From owner-svn-src-head@FreeBSD.ORG Sun May 20 02:05:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 721FD106566C; Sun, 20 May 2012 02:05:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B1A88FC0A; Sun, 20 May 2012 02:05:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4K25B9N059689; Sun, 20 May 2012 02:05:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K25Bhr059685; Sun, 20 May 2012 02:05:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205200205.q4K25Bhr059685@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 May 2012 02:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235676 - in head/sys: conf dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 02:05:11 -0000 Author: adrian Date: Sun May 20 02:05:10 2012 New Revision: 235676 URL: http://svn.freebsd.org/changeset/base/235676 Log: Migrate the bulk of the RX routines out from if_ath.c to if_ath_rx.[ch]. * migrate the rx processing out into if_ath_rx.c * migrate the TSF functions into if_ath_tsf.h, as inlines This is in prepration for supporting the EDMA RX routines, required to support the AR93xx series NICs. TODO: * ath_start() shouldn't be private, but it's called as part of the RX path. I should likely migrate ath_rx_tasklet() back into if_ath.c and then return this to be 'static'. The RX code really shouldn't need to see TX routines (and vice versa.) * ath_beacon_* should be in if_ath_beacon.[ch]. * ath_tdma_* should be in if_ath_tdma.[ch] ... Added: head/sys/dev/ath/if_ath_rx.c (contents, props changed) head/sys/dev/ath/if_ath_rx.h (contents, props changed) head/sys/dev/ath/if_ath_tsf.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_tx.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun May 20 01:40:35 2012 (r235675) +++ head/sys/conf/files Sun May 20 02:05:10 2012 (r235676) @@ -722,6 +722,8 @@ dev/ath/if_ath_tx_ht.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_sysctl.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/if_ath_rx.c optional ath \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ah_osdep.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" # Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun May 20 01:40:35 2012 (r235675) +++ head/sys/dev/ath/if_ath.c Sun May 20 02:05:10 2012 (r235676) @@ -102,10 +102,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include +#include #include #ifdef ATH_TX99_DIAG @@ -139,7 +141,6 @@ static void ath_vap_delete(struct ieee80 static void ath_init(void *); static void ath_stop_locked(struct ifnet *); static void ath_stop(struct ifnet *); -static void ath_start(struct ifnet *); static int ath_reset_vap(struct ieee80211vap *, u_long); static int ath_media_change(struct ifnet *); static void ath_watchdog(void *); @@ -151,7 +152,6 @@ static void ath_key_update_begin(struct static void ath_key_update_end(struct ieee80211vap *); static void ath_update_mcast(struct ifnet *); static void ath_update_promisc(struct ifnet *); -static void ath_mode_init(struct ath_softc *); static void ath_setslottime(struct ath_softc *); static void ath_updateslot(struct ifnet *); static int ath_beaconq_setup(struct ath_hal *); @@ -165,7 +165,6 @@ static void ath_bstuck_proc(void *, int) static void ath_reset_proc(void *, int); static void ath_beacon_return(struct ath_softc *, struct ath_buf *); static void ath_beacon_free(struct ath_softc *); -static void ath_beacon_config(struct ath_softc *, struct ieee80211vap *); static void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *, ath_bufhead *); static int ath_desc_alloc(struct ath_softc *); @@ -176,12 +175,6 @@ static void ath_node_cleanup(struct ieee static void ath_node_free(struct ieee80211_node *); static void ath_node_getsignal(const struct ieee80211_node *, int8_t *, int8_t *); -static int ath_rxbuf_init(struct ath_softc *, struct ath_buf *); -static void ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, - int subtype, int rssi, int nf); -static void ath_setdefantenna(struct ath_softc *, u_int); -static void ath_rx_proc(struct ath_softc *sc, int); -static void ath_rx_tasklet(void *, int); static void ath_txq_init(struct ath_softc *sc, struct ath_txq *, int); static struct ath_txq *ath_txq_setup(struct ath_softc*, int qtype, int subtype); static int ath_tx_setup(struct ath_softc *, int, int); @@ -194,8 +187,6 @@ static void ath_tx_proc(void *, int); static void ath_txq_sched_tasklet(void *, int); static int ath_chan_set(struct ath_softc *, struct ieee80211_channel *); static void ath_draintxq(struct ath_softc *, ATH_RESET_TYPE reset_type); -static void ath_stoprecv(struct ath_softc *, int); -static int ath_startrecv(struct ath_softc *); static void ath_chan_change(struct ath_softc *, struct ieee80211_channel *); static void ath_scan_start(struct ieee80211com *); static void ath_scan_end(struct ieee80211com *); @@ -2334,7 +2325,7 @@ ath_getbuf(struct ath_softc *sc) return bf; } -static void +void ath_start(struct ifnet *ifp) { struct ath_softc *sc = ifp->if_softc; @@ -2485,102 +2476,6 @@ ath_key_update_end(struct ieee80211vap * taskqueue_unblock(sc->sc_tq); } -/* - * Calculate the receive filter according to the - * operating mode and state: - * - * o always accept unicast, broadcast, and multicast traffic - * o accept PHY error frames when hardware doesn't have MIB support - * to count and we need them for ANI (sta mode only until recently) - * and we are not scanning (ANI is disabled) - * NB: older hal's add rx filter bits out of sight and we need to - * blindly preserve them - * o probe request frames are accepted only when operating in - * hostap, adhoc, mesh, or monitor modes - * o enable promiscuous mode - * - when in monitor mode - * - if interface marked PROMISC (assumes bridge setting is filtered) - * o accept beacons: - * - when operating in station mode for collecting rssi data when - * the station is otherwise quiet, or - * - when operating in adhoc mode so the 802.11 layer creates - * node table entries for peers, - * - when scanning - * - when doing s/w beacon miss (e.g. for ap+sta) - * - when operating in ap mode in 11g to detect overlapping bss that - * require protection - * - when operating in mesh mode to detect neighbors - * o accept control frames: - * - when in monitor mode - * XXX HT protection for 11n - */ -static u_int32_t -ath_calcrxfilter(struct ath_softc *sc) -{ - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - u_int32_t rfilt; - - rfilt = HAL_RX_FILTER_UCAST | HAL_RX_FILTER_BCAST | HAL_RX_FILTER_MCAST; - if (!sc->sc_needmib && !sc->sc_scanning) - rfilt |= HAL_RX_FILTER_PHYERR; - if (ic->ic_opmode != IEEE80211_M_STA) - rfilt |= HAL_RX_FILTER_PROBEREQ; - /* XXX ic->ic_monvaps != 0? */ - if (ic->ic_opmode == IEEE80211_M_MONITOR || (ifp->if_flags & IFF_PROMISC)) - rfilt |= HAL_RX_FILTER_PROM; - if (ic->ic_opmode == IEEE80211_M_STA || - ic->ic_opmode == IEEE80211_M_IBSS || - sc->sc_swbmiss || sc->sc_scanning) - rfilt |= HAL_RX_FILTER_BEACON; - /* - * NB: We don't recalculate the rx filter when - * ic_protmode changes; otherwise we could do - * this only when ic_protmode != NONE. - */ - if (ic->ic_opmode == IEEE80211_M_HOSTAP && - IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) - rfilt |= HAL_RX_FILTER_BEACON; - - /* - * Enable hardware PS-POLL RX only for hostap mode; - * STA mode sends PS-POLL frames but never - * receives them. - */ - if (ath_hal_getcapability(sc->sc_ah, HAL_CAP_PSPOLL, - 0, NULL) == HAL_OK && - ic->ic_opmode == IEEE80211_M_HOSTAP) - rfilt |= HAL_RX_FILTER_PSPOLL; - - if (sc->sc_nmeshvaps) { - rfilt |= HAL_RX_FILTER_BEACON; - if (sc->sc_hasbmatch) - rfilt |= HAL_RX_FILTER_BSSID; - else - rfilt |= HAL_RX_FILTER_PROM; - } - if (ic->ic_opmode == IEEE80211_M_MONITOR) - rfilt |= HAL_RX_FILTER_CONTROL; - - /* - * Enable RX of compressed BAR frames only when doing - * 802.11n. Required for A-MPDU. - */ - if (IEEE80211_IS_CHAN_HT(ic->ic_curchan)) - rfilt |= HAL_RX_FILTER_COMPBAR; - - /* - * Enable radar PHY errors if requested by the - * DFS module. - */ - if (sc->sc_dodfs) - rfilt |= HAL_RX_FILTER_PHYRADAR; - - DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x, %s if_flags 0x%x\n", - __func__, rfilt, ieee80211_opmode_name[ic->ic_opmode], ifp->if_flags); - return rfilt; -} - static void ath_update_promisc(struct ifnet *ifp) { @@ -2630,7 +2525,7 @@ ath_update_mcast(struct ifnet *ifp) __func__, mfilt[0], mfilt[1]); } -static void +void ath_mode_init(struct ath_softc *sc) { struct ifnet *ifp = sc->sc_ifp; @@ -3313,7 +3208,7 @@ ath_beacon_free(struct ath_softc *sc) * interrupt when we stop seeing beacons from the AP * we've associated with. */ -static void +void ath_beacon_config(struct ath_softc *sc, struct ieee80211vap *vap) { #define TSF_TO_TU(_h,_l) \ @@ -3788,197 +3683,10 @@ ath_node_getsignal(const struct ieee8021 *noise = -95; /* nominally correct */ } -static int -ath_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) -{ - struct ath_hal *ah = sc->sc_ah; - int error; - struct mbuf *m; - struct ath_desc *ds; - - m = bf->bf_m; - if (m == NULL) { - /* - * NB: by assigning a page to the rx dma buffer we - * implicitly satisfy the Atheros requirement that - * this buffer be cache-line-aligned and sized to be - * multiple of the cache line size. Not doing this - * causes weird stuff to happen (for the 5210 at least). - */ - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - if (m == NULL) { - DPRINTF(sc, ATH_DEBUG_ANY, - "%s: no mbuf/cluster\n", __func__); - sc->sc_stats.ast_rx_nombuf++; - return ENOMEM; - } - m->m_pkthdr.len = m->m_len = m->m_ext.ext_size; - - error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, - bf->bf_dmamap, m, - bf->bf_segs, &bf->bf_nseg, - BUS_DMA_NOWAIT); - if (error != 0) { - DPRINTF(sc, ATH_DEBUG_ANY, - "%s: bus_dmamap_load_mbuf_sg failed; error %d\n", - __func__, error); - sc->sc_stats.ast_rx_busdma++; - m_freem(m); - return error; - } - KASSERT(bf->bf_nseg == 1, - ("multi-segment packet; nseg %u", bf->bf_nseg)); - bf->bf_m = m; - } - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_PREREAD); - - /* - * Setup descriptors. For receive we always terminate - * the descriptor list with a self-linked entry so we'll - * not get overrun under high load (as can happen with a - * 5212 when ANI processing enables PHY error frames). - * - * To insure the last descriptor is self-linked we create - * each descriptor as self-linked and add it to the end. As - * each additional descriptor is added the previous self-linked - * entry is ``fixed'' naturally. This should be safe even - * if DMA is happening. When processing RX interrupts we - * never remove/process the last, self-linked, entry on the - * descriptor list. This insures the hardware always has - * someplace to write a new frame. - */ - /* - * 11N: we can no longer afford to self link the last descriptor. - * MAC acknowledges BA status as long as it copies frames to host - * buffer (or rx fifo). This can incorrectly acknowledge packets - * to a sender if last desc is self-linked. - */ - ds = bf->bf_desc; - if (sc->sc_rxslink) - ds->ds_link = bf->bf_daddr; /* link to self */ - else - ds->ds_link = 0; /* terminate the list */ - ds->ds_data = bf->bf_segs[0].ds_addr; - ath_hal_setuprxdesc(ah, ds - , m->m_len /* buffer size */ - , 0 - ); - - if (sc->sc_rxlink != NULL) - *sc->sc_rxlink = bf->bf_daddr; - sc->sc_rxlink = &ds->ds_link; - return 0; -} - -/* - * Extend 15-bit time stamp from rx descriptor to - * a full 64-bit TSF using the specified TSF. - */ -static __inline u_int64_t -ath_extend_tsf15(u_int32_t rstamp, u_int64_t tsf) -{ - if ((tsf & 0x7fff) < rstamp) - tsf -= 0x8000; - - return ((tsf &~ 0x7fff) | rstamp); -} - -/* - * Extend 32-bit time stamp from rx descriptor to - * a full 64-bit TSF using the specified TSF. - */ -static __inline u_int64_t -ath_extend_tsf32(u_int32_t rstamp, u_int64_t tsf) -{ - u_int32_t tsf_low = tsf & 0xffffffff; - u_int64_t tsf64 = (tsf & ~0xffffffffULL) | rstamp; - - if (rstamp > tsf_low && (rstamp - tsf_low > 0x10000000)) - tsf64 -= 0x100000000ULL; - - if (rstamp < tsf_low && (tsf_low - rstamp > 0x10000000)) - tsf64 += 0x100000000ULL; - - return tsf64; -} - -/* - * Extend the TSF from the RX descriptor to a full 64 bit TSF. - * Earlier hardware versions only wrote the low 15 bits of the - * TSF into the RX descriptor; later versions (AR5416 and up) - * include the 32 bit TSF value. - */ -static __inline u_int64_t -ath_extend_tsf(struct ath_softc *sc, u_int32_t rstamp, u_int64_t tsf) -{ - if (sc->sc_rxtsf32) - return ath_extend_tsf32(rstamp, tsf); - else - return ath_extend_tsf15(rstamp, tsf); -} - -/* - * Intercept management frames to collect beacon rssi data - * and to do ibss merges. - */ -static void -ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, - int subtype, int rssi, int nf) -{ - struct ieee80211vap *vap = ni->ni_vap; - struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; - - /* - * Call up first so subsequent work can use information - * potentially stored in the node (e.g. for ibss merge). - */ - ATH_VAP(vap)->av_recv_mgmt(ni, m, subtype, rssi, nf); - switch (subtype) { - case IEEE80211_FC0_SUBTYPE_BEACON: - /* update rssi statistics for use by the hal */ - /* XXX unlocked check against vap->iv_bss? */ - ATH_RSSI_LPF(sc->sc_halstats.ns_avgbrssi, rssi); - if (sc->sc_syncbeacon && - ni == vap->iv_bss && vap->iv_state == IEEE80211_S_RUN) { - /* - * Resync beacon timers using the tsf of the beacon - * frame we just received. - */ - ath_beacon_config(sc, vap); - } - /* fall thru... */ - case IEEE80211_FC0_SUBTYPE_PROBE_RESP: - if (vap->iv_opmode == IEEE80211_M_IBSS && - vap->iv_state == IEEE80211_S_RUN) { - uint32_t rstamp = sc->sc_lastrs->rs_tstamp; - uint64_t tsf = ath_extend_tsf(sc, rstamp, - ath_hal_gettsf64(sc->sc_ah)); - /* - * Handle ibss merge as needed; check the tsf on the - * frame before attempting the merge. The 802.11 spec - * says the station should change it's bssid to match - * the oldest station with the same ssid, where oldest - * is determined by the tsf. Note that hardware - * reconfiguration happens through callback to - * ath_newstate as the state machine will go from - * RUN -> RUN when this happens. - */ - if (le64toh(ni->ni_tstamp.tsf) >= tsf) { - DPRINTF(sc, ATH_DEBUG_STATE, - "ibss merge, rstamp %u tsf %ju " - "tstamp %ju\n", rstamp, (uintmax_t)tsf, - (uintmax_t)ni->ni_tstamp.tsf); - (void) ieee80211_ibss_merge(ni); - } - } - break; - } -} - /* * Set the default antenna. */ -static void +void ath_setdefantenna(struct ath_softc *sc, u_int antenna) { struct ath_hal *ah = sc->sc_ah; @@ -3992,538 +3700,6 @@ ath_setdefantenna(struct ath_softc *sc, } static void -ath_rx_tap(struct ifnet *ifp, struct mbuf *m, - const struct ath_rx_status *rs, u_int64_t tsf, int16_t nf) -{ -#define CHAN_HT20 htole32(IEEE80211_CHAN_HT20) -#define CHAN_HT40U htole32(IEEE80211_CHAN_HT40U) -#define CHAN_HT40D htole32(IEEE80211_CHAN_HT40D) -#define CHAN_HT (CHAN_HT20|CHAN_HT40U|CHAN_HT40D) - struct ath_softc *sc = ifp->if_softc; - const HAL_RATE_TABLE *rt; - uint8_t rix; - - rt = sc->sc_currates; - KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); - rix = rt->rateCodeToIndex[rs->rs_rate]; - sc->sc_rx_th.wr_rate = sc->sc_hwmap[rix].ieeerate; - sc->sc_rx_th.wr_flags = sc->sc_hwmap[rix].rxflags; -#ifdef AH_SUPPORT_AR5416 - sc->sc_rx_th.wr_chan_flags &= ~CHAN_HT; - if (sc->sc_rx_th.wr_rate & IEEE80211_RATE_MCS) { /* HT rate */ - struct ieee80211com *ic = ifp->if_l2com; - - if ((rs->rs_flags & HAL_RX_2040) == 0) - sc->sc_rx_th.wr_chan_flags |= CHAN_HT20; - else if (IEEE80211_IS_CHAN_HT40U(ic->ic_curchan)) - sc->sc_rx_th.wr_chan_flags |= CHAN_HT40U; - else - sc->sc_rx_th.wr_chan_flags |= CHAN_HT40D; - if ((rs->rs_flags & HAL_RX_GI) == 0) - sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_SHORTGI; - } -#endif - sc->sc_rx_th.wr_tsf = htole64(ath_extend_tsf(sc, rs->rs_tstamp, tsf)); - if (rs->rs_status & HAL_RXERR_CRC) - sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_BADFCS; - /* XXX propagate other error flags from descriptor */ - sc->sc_rx_th.wr_antnoise = nf; - sc->sc_rx_th.wr_antsignal = nf + rs->rs_rssi; - sc->sc_rx_th.wr_antenna = rs->rs_antenna; -#undef CHAN_HT -#undef CHAN_HT20 -#undef CHAN_HT40U -#undef CHAN_HT40D -} - -static void -ath_handle_micerror(struct ieee80211com *ic, - struct ieee80211_frame *wh, int keyix) -{ - struct ieee80211_node *ni; - - /* XXX recheck MIC to deal w/ chips that lie */ - /* XXX discard MIC errors on !data frames */ - ni = ieee80211_find_rxnode(ic, (const struct ieee80211_frame_min *) wh); - if (ni != NULL) { - ieee80211_notify_michael_failure(ni->ni_vap, wh, keyix); - ieee80211_free_node(ni); - } -} - -/* - * Only run the RX proc if it's not already running. - * Since this may get run as part of the reset/flush path, - * the task can't clash with an existing, running tasklet. - */ -static void -ath_rx_tasklet(void *arg, int npending) -{ - struct ath_softc *sc = arg; - - CTR1(ATH_KTR_INTR, "ath_rx_proc: pending=%d", npending); - DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: pending %u\n", __func__, npending); - ATH_PCU_LOCK(sc); - if (sc->sc_inreset_cnt > 0) { - device_printf(sc->sc_dev, - "%s: sc_inreset_cnt > 0; skipping\n", __func__); - ATH_PCU_UNLOCK(sc); - return; - } - ATH_PCU_UNLOCK(sc); - ath_rx_proc(sc, 1); -} - -static void -ath_rx_proc(struct ath_softc *sc, int resched) -{ -#define PA2DESC(_sc, _pa) \ - ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \ - ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) - struct ath_buf *bf; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - struct ath_hal *ah = sc->sc_ah; - struct ath_desc *ds; - struct ath_rx_status *rs; - struct mbuf *m; - struct ieee80211_node *ni; - int len, type, ngood; - HAL_STATUS status; - int16_t nf; - u_int64_t tsf, rstamp; - int npkts = 0; - - /* XXX we must not hold the ATH_LOCK here */ - ATH_UNLOCK_ASSERT(sc); - ATH_PCU_UNLOCK_ASSERT(sc); - - ATH_PCU_LOCK(sc); - sc->sc_rxproc_cnt++; - ATH_PCU_UNLOCK(sc); - - DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: called\n", __func__); - ngood = 0; - nf = ath_hal_getchannoise(ah, sc->sc_curchan); - sc->sc_stats.ast_rx_noise = nf; - tsf = ath_hal_gettsf64(ah); - do { - bf = TAILQ_FIRST(&sc->sc_rxbuf); - if (sc->sc_rxslink && bf == NULL) { /* NB: shouldn't happen */ - if_printf(ifp, "%s: no buffer!\n", __func__); - break; - } else if (bf == NULL) { - /* - * End of List: - * this can happen for non-self-linked RX chains - */ - sc->sc_stats.ast_rx_hitqueueend++; - break; - } - m = bf->bf_m; - if (m == NULL) { /* NB: shouldn't happen */ - /* - * If mbuf allocation failed previously there - * will be no mbuf; try again to re-populate it. - */ - /* XXX make debug msg */ - if_printf(ifp, "%s: no mbuf!\n", __func__); - TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); - goto rx_next; - } - ds = bf->bf_desc; - if (ds->ds_link == bf->bf_daddr) { - /* NB: never process the self-linked entry at the end */ - sc->sc_stats.ast_rx_hitqueueend++; - break; - } - /* XXX sync descriptor memory */ - /* - * Must provide the virtual address of the current - * descriptor, the physical address, and the virtual - * address of the next descriptor in the h/w chain. - * This allows the HAL to look ahead to see if the - * hardware is done with a descriptor by checking the - * done bit in the following descriptor and the address - * of the current descriptor the DMA engine is working - * on. All this is necessary because of our use of - * a self-linked list to avoid rx overruns. - */ - rs = &bf->bf_status.ds_rxstat; - status = ath_hal_rxprocdesc(ah, ds, - bf->bf_daddr, PA2DESC(sc, ds->ds_link), rs); -#ifdef ATH_DEBUG - if (sc->sc_debug & ATH_DEBUG_RECV_DESC) - ath_printrxbuf(sc, bf, 0, status == HAL_OK); -#endif - if (status == HAL_EINPROGRESS) - break; - - TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); - npkts++; - - /* - * Calculate the correct 64 bit TSF given - * the TSF64 register value and rs_tstamp. - */ - rstamp = ath_extend_tsf(sc, rs->rs_tstamp, tsf); - - /* These aren't specifically errors */ -#ifdef AH_SUPPORT_AR5416 - if (rs->rs_flags & HAL_RX_GI) - sc->sc_stats.ast_rx_halfgi++; - if (rs->rs_flags & HAL_RX_2040) - sc->sc_stats.ast_rx_2040++; - if (rs->rs_flags & HAL_RX_DELIM_CRC_PRE) - sc->sc_stats.ast_rx_pre_crc_err++; - if (rs->rs_flags & HAL_RX_DELIM_CRC_POST) - sc->sc_stats.ast_rx_post_crc_err++; - if (rs->rs_flags & HAL_RX_DECRYPT_BUSY) - sc->sc_stats.ast_rx_decrypt_busy_err++; - if (rs->rs_flags & HAL_RX_HI_RX_CHAIN) - sc->sc_stats.ast_rx_hi_rx_chain++; -#endif /* AH_SUPPORT_AR5416 */ - - if (rs->rs_status != 0) { - if (rs->rs_status & HAL_RXERR_CRC) - sc->sc_stats.ast_rx_crcerr++; - if (rs->rs_status & HAL_RXERR_FIFO) - sc->sc_stats.ast_rx_fifoerr++; - if (rs->rs_status & HAL_RXERR_PHY) { - sc->sc_stats.ast_rx_phyerr++; - /* Process DFS radar events */ - if ((rs->rs_phyerr == HAL_PHYERR_RADAR) || - (rs->rs_phyerr == HAL_PHYERR_FALSE_RADAR_EXT)) { - /* Since we're touching the frame data, sync it */ - bus_dmamap_sync(sc->sc_dmat, - bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - /* Now pass it to the radar processing code */ - ath_dfs_process_phy_err(sc, mtod(m, char *), rstamp, rs); - } - - /* Be suitably paranoid about receiving phy errors out of the stats array bounds */ - if (rs->rs_phyerr < 64) - sc->sc_stats.ast_rx_phy[rs->rs_phyerr]++; - goto rx_error; /* NB: don't count in ierrors */ - } - if (rs->rs_status & HAL_RXERR_DECRYPT) { - /* - * Decrypt error. If the error occurred - * because there was no hardware key, then - * let the frame through so the upper layers - * can process it. This is necessary for 5210 - * parts which have no way to setup a ``clear'' - * key cache entry. - * - * XXX do key cache faulting - */ - if (rs->rs_keyix == HAL_RXKEYIX_INVALID) - goto rx_accept; - sc->sc_stats.ast_rx_badcrypt++; - } - if (rs->rs_status & HAL_RXERR_MIC) { - sc->sc_stats.ast_rx_badmic++; - /* - * Do minimal work required to hand off - * the 802.11 header for notification. - */ - /* XXX frag's and qos frames */ - len = rs->rs_datalen; - if (len >= sizeof (struct ieee80211_frame)) { - bus_dmamap_sync(sc->sc_dmat, - bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - ath_handle_micerror(ic, - mtod(m, struct ieee80211_frame *), - sc->sc_splitmic ? - rs->rs_keyix-32 : rs->rs_keyix); - } - } - ifp->if_ierrors++; -rx_error: - /* - * Cleanup any pending partial frame. - */ - if (sc->sc_rxpending != NULL) { - m_freem(sc->sc_rxpending); - sc->sc_rxpending = NULL; - } - /* - * When a tap is present pass error frames - * that have been requested. By default we - * pass decrypt+mic errors but others may be - * interesting (e.g. crc). - */ - if (ieee80211_radiotap_active(ic) && - (rs->rs_status & sc->sc_monpass)) { - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - /* NB: bpf needs the mbuf length setup */ - len = rs->rs_datalen; - m->m_pkthdr.len = m->m_len = len; - bf->bf_m = NULL; - ath_rx_tap(ifp, m, rs, rstamp, nf); - ieee80211_radiotap_rx_all(ic, m); - m_freem(m); - } - /* XXX pass MIC errors up for s/w reclaculation */ - goto rx_next; - } -rx_accept: - /* - * Sync and unmap the frame. At this point we're - * committed to passing the mbuf somewhere so clear - * bf_m; this means a new mbuf must be allocated - * when the rx descriptor is setup again to receive - * another frame. - */ - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - bf->bf_m = NULL; - - len = rs->rs_datalen; - m->m_len = len; - - if (rs->rs_more) { - /* - * Frame spans multiple descriptors; save - * it for the next completed descriptor, it - * will be used to construct a jumbogram. - */ - if (sc->sc_rxpending != NULL) { - /* NB: max frame size is currently 2 clusters */ - sc->sc_stats.ast_rx_toobig++; - m_freem(sc->sc_rxpending); - } - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = len; - sc->sc_rxpending = m; - goto rx_next; - } else if (sc->sc_rxpending != NULL) { - /* - * This is the second part of a jumbogram, - * chain it to the first mbuf, adjust the - * frame length, and clear the rxpending state. - */ - sc->sc_rxpending->m_next = m; - sc->sc_rxpending->m_pkthdr.len += len; - m = sc->sc_rxpending; - sc->sc_rxpending = NULL; - } else { - /* - * Normal single-descriptor receive; setup - * the rcvif and packet length. - */ - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = len; - } - - /* - * Validate rs->rs_antenna. - * - * Some users w/ AR9285 NICs have reported crashes - * here because rs_antenna field is bogusly large. - * Let's enforce the maximum antenna limit of 8 - * (and it shouldn't be hard coded, but that's a - * separate problem) and if there's an issue, print - * out an error and adjust rs_antenna to something - * sensible. - * - * This code should be removed once the actual - * root cause of the issue has been identified. - * For example, it may be that the rs_antenna - * field is only valid for the lsat frame of - * an aggregate and it just happens that it is - * "mostly" right. (This is a general statement - - * the majority of the statistics are only valid - * for the last frame in an aggregate. - */ - if (rs->rs_antenna > 7) { - device_printf(sc->sc_dev, "%s: rs_antenna > 7 (%d)\n", - __func__, rs->rs_antenna); -#ifdef ATH_DEBUG - ath_printrxbuf(sc, bf, 0, status == HAL_OK); -#endif /* ATH_DEBUG */ - rs->rs_antenna = 0; /* XXX better than nothing */ - } - - ifp->if_ipackets++; - sc->sc_stats.ast_ant_rx[rs->rs_antenna]++; - - /* - * Populate the rx status block. When there are bpf - * listeners we do the additional work to provide - * complete status. Otherwise we fill in only the - * material required by ieee80211_input. Note that - * noise setting is filled in above. - */ - if (ieee80211_radiotap_active(ic)) - ath_rx_tap(ifp, m, rs, rstamp, nf); - - /* - * From this point on we assume the frame is at least - * as large as ieee80211_frame_min; verify that. - */ - if (len < IEEE80211_MIN_LEN) { - if (!ieee80211_radiotap_active(ic)) { - DPRINTF(sc, ATH_DEBUG_RECV, - "%s: short packet %d\n", __func__, len); - sc->sc_stats.ast_rx_tooshort++; - } else { - /* NB: in particular this captures ack's */ - ieee80211_radiotap_rx_all(ic, m); - } - m_freem(m); - goto rx_next; - } - - if (IFF_DUMPPKTS(sc, ATH_DEBUG_RECV)) { - const HAL_RATE_TABLE *rt = sc->sc_currates; - uint8_t rix = rt->rateCodeToIndex[rs->rs_rate]; - - ieee80211_dump_pkt(ic, mtod(m, caddr_t), len, - sc->sc_hwmap[rix].ieeerate, rs->rs_rssi); - } - - m_adj(m, -IEEE80211_CRC_LEN); - - /* - * Locate the node for sender, track state, and then - * pass the (referenced) node up to the 802.11 layer - * for its use. - */ - ni = ieee80211_find_rxnode_withkey(ic, - mtod(m, const struct ieee80211_frame_min *), - rs->rs_keyix == HAL_RXKEYIX_INVALID ? - IEEE80211_KEYIX_NONE : rs->rs_keyix); - sc->sc_lastrs = rs; - -#ifdef AH_SUPPORT_AR5416 - if (rs->rs_isaggr) - sc->sc_stats.ast_rx_agg++; -#endif /* AH_SUPPORT_AR5416 */ - - if (ni != NULL) { - /* - * Only punt packets for ampdu reorder processing for - * 11n nodes; net80211 enforces that M_AMPDU is only - * set for 11n nodes. - */ - if (ni->ni_flags & IEEE80211_NODE_HT) - m->m_flags |= M_AMPDU; - - /* - * Sending station is known, dispatch directly. - */ - type = ieee80211_input(ni, m, rs->rs_rssi, nf); - ieee80211_free_node(ni); - /* - * Arrange to update the last rx timestamp only for - * frames from our ap when operating in station mode. - * This assumes the rx key is always setup when - * associated. - */ - if (ic->ic_opmode == IEEE80211_M_STA && - rs->rs_keyix != HAL_RXKEYIX_INVALID) - ngood++; - } else { - type = ieee80211_input_all(ic, m, rs->rs_rssi, nf); - } - /* - * Track rx rssi and do any rx antenna management. - */ - ATH_RSSI_LPF(sc->sc_halstats.ns_avgrssi, rs->rs_rssi); - if (sc->sc_diversity) { - /* - * When using fast diversity, change the default rx - * antenna if diversity chooses the other antenna 3 - * times in a row. - */ - if (sc->sc_defant != rs->rs_antenna) { - if (++sc->sc_rxotherant >= 3) - ath_setdefantenna(sc, rs->rs_antenna); - } else - sc->sc_rxotherant = 0; - } - - /* Newer school diversity - kite specific for now */ - /* XXX perhaps migrate the normal diversity code to this? */ - if ((ah)->ah_rxAntCombDiversity) - (*(ah)->ah_rxAntCombDiversity)(ah, rs, ticks, hz); - - if (sc->sc_softled) { - /* - * Blink for any data frame. Otherwise do a - * heartbeat-style blink when idle. The latter - * is mainly for station mode where we depend on - * periodic beacon frames to trigger the poll event. - */ - if (type == IEEE80211_FC0_TYPE_DATA) { - const HAL_RATE_TABLE *rt = sc->sc_currates; - ath_led_event(sc, - rt->rateCodeToIndex[rs->rs_rate]); - } else if (ticks - sc->sc_ledevent >= sc->sc_ledidle) - ath_led_event(sc, 0); - } -rx_next: - TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); - } while (ath_rxbuf_init(sc, bf) == 0); - - /* rx signal state monitoring */ - ath_hal_rxmonitor(ah, &sc->sc_halstats, sc->sc_curchan); - if (ngood) - sc->sc_lastrx = tsf; - - CTR2(ATH_KTR_INTR, "ath_rx_proc: npkts=%d, ngood=%d", npkts, ngood); - /* Queue DFS tasklet if needed */ - if (resched && ath_dfs_tasklet_needed(sc, sc->sc_curchan)) - taskqueue_enqueue(sc->sc_tq, &sc->sc_dfstask); - - /* - * Now that all the RX frames were handled that - * need to be handled, kick the PCU if there's - * been an RXEOL condition. - */ - ATH_PCU_LOCK(sc); - if (resched && sc->sc_kickpcu) { - CTR0(ATH_KTR_ERR, "ath_rx_proc: kickpcu"); - device_printf(sc->sc_dev, "%s: kickpcu; handled %d packets\n", - __func__, npkts); - - /* XXX rxslink? */ - /* - * XXX can we hold the PCU lock here? - * Are there any net80211 buffer calls involved? - */ - bf = TAILQ_FIRST(&sc->sc_rxbuf); - ath_hal_putrxbuf(ah, bf->bf_daddr); - ath_hal_rxena(ah); /* enable recv descriptors */ - ath_mode_init(sc); /* set filters, etc. */ - ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */ - - ath_hal_intrset(ah, sc->sc_imask); - sc->sc_kickpcu = 0; - } - ATH_PCU_UNLOCK(sc); - - /* XXX check this inside of IF_LOCK? */ - if (resched && (ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { -#ifdef IEEE80211_SUPPORT_SUPERG - ieee80211_ff_age_all(ic, 100); -#endif - if (!IFQ_IS_EMPTY(&ifp->if_snd)) - ath_start(ifp); - } -#undef PA2DESC - - ATH_PCU_LOCK(sc); - sc->sc_rxproc_cnt--; - ATH_PCU_UNLOCK(sc); -} - -static void ath_txq_init(struct ath_softc *sc, struct ath_txq *txq, int qnum) { txq->axq_qnum = qnum; @@ -5404,87 +4580,6 @@ ath_draintxq(struct ath_softc *sc, ATH_R } /* - * Disable the receive h/w in preparation for a reset. - */ -static void -ath_stoprecv(struct ath_softc *sc, int dodelay) -{ -#define PA2DESC(_sc, _pa) \ - ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \ - ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) - struct ath_hal *ah = sc->sc_ah; - - ath_hal_stoppcurecv(ah); /* disable PCU */ - ath_hal_setrxfilter(ah, 0); /* clear recv filter */ - ath_hal_stopdmarecv(ah); /* disable DMA engine */ - /* - * TODO: see if this particular DELAY() is required; it may be - * masking some missing FIFO flush or DMA sync. - */ -#if 0 - if (dodelay) -#endif - DELAY(3000); /* 3ms is long enough for 1 frame */ -#ifdef ATH_DEBUG - if (sc->sc_debug & (ATH_DEBUG_RESET | ATH_DEBUG_FATAL)) { - struct ath_buf *bf; - u_int ix; - - device_printf(sc->sc_dev, - "%s: rx queue %p, link %p\n", - __func__, - (caddr_t)(uintptr_t) ath_hal_getrxbuf(ah), - sc->sc_rxlink); - ix = 0; - TAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { - struct ath_desc *ds = bf->bf_desc; - struct ath_rx_status *rs = &bf->bf_status.ds_rxstat; - HAL_STATUS status = ath_hal_rxprocdesc(ah, ds, - bf->bf_daddr, PA2DESC(sc, ds->ds_link), rs); - if (status == HAL_OK || (sc->sc_debug & ATH_DEBUG_FATAL)) - ath_printrxbuf(sc, bf, ix, status == HAL_OK); - ix++; - } - } -#endif - if (sc->sc_rxpending != NULL) { - m_freem(sc->sc_rxpending); - sc->sc_rxpending = NULL; - } - sc->sc_rxlink = NULL; /* just in case */ -#undef PA2DESC -} - -/* - * Enable the receive h/w following a reset. - */ -static int -ath_startrecv(struct ath_softc *sc) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun May 20 02:05:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1B0010657FF; Sun, 20 May 2012 02:05:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD0988FC0A; Sun, 20 May 2012 02:05:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4K25QAr059735; Sun, 20 May 2012 02:05:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K25Q6E059733; Sun, 20 May 2012 02:05:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205200205.q4K25Q6E059733@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 May 2012 02:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235677 - head/sys/modules/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 02:05:27 -0000 Author: adrian Date: Sun May 20 02:05:25 2012 New Revision: 235677 URL: http://svn.freebsd.org/changeset/base/235677 Log: .. and update this. Modified: head/sys/modules/ath/Makefile Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Sun May 20 02:05:10 2012 (r235676) +++ head/sys/modules/ath/Makefile Sun May 20 02:05:25 2012 (r235677) @@ -36,7 +36,7 @@ ATH_RATE?= sample # tx rate control alg KMOD= if_ath SRCS= if_ath.c if_ath_debug.c if_ath_keycache.c if_ath_sysctl.c -SRCS+= if_ath_tx.c if_ath_tx_ht.c if_ath_led.c +SRCS+= if_ath_tx.c if_ath_tx_ht.c if_ath_led.c if_ath_rx.c # NB: v3 eeprom support used by both AR5211 and AR5212; just include it SRCS+= ah_osdep.c ah.c ah_regdomain.c ah_eeprom_v3.c SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h From owner-svn-src-head@FreeBSD.ORG Sun May 20 02:43:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00012106566B; Sun, 20 May 2012 02:43:55 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A39368FC08; Sun, 20 May 2012 02:43:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4K2htoC061453; Sun, 20 May 2012 02:43:55 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K2hsXA061451; Sun, 20 May 2012 02:43:54 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201205200243.q4K2hsXA061451@svn.freebsd.org> From: Justin Hibbits Date: Sun, 20 May 2012 02:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235678 - head/sys/dev/powermac_nvram X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 02:43:56 -0000 Author: jhibbits Date: Sun May 20 02:43:54 2012 New Revision: 235678 URL: http://svn.freebsd.org/changeset/base/235678 Log: "nvram,flash" may not be the first in the compatible list property of the nvram ofw node, so check all strings in the list. Approved by: nwhitehorn (mentor) MFC after: 3 days Modified: head/sys/dev/powermac_nvram/powermac_nvram.c Modified: head/sys/dev/powermac_nvram/powermac_nvram.c ============================================================================== --- head/sys/dev/powermac_nvram/powermac_nvram.c Sun May 20 02:05:25 2012 (r235677) +++ head/sys/dev/powermac_nvram/powermac_nvram.c Sun May 20 02:43:54 2012 (r235678) @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -118,7 +119,7 @@ powermac_nvram_probe(device_t dev) if (strcmp(type, "nvram") != 0) return ENXIO; if (strcmp(compatible, "amd-0137") != 0 && - strcmp(compatible, "nvram,flash") != 0) + !ofw_bus_is_compatible(dev, "nvram,flash")) return ENXIO; device_set_desc(dev, "Apple NVRAM"); From owner-svn-src-head@FreeBSD.ORG Sun May 20 02:49:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51120106566C; Sun, 20 May 2012 02:49:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39B878FC08; Sun, 20 May 2012 02:49:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4K2ngED061747; Sun, 20 May 2012 02:49:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K2ngrP061738; Sun, 20 May 2012 02:49:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205200249.q4K2ngrP061738@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 May 2012 02:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235679 - in head/sys: conf dev/ath modules/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 02:49:43 -0000 Author: adrian Date: Sun May 20 02:49:42 2012 New Revision: 235679 URL: http://svn.freebsd.org/changeset/base/235679 Log: Migrate the TDMA management functions out of if_ath.c into if_ath_tdma.c. There's some TX path TDMA code in if_ath_tx.c which should be migrated out, but first I should likely try and verify/fix/repair the TDMA support in 9.x and -HEAD. Added: head/sys/dev/ath/if_ath_beacon.h (contents, props changed) head/sys/dev/ath/if_ath_tdma.c (contents, props changed) head/sys/dev/ath/if_ath_tdma.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_rx.c head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun May 20 02:43:54 2012 (r235678) +++ head/sys/conf/files Sun May 20 02:49:42 2012 (r235679) @@ -720,6 +720,8 @@ dev/ath/if_ath_tx.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_tx_ht.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/if_ath_tdma.c optional ath \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_sysctl.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_rx.c optional ath \ Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun May 20 02:43:54 2012 (r235678) +++ head/sys/dev/ath/if_ath.c Sun May 20 02:49:42 2012 (r235679) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef ATH_TX99_DIAG @@ -159,8 +160,6 @@ static int ath_beacon_alloc(struct ath_s static void ath_beacon_update(struct ieee80211vap *, int item); static void ath_beacon_setup(struct ath_softc *, struct ath_buf *); static void ath_beacon_proc(void *, int); -static struct ath_buf *ath_beacon_generate(struct ath_softc *, - struct ieee80211vap *); static void ath_bstuck_proc(void *, int); static void ath_reset_proc(void *, int); static void ath_beacon_return(struct ath_softc *, struct ath_buf *); @@ -178,7 +177,6 @@ static void ath_node_getsignal(const str static void ath_txq_init(struct ath_softc *sc, struct ath_txq *, int); static struct ath_txq *ath_txq_setup(struct ath_softc*, int qtype, int subtype); static int ath_tx_setup(struct ath_softc *, int, int); -static int ath_wme_update(struct ieee80211com *); static void ath_tx_cleanupq(struct ath_softc *, struct ath_txq *); static void ath_tx_cleanup(struct ath_softc *); static void ath_tx_proc_q0(void *, int); @@ -213,16 +211,10 @@ static void ath_announce(struct ath_soft static void ath_dfs_tasklet(void *, int); #ifdef IEEE80211_SUPPORT_TDMA -static void ath_tdma_settimers(struct ath_softc *sc, u_int32_t nexttbtt, - u_int32_t bintval); -static void ath_tdma_bintvalsetup(struct ath_softc *sc, - const struct ieee80211_tdma_state *tdma); -static void ath_tdma_config(struct ath_softc *sc, struct ieee80211vap *vap); -static void ath_tdma_update(struct ieee80211_node *ni, - const struct ieee80211_tdma_param *tdma, int); -static void ath_tdma_beacon_send(struct ath_softc *sc, - struct ieee80211vap *vap); +#include +#endif +#if 0 #define TDMA_EP_MULTIPLIER (1<<10) /* pow2 to optimize out * and / */ #define TDMA_LPF_LEN 6 #define TDMA_DUMMY_MARKER 0x127 @@ -263,7 +255,7 @@ SYSCTL_INT(_hw_ath, OID_AUTO, txbuf, CTL 0, "tx buffers allocated"); TUNABLE_INT("hw.ath.txbuf", &ath_txbuf); -static int ath_bstuck_threshold = 4; /* max missed beacons */ +int ath_bstuck_threshold = 4; /* max missed beacons */ SYSCTL_INT(_hw_ath, OID_AUTO, bstuck, CTLFLAG_RW, &ath_bstuck_threshold, 0, "max missed beacon xmits before chip reset"); @@ -2621,7 +2613,7 @@ ath_beaconq_setup(struct ath_hal *ah) /* * Setup the transmit queue parameters for the beacon queue. */ -static int +int ath_beaconq_config(struct ath_softc *sc) { #define ATH_EXPONENT_TO_VALUE(v) ((1<<(v))-1) @@ -2976,7 +2968,7 @@ ath_beacon_proc(void *arg, int pending) } } -static struct ath_buf * +struct ath_buf * ath_beacon_generate(struct ath_softc *sc, struct ieee80211vap *vap) { struct ath_vap *avp = ATH_VAP(vap); @@ -3876,7 +3868,7 @@ ath_txq_update(struct ath_softc *sc, int /* * Callback from the 802.11 layer to update WME parameters. */ -static int +int ath_wme_update(struct ieee80211com *ic) { struct ath_softc *sc = ic->ic_ifp->if_softc; @@ -5650,357 +5642,6 @@ ath_announce(struct ath_softc *sc) if_printf(ifp, "using multicast key search\n"); } -#ifdef IEEE80211_SUPPORT_TDMA -static void -ath_tdma_settimers(struct ath_softc *sc, u_int32_t nexttbtt, u_int32_t bintval) -{ - struct ath_hal *ah = sc->sc_ah; - HAL_BEACON_TIMERS bt; - - bt.bt_intval = bintval | HAL_BEACON_ENA; - bt.bt_nexttbtt = nexttbtt; - bt.bt_nextdba = (nexttbtt<<3) - sc->sc_tdmadbaprep; - bt.bt_nextswba = (nexttbtt<<3) - sc->sc_tdmaswbaprep; - bt.bt_nextatim = nexttbtt+1; - /* Enables TBTT, DBA, SWBA timers by default */ - bt.bt_flags = 0; - ath_hal_beaconsettimers(ah, &bt); -} - -/* - * Calculate the beacon interval. This is periodic in the - * superframe for the bss. We assume each station is configured - * identically wrt transmit rate so the guard time we calculate - * above will be the same on all stations. Note we need to - * factor in the xmit time because the hardware will schedule - * a frame for transmit if the start of the frame is within - * the burst time. When we get hardware that properly kills - * frames in the PCU we can reduce/eliminate the guard time. - * - * Roundup to 1024 is so we have 1 TU buffer in the guard time - * to deal with the granularity of the nexttbtt timer. 11n MAC's - * with 1us timer granularity should allow us to reduce/eliminate - * this. - */ -static void -ath_tdma_bintvalsetup(struct ath_softc *sc, - const struct ieee80211_tdma_state *tdma) -{ - /* copy from vap state (XXX check all vaps have same value?) */ - sc->sc_tdmaslotlen = tdma->tdma_slotlen; - - sc->sc_tdmabintval = roundup((sc->sc_tdmaslotlen+sc->sc_tdmaguard) * - tdma->tdma_slotcnt, 1024); - sc->sc_tdmabintval >>= 10; /* TSF -> TU */ - if (sc->sc_tdmabintval & 1) - sc->sc_tdmabintval++; - - if (tdma->tdma_slot == 0) { - /* - * Only slot 0 beacons; other slots respond. - */ - sc->sc_imask |= HAL_INT_SWBA; - sc->sc_tdmaswba = 0; /* beacon immediately */ - } else { - /* XXX all vaps must be slot 0 or slot !0 */ - sc->sc_imask &= ~HAL_INT_SWBA; - } -} - -/* - * Max 802.11 overhead. This assumes no 4-address frames and - * the encapsulation done by ieee80211_encap (llc). We also - * include potential crypto overhead. - */ -#define IEEE80211_MAXOVERHEAD \ - (sizeof(struct ieee80211_qosframe) \ - + sizeof(struct llc) \ - + IEEE80211_ADDR_LEN \ - + IEEE80211_WEP_IVLEN \ - + IEEE80211_WEP_KIDLEN \ - + IEEE80211_WEP_CRCLEN \ - + IEEE80211_WEP_MICLEN \ - + IEEE80211_CRC_LEN) - -/* - * Setup initially for tdma operation. Start the beacon - * timers and enable SWBA if we are slot 0. Otherwise - * we wait for slot 0 to arrive so we can sync up before - * starting to transmit. - */ -static void -ath_tdma_config(struct ath_softc *sc, struct ieee80211vap *vap) -{ - struct ath_hal *ah = sc->sc_ah; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - const struct ieee80211_txparam *tp; - const struct ieee80211_tdma_state *tdma = NULL; - int rix; - - if (vap == NULL) { - vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */ - if (vap == NULL) { - if_printf(ifp, "%s: no vaps?\n", __func__); - return; - } - } - /* XXX should take a locked ref to iv_bss */ - tp = vap->iv_bss->ni_txparms; - /* - * Calculate the guard time for each slot. This is the - * time to send a maximal-size frame according to the - * fixed/lowest transmit rate. Note that the interface - * mtu does not include the 802.11 overhead so we must - * tack that on (ath_hal_computetxtime includes the - * preamble and plcp in it's calculation). - */ - tdma = vap->iv_tdma; - if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) - rix = ath_tx_findrix(sc, tp->ucastrate); - else - rix = ath_tx_findrix(sc, tp->mcastrate); - /* XXX short preamble assumed */ - sc->sc_tdmaguard = ath_hal_computetxtime(ah, sc->sc_currates, - ifp->if_mtu + IEEE80211_MAXOVERHEAD, rix, AH_TRUE); - - ath_hal_intrset(ah, 0); - - ath_beaconq_config(sc); /* setup h/w beacon q */ - if (sc->sc_setcca) - ath_hal_setcca(ah, AH_FALSE); /* disable CCA */ - ath_tdma_bintvalsetup(sc, tdma); /* calculate beacon interval */ - ath_tdma_settimers(sc, sc->sc_tdmabintval, - sc->sc_tdmabintval | HAL_BEACON_RESET_TSF); - sc->sc_syncbeacon = 0; - - sc->sc_avgtsfdeltap = TDMA_DUMMY_MARKER; - sc->sc_avgtsfdeltam = TDMA_DUMMY_MARKER; - - ath_hal_intrset(ah, sc->sc_imask); - - DPRINTF(sc, ATH_DEBUG_TDMA, "%s: slot %u len %uus cnt %u " - "bsched %u guard %uus bintval %u TU dba prep %u\n", __func__, - tdma->tdma_slot, tdma->tdma_slotlen, tdma->tdma_slotcnt, - tdma->tdma_bintval, sc->sc_tdmaguard, sc->sc_tdmabintval, - sc->sc_tdmadbaprep); -} - -/* - * Update tdma operation. Called from the 802.11 layer - * when a beacon is received from the TDMA station operating - * in the slot immediately preceding us in the bss. Use - * the rx timestamp for the beacon frame to update our - * beacon timers so we follow their schedule. Note that - * by using the rx timestamp we implicitly include the - * propagation delay in our schedule. - */ -static void -ath_tdma_update(struct ieee80211_node *ni, - const struct ieee80211_tdma_param *tdma, int changed) -{ -#define TSF_TO_TU(_h,_l) \ - ((((u_int32_t)(_h)) << 22) | (((u_int32_t)(_l)) >> 10)) -#define TU_TO_TSF(_tu) (((u_int64_t)(_tu)) << 10) - struct ieee80211vap *vap = ni->ni_vap; - struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; - struct ath_hal *ah = sc->sc_ah; - const HAL_RATE_TABLE *rt = sc->sc_currates; - u_int64_t tsf, rstamp, nextslot, nexttbtt; - u_int32_t txtime, nextslottu; - int32_t tudelta, tsfdelta; - const struct ath_rx_status *rs; - int rix; - - sc->sc_stats.ast_tdma_update++; - - /* - * Check for and adopt configuration changes. - */ - if (changed != 0) { - const struct ieee80211_tdma_state *ts = vap->iv_tdma; - - ath_tdma_bintvalsetup(sc, ts); - if (changed & TDMA_UPDATE_SLOTLEN) - ath_wme_update(ic); - - DPRINTF(sc, ATH_DEBUG_TDMA, - "%s: adopt slot %u slotcnt %u slotlen %u us " - "bintval %u TU\n", __func__, - ts->tdma_slot, ts->tdma_slotcnt, ts->tdma_slotlen, - sc->sc_tdmabintval); - - /* XXX right? */ - ath_hal_intrset(ah, sc->sc_imask); - /* NB: beacon timers programmed below */ - } - - /* extend rx timestamp to 64 bits */ - rs = sc->sc_lastrs; - tsf = ath_hal_gettsf64(ah); - rstamp = ath_extend_tsf(sc, rs->rs_tstamp, tsf); - /* - * The rx timestamp is set by the hardware on completing - * reception (at the point where the rx descriptor is DMA'd - * to the host). To find the start of our next slot we - * must adjust this time by the time required to send - * the packet just received. - */ - rix = rt->rateCodeToIndex[rs->rs_rate]; - txtime = ath_hal_computetxtime(ah, rt, rs->rs_datalen, rix, - rt->info[rix].shortPreamble); - /* NB: << 9 is to cvt to TU and /2 */ - nextslot = (rstamp - txtime) + (sc->sc_tdmabintval << 9); - nextslottu = TSF_TO_TU(nextslot>>32, nextslot) & HAL_BEACON_PERIOD; - - /* - * Retrieve the hardware NextTBTT in usecs - * and calculate the difference between what the - * other station thinks and what we have programmed. This - * lets us figure how to adjust our timers to match. The - * adjustments are done by pulling the TSF forward and possibly - * rewriting the beacon timers. - */ - nexttbtt = ath_hal_getnexttbtt(ah); - tsfdelta = (int32_t)((nextslot % TU_TO_TSF(HAL_BEACON_PERIOD + 1)) - nexttbtt); - - DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, - "tsfdelta %d avg +%d/-%d\n", tsfdelta, - TDMA_AVG(sc->sc_avgtsfdeltap), TDMA_AVG(sc->sc_avgtsfdeltam)); - - if (tsfdelta < 0) { - TDMA_SAMPLE(sc->sc_avgtsfdeltap, 0); - TDMA_SAMPLE(sc->sc_avgtsfdeltam, -tsfdelta); - tsfdelta = -tsfdelta % 1024; - nextslottu++; - } else if (tsfdelta > 0) { - TDMA_SAMPLE(sc->sc_avgtsfdeltap, tsfdelta); - TDMA_SAMPLE(sc->sc_avgtsfdeltam, 0); - tsfdelta = 1024 - (tsfdelta % 1024); - nextslottu++; - } else { - TDMA_SAMPLE(sc->sc_avgtsfdeltap, 0); - TDMA_SAMPLE(sc->sc_avgtsfdeltam, 0); - } - tudelta = nextslottu - TSF_TO_TU(nexttbtt >> 32, nexttbtt); - - /* - * Copy sender's timetstamp into tdma ie so they can - * calculate roundtrip time. We submit a beacon frame - * below after any timer adjustment. The frame goes out - * at the next TBTT so the sender can calculate the - * roundtrip by inspecting the tdma ie in our beacon frame. - * - * NB: This tstamp is subtlely preserved when - * IEEE80211_BEACON_TDMA is marked (e.g. when the - * slot position changes) because ieee80211_add_tdma - * skips over the data. - */ - memcpy(ATH_VAP(vap)->av_boff.bo_tdma + - __offsetof(struct ieee80211_tdma_param, tdma_tstamp), - &ni->ni_tstamp.data, 8); -#if 0 - DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, - "tsf %llu nextslot %llu (%d, %d) nextslottu %u nexttbtt %llu (%d)\n", - (unsigned long long) tsf, (unsigned long long) nextslot, - (int)(nextslot - tsf), tsfdelta, nextslottu, nexttbtt, tudelta); -#endif - /* - * Adjust the beacon timers only when pulling them forward - * or when going back by less than the beacon interval. - * Negative jumps larger than the beacon interval seem to - * cause the timers to stop and generally cause instability. - * This basically filters out jumps due to missed beacons. - */ - if (tudelta != 0 && (tudelta > 0 || -tudelta < sc->sc_tdmabintval)) { - ath_tdma_settimers(sc, nextslottu, sc->sc_tdmabintval); - sc->sc_stats.ast_tdma_timers++; - } - if (tsfdelta > 0) { - ath_hal_adjusttsf(ah, tsfdelta); - sc->sc_stats.ast_tdma_tsf++; - } - ath_tdma_beacon_send(sc, vap); /* prepare response */ -#undef TU_TO_TSF -#undef TSF_TO_TU -} - -/* - * Transmit a beacon frame at SWBA. Dynamic updates - * to the frame contents are done as needed. - */ -static void -ath_tdma_beacon_send(struct ath_softc *sc, struct ieee80211vap *vap) -{ - struct ath_hal *ah = sc->sc_ah; - struct ath_buf *bf; - int otherant; - - /* - * Check if the previous beacon has gone out. If - * not don't try to post another, skip this period - * and wait for the next. Missed beacons indicate - * a problem and should not occur. If we miss too - * many consecutive beacons reset the device. - */ - if (ath_hal_numtxpending(ah, sc->sc_bhalq) != 0) { - sc->sc_bmisscount++; - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: missed %u consecutive beacons\n", - __func__, sc->sc_bmisscount); - if (sc->sc_bmisscount >= ath_bstuck_threshold) - taskqueue_enqueue(sc->sc_tq, &sc->sc_bstucktask); - return; - } - if (sc->sc_bmisscount != 0) { - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: resume beacon xmit after %u misses\n", - __func__, sc->sc_bmisscount); - sc->sc_bmisscount = 0; - } - - /* - * Check recent per-antenna transmit statistics and flip - * the default antenna if noticeably more frames went out - * on the non-default antenna. - * XXX assumes 2 anntenae - */ - if (!sc->sc_diversity) { - otherant = sc->sc_defant & 1 ? 2 : 1; - if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_defant] + 2) - ath_setdefantenna(sc, otherant); - sc->sc_ant_tx[1] = sc->sc_ant_tx[2] = 0; - } - - bf = ath_beacon_generate(sc, vap); - if (bf != NULL) { - /* - * Stop any current dma and put the new frame on the queue. - * This should never fail since we check above that no frames - * are still pending on the queue. - */ - if (!ath_hal_stoptxdma(ah, sc->sc_bhalq)) { - DPRINTF(sc, ATH_DEBUG_ANY, - "%s: beacon queue %u did not stop?\n", - __func__, sc->sc_bhalq); - /* NB: the HAL still stops DMA, so proceed */ - } - ath_hal_puttxbuf(ah, sc->sc_bhalq, bf->bf_daddr); - ath_hal_txstart(ah, sc->sc_bhalq); - - sc->sc_stats.ast_be_xmit++; /* XXX per-vap? */ - - /* - * Record local TSF for our last send for use - * in arbitrating slot collisions. - */ - /* XXX should take a locked ref to iv_bss */ - vap->iv_bss->ni_tstamp.tsf = ath_hal_gettsf64(ah); - } -} -#endif /* IEEE80211_SUPPORT_TDMA */ - static void ath_dfs_tasklet(void *p, int npending) { Added: head/sys/dev/ath/if_ath_beacon.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_beacon.h Sun May 20 02:49:42 2012 (r235679) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#ifndef __IF_ATH_BEACON_H__ +#define __IF_ATH_BEACON_H__ + +extern int ath_bstuck_threshold; + +extern int ath_beaconq_config(struct ath_softc *sc); +extern void ath_beacon_config(struct ath_softc *sc, + struct ieee80211vap *vap); +extern struct ath_buf * ath_beacon_generate(struct ath_softc *sc, + struct ieee80211vap *vap); +extern int ath_wme_update(struct ieee80211com *ic); + +#endif Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Sun May 20 02:43:54 2012 (r235678) +++ head/sys/dev/ath/if_ath_misc.h Sun May 20 02:49:42 2012 (r235679) @@ -80,6 +80,4 @@ extern void ath_setdefantenna(struct ath */ extern void ath_start(struct ifnet *ifp); -extern void ath_beacon_config(struct ath_softc *sc, struct ieee80211vap *vap); - #endif Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun May 20 02:43:54 2012 (r235678) +++ head/sys/dev/ath/if_ath_rx.c Sun May 20 02:49:42 2012 (r235679) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef ATH_TX99_DIAG Added: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_tdma.c Sun May 20 02:49:42 2012 (r235679) @@ -0,0 +1,476 @@ +/*- + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for the Atheros Wireless LAN controller. + * + * This software is derived from work of Atsushi Onoe; his contribution + * is greatly appreciated. + */ + +#include "opt_inet.h" +#include "opt_ath.h" +/* + * This is needed for register operations which are performed + * by the driver - eg, calls to ath_hal_gettsf32(). + * + * It's also required for any AH_DEBUG checks in here, eg the + * module dependencies. + */ +#include "opt_ah.h" +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* for mp_ncpus */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#ifdef IEEE80211_SUPPORT_SUPERG +#include +#endif +#ifdef IEEE80211_SUPPORT_TDMA +#include +#endif + +#include + +#ifdef INET +#include +#include +#endif + +#include +#include /* XXX for softled */ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef ATH_TX99_DIAG +#include +#endif + +#ifdef IEEE80211_SUPPORT_TDMA +#include + +static void ath_tdma_settimers(struct ath_softc *sc, u_int32_t nexttbtt, + u_int32_t bintval); +static void ath_tdma_bintvalsetup(struct ath_softc *sc, + const struct ieee80211_tdma_state *tdma); +#endif /* IEEE80211_SUPPORT_TDMA */ + +#ifdef IEEE80211_SUPPORT_TDMA +static void +ath_tdma_settimers(struct ath_softc *sc, u_int32_t nexttbtt, u_int32_t bintval) +{ + struct ath_hal *ah = sc->sc_ah; + HAL_BEACON_TIMERS bt; + + bt.bt_intval = bintval | HAL_BEACON_ENA; + bt.bt_nexttbtt = nexttbtt; + bt.bt_nextdba = (nexttbtt<<3) - sc->sc_tdmadbaprep; + bt.bt_nextswba = (nexttbtt<<3) - sc->sc_tdmaswbaprep; + bt.bt_nextatim = nexttbtt+1; + /* Enables TBTT, DBA, SWBA timers by default */ + bt.bt_flags = 0; + ath_hal_beaconsettimers(ah, &bt); +} + +/* + * Calculate the beacon interval. This is periodic in the + * superframe for the bss. We assume each station is configured + * identically wrt transmit rate so the guard time we calculate + * above will be the same on all stations. Note we need to + * factor in the xmit time because the hardware will schedule + * a frame for transmit if the start of the frame is within + * the burst time. When we get hardware that properly kills + * frames in the PCU we can reduce/eliminate the guard time. + * + * Roundup to 1024 is so we have 1 TU buffer in the guard time + * to deal with the granularity of the nexttbtt timer. 11n MAC's + * with 1us timer granularity should allow us to reduce/eliminate + * this. + */ +static void +ath_tdma_bintvalsetup(struct ath_softc *sc, + const struct ieee80211_tdma_state *tdma) +{ + /* copy from vap state (XXX check all vaps have same value?) */ + sc->sc_tdmaslotlen = tdma->tdma_slotlen; + + sc->sc_tdmabintval = roundup((sc->sc_tdmaslotlen+sc->sc_tdmaguard) * + tdma->tdma_slotcnt, 1024); + sc->sc_tdmabintval >>= 10; /* TSF -> TU */ + if (sc->sc_tdmabintval & 1) + sc->sc_tdmabintval++; + + if (tdma->tdma_slot == 0) { + /* + * Only slot 0 beacons; other slots respond. + */ + sc->sc_imask |= HAL_INT_SWBA; + sc->sc_tdmaswba = 0; /* beacon immediately */ + } else { + /* XXX all vaps must be slot 0 or slot !0 */ + sc->sc_imask &= ~HAL_INT_SWBA; + } +} + +/* + * Max 802.11 overhead. This assumes no 4-address frames and + * the encapsulation done by ieee80211_encap (llc). We also + * include potential crypto overhead. + */ +#define IEEE80211_MAXOVERHEAD \ + (sizeof(struct ieee80211_qosframe) \ + + sizeof(struct llc) \ + + IEEE80211_ADDR_LEN \ + + IEEE80211_WEP_IVLEN \ + + IEEE80211_WEP_KIDLEN \ + + IEEE80211_WEP_CRCLEN \ + + IEEE80211_WEP_MICLEN \ + + IEEE80211_CRC_LEN) + +/* + * Setup initially for tdma operation. Start the beacon + * timers and enable SWBA if we are slot 0. Otherwise + * we wait for slot 0 to arrive so we can sync up before + * starting to transmit. + */ +void +ath_tdma_config(struct ath_softc *sc, struct ieee80211vap *vap) +{ + struct ath_hal *ah = sc->sc_ah; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + const struct ieee80211_txparam *tp; + const struct ieee80211_tdma_state *tdma = NULL; + int rix; + + if (vap == NULL) { + vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */ + if (vap == NULL) { + if_printf(ifp, "%s: no vaps?\n", __func__); + return; + } + } + /* XXX should take a locked ref to iv_bss */ + tp = vap->iv_bss->ni_txparms; + /* + * Calculate the guard time for each slot. This is the + * time to send a maximal-size frame according to the + * fixed/lowest transmit rate. Note that the interface + * mtu does not include the 802.11 overhead so we must + * tack that on (ath_hal_computetxtime includes the + * preamble and plcp in it's calculation). + */ + tdma = vap->iv_tdma; + if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) + rix = ath_tx_findrix(sc, tp->ucastrate); + else + rix = ath_tx_findrix(sc, tp->mcastrate); + /* XXX short preamble assumed */ + sc->sc_tdmaguard = ath_hal_computetxtime(ah, sc->sc_currates, + ifp->if_mtu + IEEE80211_MAXOVERHEAD, rix, AH_TRUE); + + ath_hal_intrset(ah, 0); + + ath_beaconq_config(sc); /* setup h/w beacon q */ + if (sc->sc_setcca) + ath_hal_setcca(ah, AH_FALSE); /* disable CCA */ + ath_tdma_bintvalsetup(sc, tdma); /* calculate beacon interval */ + ath_tdma_settimers(sc, sc->sc_tdmabintval, + sc->sc_tdmabintval | HAL_BEACON_RESET_TSF); + sc->sc_syncbeacon = 0; + + sc->sc_avgtsfdeltap = TDMA_DUMMY_MARKER; + sc->sc_avgtsfdeltam = TDMA_DUMMY_MARKER; + + ath_hal_intrset(ah, sc->sc_imask); + + DPRINTF(sc, ATH_DEBUG_TDMA, "%s: slot %u len %uus cnt %u " + "bsched %u guard %uus bintval %u TU dba prep %u\n", __func__, + tdma->tdma_slot, tdma->tdma_slotlen, tdma->tdma_slotcnt, + tdma->tdma_bintval, sc->sc_tdmaguard, sc->sc_tdmabintval, + sc->sc_tdmadbaprep); +} + +/* + * Update tdma operation. Called from the 802.11 layer + * when a beacon is received from the TDMA station operating + * in the slot immediately preceding us in the bss. Use + * the rx timestamp for the beacon frame to update our + * beacon timers so we follow their schedule. Note that + * by using the rx timestamp we implicitly include the + * propagation delay in our schedule. + */ +void +ath_tdma_update(struct ieee80211_node *ni, + const struct ieee80211_tdma_param *tdma, int changed) +{ +#define TSF_TO_TU(_h,_l) \ + ((((u_int32_t)(_h)) << 22) | (((u_int32_t)(_l)) >> 10)) +#define TU_TO_TSF(_tu) (((u_int64_t)(_tu)) << 10) + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211com *ic = ni->ni_ic; + struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_hal *ah = sc->sc_ah; + const HAL_RATE_TABLE *rt = sc->sc_currates; + u_int64_t tsf, rstamp, nextslot, nexttbtt; + u_int32_t txtime, nextslottu; + int32_t tudelta, tsfdelta; + const struct ath_rx_status *rs; + int rix; + + sc->sc_stats.ast_tdma_update++; + + /* + * Check for and adopt configuration changes. + */ + if (changed != 0) { + const struct ieee80211_tdma_state *ts = vap->iv_tdma; + + ath_tdma_bintvalsetup(sc, ts); + if (changed & TDMA_UPDATE_SLOTLEN) + ath_wme_update(ic); + + DPRINTF(sc, ATH_DEBUG_TDMA, + "%s: adopt slot %u slotcnt %u slotlen %u us " + "bintval %u TU\n", __func__, + ts->tdma_slot, ts->tdma_slotcnt, ts->tdma_slotlen, + sc->sc_tdmabintval); + + /* XXX right? */ + ath_hal_intrset(ah, sc->sc_imask); + /* NB: beacon timers programmed below */ + } + + /* extend rx timestamp to 64 bits */ + rs = sc->sc_lastrs; + tsf = ath_hal_gettsf64(ah); + rstamp = ath_extend_tsf(sc, rs->rs_tstamp, tsf); + /* + * The rx timestamp is set by the hardware on completing + * reception (at the point where the rx descriptor is DMA'd + * to the host). To find the start of our next slot we + * must adjust this time by the time required to send + * the packet just received. + */ + rix = rt->rateCodeToIndex[rs->rs_rate]; + txtime = ath_hal_computetxtime(ah, rt, rs->rs_datalen, rix, + rt->info[rix].shortPreamble); + /* NB: << 9 is to cvt to TU and /2 */ + nextslot = (rstamp - txtime) + (sc->sc_tdmabintval << 9); + nextslottu = TSF_TO_TU(nextslot>>32, nextslot) & HAL_BEACON_PERIOD; + + /* + * Retrieve the hardware NextTBTT in usecs + * and calculate the difference between what the + * other station thinks and what we have programmed. This + * lets us figure how to adjust our timers to match. The + * adjustments are done by pulling the TSF forward and possibly + * rewriting the beacon timers. + */ + nexttbtt = ath_hal_getnexttbtt(ah); + tsfdelta = (int32_t)((nextslot % TU_TO_TSF(HAL_BEACON_PERIOD + 1)) - nexttbtt); + + DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, + "tsfdelta %d avg +%d/-%d\n", tsfdelta, + TDMA_AVG(sc->sc_avgtsfdeltap), TDMA_AVG(sc->sc_avgtsfdeltam)); + + if (tsfdelta < 0) { + TDMA_SAMPLE(sc->sc_avgtsfdeltap, 0); + TDMA_SAMPLE(sc->sc_avgtsfdeltam, -tsfdelta); + tsfdelta = -tsfdelta % 1024; + nextslottu++; + } else if (tsfdelta > 0) { + TDMA_SAMPLE(sc->sc_avgtsfdeltap, tsfdelta); + TDMA_SAMPLE(sc->sc_avgtsfdeltam, 0); + tsfdelta = 1024 - (tsfdelta % 1024); + nextslottu++; + } else { + TDMA_SAMPLE(sc->sc_avgtsfdeltap, 0); + TDMA_SAMPLE(sc->sc_avgtsfdeltam, 0); + } + tudelta = nextslottu - TSF_TO_TU(nexttbtt >> 32, nexttbtt); + + /* + * Copy sender's timetstamp into tdma ie so they can + * calculate roundtrip time. We submit a beacon frame + * below after any timer adjustment. The frame goes out + * at the next TBTT so the sender can calculate the + * roundtrip by inspecting the tdma ie in our beacon frame. + * + * NB: This tstamp is subtlely preserved when + * IEEE80211_BEACON_TDMA is marked (e.g. when the + * slot position changes) because ieee80211_add_tdma + * skips over the data. + */ + memcpy(ATH_VAP(vap)->av_boff.bo_tdma + + __offsetof(struct ieee80211_tdma_param, tdma_tstamp), + &ni->ni_tstamp.data, 8); +#if 0 + DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, + "tsf %llu nextslot %llu (%d, %d) nextslottu %u nexttbtt %llu (%d)\n", + (unsigned long long) tsf, (unsigned long long) nextslot, + (int)(nextslot - tsf), tsfdelta, nextslottu, nexttbtt, tudelta); +#endif + /* + * Adjust the beacon timers only when pulling them forward + * or when going back by less than the beacon interval. + * Negative jumps larger than the beacon interval seem to + * cause the timers to stop and generally cause instability. + * This basically filters out jumps due to missed beacons. + */ + if (tudelta != 0 && (tudelta > 0 || -tudelta < sc->sc_tdmabintval)) { + ath_tdma_settimers(sc, nextslottu, sc->sc_tdmabintval); + sc->sc_stats.ast_tdma_timers++; + } + if (tsfdelta > 0) { + ath_hal_adjusttsf(ah, tsfdelta); + sc->sc_stats.ast_tdma_tsf++; + } + ath_tdma_beacon_send(sc, vap); /* prepare response */ +#undef TU_TO_TSF +#undef TSF_TO_TU +} + +/* + * Transmit a beacon frame at SWBA. Dynamic updates + * to the frame contents are done as needed. + */ +void +ath_tdma_beacon_send(struct ath_softc *sc, struct ieee80211vap *vap) +{ + struct ath_hal *ah = sc->sc_ah; + struct ath_buf *bf; + int otherant; + + /* + * Check if the previous beacon has gone out. If + * not don't try to post another, skip this period + * and wait for the next. Missed beacons indicate + * a problem and should not occur. If we miss too + * many consecutive beacons reset the device. + */ + if (ath_hal_numtxpending(ah, sc->sc_bhalq) != 0) { + sc->sc_bmisscount++; + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: missed %u consecutive beacons\n", + __func__, sc->sc_bmisscount); + if (sc->sc_bmisscount >= ath_bstuck_threshold) + taskqueue_enqueue(sc->sc_tq, &sc->sc_bstucktask); + return; + } + if (sc->sc_bmisscount != 0) { + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: resume beacon xmit after %u misses\n", + __func__, sc->sc_bmisscount); + sc->sc_bmisscount = 0; + } + + /* + * Check recent per-antenna transmit statistics and flip + * the default antenna if noticeably more frames went out + * on the non-default antenna. + * XXX assumes 2 anntenae + */ + if (!sc->sc_diversity) { + otherant = sc->sc_defant & 1 ? 2 : 1; + if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_defant] + 2) + ath_setdefantenna(sc, otherant); + sc->sc_ant_tx[1] = sc->sc_ant_tx[2] = 0; + } + + bf = ath_beacon_generate(sc, vap); + if (bf != NULL) { + /* + * Stop any current dma and put the new frame on the queue. + * This should never fail since we check above that no frames + * are still pending on the queue. + */ + if (!ath_hal_stoptxdma(ah, sc->sc_bhalq)) { + DPRINTF(sc, ATH_DEBUG_ANY, + "%s: beacon queue %u did not stop?\n", + __func__, sc->sc_bhalq); + /* NB: the HAL still stops DMA, so proceed */ + } + ath_hal_puttxbuf(ah, sc->sc_bhalq, bf->bf_daddr); + ath_hal_txstart(ah, sc->sc_bhalq); + + sc->sc_stats.ast_be_xmit++; /* XXX per-vap? */ + + /* + * Record local TSF for our last send for use + * in arbitrating slot collisions. + */ + /* XXX should take a locked ref to iv_bss */ + vap->iv_bss->ni_tstamp.tsf = ath_hal_gettsf64(ah); + } +} +#endif /* IEEE80211_SUPPORT_TDMA */ Added: head/sys/dev/ath/if_ath_tdma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_tdma.h Sun May 20 02:49:42 2012 (r235679) @@ -0,0 +1,55 @@ +/*- *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun May 20 04:14:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A24401065673; Sun, 20 May 2012 04:14:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B2B68FC18; Sun, 20 May 2012 04:14:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4K4EUD9065951; Sun, 20 May 2012 04:14:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K4EUHd065946; Sun, 20 May 2012 04:14:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205200414.q4K4EUHd065946@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 May 2012 04:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235680 - in head/sys: conf dev/ath modules/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 04:14:30 -0000 Author: adrian Date: Sun May 20 04:14:29 2012 New Revision: 235680 URL: http://svn.freebsd.org/changeset/base/235680 Log: Migrate most of the beacon handling functions out to if_ath_beacon.c. This is also in preparation for supporting AR9300 and later NICs. Added: head/sys/dev/ath/if_ath_beacon.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_beacon.h head/sys/dev/ath/if_ath_misc.h head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun May 20 02:49:42 2012 (r235679) +++ head/sys/conf/files Sun May 20 04:14:29 2012 (r235680) @@ -710,6 +710,8 @@ dev/ath/if_ath_ahb.c optional ath_ahb \ # dev/ath/if_ath.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/if_ath_beacon.c optional ath \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_debug.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_keycache.c optional ath \ Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun May 20 02:49:42 2012 (r235679) +++ head/sys/dev/ath/if_ath.c Sun May 20 04:14:29 2012 (r235680) @@ -153,17 +153,9 @@ static void ath_key_update_begin(struct static void ath_key_update_end(struct ieee80211vap *); static void ath_update_mcast(struct ifnet *); static void ath_update_promisc(struct ifnet *); -static void ath_setslottime(struct ath_softc *); static void ath_updateslot(struct ifnet *); -static int ath_beaconq_setup(struct ath_hal *); -static int ath_beacon_alloc(struct ath_softc *, struct ieee80211_node *); -static void ath_beacon_update(struct ieee80211vap *, int item); -static void ath_beacon_setup(struct ath_softc *, struct ath_buf *); -static void ath_beacon_proc(void *, int); static void ath_bstuck_proc(void *, int); static void ath_reset_proc(void *, int); -static void ath_beacon_return(struct ath_softc *, struct ath_buf *); -static void ath_beacon_free(struct ath_softc *); static void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *, ath_bufhead *); static int ath_desc_alloc(struct ath_softc *); @@ -2541,7 +2533,7 @@ ath_mode_init(struct ath_softc *sc) /* * Set the slot time based on the current setting. */ -static void +void ath_setslottime(struct ath_softc *sc) { struct ieee80211com *ic = sc->sc_ifp->if_l2com; @@ -2594,248 +2586,10 @@ ath_updateslot(struct ifnet *ifp) } /* - * Setup a h/w transmit queue for beacons. - */ -static int -ath_beaconq_setup(struct ath_hal *ah) -{ - HAL_TXQ_INFO qi; - - memset(&qi, 0, sizeof(qi)); - qi.tqi_aifs = HAL_TXQ_USEDEFAULT; - qi.tqi_cwmin = HAL_TXQ_USEDEFAULT; - qi.tqi_cwmax = HAL_TXQ_USEDEFAULT; - /* NB: for dynamic turbo, don't enable any other interrupts */ - qi.tqi_qflags = HAL_TXQ_TXDESCINT_ENABLE; - return ath_hal_setuptxqueue(ah, HAL_TX_QUEUE_BEACON, &qi); -} - -/* - * Setup the transmit queue parameters for the beacon queue. - */ -int -ath_beaconq_config(struct ath_softc *sc) -{ -#define ATH_EXPONENT_TO_VALUE(v) ((1<<(v))-1) - struct ieee80211com *ic = sc->sc_ifp->if_l2com; - struct ath_hal *ah = sc->sc_ah; - HAL_TXQ_INFO qi; - - ath_hal_gettxqueueprops(ah, sc->sc_bhalq, &qi); - if (ic->ic_opmode == IEEE80211_M_HOSTAP || - ic->ic_opmode == IEEE80211_M_MBSS) { - /* - * Always burst out beacon and CAB traffic. - */ - qi.tqi_aifs = ATH_BEACON_AIFS_DEFAULT; - qi.tqi_cwmin = ATH_BEACON_CWMIN_DEFAULT; - qi.tqi_cwmax = ATH_BEACON_CWMAX_DEFAULT; - } else { - struct wmeParams *wmep = - &ic->ic_wme.wme_chanParams.cap_wmeParams[WME_AC_BE]; - /* - * Adhoc mode; important thing is to use 2x cwmin. - */ - qi.tqi_aifs = wmep->wmep_aifsn; - qi.tqi_cwmin = 2*ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmin); - qi.tqi_cwmax = ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmax); - } - - if (!ath_hal_settxqueueprops(ah, sc->sc_bhalq, &qi)) { - device_printf(sc->sc_dev, "unable to update parameters for " - "beacon hardware queue!\n"); - return 0; - } else { - ath_hal_resettxqueue(ah, sc->sc_bhalq); /* push to h/w */ - return 1; - } -#undef ATH_EXPONENT_TO_VALUE -} - -/* - * Allocate and setup an initial beacon frame. - */ -static int -ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_node *ni) -{ - struct ieee80211vap *vap = ni->ni_vap; - struct ath_vap *avp = ATH_VAP(vap); - struct ath_buf *bf; - struct mbuf *m; - int error; - - bf = avp->av_bcbuf; - DPRINTF(sc, ATH_DEBUG_NODE, "%s: bf_m=%p, bf_node=%p\n", - __func__, bf->bf_m, bf->bf_node); - if (bf->bf_m != NULL) { - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - m_freem(bf->bf_m); - bf->bf_m = NULL; - } - if (bf->bf_node != NULL) { - ieee80211_free_node(bf->bf_node); - bf->bf_node = NULL; - } - - /* - * NB: the beacon data buffer must be 32-bit aligned; - * we assume the mbuf routines will return us something - * with this alignment (perhaps should assert). - */ - m = ieee80211_beacon_alloc(ni, &avp->av_boff); - if (m == NULL) { - device_printf(sc->sc_dev, "%s: cannot get mbuf\n", __func__); - sc->sc_stats.ast_be_nombuf++; - return ENOMEM; - } - error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m, - bf->bf_segs, &bf->bf_nseg, - BUS_DMA_NOWAIT); - if (error != 0) { - device_printf(sc->sc_dev, - "%s: cannot map mbuf, bus_dmamap_load_mbuf_sg returns %d\n", - __func__, error); - m_freem(m); - return error; - } - - /* - * Calculate a TSF adjustment factor required for staggered - * beacons. Note that we assume the format of the beacon - * frame leaves the tstamp field immediately following the - * header. - */ - if (sc->sc_stagbeacons && avp->av_bslot > 0) { - uint64_t tsfadjust; - struct ieee80211_frame *wh; - - /* - * The beacon interval is in TU's; the TSF is in usecs. - * We figure out how many TU's to add to align the timestamp - * then convert to TSF units and handle byte swapping before - * inserting it in the frame. The hardware will then add this - * each time a beacon frame is sent. Note that we align vap's - * 1..N and leave vap 0 untouched. This means vap 0 has a - * timestamp in one beacon interval while the others get a - * timstamp aligned to the next interval. - */ - tsfadjust = ni->ni_intval * - (ATH_BCBUF - avp->av_bslot) / ATH_BCBUF; - tsfadjust = htole64(tsfadjust << 10); /* TU -> TSF */ - - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: %s beacons bslot %d intval %u tsfadjust %llu\n", - __func__, sc->sc_stagbeacons ? "stagger" : "burst", - avp->av_bslot, ni->ni_intval, - (long long unsigned) le64toh(tsfadjust)); - - wh = mtod(m, struct ieee80211_frame *); - memcpy(&wh[1], &tsfadjust, sizeof(tsfadjust)); - } - bf->bf_m = m; - bf->bf_node = ieee80211_ref_node(ni); - - return 0; -} - -/* - * Setup the beacon frame for transmit. - */ -static void -ath_beacon_setup(struct ath_softc *sc, struct ath_buf *bf) -{ -#define USE_SHPREAMBLE(_ic) \ - (((_ic)->ic_flags & (IEEE80211_F_SHPREAMBLE | IEEE80211_F_USEBARKER))\ - == IEEE80211_F_SHPREAMBLE) - struct ieee80211_node *ni = bf->bf_node; - struct ieee80211com *ic = ni->ni_ic; - struct mbuf *m = bf->bf_m; - struct ath_hal *ah = sc->sc_ah; - struct ath_desc *ds; - int flags, antenna; - const HAL_RATE_TABLE *rt; - u_int8_t rix, rate; - - DPRINTF(sc, ATH_DEBUG_BEACON_PROC, "%s: m %p len %u\n", - __func__, m, m->m_len); - - /* setup descriptors */ - ds = bf->bf_desc; - bf->bf_last = bf; - bf->bf_lastds = ds; - - flags = HAL_TXDESC_NOACK; - if (ic->ic_opmode == IEEE80211_M_IBSS && sc->sc_hasveol) { - ds->ds_link = bf->bf_daddr; /* self-linked */ - flags |= HAL_TXDESC_VEOL; - /* - * Let hardware handle antenna switching. - */ - antenna = sc->sc_txantenna; - } else { - ds->ds_link = 0; - /* - * Switch antenna every 4 beacons. - * XXX assumes two antenna - */ - if (sc->sc_txantenna != 0) - antenna = sc->sc_txantenna; - else if (sc->sc_stagbeacons && sc->sc_nbcnvaps != 0) - antenna = ((sc->sc_stats.ast_be_xmit / sc->sc_nbcnvaps) & 4 ? 2 : 1); - else - antenna = (sc->sc_stats.ast_be_xmit & 4 ? 2 : 1); - } - - KASSERT(bf->bf_nseg == 1, - ("multi-segment beacon frame; nseg %u", bf->bf_nseg)); - ds->ds_data = bf->bf_segs[0].ds_addr; - /* - * Calculate rate code. - * XXX everything at min xmit rate - */ - rix = 0; - rt = sc->sc_currates; - rate = rt->info[rix].rateCode; - if (USE_SHPREAMBLE(ic)) - rate |= rt->info[rix].shortPreamble; - ath_hal_setuptxdesc(ah, ds - , m->m_len + IEEE80211_CRC_LEN /* frame length */ - , sizeof(struct ieee80211_frame)/* header length */ - , HAL_PKT_TYPE_BEACON /* Atheros packet type */ - , ni->ni_txpower /* txpower XXX */ - , rate, 1 /* series 0 rate/tries */ - , HAL_TXKEYIX_INVALID /* no encryption */ - , antenna /* antenna mode */ - , flags /* no ack, veol for beacons */ - , 0 /* rts/cts rate */ - , 0 /* rts/cts duration */ - ); - /* NB: beacon's BufLen must be a multiple of 4 bytes */ - ath_hal_filltxdesc(ah, ds - , roundup(m->m_len, 4) /* buffer length */ - , AH_TRUE /* first segment */ - , AH_TRUE /* last segment */ - , ds /* first descriptor */ - ); -#if 0 - ath_desc_swap(ds); -#endif -#undef USE_SHPREAMBLE -} - -static void -ath_beacon_update(struct ieee80211vap *vap, int item) -{ - struct ieee80211_beacon_offsets *bo = &ATH_VAP(vap)->av_boff; - - setbit(bo->bo_flags, item); -} - -/* * Append the contents of src to dst; both queues * are assumed to be locked. */ -static void +void ath_txqmove(struct ath_txq *dst, struct ath_txq *src) { @@ -2852,255 +2606,6 @@ ath_txqmove(struct ath_txq *dst, struct } /* - * Transmit a beacon frame at SWBA. Dynamic updates to the - * frame contents are done as needed and the slot time is - * also adjusted based on current state. - */ -static void -ath_beacon_proc(void *arg, int pending) -{ - struct ath_softc *sc = arg; - struct ath_hal *ah = sc->sc_ah; - struct ieee80211vap *vap; - struct ath_buf *bf; - int slot, otherant; - uint32_t bfaddr; - - DPRINTF(sc, ATH_DEBUG_BEACON_PROC, "%s: pending %u\n", - __func__, pending); - /* - * Check if the previous beacon has gone out. If - * not don't try to post another, skip this period - * and wait for the next. Missed beacons indicate - * a problem and should not occur. If we miss too - * many consecutive beacons reset the device. - */ - if (ath_hal_numtxpending(ah, sc->sc_bhalq) != 0) { - sc->sc_bmisscount++; - sc->sc_stats.ast_be_missed++; - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: missed %u consecutive beacons\n", - __func__, sc->sc_bmisscount); - if (sc->sc_bmisscount >= ath_bstuck_threshold) - taskqueue_enqueue(sc->sc_tq, &sc->sc_bstucktask); - return; - } - if (sc->sc_bmisscount != 0) { - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: resume beacon xmit after %u misses\n", - __func__, sc->sc_bmisscount); - sc->sc_bmisscount = 0; - } - - if (sc->sc_stagbeacons) { /* staggered beacons */ - struct ieee80211com *ic = sc->sc_ifp->if_l2com; - uint32_t tsftu; - - tsftu = ath_hal_gettsf32(ah) >> 10; - /* XXX lintval */ - slot = ((tsftu % ic->ic_lintval) * ATH_BCBUF) / ic->ic_lintval; - vap = sc->sc_bslot[(slot+1) % ATH_BCBUF]; - bfaddr = 0; - if (vap != NULL && vap->iv_state >= IEEE80211_S_RUN) { - bf = ath_beacon_generate(sc, vap); - if (bf != NULL) - bfaddr = bf->bf_daddr; - } - } else { /* burst'd beacons */ - uint32_t *bflink = &bfaddr; - - for (slot = 0; slot < ATH_BCBUF; slot++) { - vap = sc->sc_bslot[slot]; - if (vap != NULL && vap->iv_state >= IEEE80211_S_RUN) { - bf = ath_beacon_generate(sc, vap); - if (bf != NULL) { - *bflink = bf->bf_daddr; - bflink = &bf->bf_desc->ds_link; - } - } - } - *bflink = 0; /* terminate list */ - } - - /* - * Handle slot time change when a non-ERP station joins/leaves - * an 11g network. The 802.11 layer notifies us via callback, - * we mark updateslot, then wait one beacon before effecting - * the change. This gives associated stations at least one - * beacon interval to note the state change. - */ - /* XXX locking */ - if (sc->sc_updateslot == UPDATE) { - sc->sc_updateslot = COMMIT; /* commit next beacon */ - sc->sc_slotupdate = slot; - } else if (sc->sc_updateslot == COMMIT && sc->sc_slotupdate == slot) - ath_setslottime(sc); /* commit change to h/w */ - - /* - * Check recent per-antenna transmit statistics and flip - * the default antenna if noticeably more frames went out - * on the non-default antenna. - * XXX assumes 2 anntenae - */ - if (!sc->sc_diversity && (!sc->sc_stagbeacons || slot == 0)) { - otherant = sc->sc_defant & 1 ? 2 : 1; - if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_defant] + 2) - ath_setdefantenna(sc, otherant); - sc->sc_ant_tx[1] = sc->sc_ant_tx[2] = 0; - } - - if (bfaddr != 0) { - /* - * Stop any current dma and put the new frame on the queue. - * This should never fail since we check above that no frames - * are still pending on the queue. - */ - if (!ath_hal_stoptxdma(ah, sc->sc_bhalq)) { - DPRINTF(sc, ATH_DEBUG_ANY, - "%s: beacon queue %u did not stop?\n", - __func__, sc->sc_bhalq); - } - /* NB: cabq traffic should already be queued and primed */ - ath_hal_puttxbuf(ah, sc->sc_bhalq, bfaddr); - ath_hal_txstart(ah, sc->sc_bhalq); - - sc->sc_stats.ast_be_xmit++; - } -} - -struct ath_buf * -ath_beacon_generate(struct ath_softc *sc, struct ieee80211vap *vap) -{ - struct ath_vap *avp = ATH_VAP(vap); - struct ath_txq *cabq = sc->sc_cabq; - struct ath_buf *bf; - struct mbuf *m; - int nmcastq, error; - - KASSERT(vap->iv_state >= IEEE80211_S_RUN, - ("not running, state %d", vap->iv_state)); - KASSERT(avp->av_bcbuf != NULL, ("no beacon buffer")); - - /* - * Update dynamic beacon contents. If this returns - * non-zero then we need to remap the memory because - * the beacon frame changed size (probably because - * of the TIM bitmap). - */ - bf = avp->av_bcbuf; - m = bf->bf_m; - /* XXX lock mcastq? */ - nmcastq = avp->av_mcastq.axq_depth; - - if (ieee80211_beacon_update(bf->bf_node, &avp->av_boff, m, nmcastq)) { - /* XXX too conservative? */ - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m, - bf->bf_segs, &bf->bf_nseg, - BUS_DMA_NOWAIT); - if (error != 0) { - if_printf(vap->iv_ifp, - "%s: bus_dmamap_load_mbuf_sg failed, error %u\n", - __func__, error); - return NULL; - } - } - if ((avp->av_boff.bo_tim[4] & 1) && cabq->axq_depth) { - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: cabq did not drain, mcastq %u cabq %u\n", - __func__, nmcastq, cabq->axq_depth); - sc->sc_stats.ast_cabq_busy++; - if (sc->sc_nvaps > 1 && sc->sc_stagbeacons) { - /* - * CABQ traffic from a previous vap is still pending. - * We must drain the q before this beacon frame goes - * out as otherwise this vap's stations will get cab - * frames from a different vap. - * XXX could be slow causing us to miss DBA - */ - ath_tx_draintxq(sc, cabq); - } - } - ath_beacon_setup(sc, bf); - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_PREWRITE); - - /* - * Enable the CAB queue before the beacon queue to - * insure cab frames are triggered by this beacon. - */ - if (avp->av_boff.bo_tim[4] & 1) { - struct ath_hal *ah = sc->sc_ah; - - /* NB: only at DTIM */ - ATH_TXQ_LOCK(cabq); - ATH_TXQ_LOCK(&avp->av_mcastq); - if (nmcastq) { - struct ath_buf *bfm; - - /* - * Move frames from the s/w mcast q to the h/w cab q. - * XXX MORE_DATA bit - */ - bfm = TAILQ_FIRST(&avp->av_mcastq.axq_q); - if (cabq->axq_link != NULL) { - *cabq->axq_link = bfm->bf_daddr; - } else - ath_hal_puttxbuf(ah, cabq->axq_qnum, - bfm->bf_daddr); - ath_txqmove(cabq, &avp->av_mcastq); - - sc->sc_stats.ast_cabq_xmit += nmcastq; - } - /* NB: gated by beacon so safe to start here */ - if (! TAILQ_EMPTY(&(cabq->axq_q))) - ath_hal_txstart(ah, cabq->axq_qnum); - ATH_TXQ_UNLOCK(&avp->av_mcastq); - ATH_TXQ_UNLOCK(cabq); - } - return bf; -} - -static void -ath_beacon_start_adhoc(struct ath_softc *sc, struct ieee80211vap *vap) -{ - struct ath_vap *avp = ATH_VAP(vap); - struct ath_hal *ah = sc->sc_ah; - struct ath_buf *bf; - struct mbuf *m; - int error; - - KASSERT(avp->av_bcbuf != NULL, ("no beacon buffer")); - - /* - * Update dynamic beacon contents. If this returns - * non-zero then we need to remap the memory because - * the beacon frame changed size (probably because - * of the TIM bitmap). - */ - bf = avp->av_bcbuf; - m = bf->bf_m; - if (ieee80211_beacon_update(bf->bf_node, &avp->av_boff, m, 0)) { - /* XXX too conservative? */ - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m, - bf->bf_segs, &bf->bf_nseg, - BUS_DMA_NOWAIT); - if (error != 0) { - if_printf(vap->iv_ifp, - "%s: bus_dmamap_load_mbuf_sg failed, error %u\n", - __func__, error); - return; - } - } - ath_beacon_setup(sc, bf); - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_PREWRITE); - - /* NB: caller is known to have already stopped tx dma */ - ath_hal_puttxbuf(ah, sc->sc_bhalq, bf->bf_daddr); - ath_hal_txstart(ah, sc->sc_bhalq); -} - -/* * Reset the hardware, with no loss. * * This can't be used for a general case reset. @@ -3140,255 +2645,6 @@ ath_bstuck_proc(void *arg, int pending) ath_reset(ifp, ATH_RESET_NOLOSS); } -/* - * Reclaim beacon resources and return buffer to the pool. - */ -static void -ath_beacon_return(struct ath_softc *sc, struct ath_buf *bf) -{ - - DPRINTF(sc, ATH_DEBUG_NODE, "%s: free bf=%p, bf_m=%p, bf_node=%p\n", - __func__, bf, bf->bf_m, bf->bf_node); - if (bf->bf_m != NULL) { - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - m_freem(bf->bf_m); - bf->bf_m = NULL; - } - if (bf->bf_node != NULL) { - ieee80211_free_node(bf->bf_node); - bf->bf_node = NULL; - } - TAILQ_INSERT_TAIL(&sc->sc_bbuf, bf, bf_list); -} - -/* - * Reclaim beacon resources. - */ -static void -ath_beacon_free(struct ath_softc *sc) -{ - struct ath_buf *bf; - - TAILQ_FOREACH(bf, &sc->sc_bbuf, bf_list) { - DPRINTF(sc, ATH_DEBUG_NODE, - "%s: free bf=%p, bf_m=%p, bf_node=%p\n", - __func__, bf, bf->bf_m, bf->bf_node); - if (bf->bf_m != NULL) { - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - m_freem(bf->bf_m); - bf->bf_m = NULL; - } - if (bf->bf_node != NULL) { - ieee80211_free_node(bf->bf_node); - bf->bf_node = NULL; - } - } -} - -/* - * Configure the beacon and sleep timers. - * - * When operating as an AP this resets the TSF and sets - * up the hardware to notify us when we need to issue beacons. - * - * When operating in station mode this sets up the beacon - * timers according to the timestamp of the last received - * beacon and the current TSF, configures PCF and DTIM - * handling, programs the sleep registers so the hardware - * will wakeup in time to receive beacons, and configures - * the beacon miss handling so we'll receive a BMISS - * interrupt when we stop seeing beacons from the AP - * we've associated with. - */ -void -ath_beacon_config(struct ath_softc *sc, struct ieee80211vap *vap) -{ -#define TSF_TO_TU(_h,_l) \ - ((((u_int32_t)(_h)) << 22) | (((u_int32_t)(_l)) >> 10)) -#define FUDGE 2 - struct ath_hal *ah = sc->sc_ah; - struct ieee80211com *ic = sc->sc_ifp->if_l2com; - struct ieee80211_node *ni; - u_int32_t nexttbtt, intval, tsftu; - u_int64_t tsf; - - if (vap == NULL) - vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */ - ni = ieee80211_ref_node(vap->iv_bss); - - /* extract tstamp from last beacon and convert to TU */ - nexttbtt = TSF_TO_TU(LE_READ_4(ni->ni_tstamp.data + 4), - LE_READ_4(ni->ni_tstamp.data)); - if (ic->ic_opmode == IEEE80211_M_HOSTAP || - ic->ic_opmode == IEEE80211_M_MBSS) { - /* - * For multi-bss ap/mesh support beacons are either staggered - * evenly over N slots or burst together. For the former - * arrange for the SWBA to be delivered for each slot. - * Slots that are not occupied will generate nothing. - */ - /* NB: the beacon interval is kept internally in TU's */ - intval = ni->ni_intval & HAL_BEACON_PERIOD; - if (sc->sc_stagbeacons) - intval /= ATH_BCBUF; - } else { - /* NB: the beacon interval is kept internally in TU's */ - intval = ni->ni_intval & HAL_BEACON_PERIOD; - } - if (nexttbtt == 0) /* e.g. for ap mode */ - nexttbtt = intval; - else if (intval) /* NB: can be 0 for monitor mode */ - nexttbtt = roundup(nexttbtt, intval); - DPRINTF(sc, ATH_DEBUG_BEACON, "%s: nexttbtt %u intval %u (%u)\n", - __func__, nexttbtt, intval, ni->ni_intval); - if (ic->ic_opmode == IEEE80211_M_STA && !sc->sc_swbmiss) { - HAL_BEACON_STATE bs; - int dtimperiod, dtimcount; - int cfpperiod, cfpcount; - - /* - * Setup dtim and cfp parameters according to - * last beacon we received (which may be none). - */ - dtimperiod = ni->ni_dtim_period; - if (dtimperiod <= 0) /* NB: 0 if not known */ - dtimperiod = 1; - dtimcount = ni->ni_dtim_count; - if (dtimcount >= dtimperiod) /* NB: sanity check */ - dtimcount = 0; /* XXX? */ - cfpperiod = 1; /* NB: no PCF support yet */ - cfpcount = 0; - /* - * Pull nexttbtt forward to reflect the current - * TSF and calculate dtim+cfp state for the result. - */ - tsf = ath_hal_gettsf64(ah); - tsftu = TSF_TO_TU(tsf>>32, tsf) + FUDGE; - do { - nexttbtt += intval; - if (--dtimcount < 0) { - dtimcount = dtimperiod - 1; - if (--cfpcount < 0) - cfpcount = cfpperiod - 1; - } - } while (nexttbtt < tsftu); - memset(&bs, 0, sizeof(bs)); - bs.bs_intval = intval; - bs.bs_nexttbtt = nexttbtt; - bs.bs_dtimperiod = dtimperiod*intval; - bs.bs_nextdtim = bs.bs_nexttbtt + dtimcount*intval; - bs.bs_cfpperiod = cfpperiod*bs.bs_dtimperiod; - bs.bs_cfpnext = bs.bs_nextdtim + cfpcount*bs.bs_dtimperiod; - bs.bs_cfpmaxduration = 0; -#if 0 - /* - * The 802.11 layer records the offset to the DTIM - * bitmap while receiving beacons; use it here to - * enable h/w detection of our AID being marked in - * the bitmap vector (to indicate frames for us are - * pending at the AP). - * XXX do DTIM handling in s/w to WAR old h/w bugs - * XXX enable based on h/w rev for newer chips - */ - bs.bs_timoffset = ni->ni_timoff; -#endif - /* - * Calculate the number of consecutive beacons to miss - * before taking a BMISS interrupt. - * Note that we clamp the result to at most 10 beacons. - */ - bs.bs_bmissthreshold = vap->iv_bmissthreshold; - if (bs.bs_bmissthreshold > 10) - bs.bs_bmissthreshold = 10; - else if (bs.bs_bmissthreshold <= 0) - bs.bs_bmissthreshold = 1; - - /* - * Calculate sleep duration. The configuration is - * given in ms. We insure a multiple of the beacon - * period is used. Also, if the sleep duration is - * greater than the DTIM period then it makes senses - * to make it a multiple of that. - * - * XXX fixed at 100ms - */ - bs.bs_sleepduration = - roundup(IEEE80211_MS_TO_TU(100), bs.bs_intval); - if (bs.bs_sleepduration > bs.bs_dtimperiod) - bs.bs_sleepduration = roundup(bs.bs_sleepduration, bs.bs_dtimperiod); - - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: tsf %ju tsf:tu %u intval %u nexttbtt %u dtim %u nextdtim %u bmiss %u sleep %u cfp:period %u maxdur %u next %u timoffset %u\n" - , __func__ - , tsf, tsftu - , bs.bs_intval - , bs.bs_nexttbtt - , bs.bs_dtimperiod - , bs.bs_nextdtim - , bs.bs_bmissthreshold - , bs.bs_sleepduration - , bs.bs_cfpperiod - , bs.bs_cfpmaxduration - , bs.bs_cfpnext - , bs.bs_timoffset - ); - ath_hal_intrset(ah, 0); - ath_hal_beacontimers(ah, &bs); - sc->sc_imask |= HAL_INT_BMISS; - ath_hal_intrset(ah, sc->sc_imask); - } else { - ath_hal_intrset(ah, 0); - if (nexttbtt == intval) - intval |= HAL_BEACON_RESET_TSF; - if (ic->ic_opmode == IEEE80211_M_IBSS) { - /* - * In IBSS mode enable the beacon timers but only - * enable SWBA interrupts if we need to manually - * prepare beacon frames. Otherwise we use a - * self-linked tx descriptor and let the hardware - * deal with things. - */ - intval |= HAL_BEACON_ENA; - if (!sc->sc_hasveol) - sc->sc_imask |= HAL_INT_SWBA; - if ((intval & HAL_BEACON_RESET_TSF) == 0) { - /* - * Pull nexttbtt forward to reflect - * the current TSF. - */ - tsf = ath_hal_gettsf64(ah); - tsftu = TSF_TO_TU(tsf>>32, tsf) + FUDGE; - do { - nexttbtt += intval; - } while (nexttbtt < tsftu); - } - ath_beaconq_config(sc); - } else if (ic->ic_opmode == IEEE80211_M_HOSTAP || - ic->ic_opmode == IEEE80211_M_MBSS) { - /* - * In AP/mesh mode we enable the beacon timers - * and SWBA interrupts to prepare beacon frames. - */ - intval |= HAL_BEACON_ENA; - sc->sc_imask |= HAL_INT_SWBA; /* beacon prepare */ - ath_beaconq_config(sc); - } - ath_hal_beaconinit(ah, nexttbtt, intval); - sc->sc_bmisscount = 0; - ath_hal_intrset(ah, sc->sc_imask); - /* - * When using a self-linked beacon descriptor in - * ibss mode load it once here. - */ - if (ic->ic_opmode == IEEE80211_M_IBSS && sc->sc_hasveol) - ath_beacon_start_adhoc(sc, vap); - } - sc->sc_syncbeacon = 0; - ieee80211_free_node(ni); -#undef FUDGE -#undef TSF_TO_TU -} - static void ath_load_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { Added: head/sys/dev/ath/if_ath_beacon.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_beacon.c Sun May 20 04:14:29 2012 (r235680) @@ -0,0 +1,841 @@ +/*- + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for the Atheros Wireless LAN controller. + * + * This software is derived from work of Atsushi Onoe; his contribution + * is greatly appreciated. + */ + +#include "opt_inet.h" +#include "opt_ath.h" +/* + * This is needed for register operations which are performed + * by the driver - eg, calls to ath_hal_gettsf32(). + * + * It's also required for any AH_DEBUG checks in here, eg the + * module dependencies. + */ +#include "opt_ah.h" +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* for mp_ncpus */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#ifdef IEEE80211_SUPPORT_SUPERG +#include +#endif + +#include + +#ifdef INET +#include +#include +#endif + +#include + +#include +#include +#include +#include + +#ifdef ATH_TX99_DIAG +#include +#endif + +/* + * Setup a h/w transmit queue for beacons. + */ +int +ath_beaconq_setup(struct ath_hal *ah) +{ + HAL_TXQ_INFO qi; + + memset(&qi, 0, sizeof(qi)); + qi.tqi_aifs = HAL_TXQ_USEDEFAULT; + qi.tqi_cwmin = HAL_TXQ_USEDEFAULT; + qi.tqi_cwmax = HAL_TXQ_USEDEFAULT; + /* NB: for dynamic turbo, don't enable any other interrupts */ + qi.tqi_qflags = HAL_TXQ_TXDESCINT_ENABLE; + return ath_hal_setuptxqueue(ah, HAL_TX_QUEUE_BEACON, &qi); +} + +/* + * Setup the transmit queue parameters for the beacon queue. + */ +int +ath_beaconq_config(struct ath_softc *sc) +{ +#define ATH_EXPONENT_TO_VALUE(v) ((1<<(v))-1) + struct ieee80211com *ic = sc->sc_ifp->if_l2com; + struct ath_hal *ah = sc->sc_ah; + HAL_TXQ_INFO qi; + + ath_hal_gettxqueueprops(ah, sc->sc_bhalq, &qi); + if (ic->ic_opmode == IEEE80211_M_HOSTAP || + ic->ic_opmode == IEEE80211_M_MBSS) { + /* + * Always burst out beacon and CAB traffic. + */ + qi.tqi_aifs = ATH_BEACON_AIFS_DEFAULT; + qi.tqi_cwmin = ATH_BEACON_CWMIN_DEFAULT; + qi.tqi_cwmax = ATH_BEACON_CWMAX_DEFAULT; + } else { + struct wmeParams *wmep = + &ic->ic_wme.wme_chanParams.cap_wmeParams[WME_AC_BE]; + /* + * Adhoc mode; important thing is to use 2x cwmin. + */ + qi.tqi_aifs = wmep->wmep_aifsn; + qi.tqi_cwmin = 2*ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmin); + qi.tqi_cwmax = ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmax); + } + + if (!ath_hal_settxqueueprops(ah, sc->sc_bhalq, &qi)) { + device_printf(sc->sc_dev, "unable to update parameters for " + "beacon hardware queue!\n"); + return 0; + } else { + ath_hal_resettxqueue(ah, sc->sc_bhalq); /* push to h/w */ + return 1; + } +#undef ATH_EXPONENT_TO_VALUE +} + +/* + * Allocate and setup an initial beacon frame. + */ +int +ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct ath_vap *avp = ATH_VAP(vap); + struct ath_buf *bf; + struct mbuf *m; + int error; + + bf = avp->av_bcbuf; + DPRINTF(sc, ATH_DEBUG_NODE, "%s: bf_m=%p, bf_node=%p\n", + __func__, bf->bf_m, bf->bf_node); + if (bf->bf_m != NULL) { + bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); + m_freem(bf->bf_m); + bf->bf_m = NULL; + } + if (bf->bf_node != NULL) { + ieee80211_free_node(bf->bf_node); + bf->bf_node = NULL; + } + + /* + * NB: the beacon data buffer must be 32-bit aligned; + * we assume the mbuf routines will return us something + * with this alignment (perhaps should assert). + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun May 20 05:12:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE25A106564A; Sun, 20 May 2012 05:12:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49D528FC16; Sun, 20 May 2012 05:12:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4K5CVrt068499; Sun, 20 May 2012 05:12:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K5CV2h068497; Sun, 20 May 2012 05:12:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205200512.q4K5CV2h068497@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 May 2012 05:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235681 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 05:12:34 -0000 Author: marius Date: Sun May 20 05:12:31 2012 New Revision: 235681 URL: http://svn.freebsd.org/changeset/base/235681 Log: Rewrite nd6_sysctl_{d,p}rlist() to avoid misaligned accesses to char arrays casted to structs by getting rid of these buffers entirely. In r169832, it was tried to paper over this issue by 32-bit aligning the buffers. Depending on compiler optimizations that still was insufficient for 64-bit architectures with strong alignment requirements though. While at it, add comments regarding the total lack of locking in this area. Tested by: bz Reviewed by: bz (slightly earlier version), yongari (earlier version) MFC after: 1 week Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sun May 20 04:14:29 2012 (r235680) +++ head/sys/netinet6/nd6.c Sun May 20 05:12:31 2012 (r235681) @@ -2262,128 +2262,101 @@ SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6 static int nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) { - int error; - char buf[1024] __aligned(4); - struct in6_defrouter *d, *de; + struct in6_defrouter d; struct nd_defrouter *dr; + int error; if (req->newptr) - return EPERM; - error = 0; + return (EPERM); + bzero(&d, sizeof(d)); + d.rtaddr.sin6_family = AF_INET6; + d.rtaddr.sin6_len = sizeof(d.rtaddr); + + /* + * XXX locking + */ TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { - d = (struct in6_defrouter *)buf; - de = (struct in6_defrouter *)(buf + sizeof(buf)); - - if (d + 1 <= de) { - bzero(d, sizeof(*d)); - d->rtaddr.sin6_family = AF_INET6; - d->rtaddr.sin6_len = sizeof(d->rtaddr); - d->rtaddr.sin6_addr = dr->rtaddr; - error = sa6_recoverscope(&d->rtaddr); - if (error != 0) - return (error); - d->flags = dr->flags; - d->rtlifetime = dr->rtlifetime; - d->expire = dr->expire; - d->if_index = dr->ifp->if_index; - } else - panic("buffer too short"); - - error = SYSCTL_OUT(req, buf, sizeof(*d)); - if (error) - break; + d.rtaddr.sin6_addr = dr->rtaddr; + error = sa6_recoverscope(&d.rtaddr); + if (error != 0) + return (error); + d.flags = dr->flags; + d.rtlifetime = dr->rtlifetime; + d.expire = dr->expire; + d.if_index = dr->ifp->if_index; + error = SYSCTL_OUT(req, &d, sizeof(d)); + if (error != 0) + return (error); } - - return (error); + return (0); } static int nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) { - int error; - char buf[1024] __aligned(4); - struct in6_prefix *p, *pe; + struct in6_prefix p; + struct sockaddr_in6 s6; struct nd_prefix *pr; + struct nd_pfxrouter *pfr; + time_t maxexpire; + int error; char ip6buf[INET6_ADDRSTRLEN]; if (req->newptr) - return EPERM; - error = 0; + return (EPERM); + bzero(&p, sizeof(p)); + p.origin = PR_ORIG_RA; + bzero(&s6, sizeof(s6)); + s6.sin6_family = AF_INET6; + s6.sin6_len = sizeof(s6); + + /* + * XXX locking + */ LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { - u_short advrtrs; - size_t advance; - struct sockaddr_in6 *sin6, *s6; - struct nd_pfxrouter *pfr; - - p = (struct in6_prefix *)buf; - pe = (struct in6_prefix *)(buf + sizeof(buf)); - - if (p + 1 <= pe) { - bzero(p, sizeof(*p)); - sin6 = (struct sockaddr_in6 *)(p + 1); - - p->prefix = pr->ndpr_prefix; - if (sa6_recoverscope(&p->prefix)) { + p.prefix = pr->ndpr_prefix; + if (sa6_recoverscope(&p.prefix)) { + log(LOG_ERR, "scope error in prefix list (%s)\n", + ip6_sprintf(ip6buf, &p.prefix.sin6_addr)); + /* XXX: press on... */ + } + p.raflags = pr->ndpr_raf; + p.prefixlen = pr->ndpr_plen; + p.vltime = pr->ndpr_vltime; + p.pltime = pr->ndpr_pltime; + p.if_index = pr->ndpr_ifp->if_index; + if (pr->ndpr_vltime == ND6_INFINITE_LIFETIME) + p.expire = 0; + else { + /* XXX: we assume time_t is signed. */ + maxexpire = (-1) & + ~((time_t)1 << ((sizeof(maxexpire) * 8) - 1)); + if (pr->ndpr_vltime < maxexpire - pr->ndpr_lastupdate) + p.expire = pr->ndpr_lastupdate + + pr->ndpr_vltime; + else + p.expire = maxexpire; + } + p.refcnt = pr->ndpr_refcnt; + p.flags = pr->ndpr_stateflags; + p.advrtrs = 0; + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) + p.advrtrs++; + error = SYSCTL_OUT(req, &p, sizeof(p)); + if (error != 0) + return (error); + LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { + s6.sin6_addr = pfr->router->rtaddr; + if (sa6_recoverscope(&s6)) log(LOG_ERR, "scope error in prefix list (%s)\n", - ip6_sprintf(ip6buf, &p->prefix.sin6_addr)); - /* XXX: press on... */ - } - p->raflags = pr->ndpr_raf; - p->prefixlen = pr->ndpr_plen; - p->vltime = pr->ndpr_vltime; - p->pltime = pr->ndpr_pltime; - p->if_index = pr->ndpr_ifp->if_index; - if (pr->ndpr_vltime == ND6_INFINITE_LIFETIME) - p->expire = 0; - else { - time_t maxexpire; - - /* XXX: we assume time_t is signed. */ - maxexpire = (-1) & - ~((time_t)1 << - ((sizeof(maxexpire) * 8) - 1)); - if (pr->ndpr_vltime < - maxexpire - pr->ndpr_lastupdate) { - p->expire = pr->ndpr_lastupdate + - pr->ndpr_vltime; - } else - p->expire = maxexpire; - } - p->refcnt = pr->ndpr_refcnt; - p->flags = pr->ndpr_stateflags; - p->origin = PR_ORIG_RA; - advrtrs = 0; - LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry) { - if ((void *)&sin6[advrtrs + 1] > (void *)pe) { - advrtrs++; - continue; - } - s6 = &sin6[advrtrs]; - bzero(s6, sizeof(*s6)); - s6->sin6_family = AF_INET6; - s6->sin6_len = sizeof(*sin6); - s6->sin6_addr = pfr->router->rtaddr; - if (sa6_recoverscope(s6)) { - log(LOG_ERR, - "scope error in " - "prefix list (%s)\n", - ip6_sprintf(ip6buf, - &pfr->router->rtaddr)); - } - advrtrs++; - } - p->advrtrs = advrtrs; - } else - panic("buffer too short"); - - advance = sizeof(*p) + sizeof(*sin6) * advrtrs; - error = SYSCTL_OUT(req, buf, advance); - if (error) - break; + ip6_sprintf(ip6buf, &pfr->router->rtaddr)); + error = SYSCTL_OUT(req, &s6, sizeof(s6)); + if (error != 0) + return (error); + } } - - return (error); + return (0); } From owner-svn-src-head@FreeBSD.ORG Sun May 20 06:35:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E6A5106566B; Sun, 20 May 2012 06:35:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7755F8FC14; Sun, 20 May 2012 06:35:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4K6ZNet071930; Sun, 20 May 2012 06:35:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K6ZNIZ071928; Sun, 20 May 2012 06:35:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205200635.q4K6ZNIZ071928@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 May 2012 06:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235682 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 06:35:23 -0000 Author: adrian Date: Sun May 20 06:35:22 2012 New Revision: 235682 URL: http://svn.freebsd.org/changeset/base/235682 Log: Migrate the per-frame code out from ath_rx_proc() to ath_rx_pkt(). This will (eventually) be used by the EDMA RX path used by the AR93xx and later NICs. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun May 20 05:12:31 2012 (r235681) +++ head/sys/dev/ath/if_ath_rx.c Sun May 20 06:35:22 2012 (r235682) @@ -437,6 +437,327 @@ ath_rx_tasklet(void *arg, int npending) ath_rx_proc(sc, 1); } +static int +ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status *rs, HAL_STATUS status, + uint64_t tsf, int nf, struct ath_buf *bf) +{ + struct ath_hal *ah = sc->sc_ah; + struct mbuf *m = bf->bf_m; + uint64_t rstamp; + int len, type; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211_node *ni; + int is_good = 0; + + /* + * Calculate the correct 64 bit TSF given + * the TSF64 register value and rs_tstamp. + */ + rstamp = ath_extend_tsf(sc, rs->rs_tstamp, tsf); + + /* These aren't specifically errors */ +#ifdef AH_SUPPORT_AR5416 + if (rs->rs_flags & HAL_RX_GI) + sc->sc_stats.ast_rx_halfgi++; + if (rs->rs_flags & HAL_RX_2040) + sc->sc_stats.ast_rx_2040++; + if (rs->rs_flags & HAL_RX_DELIM_CRC_PRE) + sc->sc_stats.ast_rx_pre_crc_err++; + if (rs->rs_flags & HAL_RX_DELIM_CRC_POST) + sc->sc_stats.ast_rx_post_crc_err++; + if (rs->rs_flags & HAL_RX_DECRYPT_BUSY) + sc->sc_stats.ast_rx_decrypt_busy_err++; + if (rs->rs_flags & HAL_RX_HI_RX_CHAIN) + sc->sc_stats.ast_rx_hi_rx_chain++; +#endif /* AH_SUPPORT_AR5416 */ + + if (rs->rs_status != 0) { + if (rs->rs_status & HAL_RXERR_CRC) + sc->sc_stats.ast_rx_crcerr++; + if (rs->rs_status & HAL_RXERR_FIFO) + sc->sc_stats.ast_rx_fifoerr++; + if (rs->rs_status & HAL_RXERR_PHY) { + sc->sc_stats.ast_rx_phyerr++; + /* Process DFS radar events */ + if ((rs->rs_phyerr == HAL_PHYERR_RADAR) || + (rs->rs_phyerr == HAL_PHYERR_FALSE_RADAR_EXT)) { + /* Since we're touching the frame data, sync it */ + bus_dmamap_sync(sc->sc_dmat, + bf->bf_dmamap, + BUS_DMASYNC_POSTREAD); + /* Now pass it to the radar processing code */ + ath_dfs_process_phy_err(sc, mtod(m, char *), rstamp, rs); + } + + /* Be suitably paranoid about receiving phy errors out of the stats array bounds */ + if (rs->rs_phyerr < 64) + sc->sc_stats.ast_rx_phy[rs->rs_phyerr]++; + goto rx_error; /* NB: don't count in ierrors */ + } + if (rs->rs_status & HAL_RXERR_DECRYPT) { + /* + * Decrypt error. If the error occurred + * because there was no hardware key, then + * let the frame through so the upper layers + * can process it. This is necessary for 5210 + * parts which have no way to setup a ``clear'' + * key cache entry. + * + * XXX do key cache faulting + */ + if (rs->rs_keyix == HAL_RXKEYIX_INVALID) + goto rx_accept; + sc->sc_stats.ast_rx_badcrypt++; + } + if (rs->rs_status & HAL_RXERR_MIC) { + sc->sc_stats.ast_rx_badmic++; + /* + * Do minimal work required to hand off + * the 802.11 header for notification. + */ + /* XXX frag's and qos frames */ + len = rs->rs_datalen; + if (len >= sizeof (struct ieee80211_frame)) { + bus_dmamap_sync(sc->sc_dmat, + bf->bf_dmamap, + BUS_DMASYNC_POSTREAD); + ath_handle_micerror(ic, + mtod(m, struct ieee80211_frame *), + sc->sc_splitmic ? + rs->rs_keyix-32 : rs->rs_keyix); + } + } + ifp->if_ierrors++; +rx_error: + /* + * Cleanup any pending partial frame. + */ + if (sc->sc_rxpending != NULL) { + m_freem(sc->sc_rxpending); + sc->sc_rxpending = NULL; + } + /* + * When a tap is present pass error frames + * that have been requested. By default we + * pass decrypt+mic errors but others may be + * interesting (e.g. crc). + */ + if (ieee80211_radiotap_active(ic) && + (rs->rs_status & sc->sc_monpass)) { + bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, + BUS_DMASYNC_POSTREAD); + /* NB: bpf needs the mbuf length setup */ + len = rs->rs_datalen; + m->m_pkthdr.len = m->m_len = len; + bf->bf_m = NULL; + ath_rx_tap(ifp, m, rs, rstamp, nf); + ieee80211_radiotap_rx_all(ic, m); + m_freem(m); + } + /* XXX pass MIC errors up for s/w reclaculation */ + goto rx_next; + } +rx_accept: + /* + * Sync and unmap the frame. At this point we're + * committed to passing the mbuf somewhere so clear + * bf_m; this means a new mbuf must be allocated + * when the rx descriptor is setup again to receive + * another frame. + */ + bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); + bf->bf_m = NULL; + + len = rs->rs_datalen; + m->m_len = len; + + if (rs->rs_more) { + /* + * Frame spans multiple descriptors; save + * it for the next completed descriptor, it + * will be used to construct a jumbogram. + */ + if (sc->sc_rxpending != NULL) { + /* NB: max frame size is currently 2 clusters */ + sc->sc_stats.ast_rx_toobig++; + m_freem(sc->sc_rxpending); + } + m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.len = len; + sc->sc_rxpending = m; + goto rx_next; + } else if (sc->sc_rxpending != NULL) { + /* + * This is the second part of a jumbogram, + * chain it to the first mbuf, adjust the + * frame length, and clear the rxpending state. + */ + sc->sc_rxpending->m_next = m; + sc->sc_rxpending->m_pkthdr.len += len; + m = sc->sc_rxpending; + sc->sc_rxpending = NULL; + } else { + /* + * Normal single-descriptor receive; setup + * the rcvif and packet length. + */ + m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.len = len; + } + + /* + * Validate rs->rs_antenna. + * + * Some users w/ AR9285 NICs have reported crashes + * here because rs_antenna field is bogusly large. + * Let's enforce the maximum antenna limit of 8 + * (and it shouldn't be hard coded, but that's a + * separate problem) and if there's an issue, print + * out an error and adjust rs_antenna to something + * sensible. + * + * This code should be removed once the actual + * root cause of the issue has been identified. + * For example, it may be that the rs_antenna + * field is only valid for the lsat frame of + * an aggregate and it just happens that it is + * "mostly" right. (This is a general statement - + * the majority of the statistics are only valid + * for the last frame in an aggregate. + */ + if (rs->rs_antenna > 7) { + device_printf(sc->sc_dev, "%s: rs_antenna > 7 (%d)\n", + __func__, rs->rs_antenna); +#ifdef ATH_DEBUG + ath_printrxbuf(sc, bf, 0, status == HAL_OK); +#endif /* ATH_DEBUG */ + rs->rs_antenna = 0; /* XXX better than nothing */ + } + + ifp->if_ipackets++; + sc->sc_stats.ast_ant_rx[rs->rs_antenna]++; + + /* + * Populate the rx status block. When there are bpf + * listeners we do the additional work to provide + * complete status. Otherwise we fill in only the + * material required by ieee80211_input. Note that + * noise setting is filled in above. + */ + if (ieee80211_radiotap_active(ic)) + ath_rx_tap(ifp, m, rs, rstamp, nf); + + /* + * From this point on we assume the frame is at least + * as large as ieee80211_frame_min; verify that. + */ + if (len < IEEE80211_MIN_LEN) { + if (!ieee80211_radiotap_active(ic)) { + DPRINTF(sc, ATH_DEBUG_RECV, + "%s: short packet %d\n", __func__, len); + sc->sc_stats.ast_rx_tooshort++; + } else { + /* NB: in particular this captures ack's */ + ieee80211_radiotap_rx_all(ic, m); + } + m_freem(m); + goto rx_next; + } + + if (IFF_DUMPPKTS(sc, ATH_DEBUG_RECV)) { + const HAL_RATE_TABLE *rt = sc->sc_currates; + uint8_t rix = rt->rateCodeToIndex[rs->rs_rate]; + + ieee80211_dump_pkt(ic, mtod(m, caddr_t), len, + sc->sc_hwmap[rix].ieeerate, rs->rs_rssi); + } + + m_adj(m, -IEEE80211_CRC_LEN); + + /* + * Locate the node for sender, track state, and then + * pass the (referenced) node up to the 802.11 layer + * for its use. + */ + ni = ieee80211_find_rxnode_withkey(ic, + mtod(m, const struct ieee80211_frame_min *), + rs->rs_keyix == HAL_RXKEYIX_INVALID ? + IEEE80211_KEYIX_NONE : rs->rs_keyix); + sc->sc_lastrs = rs; + +#ifdef AH_SUPPORT_AR5416 + if (rs->rs_isaggr) + sc->sc_stats.ast_rx_agg++; +#endif /* AH_SUPPORT_AR5416 */ + + if (ni != NULL) { + /* + * Only punt packets for ampdu reorder processing for + * 11n nodes; net80211 enforces that M_AMPDU is only + * set for 11n nodes. + */ + if (ni->ni_flags & IEEE80211_NODE_HT) + m->m_flags |= M_AMPDU; + + /* + * Sending station is known, dispatch directly. + */ + type = ieee80211_input(ni, m, rs->rs_rssi, nf); + ieee80211_free_node(ni); + /* + * Arrange to update the last rx timestamp only for + * frames from our ap when operating in station mode. + * This assumes the rx key is always setup when + * associated. + */ + if (ic->ic_opmode == IEEE80211_M_STA && + rs->rs_keyix != HAL_RXKEYIX_INVALID) + is_good = 1; + } else { + type = ieee80211_input_all(ic, m, rs->rs_rssi, nf); + } + /* + * Track rx rssi and do any rx antenna management. + */ + ATH_RSSI_LPF(sc->sc_halstats.ns_avgrssi, rs->rs_rssi); + if (sc->sc_diversity) { + /* + * When using fast diversity, change the default rx + * antenna if diversity chooses the other antenna 3 + * times in a row. + */ + if (sc->sc_defant != rs->rs_antenna) { + if (++sc->sc_rxotherant >= 3) + ath_setdefantenna(sc, rs->rs_antenna); + } else + sc->sc_rxotherant = 0; + } + + /* Newer school diversity - kite specific for now */ + /* XXX perhaps migrate the normal diversity code to this? */ + if ((ah)->ah_rxAntCombDiversity) + (*(ah)->ah_rxAntCombDiversity)(ah, rs, ticks, hz); + + if (sc->sc_softled) { + /* + * Blink for any data frame. Otherwise do a + * heartbeat-style blink when idle. The latter + * is mainly for station mode where we depend on + * periodic beacon frames to trigger the poll event. + */ + if (type == IEEE80211_FC0_TYPE_DATA) { + const HAL_RATE_TABLE *rt = sc->sc_currates; + ath_led_event(sc, + rt->rateCodeToIndex[rs->rs_rate]); + } else if (ticks - sc->sc_ledevent >= sc->sc_ledidle) + ath_led_event(sc, 0); + } +rx_next: + return (is_good); +} + void ath_rx_proc(struct ath_softc *sc, int resched) { @@ -450,11 +771,10 @@ ath_rx_proc(struct ath_softc *sc, int re struct ath_desc *ds; struct ath_rx_status *rs; struct mbuf *m; - struct ieee80211_node *ni; - int len, type, ngood; + int ngood; HAL_STATUS status; int16_t nf; - u_int64_t tsf, rstamp; + u_int64_t tsf; int npkts = 0; /* XXX we must not hold the ATH_LOCK here */ @@ -492,7 +812,7 @@ ath_rx_proc(struct ath_softc *sc, int re /* XXX make debug msg */ if_printf(ifp, "%s: no mbuf!\n", __func__); TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); - goto rx_next; + goto rx_proc_next; } ds = bf->bf_desc; if (ds->ds_link == bf->bf_daddr) { @@ -526,311 +846,11 @@ ath_rx_proc(struct ath_softc *sc, int re npkts++; /* - * Calculate the correct 64 bit TSF given - * the TSF64 register value and rs_tstamp. + * Process a single frame. */ - rstamp = ath_extend_tsf(sc, rs->rs_tstamp, tsf); - - /* These aren't specifically errors */ -#ifdef AH_SUPPORT_AR5416 - if (rs->rs_flags & HAL_RX_GI) - sc->sc_stats.ast_rx_halfgi++; - if (rs->rs_flags & HAL_RX_2040) - sc->sc_stats.ast_rx_2040++; - if (rs->rs_flags & HAL_RX_DELIM_CRC_PRE) - sc->sc_stats.ast_rx_pre_crc_err++; - if (rs->rs_flags & HAL_RX_DELIM_CRC_POST) - sc->sc_stats.ast_rx_post_crc_err++; - if (rs->rs_flags & HAL_RX_DECRYPT_BUSY) - sc->sc_stats.ast_rx_decrypt_busy_err++; - if (rs->rs_flags & HAL_RX_HI_RX_CHAIN) - sc->sc_stats.ast_rx_hi_rx_chain++; -#endif /* AH_SUPPORT_AR5416 */ - - if (rs->rs_status != 0) { - if (rs->rs_status & HAL_RXERR_CRC) - sc->sc_stats.ast_rx_crcerr++; - if (rs->rs_status & HAL_RXERR_FIFO) - sc->sc_stats.ast_rx_fifoerr++; - if (rs->rs_status & HAL_RXERR_PHY) { - sc->sc_stats.ast_rx_phyerr++; - /* Process DFS radar events */ - if ((rs->rs_phyerr == HAL_PHYERR_RADAR) || - (rs->rs_phyerr == HAL_PHYERR_FALSE_RADAR_EXT)) { - /* Since we're touching the frame data, sync it */ - bus_dmamap_sync(sc->sc_dmat, - bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - /* Now pass it to the radar processing code */ - ath_dfs_process_phy_err(sc, mtod(m, char *), rstamp, rs); - } - - /* Be suitably paranoid about receiving phy errors out of the stats array bounds */ - if (rs->rs_phyerr < 64) - sc->sc_stats.ast_rx_phy[rs->rs_phyerr]++; - goto rx_error; /* NB: don't count in ierrors */ - } - if (rs->rs_status & HAL_RXERR_DECRYPT) { - /* - * Decrypt error. If the error occurred - * because there was no hardware key, then - * let the frame through so the upper layers - * can process it. This is necessary for 5210 - * parts which have no way to setup a ``clear'' - * key cache entry. - * - * XXX do key cache faulting - */ - if (rs->rs_keyix == HAL_RXKEYIX_INVALID) - goto rx_accept; - sc->sc_stats.ast_rx_badcrypt++; - } - if (rs->rs_status & HAL_RXERR_MIC) { - sc->sc_stats.ast_rx_badmic++; - /* - * Do minimal work required to hand off - * the 802.11 header for notification. - */ - /* XXX frag's and qos frames */ - len = rs->rs_datalen; - if (len >= sizeof (struct ieee80211_frame)) { - bus_dmamap_sync(sc->sc_dmat, - bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - ath_handle_micerror(ic, - mtod(m, struct ieee80211_frame *), - sc->sc_splitmic ? - rs->rs_keyix-32 : rs->rs_keyix); - } - } - ifp->if_ierrors++; -rx_error: - /* - * Cleanup any pending partial frame. - */ - if (sc->sc_rxpending != NULL) { - m_freem(sc->sc_rxpending); - sc->sc_rxpending = NULL; - } - /* - * When a tap is present pass error frames - * that have been requested. By default we - * pass decrypt+mic errors but others may be - * interesting (e.g. crc). - */ - if (ieee80211_radiotap_active(ic) && - (rs->rs_status & sc->sc_monpass)) { - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - /* NB: bpf needs the mbuf length setup */ - len = rs->rs_datalen; - m->m_pkthdr.len = m->m_len = len; - bf->bf_m = NULL; - ath_rx_tap(ifp, m, rs, rstamp, nf); - ieee80211_radiotap_rx_all(ic, m); - m_freem(m); - } - /* XXX pass MIC errors up for s/w reclaculation */ - goto rx_next; - } -rx_accept: - /* - * Sync and unmap the frame. At this point we're - * committed to passing the mbuf somewhere so clear - * bf_m; this means a new mbuf must be allocated - * when the rx descriptor is setup again to receive - * another frame. - */ - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - bf->bf_m = NULL; - - len = rs->rs_datalen; - m->m_len = len; - - if (rs->rs_more) { - /* - * Frame spans multiple descriptors; save - * it for the next completed descriptor, it - * will be used to construct a jumbogram. - */ - if (sc->sc_rxpending != NULL) { - /* NB: max frame size is currently 2 clusters */ - sc->sc_stats.ast_rx_toobig++; - m_freem(sc->sc_rxpending); - } - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = len; - sc->sc_rxpending = m; - goto rx_next; - } else if (sc->sc_rxpending != NULL) { - /* - * This is the second part of a jumbogram, - * chain it to the first mbuf, adjust the - * frame length, and clear the rxpending state. - */ - sc->sc_rxpending->m_next = m; - sc->sc_rxpending->m_pkthdr.len += len; - m = sc->sc_rxpending; - sc->sc_rxpending = NULL; - } else { - /* - * Normal single-descriptor receive; setup - * the rcvif and packet length. - */ - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = len; - } - - /* - * Validate rs->rs_antenna. - * - * Some users w/ AR9285 NICs have reported crashes - * here because rs_antenna field is bogusly large. - * Let's enforce the maximum antenna limit of 8 - * (and it shouldn't be hard coded, but that's a - * separate problem) and if there's an issue, print - * out an error and adjust rs_antenna to something - * sensible. - * - * This code should be removed once the actual - * root cause of the issue has been identified. - * For example, it may be that the rs_antenna - * field is only valid for the lsat frame of - * an aggregate and it just happens that it is - * "mostly" right. (This is a general statement - - * the majority of the statistics are only valid - * for the last frame in an aggregate. - */ - if (rs->rs_antenna > 7) { - device_printf(sc->sc_dev, "%s: rs_antenna > 7 (%d)\n", - __func__, rs->rs_antenna); -#ifdef ATH_DEBUG - ath_printrxbuf(sc, bf, 0, status == HAL_OK); -#endif /* ATH_DEBUG */ - rs->rs_antenna = 0; /* XXX better than nothing */ - } - - ifp->if_ipackets++; - sc->sc_stats.ast_ant_rx[rs->rs_antenna]++; - - /* - * Populate the rx status block. When there are bpf - * listeners we do the additional work to provide - * complete status. Otherwise we fill in only the - * material required by ieee80211_input. Note that - * noise setting is filled in above. - */ - if (ieee80211_radiotap_active(ic)) - ath_rx_tap(ifp, m, rs, rstamp, nf); - - /* - * From this point on we assume the frame is at least - * as large as ieee80211_frame_min; verify that. - */ - if (len < IEEE80211_MIN_LEN) { - if (!ieee80211_radiotap_active(ic)) { - DPRINTF(sc, ATH_DEBUG_RECV, - "%s: short packet %d\n", __func__, len); - sc->sc_stats.ast_rx_tooshort++; - } else { - /* NB: in particular this captures ack's */ - ieee80211_radiotap_rx_all(ic, m); - } - m_freem(m); - goto rx_next; - } - - if (IFF_DUMPPKTS(sc, ATH_DEBUG_RECV)) { - const HAL_RATE_TABLE *rt = sc->sc_currates; - uint8_t rix = rt->rateCodeToIndex[rs->rs_rate]; - - ieee80211_dump_pkt(ic, mtod(m, caddr_t), len, - sc->sc_hwmap[rix].ieeerate, rs->rs_rssi); - } - - m_adj(m, -IEEE80211_CRC_LEN); - - /* - * Locate the node for sender, track state, and then - * pass the (referenced) node up to the 802.11 layer - * for its use. - */ - ni = ieee80211_find_rxnode_withkey(ic, - mtod(m, const struct ieee80211_frame_min *), - rs->rs_keyix == HAL_RXKEYIX_INVALID ? - IEEE80211_KEYIX_NONE : rs->rs_keyix); - sc->sc_lastrs = rs; - -#ifdef AH_SUPPORT_AR5416 - if (rs->rs_isaggr) - sc->sc_stats.ast_rx_agg++; -#endif /* AH_SUPPORT_AR5416 */ - - if (ni != NULL) { - /* - * Only punt packets for ampdu reorder processing for - * 11n nodes; net80211 enforces that M_AMPDU is only - * set for 11n nodes. - */ - if (ni->ni_flags & IEEE80211_NODE_HT) - m->m_flags |= M_AMPDU; - - /* - * Sending station is known, dispatch directly. - */ - type = ieee80211_input(ni, m, rs->rs_rssi, nf); - ieee80211_free_node(ni); - /* - * Arrange to update the last rx timestamp only for - * frames from our ap when operating in station mode. - * This assumes the rx key is always setup when - * associated. - */ - if (ic->ic_opmode == IEEE80211_M_STA && - rs->rs_keyix != HAL_RXKEYIX_INVALID) - ngood++; - } else { - type = ieee80211_input_all(ic, m, rs->rs_rssi, nf); - } - /* - * Track rx rssi and do any rx antenna management. - */ - ATH_RSSI_LPF(sc->sc_halstats.ns_avgrssi, rs->rs_rssi); - if (sc->sc_diversity) { - /* - * When using fast diversity, change the default rx - * antenna if diversity chooses the other antenna 3 - * times in a row. - */ - if (sc->sc_defant != rs->rs_antenna) { - if (++sc->sc_rxotherant >= 3) - ath_setdefantenna(sc, rs->rs_antenna); - } else - sc->sc_rxotherant = 0; - } - - /* Newer school diversity - kite specific for now */ - /* XXX perhaps migrate the normal diversity code to this? */ - if ((ah)->ah_rxAntCombDiversity) - (*(ah)->ah_rxAntCombDiversity)(ah, rs, ticks, hz); - - if (sc->sc_softled) { - /* - * Blink for any data frame. Otherwise do a - * heartbeat-style blink when idle. The latter - * is mainly for station mode where we depend on - * periodic beacon frames to trigger the poll event. - */ - if (type == IEEE80211_FC0_TYPE_DATA) { - const HAL_RATE_TABLE *rt = sc->sc_currates; - ath_led_event(sc, - rt->rateCodeToIndex[rs->rs_rate]); - } else if (ticks - sc->sc_ledevent >= sc->sc_ledidle) - ath_led_event(sc, 0); - } -rx_next: + if (ath_rx_pkt(sc, rs, status, tsf, nf, bf)) + ngood++; +rx_proc_next: TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); } while (ath_rxbuf_init(sc, bf) == 0); From owner-svn-src-head@FreeBSD.ORG Sun May 20 08:17:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A1956106567B; Sun, 20 May 2012 08:17:21 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B80F8FC17; Sun, 20 May 2012 08:17:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4K8HLOp076392; Sun, 20 May 2012 08:17:21 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K8HLAu076389; Sun, 20 May 2012 08:17:21 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201205200817.q4K8HLAu076389@svn.freebsd.org> From: Mitsuru IWASAKI Date: Sun, 20 May 2012 08:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235683 - in head/sys/i386: i386 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 08:17:21 -0000 Author: iwasaki Date: Sun May 20 08:17:20 2012 New Revision: 235683 URL: http://svn.freebsd.org/changeset/base/235683 Log: Remove cpususpend IDT vector for XEN. This broke XEN kernel building. Modified: head/sys/i386/i386/apic_vector.s head/sys/i386/include/smp.h Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Sun May 20 06:35:22 2012 (r235682) +++ head/sys/i386/i386/apic_vector.s Sun May 20 08:17:20 2012 (r235683) @@ -336,6 +336,7 @@ IDTVEC(cpustop) /* * Executed by a CPU when it receives an IPI_SUSPEND from another CPU. */ +#ifndef XEN .text SUPERALIGN_TEXT IDTVEC(cpususpend) @@ -350,6 +351,7 @@ IDTVEC(cpususpend) POP_FRAME jmp doreti_iret +#endif /* * Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU. Modified: head/sys/i386/include/smp.h ============================================================================== --- head/sys/i386/include/smp.h Sun May 20 06:35:22 2012 (r235682) +++ head/sys/i386/include/smp.h Sun May 20 08:17:20 2012 (r235683) @@ -60,7 +60,9 @@ inthand_t /* functions in mp_machdep.c */ void cpu_add(u_int apic_id, char boot_cpu); void cpustop_handler(void); +#ifndef XEN void cpususpend_handler(void); +#endif void init_secondary(void); void ipi_all_but_self(u_int ipi); #ifndef XEN From owner-svn-src-head@FreeBSD.ORG Sun May 20 09:29:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76CA81065672; Sun, 20 May 2012 09:29:15 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 617D08FC12; Sun, 20 May 2012 09:29:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4K9TFUn079630; Sun, 20 May 2012 09:29:15 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K9TEss079628; Sun, 20 May 2012 09:29:14 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205200929.q4K9TEss079628@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 20 May 2012 09:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235684 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 09:29:15 -0000 Author: bschmidt Date: Sun May 20 09:29:14 2012 New Revision: 235684 URL: http://svn.freebsd.org/changeset/base/235684 Log: Add some more 100/130 series device IDs. MFC after: 3 days Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 20 08:17:20 2012 (r235683) +++ head/sys/dev/iwn/if_iwn.c Sun May 20 09:29:14 2012 (r235684) @@ -92,6 +92,9 @@ static const struct iwn_ident iwn_ident_ { 0x8086, 0x0885, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0886, "Intel Centrino Wireless-N + WiMAX 6150" }, { 0x8086, 0x0896, "Intel Centrino Wireless-N 130" }, + { 0x8086, 0x0887, "Intel Centrino Wireless-N 130" }, + { 0x8086, 0x08ae, "Intel Centrino Wireless-N 100" }, + { 0x8086, 0x08af, "Intel Centrino Wireless-N 100" }, { 0x8086, 0x4229, "Intel Wireless WiFi Link 4965" }, { 0x8086, 0x422b, "Intel Centrino Ultimate-N 6300" }, { 0x8086, 0x422c, "Intel Centrino Advanced-N 6200" }, From owner-svn-src-head@FreeBSD.ORG Sun May 20 09:46:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D49E106566C; Sun, 20 May 2012 09:46:50 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76DAE8FC08; Sun, 20 May 2012 09:46:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4K9knxE080442; Sun, 20 May 2012 09:46:49 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4K9kmxS080440; Sun, 20 May 2012 09:46:49 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205200946.q4K9kmxS080440@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 20 May 2012 09:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235685 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 09:46:50 -0000 Author: bschmidt Date: Sun May 20 09:46:48 2012 New Revision: 235685 URL: http://svn.freebsd.org/changeset/base/235685 Log: Remove unused variable. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun May 20 09:29:14 2012 (r235684) +++ head/sys/dev/ath/if_ath_rx.c Sun May 20 09:46:48 2012 (r235685) @@ -766,7 +766,6 @@ ath_rx_proc(struct ath_softc *sc, int re ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) struct ath_buf *bf; struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; struct ath_desc *ds; struct ath_rx_status *rs; From owner-svn-src-head@FreeBSD.ORG Sun May 20 10:00:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07F281065672; Sun, 20 May 2012 10:00:37 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E73508FC15; Sun, 20 May 2012 10:00:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4KA0a1m081123; Sun, 20 May 2012 10:00:36 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KA0aCg081121; Sun, 20 May 2012 10:00:36 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205201000.q4KA0aCg081121@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 20 May 2012 10:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235686 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 10:00:37 -0000 Author: bschmidt Date: Sun May 20 10:00:36 2012 New Revision: 235686 URL: http://svn.freebsd.org/changeset/base/235686 Log: Discard frames after a DELBA which where queued during an active BA session. MFC after: 1 week Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 20 09:46:48 2012 (r235685) +++ head/sys/dev/iwn/if_iwn.c Sun May 20 10:00:36 2012 (r235686) @@ -3314,6 +3314,11 @@ iwn_tx_data(struct iwn_softc *sc, struct if (m->m_flags & M_AMPDU_MPDU) { struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac]; + if (!IEEE80211_AMPDU_RUNNING(tap)) { + m_freem(m); + return EINVAL; + } + ac = *(int *)tap->txa_private; *(uint16_t *)wh->i_seq = htole16(ni->ni_txseqs[tid] << IEEE80211_SEQ_SEQ_SHIFT); From owner-svn-src-head@FreeBSD.ORG Sun May 20 10:02:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DABB6106566B; Sun, 20 May 2012 10:02:24 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C45BC8FC23; Sun, 20 May 2012 10:02:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4KA2Oe9081241; Sun, 20 May 2012 10:02:24 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KA2OgE081239; Sun, 20 May 2012 10:02:24 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201205201002.q4KA2OgE081239@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 20 May 2012 10:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235687 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 10:02:25 -0000 Author: bschmidt Date: Sun May 20 10:02:24 2012 New Revision: 235687 URL: http://svn.freebsd.org/changeset/base/235687 Log: remove unused vap variable MFC after: 1 week Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 20 10:00:36 2012 (r235686) +++ head/sys/dev/iwn/if_iwn.c Sun May 20 10:02:24 2012 (r235687) @@ -2767,7 +2767,6 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, struct mbuf *m; struct iwn_node *wn; struct ieee80211_node *ni; - struct ieee80211vap *vap; struct ieee80211_tx_ampdu *tap; uint64_t bitmap; uint32_t *status = stat; @@ -2826,7 +2825,6 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, bus_dmamap_unload(ring->data_dmat, data->map); m = data->m, data->m = NULL; ni = data->ni, data->ni = NULL; - vap = ni->ni_vap; if (m->m_flags & M_TXCB) ieee80211_process_callback(ni, m, 1); From owner-svn-src-head@FreeBSD.ORG Sun May 20 11:10:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D2401065674; Sun, 20 May 2012 11:10:11 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id E3A318FC0A; Sun, 20 May 2012 11:10:05 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 1C3FE436; Sun, 20 May 2012 13:09:58 +0200 (CEST) Date: Sun, 20 May 2012 13:08:15 +0200 From: Pawel Jakub Dawidek To: Andriy Gapon Message-ID: <20120520110815.GB1442@garage.freebsd.pl> References: <201205151707.q4FH7UDU096834@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H1spWtNR+x+ondvy" Content-Disposition: inline In-Reply-To: <201205151707.q4FH7UDU096834@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235478 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 11:10:11 -0000 --H1spWtNR+x+ondvy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 15, 2012 at 05:07:30PM +0000, Andriy Gapon wrote: > Author: avg > Date: Tue May 15 17:07:29 2012 > New Revision: 235478 > URL: http://svn.freebsd.org/changeset/base/235478 >=20 > Log: > zpool_do_import: use /dev instead of /dev/dsk as a default > =20 > This affects behavior of zpool import without -d option. How does it affect 'zpool import' behaviour? On FreeBSD when -d is not given we should not scan entire /dev/, but take all available GEOM providers from the GEOM. > Reported by: Bruce Cran > Submitted by: Fabian Keil > MFC after: 2 weeks >=20 > Modified: > head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c >=20 > Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue May 15 16:17= :30 2012 (r235477) > +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue May 15 17:07= :29 2012 (r235478) > @@ -1909,7 +1909,7 @@ zpool_do_import(int argc, char **argv) > =20 > if (searchdirs =3D=3D NULL) { > searchdirs =3D safe_malloc(sizeof (char *)); > - searchdirs[0] =3D "/dev/dsk"; > + searchdirs[0] =3D "/dev"; > nsearch =3D 1; > } > =20 --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --H1spWtNR+x+ondvy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+40J8ACgkQForvXbEpPzSXTACcC0daM1NfstkhhgBZ/vgysnCR msIAnRvbehJca4LAwyzQ7b3Zh+K1xdZZ =4l9w -----END PGP SIGNATURE----- --H1spWtNR+x+ondvy-- From owner-svn-src-head@FreeBSD.ORG Sun May 20 14:33:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2D3C106564A; Sun, 20 May 2012 14:33:29 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82C018FC15; Sun, 20 May 2012 14:33:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4KEXTK6097301; Sun, 20 May 2012 14:33:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KEXTsi097295; Sun, 20 May 2012 14:33:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201205201433.q4KEXTsi097295@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 May 2012 14:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235689 - in head/sys: powerpc/aim powerpc/include powerpc/powerpc vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 14:33:29 -0000 Author: nwhitehorn Date: Sun May 20 14:33:28 2012 New Revision: 235689 URL: http://svn.freebsd.org/changeset/base/235689 Log: Replace the list of PVOs owned by each PMAP with an RB tree. This simplifies range operations like pmap_remove() and pmap_protect() as well as allowing simple operations like pmap_extract() not to involve any global state. This substantially reduces lock coverages for the global table lock and improves concurrency. Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/include/pmap.h head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/vm/vm_page.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sun May 20 14:15:13 2012 (r235688) +++ head/sys/powerpc/aim/mmu_oea.c Sun May 20 14:33:28 2012 (r235689) @@ -857,7 +857,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k for (i = 0; i < 16; i++) kernel_pmap->pm_sr[i] = EMPTY_SEGMENT + i; CPU_FILL(&kernel_pmap->pm_active); - LIST_INIT(&kernel_pmap->pmap_pvo); + RB_INIT(&kernel_pmap->pmap_pvo); /* * Set up the Open Firmware mappings @@ -1587,7 +1587,7 @@ moea_pinit(mmu_t mmu, pmap_t pmap) KASSERT((int)pmap < VM_MIN_KERNEL_ADDRESS, ("moea_pinit: virt pmap")); PMAP_LOCK_INIT(pmap); - LIST_INIT(&pmap->pmap_pvo); + RB_INIT(&pmap->pmap_pvo); entropy = 0; __asm __volatile("mftb %0" : "=r"(entropy)); @@ -1661,9 +1661,8 @@ void moea_protect(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { - struct pvo_entry *pvo; + struct pvo_entry *pvo, *tpvo, key; struct pte *pt; - int pteidx; KASSERT(pm == &curproc->p_vmspace->vm_pmap || pm == kernel_pmap, ("moea_protect: non current pmap")); @@ -1675,11 +1674,10 @@ moea_protect(mmu_t mmu, pmap_t pm, vm_of vm_page_lock_queues(); PMAP_LOCK(pm); - for (; sva < eva; sva += PAGE_SIZE) { - pvo = moea_pvo_find_va(pm, sva, &pteidx); - if (pvo == NULL) - continue; - + key.pvo_vaddr = sva; + for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key); + pvo != NULL && PVO_VADDR(pvo) < eva; pvo = tpvo) { + tpvo = RB_NEXT(pvo_tree, &pm->pmap_pvo, pvo); if ((prot & VM_PROT_EXECUTE) == 0) pvo->pvo_vaddr &= ~PVO_EXECUTABLE; @@ -1687,7 +1685,7 @@ moea_protect(mmu_t mmu, pmap_t pm, vm_of * Grab the PTE pointer before we diddle with the cached PTE * copy. */ - pt = moea_pvo_to_pte(pvo, pteidx); + pt = moea_pvo_to_pte(pvo, -1); /* * Change the protection of the page. */ @@ -1766,23 +1764,15 @@ moea_release(mmu_t mmu, pmap_t pmap) void moea_remove(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva) { - struct pvo_entry *pvo, *tpvo; - int pteidx; + struct pvo_entry *pvo, *tpvo, key; vm_page_lock_queues(); PMAP_LOCK(pm); - if ((eva - sva)/PAGE_SIZE < 10) { - for (; sva < eva; sva += PAGE_SIZE) { - pvo = moea_pvo_find_va(pm, sva, &pteidx); - if (pvo != NULL) - moea_pvo_remove(pvo, pteidx); - } - } else { - LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo) { - if (PVO_VADDR(pvo) < sva || PVO_VADDR(pvo) >= eva) - continue; - moea_pvo_remove(pvo, -1); - } + key.pvo_vaddr = sva; + for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key); + pvo != NULL && PVO_VADDR(pvo) < eva; pvo = tpvo) { + tpvo = RB_NEXT(pvo_tree, &pm->pmap_pvo, pvo); + moea_pvo_remove(pvo, -1); } PMAP_UNLOCK(pm); vm_page_unlock_queues(); @@ -1946,7 +1936,7 @@ moea_pvo_enter(pmap_t pm, uma_zone_t zon /* * Add to pmap list */ - LIST_INSERT_HEAD(&pm->pmap_pvo, pvo, pvo_plink); + RB_INSERT(pvo_tree, &pm->pmap_pvo, pvo); /* * Remember if the list was empty and therefore will be the first @@ -2017,7 +2007,7 @@ moea_pvo_remove(struct pvo_entry *pvo, i * Remove this PVO from the PV and pmap lists. */ LIST_REMOVE(pvo, pvo_vlink); - LIST_REMOVE(pvo, pvo_plink); + RB_REMOVE(pvo_tree, &pvo->pvo_pmap->pmap_pvo, pvo); /* * Remove this from the overflow list and return it to the pool Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sun May 20 14:15:13 2012 (r235688) +++ head/sys/powerpc/aim/mmu_oea64.c Sun May 20 14:33:28 2012 (r235689) @@ -223,8 +223,6 @@ u_int moea64_pteg_mask; * PVO data. */ struct pvo_head *moea64_pvo_table; /* pvo entries by pteg index */ -struct pvo_head moea64_pvo_kunmanaged = /* list of unmanaged pages */ - LIST_HEAD_INITIALIZER(moea64_pvo_kunmanaged); uma_zone_t moea64_upvo_zone; /* zone for pvo entries for unmanaged pages */ uma_zone_t moea64_mpvo_zone; /* zone for pvo entries for managed pages */ @@ -622,8 +620,8 @@ moea64_setup_direct_map(mmu_t mmup, vm_o pte_lo |= LPTE_G; moea64_pvo_enter(mmup, kernel_pmap, moea64_upvo_zone, - &moea64_pvo_kunmanaged, pa, pa, - pte_lo, PVO_WIRED | PVO_LARGE); + NULL, pa, pa, pte_lo, + PVO_WIRED | PVO_LARGE); } } PMAP_UNLOCK(kernel_pmap); @@ -820,7 +818,7 @@ moea64_mid_bootstrap(mmu_t mmup, vm_offs kernel_pmap->pmap_phys = kernel_pmap; CPU_FILL(&kernel_pmap->pm_active); - LIST_INIT(&kernel_pmap->pmap_pvo); + RB_INIT(&kernel_pmap->pmap_pvo); PMAP_LOCK_INIT(kernel_pmap); @@ -1179,7 +1177,7 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_ int error; if (!moea64_initialized) { - pvo_head = &moea64_pvo_kunmanaged; + pvo_head = NULL; pg = NULL; zone = moea64_upvo_zone; pvo_flags = 0; @@ -1197,7 +1195,7 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_ /* XXX change the pvo head for fake pages */ if ((m->oflags & VPO_UNMANAGED) != 0) { pvo_flags &= ~PVO_MANAGED; - pvo_head = &moea64_pvo_kunmanaged; + pvo_head = NULL; zone = moea64_upvo_zone; } @@ -1315,7 +1313,6 @@ moea64_extract(mmu_t mmu, pmap_t pm, vm_ struct pvo_entry *pvo; vm_paddr_t pa; - LOCK_TABLE_RD(); PMAP_LOCK(pm); pvo = moea64_pvo_find_va(pm, va); if (pvo == NULL) @@ -1323,7 +1320,6 @@ moea64_extract(mmu_t mmu, pmap_t pm, vm_ else pa = (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) | (va - PVO_VADDR(pvo)); - UNLOCK_TABLE_RD(); PMAP_UNLOCK(pm); return (pa); } @@ -1333,37 +1329,6 @@ moea64_extract(mmu_t mmu, pmap_t pm, vm_ * pmap and virtual address pair if that mapping permits the given * protection. */ - -extern int pa_tryrelock_restart; - -static int -vm_page_pa_tryrelock_moea64(pmap_t pmap, vm_paddr_t pa, vm_paddr_t *locked) -{ - /* - * This is a duplicate of vm_page_pa_tryrelock(), but with proper - * handling of the table lock - */ - vm_paddr_t lockpa; - - lockpa = *locked; - *locked = pa; - if (lockpa) { - PA_LOCK_ASSERT(lockpa, MA_OWNED); - if (PA_LOCKPTR(pa) == PA_LOCKPTR(lockpa)) - return (0); - PA_UNLOCK(lockpa); - } - if (PA_TRYLOCK(pa)) - return (0); - UNLOCK_TABLE_RD(); - PMAP_UNLOCK(pmap); - atomic_add_int(&pa_tryrelock_restart, 1); - PA_LOCK(pa); - LOCK_TABLE_RD(); - PMAP_LOCK(pmap); - return (EAGAIN); -} - vm_page_t moea64_extract_and_hold(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_prot_t prot) { @@ -1373,21 +1338,19 @@ moea64_extract_and_hold(mmu_t mmu, pmap_ m = NULL; pa = 0; - LOCK_TABLE_RD(); PMAP_LOCK(pmap); retry: pvo = moea64_pvo_find_va(pmap, va & ~ADDR_POFF); if (pvo != NULL && (pvo->pvo_pte.lpte.pte_hi & LPTE_VALID) && ((pvo->pvo_pte.lpte.pte_lo & LPTE_PP) == LPTE_RW || (prot & VM_PROT_WRITE) == 0)) { - if (vm_page_pa_tryrelock_moea64(pmap, + if (vm_page_pa_tryrelock(pmap, pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN, &pa)) goto retry; m = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); vm_page_hold(m); } PA_UNLOCK_COND(pa); - UNLOCK_TABLE_RD(); PMAP_UNLOCK(pmap); return (m); } @@ -1435,8 +1398,7 @@ moea64_uma_page_alloc(uma_zone_t zone, i PMAP_LOCK(kernel_pmap); moea64_pvo_enter(installed_mmu, kernel_pmap, moea64_upvo_zone, - &moea64_pvo_kunmanaged, va, VM_PAGE_TO_PHYS(m), LPTE_M, - PVO_WIRED | PVO_BOOTSTRAP); + NULL, va, VM_PAGE_TO_PHYS(m), LPTE_M, PVO_WIRED | PVO_BOOTSTRAP); if (needed_lock) PMAP_UNLOCK(kernel_pmap); @@ -1510,12 +1472,10 @@ moea64_is_prefaultable(mmu_t mmu, pmap_t struct pvo_entry *pvo; boolean_t rv; - LOCK_TABLE_RD(); PMAP_LOCK(pmap); pvo = moea64_pvo_find_va(pmap, va & ~ADDR_POFF); rv = pvo == NULL || (pvo->pvo_pte.lpte.pte_hi & LPTE_VALID) == 0; PMAP_UNLOCK(pmap); - UNLOCK_TABLE_RD(); return (rv); } @@ -1671,7 +1631,7 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_ LOCK_TABLE_WR(); PMAP_LOCK(kernel_pmap); error = moea64_pvo_enter(mmu, kernel_pmap, moea64_upvo_zone, - &moea64_pvo_kunmanaged, va, pa, pte_lo, PVO_WIRED); + NULL, va, pa, pte_lo, PVO_WIRED); PMAP_UNLOCK(kernel_pmap); UNLOCK_TABLE_WR(); @@ -1704,13 +1664,11 @@ moea64_kextract(mmu_t mmu, vm_offset_t v if (va < VM_MIN_KERNEL_ADDRESS) return (va); - LOCK_TABLE_RD(); PMAP_LOCK(kernel_pmap); pvo = moea64_pvo_find_va(kernel_pmap, va); KASSERT(pvo != NULL, ("moea64_kextract: no addr found for %#" PRIxPTR, va)); pa = (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) | (va - PVO_VADDR(pvo)); - UNLOCK_TABLE_RD(); PMAP_UNLOCK(kernel_pmap); return (pa); } @@ -1857,7 +1815,7 @@ void moea64_pinit(mmu_t mmu, pmap_t pmap) { PMAP_LOCK_INIT(pmap); - LIST_INIT(&pmap->pmap_pvo); + RB_INIT(&pmap->pmap_pvo); pmap->pm_slb_tree_root = slb_alloc_tree(); pmap->pm_slb = slb_alloc_user_cache(); @@ -1871,7 +1829,7 @@ moea64_pinit(mmu_t mmu, pmap_t pmap) uint32_t hash; PMAP_LOCK_INIT(pmap); - LIST_INIT(&pmap->pmap_pvo); + RB_INIT(&pmap->pmap_pvo); if (pmap_bootstrapped) pmap->pmap_phys = (pmap_t)moea64_kextract(mmu, @@ -1967,7 +1925,7 @@ void moea64_protect(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { - struct pvo_entry *pvo, *tpvo; + struct pvo_entry *pvo, *tpvo, key; CTR4(KTR_PMAP, "moea64_protect: pm=%p sva=%#x eva=%#x prot=%#x", pm, sva, eva, prot); @@ -1982,26 +1940,11 @@ moea64_protect(mmu_t mmu, pmap_t pm, vm_ LOCK_TABLE_RD(); PMAP_LOCK(pm); - if ((eva - sva)/PAGE_SIZE < pm->pm_stats.resident_count) { - while (sva < eva) { - #ifdef __powerpc64__ - if (pm != kernel_pmap && - user_va_to_slb_entry(pm, sva) == NULL) { - sva = roundup2(sva + 1, SEGMENT_LENGTH); - continue; - } - #endif - pvo = moea64_pvo_find_va(pm, sva); - if (pvo != NULL) - moea64_pvo_protect(mmu, pm, pvo, prot); - sva += PAGE_SIZE; - } - } else { - LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo) { - if (PVO_VADDR(pvo) < sva || PVO_VADDR(pvo) >= eva) - continue; - moea64_pvo_protect(mmu, pm, pvo, prot); - } + key.pvo_vaddr = sva; + for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key); + pvo != NULL && PVO_VADDR(pvo) < eva; pvo = tpvo) { + tpvo = RB_NEXT(pvo_tree, &pm->pmap_pvo, pvo); + moea64_pvo_protect(mmu, pm, pvo, prot); } UNLOCK_TABLE_RD(); PMAP_UNLOCK(pm); @@ -2080,7 +2023,7 @@ moea64_remove_pages(mmu_t mmu, pmap_t pm LOCK_TABLE_WR(); PMAP_LOCK(pm); - LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo) { + RB_FOREACH_SAFE(pvo, pvo_tree, &pm->pmap_pvo, tpvo) { if (!(pvo->pvo_vaddr & PVO_WIRED)) moea64_pvo_remove(mmu, pvo); } @@ -2094,7 +2037,7 @@ moea64_remove_pages(mmu_t mmu, pmap_t pm void moea64_remove(mmu_t mmu, pmap_t pm, vm_offset_t sva, vm_offset_t eva) { - struct pvo_entry *pvo, *tpvo; + struct pvo_entry *pvo, *tpvo, key; /* * Perform an unsynchronized read. This is, however, safe. @@ -2104,26 +2047,11 @@ moea64_remove(mmu_t mmu, pmap_t pm, vm_o LOCK_TABLE_WR(); PMAP_LOCK(pm); - if ((eva - sva)/PAGE_SIZE < pm->pm_stats.resident_count) { - while (sva < eva) { - #ifdef __powerpc64__ - if (pm != kernel_pmap && - user_va_to_slb_entry(pm, sva) == NULL) { - sva = roundup2(sva + 1, SEGMENT_LENGTH); - continue; - } - #endif - pvo = moea64_pvo_find_va(pm, sva); - if (pvo != NULL) - moea64_pvo_remove(mmu, pvo); - sva += PAGE_SIZE; - } - } else { - LIST_FOREACH_SAFE(pvo, &pm->pmap_pvo, pvo_plink, tpvo) { - if (PVO_VADDR(pvo) < sva || PVO_VADDR(pvo) >= eva) - continue; - moea64_pvo_remove(mmu, pvo); - } + key.pvo_vaddr = sva; + for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key); + pvo != NULL && PVO_VADDR(pvo) < eva; pvo = tpvo) { + tpvo = RB_NEXT(pvo_tree, &pm->pmap_pvo, pvo); + moea64_pvo_remove(mmu, pvo); } UNLOCK_TABLE_WR(); PMAP_UNLOCK(pm); @@ -2275,12 +2203,6 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm, u moea64_bpvo_pool_index++; bootstrap = 1; } else { - /* - * Note: drop the table lock around the UMA allocation in - * case the UMA allocator needs to manipulate the page - * table. The mapping we are working with is already - * protected by the PMAP lock. - */ pvo = uma_zalloc(zone, M_NOWAIT); } @@ -2297,7 +2219,7 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm, u if (flags & PVO_WIRED) pvo->pvo_vaddr |= PVO_WIRED; - if (pvo_head != &moea64_pvo_kunmanaged) + if (pvo_head != NULL) pvo->pvo_vaddr |= PVO_MANAGED; if (bootstrap) pvo->pvo_vaddr |= PVO_BOOTSTRAP; @@ -2310,15 +2232,17 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm, u /* * Add to pmap list */ - LIST_INSERT_HEAD(&pm->pmap_pvo, pvo, pvo_plink); + RB_INSERT(pvo_tree, &pm->pmap_pvo, pvo); /* * Remember if the list was empty and therefore will be the first * item. */ - if (LIST_FIRST(pvo_head) == NULL) - first = 1; - LIST_INSERT_HEAD(pvo_head, pvo, pvo_vlink); + if (pvo_head != NULL) { + if (LIST_FIRST(pvo_head) == NULL) + first = 1; + LIST_INSERT_HEAD(pvo_head, pvo, pvo_vlink); + } if (pvo->pvo_vaddr & PVO_WIRED) { pvo->pvo_pte.lpte.pte_hi |= LPTE_WIRED; @@ -2381,10 +2305,9 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_ pvo->pvo_pmap->pm_stats.wired_count--; /* - * Remove this PVO from the PV and pmap lists. + * Remove this PVO from the pmap list. */ - LIST_REMOVE(pvo, pvo_vlink); - LIST_REMOVE(pvo, pvo_plink); + RB_REMOVE(pvo_tree, &pvo->pvo_pmap->pmap_pvo, pvo); /* * Remove this from the overflow list and return it to the pool @@ -2398,6 +2321,7 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_ pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED && pg != NULL) { + LIST_REMOVE(pvo, pvo_vlink); if ((pvo->pvo_pte.lpte.pte_lo & LPTE_PP) != LPTE_BR) { if (pvo->pvo_pte.lpte.pte_lo & LPTE_CHG) vm_page_dirty(pg); @@ -2421,41 +2345,10 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_ static struct pvo_entry * moea64_pvo_find_va(pmap_t pm, vm_offset_t va) { - struct pvo_entry *pvo; - int ptegidx; - uint64_t vsid; - #ifdef __powerpc64__ - uint64_t slbv; - - if (pm == kernel_pmap) { - slbv = kernel_va_to_slbv(va); - } else { - struct slb *slb; - slb = user_va_to_slb_entry(pm, va); - /* The page is not mapped if the segment isn't */ - if (slb == NULL) - return NULL; - slbv = slb->slbv; - } + struct pvo_entry key; - vsid = (slbv & SLBV_VSID_MASK) >> SLBV_VSID_SHIFT; - if (slbv & SLBV_L) - va &= ~moea64_large_page_mask; - else - va &= ~ADDR_POFF; - ptegidx = va_to_pteg(vsid, va, slbv & SLBV_L); - #else - va &= ~ADDR_POFF; - vsid = va_to_vsid(pm, va); - ptegidx = va_to_pteg(vsid, va, 0); - #endif - - LIST_FOREACH(pvo, &moea64_pvo_table[ptegidx], pvo_olink) { - if (pvo->pvo_pmap == pm && PVO_VADDR(pvo) == va) - break; - } - - return (pvo); + key.pvo_vaddr = va & ~ADDR_POFF; + return (RB_FIND(pvo_tree, &pm->pmap_pvo, &key)); } static boolean_t @@ -2549,21 +2442,21 @@ moea64_clear_bit(mmu_t mmu, vm_page_t m, boolean_t moea64_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size) { - struct pvo_entry *pvo; + struct pvo_entry *pvo, key; vm_offset_t ppa; int error = 0; - LOCK_TABLE_RD(); PMAP_LOCK(kernel_pmap); - for (ppa = pa & ~ADDR_POFF; ppa < pa + size; ppa += PAGE_SIZE) { - pvo = moea64_pvo_find_va(kernel_pmap, ppa); + key.pvo_vaddr = ppa = pa & ~ADDR_POFF; + for (pvo = RB_FIND(pvo_tree, &kernel_pmap->pmap_pvo, &key); + ppa < pa + size; ppa += PAGE_SIZE, + pvo = RB_NEXT(pvo_tree, &kernel_pmap->pmap_pvo, pvo)) { if (pvo == NULL || (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) != ppa) { error = EFAULT; break; } } - UNLOCK_TABLE_RD(); PMAP_UNLOCK(kernel_pmap); return (error); @@ -2626,7 +2519,6 @@ moea64_sync_icache(mmu_t mmu, pmap_t pm, vm_paddr_t pa; vm_size_t len; - LOCK_TABLE_RD(); PMAP_LOCK(pm); while (sz > 0) { lim = round_page(va); @@ -2640,6 +2532,5 @@ moea64_sync_icache(mmu_t mmu, pmap_t pm, va += len; sz -= len; } - UNLOCK_TABLE_RD(); PMAP_UNLOCK(pm); } Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Sun May 20 14:15:13 2012 (r235688) +++ head/sys/powerpc/include/pmap.h Sun May 20 14:33:28 2012 (r235689) @@ -94,7 +94,7 @@ typedef struct pmap *pmap_t; struct pvo_entry { LIST_ENTRY(pvo_entry) pvo_vlink; /* Link to common virt page */ LIST_ENTRY(pvo_entry) pvo_olink; /* Link to overflow entry */ - LIST_ENTRY(pvo_entry) pvo_plink; /* Link to pmap entries */ + RB_ENTRY(pvo_entry) pvo_plink; /* Link to pmap entries */ union { struct pte pte; /* 32 bit PTE */ struct lpte lpte; /* 64 bit PTE */ @@ -104,6 +104,9 @@ struct pvo_entry { uint64_t pvo_vpn; /* Virtual page number */ }; LIST_HEAD(pvo_head, pvo_entry); +RB_HEAD(pvo_tree, pvo_entry); +int pvo_vaddr_compare(struct pvo_entry *, struct pvo_entry *); +RB_PROTOTYPE(pvo_tree, pvo_entry, pvo_plink, pvo_vaddr_compare); #define PVO_PTEGIDX_MASK 0x007UL /* which PTEG slot */ #define PVO_PTEGIDX_VALID 0x008UL /* slot is valid */ @@ -136,7 +139,7 @@ struct pmap { struct pmap *pmap_phys; struct pmap_statistics pm_stats; - struct pvo_head pmap_pvo; + struct pvo_tree pmap_pvo; }; struct md_page { Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Sun May 20 14:15:13 2012 (r235688) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Sun May 20 14:33:28 2012 (r235689) @@ -76,6 +76,20 @@ vm_offset_t virtual_end; int pmap_bootstrapped; +#ifdef AIM +int +pvo_vaddr_compare(struct pvo_entry *a, struct pvo_entry *b) +{ + if (PVO_VADDR(a) < PVO_VADDR(b)) + return (-1); + else if (PVO_VADDR(a) > PVO_VADDR(b)) + return (1); + return (0); +} +RB_GENERATE(pvo_tree, pvo_entry, pvo_plink, pvo_vaddr_compare); +#endif + + void pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) { Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun May 20 14:15:13 2012 (r235688) +++ head/sys/vm/vm_page.c Sun May 20 14:33:28 2012 (r235689) @@ -131,7 +131,7 @@ TUNABLE_INT("vm.boot_pages", &boot_pages SYSCTL_INT(_vm, OID_AUTO, boot_pages, CTLFLAG_RD, &boot_pages, 0, "number of pages allocated for bootstrapping the VM system"); -int pa_tryrelock_restart; +static int pa_tryrelock_restart; SYSCTL_INT(_vm, OID_AUTO, tryrelock_restart, CTLFLAG_RD, &pa_tryrelock_restart, 0, "Number of tryrelock restarts"); From owner-svn-src-head@FreeBSD.ORG Sun May 20 16:09:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CF2A1065675; Sun, 20 May 2012 16:09:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 682018FC1B; Sun, 20 May 2012 16:09:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4KG9fQF002421; Sun, 20 May 2012 16:09:41 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KG9eDk002418; Sun, 20 May 2012 16:09:40 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205201609.q4KG9eDk002418@svn.freebsd.org> From: Glen Barber Date: Sun, 20 May 2012 16:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235691 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 16:09:41 -0000 Author: gjb (doc committer) Date: Sun May 20 16:09:40 2012 New Revision: 235691 URL: http://svn.freebsd.org/changeset/base/235691 Log: Typo and mdoc(7) style fixes. PR: 167890 Submitted by: Nobuyuki Koganemaru (kogane&jp!freebsd!org) MFC after: 3 days Modified: head/share/man/man7/c99.7 head/share/man/man7/release.7 Modified: head/share/man/man7/c99.7 ============================================================================== --- head/share/man/man7/c99.7 Sun May 20 15:10:13 2012 (r235690) +++ head/share/man/man7/c99.7 Sun May 20 16:09:40 2012 (r235691) @@ -103,7 +103,7 @@ The ISO C standard was later extended wi ISO/IEC 9899 AM1 in 1995. This contained, for example, the wide-character support in wchar.h and wctype.h. -Two corregenda were also published: Technical Corrigendum 1 as +Two corrigenda were also published: Technical Corrigendum 1 as ISO/IEC 9899 TCOR1 in 1995 and Technical Corrigendum 2 as ISO/IEC 9899 TCOR1 in 1996. The continuous development and growth made it necessary to work out a new Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Sun May 20 15:10:13 2012 (r235690) +++ head/share/man/man7/release.7 Sun May 20 16:09:40 2012 (r235691) @@ -221,7 +221,7 @@ hardware guide, and installation instruc the Handbook) is built during the .Cm base.txz target invoked by -.Cm packagesystem. +.Cm packagesystem . .El .Sh ENVIRONMENT Optional variables: From owner-svn-src-head@FreeBSD.ORG Sun May 20 16:22:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DF90106580F; Sun, 20 May 2012 16:22:34 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5BE158FC15; Sun, 20 May 2012 16:22:34 +0000 (UTC) Received: by dadv36 with SMTP id v36so6255231dad.13 for ; Sun, 20 May 2012 09:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=cobaFMzIi1zUzNgSU5eT6Fn6VyyT7v3PZvsYjW3+SbE=; b=atCxmP7JTE+mGVcv256cffryKnFr35osXNk6XLujCvWiIe9Iu+eaYy+z7PqxwmIbdh POxuRPlrgOkWpcCvrsVpgINdeqL4A1T5aBLdQm4I0zta/HazvVtdTXYSj6hF0h0948fy VhRlZRm5u+bgdCve/83djHzm4S5Jh1/D2/+2JbaikUkMbsAMcWAto4C628zVOffAoAiT dKD4TwM45OVuYVy17D2V2tjm3Jc2M6yZK+J1ZRzLRPLBITdHI2j/D+SCgPwWv0gTHN8h ERIgEIodcR2BMeNtpbEZnp3pQjZ/I0RhqcDMBlzJEqqNn8pVtr1/cMGyziqqyLDPvxiy DKiQ== MIME-Version: 1.0 Received: by 10.68.232.129 with SMTP id to1mr39082052pbc.27.1337530953638; Sun, 20 May 2012 09:22:33 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.142.203.2 with HTTP; Sun, 20 May 2012 09:22:33 -0700 (PDT) In-Reply-To: <201205200946.q4K9kmxS080440@svn.freebsd.org> References: <201205200946.q4K9kmxS080440@svn.freebsd.org> Date: Sun, 20 May 2012 09:22:33 -0700 X-Google-Sender-Auth: sfII2nND41VKEDVOYxmMmvKJQZU Message-ID: From: Adrian Chadd To: Bernhard Schmidt Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235685 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 16:22:34 -0000 .. retry with ATH_DEBUG and see if it still fails? Adrian On 20 May 2012 02:46, Bernhard Schmidt wrote: > Author: bschmidt > Date: Sun May 20 09:46:48 2012 > New Revision: 235685 > URL: http://svn.freebsd.org/changeset/base/235685 > > Log: > =A0Remove unused variable. > > Modified: > =A0head/sys/dev/ath/if_ath_rx.c > > Modified: head/sys/dev/ath/if_ath_rx.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ath/if_ath_rx.c =A0 =A0 =A0 =A0Sun May 20 09:29:14 2012 = =A0 =A0 =A0 =A0(r235684) > +++ head/sys/dev/ath/if_ath_rx.c =A0 =A0 =A0 =A0Sun May 20 09:46:48 2012 = =A0 =A0 =A0 =A0(r235685) > @@ -766,7 +766,6 @@ ath_rx_proc(struct ath_softc *sc, int re > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) > =A0 =A0 =A0 =A0struct ath_buf *bf; > =A0 =A0 =A0 =A0struct ifnet *ifp =3D sc->sc_ifp; > - =A0 =A0 =A0 struct ieee80211com *ic =3D ifp->if_l2com; > =A0 =A0 =A0 =A0struct ath_hal *ah =3D sc->sc_ah; > =A0 =A0 =A0 =A0struct ath_desc *ds; > =A0 =A0 =A0 =A0struct ath_rx_status *rs; From owner-svn-src-head@FreeBSD.ORG Sun May 20 16:36:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD1CE1065672; Sun, 20 May 2012 16:36:54 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A89AD8FC08; Sun, 20 May 2012 16:36:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4KGasQY003684; Sun, 20 May 2012 16:36:54 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KGas5v003682; Sun, 20 May 2012 16:36:54 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201205201636.q4KGas5v003682@svn.freebsd.org> From: Mitsuru IWASAKI Date: Sun, 20 May 2012 16:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235692 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 16:36:54 -0000 Author: iwasaki Date: Sun May 20 16:36:54 2012 New Revision: 235692 URL: http://svn.freebsd.org/changeset/base/235692 Log: Don't start the sleep state transition procedure while sleep is disabled or the system is in shutdown procedure. This should fix the problem which kernel never response to the sleep button press events after the message `suspend request ignored (not ready yet)'. MFC after: 3 days Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sun May 20 16:09:40 2012 (r235691) +++ head/sys/dev/acpica/acpi.c Sun May 20 16:36:54 2012 (r235692) @@ -2515,6 +2515,11 @@ acpi_ReqSleepState(struct acpi_softc *sc if (!acpi_sleep_states[state]) return (EOPNOTSUPP); + /* Wait until sleep is enabled. */ + while (sc->acpi_sleep_disabled) { + AcpiOsSleep(1000); + } + ACPI_LOCK(acpi); /* If a suspend request is already in progress, just return. */ @@ -2522,6 +2527,7 @@ acpi_ReqSleepState(struct acpi_softc *sc ACPI_UNLOCK(acpi); return (0); } + sc->acpi_next_sstate = state; /* S5 (soft-off) should be entered directly with no waiting. */ if (state == ACPI_STATE_S5) { @@ -2531,7 +2537,6 @@ acpi_ReqSleepState(struct acpi_softc *sc } /* Record the pending state and notify all apm devices. */ - sc->acpi_next_sstate = state; STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) { clone->notify_status = APM_EV_NONE; if ((clone->flags & ACPI_EVF_DEVD) == 0) { From owner-svn-src-head@FreeBSD.ORG Sun May 20 16:43:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 443791065670; Sun, 20 May 2012 16:43:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 105608FC1C; Sun, 20 May 2012 16:43:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4KGhnVJ004046; Sun, 20 May 2012 16:43:49 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KGhmif004016; Sun, 20 May 2012 16:43:48 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205201643.q4KGhmif004016@svn.freebsd.org> From: Glen Barber Date: Sun, 20 May 2012 16:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235693 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 16:43:49 -0000 Author: gjb (doc committer) Date: Sun May 20 16:43:47 2012 New Revision: 235693 URL: http://svn.freebsd.org/changeset/base/235693 Log: Typo and mdoc(7) style fixes. PR: 168117 Submitted by: Nobuyuki Koganemaru (kogane&jp!freebsd!org) MFC after: 3 days Modified: head/share/man/man9/BUF_ISLOCKED.9 head/share/man/man9/DB_COMMAND.9 head/share/man/man9/VOP_GETEXTATTR.9 head/share/man/man9/VOP_GETPAGES.9 head/share/man/man9/VOP_GETVOBJECT.9 head/share/man/man9/VOP_SETEXTATTR.9 head/share/man/man9/acl.9 head/share/man/man9/bus_generic_print_child.9 head/share/man/man9/bus_release_resource.9 head/share/man/man9/bus_space.9 head/share/man/man9/byteorder.9 head/share/man/man9/devclass_get_maxunit.9 head/share/man/man9/device_find_child.9 head/share/man/man9/firmware.9 head/share/man/man9/hashinit.9 head/share/man/man9/ieee80211_proto.9 head/share/man/man9/ifnet.9 head/share/man/man9/kqueue.9 head/share/man/man9/lock.9 head/share/man/man9/locking.9 head/share/man/man9/mbuf.9 head/share/man/man9/mod_cc.9 head/share/man/man9/netisr.9 head/share/man/man9/pci.9 head/share/man/man9/spl.9 head/share/man/man9/sysctl.9 head/share/man/man9/taskqueue.9 head/share/man/man9/usbdi.9 head/share/man/man9/vm_page_aflag.9 Modified: head/share/man/man9/BUF_ISLOCKED.9 ============================================================================== --- head/share/man/man9/BUF_ISLOCKED.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/BUF_ISLOCKED.9 Sun May 20 16:43:47 2012 (r235693) @@ -52,7 +52,7 @@ It can return: .It Dv LK_EXCLUSIVE An exclusive lock is held by curthread. .It Dv LK_EXCLOTHER -An exclusive lock is held by someone other than curthread +An exclusive lock is held by someone other than curthread. .It Dv LK_SHARED A shared lock is held. .It Li 0 Modified: head/share/man/man9/DB_COMMAND.9 ============================================================================== --- head/share/man/man9/DB_COMMAND.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/DB_COMMAND.9 Sun May 20 16:43:47 2012 (r235693) @@ -32,7 +32,7 @@ .Nm DB_COMMAND , .Nm DB_SHOW_COMMAND , .Nm DB_SHOW_ALL_COMMAND -.Nd Extends the ddb command set. +.Nd Extends the ddb command set .Sh SYNOPSIS .In ddb/ddb.h .Fo DB_COMMAND Modified: head/share/man/man9/VOP_GETEXTATTR.9 ============================================================================== --- head/share/man/man9/VOP_GETEXTATTR.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/VOP_GETEXTATTR.9 Sun May 20 16:43:47 2012 (r235693) @@ -71,7 +71,7 @@ will be .Dv NULL when .Fa size -is not, and vise versa. +is not, and vice versa. .It Fa cred The user credentials to use in authorizing the request. .It Fa td @@ -113,7 +113,7 @@ The uio structure refers to an invalid u .It Bq Er EINVAL The .Fa name , -.Fa namespace, +.Fa namespace , or .Fa uio argument is invalid. Modified: head/share/man/man9/VOP_GETPAGES.9 ============================================================================== --- head/share/man/man9/VOP_GETPAGES.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/VOP_GETPAGES.9 Sun May 20 16:43:47 2012 (r235693) @@ -115,7 +115,7 @@ The page could not be written because of medium or protocol. .It Dv VM_PAGER_FAIL Treated identically to -.Dv VM_PAGER_ERROR +.Dv VM_PAGER_ERROR . .It Dv VM_PAGER_AGAIN The page was not handled by this request. .El Modified: head/share/man/man9/VOP_GETVOBJECT.9 ============================================================================== --- head/share/man/man9/VOP_GETVOBJECT.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/VOP_GETVOBJECT.9 Sun May 20 16:43:47 2012 (r235693) @@ -53,7 +53,7 @@ The vnode of the file. The VM object being returned, or .Dv NULL if the caller wants to test for the existence -of the VM object). +of the VM object. .El .Pp .Xr VFS 9 Modified: head/share/man/man9/VOP_SETEXTATTR.9 ============================================================================== --- head/share/man/man9/VOP_SETEXTATTR.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/VOP_SETEXTATTR.9 Sun May 20 16:43:47 2012 (r235693) @@ -96,7 +96,7 @@ The caller does not have the appropriate The request was not valid in this file system for the specified vnode and attribute name. .It Bq Er ENOMEM -Insufficient memory available to fulfill request +Insufficient memory available to fulfill the request. .It Bq Er EFAULT The uio structure refers to an invalid userspace address. .It Bq Er EINVAL Modified: head/share/man/man9/acl.9 ============================================================================== --- head/share/man/man9/acl.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/acl.9 Sun May 20 16:43:47 2012 (r235693) @@ -210,7 +210,7 @@ The following values are valid: .Xr vaccess_acl_nfs4 9 , .Xr vaccess_acl_posix1e 9 , .Xr VFS 9 , -.Xr vnaccess 9 , +.Xr vaccess 9 , .Xr VOP_ACLCHECK 9 , .Xr VOP_GETACL 9 , .Xr VOP_SETACL 9 Modified: head/share/man/man9/bus_generic_print_child.9 ============================================================================== --- head/share/man/man9/bus_generic_print_child.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/bus_generic_print_child.9 Sun May 20 16:43:47 2012 (r235693) @@ -51,7 +51,7 @@ foo0: on bar0 bus_generic_print_child itself calls two functions .Fn bus_print_child_header and -.Fn bus_print_child_footer +.Fn bus_print_child_footer . The former prints "foo0: " and the latter "on bar0". These routines should be used if possible in your own code if .Fn bus_generic_print_child Modified: head/share/man/man9/bus_release_resource.9 ============================================================================== --- head/share/man/man9/bus_release_resource.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/bus_release_resource.9 Sun May 20 16:43:47 2012 (r235693) @@ -71,7 +71,7 @@ value must be the same as the one return .It .Fa r is the pointer to -.Va struct res , +.Va struct resource , i.e., the resource itself, returned by .Xr bus_alloc_resource 9 . Modified: head/share/man/man9/bus_space.9 ============================================================================== --- head/share/man/man9/bus_space.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/bus_space.9 Sun May 20 16:43:47 2012 (r235693) @@ -1380,7 +1380,8 @@ functions may be executed in any order. They may also be executed out of order with respect to other pending read and write operations unless order is enforced by use of the -.Fn bus_space_barrier function . +.Fn bus_space_barrier +function. There is no way to insert barriers between reads or writes of individual bus space locations executed by the .Fn bus_space_copy_region_N Modified: head/share/man/man9/byteorder.9 ============================================================================== --- head/share/man/man9/byteorder.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/byteorder.9 Sun May 20 16:43:47 2012 (r235693) @@ -158,7 +158,7 @@ in big/little endian format. The .Fn hto* and -.Fn toh* +.Fn *toh functions first appeared in .Fx 5.0 , and were originally developed by the Modified: head/share/man/man9/devclass_get_maxunit.9 ============================================================================== --- head/share/man/man9/devclass_get_maxunit.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/devclass_get_maxunit.9 Sun May 20 16:43:47 2012 (r235693) @@ -49,7 +49,7 @@ The function returns -1 if .Fa dc is -.Dv NULL; +.Dv NULL , otherwise it returns the next unit number in .Fa dc's Modified: head/share/man/man9/device_find_child.9 ============================================================================== --- head/share/man/man9/device_find_child.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/device_find_child.9 Sun May 20 16:43:47 2012 (r235693) @@ -41,7 +41,7 @@ .Fn device_find_child "device_t dev" "const char *classname" "int unit" .Sh DESCRIPTION This function looks for a specific child of -.Dv dev . +.Dv dev with the given .Fa classname and Modified: head/share/man/man9/firmware.9 ============================================================================== --- head/share/man/man9/firmware.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/firmware.9 Sun May 20 16:43:47 2012 (r235693) @@ -101,11 +101,13 @@ they want as an argument. If a matching the firmware subsystem will try to load it using the mechanisms specified below (typically, a kernel module with -.Nm the same name +.Nm +the same name as the image). .Sh API DESCRIPTION The kernel -.Nm firmware API +.Nm +firmware API is made of the following functions: .Pp .Fn firmware_register @@ -225,7 +227,7 @@ in the module, the imagename and version If you need to embed firmware images into a system, you should write appropriate entries in the file, e.g. this example is from -.Nm sys/arm/xscale/ixp425/files.ixp425: +.Nm sys/arm/xscale/ixp425/files.ixp425 : .Bd -literal ixp425_npe_fw.c optional npe_fw \\ compile-with "${AWK} -f $S/tools/fw_stub.awk \\ Modified: head/share/man/man9/hashinit.9 ============================================================================== --- head/share/man/man9/hashinit.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/hashinit.9 Sun May 20 16:43:47 2012 (r235693) @@ -29,7 +29,7 @@ .Dt HASHINIT 9 .Os .Sh NAME -.Nm hashinit , hashinit_flags, hashdestroy , phashinit +.Nm hashinit , hashinit_flags , hashdestroy , phashinit .Nd manage kernel hash tables .Sh SYNOPSIS .In sys/malloc.h Modified: head/share/man/man9/ieee80211_proto.9 ============================================================================== --- head/share/man/man9/ieee80211_proto.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/ieee80211_proto.9 Sun May 20 16:43:47 2012 (r235693) @@ -238,4 +238,4 @@ work will be initiated outside the drive The state machine concept was part of the original .Nm ieee80211 code base that first appeared in -.Nx 1.5 , +.Nx 1.5 . Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/ifnet.9 Sun May 20 16:43:47 2012 (r235693) @@ -637,7 +637,7 @@ interfaces registered at the interface l .Aq D This interface blocks transmission of packets and discards incoming packets after BPF processing. -Used to monitor network trafic but not interact +Used to monitor network traffic but not interact with the network in question. .It Dv IFF_STATICARP .Aq D Modified: head/share/man/man9/kqueue.9 ============================================================================== --- head/share/man/man9/kqueue.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/kqueue.9 Sun May 20 16:43:47 2012 (r235693) @@ -260,8 +260,7 @@ is not required, but is commonly used. If used, the .Vt knlist must be initialized with either -.Fn knlist_init -, +.Fn knlist_init , .Fn knlist_init_mtx or .Fn knlist_init_rw_reader . Modified: head/share/man/man9/lock.9 ============================================================================== --- head/share/man/man9/lock.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/lock.9 Sun May 20 16:43:47 2012 (r235693) @@ -230,7 +230,7 @@ and The .Fn lockmgr_disown function switches the owner from the current thread to be -.Dv LK_KERNPROC, +.Dv LK_KERNPROC , if the lock is already held. .Pp The Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/locking.9 Sun May 20 16:43:47 2012 (r235693) @@ -315,8 +315,7 @@ and reacquire it on wakeup (e.g. .Fn mtx_sleep , .Fn rw_sleep and -.Fn msleep_spin -). +.Fn msleep_spin ) . .Pp .Em *4 Though one can sleep holding an sx lock, one can also use @@ -358,6 +357,6 @@ These functions appeared in .Bsx 4.1 through -.Fx 7.0 +.Fx 7.0 . .Sh BUGS There are too many locking primitives to choose from. Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/mbuf.9 Sun May 20 16:43:47 2012 (r235693) @@ -403,7 +403,8 @@ for details. Associate externally managed data with .Fa mbuf . Any internal data contained in the mbuf will be discarded, and the -.Dv M_EXT flag will be set. +.Dv M_EXT +flag will be set. The .Fa buf and @@ -722,7 +723,8 @@ are contiguous and lay in the data area .Fa mbuf , so they are accessible with .Fn mtod mbuf type . -.Fa len must be smaller than, or equal to, the size of an +.Fa len +must be smaller than, or equal to, the size of an .Vt mbuf cluster . Return a pointer to an intermediate .Vt mbuf Modified: head/share/man/man9/mod_cc.9 ============================================================================== --- head/share/man/man9/mod_cc.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/mod_cc.9 Sun May 20 16:43:47 2012 (r235693) @@ -287,7 +287,7 @@ The CCF_CWND_LIMITED flag is relevant in .Va ack_received and is set when the connection's ability to send data is currently constrained by the value of the congestion window. -Algorithms should use the abscence of this flag being set to avoid accumulating +Algorithms should use the absence of this flag being set to avoid accumulating a large difference between the congestion window and send window. .Sh SEE ALSO .Xr cc_chd 4 , Modified: head/share/man/man9/netisr.9 ============================================================================== --- head/share/man/man9/netisr.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/netisr.9 Sun May 20 16:43:47 2012 (r235693) @@ -78,7 +78,7 @@ and may also manage queue limits and sta .Fn netisr_getqdrops , .Fn netisr_getqlimit , and -.Fn netisr_setqlimit. +.Fn netisr_setqlimit . .Pp .Nm supports multi-processor execution of handlers, and relies on a combination Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/pci.9 Sun May 20 16:43:47 2012 (r235693) @@ -488,7 +488,7 @@ The .Fn pci_count_msi function returns the maximum number of MSI messages supported by the device -.Fa dev. +.Fa dev . If the device does not support MSI, then .Fn pci_count_msi @@ -567,7 +567,8 @@ is set to the number of messages allocat returns zero. For MSI-X messages, the resource ID for each -.Dv SYS_RES_IRQ resource identifies the index in the MSI-X table of the +.Dv SYS_RES_IRQ +resource identifies the index in the MSI-X table of the corresponding message. A resource ID of one maps to the first index of the MSI-X table; a resource ID two identifies the second index in the table, etc. @@ -608,7 +609,7 @@ A driver may use a different distributio table entries via the .Fn pci_remap_msix function. -Note that this function must be called after a succesful call to +Note that this function must be called after a successful call to .Fn pci_alloc_msix but before any of the .Dv SYS_RES_IRQ @@ -649,7 +650,8 @@ above for .Fn pci_alloc_msix . MSI-X table entries that with a vector of zero will not have an associated -.Dv SYS_RES_IRQ resource. +.Dv SYS_RES_IRQ +resource. Additionally, if any of the original messages allocated by .Fn pci_alloc_msix Modified: head/share/man/man9/spl.9 ============================================================================== --- head/share/man/man9/spl.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/spl.9 Sun May 20 16:43:47 2012 (r235693) @@ -220,7 +220,8 @@ the system. The historical number scheme can be considered as a simple linearly ordered set of interrupt priority groups. .Pp -.Fx 5.0 eliminated spl entirely in favor of locking primitives which scale +.Fx 5.0 +eliminated spl entirely in favor of locking primitives which scale to more than one processor. .Sh AUTHORS This manual page was written by Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/sysctl.9 Sun May 20 16:43:47 2012 (r235693) @@ -107,7 +107,7 @@ This is a 64-bit signed integer. This is an opaque data structure. .It Dv CTLTYPE_STRUCT Alias for -.Dv CTLTYPE_OPAQUE. +.Dv CTLTYPE_OPAQUE . .It Dv CTLTYPE_UINT This is an unsigned integer. .It Dv CTLTYPE_LONG Modified: head/share/man/man9/taskqueue.9 ============================================================================== --- head/share/man/man9/taskqueue.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/taskqueue.9 Sun May 20 16:43:47 2012 (r235693) @@ -189,8 +189,8 @@ The count is cleared, and the old value returned in the reference parameter .Fa pendp , -if it is non- -.Dv NULL . +if it is +.Pf non- Dv NULL . If the task is currently running, .Dv EBUSY is returned, otherwise 0. Modified: head/share/man/man9/usbdi.9 ============================================================================== --- head/share/man/man9/usbdi.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/usbdi.9 Sun May 20 16:43:47 2012 (r235693) @@ -524,7 +524,7 @@ executed on the USB control endpoint. . This flag can be changed during operation. .Pp -"BOF" is short for "Block On Failure" +"BOF" is short for "Block On Failure". .Pp NOTE: This flag should be set on all BULK and INTERRUPT USB transfers which use an endpoint that can be shared between userland and kernel. Modified: head/share/man/man9/vm_page_aflag.9 ============================================================================== --- head/share/man/man9/vm_page_aflag.9 Sun May 20 16:36:54 2012 (r235692) +++ head/share/man/man9/vm_page_aflag.9 Sun May 20 16:43:47 2012 (r235693) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .Dd August 31, 2011 -.Dt VM_PAGE_FLAG 9 +.Dt VM_PAGE_AFLAG 9 .Os .Sh NAME .Nm vm_page_aflag_clear , vm_page_aflag_set , vm_page_reference From owner-svn-src-head@FreeBSD.ORG Sun May 20 18:07:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 202B4106564A; Sun, 20 May 2012 18:07:36 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A8F68FC0A; Sun, 20 May 2012 18:07:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4KI7ZZd007867; Sun, 20 May 2012 18:07:35 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KI7ZaK007863; Sun, 20 May 2012 18:07:35 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201205201807.q4KI7ZaK007863@svn.freebsd.org> From: Tim Kientzle Date: Sun, 20 May 2012 18:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235694 - head/sys/boot/uboot/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 18:07:36 -0000 Author: kientzle Date: Sun May 20 18:07:35 2012 New Revision: 235694 URL: http://svn.freebsd.org/changeset/base/235694 Log: Determine kernel load address dynamically from u-boot memory map. The generic ELF loading code maps the kernel into low memory by subtracting KERN_BASE. So the copyin/copyout/readin functions are always called with low addresses. This code finds the largest DRAM block from the U-Boot memory map and adds that base to the addresses. In particular, this fixes ubldr on AM3358, which has DRAM mapped to 0x80000000 at power-on. Modified: head/sys/boot/uboot/lib/copy.c head/sys/boot/uboot/lib/elf_freebsd.c head/sys/boot/uboot/lib/libuboot.h Modified: head/sys/boot/uboot/lib/copy.c ============================================================================== --- head/sys/boot/uboot/lib/copy.c Sun May 20 16:43:47 2012 (r235693) +++ head/sys/boot/uboot/lib/copy.c Sun May 20 18:07:35 2012 (r235694) @@ -29,32 +29,64 @@ __FBSDID("$FreeBSD$"); #include +#include + +#include "api_public.h" +#include "glue.h" /* * MD primitives supporting placement of module data - * - * XXX should check load address/size against memory top. */ +void * +uboot_vm_translate(vm_offset_t o) { + struct sys_info *si; + static uintptr_t start = 0; + static size_t size = 0; + int i; + + if (size == 0) { + if ((si = ub_get_sys_info()) == NULL) + panic("could not retrieve system info"); + + /* Find start/size of largest DRAM block. */ + for (i = 0; i < si->mr_no; i++) { + if (si->mr[i].flags == MR_ATTR_DRAM + && si->mr[i].size > size) { + start = si->mr[i].start; + size = si->mr[i].size; + } + } + + if (size <= 0) + panic("No suitable DRAM?\n"); + /* + printf("Loading into memory region 0x%08X-0x%08X (%d MiB)\n", + start, start + size, size / 1024 / 1024); + */ + } + if (o > size) + panic("Address 0x%08jX bigger than size 0x%08X\n", + (intmax_t)o, size); + return (void *)(start + o); +} + ssize_t uboot_copyin(const void *src, vm_offset_t dest, const size_t len) { - - bcopy(src, (void *)dest, len); + bcopy(src, uboot_vm_translate(dest), len); return (len); } ssize_t uboot_copyout(const vm_offset_t src, void *dest, const size_t len) { - - bcopy((void *)src, dest, len); + bcopy(uboot_vm_translate(src), dest, len); return (len); } ssize_t uboot_readin(const int fd, vm_offset_t dest, const size_t len) { - - return (read(fd, (void *) dest, len)); + return (read(fd, uboot_vm_translate(dest), len)); } Modified: head/sys/boot/uboot/lib/elf_freebsd.c ============================================================================== --- head/sys/boot/uboot/lib/elf_freebsd.c Sun May 20 16:43:47 2012 (r235693) +++ head/sys/boot/uboot/lib/elf_freebsd.c Sun May 20 18:07:35 2012 (r235694) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" +#include "libuboot.h" extern vm_offset_t md_load(char *, vm_offset_t *); @@ -69,6 +70,7 @@ __elfN(uboot_exec)(struct preloaded_file vm_offset_t mdp; Elf_Ehdr *e; int error; + void (*entry)(void *); if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) return (EFTYPE); @@ -78,11 +80,12 @@ __elfN(uboot_exec)(struct preloaded_file if ((error = md_load(fp->f_args, &mdp)) != 0) return (error); - printf("Kernel entry at 0x%x ...\n", e->e_entry); + entry = uboot_vm_translate(e->e_entry); + printf("Kernel entry at 0x%x...\n", (unsigned)entry); dev_cleanup(); - (*(void (*)())e->e_entry)((void *)mdp); + (*entry)((void *)mdp); panic("exec returned"); } Modified: head/sys/boot/uboot/lib/libuboot.h ============================================================================== --- head/sys/boot/uboot/lib/libuboot.h Sun May 20 16:43:47 2012 (r235693) +++ head/sys/boot/uboot/lib/libuboot.h Sun May 20 18:07:35 2012 (r235694) @@ -60,6 +60,7 @@ extern int devs_no; extern struct netif_driver uboot_net; extern struct devsw uboot_storage; +void *uboot_vm_translate(vm_offset_t); ssize_t uboot_copyin(const void *src, vm_offset_t dest, const size_t len); ssize_t uboot_copyout(const vm_offset_t src, void *dest, const size_t len); ssize_t uboot_readin(const int fd, vm_offset_t dest, const size_t len); From owner-svn-src-head@FreeBSD.ORG Sun May 20 18:25:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77AF4106564A; Sun, 20 May 2012 18:25:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60A078FC15; Sun, 20 May 2012 18:25:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4KIPk7O008721; Sun, 20 May 2012 18:25:46 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KIPkeB008719; Sun, 20 May 2012 18:25:46 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205201825.q4KIPkeB008719@svn.freebsd.org> From: Alan Cox Date: Sun, 20 May 2012 18:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235695 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 18:25:46 -0000 Author: alc Date: Sun May 20 18:25:45 2012 New Revision: 235695 URL: http://svn.freebsd.org/changeset/base/235695 Log: Replace all uses of the vm page queues lock by a r/w lock that is private to this pmap.c. This new r/w lock is used primarily to synchronize access to the PV lists. However, it will be used in a somewhat unconventional way. As finer-grained PV list locking is added to each of the pmap functions that acquire this r/w lock, its acquisition will be changed from write to read, enabling concurrent execution of the pmap functions with finer-grained locking. Reviewed by: kib X-MFC after: r235598 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun May 20 18:07:35 2012 (r235694) +++ head/sys/amd64/amd64/pmap.c Sun May 20 18:25:45 2012 (r235695) @@ -117,6 +117,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -204,6 +205,7 @@ static u_int64_t DMPDPphys; /* phys addr static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); static long pv_entry_count; static struct md_page *pv_table; +static struct rwlock pvh_global_lock; /* * All those kernel PT submaps that BSD is so fond of @@ -581,6 +583,11 @@ pmap_bootstrap(vm_paddr_t *firstaddr) CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */ TAILQ_INIT(&kernel_pmap->pm_pvchunk); + /* + * Initialize the global pv list lock. + */ + rw_init(&pvh_global_lock, "pvh global"); + /* * Reserve some special page table entries/VA space for temporary * mapping of pages. @@ -1651,9 +1658,9 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { if (flags & M_WAITOK) { PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); VM_WAIT; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); } @@ -2055,7 +2062,7 @@ pmap_pv_reclaim(pmap_t locked_pmap) uint64_t inuse, freemask; int bit, field, freed; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); pmap = NULL; free = m = NULL; @@ -2171,7 +2178,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv struct pv_chunk *pc; int idx, field, bit; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); PV_STAT(pv_entry_frees++); PV_STAT(pv_entry_spare++); @@ -2214,8 +2221,8 @@ get_pv_entry(pmap_t pmap, boolean_t try) struct pv_chunk *pc; vm_page_t m; + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); PV_STAT(pv_entry_allocs++); retry: pc = TAILQ_FIRST(&pmap->pm_pvchunk); @@ -2284,7 +2291,7 @@ pmap_pvh_remove(struct md_page *pvh, pma { pv_entry_t pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { if (pmap == PV_PMAP(pv) && va == pv->pv_va) { TAILQ_REMOVE(&pvh->pv_list, pv, pv_list); @@ -2307,7 +2314,7 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse vm_offset_t va_last; vm_page_t m; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_demote_pde: pa is not 2mpage aligned")); @@ -2345,7 +2352,7 @@ pmap_pv_promote_pde(pmap_t pmap, vm_offs vm_offset_t va_last; vm_page_t m; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); KASSERT((pa & PDRMASK) == 0, ("pmap_pv_promote_pde: pa is not 2mpage aligned")); @@ -2391,7 +2398,7 @@ pmap_remove_entry(pmap_t pmap, vm_page_t { struct md_page *pvh; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); pmap_pvh_free(&m->md, pmap, va); if (TAILQ_EMPTY(&m->md.pv_list) && (m->flags & PG_FICTITIOUS) == 0) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -2409,8 +2416,8 @@ pmap_insert_entry(pmap_t pmap, vm_offset { pv_entry_t pv; + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); pv = get_pv_entry(pmap, FALSE); pv->pv_va = va; TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); @@ -2424,8 +2431,8 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm { pv_entry_t pv; + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); if ((pv = get_pv_entry(pmap, TRUE)) != NULL) { pv->pv_va = va; TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); @@ -2443,7 +2450,7 @@ pmap_pv_insert_pde(pmap_t pmap, vm_offse struct md_page *pvh; pv_entry_t pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); if ((pv = get_pv_entry(pmap, TRUE)) != NULL) { pv->pv_va = va; pvh = pa_to_pvh(pa); @@ -2711,7 +2718,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva anyvalid = 0; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); /* @@ -2821,7 +2828,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva out: if (anyvalid) pmap_invalidate_all(pmap); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(free); } @@ -2853,7 +2860,7 @@ pmap_remove_all(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); free = NULL; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if ((m->flags & PG_FICTITIOUS) != 0) goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -2892,7 +2899,7 @@ small_mappings: PMAP_UNLOCK(pmap); } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); pmap_free_zero_pages(free); } @@ -3013,12 +3020,12 @@ resume: } else { if (!pv_lists_locked) { pv_lists_locked = TRUE; - if (!mtx_trylock(&vm_page_queue_mtx)) { + if (!rw_try_wlock(&pvh_global_lock)) { if (anychanged) pmap_invalidate_all( pmap); PMAP_UNLOCK(pmap); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); goto resume; } } @@ -3069,7 +3076,7 @@ retry: if (anychanged) pmap_invalidate_all(pmap); if (pv_lists_locked) - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3224,7 +3231,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, mpte = NULL; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); /* @@ -3380,7 +3387,7 @@ validate: vm_reserv_level_iffullpop(m) == 0) pmap_promote_pde(pmap, pde, va); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3396,7 +3403,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t pd_entry_t *pde, newpde; vm_page_t free, mpde; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); if ((mpde = pmap_allocpde(pmap, va, M_NOWAIT)) == NULL) { CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" @@ -3477,7 +3484,7 @@ pmap_enter_object(pmap_t pmap, vm_offset psize = atop(end - start); mpte = NULL; m = m_start; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { va = start + ptoa(diff); @@ -3491,7 +3498,7 @@ pmap_enter_object(pmap_t pmap, vm_offset mpte); m = TAILQ_NEXT(m, listq); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3508,10 +3515,10 @@ void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); (void)pmap_enter_quick_locked(pmap, va, m, prot, NULL); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3526,7 +3533,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || (m->oflags & VPO_UNMANAGED) != 0, ("pmap_enter_quick_locked: managed mapping within the clean submap")); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); /* @@ -3745,9 +3752,9 @@ retry: if (!wired != ((*pde & PG_W) == 0)) { if (!are_queues_locked) { are_queues_locked = TRUE; - if (!mtx_trylock(&vm_page_queue_mtx)) { + if (!rw_try_wlock(&pvh_global_lock)) { PMAP_UNLOCK(pmap); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); goto retry; } } @@ -3766,7 +3773,7 @@ retry: } out: if (are_queues_locked) - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3790,7 +3797,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm if (dst_addr != src_addr) return; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if (dst_pmap < src_pmap) { PMAP_LOCK(dst_pmap); PMAP_LOCK(src_pmap); @@ -3906,7 +3913,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm } } out: - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(src_pmap); PMAP_UNLOCK(dst_pmap); } @@ -3987,7 +3994,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (PV_PMAP(pv) == pmap) { rv = TRUE; @@ -4009,7 +4016,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p break; } } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -4027,13 +4034,13 @@ pmap_page_wired_mappings(vm_page_t m) count = 0; if ((m->oflags & VPO_UNMANAGED) != 0) return (count); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); count = pmap_pvh_wired_mappings(&m->md, count); if ((m->flags & PG_FICTITIOUS) == 0) { count = pmap_pvh_wired_mappings(pa_to_pvh(VM_PAGE_TO_PHYS(m)), count); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (count); } @@ -4049,7 +4056,7 @@ pmap_pvh_wired_mappings(struct md_page * pt_entry_t *pte; pv_entry_t pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); @@ -4072,11 +4079,11 @@ pmap_page_is_mapped(vm_page_t m) if ((m->oflags & VPO_UNMANAGED) != 0) return (FALSE); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); rv = !TAILQ_EMPTY(&m->md.pv_list) || ((m->flags & PG_FICTITIOUS) == 0 && !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -4107,7 +4114,7 @@ pmap_remove_pages(pmap_t pmap) printf("warning: pmap_remove_pages called with non-current pmap\n"); return; } - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) { allfree = 1; @@ -4216,7 +4223,7 @@ pmap_remove_pages(pmap_t pmap) } } pmap_invalidate_all(pmap); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(free); } @@ -4244,11 +4251,11 @@ pmap_is_modified(vm_page_t m) if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); rv = pmap_is_modified_pvh(&m->md) || ((m->flags & PG_FICTITIOUS) == 0 && pmap_is_modified_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m)))); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -4265,7 +4272,7 @@ pmap_is_modified_pvh(struct md_page *pvh pmap_t pmap; boolean_t rv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); rv = FALSE; TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { pmap = PV_PMAP(pv); @@ -4316,11 +4323,11 @@ pmap_is_referenced(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_referenced: page %p is not managed", m)); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); rv = pmap_is_referenced_pvh(&m->md) || ((m->flags & PG_FICTITIOUS) == 0 && pmap_is_referenced_pvh(pa_to_pvh(VM_PAGE_TO_PHYS(m)))); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -4336,7 +4343,7 @@ pmap_is_referenced_pvh(struct md_page *p pmap_t pmap; boolean_t rv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); rv = FALSE; TAILQ_FOREACH(pv, &pvh->pv_list, pv_list) { pmap = PV_PMAP(pv); @@ -4375,7 +4382,7 @@ pmap_remove_write(vm_page_t m) if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if ((m->flags & PG_FICTITIOUS) != 0) goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -4409,7 +4416,7 @@ retry: PMAP_UNLOCK(pmap); } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -4437,7 +4444,7 @@ pmap_ts_referenced(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if ((m->flags & PG_FICTITIOUS) != 0) goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -4495,7 +4502,7 @@ small_mappings: } while ((pv = pvn) != NULL && pv != pvf); } out: - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rtval); } @@ -4525,7 +4532,7 @@ pmap_clear_modify(vm_page_t m) */ if ((m->aflags & PGA_WRITEABLE) == 0) return; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if ((m->flags & PG_FICTITIOUS) != 0) goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -4574,7 +4581,7 @@ small_mappings: } PMAP_UNLOCK(pmap); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -4594,7 +4601,7 @@ pmap_clear_reference(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_reference: page %p is not managed", m)); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if ((m->flags & PG_FICTITIOUS) != 0) goto small_mappings; pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -4634,7 +4641,7 @@ small_mappings: } PMAP_UNLOCK(pmap); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* From owner-svn-src-head@FreeBSD.ORG Sun May 20 19:04:51 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9B86E106566B; Sun, 20 May 2012 19:04:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1C9A38FC0A; Sun, 20 May 2012 19:04:49 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA13338; Sun, 20 May 2012 22:04:41 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1SWBQm-000G3h-SB; Sun, 20 May 2012 22:04:40 +0300 Message-ID: <4FB94046.7090108@FreeBSD.org> Date: Sun, 20 May 2012 22:04:38 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120503 Thunderbird/12.0.1 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201205151707.q4FH7UDU096834@svn.freebsd.org> <20120520110815.GB1442@garage.freebsd.pl> In-Reply-To: <20120520110815.GB1442@garage.freebsd.pl> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235478 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 19:04:51 -0000 on 20/05/2012 14:08 Pawel Jakub Dawidek said the following: > On Tue, May 15, 2012 at 05:07:30PM +0000, Andriy Gapon wrote: >> Author: avg Date: Tue May 15 17:07:29 2012 New Revision: 235478 URL: >> http://svn.freebsd.org/changeset/base/235478 >> >> Log: zpool_do_import: use /dev instead of /dev/dsk as a default >> >> This affects behavior of zpool import without -d option. > > How does it affect 'zpool import' behaviour? On FreeBSD when -d is not > given we should not scan entire /dev/, but take all available GEOM Here is a discussion thread that lead to this commit: http://thread.gmane.org/gmane.os.freebsd.current/141813 > providers from the GEOM. > >> Reported by: Bruce Cran Submitted by: Fabian Keil >> MFC after: 2 weeks >> >> Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c >> >> Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c >> ============================================================================== >> >> --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue May 15 16:17:30 2012 (r235477) >> +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue May 15 >> 17:07:29 2012 (r235478) @@ -1909,7 +1909,7 @@ zpool_do_import(int argc, >> char **argv) >> >> if (searchdirs == NULL) { searchdirs = safe_malloc(sizeof (char *)); - >> searchdirs[0] = "/dev/dsk"; + searchdirs[0] = "/dev"; nsearch = 1; } >> > -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Sun May 20 20:50:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 167671065670; Sun, 20 May 2012 20:50:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F25F8FC08; Sun, 20 May 2012 20:50:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4KKofNp015407; Sun, 20 May 2012 20:50:41 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4KKoe9S015405; Sun, 20 May 2012 20:50:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201205202050.q4KKoe9S015405@svn.freebsd.org> From: Warner Losh Date: Sun, 20 May 2012 20:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235698 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 20:50:42 -0000 Author: imp Date: Sun May 20 20:50:40 2012 New Revision: 235698 URL: http://svn.freebsd.org/changeset/base/235698 Log: Minor cleanup before some more major changes: o main_clock_hz isn't used, eliminate it o move main clock calculation code and table so we have only one ifdef. Modified: head/sys/arm/at91/at91_pmc.c Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Sun May 20 20:25:57 2012 (r235697) +++ head/sys/arm/at91/at91_pmc.c Sun May 20 20:50:40 2012 (r235698) @@ -55,7 +55,6 @@ static struct at91_pmc_softc { bus_space_handle_t sc_sh; struct resource *mem_res; /* Memory resource */ device_t dev; - unsigned int main_clock_hz; uint32_t pllb_init; } *pmc_softc; @@ -147,18 +146,6 @@ static struct at91_pmc_clock *clock_list &cpu }; -#if !defined(AT91C_MAIN_CLOCK) -static const unsigned int at91_mainf_tbl[] = { - 3000000, 3276800, 3686400, 3840000, 4000000, - 4433619, 4915200, 5000000, 5242880, 6000000, - 6144000, 6400000, 6553600, 7159090, 7372800, - 7864320, 8000000, 9830400, 10000000, 11059200, - 12000000, 12288000, 13560000, 14318180, 14745600, - 16000000, 17344700, 18432000, 20000000 -}; -#define MAINF_TBL_LEN (sizeof(at91_mainf_tbl) / sizeof(*at91_mainf_tbl)) -#endif - static inline uint32_t RD4(struct at91_pmc_softc *sc, bus_size_t off) { @@ -412,7 +399,6 @@ at91_pmc_init_clock(struct at91_pmc_soft udpck.pmc_mask = PMC_SCER_UDP_SAM9; } mckr = RD4(sc, PMC_MCKR); - sc->main_clock_hz = main_clock; main_ck.hz = main_clock; at91_pmc_pll_rate(&plla, RD4(sc, CKGR_PLLAR)); @@ -465,7 +451,7 @@ at91_pmc_init_clock(struct at91_pmc_soft device_printf(sc->dev, "Primary: %d Hz PLLA: %d MHz CPU: %d MHz MCK: %d MHz\n", - sc->main_clock_hz, + main_clock, plla.hz / 1000000, cpu.hz / 1000000, mck.hz / 1000000); @@ -520,6 +506,16 @@ at91_pmc_probe(device_t dev) } #if !defined(AT91C_MAIN_CLOCK) +static const unsigned int at91_mainf_tbl[] = { + 3000000, 3276800, 3686400, 3840000, 4000000, + 4433619, 4915200, 5000000, 5242880, 6000000, + 6144000, 6400000, 6553600, 7159090, 7372800, + 7864320, 8000000, 9830400, 10000000, 11059200, + 12000000, 12288000, 13560000, 14318180, 14745600, + 16000000, 17344700, 18432000, 20000000 +}; +#define MAINF_TBL_LEN (sizeof(at91_mainf_tbl) / sizeof(*at91_mainf_tbl)) + static unsigned int at91_pmc_sense_mainf(struct at91_pmc_softc *sc) { From owner-svn-src-head@FreeBSD.ORG Mon May 21 02:23:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1972106566B; Mon, 21 May 2012 02:23:21 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81D338FC0A; Mon, 21 May 2012 02:23:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4L2NKFU031490; Mon, 21 May 2012 02:23:20 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L2NKYO031488; Mon, 21 May 2012 02:23:20 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205210223.q4L2NKYO031488@svn.freebsd.org> From: Kevin Lo Date: Mon, 21 May 2012 02:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235710 - head/sys/libkern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 02:23:21 -0000 Author: kevlo Date: Mon May 21 02:23:20 2012 New Revision: 235710 URL: http://svn.freebsd.org/changeset/base/235710 Log: Remove dead code Modified: head/sys/libkern/iconv_ucs.c Modified: head/sys/libkern/iconv_ucs.c ============================================================================== --- head/sys/libkern/iconv_ucs.c Mon May 21 00:15:58 2012 (r235709) +++ head/sys/libkern/iconv_ucs.c Mon May 21 02:23:20 2012 (r235710) @@ -102,12 +102,12 @@ iconv_ucs_open(struct iconv_converter_cl if (cspf) dp->convtype |= KICONV_UCS_COMBINE; for (i = 0; unicode_family[i].name; i++) { - if (strcmp(from, unicode_family[i].name) == 0) + if (strcasecmp(from, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].from_flag; - if (strcmp(to, unicode_family[i].name) == 0) + if (strcasecmp(to, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].to_flag; } - if (strcmp(ENCODING_UNICODE, ENCODING_UTF16) == 0) + if (strcasecmp(ENCODING_UNICODE, ENCODING_UTF16) == 0) dp->convtype |= KICONV_UCS_UCS4; else dp->convtype &= ~KICONV_UCS_UCS4; @@ -457,8 +457,6 @@ utf8_to_ucs4(const char *src, size_t *ut /* out of utf-16 range or having illegal bits */ return (0); } - if (w == 0) - return (0); if (srclen < w) return (0); From owner-svn-src-head@FreeBSD.ORG Mon May 21 02:30:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58A74106564A; Mon, 21 May 2012 02:30:23 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4354E8FC12; Mon, 21 May 2012 02:30:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4L2UNna031813; Mon, 21 May 2012 02:30:23 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L2UN5b031810; Mon, 21 May 2012 02:30:23 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205210230.q4L2UN5b031810@svn.freebsd.org> From: Kevin Lo Date: Mon, 21 May 2012 02:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235711 - in head/sys: libkern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 02:30:23 -0000 Author: kevlo Date: Mon May 21 02:30:22 2012 New Revision: 235711 URL: http://svn.freebsd.org/changeset/base/235711 Log: Fix improper handling of variadic args with ICDEBUG PR: kern/168095 Submitted by: gcooper Modified: head/sys/libkern/iconv.c head/sys/sys/iconv.h Modified: head/sys/libkern/iconv.c ============================================================================== --- head/sys/libkern/iconv.c Mon May 21 02:23:20 2012 (r235710) +++ head/sys/libkern/iconv.c Mon May 21 02:30:22 2012 (r235711) @@ -549,9 +549,7 @@ int iconv_lookupcp(char **cpp, const char *s) { if (cpp == NULL) { - ICDEBUG("warning a NULL list passed\n", ""); /* XXX ISO variadic macros cannot - leave out the - variadic args */ + ICDEBUG("warning a NULL list passed\n", ""); return ENOENT; } for (; *cpp; cpp++) Modified: head/sys/sys/iconv.h ============================================================================== --- head/sys/sys/iconv.h Mon May 21 02:23:20 2012 (r235710) +++ head/sys/sys/iconv.h Mon May 21 02:30:22 2012 (r235711) @@ -240,7 +240,7 @@ int iconv_converter_tolowerstub(int c, v int iconv_converter_handler(module_t mod, int type, void *data); #ifdef ICONV_DEBUG -#define ICDEBUG(format, ...) printf("%s: "format, __func__ , __VA_ARGS__) +#define ICDEBUG(format, ...) printf("%s: "format, __func__ , ## __VA_ARGS__) #else #define ICDEBUG(format, ...) #endif From owner-svn-src-head@FreeBSD.ORG Mon May 21 02:41:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DEC41065670; Mon, 21 May 2012 02:41:15 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89B2D8FC0A; Mon, 21 May 2012 02:41:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4L2fFg4032341; Mon, 21 May 2012 02:41:15 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L2fFIH032339; Mon, 21 May 2012 02:41:15 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205210241.q4L2fFIH032339@svn.freebsd.org> From: Kevin Lo Date: Mon, 21 May 2012 02:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235712 - head/sys/libkern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 02:41:15 -0000 Author: kevlo Date: Mon May 21 02:41:15 2012 New Revision: 235712 URL: http://svn.freebsd.org/changeset/base/235712 Log: Fix broken ref count Submitted by: gcooper Modified: head/sys/libkern/iconv.c Modified: head/sys/libkern/iconv.c ============================================================================== --- head/sys/libkern/iconv.c Mon May 21 02:30:22 2012 (r235711) +++ head/sys/libkern/iconv.c Mon May 21 02:41:15 2012 (r235712) @@ -133,6 +133,7 @@ iconv_register_converter(struct iconv_co static int iconv_unregister_converter(struct iconv_converter_class *dcp) { + dcp->refs--; if (dcp->refs > 1) { ICDEBUG("converter have %d referenses left\n", dcp->refs); return EBUSY; From owner-svn-src-head@FreeBSD.ORG Mon May 21 02:45:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A783D106566B; Mon, 21 May 2012 02:45:48 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57AF58FC0A; Mon, 21 May 2012 02:45:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4L2jl6m032583; Mon, 21 May 2012 02:45:47 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L2jlE4032581; Mon, 21 May 2012 02:45:47 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205210245.q4L2jlE4032581@svn.freebsd.org> From: Kevin Lo Date: Mon, 21 May 2012 02:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235713 - head/sys/libkern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 02:45:48 -0000 Author: kevlo Date: Mon May 21 02:45:47 2012 New Revision: 235713 URL: http://svn.freebsd.org/changeset/base/235713 Log: Use strcmp that I replaced by accident. Modified: head/sys/libkern/iconv_ucs.c Modified: head/sys/libkern/iconv_ucs.c ============================================================================== --- head/sys/libkern/iconv_ucs.c Mon May 21 02:41:15 2012 (r235712) +++ head/sys/libkern/iconv_ucs.c Mon May 21 02:45:47 2012 (r235713) @@ -102,12 +102,12 @@ iconv_ucs_open(struct iconv_converter_cl if (cspf) dp->convtype |= KICONV_UCS_COMBINE; for (i = 0; unicode_family[i].name; i++) { - if (strcasecmp(from, unicode_family[i].name) == 0) + if (strcmp(from, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].from_flag; - if (strcasecmp(to, unicode_family[i].name) == 0) + if (strcmp(to, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].to_flag; } - if (strcasecmp(ENCODING_UNICODE, ENCODING_UTF16) == 0) + if (strcmp(ENCODING_UNICODE, ENCODING_UTF16) == 0) dp->convtype |= KICONV_UCS_UCS4; else dp->convtype &= ~KICONV_UCS_UCS4; From owner-svn-src-head@FreeBSD.ORG Mon May 21 03:06:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D7446106566B; Mon, 21 May 2012 03:06:31 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C33A58FC12; Mon, 21 May 2012 03:06:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4L36Vel033624; Mon, 21 May 2012 03:06:31 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L36VZ5033622; Mon, 21 May 2012 03:06:31 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201205210306.q4L36VZ5033622@svn.freebsd.org> From: David Xu Date: Mon, 21 May 2012 03:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235714 - head/gnu/usr.bin/gdb/libgdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 03:06:31 -0000 Author: davidxu Date: Mon May 21 03:06:31 2012 New Revision: 235714 URL: http://svn.freebsd.org/changeset/base/235714 Log: Print key value, an index, otherwise we don't know which key is allocated. Modified: head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Modified: head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c ============================================================================== --- head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Mon May 21 02:45:47 2012 (r235713) +++ head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Mon May 21 03:06:31 2012 (r235714) @@ -1311,7 +1311,7 @@ tsd_cb (thread_key_t key, void (*destruc else name = DEPRECATED_SYMBOL_NAME (ms); - printf_filtered ("Destructor %p <%s>\n", destructor, name); + printf_filtered ("Key %d, destructor %p <%s>\n", key, destructor, name); return 0; } From owner-svn-src-head@FreeBSD.ORG Mon May 21 04:24:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9DFF41065670; Mon, 21 May 2012 04:24:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E0C18FC0A; Mon, 21 May 2012 04:24:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4L4OxGV037061; Mon, 21 May 2012 04:24:59 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L4Oxib037059; Mon, 21 May 2012 04:24:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201205210424.q4L4Oxib037059@svn.freebsd.org> From: Warner Losh Date: Mon, 21 May 2012 04:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235715 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 04:24:59 -0000 Author: imp Date: Mon May 21 04:24:58 2012 New Revision: 235715 URL: http://svn.freebsd.org/changeset/base/235715 Log: Another minor re-arrangement of the code: calcualte the master clock frequency in the at91_pmc_clock_init rather than passing it in. Allow for frequencies >= 21MHz by rounding to the nearest 500Hz (Idea from Ian Lapore whose company uses a similar arrangement in their product). at91_pmc_clock_init() is now nearly independent of the rest of the pmc driver (which means we may be able to call it much earlier in boot soon to eliminate the master clock config file requirement for printf to work during early boot and also eliminate some interdependencies with the device ordering which requires pmc to be the first device added). Modified: head/sys/arm/at91/at91_pmc.c Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Mon May 21 03:06:31 2012 (r235714) +++ head/sys/arm/at91/at91_pmc.c Mon May 21 04:24:58 2012 (r235715) @@ -388,12 +388,66 @@ fail: return (0); } +#if !defined(AT91C_MAIN_CLOCK) +static const unsigned int at91_main_clock_tbl[] = { + 3000000, 3276800, 3686400, 3840000, 4000000, + 4433619, 4915200, 5000000, 5242880, 6000000, + 6144000, 6400000, 6553600, 7159090, 7372800, + 7864320, 8000000, 9830400, 10000000, 11059200, + 12000000, 12288000, 13560000, 14318180, 14745600, + 16000000, 17344700, 18432000, 20000000 +}; +#define MAIN_CLOCK_TBL_LEN (sizeof(at91_main_clock_tbl) / sizeof(*at91_main_clock_tbl)) + +static unsigned int +at91_pmc_sense_main_clock(struct at91_pmc_softc *sc) +{ + unsigned int ckgr_val; + unsigned int diff, matchdiff, freq; + int i; + + ckgr_val = (RD4(sc, CKGR_MCFR) & CKGR_MCFR_MAINF_MASK) << 11; + + /* + * Clocks up to 50MHz can be connected to some models. If + * the frequency is >= 21MHz, assume that the slow clock can + * measure it correctly, and that any error can be adequately + * compensated for by roudning to the nearest 500Hz. Users + * with fast, or odd-ball clocks will need to set + * AT91C_MASTER_CLOCK in the kernel config file. + */ + if (ckgr_val >= 21000000) + return ((ckgr_val + 250) / 500 * 500); + + /* + * Try to find the standard frequency that match best. + */ + freq = at91_main_clock_tbl[0]; + matchdiff = abs(ckgr_val - at91_main_clock_tbl[0]); + for (i = 1; i < MAIN_CLOCK_TBL_LEN; i++) { + diff = abs(ckgr_val - at91_main_clock_tbl[i]); + if (diff < matchdiff) { + freq = at91_main_clock_tbl[i]; + matchdiff = diff; + } + } + return (freq); +} +#endif + static void -at91_pmc_init_clock(struct at91_pmc_softc *sc, unsigned int main_clock) +at91_pmc_init_clock(struct at91_pmc_softc *sc) { + unsigned int main_clock; uint32_t mckr; uint32_t mdiv; +#if !defined(AT91C_MAIN_CLOCK) + main_clock = at91_pmc_sense_main_clock(pmc_softc); +#else + main_clock = AT91C_MAIN_CLOCK; +#endif + if (at91_is_sam9() || at91_is_sam9xe()) { uhpck.pmc_mask = PMC_SCER_UHP_SAM9; udpck.pmc_mask = PMC_SCER_UDP_SAM9; @@ -449,11 +503,9 @@ at91_pmc_init_clock(struct at91_pmc_soft at91_master_clock = mck.hz; - device_printf(sc->dev, - "Primary: %d Hz PLLA: %d MHz CPU: %d MHz MCK: %d MHz\n", - main_clock, - plla.hz / 1000000, - cpu.hz / 1000000, mck.hz / 1000000); + /* These clocks refrenced by "special" names */ + at91_pmc_clock_alias("ohci0", "ohci_clk"); + at91_pmc_clock_alias("udp0", "udp_clk"); /* Turn off "Progamable" clocks */ WR4(sc, PMC_SCDR, PMC_SCER_PCK0 | PMC_SCER_PCK1 | PMC_SCER_PCK2 | @@ -505,46 +557,9 @@ at91_pmc_probe(device_t dev) return (0); } -#if !defined(AT91C_MAIN_CLOCK) -static const unsigned int at91_mainf_tbl[] = { - 3000000, 3276800, 3686400, 3840000, 4000000, - 4433619, 4915200, 5000000, 5242880, 6000000, - 6144000, 6400000, 6553600, 7159090, 7372800, - 7864320, 8000000, 9830400, 10000000, 11059200, - 12000000, 12288000, 13560000, 14318180, 14745600, - 16000000, 17344700, 18432000, 20000000 -}; -#define MAINF_TBL_LEN (sizeof(at91_mainf_tbl) / sizeof(*at91_mainf_tbl)) - -static unsigned int -at91_pmc_sense_mainf(struct at91_pmc_softc *sc) -{ - unsigned int ckgr_val; - unsigned int diff, matchdiff; - int i, match; - - ckgr_val = (RD4(sc, CKGR_MCFR) & CKGR_MCFR_MAINF_MASK) << 11; - - /* - * Try to find the standard frequency that match best. - */ - match = 0; - matchdiff = abs(ckgr_val - at91_mainf_tbl[0]); - for (i = 1; i < MAINF_TBL_LEN; i++) { - diff = abs(ckgr_val - at91_mainf_tbl[i]); - if (diff < matchdiff) { - match = i; - matchdiff = diff; - } - } - return (at91_mainf_tbl[match]); -} -#endif - static int at91_pmc_attach(device_t dev) { - unsigned int mainf; int err; pmc_softc = device_get_softc(dev); @@ -555,16 +570,13 @@ at91_pmc_attach(device_t dev) /* * Configure main clock frequency. */ -#if !defined(AT91C_MAIN_CLOCK) - mainf = at91_pmc_sense_mainf(pmc_softc); -#else - mainf = AT91C_MAIN_CLOCK; -#endif - at91_pmc_init_clock(pmc_softc, mainf); + at91_pmc_init_clock(pmc_softc); - /* These clocks refrenced by "special" names */ - at91_pmc_clock_alias("ohci0", "ohci_clk"); - at91_pmc_clock_alias("udp0", "udp_clk"); + device_printf(dev, + "Primary: %d Hz PLLA: %d MHz CPU: %d MHz MCK: %d MHz\n", + main_ck.hz, + plla.hz / 1000000, + cpu.hz / 1000000, mck.hz / 1000000); return (0); } From owner-svn-src-head@FreeBSD.ORG Mon May 21 04:29:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F7811065670; Mon, 21 May 2012 04:29:12 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A3578FC15; Mon, 21 May 2012 04:29:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4L4TBxV037264; Mon, 21 May 2012 04:29:11 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L4TBEw037262; Mon, 21 May 2012 04:29:11 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201205210429.q4L4TBEw037262@svn.freebsd.org> From: Stanislav Sedov Date: Mon, 21 May 2012 04:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235716 - head/contrib/com_err X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 04:29:12 -0000 Author: stas Date: Mon May 21 04:29:11 2012 New Revision: 235716 URL: http://svn.freebsd.org/changeset/base/235716 Log: - On FreeBSD, com_err.h is installed into /usr/include, not /usr/include/krb5. Reflect that in the manpage. PR: bin/167986 Reported by: truckman@ Modified: head/contrib/com_err/com_err.3 Modified: head/contrib/com_err/com_err.3 ============================================================================== --- head/contrib/com_err/com_err.3 Mon May 21 04:24:58 2012 (r235715) +++ head/contrib/com_err/com_err.3 Mon May 21 04:29:11 2012 (r235716) @@ -54,7 +54,7 @@ Common Error Library (libcom_err, -lcom_ .Sh SYNOPSIS .Fd #include .Fd #include -.Fd #include +.Fd #include .Fd #include \&"XXX_err.h\&" .Pp typedef void (*errf)(const char *, long, const char *, ...); From owner-svn-src-head@FreeBSD.ORG Mon May 21 06:56:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D95161065670; Mon, 21 May 2012 06:56:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAFD88FC08; Mon, 21 May 2012 06:56:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4L6uRPF043844; Mon, 21 May 2012 06:56:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L6uR8L043842; Mon, 21 May 2012 06:56:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201205210656.q4L6uR8L043842@svn.freebsd.org> From: Warner Losh Date: Mon, 21 May 2012 06:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235717 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 06:56:27 -0000 Author: imp Date: Mon May 21 06:56:26 2012 New Revision: 235717 URL: http://svn.freebsd.org/changeset/base/235717 Log: Implement pmap_mincore for arm. Now programs using it don't cause a flood of console messages. Reviewed by: alc@ Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Mon May 21 04:29:11 2012 (r235716) +++ head/sys/arm/arm/pmap.c Mon May 21 06:56:26 2012 (r235717) @@ -4557,9 +4557,59 @@ pmap_remove_write(vm_page_t m) int pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { - printf("pmap_mincore()\n"); - - return (0); + struct l2_bucket *l2b; + pt_entry_t *ptep, pte; + vm_paddr_t pa; + vm_page_t m; + int val; + boolean_t managed; + + PMAP_LOCK(pmap); +retry: + l2b = pmap_get_l2_bucket(pmap, addr); + if (l2b == NULL) { + val = 0; + goto out; + } + ptep = &l2b->l2b_kva[l2pte_index(addr)]; + pte = *ptep; + if (!l2pte_valid(pte)) { + val = 0; + goto out; + } + val = MINCORE_INCORE; + if (pte & L2_S_PROT_W) + val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; + managed = false; + pa = l2pte_pa(pte); + m = PHYS_TO_VM_PAGE(pa); + if (m != NULL && !(m->oflags & VPO_UNMANAGED)) + managed = true; + if (managed) { + /* + * the ARM pmap tries to maintain a per-mapping + * reference bit. The trouble is that it's kept in + * the PV entry, not the PTE, so it's costly to access + * here. You would need to acquire the page queues + * lock, call pmap_find_pv(), and introduce a custom + * version of vm_page_pa_tryrelock() that releases and + * reacquires the page queues lock. In the end, I + * doubt it's worthwhile. This may falsely report + * the given address as referenced. + */ + if ((m->md.pvh_attrs & PVF_REF) != 0) + val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; + } + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && managed) { + /* Ensure that "PHYS_TO_VM_PAGE(pa)->object" doesn't change. */ + if (vm_page_pa_tryrelock(pmap, pa, locked_pa)) + goto retry; + } else +out: + PA_UNLOCK_COND(*locked_pa); + PMAP_UNLOCK(pmap); + return (val); } From owner-svn-src-head@FreeBSD.ORG Mon May 21 07:47:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A1ED1065674; Mon, 21 May 2012 07:47:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA28B8FC0A; Mon, 21 May 2012 07:47:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4L7lvFa046207; Mon, 21 May 2012 07:47:57 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L7lvFu046204; Mon, 21 May 2012 07:47:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201205210747.q4L7lvFu046204@svn.freebsd.org> From: Warner Losh Date: Mon, 21 May 2012 07:47:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235718 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 07:47:58 -0000 Author: imp Date: Mon May 21 07:47:57 2012 New Revision: 235718 URL: http://svn.freebsd.org/changeset/base/235718 Log: Be a little less magical, not that these values are likely to change... Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91reg.h Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Mon May 21 06:56:26 2012 (r235717) +++ head/sys/arm/at91/at91.c Mon May 21 07:47:57 2012 (r235718) @@ -69,11 +69,11 @@ at91_bs_map(void *t, bus_addr_t bpa, bus vm_paddr_t pa, endpa; pa = trunc_page(bpa); - if (pa >= 0xfff00000) { - *bshp = pa - 0xf0000000 + 0xd0000000; + if (pa >= AT91_PA_BASE + 0xff00000) { + *bshp = pa - AT91_PA_BASE + AT91_BASE; return (0); } - if (pa >= 0xdff00000) + if (pa >= AT91_BASE + 0xff00000) return (0); endpa = round_page(bpa + size); @@ -269,7 +269,7 @@ at91_attach(device_t dev) sc->sc_mem_rman.rm_descr = "AT91 Memory"; if (rman_init(&sc->sc_mem_rman) != 0) panic("at91_attach: failed to set up memory rman"); - for ( pdevmap = at91_devmap; pdevmap->pd_va != 0; pdevmap++) { + for (pdevmap = at91_devmap; pdevmap->pd_va != 0; pdevmap++) { if (rman_manage_region(&sc->sc_mem_rman, pdevmap->pd_va, pdevmap->pd_va + pdevmap->pd_size - 1) != 0) panic("at91_attach: failed to set up memory rman"); Modified: head/sys/arm/at91/at91reg.h ============================================================================== --- head/sys/arm/at91/at91reg.h Mon May 21 06:56:26 2012 (r235717) +++ head/sys/arm/at91/at91reg.h Mon May 21 07:47:57 2012 (r235718) @@ -35,6 +35,9 @@ /* Where builtin peripherals start in KVM */ #define AT91_BASE 0xd0000000 +/* Where builtin peripherals start PA */ +#define AT91_PA_BASE 0xf0000000 + /* A few things that we count on being the same * throught the whole family of SOCs */ From owner-svn-src-head@FreeBSD.ORG Mon May 21 07:52:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7FA3F1065670; Mon, 21 May 2012 07:52:47 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A7878FC1A; Mon, 21 May 2012 07:52:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4L7qlmQ046458; Mon, 21 May 2012 07:52:47 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L7qlQY046454; Mon, 21 May 2012 07:52:47 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205210752.q4L7qlQY046454@svn.freebsd.org> From: Kevin Lo Date: Mon, 21 May 2012 07:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235719 - in head/tools/regression: sysvmsg sysvsem sysvshm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 07:52:47 -0000 Author: kevlo Date: Mon May 21 07:52:46 2012 New Revision: 235719 URL: http://svn.freebsd.org/changeset/base/235719 Log: According to shared memory man pages, advice including instead of Modified: head/tools/regression/sysvmsg/msgtest.c head/tools/regression/sysvsem/semtest.c head/tools/regression/sysvshm/shmtest.c Modified: head/tools/regression/sysvmsg/msgtest.c ============================================================================== --- head/tools/regression/sysvmsg/msgtest.c Mon May 21 07:47:57 2012 (r235718) +++ head/tools/regression/sysvmsg/msgtest.c Mon May 21 07:52:46 2012 (r235719) @@ -35,7 +35,7 @@ * Test the SVID-compatible Message Queue facility. */ -#include +#include #include #include #include Modified: head/tools/regression/sysvsem/semtest.c ============================================================================== --- head/tools/regression/sysvsem/semtest.c Mon May 21 07:47:57 2012 (r235718) +++ head/tools/regression/sysvsem/semtest.c Mon May 21 07:52:46 2012 (r235719) @@ -35,7 +35,7 @@ * Test the SVID-compatible Semaphore facility. */ -#include +#include #include #include #include Modified: head/tools/regression/sysvshm/shmtest.c ============================================================================== --- head/tools/regression/sysvshm/shmtest.c Mon May 21 07:47:57 2012 (r235718) +++ head/tools/regression/sysvshm/shmtest.c Mon May 21 07:52:46 2012 (r235719) @@ -35,7 +35,7 @@ * Test the SVID-compatible Shared Memory facility. */ -#include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Mon May 21 08:10:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE8901065670; Mon, 21 May 2012 08:10:43 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AAED8FC17; Mon, 21 May 2012 08:10:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4L8AhYx047298; Mon, 21 May 2012 08:10:43 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4L8AhmF047296; Mon, 21 May 2012 08:10:43 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201205210810.q4L8AhmF047296@svn.freebsd.org> From: Gleb Kurtsou Date: Mon, 21 May 2012 08:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235720 - head/lib/libc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 08:10:43 -0000 Author: gleb Date: Mon May 21 08:10:42 2012 New Revision: 235720 URL: http://svn.freebsd.org/changeset/base/235720 Log: Disable NLS catalog use in libc if built with WITHOUT_NLS option. Functions affected: strerror, strsignal, gai_strerror. Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Mon May 21 07:52:46 2012 (r235719) +++ head/lib/libc/Makefile Mon May 21 08:10:42 2012 (r235720) @@ -26,7 +26,9 @@ SHLIB_MAJOR= 7 WARNS?= 2 CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include CFLAGS+=-I${.CURDIR}/${LIBC_ARCH} +.if ${MK_NLS} != "no" CFLAGS+=-DNLS +.endif CLEANFILES+=tags INSTALL_PIC_ARCHIVE= PRECIOUSLIB= From owner-svn-src-head@FreeBSD.ORG Mon May 21 13:31:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12A6A1065673; Mon, 21 May 2012 13:31:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE0E28FC0C; Mon, 21 May 2012 13:31:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LDVRnn060092; Mon, 21 May 2012 13:31:27 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LDVRvB060077; Mon, 21 May 2012 13:31:27 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201205211331.q4LDVRvB060077@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 21 May 2012 13:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 13:31:28 -0000 Author: bapt Date: Mon May 21 13:31:26 2012 New Revision: 235723 URL: http://svn.freebsd.org/changeset/base/235723 Log: Import byacc from invisible island, it brings us lots of compatibilities with bison, keeping full compatibility with our previous yacc implementation. Also bring the ability to create reentrant parser This fix bin/140309 [1] PR: bin/140309 [1] Submitted by: Philippe Pepiot [1] Approved by: des (mentor) MFC after: 1 month Added: head/contrib/byacc/ - copied from r235040, vendor/byacc/dist/ head/tools/regression/usr.bin/yacc/ head/tools/regression/usr.bin/yacc/Makefile (contents, props changed) head/tools/regression/usr.bin/yacc/calc.y (contents, props changed) head/tools/regression/usr.bin/yacc/calc1.y (contents, props changed) head/tools/regression/usr.bin/yacc/calc2.y (contents, props changed) head/tools/regression/usr.bin/yacc/calc3.y (contents, props changed) head/tools/regression/usr.bin/yacc/code_calc.y (contents, props changed) head/tools/regression/usr.bin/yacc/code_error.y (contents, props changed) head/tools/regression/usr.bin/yacc/error.y (contents, props changed) head/tools/regression/usr.bin/yacc/ftp.y (contents, props changed) head/tools/regression/usr.bin/yacc/grammar.y (contents, props changed) head/tools/regression/usr.bin/yacc/pure_calc.y (contents, props changed) head/tools/regression/usr.bin/yacc/pure_error.y (contents, props changed) head/tools/regression/usr.bin/yacc/quote_calc.y (contents, props changed) head/tools/regression/usr.bin/yacc/quote_calc2.y (contents, props changed) head/tools/regression/usr.bin/yacc/quote_calc3.y (contents, props changed) head/tools/regression/usr.bin/yacc/quote_calc4.y (contents, props changed) head/tools/regression/usr.bin/yacc/regress.00.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.01.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.02.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.03.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.04.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.05.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.06.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.07.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.08.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.09.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.10.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.11.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.12.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.13.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.14.out (contents, props changed) head/tools/regression/usr.bin/yacc/regress.sh (contents, props changed) head/tools/regression/usr.bin/yacc/regress.t (contents, props changed) head/tools/regression/usr.bin/yacc/undefined.y (contents, props changed) Deleted: head/usr.bin/yacc/ACKNOWLEDGEMENTS head/usr.bin/yacc/NEW_FEATURES head/usr.bin/yacc/NOTES head/usr.bin/yacc/README head/usr.bin/yacc/closure.c head/usr.bin/yacc/defs.h head/usr.bin/yacc/error.c head/usr.bin/yacc/lalr.c head/usr.bin/yacc/lr0.c head/usr.bin/yacc/main.c head/usr.bin/yacc/mkpar.c head/usr.bin/yacc/output.c head/usr.bin/yacc/reader.c head/usr.bin/yacc/skeleton.c head/usr.bin/yacc/symtab.c head/usr.bin/yacc/test/ head/usr.bin/yacc/verbose.c head/usr.bin/yacc/warshall.c head/usr.bin/yacc/yacc.1 head/usr.bin/yacc/yyfix.1 head/usr.bin/yacc/yyfix.sh Modified: head/contrib/byacc/defs.h head/contrib/byacc/main.c head/contrib/byacc/reader.c head/usr.bin/yacc/Makefile Modified: head/contrib/byacc/defs.h ============================================================================== --- vendor/byacc/dist/defs.h Fri May 4 22:54:54 2012 (r235040) +++ head/contrib/byacc/defs.h Mon May 21 13:31:26 2012 (r235723) @@ -241,7 +241,6 @@ extern char *line; extern int lineno; extern int outline; extern int exit_code; -extern int pure_parser; extern const char *const banner[]; extern const char *const xdecls[]; Modified: head/contrib/byacc/main.c ============================================================================== --- vendor/byacc/dist/main.c Fri May 4 22:54:54 2012 (r235040) +++ head/contrib/byacc/main.c Mon May 21 13:31:26 2012 (r235723) @@ -163,7 +163,7 @@ done(int k) } static void -onintr(int sig GCC_UNUSED) +onintr(__unused int sig) { got_intr = 1; done(EXIT_FAILURE); Modified: head/contrib/byacc/reader.c ============================================================================== --- vendor/byacc/dist/reader.c Fri May 4 22:54:54 2012 (r235040) +++ head/contrib/byacc/reader.c Mon May 21 13:31:26 2012 (r235723) @@ -338,6 +338,7 @@ keyword(void) } syntax_error(lineno, line, t_cptr); /*NOTREACHED */ + return (-1); } static void @@ -1781,6 +1782,8 @@ mark_symbol(void) int c; bucket *bp; + bp = NULL; + c = cptr[1]; if (c == '%' || c == '\\') { Added: head/tools/regression/usr.bin/yacc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/Makefile Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +all: + @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} Added: head/tools/regression/usr.bin/yacc/calc.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/calc.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,106 @@ +%{ +# include +# include + +int regs[26]; +int base; + +extern int yylex(void); +static void yyerror(const char *s); + +%} + +%start list + +%token DIGIT LETTER + +%left '|' +%left '&' +%left '+' '-' +%left '*' '/' '%' +%left UMINUS /* supplies precedence for unary minus */ + +%% /* beginning of rules section */ + +list : /* empty */ + | list stat '\n' + | list error '\n' + { yyerrok ; } + ; + +stat : expr + { printf("%d\n",$1);} + | LETTER '=' expr + { regs[$1] = $3; } + ; + +expr : '(' expr ')' + { $$ = $2; } + | expr '+' expr + { $$ = $1 + $3; } + | expr '-' expr + { $$ = $1 - $3; } + | expr '*' expr + { $$ = $1 * $3; } + | expr '/' expr + { $$ = $1 / $3; } + | expr '%' expr + { $$ = $1 % $3; } + | expr '&' expr + { $$ = $1 & $3; } + | expr '|' expr + { $$ = $1 | $3; } + | '-' expr %prec UMINUS + { $$ = - $2; } + | LETTER + { $$ = regs[$1]; } + | number + ; + +number: DIGIT + { $$ = $1; base = ($1==0) ? 8 : 10; } + | number DIGIT + { $$ = base * $1 + $2; } + ; + +%% /* start of programs */ + +int +main (void) +{ + while(!feof(stdin)) { + yyparse(); + } + return 0; +} + +static void +yyerror(const char *s) +{ + fprintf(stderr, "%s\n", s); +} + +int +yylex(void) +{ + /* lexical analysis routine */ + /* returns LETTER for a lower case letter, yylval = 0 through 25 */ + /* return DIGIT for a digit, yylval = 0 through 9 */ + /* all other characters are returned immediately */ + + int c; + + while( (c=getchar()) == ' ' ) { /* skip blanks */ } + + /* c is now nonblank */ + + if( islower( c )) { + yylval = c - 'a'; + return ( LETTER ); + } + if( isdigit( c )) { + yylval = c - '0'; + return ( DIGIT ); + } + return( c ); +} Added: head/tools/regression/usr.bin/yacc/calc1.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/calc1.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,305 @@ +%{ + +/* http://dinosaur.compilertools.net/yacc/index.html */ + +#include +#include +#include +#include + +typedef struct interval +{ + double lo, hi; +} +INTERVAL; + +INTERVAL vmul(double, double, INTERVAL); +INTERVAL vdiv(double, double, INTERVAL); + +extern int yylex(void); +static void yyerror(const char *s); + +int dcheck(INTERVAL); + +double dreg[26]; +INTERVAL vreg[26]; + +%} +%expect 18 + +%start line +%union +{ + int ival; + double dval; + INTERVAL vval; +} + +%token DREG VREG /* indices into dreg, vreg arrays */ +%token CONST /* floating point constant */ + +%type dexp /* expression */ +%type vexp /* interval expression */ + + /* precedence information about the operators */ + +%left '+' '-' +%left '*' '/' +%left UMINUS /* precedence for unary minus */ + +%% /* beginning of rules section */ + +lines : /* empty */ + | lines line + ; + +line : dexp '\n' + { + (void) printf("%15.8f\n", $1); + } + | vexp '\n' + { + (void) printf("(%15.8f, %15.8f)\n", $1.lo, $1.hi); + } + | DREG '=' dexp '\n' + { + dreg[$1] = $3; + } + | VREG '=' vexp '\n' + { + vreg[$1] = $3; + } + | error '\n' + { + yyerrok; + } + ; + +dexp : CONST + | DREG + { + $$ = dreg[$1]; + } + | dexp '+' dexp + { + $$ = $1 + $3; + } + | dexp '-' dexp + { + $$ = $1 - $3; + } + | dexp '*' dexp + { + $$ = $1 * $3; + } + | dexp '/' dexp + { + $$ = $1 / $3; + } + | '-' dexp %prec UMINUS + { + $$ = -$2; + } + | '(' dexp ')' + { + $$ = $2; + } + ; + +vexp : dexp + { + $$.hi = $$.lo = $1; + } + | '(' dexp ',' dexp ')' + { + $$.lo = $2; + $$.hi = $4; + if ( $$.lo > $$.hi ) + { + (void) printf("interval out of order\n"); + YYERROR; + } + } + | VREG + { + $$ = vreg[$1]; + } + | vexp '+' vexp + { + $$.hi = $1.hi + $3.hi; + $$.lo = $1.lo + $3.lo; + } + | dexp '+' vexp + { + $$.hi = $1 + $3.hi; + $$.lo = $1 + $3.lo; + } + | vexp '-' vexp + { + $$.hi = $1.hi - $3.lo; + $$.lo = $1.lo - $3.hi; + } + | dexp '-' vexp + { + $$.hi = $1 - $3.lo; + $$.lo = $1 - $3.hi; + } + | vexp '*' vexp + { + $$ = vmul( $1.lo, $1.hi, $3 ); + } + | dexp '*' vexp + { + $$ = vmul ($1, $1, $3 ); + } + | vexp '/' vexp + { + if (dcheck($3)) YYERROR; + $$ = vdiv ( $1.lo, $1.hi, $3 ); + } + | dexp '/' vexp + { + if (dcheck ( $3 )) YYERROR; + $$ = vdiv ($1, $1, $3 ); + } + | '-' vexp %prec UMINUS + { + $$.hi = -$2.lo; + $$.lo = -$2.hi; + } + | '(' vexp ')' + { + $$ = $2; + } + ; + +%% /* beginning of subroutines section */ + +#define BSZ 50 /* buffer size for floating point numbers */ + + /* lexical analysis */ + +static void +yyerror(const char *s) +{ + fprintf(stderr, "%s\n", s); +} + +int +yylex(void) +{ + int c; + + while ((c = getchar()) == ' ') + { /* skip over blanks */ + } + + if (isupper(c)) + { + yylval.ival = c - 'A'; + return (VREG); + } + if (islower(c)) + { + yylval.ival = c - 'a'; + return (DREG); + } + + if (isdigit(c) || c == '.') + { + /* gobble up digits, points, exponents */ + char buf[BSZ + 1], *cp = buf; + int dot = 0, expr = 0; + + for (; (cp - buf) < BSZ; ++cp, c = getchar()) + { + + *cp = c; + if (isdigit(c)) + continue; + if (c == '.') + { + if (dot++ || expr) + return ('.'); /* will cause syntax error */ + continue; + } + + if (c == 'e') + { + if (expr++) + return ('e'); /* will cause syntax error */ + continue; + } + + /* end of number */ + break; + } + *cp = '\0'; + + if ((cp - buf) >= BSZ) + printf("constant too long: truncated\n"); + else + ungetc(c, stdin); /* push back last char read */ + yylval.dval = atof(buf); + return (CONST); + } + return (c); +} + +static INTERVAL +hilo(double a, double b, double c, double d) +{ + /* returns the smallest interval containing a, b, c, and d */ + /* used by *, / routines */ + INTERVAL v; + + if (a > b) + { + v.hi = a; + v.lo = b; + } + else + { + v.hi = b; + v.lo = a; + } + + if (c > d) + { + if (c > v.hi) + v.hi = c; + if (d < v.lo) + v.lo = d; + } + else + { + if (d > v.hi) + v.hi = d; + if (c < v.lo) + v.lo = c; + } + return (v); +} + +INTERVAL +vmul(double a, double b, INTERVAL v) +{ + return (hilo(a * v.hi, a * v.lo, b * v.hi, b * v.lo)); +} + +int +dcheck(INTERVAL v) +{ + if (v.hi >= 0. && v.lo <= 0.) + { + printf("divisor interval contains 0.\n"); + return (1); + } + return (0); +} + +INTERVAL +vdiv(double a, double b, INTERVAL v) +{ + return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); +} Added: head/tools/regression/usr.bin/yacc/calc2.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/calc2.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,120 @@ +%parse-param { int regs[26] } +%parse-param { int *base } + +%lex-param { int *base } + +%{ +# include +# include + +#ifdef YYBISON +#define YYLEX_PARAM base +#define YYLEX_DECL() yylex(int *YYLEX_PARAM) +#define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s) +int YYLEX_DECL(); +static void YYERROR_DECL(); +#endif + +%} + +%start list + +%token DIGIT LETTER + +%left '|' +%left '&' +%left '+' '-' +%left '*' '/' '%' +%left UMINUS /* supplies precedence for unary minus */ + +%% /* beginning of rules section */ + +list : /* empty */ + | list stat '\n' + | list error '\n' + { yyerrok ; } + ; + +stat : expr + { printf("%d\n",$1);} + | LETTER '=' expr + { regs[$1] = $3; } + ; + +expr : '(' expr ')' + { $$ = $2; } + | expr '+' expr + { $$ = $1 + $3; } + | expr '-' expr + { $$ = $1 - $3; } + | expr '*' expr + { $$ = $1 * $3; } + | expr '/' expr + { $$ = $1 / $3; } + | expr '%' expr + { $$ = $1 % $3; } + | expr '&' expr + { $$ = $1 & $3; } + | expr '|' expr + { $$ = $1 | $3; } + | '-' expr %prec UMINUS + { $$ = - $2; } + | LETTER + { $$ = regs[$1]; } + | number + ; + +number: DIGIT + { $$ = $1; (*base) = ($1==0) ? 8 : 10; } + | number DIGIT + { $$ = (*base) * $1 + $2; } + ; + +%% /* start of programs */ + +#ifdef YYBYACC +extern int YYLEX_DECL(); +#endif + +int +main (void) +{ + int regs[26]; + int base = 10; + + while(!feof(stdin)) { + yyparse(regs, &base); + } + return 0; +} + +static void +YYERROR_DECL() +{ + fprintf(stderr, "%s\n", s); +} + +int +YYLEX_DECL() +{ + /* lexical analysis routine */ + /* returns LETTER for a lower case letter, yylval = 0 through 25 */ + /* return DIGIT for a digit, yylval = 0 through 9 */ + /* all other characters are returned immediately */ + + int c; + + while( (c=getchar()) == ' ' ) { /* skip blanks */ } + + /* c is now nonblank */ + + if( islower( c )) { + yylval = c - 'a'; + return ( LETTER ); + } + if( isdigit( c )) { + yylval = (c - '0') % (*base); + return ( DIGIT ); + } + return( c ); +} Added: head/tools/regression/usr.bin/yacc/calc3.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/calc3.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,123 @@ +%pure-parser + +%parse-param { int regs[26] } +%parse-param { int *base } + +%lex-param { int *base } + +%{ +# include +# include + +#ifdef YYBISON +#define YYSTYPE int +#define YYLEX_PARAM base +#define YYLEX_DECL() yylex(YYSTYPE *yylval, int *YYLEX_PARAM) +#define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s) +int YYLEX_DECL(); +static void YYERROR_DECL(); +#endif + +%} + +%start list + +%token DIGIT LETTER + +%left '|' +%left '&' +%left '+' '-' +%left '*' '/' '%' +%left UMINUS /* supplies precedence for unary minus */ + +%% /* beginning of rules section */ + +list : /* empty */ + | list stat '\n' + | list error '\n' + { yyerrok ; } + ; + +stat : expr + { printf("%d\n",$1);} + | LETTER '=' expr + { regs[$1] = $3; } + ; + +expr : '(' expr ')' + { $$ = $2; } + | expr '+' expr + { $$ = $1 + $3; } + | expr '-' expr + { $$ = $1 - $3; } + | expr '*' expr + { $$ = $1 * $3; } + | expr '/' expr + { $$ = $1 / $3; } + | expr '%' expr + { $$ = $1 % $3; } + | expr '&' expr + { $$ = $1 & $3; } + | expr '|' expr + { $$ = $1 | $3; } + | '-' expr %prec UMINUS + { $$ = - $2; } + | LETTER + { $$ = regs[$1]; } + | number + ; + +number: DIGIT + { $$ = $1; (*base) = ($1==0) ? 8 : 10; } + | number DIGIT + { $$ = (*base) * $1 + $2; } + ; + +%% /* start of programs */ + +#ifdef YYBYACC +extern int YYLEX_DECL(); +#endif + +int +main (void) +{ + int regs[26]; + int base = 10; + + while(!feof(stdin)) { + yyparse(regs, &base); + } + return 0; +} + +static void +YYERROR_DECL() +{ + fprintf(stderr, "%s\n", s); +} + +int +YYLEX_DECL() +{ + /* lexical analysis routine */ + /* returns LETTER for a lower case letter, yylval = 0 through 25 */ + /* return DIGIT for a digit, yylval = 0 through 9 */ + /* all other characters are returned immediately */ + + int c; + + while( (c=getchar()) == ' ' ) { /* skip blanks */ } + + /* c is now nonblank */ + + if( islower( c )) { + *yylval = (c - 'a'); + return ( LETTER ); + } + if( isdigit( c )) { + *yylval = (c - '0') % (*base); + return ( DIGIT ); + } + return( c ); +} Added: head/tools/regression/usr.bin/yacc/code_calc.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/code_calc.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,112 @@ +%{ +# include +# include + +int regs[26]; +int base; + +#ifdef YYBISON +int yylex(void); +static void yyerror(const char *s); +#endif + +%} + +%start list + +%token DIGIT LETTER + +%left '|' +%left '&' +%left '+' '-' +%left '*' '/' '%' +%left UMINUS /* supplies precedence for unary minus */ + +%% /* beginning of rules section */ + +list : /* empty */ + | list stat '\n' + | list error '\n' + { yyerrok ; } + ; + +stat : expr + { printf("%d\n",$1);} + | LETTER '=' expr + { regs[$1] = $3; } + ; + +expr : '(' expr ')' + { $$ = $2; } + | expr '+' expr + { $$ = $1 + $3; } + | expr '-' expr + { $$ = $1 - $3; } + | expr '*' expr + { $$ = $1 * $3; } + | expr '/' expr + { $$ = $1 / $3; } + | expr '%' expr + { $$ = $1 % $3; } + | expr '&' expr + { $$ = $1 & $3; } + | expr '|' expr + { $$ = $1 | $3; } + | '-' expr %prec UMINUS + { $$ = - $2; } + | LETTER + { $$ = regs[$1]; } + | number + ; + +number: DIGIT + { $$ = $1; base = ($1==0) ? 8 : 10; } + | number DIGIT + { $$ = base * $1 + $2; } + ; + +%% /* start of programs */ + +#ifdef YYBYACC +extern int YYLEX_DECL(); +#endif + +int +main (void) +{ + while(!feof(stdin)) { + yyparse(); + } + return 0; +} + +static void +yyerror(const char *s) +{ + fprintf(stderr, "%s\n", s); +} + +int +yylex(void) +{ + /* lexical analysis routine */ + /* returns LETTER for a lower case letter, yylval = 0 through 25 */ + /* return DIGIT for a digit, yylval = 0 through 9 */ + /* all other characters are returned immediately */ + + int c; + + while( (c=getchar()) == ' ' ) { /* skip blanks */ } + + /* c is now nonblank */ + + if( islower( c )) { + yylval = c - 'a'; + return ( LETTER ); + } + if( isdigit( c )) { + yylval = c - '0'; + return ( DIGIT ); + } + return( c ); +} Added: head/tools/regression/usr.bin/yacc/code_error.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/code_error.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,36 @@ +%{ + +#ifdef YYBISON +int yylex(void); +static void yyerror(const char *); +#endif + +%} +%% +S: error +%% + +#include + +#ifdef YYBYACC +extern int YYLEX_DECL(); +#endif + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} Added: head/tools/regression/usr.bin/yacc/error.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/error.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,28 @@ +%{ +int yylex(void); +static void yyerror(const char *); +%} +%% +S: error +%% + +#include + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} Added: head/tools/regression/usr.bin/yacc/ftp.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/yacc/ftp.y Mon May 21 13:31:26 2012 (r235723) @@ -0,0 +1,1228 @@ +/* + * Copyright (c) 1985, 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * @(#)ftpcmd.y 5.20.1.1 (Berkeley) 3/2/89 + */ + +/* + * Grammar for FTP commands. + * See RFC 959. + */ + +%{ + +/* sccsid[] = "@(#)ftpcmd.y 5.20.1.1 (Berkeley) 3/2/89"; */ + +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef YYBISON +int yylex(void); +static void yyerror(const char *); +#endif + +extern struct sockaddr_in data_dest; +extern int logged_in; +extern struct passwd *pw; +extern int guest; +extern int logging; +extern int type; +extern int form; +extern int debug; +extern int timeout; +extern int maxtimeout; +extern int pdata; +extern char hostname[], remotehost[]; +extern char proctitle[]; +extern char *globerr; +extern int usedefault; +extern int transflag; +extern char tmpline[]; + +extern char **glob(char *); +extern char *renamefrom(char *); +extern void cwd(const char *); + +extern void dologout(int); +extern void fatal(const char *); +extern void makedir(const char *); +extern void nack(const char *); +extern void pass(const char *); +extern void passive(void); +extern void pwd(void); +extern void removedir(char *); +extern void renamecmd(char *, char *); +extern void retrieve(const char *, const char *); +extern void send_file_list(const char *); +extern void statcmd(void); +extern void statfilecmd(const char *); +extern void store(char *, const char *, int); +extern void user(const char *); + +extern void perror_reply(int, const char *, ...); +extern void reply(int, const char *, ...); +extern void lreply(int, const char *, ...); + +static int cmd_type; +static int cmd_form; +static int cmd_bytesz; +char cbuf[512]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon May 21 15:01:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64E1C1065676; Mon, 21 May 2012 15:01:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 453868FC0A; Mon, 21 May 2012 15:01:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LF1Zpn062595; Mon, 21 May 2012 15:01:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LF1Zep062593; Mon, 21 May 2012 15:01:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201205211501.q4LF1Zep062593@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 21 May 2012 15:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235725 - head/etc/devd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 15:01:36 -0000 Author: hselasky Date: Mon May 21 15:01:35 2012 New Revision: 235725 URL: http://svn.freebsd.org/changeset/base/235725 Log: Regenerate usb.conf MFC after: 3 days Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Mon May 21 14:47:34 2012 (r235724) +++ head/etc/devd/usb.conf Mon May 21 15:01:35 2012 (r235725) @@ -157,7 +157,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0403"; - match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xa6d0|0xa6d0|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; + match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; action "kldload -n uftdi"; }; @@ -1021,7 +1021,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05c6"; - match "product" "(0x1000|0x6000|0x6613)"; + match "product" "(0x1000|0x6000|0x6613|0x9000)"; action "kldload -n u3g"; }; @@ -2852,6 +2852,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x1199"; + match "product" "0x68aa"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x11ad"; match "product" "0x0701"; action "kldload -n uplcom"; @@ -3661,7 +3669,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x19d2"; - match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0117|0x2000|0x2002|0x2003|0xfff1|0xfff5|0xfffe)"; + match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0117|0x1179|0x2000|0x2002|0x2003|0xfff1|0xfff5|0xfffe)"; action "kldload -n u3g"; }; @@ -4165,7 +4173,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x9710"; - match "product" "0x7830"; + match "product" "(0x7830|0x7832)"; action "kldload -n if_mos"; }; @@ -4336,5 +4344,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 1652 USB entries processed +# 1654 USB entries processed From owner-svn-src-head@FreeBSD.ORG Mon May 21 15:38:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D899C1065675; Mon, 21 May 2012 15:38:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id ADE1C8FC1E; Mon, 21 May 2012 15:38:46 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2F554B949; Mon, 21 May 2012 11:38:46 -0400 (EDT) From: John Baldwin To: Gleb Kurtsou Date: Mon, 21 May 2012 11:27:34 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <201205181001.q4IA1VED044374@svn.freebsd.org> <201205180941.48076.jhb@freebsd.org> <20120518152436.GA9116@reks> In-Reply-To: <20120518152436.GA9116@reks> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201205211127.34052.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 21 May 2012 11:38:46 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235601 - head/include/protocols X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 15:38:46 -0000 On Friday, May 18, 2012 11:24:36 am Gleb Kurtsou wrote: > On (18/05/2012 09:41), John Baldwin wrote: > > On Friday, May 18, 2012 6:01:31 am Gleb Kurtsou wrote: > > > Author: gleb > > > Date: Fri May 18 10:01:31 2012 > > > New Revision: 235601 > > > URL: http://svn.freebsd.org/changeset/base/235601 > > > > > > Log: > > > Don't use ino_t in dumprestore protocol definition. > > > > > > Since ino_t size is about to change to 64-bits, replace ino_t used in > > > dump protocol definition with 32-bit dump_ino_t to preserve backward > > > compatibility. At some point, it may be necessary to use spare fields > > > in struct in order to fully support 64-bit inode numbers. > > > > > > Sponsored by: Google Summer of Code 2011 > > > > A question about your stat changes: did you expand dev_t to 32 bits for the > > AFS folks, or did you leave it as 16 bits? > > dev_t is already 32-bit. Changing it to 64-bit was discussed at some > point and from what I recall no decision was made: > > http://marc.info/?t=129119478700005&r=1&w=2 > > I'm going to commit preparatory changes only for now. Then publish diff > for testing. We can still change dev_t to 64-bit if needed. Although I > didn't work on it. Ah, it was 64-bit they asked for. If it is easy to do so, I'd favor changing it since you've already done all the hard work of rolling a new stat structure. I'd rather err on wasting 32-bits for dev_t than having to do all this over again. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon May 21 15:45:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2647E1065670; Mon, 21 May 2012 15:45:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11EA18FC17; Mon, 21 May 2012 15:45:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LFjIYc063694; Mon, 21 May 2012 15:45:18 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LFjISZ063692; Mon, 21 May 2012 15:45:18 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201205211545.q4LFjISZ063692@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 21 May 2012 15:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235726 - head/usr.sbin/pkg X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 15:45:19 -0000 Author: bapt Date: Mon May 21 15:45:18 2012 New Revision: 235726 URL: http://svn.freebsd.org/changeset/base/235726 Log: Add missing \n when generating pkg.conf Reported by: beat Approved by: des (mentor) MFC after: 1 day Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Mon May 21 15:01:35 2012 (r235725) +++ head/usr.sbin/pkg/pkg.c Mon May 21 15:45:18 2012 (r235726) @@ -371,7 +371,7 @@ bootstrap_pkg(void) config = fopen(conf, "w+"); if (config == NULL) goto cleanup; - fprintf(config, "packagesite: %s", url); + fprintf(config, "packagesite: %s\n", url); fclose(config); } From owner-svn-src-head@FreeBSD.ORG Mon May 21 16:03:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0EB56106566C; Mon, 21 May 2012 16:03:45 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEC298FC23; Mon, 21 May 2012 16:03:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LG3ifl064166; Mon, 21 May 2012 16:03:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LG3igN064164; Mon, 21 May 2012 16:03:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205211603.q4LG3igN064164@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 21 May 2012 16:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235727 - head/gnu/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 16:03:45 -0000 Author: marcel Date: Mon May 21 16:03:44 2012 New Revision: 235727 URL: http://svn.freebsd.org/changeset/base/235727 Log: Don't recurse into libssp when MK_SSP is set to no. Modified: head/gnu/lib/Makefile Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Mon May 21 15:45:18 2012 (r235726) +++ head/gnu/lib/Makefile Mon May 21 16:03:44 2012 (r235727) @@ -2,7 +2,11 @@ .include -SUBDIR= csu libgcc libgcov libdialog libgomp libregex libreadline libssp +SUBDIR= csu libgcc libgcov libdialog libgomp libregex libreadline + +.if ${MK_SSP} != "no" +SUBDIR+= libssp +.endif # libsupc++ uses libstdc++ headers, although 'make includes' should # have taken care of that already. From owner-svn-src-head@FreeBSD.ORG Mon May 21 17:51:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 494B310658F3; Mon, 21 May 2012 17:51:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34C0D8FC17; Mon, 21 May 2012 17:51:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LHpQio067132; Mon, 21 May 2012 17:51:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LHpQc5067130; Mon, 21 May 2012 17:51:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205211751.q4LHpQc5067130@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 May 2012 17:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235728 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 17:51:27 -0000 Author: adrian Date: Mon May 21 17:51:26 2012 New Revision: 235728 URL: http://svn.freebsd.org/changeset/base/235728 Log: Re-add 'ic' and properly wrap it in the SUPERG macro. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Mon May 21 16:03:44 2012 (r235727) +++ head/sys/dev/ath/if_ath_rx.c Mon May 21 17:51:26 2012 (r235728) @@ -767,6 +767,9 @@ ath_rx_proc(struct ath_softc *sc, int re struct ath_buf *bf; struct ifnet *ifp = sc->sc_ifp; struct ath_hal *ah = sc->sc_ah; +#ifdef IEEE80211_SUPPORT_SUPERG + struct ieee80211com *ic = ifp->if_l2com; +#endif struct ath_desc *ds; struct ath_rx_status *rs; struct mbuf *m; From owner-svn-src-head@FreeBSD.ORG Mon May 21 18:28:24 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC6D21065676; Mon, 21 May 2012 18:28:24 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from smtp5.server.rpi.edu (smtp5.server.rpi.edu [128.113.2.225]) by mx1.freebsd.org (Postfix) with ESMTP id 30D668FC0A; Mon, 21 May 2012 18:28:23 +0000 (UTC) Received: from gilead.netel.rpi.edu (gilead.netel.rpi.edu [128.113.124.121]) by smtp5.server.rpi.edu (8.13.1/8.13.1) with ESMTP id q4LHK6rE007508; Mon, 21 May 2012 13:20:06 -0400 Message-ID: <4FBA7946.7040702@FreeBSD.org> Date: Mon, 21 May 2012 13:20:06 -0400 From: Garance A Drosehn User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100722 Eudora/3.0.4 MIME-Version: 1.0 To: John Baldwin References: <201205181001.q4IA1VED044374@svn.freebsd.org> <201205180941.48076.jhb@freebsd.org> <20120518152436.GA9116@reks> <201205211127.34052.jhb@freebsd.org> In-Reply-To: <201205211127.34052.jhb@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Bayes-Prob: 0.0001 (Score 0) X-RPI-SA-Score: 2.30 (**) [Hold at 8.00] COMBINED_FROM, INFO_TLD, RATWARE_GECKO_BUILD X-CanItPRO-Stream: outgoing X-Canit-Stats-ID: 49638602 - cb1303eee5ea X-Scanned-By: CanIt (www . roaringpenguin . com) on 128.113.2.225 Cc: svn-src-head@FreeBSD.org, Gleb Kurtsou , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r235601 - head/include/protocols X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 18:28:24 -0000 On 5/21/12 11:27 AM, John Baldwin wrote: > On Friday, May 18, 2012 11:24:36 am Gleb Kurtsou wrote: > >> On (18/05/2012 09:41), John Baldwin wrote: >> >>> A question about your stat changes: did you expand dev_t to 32 bits >>> for the AFS folks, or did you leave it as 16 bits? >> dev_t is already 32-bit. Changing it to 64-bit was discussed at some >> point and from what I recall no decision was made: >> >> http://marc.info/?t=129119478700005&r=1&w=2 >> >> I'm going to commit preparatory changes only for now. Then publish >> diff for testing. We can still change dev_t to 64-bit if needed. >> Although I didn't work on it. >> > Ah, it was 64-bit they asked for. If it is easy to do so, I'd favor > changing it since you've already done all the hard work of rolling a > new stat structure. I'd rather err on wasting 32-bits for dev_t than > having to do all this over again. > I would also like to see dev_t changed to 64-bits as part of these 'stat' changes, if that won't cause too much work. It should be less work to do it as part of these changes than to do it later! If changing dev_t to 64-bits turns out to be too much work right now, then maybe we could at least reserve a 64-bit space and have the current dev_t be the low-order 32-bits of that space. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-svn-src-head@FreeBSD.ORG Mon May 21 21:04:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5DAA106564A; Mon, 21 May 2012 21:04:30 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8705D8FC0C; Mon, 21 May 2012 21:04:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LL4UnN072619; Mon, 21 May 2012 21:04:30 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LL4UDN072617; Mon, 21 May 2012 21:04:30 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201205212104.q4LL4UDN072617@svn.freebsd.org> From: Guy Helmer Date: Mon, 21 May 2012 21:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235739 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 21:04:30 -0000 Author: ghelmer Date: Mon May 21 21:04:29 2012 New Revision: 235739 URL: http://svn.freebsd.org/changeset/base/235739 Log: Apply style(9) to return and switch/case statements. Reviewed by: delphij (prior version of the patch) Modified: head/lib/libc/gen/getnetgrent.c Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Mon May 21 19:58:40 2012 (r235738) +++ head/lib/libc/gen/getnetgrent.c Mon May 21 21:04:29 2012 (r235739) @@ -292,12 +292,12 @@ _listmatch(const char *list, const char while(*ptr != ',' && *ptr != '\0' && !isspace((unsigned char)*ptr)) ptr++; if (strncmp(cptr, group, glen) == 0 && glen == (ptr - cptr)) - return(1); + return (1); while(*ptr == ',' || isspace((unsigned char)*ptr)) ptr++; } - return(0); + return (0); } static int @@ -311,32 +311,35 @@ _revnetgr_lookup(char* lookupdom, char* for (rot = 0; ; rot++) { switch (rot) { - case(0): snprintf(key, MAXHOSTNAMELEN, "%s.%s", - str, dom?dom:lookupdom); - break; - case(1): snprintf(key, MAXHOSTNAMELEN, "%s.*", - str); - break; - case(2): snprintf(key, MAXHOSTNAMELEN, "*.%s", - dom?dom:lookupdom); - break; - case(3): snprintf(key, MAXHOSTNAMELEN, "*.*"); - break; - default: return(0); + case(0): + snprintf(key, MAXHOSTNAMELEN, "%s.%s", str, + dom ? dom : lookupdom); + break; + case(1): + snprintf(key, MAXHOSTNAMELEN, "%s.*", str); + break; + case(2): + snprintf(key, MAXHOSTNAMELEN, "*.%s", + dom ? dom : lookupdom); + break; + case(3): + snprintf(key, MAXHOSTNAMELEN, "*.*"); + break; + default: return (0); } y = yp_match(lookupdom, map, key, strlen(key), &result, &resultlen); if (y == 0) { rv = _listmatch(result, group, resultlen); free(result); - if (rv) return(1); + if (rv) return (1); } else if (y != YPERR_KEY) { /* * If we get an error other than 'no * such key in map' then something is * wrong and we should stop the search. */ - return(-1); + return (-1); } } } @@ -386,14 +389,14 @@ innetgr(const char *group, const char *h if (_use_only_yp && (host == NULL) != (user == NULL)) { int ret; if(yp_get_default_domain(&_netgr_yp_domain)) - return(0); + return (0); ret = _revnetgr_lookup(_netgr_yp_domain, host?"netgroup.byhost":"netgroup.byuser", host?host:user, dom, group); if (ret == 1) - return(1); + return (1); else if (ret == 0 && dom != NULL) - return(0); + return (0); } setnetgrent(group); From owner-svn-src-head@FreeBSD.ORG Mon May 21 21:10:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0FF11065675; Mon, 21 May 2012 21:10:10 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC5B78FC1F; Mon, 21 May 2012 21:10:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LLA1mk072798; Mon, 21 May 2012 21:10:01 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LLA1nR072795; Mon, 21 May 2012 21:10:01 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201205212110.q4LLA1nR072795@svn.freebsd.org> From: Guy Helmer Date: Mon, 21 May 2012 21:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235740 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 21:10:11 -0000 Author: ghelmer Date: Mon May 21 21:10:00 2012 New Revision: 235740 URL: http://svn.freebsd.org/changeset/base/235740 Log: Add checks for memory allocation failures in appropriate places, and avoid creating bad entries in the grp list as a result of memory allocation failures while building new entries. PR: bin/83340 Reviewed by: delphij (prior version of patch) Modified: head/lib/libc/gen/getnetgrent.c Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Mon May 21 21:04:29 2012 (r235739) +++ head/lib/libc/gen/getnetgrent.c Mon May 21 21:10:00 2012 (r235740) @@ -203,9 +203,7 @@ setnetgrent(const char *group) if (parse_netgrp(group)) endnetgrent(); else { - grouphead.grname = (char *) - malloc(strlen(group) + 1); - strcpy(grouphead.grname, group); + grouphead.grname = strdup(group); } if (netf) fclose(netf); @@ -457,9 +455,9 @@ parse_netgrp(const char *group) while (pos != NULL && *pos != '\0') { if (*pos == '(') { grp = (struct netgrp *)malloc(sizeof (struct netgrp)); + if (grp == NULL) + return (1); bzero((char *)grp, sizeof (struct netgrp)); - grp->ng_next = grouphead.gr; - grouphead.gr = grp; pos++; gpos = strsep(&pos, ")"); #ifdef DEBUG @@ -480,6 +478,13 @@ parse_netgrp(const char *group) if (len > 0) { grp->ng_str[strpos] = (char *) malloc(len + 1); + if (grp->ng_str[strpos] == NULL) { + int freepos; + for (freepos = 0; freepos < strpos; freepos++) + free(grp->ng_str[freepos]); + free(grp); + return (1); + } bcopy(spos, grp->ng_str[strpos], len + 1); } @@ -493,6 +498,8 @@ parse_netgrp(const char *group) grp->ng_str[strpos] = NULL; } } + grp->ng_next = grouphead.gr; + grouphead.gr = grp; #ifdef DEBUG /* * Note: on other platforms, malformed netgroup @@ -529,7 +536,7 @@ parse_netgrp(const char *group) static struct linelist * read_for_group(const char *group) { - char *pos, *spos, *linep, *olinep; + char *pos, *spos, *linep; int len, olen; int cont; struct linelist *lp; @@ -537,6 +544,7 @@ read_for_group(const char *group) #ifdef YP char *result; int resultlen; + linep = NULL; while (_netgr_yp_enabled || fgets(line, LINSIZ, netf) != NULL) { if (_netgr_yp_enabled) { @@ -557,6 +565,7 @@ read_for_group(const char *group) free(result); } #else + linep = NULL; while (fgets(line, LINSIZ, netf) != NULL) { #endif pos = (char *)&line; @@ -579,8 +588,14 @@ read_for_group(const char *group) pos++; if (*pos != '\n' && *pos != '\0') { lp = (struct linelist *)malloc(sizeof (*lp)); + if (lp == NULL) + return (NULL); lp->l_parsed = 0; lp->l_groupname = (char *)malloc(len + 1); + if (lp->l_groupname == NULL) { + free(lp); + return (NULL); + } bcopy(spos, lp->l_groupname, len); *(lp->l_groupname + len) = '\0'; len = strlen(pos); @@ -598,15 +613,15 @@ read_for_group(const char *group) } else cont = 0; if (len > 0) { - linep = (char *)malloc(olen + len + 1); - if (olen > 0) { - bcopy(olinep, linep, olen); - free(olinep); + linep = (char *)reallocf(linep, olen + len + 1); + if (linep == NULL) { + free(lp->l_groupname); + free(lp); + return (NULL); } bcopy(pos, linep + olen, len); olen += len; *(linep + olen) = '\0'; - olinep = linep; } if (cont) { if (fgets(line, LINSIZ, netf)) { @@ -637,5 +652,5 @@ read_for_group(const char *group) */ rewind(netf); #endif - return ((struct linelist *)0); + return (NULL); } From owner-svn-src-head@FreeBSD.ORG Mon May 21 22:13:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16672106564A; Mon, 21 May 2012 22:13:49 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA90B8FC14; Mon, 21 May 2012 22:13:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LMDmlB075746; Mon, 21 May 2012 22:13:48 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMDmnG075742; Mon, 21 May 2012 22:13:48 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201205212213.q4LMDmnG075742@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 21 May 2012 22:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235744 - in head: share/man/man9 sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:13:49 -0000 Author: melifaro Date: Mon May 21 22:13:48 2012 New Revision: 235744 URL: http://svn.freebsd.org/changeset/base/235744 Log: Fix panic on attaching to non-existent interface (introduced by r233937, pointed by hrs@) Fix panic on tcpdump being attached to interface being removed (introduced by r233937, pointed by hrs@ and adrian@) Protect most of bpf_setf() by BPF global lock Add several forgotten assertions (thanks to adrian@) Document current locking model inside bpf.c Document EVENTHANDLER(9) usage inside BPF. Approved by: kib(mentor) Tested by: gnn MFC in: 4 weeks Modified: head/share/man/man9/EVENTHANDLER.9 head/share/man/man9/bpf.9 head/sys/net/bpf.c Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Mon May 21 21:29:59 2012 (r235743) +++ head/share/man/man9/EVENTHANDLER.9 Mon May 21 22:13:48 2012 (r235744) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd January 7, 2005 +.Dd May 11, 2012 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -197,6 +197,8 @@ Callbacks invoked when an interface is c Callbacks invoked when a new network interface appears. .It Vt ifnet_departure_event Callbacks invoked when a network interface is taken down. +.It Vt bpf_track +Callbacks invoked when a BPF listener attaches to/detaches from network interface. .It Vt power_profile_change Callbacks invoked when the power profile of the system changes. .It Vt process_exec Modified: head/share/man/man9/bpf.9 ============================================================================== --- head/share/man/man9/bpf.9 Mon May 21 21:29:59 2012 (r235743) +++ head/share/man/man9/bpf.9 Mon May 21 22:13:48 2012 (r235744) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2006 +.Dd May 11, 2012 .Dt BPF 9 .Os .\" @@ -246,9 +246,31 @@ The function returns 0 when the program is not a valid filter program. .\" +.Sh EVENT HANDLERS +.Nm +invokes +.Fa bpf_track +.Xr EVENTHANDLER 9 +event each time listener attaches to or detaches from an interface. +Pointer to +.Pq Vt "struct ifnet *" +is passed as the first argument, interface +.Fa dlt +follows. Last argument indicates listener is attached (1) or +detached (0). +Note that handler is invoked with +.Nm +global lock held, which implies restriction on sleeping and calling +.Nm +subsystem inside +.Xr EVENTHANDLER 9 +dispatcher. +Note that handler is not called for write-only listeners. +.\" .Sh SEE ALSO .Xr tcpdump 1 , -.Xr bpf 4 +.Xr bpf 4 , +.Xr EVENTHANDLER 9 .\" .Sh HISTORY The Enet packet filter was created in 1980 by Mike Accetta and Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon May 21 21:29:59 2012 (r235743) +++ head/sys/net/bpf.c Mon May 21 22:13:48 2012 (r235744) @@ -147,6 +147,7 @@ static int bpf_bpfd_cnt; static void bpf_attachd(struct bpf_d *, struct bpf_if *); static void bpf_detachd(struct bpf_d *); +static void bpf_detachd_locked(struct bpf_d *); static void bpf_freed(struct bpf_d *); static int bpf_movein(struct uio *, int, struct ifnet *, struct mbuf **, struct sockaddr *, int *, struct bpf_insn *); @@ -207,6 +208,35 @@ static struct filterops bpfread_filtops }; /* + * LOCKING MODEL USED BY BPF: + * Locks: + * 1) global lock (BPF_LOCK). Mutex, used to protect interface addition/removal, + * some global counters and every bpf_if reference. + * 2) Interface lock. Rwlock, used to protect list of BPF descriptors and their filters. + * 3) Descriptor lock. Rwlock, used to protect BPF buffers and various structure fields + * used by bpf_mtap code. + * + * Lock order: + * + * Global lock, interface lock, descriptor lock + * + * We have to acquire interface lock before descriptor main lock due to BPF_MTAP[2] + * working model. In many places (like bpf_detachd) we start with BPF descriptor + * (and we need to at least rlock it to get reliable interface pointer). This + * gives us potential LOR. As a result, we use global lock to protect from bpf_if + * change in every such place. + * + * Changing d->bd_bif is protected by 1) global lock, 2) interface lock and + * 3) descriptor main wlock. + * Reading bd_bif can be protected by any of these locks, typically global lock. + * + * Changing read/write BPF filter is protected by the same three locks, + * the same applies for reading. + * + * Sleeping in global lock is not allowed due to bpfdetach() using it. + */ + +/* * Wrapper functions for various buffering methods. If the set of buffer * modes expands, we will probably want to introduce a switch data structure * similar to protosw, et. @@ -577,6 +607,18 @@ bad: static void bpf_attachd(struct bpf_d *d, struct bpf_if *bp) { + int op_w; + + BPF_LOCK_ASSERT(); + + /* + * Save sysctl value to protect from sysctl change + * between reads + */ + op_w = V_bpf_optimize_writers; + + if (d->bd_bif != NULL) + bpf_detachd_locked(d); /* * Point d at bp, and add d to the interface's list. * Since there are many applicaiotns using BPF for @@ -584,11 +626,13 @@ bpf_attachd(struct bpf_d *d, struct bpf_ * we can delay adding d to the list of active listeners until * some filter is configured. */ - d->bd_bif = bp; BPFIF_WLOCK(bp); + BPFD_WLOCK(d); - if (V_bpf_optimize_writers != 0) { + d->bd_bif = bp; + + if (op_w != 0) { /* Add to writers-only list */ LIST_INSERT_HEAD(&bp->bif_wlist, d, bd_next); /* @@ -600,16 +644,15 @@ bpf_attachd(struct bpf_d *d, struct bpf_ } else LIST_INSERT_HEAD(&bp->bif_dlist, d, bd_next); + BPFD_WUNLOCK(d); BPFIF_WUNLOCK(bp); - BPF_LOCK(); bpf_bpfd_cnt++; - BPF_UNLOCK(); CTR3(KTR_NET, "%s: bpf_attach called by pid %d, adding to %s list", __func__, d->bd_pid, d->bd_writer ? "writer" : "active"); - if (V_bpf_optimize_writers == 0) + if (op_w == 0) EVENTHANDLER_INVOKE(bpf_track, bp->bif_ifp, bp->bif_dlt, 1); } @@ -622,8 +665,21 @@ bpf_upgraded(struct bpf_d *d) { struct bpf_if *bp; + BPF_LOCK_ASSERT(); + bp = d->bd_bif; + /* + * Filter can be set several times without specifying interface. + * Mark d as reader and exit. + */ + if (bp == NULL) { + BPFD_WLOCK(d); + d->bd_writer = 0; + BPFD_WUNLOCK(d); + return; + } + BPFIF_WLOCK(bp); BPFD_WLOCK(d); @@ -647,6 +703,14 @@ bpf_upgraded(struct bpf_d *d) static void bpf_detachd(struct bpf_d *d) { + BPF_LOCK(); + bpf_detachd_locked(d); + BPF_UNLOCK(); +} + +static void +bpf_detachd_locked(struct bpf_d *d) +{ int error; struct bpf_if *bp; struct ifnet *ifp; @@ -655,7 +719,10 @@ bpf_detachd(struct bpf_d *d) BPF_LOCK_ASSERT(); - bp = d->bd_bif; + /* Check if descriptor is attached */ + if ((bp = d->bd_bif) == NULL) + return; + BPFIF_WLOCK(bp); BPFD_WLOCK(d); @@ -672,7 +739,6 @@ bpf_detachd(struct bpf_d *d) BPFD_WUNLOCK(d); BPFIF_WUNLOCK(bp); - /* We're already protected by global lock. */ bpf_bpfd_cnt--; /* Call event handler iff d is attached */ @@ -716,10 +782,7 @@ bpf_dtor(void *data) d->bd_state = BPF_IDLE; BPFD_WUNLOCK(d); funsetown(&d->bd_sigio); - BPF_LOCK(); - if (d->bd_bif) - bpf_detachd(d); - BPF_UNLOCK(); + bpf_detachd(d); #ifdef MAC mac_bpfdesc_destroy(d); #endif /* MAC */ @@ -959,6 +1022,7 @@ bpfwrite(struct cdev *dev, struct uio *u BPF_PID_REFRESH_CUR(d); d->bd_wcount++; + /* XXX: locking required */ if (d->bd_bif == NULL) { d->bd_wdcount++; return (ENXIO); @@ -979,6 +1043,7 @@ bpfwrite(struct cdev *dev, struct uio *u bzero(&dst, sizeof(dst)); m = NULL; hlen = 0; + /* XXX: bpf_movein() can sleep */ error = bpf_movein(uio, (int)d->bd_bif->bif_dlt, ifp, &m, &dst, &hlen, d->bd_wfilter); if (error) { @@ -1298,10 +1363,12 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Set data link type. */ case BIOCSDLT: + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else error = bpf_setdlt(d, *(u_int *)addr); + BPF_UNLOCK(); break; /* @@ -1323,7 +1390,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Set interface. */ case BIOCSETIF: + BPF_LOCK(); error = bpf_setif(d, (struct ifreq *)addr); + BPF_UNLOCK(); break; /* @@ -1609,6 +1678,23 @@ bpf_setf(struct bpf_d *d, struct bpf_pro cmd = BIOCSETWF; } #endif + /* + * Check new filter validness before acquiring any locks. + * Allocate memory for new filter, if needed. + */ + flen = fp->bf_len; + if ((flen > bpf_maxinsns) || ((fp->bf_insns == NULL) && (flen != 0))) + return (EINVAL); + + need_upgrade = 0; + size = flen * sizeof(*fp->bf_insns); + if (size > 0) + fcode = (struct bpf_insn *)malloc(size, M_BPF, M_WAITOK); + else + fcode = NULL; /* Make compiler happy */ + + BPF_LOCK(); + if (cmd == BIOCSETWF) { old = d->bd_wfilter; wfilter = 1; @@ -1623,13 +1709,12 @@ bpf_setf(struct bpf_d *d, struct bpf_pro #endif } if (fp->bf_insns == NULL) { - if (fp->bf_len != 0) - return (EINVAL); /* - * Protect filter change by interface lock, too. - * The same lock order is used by bpf_detachd(). + * Protect filter removal by interface lock. + * Additionally, we are protected by global lock here. */ - BPFIF_WLOCK(d->bd_bif); + if (d->bd_bif != NULL) + BPFIF_WLOCK(d->bd_bif); BPFD_WLOCK(d); if (wfilter) d->bd_wfilter = NULL; @@ -1642,29 +1727,26 @@ bpf_setf(struct bpf_d *d, struct bpf_pro reset_d(d); } BPFD_WUNLOCK(d); - BPFIF_WUNLOCK(d->bd_bif); + if (d->bd_bif != NULL) + BPFIF_WUNLOCK(d->bd_bif); if (old != NULL) free((caddr_t)old, M_BPF); #ifdef BPF_JITTER if (ofunc != NULL) bpf_destroy_jit_filter(ofunc); #endif + BPF_UNLOCK(); return (0); } - flen = fp->bf_len; - if (flen > bpf_maxinsns) - return (EINVAL); - need_upgrade = 0; - size = flen * sizeof(*fp->bf_insns); - fcode = (struct bpf_insn *)malloc(size, M_BPF, M_WAITOK); if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) == 0 && bpf_validate(fcode, (int)flen)) { /* - * Protect filter change by interface lock, too - * The same lock order is used by bpf_detachd(). + * Protect filter change by interface lock + * Additionally, we are protected by global lock here. */ - BPFIF_WLOCK(d->bd_bif); + if (d->bd_bif != NULL) + BPFIF_WLOCK(d->bd_bif); BPFD_WLOCK(d); if (wfilter) d->bd_wfilter = fcode; @@ -1687,7 +1769,8 @@ bpf_setf(struct bpf_d *d, struct bpf_pro __func__, d->bd_pid, d->bd_writer, need_upgrade); } BPFD_WUNLOCK(d); - BPFIF_WUNLOCK(d->bd_bif); + if (d->bd_bif != NULL) + BPFIF_WUNLOCK(d->bd_bif); if (old != NULL) free((caddr_t)old, M_BPF); #ifdef BPF_JITTER @@ -1699,9 +1782,11 @@ bpf_setf(struct bpf_d *d, struct bpf_pro if (need_upgrade != 0) bpf_upgraded(d); + BPF_UNLOCK(); return (0); } free((caddr_t)fcode, M_BPF); + BPF_UNLOCK(); return (EINVAL); } @@ -1716,6 +1801,8 @@ bpf_setif(struct bpf_d *d, struct ifreq struct bpf_if *bp; struct ifnet *theywant; + BPF_LOCK_ASSERT(); + theywant = ifunit(ifr->ifr_name); if (theywant == NULL || theywant->if_bpf == NULL) return (ENXIO); @@ -1746,15 +1833,8 @@ bpf_setif(struct bpf_d *d, struct ifreq default: panic("bpf_setif: bufmode %d", d->bd_bufmode); } - if (bp != d->bd_bif) { - if (d->bd_bif) - /* - * Detach if attached to something else. - */ - bpf_detachd(d); - + if (bp != d->bd_bif) bpf_attachd(d, bp); - } BPFD_WLOCK(d); reset_d(d); BPFD_WUNLOCK(d); @@ -2361,10 +2441,9 @@ bpfattach2(struct ifnet *ifp, u_int dlt, } /* - * Detach bpf from an interface. This involves detaching each descriptor - * associated with the interface, and leaving bd_bif NULL. Notify each - * descriptor as it's detached so that any sleepers wake up and get - * ENXIO. + * Detach bpf from an interface. This involves detaching each descriptor + * associated with the interface. Notify each descriptor as it's detached + * so that any sleepers wake up and get ENXIO. */ void bpfdetach(struct ifnet *ifp) @@ -2398,6 +2477,13 @@ bpfdetach(struct ifnet *ifp) bpf_wakeup(d); BPFD_WUNLOCK(d); } + /* Free writer-only descriptors */ + while ((d = LIST_FIRST(&bp->bif_wlist)) != NULL) { + bpf_detachd(d); + BPFD_WLOCK(d); + bpf_wakeup(d); + BPFD_WUNLOCK(d); + } rw_destroy(&bp->bif_lock); free(bp, M_BPF); } @@ -2451,18 +2537,19 @@ bpf_setdlt(struct bpf_d *d, u_int dlt) struct ifnet *ifp; struct bpf_if *bp; + BPF_LOCK_ASSERT(); + if (d->bd_bif->bif_dlt == dlt) return (0); ifp = d->bd_bif->bif_ifp; - BPF_LOCK(); + LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (bp->bif_ifp == ifp && bp->bif_dlt == dlt) break; } - BPF_UNLOCK(); + if (bp != NULL) { opromisc = d->bd_promisc; - bpf_detachd(d); bpf_attachd(d, bp); BPFD_WLOCK(d); reset_d(d); @@ -2522,6 +2609,9 @@ bpf_zero_counters(void) BPF_UNLOCK(); } +/* + * Fill filter statistics + */ static void bpfstats_fill_xbpf(struct xbpf_d *d, struct bpf_d *bd) { @@ -2529,6 +2619,7 @@ bpfstats_fill_xbpf(struct xbpf_d *d, str bzero(d, sizeof(*d)); BPFD_LOCK_ASSERT(bd); d->bd_structsize = sizeof(*d); + /* XXX: reading should be protected by global lock */ d->bd_immediate = bd->bd_immediate; d->bd_promisc = bd->bd_promisc; d->bd_hdrcmplt = bd->bd_hdrcmplt; @@ -2553,6 +2644,9 @@ bpfstats_fill_xbpf(struct xbpf_d *d, str d->bd_bufmode = bd->bd_bufmode; } +/* + * Handle `netstat -B' stats request + */ static int bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) { From owner-svn-src-head@FreeBSD.ORG Mon May 21 22:17:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB41C106564A; Mon, 21 May 2012 22:17:30 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69EB38FC08; Mon, 21 May 2012 22:17:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LMHTPo075934; Mon, 21 May 2012 22:17:29 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMHTFm075927; Mon, 21 May 2012 22:17:29 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201205212217.q4LMHTFm075927@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 21 May 2012 22:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235745 - in head/sys: kern net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:17:30 -0000 Author: melifaro Date: Mon May 21 22:17:29 2012 New Revision: 235745 URL: http://svn.freebsd.org/changeset/base/235745 Log: Fix old panic when BPF consumer attaches to destroying interface. 'flags' field is added to the end of bpf_if structure. Currently the only flag is BPFIF_FLAG_DYING which is set on bpf detach and checked by bpf_attachd() Problem can be easily triggered on SMP stable/[89] by the following command (sort of): 'while true; do ifconfig vlan222 create vlan 222 vlandev em0 up ; tcpdump -pi vlan222 & ; ifconfig vlan222 destroy ; done' Fix possible use-after-free when BPF detaches itself from interface, freeing bpf_bif memory, while interface is still UP and there can be routes via this interface. Freeing is now delayed till ifnet_departure_event is received via eventhandler(9) api. Convert bpfd rwlock back to mutex due lack of performance gain (currently checking if packet matches filter is done without holding bpfd lock and we have to acquire write lock if packet matches) Approved by: kib(mentor) MFC in: 4 weeks Modified: head/sys/kern/subr_witness.c head/sys/net/bpf.c head/sys/net/bpf.h head/sys/net/bpf_buffer.c head/sys/net/bpf_zerocopy.c head/sys/net/bpfdesc.h Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Mon May 21 22:13:48 2012 (r235744) +++ head/sys/kern/subr_witness.c Mon May 21 22:17:29 2012 (r235745) @@ -564,7 +564,7 @@ static struct witness_order_list_entry o */ { "bpf global lock", &lock_class_mtx_sleep }, { "bpf interface lock", &lock_class_rw }, - { "bpf cdev lock", &lock_class_rw }, + { "bpf cdev lock", &lock_class_mtx_sleep }, { NULL, NULL }, /* * NFS server Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon May 21 22:13:48 2012 (r235744) +++ head/sys/net/bpf.c Mon May 21 22:17:29 2012 (r235745) @@ -207,13 +207,15 @@ static struct filterops bpfread_filtops .f_event = filt_bpfread, }; +eventhandler_tag bpf_ifdetach_cookie = NULL; + /* * LOCKING MODEL USED BY BPF: * Locks: * 1) global lock (BPF_LOCK). Mutex, used to protect interface addition/removal, * some global counters and every bpf_if reference. * 2) Interface lock. Rwlock, used to protect list of BPF descriptors and their filters. - * 3) Descriptor lock. Rwlock, used to protect BPF buffers and various structure fields + * 3) Descriptor lock. Mutex, used to protect BPF buffers and various structure fields * used by bpf_mtap code. * * Lock order: @@ -246,7 +248,7 @@ bpf_append_bytes(struct bpf_d *d, caddr_ u_int len) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); switch (d->bd_bufmode) { case BPF_BUFMODE_BUFFER: @@ -266,7 +268,7 @@ bpf_append_mbuf(struct bpf_d *d, caddr_t u_int len) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); switch (d->bd_bufmode) { case BPF_BUFMODE_BUFFER: @@ -288,7 +290,7 @@ static void bpf_buf_reclaimed(struct bpf_d *d) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); switch (d->bd_bufmode) { case BPF_BUFMODE_BUFFER: @@ -347,7 +349,7 @@ static void bpf_buffull(struct bpf_d *d) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); switch (d->bd_bufmode) { case BPF_BUFMODE_ZBUF: @@ -363,7 +365,7 @@ void bpf_bufheld(struct bpf_d *d) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); switch (d->bd_bufmode) { case BPF_BUFMODE_ZBUF: @@ -628,7 +630,7 @@ bpf_attachd(struct bpf_d *d, struct bpf_ */ BPFIF_WLOCK(bp); - BPFD_WLOCK(d); + BPFD_LOCK(d); d->bd_bif = bp; @@ -644,7 +646,7 @@ bpf_attachd(struct bpf_d *d, struct bpf_ } else LIST_INSERT_HEAD(&bp->bif_dlist, d, bd_next); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); BPFIF_WUNLOCK(bp); bpf_bpfd_cnt++; @@ -674,14 +676,14 @@ bpf_upgraded(struct bpf_d *d) * Mark d as reader and exit. */ if (bp == NULL) { - BPFD_WLOCK(d); + BPFD_LOCK(d); d->bd_writer = 0; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return; } BPFIF_WLOCK(bp); - BPFD_WLOCK(d); + BPFD_LOCK(d); /* Remove from writers-only list */ LIST_REMOVE(d, bd_next); @@ -689,7 +691,7 @@ bpf_upgraded(struct bpf_d *d) /* Mark d as reader */ d->bd_writer = 0; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); BPFIF_WUNLOCK(bp); CTR2(KTR_NET, "%s: upgrade required by pid %d", __func__, d->bd_pid); @@ -724,7 +726,7 @@ bpf_detachd_locked(struct bpf_d *d) return; BPFIF_WLOCK(bp); - BPFD_WLOCK(d); + BPFD_LOCK(d); /* Save bd_writer value */ error = d->bd_writer; @@ -736,7 +738,7 @@ bpf_detachd_locked(struct bpf_d *d) ifp = bp->bif_ifp; d->bd_bif = NULL; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); BPFIF_WUNLOCK(bp); bpf_bpfd_cnt--; @@ -776,11 +778,11 @@ bpf_dtor(void *data) { struct bpf_d *d = data; - BPFD_WLOCK(d); + BPFD_LOCK(d); if (d->bd_state == BPF_WAITING) callout_stop(&d->bd_callout); d->bd_state = BPF_IDLE; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); funsetown(&d->bd_sigio); bpf_detachd(d); #ifdef MAC @@ -825,9 +827,9 @@ bpfopen(struct cdev *dev, int flags, int mac_bpfdesc_init(d); mac_bpfdesc_create(td->td_ucred, d); #endif - rw_init(&d->bd_lock, "bpf cdev lock"); - callout_init_rw(&d->bd_callout, &d->bd_lock, 0); - knlist_init_rw_reader(&d->bd_sel.si_note, &d->bd_lock); + mtx_init(&d->bd_lock, devtoname(dev), "bpf cdev lock", MTX_DEF); + callout_init_mtx(&d->bd_callout, &d->bd_lock, 0); + knlist_init_mtx(&d->bd_sel.si_note, &d->bd_lock); return (0); } @@ -856,10 +858,10 @@ bpfread(struct cdev *dev, struct uio *ui non_block = ((ioflag & O_NONBLOCK) != 0); - BPFD_WLOCK(d); + BPFD_LOCK(d); BPF_PID_REFRESH_CUR(d); if (d->bd_bufmode != BPF_BUFMODE_BUFFER) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (EOPNOTSUPP); } if (d->bd_state == BPF_WAITING) @@ -895,18 +897,18 @@ bpfread(struct cdev *dev, struct uio *ui * it before using it again. */ if (d->bd_bif == NULL) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (ENXIO); } if (non_block) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (EWOULDBLOCK); } - error = rw_sleep(d, &d->bd_lock, PRINET|PCATCH, + error = msleep(d, &d->bd_lock, PRINET|PCATCH, "bpf", d->bd_rtout); if (error == EINTR || error == ERESTART) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (error); } if (error == EWOULDBLOCK) { @@ -924,7 +926,7 @@ bpfread(struct cdev *dev, struct uio *ui break; if (d->bd_slen == 0) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (0); } ROTATE_BUFFERS(d); @@ -934,7 +936,7 @@ bpfread(struct cdev *dev, struct uio *ui /* * At this point, we know we have something in the hold slot. */ - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); /* * Move data from hold buffer into user space. @@ -947,12 +949,12 @@ bpfread(struct cdev *dev, struct uio *ui */ error = bpf_uiomove(d, d->bd_hbuf, d->bd_hlen, uio); - BPFD_WLOCK(d); + BPFD_LOCK(d); d->bd_fbuf = d->bd_hbuf; d->bd_hbuf = NULL; d->bd_hlen = 0; bpf_buf_reclaimed(d); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (error); } @@ -964,7 +966,7 @@ static __inline void bpf_wakeup(struct bpf_d *d) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); if (d->bd_state == BPF_WAITING) { callout_stop(&d->bd_callout); d->bd_state = BPF_IDLE; @@ -982,7 +984,7 @@ bpf_timed_out(void *arg) { struct bpf_d *d = (struct bpf_d *)arg; - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); if (callout_pending(&d->bd_callout) || !callout_active(&d->bd_callout)) return; @@ -997,7 +999,7 @@ static int bpf_ready(struct bpf_d *d) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); if (!bpf_canfreebuf(d) && d->bd_hlen != 0) return (1); @@ -1070,11 +1072,11 @@ bpfwrite(struct cdev *dev, struct uio *u CURVNET_SET(ifp->if_vnet); #ifdef MAC - BPFD_WLOCK(d); + BPFD_LOCK(d); mac_bpfdesc_create_mbuf(d, m); if (mc != NULL) mac_bpfdesc_create_mbuf(d, mc); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); #endif error = (*ifp->if_output)(ifp, m, &dst, NULL); @@ -1103,7 +1105,7 @@ static void reset_d(struct bpf_d *d) { - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); if ((d->bd_hbuf != NULL) && (d->bd_bufmode != BPF_BUFMODE_ZBUF || bpf_canfreebuf(d))) { @@ -1170,12 +1172,12 @@ bpfioctl(struct cdev *dev, u_long cmd, c /* * Refresh PID associated with this descriptor. */ - BPFD_WLOCK(d); + BPFD_LOCK(d); BPF_PID_REFRESH(d, td); if (d->bd_state == BPF_WAITING) callout_stop(&d->bd_callout); d->bd_state = BPF_IDLE; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); if (d->bd_locked == 1) { switch (cmd) { @@ -1241,11 +1243,11 @@ bpfioctl(struct cdev *dev, u_long cmd, c { int n; - BPFD_WLOCK(d); + BPFD_LOCK(d); n = d->bd_slen; if (d->bd_hbuf) n += d->bd_hlen; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); *(int *)addr = n; break; @@ -1296,9 +1298,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Flush read packet buffer. */ case BIOCFLUSH: - BPFD_WLOCK(d); + BPFD_LOCK(d); reset_d(d); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); break; /* @@ -1625,15 +1627,15 @@ bpfioctl(struct cdev *dev, u_long cmd, c return (EINVAL); } - BPFD_WLOCK(d); + BPFD_LOCK(d); if (d->bd_sbuf != NULL || d->bd_hbuf != NULL || d->bd_fbuf != NULL || d->bd_bif != NULL) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); CURVNET_RESTORE(); return (EBUSY); } d->bd_bufmode = *(u_int *)addr; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); break; case BIOCGETZMAX: @@ -1715,7 +1717,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro */ if (d->bd_bif != NULL) BPFIF_WLOCK(d->bd_bif); - BPFD_WLOCK(d); + BPFD_LOCK(d); if (wfilter) d->bd_wfilter = NULL; else { @@ -1726,7 +1728,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro if (cmd == BIOCSETF) reset_d(d); } - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); if (d->bd_bif != NULL) BPFIF_WUNLOCK(d->bd_bif); if (old != NULL) @@ -1747,7 +1749,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro */ if (d->bd_bif != NULL) BPFIF_WLOCK(d->bd_bif); - BPFD_WLOCK(d); + BPFD_LOCK(d); if (wfilter) d->bd_wfilter = fcode; else { @@ -1768,7 +1770,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro "bd_writer counter %d, need_upgrade %d", __func__, d->bd_pid, d->bd_writer, need_upgrade); } - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); if (d->bd_bif != NULL) BPFIF_WUNLOCK(d->bd_bif); if (old != NULL) @@ -1809,14 +1811,19 @@ bpf_setif(struct bpf_d *d, struct ifreq bp = theywant->if_bpf; + /* Check if interface is not being detached from BPF */ + BPFIF_RLOCK(bp); + if (bp->flags & BPFIF_FLAG_DYING) { + BPFIF_RUNLOCK(bp); + return (ENXIO); + } + BPFIF_RUNLOCK(bp); + /* * Behavior here depends on the buffering model. If we're using * kernel memory buffers, then we can allocate them here. If we're * using zero-copy, then the user process must have registered * buffers by the time we get here. If not, return an error. - * - * XXXRW: There are locking issues here with multi-threaded use: what - * if two threads try to set the interface at once? */ switch (d->bd_bufmode) { case BPF_BUFMODE_BUFFER: @@ -1835,9 +1842,9 @@ bpf_setif(struct bpf_d *d, struct ifreq } if (bp != d->bd_bif) bpf_attachd(d, bp); - BPFD_WLOCK(d); + BPFD_LOCK(d); reset_d(d); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (0); } @@ -1861,7 +1868,7 @@ bpfpoll(struct cdev *dev, int events, st * Refresh PID associated with this descriptor. */ revents = events & (POLLOUT | POLLWRNORM); - BPFD_WLOCK(d); + BPFD_LOCK(d); BPF_PID_REFRESH(d, td); if (events & (POLLIN | POLLRDNORM)) { if (bpf_ready(d)) @@ -1876,7 +1883,7 @@ bpfpoll(struct cdev *dev, int events, st } } } - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (revents); } @@ -1896,12 +1903,12 @@ bpfkqfilter(struct cdev *dev, struct kno /* * Refresh PID associated with this descriptor. */ - BPFD_WLOCK(d); + BPFD_LOCK(d); BPF_PID_REFRESH_CUR(d); kn->kn_fop = &bpfread_filtops; kn->kn_hook = d; knlist_add(&d->bd_sel.si_note, kn, 1); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (0); } @@ -1920,7 +1927,7 @@ filt_bpfread(struct knote *kn, long hint struct bpf_d *d = (struct bpf_d *)kn->kn_hook; int ready; - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); ready = bpf_ready(d); if (ready) { kn->kn_data = d->bd_slen; @@ -2026,7 +2033,7 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, /* * Filter matches. Let's to acquire write lock. */ - BPFD_WLOCK(d); + BPFD_LOCK(d); d->bd_fcount++; if (gottime < bpf_ts_quality(d->bd_tstamp)) @@ -2036,7 +2043,7 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, #endif catchpacket(d, pkt, pktlen, slen, bpf_append_bytes, &bt); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); } } BPFIF_RUNLOCK(bp); @@ -2085,7 +2092,7 @@ bpf_mtap(struct bpf_if *bp, struct mbuf #endif slen = bpf_filter(d->bd_rfilter, (u_char *)m, pktlen, 0); if (slen != 0) { - BPFD_WLOCK(d); + BPFD_LOCK(d); d->bd_fcount++; if (gottime < bpf_ts_quality(d->bd_tstamp)) @@ -2095,7 +2102,7 @@ bpf_mtap(struct bpf_if *bp, struct mbuf #endif catchpacket(d, (u_char *)m, pktlen, slen, bpf_append_mbuf, &bt); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); } } BPFIF_RUNLOCK(bp); @@ -2141,7 +2148,7 @@ bpf_mtap2(struct bpf_if *bp, void *data, ++d->bd_rcount; slen = bpf_filter(d->bd_rfilter, (u_char *)&mb, pktlen, 0); if (slen != 0) { - BPFD_WLOCK(d); + BPFD_LOCK(d); d->bd_fcount++; if (gottime < bpf_ts_quality(d->bd_tstamp)) @@ -2151,7 +2158,7 @@ bpf_mtap2(struct bpf_if *bp, void *data, #endif catchpacket(d, (u_char *)&mb, pktlen, slen, bpf_append_mbuf, &bt); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); } } BPFIF_RUNLOCK(bp); @@ -2246,7 +2253,7 @@ catchpacket(struct bpf_d *d, u_char *pkt int do_timestamp; int tstype; - BPFD_WLOCK_ASSERT(d); + BPFD_LOCK_ASSERT(d); /* * Detect whether user space has released a buffer back to us, and if @@ -2393,7 +2400,7 @@ bpf_freed(struct bpf_d *d) } if (d->bd_wfilter != NULL) free((caddr_t)d->bd_wfilter, M_BPF); - rw_destroy(&d->bd_lock); + mtx_destroy(&d->bd_lock); } /* @@ -2456,38 +2463,45 @@ bpfdetach(struct ifnet *ifp) ndetached = 0; #endif + BPF_LOCK(); /* Find all bpf_if struct's which reference ifp and detach them. */ do { - BPF_LOCK(); LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (ifp == bp->bif_ifp) break; } if (bp != NULL) LIST_REMOVE(bp, bif_next); - BPF_UNLOCK(); if (bp != NULL) { #ifdef INVARIANTS ndetached++; #endif while ((d = LIST_FIRST(&bp->bif_dlist)) != NULL) { - bpf_detachd(d); - BPFD_WLOCK(d); + bpf_detachd_locked(d); + BPFD_LOCK(d); bpf_wakeup(d); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); } /* Free writer-only descriptors */ while ((d = LIST_FIRST(&bp->bif_wlist)) != NULL) { - bpf_detachd(d); - BPFD_WLOCK(d); + bpf_detachd_locked(d); + BPFD_LOCK(d); bpf_wakeup(d); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); } - rw_destroy(&bp->bif_lock); - free(bp, M_BPF); + + /* + * Delay freing bp till interface is detached + * and all routes through this interface are removed. + * Mark bp as detached to restrict new consumers. + */ + BPFIF_WLOCK(bp); + bp->flags |= BPFIF_FLAG_DYING; + BPFIF_WUNLOCK(bp); } } while (bp != NULL); + BPF_UNLOCK(); #ifdef INVARIANTS if (ndetached == 0) @@ -2496,6 +2510,25 @@ bpfdetach(struct ifnet *ifp) } /* + * Interface departure handler + */ +static void +bpf_ifdetach(void *arg __unused, struct ifnet *ifp) +{ + struct bpf_if *bp; + + if ((bp = ifp->if_bpf) == NULL) + return; + + CTR3(KTR_NET, "%s: freing BPF instance %p for interface %p", + __func__, bp, ifp); + + ifp->if_bpf = NULL; + rw_destroy(&bp->bif_lock); + free(bp, M_BPF); +} + +/* * Get a list of available data link type of the interface. */ static int @@ -2551,9 +2584,9 @@ bpf_setdlt(struct bpf_d *d, u_int dlt) if (bp != NULL) { opromisc = d->bd_promisc; bpf_attachd(d, bp); - BPFD_WLOCK(d); + BPFD_LOCK(d); reset_d(d); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); if (opromisc) { error = ifpromisc(bp->bif_ifp, 1); if (error) @@ -2578,6 +2611,11 @@ bpf_drvinit(void *unused) dev = make_dev(&bpf_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "bpf"); /* For compatibility */ make_dev_alias(dev, "bpf0"); + + /* Register interface departure handler */ + bpf_ifdetach_cookie = EVENTHANDLER_REGISTER( + ifnet_departure_event, bpf_ifdetach, NULL, + EVENTHANDLER_PRI_ANY); } /* @@ -2595,14 +2633,14 @@ bpf_zero_counters(void) LIST_FOREACH(bp, &bpf_iflist, bif_next) { BPFIF_RLOCK(bp); LIST_FOREACH(bd, &bp->bif_dlist, bd_next) { - BPFD_WLOCK(bd); + BPFD_LOCK(bd); bd->bd_rcount = 0; bd->bd_dcount = 0; bd->bd_fcount = 0; bd->bd_wcount = 0; bd->bd_wfcount = 0; bd->bd_zcopy = 0; - BPFD_WUNLOCK(bd); + BPFD_UNLOCK(bd); } BPFIF_RUNLOCK(bp); } @@ -2696,15 +2734,15 @@ bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) /* Send writers-only first */ LIST_FOREACH(bd, &bp->bif_wlist, bd_next) { xbd = &xbdbuf[index++]; - BPFD_RLOCK(bd); + BPFD_LOCK(bd); bpfstats_fill_xbpf(xbd, bd); - BPFD_RUNLOCK(bd); + BPFD_UNLOCK(bd); } LIST_FOREACH(bd, &bp->bif_dlist, bd_next) { xbd = &xbdbuf[index++]; - BPFD_RLOCK(bd); + BPFD_LOCK(bd); bpfstats_fill_xbpf(xbd, bd); - BPFD_RUNLOCK(bd); + BPFD_UNLOCK(bd); } BPFIF_RUNLOCK(bp); } Modified: head/sys/net/bpf.h ============================================================================== --- head/sys/net/bpf.h Mon May 21 22:13:48 2012 (r235744) +++ head/sys/net/bpf.h Mon May 21 22:17:29 2012 (r235745) @@ -1225,6 +1225,7 @@ struct bpf_if { struct ifnet *bif_ifp; /* corresponding interface */ struct rwlock bif_lock; /* interface lock */ LIST_HEAD(, bpf_d) bif_wlist; /* writer-only list */ + int flags; /* Interface flags */ #endif }; Modified: head/sys/net/bpf_buffer.c ============================================================================== --- head/sys/net/bpf_buffer.c Mon May 21 22:13:48 2012 (r235744) +++ head/sys/net/bpf_buffer.c Mon May 21 22:17:29 2012 (r235745) @@ -184,9 +184,9 @@ bpf_buffer_ioctl_sblen(struct bpf_d *d, { u_int size; - BPFD_WLOCK(d); + BPFD_LOCK(d); if (d->bd_bif != NULL) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (EINVAL); } size = *i; @@ -195,7 +195,7 @@ bpf_buffer_ioctl_sblen(struct bpf_d *d, else if (size < BPF_MINBUFSIZE) *i = size = BPF_MINBUFSIZE; d->bd_bufsize = size; - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (0); } Modified: head/sys/net/bpf_zerocopy.c ============================================================================== --- head/sys/net/bpf_zerocopy.c Mon May 21 22:13:48 2012 (r235744) +++ head/sys/net/bpf_zerocopy.c Mon May 21 22:17:29 2012 (r235745) @@ -515,14 +515,14 @@ bpf_zerocopy_ioctl_rotzbuf(struct thread struct zbuf *bzh; bzero(bz, sizeof(*bz)); - BPFD_WLOCK(d); + BPFD_LOCK(d); if (d->bd_hbuf == NULL && d->bd_slen != 0) { ROTATE_BUFFERS(d); bzh = (struct zbuf *)d->bd_hbuf; bz->bz_bufa = (void *)bzh->zb_uaddr; bz->bz_buflen = d->bd_hlen; } - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (0); } @@ -570,10 +570,10 @@ bpf_zerocopy_ioctl_setzbuf(struct thread * We only allow buffers to be installed once, so atomically check * that no buffers are currently installed and install new buffers. */ - BPFD_WLOCK(d); + BPFD_LOCK(d); if (d->bd_hbuf != NULL || d->bd_sbuf != NULL || d->bd_fbuf != NULL || d->bd_bif != NULL) { - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); zbuf_free(zba); zbuf_free(zbb); return (EINVAL); @@ -593,6 +593,6 @@ bpf_zerocopy_ioctl_setzbuf(struct thread * shared management region. */ d->bd_bufsize = bz->bz_buflen - sizeof(struct bpf_zbuf_header); - BPFD_WUNLOCK(d); + BPFD_UNLOCK(d); return (0); } Modified: head/sys/net/bpfdesc.h ============================================================================== --- head/sys/net/bpfdesc.h Mon May 21 22:13:48 2012 (r235744) +++ head/sys/net/bpfdesc.h Mon May 21 22:17:29 2012 (r235745) @@ -88,7 +88,7 @@ struct bpf_d { int bd_sig; /* signal to send upon packet reception */ struct sigio * bd_sigio; /* information for async I/O */ struct selinfo bd_sel; /* bsd select info */ - struct rwlock bd_lock; /* per-descriptor lock */ + struct mtx bd_lock; /* per-descriptor lock */ struct callout bd_callout; /* for BPF timeouts with select */ struct label *bd_label; /* MAC label for descriptor */ u_int64_t bd_fcount; /* number of packets which matched filter */ @@ -107,12 +107,9 @@ struct bpf_d { #define BPF_WAITING 1 /* waiting for read timeout in select */ #define BPF_TIMED_OUT 2 /* read timeout has expired in select */ -#define BPFD_RLOCK(bd) rw_rlock(&(bd)->bd_lock) -#define BPFD_RUNLOCK(bd) rw_runlock(&(bd)->bd_lock) -#define BPFD_WLOCK(bd) rw_wlock(&(bd)->bd_lock) -#define BPFD_WUNLOCK(bd) rw_wunlock(&(bd)->bd_lock) -#define BPFD_WLOCK_ASSERT(bd) rw_assert(&(bd)->bd_lock, RA_WLOCKED) -#define BPFD_LOCK_ASSERT(bd) rw_assert(&(bd)->bd_lock, RA_LOCKED) +#define BPFD_LOCK(bd) mtx_lock(&(bd)->bd_lock) +#define BPFD_UNLOCK(bd) mtx_unlock(&(bd)->bd_lock) +#define BPFD_LOCK_ASSERT(bd) mtx_assert(&(bd)->bd_lock, MA_OWNED) #define BPF_PID_REFRESH(bd, td) (bd)->bd_pid = (td)->td_proc->p_pid #define BPF_PID_REFRESH_CUR(bd) (bd)->bd_pid = curthread->td_proc->p_pid @@ -159,4 +156,6 @@ struct xbpf_d { #define BPFIF_WLOCK(bif) rw_wlock(&(bif)->bif_lock) #define BPFIF_WUNLOCK(bif) rw_wunlock(&(bif)->bif_lock) +#define BPFIF_FLAG_DYING 1 /* Reject new bpf consumers */ + #endif From owner-svn-src-head@FreeBSD.ORG Mon May 21 22:19:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CDAF01065680; Mon, 21 May 2012 22:19:20 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE46A8FC0A; Mon, 21 May 2012 22:19:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LMJKl7076039; Mon, 21 May 2012 22:19:20 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMJKR9076035; Mon, 21 May 2012 22:19:20 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201205212219.q4LMJKR9076035@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 21 May 2012 22:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235746 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:19:20 -0000 Author: melifaro Date: Mon May 21 22:19:19 2012 New Revision: 235746 URL: http://svn.freebsd.org/changeset/base/235746 Log: Call bpf_jitter() before acquiring BPF global lock due to malloc() being used inside bpf_jitter. Eliminate bpf_buffer_alloc() and allocate BPF buffers on descriptor creation and BIOCSBLEN ioctl. This permits us not to allocate buffers inside bpf_attachd() which is protected by global lock. Approved by: kib(mentor) MFC in: 4 weeks Modified: head/sys/net/bpf.c head/sys/net/bpf_buffer.c head/sys/net/bpf_buffer.h Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon May 21 22:17:29 2012 (r235745) +++ head/sys/net/bpf.c Mon May 21 22:19:19 2012 (r235746) @@ -804,7 +804,7 @@ static int bpfopen(struct cdev *dev, int flags, int fmt, struct thread *td) { struct bpf_d *d; - int error; + int error, size; d = malloc(sizeof(*d), M_BPF, M_WAITOK | M_ZERO); error = devfs_set_cdevpriv(d, bpf_dtor); @@ -831,6 +831,10 @@ bpfopen(struct cdev *dev, int flags, int callout_init_mtx(&d->bd_callout, &d->bd_lock, 0); knlist_init_mtx(&d->bd_sel.si_note, &d->bd_lock); + /* Allocate default buffers */ + size = d->bd_bufsize; + bpf_buffer_ioctl_sblen(d, &size); + return (0); } @@ -1664,7 +1668,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro struct bpf_insn *fcode, *old; u_int wfilter, flen, size; #ifdef BPF_JITTER - bpf_jit_filter *ofunc; + bpf_jit_filter *ofunc, *jfunc; #endif int need_upgrade; #ifdef COMPAT_FREEBSD32 @@ -1695,6 +1699,13 @@ bpf_setf(struct bpf_d *d, struct bpf_pro else fcode = NULL; /* Make compiler happy */ +#ifdef BPF_JITTER + if (fp->bf_insns != NULL) + jfunc = bpf_jitter(fcode, flen); + else + jfunc = NULL; /* Make compiler happy */ +#endif + BPF_LOCK(); if (cmd == BIOCSETWF) { @@ -1755,7 +1766,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro else { d->bd_rfilter = fcode; #ifdef BPF_JITTER - d->bd_bfilter = bpf_jitter(fcode, flen); + d->bd_bfilter = jfunc; #endif if (cmd == BIOCSETF) reset_d(d); @@ -1827,11 +1838,6 @@ bpf_setif(struct bpf_d *d, struct ifreq */ switch (d->bd_bufmode) { case BPF_BUFMODE_BUFFER: - if (d->bd_sbuf == NULL) - bpf_buffer_alloc(d); - KASSERT(d->bd_sbuf != NULL, ("bpf_setif: bd_sbuf NULL")); - break; - case BPF_BUFMODE_ZBUF: if (d->bd_sbuf == NULL) return (EINVAL); Modified: head/sys/net/bpf_buffer.c ============================================================================== --- head/sys/net/bpf_buffer.c Mon May 21 22:17:29 2012 (r235745) +++ head/sys/net/bpf_buffer.c Mon May 21 22:19:19 2012 (r235746) @@ -93,21 +93,6 @@ static int bpf_maxbufsize = BPF_MAXBUFSI SYSCTL_INT(_net_bpf, OID_AUTO, maxbufsize, CTLFLAG_RW, &bpf_maxbufsize, 0, "Maximum capture buffer in bytes"); -void -bpf_buffer_alloc(struct bpf_d *d) -{ - - KASSERT(d->bd_fbuf == NULL, ("bpf_buffer_alloc: bd_fbuf != NULL")); - KASSERT(d->bd_sbuf == NULL, ("bpf_buffer_alloc: bd_sbuf != NULL")); - KASSERT(d->bd_hbuf == NULL, ("bpf_buffer_alloc: bd_hbuf != NULL")); - - d->bd_fbuf = (caddr_t)malloc(d->bd_bufsize, M_BPF, M_WAITOK); - d->bd_sbuf = (caddr_t)malloc(d->bd_bufsize, M_BPF, M_WAITOK); - d->bd_hbuf = NULL; - d->bd_slen = 0; - d->bd_hlen = 0; -} - /* * Simple data copy to the current kernel buffer. */ @@ -183,18 +168,42 @@ int bpf_buffer_ioctl_sblen(struct bpf_d *d, u_int *i) { u_int size; + caddr_t fbuf, sbuf; - BPFD_LOCK(d); - if (d->bd_bif != NULL) { - BPFD_UNLOCK(d); - return (EINVAL); - } size = *i; if (size > bpf_maxbufsize) *i = size = bpf_maxbufsize; else if (size < BPF_MINBUFSIZE) *i = size = BPF_MINBUFSIZE; + + /* Allocate buffers immediately */ + fbuf = (caddr_t)malloc(size, M_BPF, M_WAITOK); + sbuf = (caddr_t)malloc(size, M_BPF, M_WAITOK); + + BPFD_LOCK(d); + if (d->bd_bif != NULL) { + /* Interface already attached, unable to change buffers */ + BPFD_UNLOCK(d); + free(fbuf, M_BPF); + free(sbuf, M_BPF); + return (EINVAL); + } + + /* Free old buffers if set */ + if (d->bd_fbuf != NULL) + free(d->bd_fbuf, M_BPF); + if (d->bd_sbuf != NULL) + free(d->bd_sbuf, M_BPF); + + /* Fill in new data */ d->bd_bufsize = size; + d->bd_fbuf = fbuf; + d->bd_sbuf = sbuf; + + d->bd_hbuf = NULL; + d->bd_slen = 0; + d->bd_hlen = 0; + BPFD_UNLOCK(d); return (0); } Modified: head/sys/net/bpf_buffer.h ============================================================================== --- head/sys/net/bpf_buffer.h Mon May 21 22:17:29 2012 (r235745) +++ head/sys/net/bpf_buffer.h Mon May 21 22:19:19 2012 (r235746) @@ -36,7 +36,6 @@ #error "no user-serviceable parts inside" #endif -void bpf_buffer_alloc(struct bpf_d *d); void bpf_buffer_append_bytes(struct bpf_d *d, caddr_t buf, u_int offset, void *src, u_int len); void bpf_buffer_append_mbuf(struct bpf_d *d, caddr_t buf, u_int offset, From owner-svn-src-head@FreeBSD.ORG Mon May 21 22:21:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35AB7106578B; Mon, 21 May 2012 22:21:01 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15D778FC0C; Mon, 21 May 2012 22:21:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LML0Ff076131; Mon, 21 May 2012 22:21:00 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LML09n076128; Mon, 21 May 2012 22:21:00 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201205212221.q4LML09n076128@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 21 May 2012 22:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235747 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:21:01 -0000 Author: melifaro Date: Mon May 21 22:21:00 2012 New Revision: 235747 URL: http://svn.freebsd.org/changeset/base/235747 Log: Make most BPF ioctls() SMP-safe. Approved by: kib(mentor) MFC in: 4 weeks Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon May 21 22:19:19 2012 (r235746) +++ head/sys/net/bpf.c Mon May 21 22:21:00 2012 (r235747) @@ -1229,7 +1229,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c case BIOCGDLTLIST32: case BIOCGRTIMEOUT32: case BIOCSRTIMEOUT32: + BPFD_LOCK(d); d->bd_compat32 = 1; + BPFD_UNLOCK(d); } #endif @@ -1274,7 +1276,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get buffer len [for read()]. */ case BIOCGBLEN: + BPFD_LOCK(d); *(u_int *)addr = d->bd_bufsize; + BPFD_UNLOCK(d); break; /* @@ -1329,10 +1333,12 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get current data link type. */ case BIOCGDLT: + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else *(u_int *)addr = d->bd_bif->bif_dlt; + BPF_UNLOCK(); break; /* @@ -1347,6 +1353,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c list32 = (struct bpf_dltlist32 *)addr; dltlist.bfl_len = list32->bfl_len; dltlist.bfl_list = PTRIN(list32->bfl_list); + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else { @@ -1354,15 +1361,18 @@ bpfioctl(struct cdev *dev, u_long cmd, c if (error == 0) list32->bfl_len = dltlist.bfl_len; } + BPF_UNLOCK(); break; } #endif case BIOCGDLTLIST: + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else error = bpf_getdltlist(d, (struct bpf_dltlist *)addr); + BPF_UNLOCK(); break; /* @@ -1381,6 +1391,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get interface name. */ case BIOCGETIF: + BPF_LOCK(); if (d->bd_bif == NULL) error = EINVAL; else { @@ -1390,6 +1401,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c strlcpy(ifr->ifr_name, ifp->if_xname, sizeof(ifr->ifr_name)); } + BPF_UNLOCK(); break; /* @@ -1481,7 +1493,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Set immediate mode. */ case BIOCIMMEDIATE: + BPFD_LOCK(d); d->bd_immediate = *(u_int *)addr; + BPFD_UNLOCK(d); break; case BIOCVERSION: @@ -1497,21 +1511,27 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get "header already complete" flag */ case BIOCGHDRCMPLT: + BPFD_LOCK(d); *(u_int *)addr = d->bd_hdrcmplt; + BPFD_UNLOCK(d); break; /* * Set "header already complete" flag */ case BIOCSHDRCMPLT: + BPFD_LOCK(d); d->bd_hdrcmplt = *(u_int *)addr ? 1 : 0; + BPFD_UNLOCK(d); break; /* * Get packet direction flag */ case BIOCGDIRECTION: + BPFD_LOCK(d); *(u_int *)addr = d->bd_direction; + BPFD_UNLOCK(d); break; /* @@ -1526,7 +1546,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c case BPF_D_IN: case BPF_D_INOUT: case BPF_D_OUT: + BPFD_LOCK(d); d->bd_direction = direction; + BPFD_UNLOCK(d); break; default: error = EINVAL; @@ -1538,7 +1560,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get packet timestamp format and resolution. */ case BIOCGTSTAMP: + BPFD_LOCK(d); *(u_int *)addr = d->bd_tstamp; + BPFD_UNLOCK(d); break; /* @@ -1557,26 +1581,38 @@ bpfioctl(struct cdev *dev, u_long cmd, c break; case BIOCFEEDBACK: + BPFD_LOCK(d); d->bd_feedback = *(u_int *)addr; + BPFD_UNLOCK(d); break; case BIOCLOCK: + BPFD_LOCK(d); d->bd_locked = 1; + BPFD_UNLOCK(d); break; case FIONBIO: /* Non-blocking I/O */ break; case FIOASYNC: /* Send signal on receive packets */ + BPFD_LOCK(d); d->bd_async = *(int *)addr; + BPFD_UNLOCK(d); break; case FIOSETOWN: + /* + * XXX: Add some sort of locking here? + * fsetown() can sleep. + */ error = fsetown(*(int *)addr, &d->bd_sigio); break; case FIOGETOWN: + BPFD_LOCK(d); *(int *)addr = fgetown(&d->bd_sigio); + BPFD_UNLOCK(d); break; /* This is deprecated, FIOSETOWN should be used instead. */ @@ -1597,16 +1633,23 @@ bpfioctl(struct cdev *dev, u_long cmd, c if (sig >= NSIG) error = EINVAL; - else + else { + BPFD_LOCK(d); d->bd_sig = sig; + BPFD_UNLOCK(d); + } break; } case BIOCGRSIG: + BPFD_LOCK(d); *(u_int *)addr = d->bd_sig; + BPFD_UNLOCK(d); break; case BIOCGETBUFMODE: + BPFD_LOCK(d); *(u_int *)addr = d->bd_bufmode; + BPFD_UNLOCK(d); break; case BIOCSETBUFMODE: @@ -2544,24 +2587,22 @@ bpf_getdltlist(struct bpf_d *d, struct b struct ifnet *ifp; struct bpf_if *bp; + BPF_LOCK_ASSERT(); + ifp = d->bd_bif->bif_ifp; n = 0; error = 0; - BPF_LOCK(); LIST_FOREACH(bp, &bpf_iflist, bif_next) { if (bp->bif_ifp != ifp) continue; if (bfl->bfl_list != NULL) { - if (n >= bfl->bfl_len) { - BPF_UNLOCK(); + if (n >= bfl->bfl_len) return (ENOMEM); - } error = copyout(&bp->bif_dlt, bfl->bfl_list + n, sizeof(u_int)); } n++; } - BPF_UNLOCK(); bfl->bfl_len = n; return (error); } From owner-svn-src-head@FreeBSD.ORG Mon May 21 22:39:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6797106567E; Mon, 21 May 2012 22:39:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A241E8FC16; Mon, 21 May 2012 22:39:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LMdEau076733; Mon, 21 May 2012 22:39:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMdEPa076731; Mon, 21 May 2012 22:39:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205212239.q4LMdEPa076731@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 May 2012 22:39:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235749 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:39:14 -0000 Author: adrian Date: Mon May 21 22:39:13 2012 New Revision: 235749 URL: http://svn.freebsd.org/changeset/base/235749 Log: Rename ath_tx_cleanup() -> ath_tx_tid_cleanup() in order to not clash with a symbol in if_ath.c Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon May 21 22:23:21 2012 (r235748) +++ head/sys/dev/ath/if_ath_tx.c Mon May 21 22:39:13 2012 (r235749) @@ -3094,7 +3094,7 @@ ath_tx_comp_cleanup_unaggr(struct ath_so * The caller is responsible for pausing the TID. */ static void -ath_tx_cleanup(struct ath_softc *sc, struct ath_node *an, int tid) +ath_tx_tid_cleanup(struct ath_softc *sc, struct ath_node *an, int tid) { struct ath_tid *atid = &an->an_tid[tid]; struct ieee80211_tx_ampdu *tap; @@ -4419,11 +4419,11 @@ ath_addba_stop(struct ieee80211_node *ni sc->sc_addba_stop(ni, tap); /* - * ath_tx_cleanup will resume the TID if possible, otherwise + * ath_tx_tid_cleanup will resume the TID if possible, otherwise * it'll set the cleanup flag, and it'll be unpaused once * things have been cleaned up. */ - ath_tx_cleanup(sc, an, tid); + ath_tx_tid_cleanup(sc, an, tid); } /* From owner-svn-src-head@FreeBSD.ORG Mon May 21 22:43:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33C0E1065679; Mon, 21 May 2012 22:43:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F2128FC24; Mon, 21 May 2012 22:43:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LMhc3h076892; Mon, 21 May 2012 22:43:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMhc9D076890; Mon, 21 May 2012 22:43:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205212243.q4LMhc9D076890@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 May 2012 22:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235750 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:43:39 -0000 Author: adrian Date: Mon May 21 22:43:38 2012 New Revision: 235750 URL: http://svn.freebsd.org/changeset/base/235750 Log: For now, add a quick debugging patch to log when the hw TXQ != the TID/AC. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon May 21 22:39:13 2012 (r235749) +++ head/sys/dev/ath/if_ath_tx.c Mon May 21 22:43:38 2012 (r235750) @@ -1298,6 +1298,18 @@ ath_tx_normal_setup(struct ath_softc *sc return EIO; } + /* Check if the TXQ wouldn't match what the hardware TXQ is! */ + if (txq != sc->sc_ac2q[pri]) { + device_printf(sc->sc_dev, + "%s: txq=%p (%d), pri=%d, pri txq=%p (%d)\n", + __func__, + txq, + txq->axq_qnum, + pri, + sc->sc_ac2q[pri], + sc->sc_ac2q[pri]->axq_qnum); + } + /* * Calculate miscellaneous flags. */ From owner-svn-src-head@FreeBSD.ORG Mon May 21 22:54:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D4CA1065670; Mon, 21 May 2012 22:54:34 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 873928FC19; Mon, 21 May 2012 22:54:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4LMsYdq077180; Mon, 21 May 2012 22:54:34 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4LMsYhg077174; Mon, 21 May 2012 22:54:34 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201205212254.q4LMsYhg077174@svn.freebsd.org> From: Jim Harris Date: Mon, 21 May 2012 22:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235751 - head/sys/dev/isci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2012 22:54:34 -0000 Author: jimharris Date: Mon May 21 22:54:33 2012 New Revision: 235751 URL: http://svn.freebsd.org/changeset/base/235751 Log: Wait until completion context unwinds before retrying CCBs that have been queued internally. This works around issue in the isci HAL where it cannot accept new I/O to a device after a resetting->ready state transition until the completion context has unwound. This issue was found by submitting non-tagged CCBs through pass(4) interface to a SATA disk with an extremely small timeout value (5ms). This would trigger internal resets with I/O in the isci(4) internal queues. The small timeout value had not been intentional (and original reporter has since changed his test to use 5sec instead), but it did uncover this corner case that would result in a hung disk. Sponsored by: Intel Reported and tested by: Ravi Pokala Reviewed by: scottl (earlier version) MFC after: 1 week Modified: head/sys/dev/isci/isci.h head/sys/dev/isci/isci_controller.c head/sys/dev/isci/isci_interrupt.c head/sys/dev/isci/isci_io_request.c head/sys/dev/isci/isci_remote_device.c Modified: head/sys/dev/isci/isci.h ============================================================================== --- head/sys/dev/isci/isci.h Mon May 21 22:43:38 2012 (r235750) +++ head/sys/dev/isci/isci.h Mon May 21 22:54:33 2012 (r235751) @@ -30,6 +30,9 @@ * $FreeBSD$ */ +#ifndef _ISCI_H +#define _ISCI_H + #include #include #include @@ -86,7 +89,31 @@ struct ISCI_REMOTE_DEVICE { BOOL is_resetting; uint32_t frozen_lun_mask; SCI_FAST_LIST_ELEMENT_T pending_device_reset_element; + + /* + * This queue maintains CCBs that have been returned with + * SCI_IO_FAILURE_INVALID_STATE from the SCI layer. These CCBs + * need to be retried, but we cannot return CAM_REQUEUE_REQ because + * this status gets passed all the way back up to users of the pass(4) + * interface and breaks things like smartctl. So instead, we queue + * these CCBs internally. + */ TAILQ_HEAD(,ccb_hdr) queued_ccbs; + + /* + * Marker denoting this remote device needs its first queued ccb to + * be retried. + */ + BOOL release_queued_ccb; + + /* + * Points to a CCB in the queue that is currently being processed by + * SCIL. This allows us to keep in flight CCBs in the queue so as to + * maintain ordering (i.e. in case we retry an I/O and then find out + * it needs to be retried again - it just keeps its same place in the + * queue. + */ + union ccb * queued_ccb_in_progress; }; struct ISCI_DOMAIN { @@ -126,6 +153,7 @@ struct ISCI_CONTROLLER BOOL has_been_scanned; uint32_t initial_discovery_mask; BOOL is_frozen; + BOOL release_queued_ccbs; uint8_t *remote_device_memory; struct ISCI_MEMORY cached_controller_memory; struct ISCI_MEMORY uncached_controller_memory; @@ -291,6 +319,8 @@ int isci_controller_attach_to_cam(struct void isci_controller_start(void *controller); +void isci_controller_release_queued_ccbs(struct ISCI_CONTROLLER *controller); + void isci_domain_construct(struct ISCI_DOMAIN *domain, uint32_t domain_index, struct ISCI_CONTROLLER *controller); @@ -301,3 +331,5 @@ void isci_log_message(uint32_t verbosity char *log_message, ...); extern uint32_t g_isci_debug_level; + +#endif /* #ifndef _ISCI_H */ Modified: head/sys/dev/isci/isci_controller.c ============================================================================== --- head/sys/dev/isci/isci_controller.c Mon May 21 22:43:38 2012 (r235750) +++ head/sys/dev/isci/isci_controller.c Mon May 21 22:54:33 2012 (r235751) @@ -201,6 +201,7 @@ void isci_controller_construct(struct IS controller->is_started = FALSE; controller->is_frozen = FALSE; + controller->release_queued_ccbs = FALSE; controller->sim = NULL; controller->initial_discovery_mask = 0; @@ -431,6 +432,8 @@ int isci_controller_allocate_memory(stru sci_fast_list_element_init(remote_device, &remote_device->pending_device_reset_element); TAILQ_INIT(&remote_device->queued_ccbs); + remote_device->release_queued_ccb = FALSE; + remote_device->queued_ccb_in_progress = NULL; /* * For the first SCI_MAX_DOMAINS device objects, do not put @@ -694,3 +697,47 @@ void isci_action(struct cam_sim *sim, un } } +/* + * Unfortunately, SCIL doesn't cleanly handle retry conditions. + * CAM_REQUEUE_REQ works only when no one is using the pass(4) interface. So + * when SCIL denotes an I/O needs to be retried (typically because of mixing + * tagged/non-tagged ATA commands, or running out of NCQ slots), we queue + * these I/O internally. Once SCIL completes an I/O to this device, or we get + * a ready notification, we will retry the first I/O on the queue. + * Unfortunately, SCIL also doesn't cleanly handle starting the new I/O within + * the context of the completion handler, so we need to retry these I/O after + * the completion handler is done executing. + */ +void +isci_controller_release_queued_ccbs(struct ISCI_CONTROLLER *controller) +{ + struct ISCI_REMOTE_DEVICE *dev; + struct ccb_hdr *ccb_h; + int dev_idx; + + KASSERT(mtx_owned(&controller->lock), ("controller lock not owned")); + + controller->release_queued_ccbs = FALSE; + for (dev_idx = 0; + dev_idx < SCI_MAX_REMOTE_DEVICES; + dev_idx++) { + + dev = controller->remote_device[dev_idx]; + if (dev != NULL && + dev->release_queued_ccb == TRUE && + dev->queued_ccb_in_progress == NULL) { + dev->release_queued_ccb = FALSE; + ccb_h = TAILQ_FIRST(&dev->queued_ccbs); + + if (ccb_h == NULL) + continue; + + isci_log_message(1, "ISCI", "release %p %x\n", ccb_h, + ((union ccb *)ccb_h)->csio.cdb_io.cdb_bytes[0]); + + dev->queued_ccb_in_progress = (union ccb *)ccb_h; + isci_io_request_execute_scsi_io( + (union ccb *)ccb_h, controller); + } + } +} Modified: head/sys/dev/isci/isci_interrupt.c ============================================================================== --- head/sys/dev/isci/isci_interrupt.c Mon May 21 22:43:38 2012 (r235750) +++ head/sys/dev/isci/isci_interrupt.c Mon May 21 22:54:33 2012 (r235751) @@ -177,6 +177,9 @@ isci_interrupt_legacy_handler(void *arg) if (interrupt_handler(scic_controller_handle)) { mtx_lock(&controller->lock); completion_handler(scic_controller_handle); + if (controller->release_queued_ccbs == TRUE) + isci_controller_release_queued_ccbs( + controller); mtx_unlock(&controller->lock); } } @@ -204,6 +207,13 @@ isci_interrupt_msix_handler(void *arg) if (interrupt_handler(scic_controller_handle)) { mtx_lock(&controller->lock); completion_handler(scic_controller_handle); + /* + * isci_controller_release_queued_ccb() is a relatively + * expensive routine, so we don't call it until the controller + * level flag is set to TRUE. + */ + if (controller->release_queued_ccbs == TRUE) + isci_controller_release_queued_ccbs(controller); mtx_unlock(&controller->lock); } } Modified: head/sys/dev/isci/isci_io_request.c ============================================================================== --- head/sys/dev/isci/isci_io_request.c Mon May 21 22:43:38 2012 (r235750) +++ head/sys/dev/isci/isci_io_request.c Mon May 21 22:54:33 2012 (r235751) @@ -223,7 +223,7 @@ isci_io_request_complete(SCI_CONTROLLER_ (struct ISCI_REQUEST *)isci_request); if (complete_ccb) { - if (ccb->ccb_h.status != CAM_REQ_CMP) { + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { /* ccb will be completed with some type of non-success * status. So temporarily freeze the queue until the * upper layers can act on the status. The @@ -234,6 +234,26 @@ isci_io_request_complete(SCI_CONTROLLER_ xpt_freeze_devq(ccb->ccb_h.path, 1); } + if (ccb->ccb_h.status & CAM_SIM_QUEUED) { + + KASSERT(ccb == isci_remote_device->queued_ccb_in_progress, + ("multiple internally queued ccbs in flight")); + + TAILQ_REMOVE(&isci_remote_device->queued_ccbs, + &ccb->ccb_h, sim_links.tqe); + ccb->ccb_h.status &= ~CAM_SIM_QUEUED; + + /* + * This CCB that was in the queue was completed, so + * set the in_progress pointer to NULL denoting that + * we can retry another CCB from the queue. We only + * allow one CCB at a time from the queue to be + * in progress so that we can effectively maintain + * ordering. + */ + isci_remote_device->queued_ccb_in_progress = NULL; + } + if (isci_remote_device->frozen_lun_mask != 0) { isci_remote_device_release_device_queue(isci_remote_device); } @@ -248,11 +268,30 @@ isci_io_request_complete(SCI_CONTROLLER_ isci_remote_device_freeze_lun_queue(isci_remote_device, ccb->ccb_h.target_lun); - isci_log_message(1, "ISCI", "queue %p %x\n", ccb, - ccb->csio.cdb_io.cdb_bytes[0]); - ccb->ccb_h.status |= CAM_SIM_QUEUED; - TAILQ_INSERT_TAIL(&isci_remote_device->queued_ccbs, - &ccb->ccb_h, sim_links.tqe); + if (ccb->ccb_h.status & CAM_SIM_QUEUED) { + + KASSERT(ccb == isci_remote_device->queued_ccb_in_progress, + ("multiple internally queued ccbs in flight")); + + /* + * Do nothing, CCB is already on the device's queue. + * We leave it on the queue, to be retried again + * next time a CCB on this device completes, or we + * get a ready notification for this device. + */ + isci_log_message(1, "ISCI", "already queued %p %x\n", + ccb, ccb->csio.cdb_io.cdb_bytes[0]); + + isci_remote_device->queued_ccb_in_progress = NULL; + + } else { + isci_log_message(1, "ISCI", "queue %p %x\n", ccb, + ccb->csio.cdb_io.cdb_bytes[0]); + ccb->ccb_h.status |= CAM_SIM_QUEUED; + + TAILQ_INSERT_TAIL(&isci_remote_device->queued_ccbs, + &ccb->ccb_h, sim_links.tqe); + } } } Modified: head/sys/dev/isci/isci_remote_device.c ============================================================================== --- head/sys/dev/isci/isci_remote_device.c Mon May 21 22:43:38 2012 (r235750) +++ head/sys/dev/isci/isci_remote_device.c Mon May 21 22:54:33 2012 (r235751) @@ -297,14 +297,18 @@ isci_remote_device_release_device_queue( for (lun = 0; lun < ISCI_MAX_LUN; lun++) isci_remote_device_release_lun_queue(device, lun); } else { - struct ccb_hdr *ccb_h; + /* + * We cannot unfreeze the devq, because there are still + * CCBs in our internal queue that need to be processed + * first. Mark this device, and the controller, so that + * the first CCB in this device's internal queue will be + * resubmitted after the current completion context + * unwinds. + */ + device->release_queued_ccb = TRUE; + device->domain->controller->release_queued_ccbs = TRUE; - ccb_h = TAILQ_FIRST(&device->queued_ccbs); - TAILQ_REMOVE(&device->queued_ccbs, ccb_h, sim_links.tqe); - ccb_h->status &= ~CAM_SIM_QUEUED; - isci_log_message(1, "ISCI", "release %p %x\n", ccb_h, - ((union ccb*)ccb_h)->csio.cdb_io.cdb_bytes[0]); - isci_io_request_execute_scsi_io((union ccb *)ccb_h, - device->domain->controller); + isci_log_message(1, "ISCI", "schedule %p for release\n", + device); } } From owner-svn-src-head@FreeBSD.ORG Tue May 22 01:28:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58979106564A; Tue, 22 May 2012 01:28:33 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4416D8FC08; Tue, 22 May 2012 01:28:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4M1SXQr081578; Tue, 22 May 2012 01:28:33 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M1SXPv081576; Tue, 22 May 2012 01:28:33 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205220128.q4M1SXPv081576@svn.freebsd.org> From: Kevin Lo Date: Tue, 22 May 2012 01:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235767 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 01:28:33 -0000 Author: kevlo Date: Tue May 22 01:28:32 2012 New Revision: 235767 URL: http://svn.freebsd.org/changeset/base/235767 Log: Add missing header needed by free() Reported by: tinderbox Modified: head/lib/libc/net/nsparser.y Modified: head/lib/libc/net/nsparser.y ============================================================================== --- head/lib/libc/net/nsparser.y Tue May 22 00:32:30 2012 (r235766) +++ head/lib/libc/net/nsparser.y Tue May 22 01:28:32 2012 (r235767) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #define _NS_PRIVATE #include #include +#include #include #include #include "un-namespace.h" From owner-svn-src-head@FreeBSD.ORG Tue May 22 02:27:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B81B91065670; Tue, 22 May 2012 02:27:48 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 536AD8FC1B; Tue, 22 May 2012 02:27:48 +0000 (UTC) Received: by obcni5 with SMTP id ni5so12099726obc.13 for ; Mon, 21 May 2012 19:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=BPPeajXJBtulDNQ6uUDrHIeeVxuNNpByFictIhlHJ8A=; b=cnnCsb6iW3yjy1OElysx3bmHvhRuOOFArJwIDZ8EVEyLjC2CDakSmvPusXzX40CYio bBFju3By8nv8V4U3JfgANzRX3w+rz37AuhiRCwEfPCP4tbRm7YQfJN5KFUwpQY8x5Rcn JZJ19AD/tdYrzAf+Y3lhBvswK9NMEU7BZSipcdhffB/40kYTkd9oeXuYsarI78sQS4D/ PGhp28a+gjwhxLJ/p4+ebpgZ5WgHQuF4p1A/WN1Al0lbVfRHHTTy8xZbu1yOIoTAk5+m J9Ji5AXk9Hv6c+MK1mgARHZqjvIwE33pFkfjLuTH2J4a73IGM/K06WgX6s/LFgjyAj0k nhuA== MIME-Version: 1.0 Received: by 10.182.31.102 with SMTP id z6mr21468770obh.78.1337653667689; Mon, 21 May 2012 19:27:47 -0700 (PDT) Received: by 10.76.153.72 with HTTP; Mon, 21 May 2012 19:27:47 -0700 (PDT) In-Reply-To: <201205220128.q4M1SXPv081576@svn.freebsd.org> References: <201205220128.q4M1SXPv081576@svn.freebsd.org> Date: Mon, 21 May 2012 19:27:47 -0700 Message-ID: From: Garrett Cooper To: Kevin Lo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235767 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 02:27:48 -0000 On Mon, May 21, 2012 at 6:28 PM, Kevin Lo wrote: > Author: kevlo > Date: Tue May 22 01:28:32 2012 > New Revision: 235767 > URL: http://svn.freebsd.org/changeset/base/235767 > > Log: > =A0Add missing header needed by free() > > =A0Reported by: =A0tinderbox Thank you for saving my mailbox :)!!! FWIW, it's weird because my STABLE-9 box didn't reproduce this. Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Tue May 22 03:01:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A92971065679; Tue, 22 May 2012 03:01:55 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B7F48FC0A; Tue, 22 May 2012 03:01:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4M31tXL084099; Tue, 22 May 2012 03:01:55 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M31tJn084097; Tue, 22 May 2012 03:01:55 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201205220301.q4M31tJn084097@svn.freebsd.org> From: Kevin Lo Date: Tue, 22 May 2012 03:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235771 - head/bin/expr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 03:01:55 -0000 Author: kevlo Date: Tue May 22 03:01:54 2012 New Revision: 235771 URL: http://svn.freebsd.org/changeset/base/235771 Log: Remove redundant declaration of yyparse Reported by: tinderbox Modified: head/bin/expr/expr.y Modified: head/bin/expr/expr.y ============================================================================== --- head/bin/expr/expr.y Tue May 22 02:37:04 2012 (r235770) +++ head/bin/expr/expr.y Tue May 22 03:01:54 2012 (r235771) @@ -74,7 +74,6 @@ int to_integer(struct val *); void to_string(struct val *); int yyerror(const char *); int yylex(void); -int yyparse(void); %} From owner-svn-src-head@FreeBSD.ORG Tue May 22 05:18:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5FA34106566B; Tue, 22 May 2012 05:18:31 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A6668FC08; Tue, 22 May 2012 05:18:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4M5IV2N088527; Tue, 22 May 2012 05:18:31 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M5IVHB088525; Tue, 22 May 2012 05:18:31 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201205220518.q4M5IVHB088525@svn.freebsd.org> From: Mitsuru IWASAKI Date: Tue, 22 May 2012 05:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235772 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 05:18:31 -0000 Author: iwasaki Date: Tue May 22 05:18:30 2012 New Revision: 235772 URL: http://svn.freebsd.org/changeset/base/235772 Log: Ignore the power button press event for resuming rather than starting shutdown. MFC after: 2 days Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue May 22 03:01:54 2012 (r235771) +++ head/sys/dev/acpica/acpi.c Tue May 22 05:18:30 2012 (r235772) @@ -2515,6 +2515,11 @@ acpi_ReqSleepState(struct acpi_softc *sc if (!acpi_sleep_states[state]) return (EOPNOTSUPP); + /* If a suspend request is already in progress, just return. */ + if (sc->acpi_next_sstate != 0) { + return (0); + } + /* Wait until sleep is enabled. */ while (sc->acpi_sleep_disabled) { AcpiOsSleep(1000); @@ -2522,11 +2527,6 @@ acpi_ReqSleepState(struct acpi_softc *sc ACPI_LOCK(acpi); - /* If a suspend request is already in progress, just return. */ - if (sc->acpi_next_sstate != 0) { - ACPI_UNLOCK(acpi); - return (0); - } sc->acpi_next_sstate = state; /* S5 (soft-off) should be entered directly with no waiting. */ From owner-svn-src-head@FreeBSD.ORG Tue May 22 06:28:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B4D21065673; Tue, 22 May 2012 06:28:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 161D58FC0C; Tue, 22 May 2012 06:28:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4M6SrMJ090227; Tue, 22 May 2012 06:28:53 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M6SrV2090225; Tue, 22 May 2012 06:28:53 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205220628.q4M6SrV2090225@svn.freebsd.org> From: Dimitry Andric Date: Tue, 22 May 2012 06:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235773 - head/contrib/ncurses/man X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 06:28:54 -0000 Author: dim Date: Tue May 22 06:28:53 2012 New Revision: 235773 URL: http://svn.freebsd.org/changeset/base/235773 Log: Correct use_screen() and use_window() prototypes in curs_threads(3x). Submitted by: Yanhui Shen MFC after: 3 days Modified: head/contrib/ncurses/man/curs_threads.3x Modified: head/contrib/ncurses/man/curs_threads.3x ============================================================================== --- head/contrib/ncurses/man/curs_threads.3x Tue May 22 05:18:30 2012 (r235772) +++ head/contrib/ncurses/man/curs_threads.3x Tue May 22 06:28:53 2012 (r235773) @@ -45,9 +45,9 @@ .br \fBint set_tabsize(int size);\fR .br -\fBint use_screen(SCREEN *scr, NCURSES_WINDOW_CB func, void *data);\fR +\fBint use_screen(SCREEN *scr, NCURSES_SCREEN_CB func, void *data);\fR .br -\fBint use_window(WINDOW *win, NCURSES_SCREEN_CB func, void *data);\fR +\fBint use_window(WINDOW *win, NCURSES_WINDOW_CB func, void *data);\fR .br .SH DESCRIPTION This implementation can be configured to provide rudimentary support From owner-svn-src-head@FreeBSD.ORG Tue May 22 06:31:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CBDE1065766; Tue, 22 May 2012 06:31:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB70D8FC18; Tue, 22 May 2012 06:31:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4M6V3qL090384; Tue, 22 May 2012 06:31:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M6V3UR090381; Tue, 22 May 2012 06:31:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205220631.q4M6V3UR090381@svn.freebsd.org> From: Adrian Chadd Date: Tue, 22 May 2012 06:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235774 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 06:31:04 -0000 Author: adrian Date: Tue May 22 06:31:03 2012 New Revision: 235774 URL: http://svn.freebsd.org/changeset/base/235774 Log: Fix up some corner cases with aggregation handling. I've come across a weird scenario in net80211 where two TX streams will happily attempt to setup an aggregation session together. If we're very lucky, it happens concurrently on separate CPUs and the total lack of locking in the net80211 aggregation code causes this stuff to race. Badly. So >1 call would occur to the ath(4) addba start, but only one call would complete to addba complete or timeout. The TID would thus stay paused. The real fix is to implement some proper per-node (or maybe per-TID) locking in net80211, which then could be leveraged by the ath(4) TX aggregation code. Whilst I'm at it, shuffle around the debugging messages a bit. I like to keep people on their toes. Modified: head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue May 22 06:28:53 2012 (r235773) +++ head/sys/dev/ath/if_ath_tx.c Tue May 22 06:31:03 2012 (r235774) @@ -1580,21 +1580,21 @@ ath_tx_start(struct ath_softc *sc, struc * reached.) */ if (txq == &avp->av_mcastq) { - DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: mcastq: TX'ing\n", __func__, bf); ATH_TXQ_LOCK(txq); ath_tx_xmit_normal(sc, txq, bf); ATH_TXQ_UNLOCK(txq); } else if (type == IEEE80211_FC0_TYPE_CTL && subtype == IEEE80211_FC0_SUBTYPE_BAR) { - DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: BAR: TX'ing direct\n", __func__); ATH_TXQ_LOCK(txq); ath_tx_xmit_normal(sc, txq, bf); ATH_TXQ_UNLOCK(txq); } else { /* add to software queue */ - DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: swq: TX'ing\n", __func__, bf); ath_tx_swq(sc, ni, txq, bf); } @@ -3113,7 +3113,7 @@ ath_tx_tid_cleanup(struct ath_softc *sc, struct ath_buf *bf, *bf_next; ath_bufhead bf_cq; - DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: TID %d: called\n", __func__, tid); TAILQ_INIT(&bf_cq); @@ -4336,7 +4336,15 @@ ath_addba_request(struct ieee80211_node * fall within it. */ ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); - ath_tx_tid_pause(sc, atid); + /* + * This is a bit annoying. Until net80211 HT code inherits some + * (any) locking, we may have this called in parallel BUT only + * one response/timeout will be called. Grr. + */ + if (atid->addba_tx_pending == 0) { + ath_tx_tid_pause(sc, atid); + atid->addba_tx_pending = 1; + } ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, @@ -4397,6 +4405,7 @@ ath_addba_response(struct ieee80211_node r = sc->sc_addba_response(ni, tap, status, code, batimeout); ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); + atid->addba_tx_pending = 0; /* * XXX dirty! * Slide the BAW left edge to wherever net80211 left it for us. @@ -4500,6 +4509,10 @@ ath_addba_response_timeout(struct ieee80 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: called; resuming\n", __func__); + ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); + atid->addba_tx_pending = 0; + ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); + /* Note: This updates the aggregate state to (again) pending */ sc->sc_addba_response_timeout(ni, tap); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue May 22 06:28:53 2012 (r235773) +++ head/sys/dev/ath/if_athvar.h Tue May 22 06:31:03 2012 (r235774) @@ -106,6 +106,7 @@ struct ath_tid { TAILQ_ENTRY(ath_tid) axq_qelem; int sched; int paused; /* >0 if the TID has been paused */ + int addba_tx_pending; /* TX ADDBA pending */ int bar_wait; /* waiting for BAR */ int bar_tx; /* BAR TXed */ From owner-svn-src-head@FreeBSD.ORG Tue May 22 06:33:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8633A1065676; Tue, 22 May 2012 06:33:09 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 719258FC12; Tue, 22 May 2012 06:33:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4M6X9nU090478; Tue, 22 May 2012 06:33:09 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M6X9Ct090476; Tue, 22 May 2012 06:33:09 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201205220633.q4M6X9Ct090476@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 22 May 2012 06:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235775 - head/sys/modules/bwi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 06:33:09 -0000 Author: uqs Date: Tue May 22 06:33:08 2012 New Revision: 235775 URL: http://svn.freebsd.org/changeset/base/235775 Log: Fix make depend. Modified: head/sys/modules/bwi/Makefile Modified: head/sys/modules/bwi/Makefile ============================================================================== --- head/sys/modules/bwi/Makefile Tue May 22 06:31:03 2012 (r235774) +++ head/sys/modules/bwi/Makefile Tue May 22 06:33:08 2012 (r235775) @@ -5,7 +5,7 @@ KMOD = if_bwi SRCS = if_bwi.c if_bwi_pci.c bwimac.c bwiphy.c bwirf.c -SRCS += device_if.h bus_if.h pci_if.h opt_inet.h opt_bwi.h +SRCS += device_if.h bus_if.h pci_if.h opt_inet.h opt_bwi.h opt_wlan.h opt_bwi.h: echo '#define BWI_DEBUG 1' > opt_bwi.h From owner-svn-src-head@FreeBSD.ORG Tue May 22 06:48:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A578106566C; Tue, 22 May 2012 06:48:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by mx1.freebsd.org (Postfix) with ESMTP id C7CC98FC12; Tue, 22 May 2012 06:48:18 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4M6m81e004473 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 May 2012 16:48:10 +1000 Date: Tue, 22 May 2012 16:48:08 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Guy Helmer In-Reply-To: <201205212104.q4LL4UDN072617@svn.freebsd.org> Message-ID: <20120522163814.T1056@besplex.bde.org> References: <201205212104.q4LL4UDN072617@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235739 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 06:48:19 -0000 On Mon, 21 May 2012, Guy Helmer wrote: > Log: > Apply style(9) to return and switch/case statements. > > Reviewed by: delphij (prior version of the patch) > > Modified: > head/lib/libc/gen/getnetgrent.c > > Modified: head/lib/libc/gen/getnetgrent.c > ============================================================================== > --- head/lib/libc/gen/getnetgrent.c Mon May 21 19:58:40 2012 (r235738) > +++ head/lib/libc/gen/getnetgrent.c Mon May 21 21:04:29 2012 (r235739) > ... > @@ -311,32 +311,35 @@ _revnetgr_lookup(char* lookupdom, char* > > for (rot = 0; ; rot++) { > switch (rot) { > - case(0): snprintf(key, MAXHOSTNAMELEN, "%s.%s", > - str, dom?dom:lookupdom); > - break; > - case(1): snprintf(key, MAXHOSTNAMELEN, "%s.*", > - str); > - break; > - case(2): snprintf(key, MAXHOSTNAMELEN, "*.%s", > - dom?dom:lookupdom); > - break; > - case(3): snprintf(key, MAXHOSTNAMELEN, "*.*"); > - break; > - default: return(0); > + case(0): > + snprintf(key, MAXHOSTNAMELEN, "%s.%s", str, > + dom ? dom : lookupdom); > + break; > + case(1): > + snprintf(key, MAXHOSTNAMELEN, "%s.*", str); > + break; > + case(2): > + snprintf(key, MAXHOSTNAMELEN, "*.%s", > + dom ? dom : lookupdom); > + break; > + case(3): > + snprintf(key, MAXHOSTNAMELEN, "*.*"); > + break; Thanks, but a fuller application would have removed the obfuscatory parentheses that make case() look like a function call... > + default: return (0); ... and split the case statements after ":" in all cases. > } > y = yp_match(lookupdom, map, key, strlen(key), &result, > &resultlen); You fixed the continuation indentation in the case statement but not here. > if (y == 0) { > rv = _listmatch(result, group, resultlen); > free(result); > - if (rv) return(1); > + if (rv) return (1); Another statement not started on a new line. > } else if (y != YPERR_KEY) { > /* > * If we get an error other than 'no > * such key in map' then something is > * wrong and we should stop the search. > */ > - return(-1); > + return (-1); > } > } > } These style bugs weren't in the CSRG version of course. The YP code added many. The most obvious ones are the case(n) and gnu-style continuation indentation. Bruce From owner-svn-src-head@FreeBSD.ORG Tue May 22 07:04:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA112106564A; Tue, 22 May 2012 07:04:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B507D8FC0A; Tue, 22 May 2012 07:04:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4M74Nc0091185; Tue, 22 May 2012 07:04:23 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M74NM6091183; Tue, 22 May 2012 07:04:23 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201205220704.q4M74NM6091183@svn.freebsd.org> From: Andrew Turner Date: Tue, 22 May 2012 07:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235776 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 07:04:23 -0000 Author: andrew Date: Tue May 22 07:04:23 2012 New Revision: 235776 URL: http://svn.freebsd.org/changeset/base/235776 Log: Fix booting on ARM. In PHYS_TO_VM_PAGE() when VM_PHYSSEG_DENSE is set the check if we are past the end of vm_page_array was incorrect causing it to return NULL. This value is then used in vm_phys_add_page causing a data abort. Reviewed by: alc, kib, imp Tested by: stas Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue May 22 06:33:08 2012 (r235775) +++ head/sys/vm/vm_page.c Tue May 22 07:04:23 2012 (r235776) @@ -647,7 +647,7 @@ PHYS_TO_VM_PAGE(vm_paddr_t pa) long pi; pi = atop(pa); - if (pi >= first_page && pi < vm_page_array_size) { + if (pi >= first_page && (pi - first_page) < vm_page_array_size) { m = &vm_page_array[pi - first_page]; return (m); } From owner-svn-src-head@FreeBSD.ORG Tue May 22 07:23:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C6131065674; Tue, 22 May 2012 07:23:42 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 881E78FC19; Tue, 22 May 2012 07:23:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4M7NgKu091717; Tue, 22 May 2012 07:23:42 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M7Ng2I091715; Tue, 22 May 2012 07:23:42 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <201205220723.q4M7Ng2I091715@svn.freebsd.org> From: Hartmut Brandt Date: Tue, 22 May 2012 07:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235777 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 07:23:42 -0000 Author: harti Date: Tue May 22 07:23:41 2012 New Revision: 235777 URL: http://svn.freebsd.org/changeset/base/235777 Log: Make dumptid non-static. It is used by libkvm to detect whether this is a VNET-kernel or not. gcc used to put the static symbol into the symbol table, clang does not. This fixes the 'netstat: no namelist' error seen on clang+VNET systems. Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Tue May 22 07:04:23 2012 (r235776) +++ head/sys/kern/kern_shutdown.c Tue May 22 07:23:41 2012 (r235777) @@ -151,7 +151,7 @@ static struct dumperinfo dumper; /* our /* Context information for dump-debuggers. */ static struct pcb dumppcb; /* Registers. */ -static lwpid_t dumptid; /* Thread ID. */ +lwpid_t dumptid; /* Thread ID. */ static void poweroff_wait(void *, int); static void shutdown_halt(void *junk, int howto); From owner-svn-src-head@FreeBSD.ORG Tue May 22 08:33:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 90C231065672; Tue, 22 May 2012 08:33:15 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 789D58FC12; Tue, 22 May 2012 08:33:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4M8XFCI093460; Tue, 22 May 2012 08:33:15 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M8XFLM093453; Tue, 22 May 2012 08:33:15 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205220833.q4M8XFLM093453@svn.freebsd.org> From: Grzegorz Bernacki Date: Tue, 22 May 2012 08:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235778 - in head/sys: boot/fdt/dts conf dev/fdt geom sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 08:33:15 -0000 Author: gber Date: Tue May 22 08:33:14 2012 New Revision: 235778 URL: http://svn.freebsd.org/changeset/base/235778 Log: Add a new geom class which allows to divide NAND Flash chip into partitions. Partitions are created based on data in dts file which are extracted and interpreted by slicer. Obtained from: Semihalf Supported by: FreeBSD Foundation, Juniper Networks Added: head/sys/dev/fdt/fdt_slicer.c (contents, props changed) head/sys/geom/geom_flashmap.c (contents, props changed) head/sys/sys/slicer.h (contents, props changed) Modified: head/sys/boot/fdt/dts/sheevaplug.dts head/sys/conf/files head/sys/dev/fdt/fdt_common.h Modified: head/sys/boot/fdt/dts/sheevaplug.dts ============================================================================== --- head/sys/boot/fdt/dts/sheevaplug.dts Tue May 22 07:23:41 2012 (r235777) +++ head/sys/boot/fdt/dts/sheevaplug.dts Tue May 22 08:33:14 2012 (r235778) @@ -88,7 +88,16 @@ bank-width = <2>; device-width = <1>; + slice@0 { + reg = <0x0 0x200000>; + label = "u-boot"; + read-only; + }; + slice@200000 { + reg = <0x200000 0x1fe00000>; + label = "root"; + }; }; }; Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 22 07:23:41 2012 (r235777) +++ head/sys/conf/files Tue May 22 08:33:14 2012 (r235778) @@ -1223,6 +1223,7 @@ dev/fatm/if_fatm.c optional fatm pci dev/fb/splash.c optional splash dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_pci.c optional fdt pci +dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static dev/fdt/fdtbus.c optional fdt dev/fdt/simplebus.c optional fdt @@ -2388,6 +2389,7 @@ geom/geom_disk.c standard geom/geom_dump.c standard geom/geom_event.c standard geom/geom_fox.c optional geom_fox +geom/geom_flashmap.c optional fdt cfi | fdt nand geom/geom_io.c standard geom/geom_kern.c standard geom/geom_map.c optional geom_map Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Tue May 22 07:23:41 2012 (r235777) +++ head/sys/dev/fdt/fdt_common.h Tue May 22 08:33:14 2012 (r235778) @@ -32,6 +32,7 @@ #ifndef _FDT_COMMON_H_ #define _FDT_COMMON_H_ +#include #include #include #include Added: head/sys/dev/fdt/fdt_slicer.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/fdt/fdt_slicer.c Tue May 22 08:33:14 2012 (r235778) @@ -0,0 +1,115 @@ +/*- + * Copyright (c) 2012 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +#define DEBUG +#undef DEBUG + +#ifdef DEBUG +#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ + printf(fmt,##args); } while (0) +#else +#define debugf(fmt, args...) +#endif + +int +flash_fill_slices(device_t dev, struct flash_slice *slices, int *slices_num) +{ + char *slice_name; + phandle_t dt_node, dt_child; + u_long base, size; + int i; + ssize_t name_len; + + /* + * We assume the caller provides buffer for FLASH_SLICES_MAX_NUM + * flash_slice structures. + */ + if (slices == NULL) { + *slices_num = 0; + return (ENOMEM); + } + + dt_node = ofw_bus_get_node(dev); + for (dt_child = OF_child(dt_node), i = 0; dt_child != 0; + dt_child = OF_peer(dt_child)) { + + if (i == FLASH_SLICES_MAX_NUM) { + debugf("not enough buffer for slice i=%d\n", i); + break; + } + + /* + * Retrieve start and size of the slice. + */ + if (fdt_regsize(dt_child, &base, &size) != 0) { + debugf("error during processing reg property, i=%d\n", + i); + continue; + } + + if (size == 0) { + debugf("slice i=%d with no size\n", i); + continue; + } + + /* + * Retrieve label. + */ + name_len = OF_getprop_alloc(dt_child, "label", sizeof(char), + (void **)&slice_name); + if (name_len <= 0) { + /* Use node name if no label defined */ + name_len = OF_getprop_alloc(dt_child, "name", sizeof(char), + (void **)&slice_name); + if (name_len <= 0) { + debugf("slice i=%d with no name\n", i); + slice_name = NULL; + } + } + + /* + * Fill slice entry data. + */ + slices[i].base = base; + slices[i].size = size; + slices[i].label = slice_name; + i++; + } + + *slices_num = i; + return (0); +} Added: head/sys/geom/geom_flashmap.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/geom_flashmap.c Tue May 22 08:33:14 2012 (r235778) @@ -0,0 +1,255 @@ +/*- + * Copyright (c) 2012 Semihalf + * Copyright (c) 2009 Jakub Klama + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define FLASHMAP_CLASS_NAME "Flashmap" + +struct g_flashmap_slice { + off_t sl_start; + off_t sl_end; + const char *sl_name; + + STAILQ_ENTRY(g_flashmap_slice) sl_link; +}; + +STAILQ_HEAD(g_flashmap_head, g_flashmap_slice); + +static void g_flashmap_print(struct g_flashmap_slice *); +static int g_flashmap_modify(struct g_geom *, const char *, + int, struct g_flashmap_head *); +static int g_flashmap_start(struct bio *); +static int g_flashmap_ioctl(struct g_provider *, u_long, void *, + int, struct thread *); +static void g_flashmap_dumpconf(struct sbuf *, const char *, + struct g_geom *, struct g_consumer *, struct g_provider *); +static struct g_geom *g_flashmap_taste(struct g_class *, + struct g_provider *, int); +static void g_flashmap_config(struct gctl_req *, struct g_class *, + const char *); +static int g_flashmap_load(device_t, struct g_flashmap_head *); + +MALLOC_DECLARE(M_FLASHMAP); +MALLOC_DEFINE(M_FLASHMAP, "geom_flashmap", "GEOM flash memory slicer class"); + +static void +g_flashmap_print(struct g_flashmap_slice *slice) +{ + + printf("%08llx-%08llx: %s (%lluKB)\n", slice->sl_start, slice->sl_end, + slice->sl_name, (slice->sl_end - slice->sl_start) / 1024); +} + +static int +g_flashmap_modify(struct g_geom *gp, const char *devname, int secsize, + struct g_flashmap_head *slices) +{ + struct g_flashmap_slice *slice; + int i, error; + + g_topology_assert(); + + i = 0; + STAILQ_FOREACH(slice, slices, sl_link) { + if (bootverbose) { + printf("%s: slice ", devname); + g_flashmap_print(slice); + } + + error = g_slice_config(gp, i++, G_SLICE_CONFIG_CHECK, + slice->sl_start, + slice->sl_end - slice->sl_start + 1, + secsize, "%ss.%s", gp->name, slice->sl_name); + + if (error) + return (error); + } + + i = 0; + STAILQ_FOREACH(slice, slices, sl_link) { + error = g_slice_config(gp, i++, G_SLICE_CONFIG_SET, + slice->sl_start, + slice->sl_end - slice->sl_start + 1, + secsize, "%ss.%s", gp->name, slice->sl_name); + + if (error) + return (error); + } + + return (0); +} + +static int +g_flashmap_start(struct bio *bp) +{ + + return (0); +} + +static void +g_flashmap_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, + struct g_consumer *cp __unused, struct g_provider *pp) +{ + struct g_slicer *gsp; + + gsp = gp->softc; + g_slice_dumpconf(sb, indent, gp, cp, pp); +} + +static int +g_flashmap_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag, + struct thread *td) +{ + struct g_consumer *cp; + struct g_geom *gp; + + if (cmd != NAND_IO_GET_CHIP_PARAM) + return (ENOIOCTL); + + cp = LIST_FIRST(&pp->geom->consumer); + if (cp == NULL) + return (ENOIOCTL); + gp = cp->provider->geom; + if (gp->ioctl == NULL) + return (ENOIOCTL); + + return (gp->ioctl(cp->provider, cmd, data, fflag, td)); +} + + +static struct g_geom * +g_flashmap_taste(struct g_class *mp, struct g_provider *pp, int flags) +{ + struct g_geom *gp = NULL; + struct g_consumer *cp; + struct g_flashmap_head head; + struct g_flashmap_slice *slice, *slice_temp; + device_t dev; + int nslices, size; + + g_trace(G_T_TOPOLOGY, "flashmap_taste(%s,%s)", mp->name, pp->name); + g_topology_assert(); + + if (flags == G_TF_NORMAL && + !strcmp(pp->geom->class->name, FLASHMAP_CLASS_NAME)) + return (NULL); + + gp = g_slice_new(mp, FLASH_SLICES_MAX_NUM, pp, &cp, NULL, 0, + g_flashmap_start); + if (gp == NULL) + return (NULL); + + STAILQ_INIT(&head); + + do { + size = sizeof(device_t); + if (g_io_getattr("NAND::device", cp, &size, &dev)) + break; + + nslices = g_flashmap_load(dev, &head); + if (nslices == 0) + break; + + g_flashmap_modify(gp, cp->provider->name, + cp->provider->sectorsize, &head); + } while (0); + + g_access(cp, -1, 0, 0); + + STAILQ_FOREACH_SAFE(slice, &head, sl_link, slice_temp) { + free(slice, M_FLASHMAP); + } + + if (LIST_EMPTY(&gp->provider)) { + g_slice_spoiled(cp); + return (NULL); + } + return (gp); +} + +static void +g_flashmap_config(struct gctl_req *req, struct g_class *mp, const char *verb) +{ + + gctl_error(req, "unknown config verb"); +} + +static int +g_flashmap_load(device_t dev, struct g_flashmap_head *head) +{ + struct flash_slice *slices; + struct g_flashmap_slice *slice; + uint32_t i, buf_size; + int nslices = 0; + + buf_size = sizeof(struct flash_slice) * FLASH_SLICES_MAX_NUM; + slices = malloc(buf_size, M_FLASHMAP, M_WAITOK | M_ZERO); + if (flash_fill_slices(dev, slices, &nslices) == 0) { + for (i = 0; i < nslices; i++) { + slice = malloc(sizeof(struct g_flashmap_slice), + M_FLASHMAP, M_WAITOK); + + slice->sl_name = slices[i].label; + slice->sl_start = slices[i].base; + slice->sl_end = slices[i].base + slices[i].size - 1; + + STAILQ_INSERT_TAIL(head, slice, sl_link); + } + } + + free(slices, M_FLASHMAP); + return (nslices); +} + +static struct g_class g_flashmap_class = { + .name = FLASHMAP_CLASS_NAME, + .version = G_VERSION, + .taste = g_flashmap_taste, + .dumpconf = g_flashmap_dumpconf, + .ioctl = g_flashmap_ioctl, + .ctlreq = g_flashmap_config, +}; + +DECLARE_GEOM_CLASS(g_flashmap_class, g_flashmap); Added: head/sys/sys/slicer.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/slicer.h Tue May 22 08:33:14 2012 (r235778) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2012 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _FLASH_SLICER_H_ +#define _FLASH_SLICER_H_ + +#include + +#define FLASH_SLICES_MAX_NUM 8 +#define FLASH_SLICES_MAX_NAME_LEN (32 + 1) + +#define FLASH_SLICES_FLAG_NONE 0 +#define FLASH_SLICES_FLAG_RO 1 /* Read only */ + +struct flash_slice { + off_t base; + off_t size; + char *label; + unsigned int flags; +}; + +#ifdef _KERNEL +int flash_fill_slices(device_t, struct flash_slice *, int *); +#endif /* _KERNEL */ + +#endif /* _FLASH_SLICER_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue May 22 09:27:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 124271065673; Tue, 22 May 2012 09:27:58 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F23FF8FC16; Tue, 22 May 2012 09:27:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4M9Rvfh094766; Tue, 22 May 2012 09:27:57 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M9RvOc094764; Tue, 22 May 2012 09:27:57 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205220927.q4M9RvOc094764@svn.freebsd.org> From: Grzegorz Bernacki Date: Tue, 22 May 2012 09:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235779 - head/sys/boot/fdt/dts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 09:27:58 -0000 Author: gber Date: Tue May 22 09:27:57 2012 New Revision: 235779 URL: http://svn.freebsd.org/changeset/base/235779 Log: Divide nand flash for DB6281 into two partitions. One for u-boot and second one for general use. Obtained from: Semihalf Supported by: FreeBSD Foundation, Juniper Networks Modified: head/sys/boot/fdt/dts/db88f6281.dts Modified: head/sys/boot/fdt/dts/db88f6281.dts ============================================================================== --- head/sys/boot/fdt/dts/db88f6281.dts Tue May 22 08:33:14 2012 (r235778) +++ head/sys/boot/fdt/dts/db88f6281.dts Tue May 22 09:27:57 2012 (r235779) @@ -89,7 +89,16 @@ bank-width = <2>; device-width = <1>; + slice@0 { + reg = <0x0 0x200000>; + label = "u-boot"; + read-only; + }; + slice@200000 { + reg = <0x200000 0x7e00000>; + label = "root"; + }; }; }; From owner-svn-src-head@FreeBSD.ORG Tue May 22 09:59:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 724A8106566C; Tue, 22 May 2012 09:59:50 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D7C88FC0C; Tue, 22 May 2012 09:59:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4M9xoke095554; Tue, 22 May 2012 09:59:50 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4M9xoB2095552; Tue, 22 May 2012 09:59:50 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <201205220959.q4M9xoB2095552@svn.freebsd.org> From: Hartmut Brandt Date: Tue, 22 May 2012 09:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235780 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 09:59:50 -0000 Author: harti Date: Tue May 22 09:59:49 2012 New Revision: 235780 URL: http://svn.freebsd.org/changeset/base/235780 Log: Fix a compilation error with some compilers: __attribute__ requires two parenthesis for its argument, but instead of using __attribute__ directly, use the appropriate __nonnull macro from cdefs.h. Modified: head/include/malloc_np.h Modified: head/include/malloc_np.h ============================================================================== --- head/include/malloc_np.h Tue May 22 09:27:57 2012 (r235779) +++ head/include/malloc_np.h Tue May 22 09:59:49 2012 (r235780) @@ -55,13 +55,11 @@ int mallctlbymib(const size_t *mib, size #define ALLOCM_ERR_OOM 1 #define ALLOCM_ERR_NOT_MOVED 2 -int allocm(void **ptr, size_t *rsize, size_t size, int flags) - __attribute__(nonnull(1)); +int allocm(void **ptr, size_t *rsize, size_t size, int flags) __nonnull(1); int rallocm(void **ptr, size_t *rsize, size_t size, size_t extra, - int flags) __attribute__(nonnull(1)); -int sallocm(const void *ptr, size_t *rsize, int flags) - __attribute__(nonnull(1)); -int dallocm(void *ptr, int flags) __attribute__(nonnull(1)); + int flags) __nonnull(1); +int sallocm(const void *ptr, size_t *rsize, int flags) __nonnull(1); +int dallocm(void *ptr, int flags) __nonnull(1); int nallocm(size_t *rsize, size_t size, int flags); __END_DECLS From owner-svn-src-head@FreeBSD.ORG Tue May 22 10:22:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12870106566C; Tue, 22 May 2012 10:22:56 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 9928F8FC12; Tue, 22 May 2012 10:22:55 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 009D86AB9; Tue, 22 May 2012 10:22:54 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 9A4869239; Tue, 22 May 2012 12:22:54 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Baptiste Daroussin References: <201205211331.q4LDVRvB060077@svn.freebsd.org> Date: Tue, 22 May 2012 12:22:54 +0200 In-Reply-To: <201205211331.q4LDVRvB060077@svn.freebsd.org> (Baptiste Daroussin's message of "Mon, 21 May 2012 13:31:27 +0000 (UTC)") Message-ID: <86likkpla9.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 10:22:56 -0000 Baptiste Daroussin writes: > Log: > Import byacc from invisible island, it brings us lots of compatibilitie= s with > bison, keeping full compatibility with our previous yacc > implementation. This commit broke the build, in large part because Baptiste tested with Clang instead of GCC, and GCC generates a warning when compiling the generated code. Baptiste has a patch ready to commit, currently undergoing review by myself and other interested parties. I chose not to ask Baptiste to revert the commit, because it is a complex commit that copies some files from a vendor branch into contrib and removes others from the usr.bin/yacc, and I wasn't sure that reverting it wouldn't cause trouble with merge tracking. Lessons learned: 1) always test a *stock* build before committing: % cd /usr/src && env __MAKE_CONF=3D/dev/null make buildworld 2) the contrib part and the usr.bin part should probably have been committed separately. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue May 22 10:51:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EAD5106566C; Tue, 22 May 2012 10:51:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id E2C088FC14; Tue, 22 May 2012 10:51:53 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4MApiUd012829 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 May 2012 20:51:45 +1000 Date: Tue, 22 May 2012 20:51:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper In-Reply-To: Message-ID: <20120522183847.M1344@besplex.bde.org> References: <201205220128.q4M1SXPv081576@svn.freebsd.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-2035810234-1337683904=:1344" Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235767 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 10:51:54 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-2035810234-1337683904=:1344 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 21 May 2012, Garrett Cooper wrote: > On Mon, May 21, 2012 at 6:28 PM, Kevin Lo wrote: >> Author: kevlo >> Date: Tue May 22 01:28:32 2012 >> New Revision: 235767 >> URL: http://svn.freebsd.org/changeset/base/235767 >> >> Log: >> =A0Add missing header needed by free() >> >> =A0Reported by: =A0tinderbox Please don't use binary characters in mail. > Thank you for saving my mailbox :)!!! > > FWIW, it's weird because my STABLE-9 box didn't reproduce this. This seems to be a bug in both nsparser.y and the new yacc: - new yacc: it is incompatible. Old yacc includes stdlib.h and string.h as the first thing in the generated file, so the C code copied from the .y part sees them too. New yacc puts more its code including its all includes (which still involve stdlib.h) at the end of the generated file. Including stdlib.h nearly first is from Lite2 (skeleton.c 1.7 in 1997). Much later, FreeBSD moved it to the very first thing in the generated file, so as to use namespace pollution (__unused) from it early. __unused was ifdefed and was defined by the yacc skeleton if didn't define it. It took much churn to produce this, but it seems to have been garbage, since old yacc didn't actually generate any use of __unused. The definition was apparently compatibilty cruft to hide unportabilities in .y files that use __unused (I guess these failed for bootstrapping). New yacc doesn't define __unused. - nsparser.y: it uses free() but never declared it. It depended on namespace pollution in the yacc code, and this pollution being in a particular order. The yyparse() incompatibilities seem to be bugs on both sides too: - Old yacc didn't declare yyparse() automatically, so .y files had to do it, but probably shouldn't have. - New yacc still doesn't declare yylex() or yyerror() automatically, so applications still have to declare them. - Some of these may be more the responsibility of the yacc library (to supply defaults) than others. I couldn't see who is required to declare them in POSIX.1-2001. However, a bad example in POSIX.1 has "extern int yyparse();" in main() just before calling yyparse(). Badness in this example include several style bugs and the declaration being incomplete (missing "void"). Old yacc has about 20 lines of ifdefs half just to supply this "void" for STDC but not for K&R. New yacc no longer supports K&R, at least here, but it still has 11 lines of ifdefs to get the declaration of yyparse() right for bison compatibility). I don't know if the badness includes having the home made declaration. Nearby bugs: all CSRG and FreeBSD changes including copyrights and history seem to have been lost. Just after the old include of stdlib.h, skeleton.c used to produce a string yyrcsid[] with __FBSDID() for skeleton.c itself in it. New yacc generates a string yysccsid with a hard-coded berkeley 1993 id in it, and the name in this id doesn't even match the file name (it is "yaccpar"). Another FreeBSD change was to remove this bogus id from the generated file. Some relevant FreeBSD changes: % Index: skeleton.c % =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D % RCS file: /home/ncvs/src/usr.bin/yacc/skeleton.c,v % retrieving revision 1.1.1.2 % retrieving revision 1.37 % diff -u -2 -r1.1.1.2 -r1.37 % --- skeleton.c=096 Jan 1997 03:03:46 -0000=091.1.1.2 % +++ skeleton.c=0912 Feb 2003 18:03:55 -0000=091.37 % @@ -35,7 +35,12 @@ % */ %=20 % +#if 0 % #ifndef lint % static char sccsid[] =3D "@(#)skeleton.c=095.8 (Berkeley) 4/29/95"; % -#endif /* not lint */ % +#endif % +#endif FreeBSD normally comments out vendor ids like this. 5.8 is from Lite2; Lite1 had 5.7. New yacc doesn't have any of this. It apparently started from older yacc (before Lite1; indeed, it agrees with the FreeBSD-1 =3D=3D = Net/2 version in not having any CSRG copyrights or this sccsid). % + % +#include % +__FBSDID("$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.37 2003/02/12 18:03:= 55 davidc Exp $"); FreeBSD normally adds this to source files. Except in contrib. yacc is now mostly in contrib, although it hasn't changed all that much. %=20 % #include "defs.h" % @@ -53,31 +58,42 @@ % /* are conditional.=09=09=09=09=09=09=09*/ %=20 % -char *banner[] =3D % +const char *banner[] =3D New yacc has this change too. % { % + "#include ", See above. % "#ifndef lint", % - "static char yysccsid[] =3D \"@(#)yaccpar=091.9 (Berkeley) 02/21/93\= ";", Was in Net/2 (?), FreeBSD-1, Lite1 and Lite2. Came back with new yacc. It's interesting that "yaccpar 1.9 (Berkeley) 1.9 02/21/93" is only 3 month= s before the correct id "skeleton.c 5.7 (Berkeley) 5/24/93". Hmm, the FreeBSD-1 history is even more instructive than I first thought. FreeBSD-1 started with the CSRG version of skeleton.c on 1993/06/12. This had CSRG copyrights and ids, and yaccpar was at 1.8 01/20/90. But this was upgraded to "the newest version on vangogh.cs.berkeley.edu" 17 days later on 1993/06/29. This version has no CSRG copyrights or ids, except for the above rotted one for yaccpar (the 1.9 02/21/93 one). I think it was only missing CSRG copyrights and ids because CSRG only added these to full releases. This resulted in the version in FreeBSD-1 not having any copyright notices inside most files, and none for the directory either. The new byacc seems to be the same as the older yacc here too. % + "#ifdef __unused", % + "__unused", % + "#endif", % + "static char const ", % + "yyrcsid[] =3D \"$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.37 2003/0= 2/12 18:03:55 davidc Exp $\";", % "#endif", % - "#include ", See above. % "#define YYBYACC 1", % "#define YYMAJOR 1", % "#define YYMINOR 9", % - "#define yyclearin (yychar=3D(-1))", % + "#define YYLEX yylex()", % + "#define YYEMPTY -1", % + "#define yyclearin (yychar=3D(YYEMPTY))", % "#define yyerrok (yyerrflag=3D0)", % - "#define YYRECOVERING (yyerrflag!=3D0)", % + "#define YYRECOVERING() (yyerrflag!=3D0)", % + "#if defined(__cplusplus) || __STDC__", % + "static int yygrowstack(void);", % + "#else", % + "static int yygrowstack();", % + "#endif", % 0 % }; Hrmph. It was FreeBSD that added the STDC ifdefs, to avoid breaking support for generating K&R code (older yacc generated fairly pure K&R code without even "const"). For yygrowstack(), this was sloppy: it only changed the declaration -- the function body still doesn't say "void". % @@ -151,13 +174,35 @@ % "#define YYACCEPT goto yyaccept", % "#define YYERROR goto yyerrlab", % + "", % + "#ifndef YYPARSE_PARAM", % + "#if defined(__cplusplus) || __STDC__", % + "#define YYPARSE_PARAM_ARG void", % + "#define YYPARSE_PARAM_DECL", % + "#else=09/* ! ANSI-C/C++ */", % + "#define YYPARSE_PARAM_ARG", % + "#define YYPARSE_PARAM_DECL", % + "#endif=09/* ANSI-C/C++ */", % + "#else=09/* YYPARSE_PARAM */", % + "#ifndef YYPARSE_PARAM_TYPE", % + "#define YYPARSE_PARAM_TYPE void *", % + "#endif", % + "#if defined(__cplusplus) || __STDC__", % + "#define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM", % + "#define YYPARSE_PARAM_DECL", % + "#else=09/* ! ANSI-C/C++ */", % + "#define YYPARSE_PARAM_ARG YYPARSE_PARAM", % + "#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;", % + "#endif=09/* ANSI-C/C++ */", % + "#endif=09/* ! YYPARSE_PARAM */", % + "", % "int", % - "yyparse()", % + "yyparse (YYPARSE_PARAM_ARG)", % + " YYPARSE_PARAM_DECL", % "{", % - " register int yym, yyn, yystate;", % + " int yym, yyn, yystate;", % "#if YYDEBUG", % - " register char *yys;", % - " extern char *getenv();", % + " const char *yys;", % "", % - " if (yys =3D getenv(\"YYDEBUG\"))", % + " if ((yys =3D getenv(\"YYDEBUG\")))", % " {", % " yyn =3D *yys;", The STDC support was especially messy for yyparse(). Bruce --0-2035810234-1337683904=:1344-- From owner-svn-src-head@FreeBSD.ORG Tue May 22 10:54:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F421C106564A; Tue, 22 May 2012 10:54:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE7668FC08; Tue, 22 May 2012 10:54:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MAsgNx099494; Tue, 22 May 2012 10:54:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MAsgsm099492; Tue, 22 May 2012 10:54:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205221054.q4MAsgsm099492@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 22 May 2012 10:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235781 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 10:54:43 -0000 Author: trasz Date: Tue May 22 10:54:42 2012 New Revision: 235781 URL: http://svn.freebsd.org/changeset/base/235781 Log: Fix enforcement of file size limit with O_APPEND on ZFS. vn_rlimit_fsize takes uio->uio_offset and uio->uio_resid into account when determining whether given write would exceed RLIMIT_FSIZE. When APPEND flag is specified, ZFS updates uio->uio_offset to point to the end of file. But this happens after a call to vn_rlimit_fsize, so vn_rlimit_fsize check can be rendered ineffective by thread that opens some file with O_APPEND and lseeks below RLIMIT_FSIZE before calling write. Submitted by: Mateusz Guzik MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue May 22 09:59:49 2012 (r235780) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue May 22 10:54:42 2012 (r235781) @@ -838,6 +838,12 @@ zfs_write(vnode_t *vp, uio_t *uio, int i rl = zfs_range_lock(zp, woff, n, RL_WRITER); } + if (vn_rlimit_fsize(vp, uio, uio->uio_td)) { + zfs_range_unlock(rl); + ZFS_EXIT(zfsvfs); + return (EFBIG); + } + if (woff >= limit) { zfs_range_unlock(rl); ZFS_EXIT(zfsvfs); @@ -5696,9 +5702,6 @@ zfs_freebsd_write(ap) } */ *ap; { - if (vn_rlimit_fsize(ap->a_vp, ap->a_uio, ap->a_uio->uio_td)) - return (EFBIG); - return (zfs_write(ap->a_vp, ap->a_uio, ioflags(ap->a_ioflag), ap->a_cred, NULL)); } From owner-svn-src-head@FreeBSD.ORG Tue May 22 10:59:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27174106566B; Tue, 22 May 2012 10:59:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EADB8FC16; Tue, 22 May 2012 10:59:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MAxRpd099646; Tue, 22 May 2012 10:59:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MAxQRM099642; Tue, 22 May 2012 10:59:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205221059.q4MAxQRM099642@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 May 2012 10:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235782 - in head/sys: dev/agp modules/agp sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 10:59:27 -0000 Author: kib Date: Tue May 22 10:59:26 2012 New Revision: 235782 URL: http://svn.freebsd.org/changeset/base/235782 Log: A rewrite of the i810 bits of the agp(4) driver. New driver supports operations required by GEMified i915.ko. It also attaches to SandyBridge and IvyBridge CPU northbridges now. Sponsored by: The FreeBSD Foundation MFC after: 1 month Added: head/sys/dev/agp/agp_i810.h (contents, props changed) Modified: head/sys/dev/agp/agp.c head/sys/dev/agp/agp_i810.c head/sys/dev/agp/agp_if.m head/sys/dev/agp/agppriv.h head/sys/dev/agp/agpreg.h head/sys/dev/agp/agpvar.h head/sys/modules/agp/Makefile head/sys/sys/agpio.h Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Tue May 22 10:54:42 2012 (r235781) +++ head/sys/dev/agp/agp.c Tue May 22 10:59:26 2012 (r235782) @@ -239,7 +239,8 @@ agp_generic_attach(device_t dev) if (memsize <= agp_max[i][0]) break; } - if (i == agp_max_size) i = agp_max_size - 1; + if (i == agp_max_size) + i = agp_max_size - 1; sc->as_maxmem = agp_max[i][1] << 20U; /* @@ -803,6 +804,13 @@ agp_unbind_user(device_t dev, agp_unbind } static int +agp_chipset_flush(device_t dev) +{ + + return (AGP_CHIPSET_FLUSH(dev)); +} + +static int agp_open(struct cdev *kdev, int oflags, int devtype, struct thread *td) { device_t dev = kdev->si_drv1; @@ -869,6 +877,8 @@ agp_ioctl(struct cdev *kdev, u_long cmd, case AGPIOC_UNBIND: return agp_unbind_user(dev, (agp_unbind *)data); + case AGPIOC_CHIPSET_FLUSH: + return agp_chipset_flush(dev); } return EINVAL; Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Tue May 22 10:54:42 2012 (r235781) +++ head/sys/dev/agp/agp_i810.c Tue May 22 10:59:26 2012 (r235782) @@ -1,8 +1,12 @@ /*- * Copyright (c) 2000 Doug Rabson * Copyright (c) 2000 Ruslan Ermilov + * Copyright (c) 2011 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -28,6 +32,9 @@ /* * Fixes for 830/845G support: David Dawes * 852GM/855GM/865G support added by David Dawes + * + * This is generic Intel GTT handling code, morphed from the AGP + * bridge code. */ #include @@ -35,10 +42,17 @@ __FBSDID("$FreeBSD$"); #include "opt_bus.h" +#if 0 +#define KTR_AGP_I810 KTR_DEV +#else +#define KTR_AGP_I810 0 +#endif + #include #include #include #include +#include #include #include #include @@ -47,8 +61,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include #include #include @@ -63,6 +79,88 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_AGP); +struct agp_i810_match; + +static int agp_i810_check_active(device_t bridge_dev); +static int agp_i830_check_active(device_t bridge_dev); +static int agp_i915_check_active(device_t bridge_dev); +static int agp_sb_check_active(device_t bridge_dev); + +static void agp_82852_set_desc(device_t dev, + const struct agp_i810_match *match); +static void agp_i810_set_desc(device_t dev, const struct agp_i810_match *match); + +static void agp_i810_dump_regs(device_t dev); +static void agp_i830_dump_regs(device_t dev); +static void agp_i855_dump_regs(device_t dev); +static void agp_i915_dump_regs(device_t dev); +static void agp_i965_dump_regs(device_t dev); +static void agp_sb_dump_regs(device_t dev); + +static int agp_i810_get_stolen_size(device_t dev); +static int agp_i830_get_stolen_size(device_t dev); +static int agp_i915_get_stolen_size(device_t dev); +static int agp_sb_get_stolen_size(device_t dev); + +static int agp_i810_get_gtt_mappable_entries(device_t dev); +static int agp_i830_get_gtt_mappable_entries(device_t dev); +static int agp_i915_get_gtt_mappable_entries(device_t dev); + +static int agp_i810_get_gtt_total_entries(device_t dev); +static int agp_i965_get_gtt_total_entries(device_t dev); +static int agp_gen5_get_gtt_total_entries(device_t dev); +static int agp_sb_get_gtt_total_entries(device_t dev); + +static int agp_i810_install_gatt(device_t dev); +static int agp_i830_install_gatt(device_t dev); + +static void agp_i810_deinstall_gatt(device_t dev); +static void agp_i830_deinstall_gatt(device_t dev); + +static void agp_i810_install_gtt_pte(device_t dev, u_int index, + vm_offset_t physical, int flags); +static void agp_i830_install_gtt_pte(device_t dev, u_int index, + vm_offset_t physical, int flags); +static void agp_i915_install_gtt_pte(device_t dev, u_int index, + vm_offset_t physical, int flags); +static void agp_i965_install_gtt_pte(device_t dev, u_int index, + vm_offset_t physical, int flags); +static void agp_g4x_install_gtt_pte(device_t dev, u_int index, + vm_offset_t physical, int flags); +static void agp_sb_install_gtt_pte(device_t dev, u_int index, + vm_offset_t physical, int flags); + +static void agp_i810_write_gtt(device_t dev, u_int index, uint32_t pte); +static void agp_i915_write_gtt(device_t dev, u_int index, uint32_t pte); +static void agp_i965_write_gtt(device_t dev, u_int index, uint32_t pte); +static void agp_g4x_write_gtt(device_t dev, u_int index, uint32_t pte); +static void agp_sb_write_gtt(device_t dev, u_int index, uint32_t pte); + +static u_int32_t agp_i810_read_gtt_pte(device_t dev, u_int index); +static u_int32_t agp_i915_read_gtt_pte(device_t dev, u_int index); +static u_int32_t agp_i965_read_gtt_pte(device_t dev, u_int index); +static u_int32_t agp_g4x_read_gtt_pte(device_t dev, u_int index); + +static vm_paddr_t agp_i810_read_gtt_pte_paddr(device_t dev, u_int index); +static vm_paddr_t agp_i915_read_gtt_pte_paddr(device_t dev, u_int index); +static vm_paddr_t agp_sb_read_gtt_pte_paddr(device_t dev, u_int index); + +static int agp_i810_set_aperture(device_t dev, u_int32_t aperture); +static int agp_i830_set_aperture(device_t dev, u_int32_t aperture); +static int agp_i915_set_aperture(device_t dev, u_int32_t aperture); + +static int agp_i810_chipset_flush_setup(device_t dev); +static int agp_i915_chipset_flush_setup(device_t dev); +static int agp_i965_chipset_flush_setup(device_t dev); + +static void agp_i810_chipset_flush_teardown(device_t dev); +static void agp_i915_chipset_flush_teardown(device_t dev); +static void agp_i965_chipset_flush_teardown(device_t dev); + +static void agp_i810_chipset_flush(device_t dev); +static void agp_i830_chipset_flush(device_t dev); +static void agp_i915_chipset_flush(device_t dev); + enum { CHIP_I810, /* i810/i815 */ CHIP_I830, /* 830M/845G */ @@ -72,6 +170,7 @@ enum { CHIP_G33, /* G33/Q33/Q35 */ CHIP_IGD, /* Pineview */ CHIP_G4X, /* G45/Q45 */ + CHIP_SB, /* SandyBridge */ }; /* The i810 through i855 have the registers at BAR 1, and the GATT gets @@ -96,19 +195,308 @@ static struct resource_spec agp_i965_res { -1, 0 } }; +static struct resource_spec agp_g4x_res_spec[] = { + { SYS_RES_MEMORY, AGP_G4X_MMADR, RF_ACTIVE | RF_SHAREABLE }, + { SYS_RES_MEMORY, AGP_G4X_GTTADR, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0 } +}; + struct agp_i810_softc { struct agp_softc agp; u_int32_t initial_aperture; /* aperture size at startup */ struct agp_gatt *gatt; - int chiptype; /* i810-like or i830 */ u_int32_t dcache_size; /* i810 only */ - u_int32_t stolen; /* number of i830/845 gtt entries for stolen memory */ + u_int32_t stolen; /* number of i830/845 gtt + entries for stolen memory */ + u_int stolen_size; /* BIOS-reserved graphics memory */ + u_int gtt_total_entries; /* Total number of gtt ptes */ + u_int gtt_mappable_entries; /* Number of gtt ptes mappable by CPU */ device_t bdev; /* bridge device */ - void *argb_cursor; /* contigmalloc area for ARGB cursor */ - - struct resource_spec * sc_res_spec; struct resource *sc_res[2]; + const struct agp_i810_match *match; + int sc_flush_page_rid; + struct resource *sc_flush_page_res; + void *sc_flush_page_vaddr; + int sc_bios_allocated_flush_page; +}; + +static device_t intel_agp; + +struct agp_i810_driver { + int chiptype; + int gen; + int busdma_addr_mask_sz; + struct resource_spec *res_spec; + int (*check_active)(device_t); + void (*set_desc)(device_t, const struct agp_i810_match *); + void (*dump_regs)(device_t); + int (*get_stolen_size)(device_t); + int (*get_gtt_total_entries)(device_t); + int (*get_gtt_mappable_entries)(device_t); + int (*install_gatt)(device_t); + void (*deinstall_gatt)(device_t); + void (*write_gtt)(device_t, u_int, uint32_t); + void (*install_gtt_pte)(device_t, u_int, vm_offset_t, int); + u_int32_t (*read_gtt_pte)(device_t, u_int); + vm_paddr_t (*read_gtt_pte_paddr)(device_t , u_int); + int (*set_aperture)(device_t, u_int32_t); + int (*chipset_flush_setup)(device_t); + void (*chipset_flush_teardown)(device_t); + void (*chipset_flush)(device_t); +}; + +static const struct agp_i810_driver agp_i810_i810_driver = { + .chiptype = CHIP_I810, + .gen = 1, + .busdma_addr_mask_sz = 32, + .res_spec = agp_i810_res_spec, + .check_active = agp_i810_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i810_dump_regs, + .get_stolen_size = agp_i810_get_stolen_size, + .get_gtt_mappable_entries = agp_i810_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i810_get_gtt_total_entries, + .install_gatt = agp_i810_install_gatt, + .deinstall_gatt = agp_i810_deinstall_gatt, + .write_gtt = agp_i810_write_gtt, + .install_gtt_pte = agp_i810_install_gtt_pte, + .read_gtt_pte = agp_i810_read_gtt_pte, + .read_gtt_pte_paddr = agp_i810_read_gtt_pte_paddr, + .set_aperture = agp_i810_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i810_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_i815_driver = { + .chiptype = CHIP_I810, + .gen = 2, + .busdma_addr_mask_sz = 32, + .res_spec = agp_i810_res_spec, + .check_active = agp_i810_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i810_dump_regs, + .get_stolen_size = agp_i810_get_stolen_size, + .get_gtt_mappable_entries = agp_i830_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i810_get_gtt_total_entries, + .install_gatt = agp_i810_install_gatt, + .deinstall_gatt = agp_i810_deinstall_gatt, + .write_gtt = agp_i810_write_gtt, + .install_gtt_pte = agp_i810_install_gtt_pte, + .read_gtt_pte = agp_i810_read_gtt_pte, + .read_gtt_pte_paddr = agp_i810_read_gtt_pte_paddr, + .set_aperture = agp_i810_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i830_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_i830_driver = { + .chiptype = CHIP_I830, + .gen = 2, + .busdma_addr_mask_sz = 32, + .res_spec = agp_i810_res_spec, + .check_active = agp_i830_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i830_dump_regs, + .get_stolen_size = agp_i830_get_stolen_size, + .get_gtt_mappable_entries = agp_i830_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i810_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i810_write_gtt, + .install_gtt_pte = agp_i830_install_gtt_pte, + .read_gtt_pte = agp_i810_read_gtt_pte, + .read_gtt_pte_paddr = agp_i810_read_gtt_pte_paddr, + .set_aperture = agp_i830_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i830_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_i855_driver = { + .chiptype = CHIP_I855, + .gen = 2, + .busdma_addr_mask_sz = 32, + .res_spec = agp_i810_res_spec, + .check_active = agp_i830_check_active, + .set_desc = agp_82852_set_desc, + .dump_regs = agp_i855_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i810_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i810_write_gtt, + .install_gtt_pte = agp_i830_install_gtt_pte, + .read_gtt_pte = agp_i810_read_gtt_pte, + .read_gtt_pte_paddr = agp_i810_read_gtt_pte_paddr, + .set_aperture = agp_i830_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i830_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_i865_driver = { + .chiptype = CHIP_I855, + .gen = 2, + .busdma_addr_mask_sz = 32, + .res_spec = agp_i810_res_spec, + .check_active = agp_i830_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i855_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i810_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i810_write_gtt, + .install_gtt_pte = agp_i830_install_gtt_pte, + .read_gtt_pte = agp_i810_read_gtt_pte, + .read_gtt_pte_paddr = agp_i810_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i830_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_i915_driver = { + .chiptype = CHIP_I915, + .gen = 3, + .busdma_addr_mask_sz = 32, + .res_spec = agp_i915_res_spec, + .check_active = agp_i915_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i915_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i810_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i915_write_gtt, + .install_gtt_pte = agp_i915_install_gtt_pte, + .read_gtt_pte = agp_i915_read_gtt_pte, + .read_gtt_pte_paddr = agp_i915_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i915_chipset_flush_setup, + .chipset_flush_teardown = agp_i915_chipset_flush_teardown, + .chipset_flush = agp_i915_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_g965_driver = { + .chiptype = CHIP_I965, + .gen = 4, + .busdma_addr_mask_sz = 36, + .res_spec = agp_i965_res_spec, + .check_active = agp_i915_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i965_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i965_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i965_write_gtt, + .install_gtt_pte = agp_i965_install_gtt_pte, + .read_gtt_pte = agp_i965_read_gtt_pte, + .read_gtt_pte_paddr = agp_i915_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i965_chipset_flush_setup, + .chipset_flush_teardown = agp_i965_chipset_flush_teardown, + .chipset_flush = agp_i915_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_g33_driver = { + .chiptype = CHIP_G33, + .gen = 3, + .busdma_addr_mask_sz = 36, + .res_spec = agp_i915_res_spec, + .check_active = agp_i915_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i965_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i965_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i915_write_gtt, + .install_gtt_pte = agp_i915_install_gtt_pte, + .read_gtt_pte = agp_i915_read_gtt_pte, + .read_gtt_pte_paddr = agp_i915_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i965_chipset_flush_setup, + .chipset_flush_teardown = agp_i965_chipset_flush_teardown, + .chipset_flush = agp_i915_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_igd_driver = { + .chiptype = CHIP_IGD, + .gen = 3, + .busdma_addr_mask_sz = 36, + .res_spec = agp_i915_res_spec, + .check_active = agp_i915_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i915_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_i965_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_i915_write_gtt, + .install_gtt_pte = agp_i915_install_gtt_pte, + .read_gtt_pte = agp_i915_read_gtt_pte, + .read_gtt_pte_paddr = agp_i915_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i965_chipset_flush_setup, + .chipset_flush_teardown = agp_i965_chipset_flush_teardown, + .chipset_flush = agp_i915_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_g4x_driver = { + .chiptype = CHIP_G4X, + .gen = 5, + .busdma_addr_mask_sz = 36, + .res_spec = agp_i965_res_spec, + .check_active = agp_i915_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_i965_dump_regs, + .get_stolen_size = agp_i915_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_gen5_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_g4x_write_gtt, + .install_gtt_pte = agp_g4x_install_gtt_pte, + .read_gtt_pte = agp_g4x_read_gtt_pte, + .read_gtt_pte_paddr = agp_i915_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i965_chipset_flush_setup, + .chipset_flush_teardown = agp_i965_chipset_flush_teardown, + .chipset_flush = agp_i915_chipset_flush, +}; + +static const struct agp_i810_driver agp_i810_sb_driver = { + .chiptype = CHIP_SB, + .gen = 6, + .busdma_addr_mask_sz = 40, + .res_spec = agp_g4x_res_spec, + .check_active = agp_sb_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_sb_dump_regs, + .get_stolen_size = agp_sb_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_sb_get_gtt_total_entries, + .install_gatt = agp_i830_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_sb_write_gtt, + .install_gtt_pte = agp_sb_install_gtt_pte, + .read_gtt_pte = agp_g4x_read_gtt_pte, + .read_gtt_pte_paddr = agp_sb_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i810_chipset_flush, }; /* For adding new devices, devid is the id of the graphics controller @@ -118,75 +506,232 @@ struct agp_i810_softc { */ static const struct agp_i810_match { int devid; - int chiptype; - int bridge_offset; char *name; + const struct agp_i810_driver *driver; } agp_i810_matches[] = { - {0x71218086, CHIP_I810, 0x00010000, - "Intel 82810 (i810 GMCH) SVGA controller"}, - {0x71238086, CHIP_I810, 0x00010000, - "Intel 82810-DC100 (i810-DC100 GMCH) SVGA controller"}, - {0x71258086, CHIP_I810, 0x00010000, - "Intel 82810E (i810E GMCH) SVGA controller"}, - {0x11328086, CHIP_I810, 0x00020000, - "Intel 82815 (i815 GMCH) SVGA controller"}, - {0x35778086, CHIP_I830, 0x00020000, - "Intel 82830M (830M GMCH) SVGA controller"}, - {0x25628086, CHIP_I830, 0x00020000, - "Intel 82845M (845M GMCH) SVGA controller"}, - {0x35828086, CHIP_I855, 0x00020000, - "Intel 82852/855GM SVGA controller"}, - {0x25728086, CHIP_I855, 0x00020000, - "Intel 82865G (865G GMCH) SVGA controller"}, - {0x25828086, CHIP_I915, 0x00020000, - "Intel 82915G (915G GMCH) SVGA controller"}, - {0x258A8086, CHIP_I915, 0x00020000, - "Intel E7221 SVGA controller"}, - {0x25928086, CHIP_I915, 0x00020000, - "Intel 82915GM (915GM GMCH) SVGA controller"}, - {0x27728086, CHIP_I915, 0x00020000, - "Intel 82945G (945G GMCH) SVGA controller"}, - {0x27A28086, CHIP_I915, 0x00020000, - "Intel 82945GM (945GM GMCH) SVGA controller"}, - {0x27AE8086, CHIP_I915, 0x00020000, - "Intel 945GME SVGA controller"}, - {0x29728086, CHIP_I965, 0x00020000, - "Intel 946GZ SVGA controller"}, - {0x29828086, CHIP_I965, 0x00020000, - "Intel G965 SVGA controller"}, - {0x29928086, CHIP_I965, 0x00020000, - "Intel Q965 SVGA controller"}, - {0x29A28086, CHIP_I965, 0x00020000, - "Intel G965 SVGA controller"}, - {0x29B28086, CHIP_G33, 0x00020000, - "Intel Q35 SVGA controller"}, - {0x29C28086, CHIP_G33, 0x00020000, - "Intel G33 SVGA controller"}, - {0x29D28086, CHIP_G33, 0x00020000, - "Intel Q33 SVGA controller"}, - {0xA0018086, CHIP_IGD, 0x00010000, - "Intel Pineview SVGA controller"}, - {0xA0118086, CHIP_IGD, 0x00010000, - "Intel Pineview (M) SVGA controller"}, - {0x2A028086, CHIP_I965, 0x00020000, - "Intel GM965 SVGA controller"}, - {0x2A128086, CHIP_I965, 0x00020000, - "Intel GME965 SVGA controller"}, - {0x2A428086, CHIP_G4X, 0x00020000, - "Intel GM45 SVGA controller"}, - {0x2E028086, CHIP_G4X, 0x00020000, - "Intel Eaglelake SVGA controller"}, - {0x2E128086, CHIP_G4X, 0x00020000, - "Intel Q45 SVGA controller"}, - {0x2E228086, CHIP_G4X, 0x00020000, - "Intel G45 SVGA controller"}, - {0x2E328086, CHIP_G4X, 0x00020000, - "Intel G41 SVGA controller"}, - {0x00428086, CHIP_G4X, 0x00020000, - "Intel Ironlake (D) SVGA controller"}, - {0x00468086, CHIP_G4X, 0x00020000, - "Intel Ironlake (M) SVGA controller"}, - {0, 0, 0, NULL} + { + .devid = 0x71218086, + .name = "Intel 82810 (i810 GMCH) SVGA controller", + .driver = &agp_i810_i810_driver + }, + { + .devid = 0x71238086, + .name = "Intel 82810-DC100 (i810-DC100 GMCH) SVGA controller", + .driver = &agp_i810_i810_driver + }, + { + .devid = 0x71258086, + .name = "Intel 82810E (i810E GMCH) SVGA controller", + .driver = &agp_i810_i810_driver + }, + { + .devid = 0x11328086, + .name = "Intel 82815 (i815 GMCH) SVGA controller", + .driver = &agp_i810_i815_driver + }, + { + .devid = 0x35778086, + .name = "Intel 82830M (830M GMCH) SVGA controller", + .driver = &agp_i810_i830_driver + }, + { + .devid = 0x25628086, + .name = "Intel 82845M (845M GMCH) SVGA controller", + .driver = &agp_i810_i830_driver + }, + { + .devid = 0x35828086, + .name = "Intel 82852/855GM SVGA controller", + .driver = &agp_i810_i855_driver + }, + { + .devid = 0x25728086, + .name = "Intel 82865G (865G GMCH) SVGA controller", + .driver = &agp_i810_i865_driver + }, + { + .devid = 0x25828086, + .name = "Intel 82915G (915G GMCH) SVGA controller", + .driver = &agp_i810_i915_driver + }, + { + .devid = 0x258A8086, + .name = "Intel E7221 SVGA controller", + .driver = &agp_i810_i915_driver + }, + { + .devid = 0x25928086, + .name = "Intel 82915GM (915GM GMCH) SVGA controller", + .driver = &agp_i810_i915_driver + }, + { + .devid = 0x27728086, + .name = "Intel 82945G (945G GMCH) SVGA controller", + .driver = &agp_i810_i915_driver + }, + { + .devid = 0x27A28086, + .name = "Intel 82945GM (945GM GMCH) SVGA controller", + .driver = &agp_i810_i915_driver + }, + { + .devid = 0x27AE8086, + .name = "Intel 945GME SVGA controller", + .driver = &agp_i810_i915_driver + }, + { + .devid = 0x29728086, + .name = "Intel 946GZ SVGA controller", + .driver = &agp_i810_g965_driver + }, + { + .devid = 0x29828086, + .name = "Intel G965 SVGA controller", + .driver = &agp_i810_g965_driver + }, + { + .devid = 0x29928086, + .name = "Intel Q965 SVGA controller", + .driver = &agp_i810_g965_driver + }, + { + .devid = 0x29A28086, + .name = "Intel G965 SVGA controller", + .driver = &agp_i810_g965_driver + }, + { + .devid = 0x29B28086, + .name = "Intel Q35 SVGA controller", + .driver = &agp_i810_g33_driver + }, + { + .devid = 0x29C28086, + .name = "Intel G33 SVGA controller", + .driver = &agp_i810_g33_driver + }, + { + .devid = 0x29D28086, + .name = "Intel Q33 SVGA controller", + .driver = &agp_i810_g33_driver + }, + { + .devid = 0xA0018086, + .name = "Intel Pineview SVGA controller", + .driver = &agp_i810_igd_driver + }, + { + .devid = 0xA0118086, + .name = "Intel Pineview (M) SVGA controller", + .driver = &agp_i810_igd_driver + }, + { + .devid = 0x2A028086, + .name = "Intel GM965 SVGA controller", + .driver = &agp_i810_g965_driver + }, + { + .devid = 0x2A128086, + .name = "Intel GME965 SVGA controller", + .driver = &agp_i810_g965_driver + }, + { + .devid = 0x2A428086, + .name = "Intel GM45 SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x2E028086, + .name = "Intel Eaglelake SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x2E128086, + .name = "Intel Q45 SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x2E228086, + .name = "Intel G45 SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x2E328086, + .name = "Intel G41 SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x00428086, + .name = "Intel Ironlake (D) SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x00468086, + .name = "Intel Ironlake (M) SVGA controller", + .driver = &agp_i810_g4x_driver + }, + { + .devid = 0x01028086, + .name = "SandyBridge desktop GT1 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01128086, + .name = "SandyBridge desktop GT2 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01228086, + .name = "SandyBridge desktop GT2+ IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01068086, + .name = "SandyBridge mobile GT1 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01168086, + .name = "SandyBridge mobile GT2 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01268086, + .name = "SandyBridge mobile GT2+ IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01088086, + .name = "SandyBridge server IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01528086, + .name = "IvyBridge desktop GT1 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01628086, + .name = "IvyBridge desktop GT2 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01568086, + .name = "IvyBridge mobile GT1 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x01668086, + .name = "IvyBridge mobile GT2 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0x015a8086, + .name = "IvyBridge server GT1 IG", + .driver = &agp_i810_sb_driver + }, + { + .devid = 0, + } }; static const struct agp_i810_match* @@ -196,17 +741,17 @@ agp_i810_match(device_t dev) if (pci_get_class(dev) != PCIC_DISPLAY || pci_get_subclass(dev) != PCIS_DISPLAY_VGA) - return NULL; + return (NULL); devid = pci_get_devid(dev); for (i = 0; agp_i810_matches[i].devid != 0; i++) { if (agp_i810_matches[i].devid == devid) - break; + break; } if (agp_i810_matches[i].devid == 0) - return NULL; + return (NULL); else - return &agp_i810_matches[i]; + return (&agp_i810_matches[i]); } /* @@ -215,28 +760,8 @@ agp_i810_match(device_t dev) static device_t agp_i810_find_bridge(device_t dev) { - device_t *children, child; - int nchildren, i; - u_int32_t devid; - const struct agp_i810_match *match; - - match = agp_i810_match(dev); - devid = match->devid - match->bridge_offset; - if (device_get_children(device_get_parent(device_get_parent(dev)), - &children, &nchildren)) - return 0; - - for (i = 0; i < nchildren; i++) { - child = children[i]; - - if (pci_get_devid(child) == devid) { - free(children, M_TEMP); - return child; - } - } - free(children, M_TEMP); - return 0; + return (pci_find_dbsf(0, 0, 0, 0)); } static void @@ -249,92 +774,116 @@ agp_i810_identify(driver_t *driver, devi } static int +agp_i810_check_active(device_t bridge_dev) +{ + u_int8_t smram; + + smram = pci_read_config(bridge_dev, AGP_I810_SMRAM, 1); + if ((smram & AGP_I810_SMRAM_GMS) == AGP_I810_SMRAM_GMS_DISABLED) + return (ENXIO); + return (0); +} + +static int +agp_i830_check_active(device_t bridge_dev) +{ + int gcc1; + + gcc1 = pci_read_config(bridge_dev, AGP_I830_GCC1, 1); + if ((gcc1 & AGP_I830_GCC1_DEV2) == AGP_I830_GCC1_DEV2_DISABLED) + return (ENXIO); + return (0); +} + +static int +agp_i915_check_active(device_t bridge_dev) +{ + int deven; + + deven = pci_read_config(bridge_dev, AGP_I915_DEVEN, 4); + if ((deven & AGP_I915_DEVEN_D2F0) == AGP_I915_DEVEN_D2F0_DISABLED) + return (ENXIO); + return (0); +} + +static int +agp_sb_check_active(device_t bridge_dev) +{ + int deven; + + deven = pci_read_config(bridge_dev, AGP_I915_DEVEN, 4); + if ((deven & AGP_SB_DEVEN_D2EN) == AGP_SB_DEVEN_D2EN_DISABLED) + return (ENXIO); + return (0); +} + +static void +agp_82852_set_desc(device_t dev, const struct agp_i810_match *match) +{ + + switch (pci_read_config(dev, AGP_I85X_CAPID, 1)) { + case AGP_I855_GME: + device_set_desc(dev, + "Intel 82855GME (855GME GMCH) SVGA controller"); + break; + case AGP_I855_GM: + device_set_desc(dev, + "Intel 82855GM (855GM GMCH) SVGA controller"); + break; + case AGP_I852_GME: + device_set_desc(dev, + "Intel 82852GME (852GME GMCH) SVGA controller"); + break; + case AGP_I852_GM: + device_set_desc(dev, + "Intel 82852GM (852GM GMCH) SVGA controller"); + break; + default: + device_set_desc(dev, + "Intel 8285xM (85xGM GMCH) SVGA controller"); + break; + } +} + +static void +agp_i810_set_desc(device_t dev, const struct agp_i810_match *match) +{ + + device_set_desc(dev, match->name); +} + +static int agp_i810_probe(device_t dev) { device_t bdev; const struct agp_i810_match *match; - u_int8_t smram; - int gcc1, deven; + int err; if (resource_disabled("agp", device_get_unit(dev))) return (ENXIO); match = agp_i810_match(dev); if (match == NULL) - return ENXIO; + return (ENXIO); bdev = agp_i810_find_bridge(dev); - if (!bdev) { + if (bdev == NULL) { if (bootverbose) printf("I810: can't find bridge device\n"); - return ENXIO; + return (ENXIO); } /* * checking whether internal graphics device has been activated. */ - switch (match->chiptype) { - case CHIP_I810: - smram = pci_read_config(bdev, AGP_I810_SMRAM, 1); - if ((smram & AGP_I810_SMRAM_GMS) == - AGP_I810_SMRAM_GMS_DISABLED) { - if (bootverbose) - printf("I810: disabled, not probing\n"); - return ENXIO; - } - break; - case CHIP_I830: - case CHIP_I855: - gcc1 = pci_read_config(bdev, AGP_I830_GCC1, 1); - if ((gcc1 & AGP_I830_GCC1_DEV2) == - AGP_I830_GCC1_DEV2_DISABLED) { - if (bootverbose) - printf("I830: disabled, not probing\n"); - return ENXIO; - } - break; - case CHIP_I915: - case CHIP_I965: - case CHIP_G33: - case CHIP_IGD: - case CHIP_G4X: - deven = pci_read_config(bdev, AGP_I915_DEVEN, 4); - if ((deven & AGP_I915_DEVEN_D2F0) == - AGP_I915_DEVEN_D2F0_DISABLED) { - if (bootverbose) - printf("I915: disabled, not probing\n"); - return ENXIO; - } - break; - } - - if (match->devid == 0x35828086) { - switch (pci_read_config(dev, AGP_I85X_CAPID, 1)) { - case AGP_I855_GME: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue May 22 11:07:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C91D61065696; Tue, 22 May 2012 11:07:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B105C8FC15; Tue, 22 May 2012 11:07:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MB7jqx099907; Tue, 22 May 2012 11:07:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MB7jx0099903; Tue, 22 May 2012 11:07:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205221107.q4MB7jx0099903@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 May 2012 11:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235783 - in head/sys/dev/drm2: . i915 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 11:07:45 -0000 Author: kib Date: Tue May 22 11:07:44 2012 New Revision: 235783 URL: http://svn.freebsd.org/changeset/base/235783 Log: Add the code for new Intel GPU driver, which supports GEM, KMS and works with new generations of GPUs (IronLake, SandyBridge and supposedly IvyBridge). The driver is not connected to the build yet. Sponsored by: The FreeBSD Foundation MFC after: 1 week Added: head/sys/dev/drm2/ head/sys/dev/drm2/drm.h (contents, props changed) head/sys/dev/drm2/drmP.h (contents, props changed) head/sys/dev/drm2/drm_agpsupport.c (contents, props changed) head/sys/dev/drm2/drm_atomic.h (contents, props changed) head/sys/dev/drm2/drm_auth.c (contents, props changed) head/sys/dev/drm2/drm_bufs.c (contents, props changed) head/sys/dev/drm2/drm_context.c (contents, props changed) head/sys/dev/drm2/drm_crtc.c (contents, props changed) head/sys/dev/drm2/drm_crtc.h (contents, props changed) head/sys/dev/drm2/drm_crtc_helper.c (contents, props changed) head/sys/dev/drm2/drm_crtc_helper.h (contents, props changed) head/sys/dev/drm2/drm_dma.c (contents, props changed) head/sys/dev/drm2/drm_dp_helper.h (contents, props changed) head/sys/dev/drm2/drm_dp_iic_helper.c (contents, props changed) head/sys/dev/drm2/drm_drawable.c (contents, props changed) head/sys/dev/drm2/drm_drv.c (contents, props changed) head/sys/dev/drm2/drm_edid.c (contents, props changed) head/sys/dev/drm2/drm_edid.h (contents, props changed) head/sys/dev/drm2/drm_edid_modes.h (contents, props changed) head/sys/dev/drm2/drm_fb_helper.c (contents, props changed) head/sys/dev/drm2/drm_fb_helper.h (contents, props changed) head/sys/dev/drm2/drm_fops.c (contents, props changed) head/sys/dev/drm2/drm_fourcc.h (contents, props changed) head/sys/dev/drm2/drm_gem.c (contents, props changed) head/sys/dev/drm2/drm_gem_names.c (contents, props changed) head/sys/dev/drm2/drm_gem_names.h (contents, props changed) head/sys/dev/drm2/drm_hashtab.c (contents, props changed) head/sys/dev/drm2/drm_hashtab.h (contents, props changed) head/sys/dev/drm2/drm_internal.h (contents, props changed) head/sys/dev/drm2/drm_ioctl.c (contents, props changed) head/sys/dev/drm2/drm_irq.c (contents, props changed) head/sys/dev/drm2/drm_linux_list.h (contents, props changed) head/sys/dev/drm2/drm_linux_list_sort.c (contents, props changed) head/sys/dev/drm2/drm_lock.c (contents, props changed) head/sys/dev/drm2/drm_memory.c (contents, props changed) head/sys/dev/drm2/drm_mm.c (contents, props changed) head/sys/dev/drm2/drm_mm.h (contents, props changed) head/sys/dev/drm2/drm_mode.h (contents, props changed) head/sys/dev/drm2/drm_modes.c (contents, props changed) head/sys/dev/drm2/drm_pci.c (contents, props changed) head/sys/dev/drm2/drm_pciids.h (contents, props changed) head/sys/dev/drm2/drm_sarea.h (contents, props changed) head/sys/dev/drm2/drm_scatter.c (contents, props changed) head/sys/dev/drm2/drm_sman.c (contents, props changed) head/sys/dev/drm2/drm_sman.h (contents, props changed) head/sys/dev/drm2/drm_stub.c (contents, props changed) head/sys/dev/drm2/drm_sysctl.c (contents, props changed) head/sys/dev/drm2/drm_vm.c (contents, props changed) head/sys/dev/drm2/i915/ head/sys/dev/drm2/i915/i915_debug.c (contents, props changed) head/sys/dev/drm2/i915/i915_dma.c (contents, props changed) head/sys/dev/drm2/i915/i915_drm.h (contents, props changed) head/sys/dev/drm2/i915/i915_drv.c (contents, props changed) head/sys/dev/drm2/i915/i915_drv.h (contents, props changed) head/sys/dev/drm2/i915/i915_gem.c (contents, props changed) head/sys/dev/drm2/i915/i915_gem_evict.c (contents, props changed) head/sys/dev/drm2/i915/i915_gem_execbuffer.c (contents, props changed) head/sys/dev/drm2/i915/i915_gem_gtt.c (contents, props changed) head/sys/dev/drm2/i915/i915_gem_tiling.c (contents, props changed) head/sys/dev/drm2/i915/i915_irq.c (contents, props changed) head/sys/dev/drm2/i915/i915_reg.h (contents, props changed) head/sys/dev/drm2/i915/i915_suspend.c (contents, props changed) head/sys/dev/drm2/i915/intel_bios.c (contents, props changed) head/sys/dev/drm2/i915/intel_bios.h (contents, props changed) head/sys/dev/drm2/i915/intel_crt.c (contents, props changed) head/sys/dev/drm2/i915/intel_display.c (contents, props changed) head/sys/dev/drm2/i915/intel_dp.c (contents, props changed) head/sys/dev/drm2/i915/intel_drv.h (contents, props changed) head/sys/dev/drm2/i915/intel_fb.c (contents, props changed) head/sys/dev/drm2/i915/intel_hdmi.c (contents, props changed) head/sys/dev/drm2/i915/intel_iic.c (contents, props changed) head/sys/dev/drm2/i915/intel_lvds.c (contents, props changed) head/sys/dev/drm2/i915/intel_modes.c (contents, props changed) head/sys/dev/drm2/i915/intel_opregion.c (contents, props changed) head/sys/dev/drm2/i915/intel_overlay.c (contents, props changed) head/sys/dev/drm2/i915/intel_panel.c (contents, props changed) head/sys/dev/drm2/i915/intel_ringbuffer.c (contents, props changed) head/sys/dev/drm2/i915/intel_ringbuffer.h (contents, props changed) head/sys/dev/drm2/i915/intel_sdvo.c (contents, props changed) head/sys/dev/drm2/i915/intel_sdvo_regs.h (contents, props changed) head/sys/dev/drm2/i915/intel_sprite.c (contents, props changed) head/sys/dev/drm2/i915/intel_tv.c (contents, props changed) Added: head/sys/dev/drm2/drm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/drm2/drm.h Tue May 22 11:07:44 2012 (r235783) @@ -0,0 +1,1214 @@ +/** + * \file drm.h + * Header for the Direct Rendering Manager + * + * \author Rickard E. (Rik) Faith + * + * \par Acknowledgments: + * Dec 1999, Richard Henderson , move to generic \c cmpxchg. + */ + +/*- + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/** + * \mainpage + * + * The Direct Rendering Manager (DRM) is a device-independent kernel-level + * device driver that provides support for the XFree86 Direct Rendering + * Infrastructure (DRI). + * + * The DRM supports the Direct Rendering Infrastructure (DRI) in four major + * ways: + * -# The DRM provides synchronized access to the graphics hardware via + * the use of an optimized two-tiered lock. + * -# The DRM enforces the DRI security policy for access to the graphics + * hardware by only allowing authenticated X11 clients access to + * restricted regions of memory. + * -# The DRM provides a generic DMA engine, complete with multiple + * queues and the ability to detect the need for an OpenGL context + * switch. + * -# The DRM is extensible via the use of small device-specific modules + * that rely extensively on the API exported by the DRM module. + * + */ + +#ifndef _DRM_H_ +#define _DRM_H_ + +#ifndef __user +#define __user +#endif +#ifndef __iomem +#define __iomem +#endif + +#ifdef __GNUC__ +# define DEPRECATED __attribute__ ((deprecated)) +#else +# define DEPRECATED +#endif + +#if defined(__linux__) +#include /* For _IO* macros */ +#define DRM_IOCTL_NR(n) _IOC_NR(n) +#define DRM_IOC_VOID _IOC_NONE +#define DRM_IOC_READ _IOC_READ +#define DRM_IOC_WRITE _IOC_WRITE +#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE +#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) +#include +#define DRM_IOCTL_NR(n) ((n) & 0xff) +#define DRM_IOC_VOID IOC_VOID +#define DRM_IOC_READ IOC_OUT +#define DRM_IOC_WRITE IOC_IN +#define DRM_IOC_READWRITE IOC_INOUT +#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) +#endif + +#ifdef __OpenBSD__ +#define DRM_MAJOR 81 +#endif +#if defined(__linux__) || defined(__NetBSD__) +#define DRM_MAJOR 226 +#endif +#define DRM_MAX_MINOR 15 + +#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ +#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ +#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ +#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ + +#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ +#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ +#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) +#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) +#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) + +#if defined(__linux__) +typedef unsigned int drm_handle_t; +#else +#include +typedef unsigned long drm_handle_t; /**< To mapped regions */ +#endif +typedef unsigned int drm_context_t; /**< GLXContext handle */ +typedef unsigned int drm_drawable_t; +typedef unsigned int drm_magic_t; /**< Magic for authentication */ + +/** + * Cliprect. + * + * \warning If you change this structure, make sure you change + * XF86DRIClipRectRec in the server as well + * + * \note KW: Actually it's illegal to change either for + * backwards-compatibility reasons. + */ +struct drm_clip_rect { + unsigned short x1; + unsigned short y1; + unsigned short x2; + unsigned short y2; +}; + +/** + * Texture region, + */ +struct drm_tex_region { + unsigned char next; + unsigned char prev; + unsigned char in_use; + unsigned char padding; + unsigned int age; +}; + +/** + * Hardware lock. + * + * The lock structure is a simple cache-line aligned integer. To avoid + * processor bus contention on a multiprocessor system, there should not be any + * other data stored in the same cache line. + */ +struct drm_hw_lock { + __volatile__ unsigned int lock; /**< lock variable */ + char padding[60]; /**< Pad to cache line */ +}; + +/* This is beyond ugly, and only works on GCC. However, it allows me to use + * drm.h in places (i.e., in the X-server) where I can't use size_t. The real + * fix is to use uint32_t instead of size_t, but that fix will break existing + * LP64 (i.e., PowerPC64, SPARC64, IA-64, Alpha, etc.) systems. That *will* + * eventually happen, though. I chose 'unsigned long' to be the fallback type + * because that works on all the platforms I know about. Hopefully, the + * real fix will happen before that bites us. + */ + +#ifdef __SIZE_TYPE__ +# define DRM_SIZE_T __SIZE_TYPE__ +#else +# warning "__SIZE_TYPE__ not defined. Assuming sizeof(size_t) == sizeof(unsigned long)!" +# define DRM_SIZE_T unsigned long +#endif + +/** + * DRM_IOCTL_VERSION ioctl argument type. + * + * \sa drmGetVersion(). + */ +struct drm_version { + int version_major; /**< Major version */ + int version_minor; /**< Minor version */ + int version_patchlevel; /**< Patch level */ + DRM_SIZE_T name_len; /**< Length of name buffer */ + char __user *name; /**< Name of driver */ + DRM_SIZE_T date_len; /**< Length of date buffer */ + char __user *date; /**< User-space buffer to hold date */ + DRM_SIZE_T desc_len; /**< Length of desc buffer */ + char __user *desc; /**< User-space buffer to hold desc */ +}; + +/** + * DRM_IOCTL_GET_UNIQUE ioctl argument type. + * + * \sa drmGetBusid() and drmSetBusId(). + */ +struct drm_unique { + DRM_SIZE_T unique_len; /**< Length of unique */ + char __user *unique; /**< Unique name for driver instantiation */ +}; + +#undef DRM_SIZE_T + +struct drm_list { + int count; /**< Length of user-space structures */ + struct drm_version __user *version; +}; + +struct drm_block { + int unused; +}; + +/** + * DRM_IOCTL_CONTROL ioctl argument type. + * + * \sa drmCtlInstHandler() and drmCtlUninstHandler(). + */ +struct drm_control { + enum { + DRM_ADD_COMMAND, + DRM_RM_COMMAND, + DRM_INST_HANDLER, + DRM_UNINST_HANDLER + } func; + int irq; +}; + +/** + * Type of memory to map. + */ +enum drm_map_type { + _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ + _DRM_REGISTERS = 1, /**< no caching, no core dump */ + _DRM_SHM = 2, /**< shared, cached */ + _DRM_AGP = 3, /**< AGP/GART */ + _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ + _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */ + _DRM_GEM = 6 /**< GEM */ +}; + +/** + * Memory mapping flags. + */ +enum drm_map_flags { + _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ + _DRM_READ_ONLY = 0x02, + _DRM_LOCKED = 0x04, /**< shared, cached, locked */ + _DRM_KERNEL = 0x08, /**< kernel requires access */ + _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ + _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ + _DRM_REMOVABLE = 0x40, /**< Removable mapping */ + _DRM_DRIVER = 0x80 /**< Managed by driver */ +}; + +struct drm_ctx_priv_map { + unsigned int ctx_id; /**< Context requesting private mapping */ + void *handle; /**< Handle of map */ +}; + +/** + * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls + * argument type. + * + * \sa drmAddMap(). + */ +struct drm_map { + unsigned long offset; /**< Requested physical address (0 for SAREA)*/ + unsigned long size; /**< Requested physical size (bytes) */ + enum drm_map_type type; /**< Type of memory to map */ + enum drm_map_flags flags; /**< Flags */ + void *handle; /**< User-space: "Handle" to pass to mmap() */ + /**< Kernel-space: kernel-virtual address */ + int mtrr; /**< MTRR slot used */ + /* Private data */ +}; + +/** + * DRM_IOCTL_GET_CLIENT ioctl argument type. + */ +struct drm_client { + int idx; /**< Which client desired? */ + int auth; /**< Is client authenticated? */ + unsigned long pid; /**< Process ID */ + unsigned long uid; /**< User ID */ + unsigned long magic; /**< Magic */ + unsigned long iocs; /**< Ioctl count */ +}; + +enum drm_stat_type { + _DRM_STAT_LOCK, + _DRM_STAT_OPENS, + _DRM_STAT_CLOSES, + _DRM_STAT_IOCTLS, + _DRM_STAT_LOCKS, + _DRM_STAT_UNLOCKS, + _DRM_STAT_VALUE, /**< Generic value */ + _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ + _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ + + _DRM_STAT_IRQ, /**< IRQ */ + _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ + _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ + _DRM_STAT_DMA, /**< DMA */ + _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ + _DRM_STAT_MISSED /**< Missed DMA opportunity */ + /* Add to the *END* of the list */ +}; + +/** + * DRM_IOCTL_GET_STATS ioctl argument type. + */ +struct drm_stats { + unsigned long count; + struct { + unsigned long value; + enum drm_stat_type type; + } data[15]; +}; + +/** + * Hardware locking flags. + */ +enum drm_lock_flags { + _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ + _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ + _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ + _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ + /* These *HALT* flags aren't supported yet + -- they will be used to support the + full-screen DGA-like mode. */ + _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ + _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ +}; + +/** + * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. + * + * \sa drmGetLock() and drmUnlock(). + */ +struct drm_lock { + int context; + enum drm_lock_flags flags; +}; + +/** + * DMA flags + * + * \warning + * These values \e must match xf86drm.h. + * + * \sa drm_dma. + */ +enum drm_dma_flags { + /* Flags for DMA buffer dispatch */ + _DRM_DMA_BLOCK = 0x01, /**< + * Block until buffer dispatched. + * + * \note The buffer may not yet have + * been processed by the hardware -- + * getting a hardware lock with the + * hardware quiescent will ensure + * that the buffer has been + * processed. + */ + _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ + _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ + + /* Flags for DMA buffer request */ + _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ + _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ + _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ +}; + +/** + * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. + * + * \sa drmAddBufs(). + */ +struct drm_buf_desc { + int count; /**< Number of buffers of this size */ + int size; /**< Size in bytes */ + int low_mark; /**< Low water mark */ + int high_mark; /**< High water mark */ + enum { + _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ + _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ + _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ + _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */ + _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */ + } flags; + unsigned long agp_start; /**< + * Start address of where the AGP buffers are + * in the AGP aperture + */ +}; + +/** + * DRM_IOCTL_INFO_BUFS ioctl argument type. + */ +struct drm_buf_info { + int count; /**< Number of buffers described in list */ + struct drm_buf_desc __user *list; /**< List of buffer descriptions */ +}; + +/** + * DRM_IOCTL_FREE_BUFS ioctl argument type. + */ +struct drm_buf_free { + int count; + int __user *list; +}; + +/** + * Buffer information + * + * \sa drm_buf_map. + */ +struct drm_buf_pub { + int idx; /**< Index into the master buffer list */ + int total; /**< Buffer size */ + int used; /**< Amount of buffer in use (for DMA) */ + void __user *address; /**< Address of buffer */ +}; + +/** + * DRM_IOCTL_MAP_BUFS ioctl argument type. + */ +struct drm_buf_map { + int count; /**< Length of the buffer list */ +#if defined(__cplusplus) + void __user *c_virtual; +#else + void __user *virtual; /**< Mmap'd area in user-virtual */ +#endif + struct drm_buf_pub __user *list; /**< Buffer information */ +}; + +/** + * DRM_IOCTL_DMA ioctl argument type. + * + * Indices here refer to the offset into the buffer list in drm_buf_get. + * + * \sa drmDMA(). + */ +struct drm_dma { + int context; /**< Context handle */ + int send_count; /**< Number of buffers to send */ + int __user *send_indices; /**< List of handles to buffers */ + int __user *send_sizes; /**< Lengths of data to send */ + enum drm_dma_flags flags; /**< Flags */ + int request_count; /**< Number of buffers requested */ + int request_size; /**< Desired size for buffers */ + int __user *request_indices; /**< Buffer information */ + int __user *request_sizes; + int granted_count; /**< Number of buffers granted */ +}; + +enum drm_ctx_flags { + _DRM_CONTEXT_PRESERVED = 0x01, + _DRM_CONTEXT_2DONLY = 0x02 +}; + +/** + * DRM_IOCTL_ADD_CTX ioctl argument type. + * + * \sa drmCreateContext() and drmDestroyContext(). + */ +struct drm_ctx { + drm_context_t handle; + enum drm_ctx_flags flags; +}; + +/** + * DRM_IOCTL_RES_CTX ioctl argument type. + */ +struct drm_ctx_res { + int count; + struct drm_ctx __user *contexts; +}; + +/** + * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. + */ +struct drm_draw { + drm_drawable_t handle; +}; + +/** + * DRM_IOCTL_UPDATE_DRAW ioctl argument type. + */ +typedef enum { + DRM_DRAWABLE_CLIPRECTS, +} drm_drawable_info_type_t; + +struct drm_update_draw { + drm_drawable_t handle; + unsigned int type; + unsigned int num; + unsigned long long data; +}; + +/** + * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. + */ +struct drm_auth { + drm_magic_t magic; +}; + +/** + * DRM_IOCTL_IRQ_BUSID ioctl argument type. + * + * \sa drmGetInterruptFromBusID(). + */ +struct drm_irq_busid { + int irq; /**< IRQ number */ + int busnum; /**< bus number */ + int devnum; /**< device number */ + int funcnum; /**< function number */ +}; + +enum drm_vblank_seq_type { + _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ + _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ + _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, + _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ + _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ + _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ + _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ + _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */ +}; +#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 + +#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) +#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ + _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) + +struct drm_wait_vblank_request { + enum drm_vblank_seq_type type; + unsigned int sequence; + unsigned long signal; +}; + +struct drm_wait_vblank_reply { + enum drm_vblank_seq_type type; + unsigned int sequence; + long tval_sec; + long tval_usec; +}; + +/** + * DRM_IOCTL_WAIT_VBLANK ioctl argument type. + * + * \sa drmWaitVBlank(). + */ +union drm_wait_vblank { + struct drm_wait_vblank_request request; + struct drm_wait_vblank_reply reply; +}; + + +#define _DRM_PRE_MODESET 1 +#define _DRM_POST_MODESET 2 + +/** + * DRM_IOCTL_MODESET_CTL ioctl argument type + * + * \sa drmModesetCtl(). + */ +struct drm_modeset_ctl { + uint32_t crtc; + uint32_t cmd; +}; + +/** + * DRM_IOCTL_AGP_ENABLE ioctl argument type. + * + * \sa drmAgpEnable(). + */ +struct drm_agp_mode { + unsigned long mode; /**< AGP mode */ +}; + +/** + * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. + * + * \sa drmAgpAlloc() and drmAgpFree(). + */ +struct drm_agp_buffer { + unsigned long size; /**< In bytes -- will round to page boundary */ + unsigned long handle; /**< Used for binding / unbinding */ + unsigned long type; /**< Type of memory to allocate */ + unsigned long physical; /**< Physical used by i810 */ +}; + +/** + * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. + * + * \sa drmAgpBind() and drmAgpUnbind(). + */ +struct drm_agp_binding { + unsigned long handle; /**< From drm_agp_buffer */ + unsigned long offset; /**< In bytes -- will round to page boundary */ +}; + +/** + * DRM_IOCTL_AGP_INFO ioctl argument type. + * + * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(), + * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), + * drmAgpVendorId() and drmAgpDeviceId(). + */ +struct drm_agp_info { + int agp_version_major; + int agp_version_minor; + unsigned long mode; + unsigned long aperture_base; /**< physical address */ + unsigned long aperture_size; /**< bytes */ + unsigned long memory_allowed; /**< bytes */ + unsigned long memory_used; + + /** \name PCI information */ + /*@{ */ + unsigned short id_vendor; + unsigned short id_device; + /*@} */ +}; + +/** + * DRM_IOCTL_SG_ALLOC ioctl argument type. + */ +struct drm_scatter_gather { + unsigned long size; /**< In bytes -- will round to page boundary */ + unsigned long handle; /**< Used for mapping / unmapping */ +}; + +/** + * DRM_IOCTL_SET_VERSION ioctl argument type. + */ +struct drm_set_version { + int drm_di_major; + int drm_di_minor; + int drm_dd_major; + int drm_dd_minor; +}; + +#define DRM_FENCE_FLAG_EMIT 0x00000001 +#define DRM_FENCE_FLAG_SHAREABLE 0x00000002 +/** + * On hardware with no interrupt events for operation completion, + * indicates that the kernel should sleep while waiting for any blocking + * operation to complete rather than spinning. + * + * Has no effect otherwise. + */ +#define DRM_FENCE_FLAG_WAIT_LAZY 0x00000004 +#define DRM_FENCE_FLAG_NO_USER 0x00000010 + +/* Reserved for driver use */ +#define DRM_FENCE_MASK_DRIVER 0xFF000000 + +#define DRM_FENCE_TYPE_EXE 0x00000001 + +struct drm_fence_arg { + unsigned int handle; + unsigned int fence_class; + unsigned int type; + unsigned int flags; + unsigned int signaled; + unsigned int error; + unsigned int sequence; + unsigned int pad64; + uint64_t expand_pad[2]; /* Future expansion */ +}; + +/* Buffer permissions, referring to how the GPU uses the buffers. + * these translate to fence types used for the buffers. + * Typically a texture buffer is read, A destination buffer is write and + * a command (batch-) buffer is exe. Can be or-ed together. + */ + +#define DRM_BO_FLAG_READ (1ULL << 0) +#define DRM_BO_FLAG_WRITE (1ULL << 1) +#define DRM_BO_FLAG_EXE (1ULL << 2) + +/* + * All of the bits related to access mode + */ +#define DRM_BO_MASK_ACCESS (DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_EXE) +/* + * Status flags. Can be read to determine the actual state of a buffer. + * Can also be set in the buffer mask before validation. + */ + +/* + * Mask: Never evict this buffer. Not even with force. This type of buffer is only + * available to root and must be manually removed before buffer manager shutdown + * or lock. + * Flags: Acknowledge + */ +#define DRM_BO_FLAG_NO_EVICT (1ULL << 4) + +/* + * Mask: Require that the buffer is placed in mappable memory when validated. + * If not set the buffer may or may not be in mappable memory when validated. + * Flags: If set, the buffer is in mappable memory. + */ +#define DRM_BO_FLAG_MAPPABLE (1ULL << 5) + +/* Mask: The buffer should be shareable with other processes. + * Flags: The buffer is shareable with other processes. + */ +#define DRM_BO_FLAG_SHAREABLE (1ULL << 6) + +/* Mask: If set, place the buffer in cache-coherent memory if available. + * If clear, never place the buffer in cache coherent memory if validated. + * Flags: The buffer is currently in cache-coherent memory. + */ +#define DRM_BO_FLAG_CACHED (1ULL << 7) + +/* Mask: Make sure that every time this buffer is validated, + * it ends up on the same location provided that the memory mask is the same. + * The buffer will also not be evicted when claiming space for + * other buffers. Basically a pinned buffer but it may be thrown out as + * part of buffer manager shutdown or locking. + * Flags: Acknowledge. + */ +#define DRM_BO_FLAG_NO_MOVE (1ULL << 8) + +/* Mask: Make sure the buffer is in cached memory when mapped. In conjunction + * with DRM_BO_FLAG_CACHED it also allows the buffer to be bound into the GART + * with unsnooped PTEs instead of snooped, by using chipset-specific cache + * flushing at bind time. A better name might be DRM_BO_FLAG_TT_UNSNOOPED, + * as the eviction to local memory (TTM unbind) on map is just a side effect + * to prevent aggressive cache prefetch from the GPU disturbing the cache + * management that the DRM is doing. + * + * Flags: Acknowledge. + * Buffers allocated with this flag should not be used for suballocators + * This type may have issues on CPUs with over-aggressive caching + * http://marc.info/?l=linux-kernel&m=102376926732464&w=2 + */ +#define DRM_BO_FLAG_CACHED_MAPPED (1ULL << 19) + + +/* Mask: Force DRM_BO_FLAG_CACHED flag strictly also if it is set. + * Flags: Acknowledge. + */ +#define DRM_BO_FLAG_FORCE_CACHING (1ULL << 13) + +/* + * Mask: Force DRM_BO_FLAG_MAPPABLE flag strictly also if it is clear. + * Flags: Acknowledge. + */ +#define DRM_BO_FLAG_FORCE_MAPPABLE (1ULL << 14) +#define DRM_BO_FLAG_TILE (1ULL << 15) + +/* + * Memory type flags that can be or'ed together in the mask, but only + * one appears in flags. + */ + +/* System memory */ +#define DRM_BO_FLAG_MEM_LOCAL (1ULL << 24) +/* Translation table memory */ +#define DRM_BO_FLAG_MEM_TT (1ULL << 25) +/* Vram memory */ +#define DRM_BO_FLAG_MEM_VRAM (1ULL << 26) +/* Up to the driver to define. */ +#define DRM_BO_FLAG_MEM_PRIV0 (1ULL << 27) +#define DRM_BO_FLAG_MEM_PRIV1 (1ULL << 28) +#define DRM_BO_FLAG_MEM_PRIV2 (1ULL << 29) +#define DRM_BO_FLAG_MEM_PRIV3 (1ULL << 30) +#define DRM_BO_FLAG_MEM_PRIV4 (1ULL << 31) +/* We can add more of these now with a 64-bit flag type */ + +/* + * This is a mask covering all of the memory type flags; easier to just + * use a single constant than a bunch of | values. It covers + * DRM_BO_FLAG_MEM_LOCAL through DRM_BO_FLAG_MEM_PRIV4 + */ +#define DRM_BO_MASK_MEM 0x00000000FF000000ULL +/* + * This adds all of the CPU-mapping options in with the memory + * type to label all bits which change how the page gets mapped + */ +#define DRM_BO_MASK_MEMTYPE (DRM_BO_MASK_MEM | \ + DRM_BO_FLAG_CACHED_MAPPED | \ + DRM_BO_FLAG_CACHED | \ + DRM_BO_FLAG_MAPPABLE) + +/* Driver-private flags */ +#define DRM_BO_MASK_DRIVER 0xFFFF000000000000ULL + +/* + * Don't block on validate and map. Instead, return EBUSY. + */ +#define DRM_BO_HINT_DONT_BLOCK 0x00000002 +/* + * Don't place this buffer on the unfenced list. This means + * that the buffer will not end up having a fence associated + * with it as a result of this operation + */ +#define DRM_BO_HINT_DONT_FENCE 0x00000004 +/** + * On hardware with no interrupt events for operation completion, + * indicates that the kernel should sleep while waiting for any blocking + * operation to complete rather than spinning. + * + * Has no effect otherwise. + */ +#define DRM_BO_HINT_WAIT_LAZY 0x00000008 +/* + * The client has compute relocations refering to this buffer using the + * offset in the presumed_offset field. If that offset ends up matching + * where this buffer lands, the kernel is free to skip executing those + * relocations + */ +#define DRM_BO_HINT_PRESUMED_OFFSET 0x00000010 + +#define DRM_BO_INIT_MAGIC 0xfe769812 +#define DRM_BO_INIT_MAJOR 1 +#define DRM_BO_INIT_MINOR 0 +#define DRM_BO_INIT_PATCH 0 + + +struct drm_bo_info_req { + uint64_t mask; + uint64_t flags; + unsigned int handle; + unsigned int hint; + unsigned int fence_class; + unsigned int desired_tile_stride; + unsigned int tile_info; + unsigned int pad64; + uint64_t presumed_offset; +}; + +struct drm_bo_create_req { + uint64_t flags; + uint64_t size; + uint64_t buffer_start; + unsigned int hint; + unsigned int page_alignment; +}; + + +/* + * Reply flags + */ + +#define DRM_BO_REP_BUSY 0x00000001 + +struct drm_bo_info_rep { + uint64_t flags; + uint64_t proposed_flags; + uint64_t size; + uint64_t offset; + uint64_t arg_handle; + uint64_t buffer_start; + unsigned int handle; + unsigned int fence_flags; + unsigned int rep_flags; + unsigned int page_alignment; + unsigned int desired_tile_stride; + unsigned int hw_tile_stride; + unsigned int tile_info; + unsigned int pad64; + uint64_t expand_pad[4]; /*Future expansion */ +}; + +struct drm_bo_arg_rep { + struct drm_bo_info_rep bo_info; + int ret; + unsigned int pad64; +}; + +struct drm_bo_create_arg { + union { + struct drm_bo_create_req req; + struct drm_bo_info_rep rep; + } d; +}; + +struct drm_bo_handle_arg { + unsigned int handle; +}; + +struct drm_bo_reference_info_arg { + union { + struct drm_bo_handle_arg req; + struct drm_bo_info_rep rep; + } d; +}; + +struct drm_bo_map_wait_idle_arg { + union { + struct drm_bo_info_req req; + struct drm_bo_info_rep rep; + } d; +}; + +struct drm_bo_op_req { + enum { + drm_bo_validate, + drm_bo_fence, + drm_bo_ref_fence, + } op; + unsigned int arg_handle; + struct drm_bo_info_req bo_req; +}; + + +struct drm_bo_op_arg { + uint64_t next; + union { + struct drm_bo_op_req req; + struct drm_bo_arg_rep rep; + } d; + int handled; + unsigned int pad64; +}; + + +#define DRM_BO_MEM_LOCAL 0 +#define DRM_BO_MEM_TT 1 +#define DRM_BO_MEM_VRAM 2 +#define DRM_BO_MEM_PRIV0 3 +#define DRM_BO_MEM_PRIV1 4 +#define DRM_BO_MEM_PRIV2 5 +#define DRM_BO_MEM_PRIV3 6 +#define DRM_BO_MEM_PRIV4 7 + +#define DRM_BO_MEM_TYPES 8 /* For now. */ + +#define DRM_BO_LOCK_UNLOCK_BM (1 << 0) +#define DRM_BO_LOCK_IGNORE_NO_EVICT (1 << 1) + +struct drm_bo_version_arg { + uint32_t major; + uint32_t minor; + uint32_t patchlevel; +}; + +struct drm_mm_type_arg { + unsigned int mem_type; + unsigned int lock_flags; +}; + +struct drm_mm_init_arg { + unsigned int magic; + unsigned int major; + unsigned int minor; + unsigned int mem_type; + uint64_t p_offset; + uint64_t p_size; +}; + +struct drm_mm_info_arg { + unsigned int mem_type; + uint64_t p_size; +}; + +struct drm_gem_close { + /** Handle of the object to be closed. */ + uint32_t handle; + uint32_t pad; +}; + +struct drm_gem_flink { + /** Handle for the object being named */ + uint32_t handle; + + /** Returned global name */ + uint32_t name; +}; + +struct drm_gem_open { + /** Name of object being opened */ + uint32_t name; + + /** Returned handle for the object */ + uint32_t handle; + + /** Returned size of the object */ + uint64_t size; +}; + +struct drm_get_cap { + uint64_t capability; + uint64_t value; +}; + +struct drm_event { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue May 22 11:42:23 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A1B191065679; Tue, 22 May 2012 11:42:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 376C48FC17; Tue, 22 May 2012 11:42:23 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4MBgEaD032723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 May 2012 21:42:15 +1000 Date: Tue, 22 May 2012 21:42:14 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hartmut Brandt In-Reply-To: <201205220723.q4M7Ng2I091715@svn.freebsd.org> Message-ID: <20120522212307.V1971@besplex.bde.org> References: <201205220723.q4M7Ng2I091715@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235777 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 11:42:23 -0000 On Tue, 22 May 2012, Hartmut Brandt wrote: > Log: > Make dumptid non-static. It is used by libkvm to detect whether > this is a VNET-kernel or not. gcc used to put the static symbol into > the symbol table, clang does not. This fixes the 'netstat: no namelist' > error seen on clang+VNET systems. > > Modified: > head/sys/kern/kern_shutdown.c That would be a bug in clang if it were done for static symbols generally, but here the bug seems to be that the symbol is not declared as __used. gcc does the same for a file containing only "static int x;", but it is apparently confused by dumptid being initialized non-statically, although the initialization has no side effects. If dumptid were a local variable, then clang would probably warn about the variable being unused, but gcc-4.2.1 never detects such unused variables (thus code that compiles with gcc -Wunused -Werror often fails with clang). Here the initialization is to curthread->td_tid, so it isn't clear if the compiler can tell if it has no side effects. curthread() is actually __curthread(). __curthread() is now declared as __pure2, but that never worked for me with older compilers (its result wasn't cached). If the compilers can tell that the expression has no side effects, then it is another bug that they don't warn about it having no effect when it is only assigned to the apparently-unused variable dumptid. > Modified: head/sys/kern/kern_shutdown.c > ============================================================================== > --- head/sys/kern/kern_shutdown.c Tue May 22 07:04:23 2012 (r235776) > +++ head/sys/kern/kern_shutdown.c Tue May 22 07:23:41 2012 (r235777) > @@ -151,7 +151,7 @@ static struct dumperinfo dumper; /* our > > /* Context information for dump-debuggers. */ > static struct pcb dumppcb; /* Registers. */ > -static lwpid_t dumptid; /* Thread ID. */ > +lwpid_t dumptid; /* Thread ID. */ > > static void poweroff_wait(void *, int); > static void shutdown_halt(void *junk, int howto); Now there are 3 bugs instead of 1: - the variable is declared (implicit) extern instead of static - the extern declaration is in a section for static declaration - the variable is still not declared as __used. If the compiler did a more extensive usage analysis, that looked at all object files but not at the libkvm API, then it should remove this variable anyway when it is not declared as __used. Bruce From owner-svn-src-head@FreeBSD.ORG Tue May 22 11:53:41 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79DDF1065673; Tue, 22 May 2012 11:53:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 01D428FC19; Tue, 22 May 2012 11:53:40 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4MBrWv4023321 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 May 2012 21:53:33 +1000 Date: Tue, 22 May 2012 21:53:32 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hartmut Brandt In-Reply-To: <201205220959.q4M9xoB2095552@svn.freebsd.org> Message-ID: <20120522214349.I1971@besplex.bde.org> References: <201205220959.q4M9xoB2095552@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235780 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 11:53:41 -0000 On Tue, 22 May 2012, Hartmut Brandt wrote: > Log: > Fix a compilation error with some compilers: __attribute__ > requires two parenthesis for its argument, but instead of using > __attribute__ directly, use the appropriate __nonnull macro > from cdefs.h. This also fixes: - the style bug of hard-coding __attribute__(()) - the namespace pollution of using nonnull() instead of __nonnull__(). > Modified: head/include/malloc_np.h > ============================================================================== > --- head/include/malloc_np.h Tue May 22 09:27:57 2012 (r235779) > +++ head/include/malloc_np.h Tue May 22 09:59:49 2012 (r235780) > @@ -55,13 +55,11 @@ int mallctlbymib(const size_t *mib, size > #define ALLOCM_ERR_OOM 1 > #define ALLOCM_ERR_NOT_MOVED 2 > > -int allocm(void **ptr, size_t *rsize, size_t size, int flags) > - __attribute__(nonnull(1)); > +int allocm(void **ptr, size_t *rsize, size_t size, int flags) __nonnull(1); > int rallocm(void **ptr, size_t *rsize, size_t size, size_t extra, > - int flags) __attribute__(nonnull(1)); > -int sallocm(const void *ptr, size_t *rsize, int flags) > - __attribute__(nonnull(1)); > -int dallocm(void *ptr, int flags) __attribute__(nonnull(1)); > + int flags) __nonnull(1); > +int sallocm(const void *ptr, size_t *rsize, int flags) __nonnull(1); > +int dallocm(void *ptr, int flags) __nonnull(1); > int nallocm(size_t *rsize, size_t size, int flags); > __END_DECLS Many unfixed bugs are visible nearby, starting with the namespace pollution of parameter names in the application namespace. Bruce From owner-svn-src-head@FreeBSD.ORG Tue May 22 12:47:48 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D14B8106566C; Tue, 22 May 2012 12:47:48 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from mailhost.dlr.de (mailhost.dlr.de [129.247.252.32]) by mx1.freebsd.org (Postfix) with ESMTP id 3879D8FC1D; Tue, 22 May 2012 12:47:48 +0000 (UTC) Received: from DLREXHUB01.intra.dlr.de (172.21.152.130) by dlrexedge01.dlr.de (172.21.163.100) with Microsoft SMTP Server (TLS) id 14.2.298.4; Tue, 22 May 2012 14:45:54 +0200 Received: from KNOP-BEAGLE.kn.op.dlr.de (129.247.178.136) by smtp.dlr.de (172.21.152.151) with Microsoft SMTP Server (TLS) id 14.2.298.4; Tue, 22 May 2012 14:45:55 +0200 Date: Tue, 22 May 2012 14:46:01 +0200 From: Hartmut Brandt X-X-Sender: brandt_h@KNOP-BEAGLE.kn.op.dlr.de To: Bruce Evans In-Reply-To: <20120522212307.V1971@besplex.bde.org> Message-ID: References: <201205220723.q4M7Ng2I091715@svn.freebsd.org> <20120522212307.V1971@besplex.bde.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [129.247.178.136] Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Hartmut Brandt Subject: Re: svn commit: r235777 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 12:47:49 -0000 On Tue, 22 May 2012, Bruce Evans wrote: BE>On Tue, 22 May 2012, Hartmut Brandt wrote: BE> BE>> Log: BE>> Make dumptid non-static. It is used by libkvm to detect whether BE>> this is a VNET-kernel or not. gcc used to put the static symbol into BE>> the symbol table, clang does not. This fixes the 'netstat: no namelist' BE>> error seen on clang+VNET systems. BE>> BE>> Modified: BE>> head/sys/kern/kern_shutdown.c BE> BE>That would be a bug in clang if it were done for static symbols generally, BE>but here the bug seems to be that the symbol is not declared as __used. I don't get this. Why should a symbol declared static be in the symbol table (except for debugging purposes) ? It has internal linkage and so has a meaning only in the given file. What is the linker supposed to do with several static symbols with the same name from several object files? If several files declared static dumptids, which one would kldsym be supposed to return? harti BE> BE>gcc does the same for a file containing only "static int x;", but it BE>is apparently confused by dumptid being initialized non-statically, BE>although the initialization has no side effects. If dumptid were a BE>local variable, then clang would probably warn about the variable being BE>unused, but gcc-4.2.1 never detects such unused variables (thus code BE>that compiles with gcc -Wunused -Werror often fails with clang). Here BE>the initialization is to curthread->td_tid, so it isn't clear if the BE>compiler can tell if it has no side effects. curthread() is actually BE>__curthread(). __curthread() is now declared as __pure2, but that BE>never worked for me with older compilers (its result wasn't cached). BE>If the compilers can tell that the expression has no side effects, BE>then it is another bug that they don't warn about it having no effect BE>when it is only assigned to the apparently-unused variable dumptid. BE> BE>> Modified: head/sys/kern/kern_shutdown.c BE>> ============================================================================== BE>> --- head/sys/kern/kern_shutdown.c Tue May 22 07:04:23 2012 BE>> (r235776) BE>> +++ head/sys/kern/kern_shutdown.c Tue May 22 07:23:41 2012 BE>> (r235777) BE>> @@ -151,7 +151,7 @@ static struct dumperinfo dumper; /* our BE>> BE>> /* Context information for dump-debuggers. */ BE>> static struct pcb dumppcb; /* Registers. */ BE>> -static lwpid_t dumptid; /* Thread ID. */ BE>> +lwpid_t dumptid; /* Thread ID. */ BE>> BE>> static void poweroff_wait(void *, int); BE>> static void shutdown_halt(void *junk, int howto); BE> BE>Now there are 3 bugs instead of 1: BE>- the variable is declared (implicit) extern instead of static BE>- the extern declaration is in a section for static declaration BE>- the variable is still not declared as __used. If the compiler did BE> a more extensive usage analysis, that looked at all object files but BE> not at the libkvm API, then it should remove this variable anyway BE> when it is not declared as __used. BE> BE>Bruce BE> BE> From owner-svn-src-head@FreeBSD.ORG Tue May 22 13:32:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9DBB6106564A; Tue, 22 May 2012 13:32:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from springbank.echomania.com (andric.com [IPv6:2001:888:2003:1001:230:48ff:fe51:76b6]) by mx1.freebsd.org (Postfix) with ESMTP id 323CF8FC08; Tue, 22 May 2012 13:32:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from [192.168.1.6] (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id 3A123A7071; Tue, 22 May 2012 15:31:41 +0200 (CEST) Message-ID: <4FBB9551.6060407@FreeBSD.org> Date: Tue, 22 May 2012 15:32:01 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120512 Thunderbird/13.0 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> In-Reply-To: <86likkpla9.fsf@ds4.des.no> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 13:32:04 -0000 On 2012-05-22 12:22, Dag-Erling Sm=C3=B8rgrav wrote: > Baptiste Daroussin writes: >> Log: >> Import byacc from invisible island, it brings us lots of compatibili= ties with >> bison, keeping full compatibility with our previous yacc >> implementation. >=20 > This commit broke the build, in large part because Baptiste tested with= > Clang instead of GCC, and GCC generates a warning when compiling the > generated code. It doesn't seem to compile with clang either, at least not as of r235777:= /usr/src/bin/expr/expr.y:291:2: error: implicit declaration of function '= yyparse' is invalid in C99 [-Werror,-Wimplicit-function-declaration] yyparse(); ^ Note that it looks like the expr.c file is still generated with the system yacc, so I'm not entirely sure what's going on here... From owner-svn-src-head@FreeBSD.ORG Tue May 22 13:42:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 544581065702; Tue, 22 May 2012 13:42:48 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id B60048FC19; Tue, 22 May 2012 13:42:47 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 19D046B81; Tue, 22 May 2012 13:42:47 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id DB9959267; Tue, 22 May 2012 15:42:46 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Dimitry Andric References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> <4FBB9551.6060407@FreeBSD.org> Date: Tue, 22 May 2012 15:42:46 +0200 In-Reply-To: <4FBB9551.6060407@FreeBSD.org> (Dimitry Andric's message of "Tue, 22 May 2012 15:32:01 +0200") Message-ID: <86txz8nxgp.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 13:42:48 -0000 Dimitry Andric writes: > Note that it looks like the expr.c file is still generated with the > system yacc, so I'm not entirely sure what's going on here... Yes, I am currently testing a patch that (among other things) bumps __FreeBSD_version and makes yacc a bootstrap tool. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue May 22 14:20:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A597106566C; Tue, 22 May 2012 14:20:08 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id 466628FC18; Tue, 22 May 2012 14:20:08 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q4MEEfT5044659; Tue, 22 May 2012 09:14:41 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q4MEERTe036305 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 22 May 2012 09:14:28 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q4MEERTe036305 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1337696068; bh=9fY61Zwtw1yqm5BqFEQl/RTKjKKMrodLe2ejqn4XSYk=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=BsH6WQT6QcINcM1LmeUh1KkJGQVEHoYnFQWv6//iyFwtoMshM2Aq1sBhNXxCPLPEj u2uzCKOjwc5geQnm+Y3DvzZ0YF83pw3GLLT+ve1qeIly2bOl+yM7mExwUFT0BAKE9O ASGy7HNXlCxqtSUfhwimXDm0zzBwwx8W+Y0JFzpA= Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <20120522163814.T1056@besplex.bde.org> Date: Tue, 22 May 2012 09:14:27 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <41955DCF-552D-4E44-849D-8C2CD42D7B79@palisadesystems.com> References: <201205212104.q4LL4UDN072617@svn.freebsd.org> <20120522163814.T1056@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1278) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Tue, 22 May 2012 09:14:28 -0500 (CDT) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q4MEERTe036305 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=0.884, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, J_CHICKENPOX_54 0.60, J_CHICKENPOX_63 0.60, J_CHICKENPOX_83 0.60, RP_8BIT 1.98) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Guy Helmer Subject: Re: svn commit: r235739 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 14:20:08 -0000 On May 22, 2012, at 1:48 AM, Bruce Evans wrote: > On Mon, 21 May 2012, Guy Helmer wrote: >=20 >> Log: >> Apply style(9) to return and switch/case statements. >>=20 >> Reviewed by: delphij (prior version of the patch) >>=20 >> Modified: >> head/lib/libc/gen/getnetgrent.c >>=20 >> Modified: head/lib/libc/gen/getnetgrent.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/lib/libc/gen/getnetgrent.c Mon May 21 19:58:40 2012 = (r235738) >> +++ head/lib/libc/gen/getnetgrent.c Mon May 21 21:04:29 2012 = (r235739) >> ... >> @@ -311,32 +311,35 @@ _revnetgr_lookup(char* lookupdom, char* >>=20 >> for (rot =3D 0; ; rot++) { >> switch (rot) { >> - case(0): snprintf(key, MAXHOSTNAMELEN, "%s.%s", >> - str, dom?dom:lookupdom); >> - break; >> - case(1): snprintf(key, MAXHOSTNAMELEN, "%s.*", >> - str); >> - break; >> - case(2): snprintf(key, MAXHOSTNAMELEN, "*.%s", >> - dom?dom:lookupdom); >> - break; >> - case(3): snprintf(key, MAXHOSTNAMELEN, "*.*"); >> - break; >> - default: return(0); >> + case(0): >> + snprintf(key, MAXHOSTNAMELEN, "%s.%s", str, >> + dom ? dom : lookupdom); >> + break; >> + case(1): >> + snprintf(key, MAXHOSTNAMELEN, "%s.*", str); >> + break; >> + case(2): >> + snprintf(key, MAXHOSTNAMELEN, "*.%s", >> + dom ? dom : lookupdom); >> + break; >> + case(3): >> + snprintf(key, MAXHOSTNAMELEN, "*.*"); >> + break; >=20 > Thanks, but a fuller application would have removed the obfuscatory > parentheses that make case() look like a function call... >=20 >> + default: return (0); >=20 > ... and split the case statements after ":" in all cases. >=20 >> } >> y =3D yp_match(lookupdom, map, key, strlen(key), = &result, >> &resultlen); >=20 > You fixed the continuation indentation in the case statement but not = here. >=20 >> if (y =3D=3D 0) { >> rv =3D _listmatch(result, group, resultlen); >> free(result); >> - if (rv) return(1); >> + if (rv) return (1); >=20 > Another statement not started on a new line. >=20 >> } else if (y !=3D YPERR_KEY) { >> /* >> * If we get an error other than 'no >> * such key in map' then something is >> * wrong and we should stop the search. >> */ >> - return(-1); >> + return (-1); >> } >> } >> } >=20 > These style bugs weren't in the CSRG version of course. The YP code = added > many. The most obvious ones are the case(n) and gnu-style = continuation > indentation. >=20 I am not sure how to best resolve the long lines in the block of code to = free grp->ng_str[] elements. The indentation is quite deep at that = point, and breaking short statements over multiple lines would make the = code quite ugly. Would this resolve the other issues you pointed out? Index: lib/libc/gen/getnetgrent.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- lib/libc/gen/getnetgrent.c (revision 235784) +++ lib/libc/gen/getnetgrent.c (working copy) @@ -309,28 +309,30 @@ =20 for (rot =3D 0; ; rot++) { switch (rot) { - case(0): + case 0: snprintf(key, MAXHOSTNAMELEN, "%s.%s", str, dom ? dom : lookupdom); break; - case(1): + case 1: snprintf(key, MAXHOSTNAMELEN, "%s.*", str); break; - case(2): + case 2: snprintf(key, MAXHOSTNAMELEN, "*.%s", dom ? dom : lookupdom); break; - case(3): + case 3: snprintf(key, MAXHOSTNAMELEN, "*.*"); break; - default: return (0); + default: + return (0); } y =3D yp_match(lookupdom, map, key, strlen(key), = &result, - &resultlen); + &resultlen); if (y =3D=3D 0) { rv =3D _listmatch(result, group, resultlen); free(result); - if (rv) return (1); + if (rv) + return (1); } else if (y !=3D YPERR_KEY) { /* * If we get an error other than 'no @@ -418,7 +420,7 @@ parse_netgrp(const char *group) { char *spos, *epos; - int len, strpos; + int len, strpos, freepos; #ifdef DEBUG int fields; #endif @@ -476,17 +478,16 @@ } else len =3D strlen(spos); if (len > 0) { - grp->ng_str[strpos] =3D = (char *) - malloc(len + 1); + grp->ng_str[strpos] =3D + malloc(len + 1); if (grp->ng_str[strpos] = =3D=3D NULL) { - int freepos; for (freepos =3D = 0; freepos < strpos; freepos++) = free(grp->ng_str[freepos]); free(grp); return (1); } bcopy(spos, = grp->ng_str[strpos], - len + 1); + len + 1); } } else { /* @@ -508,13 +509,13 @@ * stay silent by default for compatibility's = sake. */ if (fields < 3) - fprintf(stderr, "Bad entry = (%s%s%s%s%s) in netgroup \"%s\"\n", - grp->ng_str[NG_HOST] =3D=3D= NULL ? "" : grp->ng_str[NG_HOST], - grp->ng_str[NG_USER] =3D=3D= NULL ? "" : ",", - grp->ng_str[NG_USER] =3D=3D= NULL ? "" : grp->ng_str[NG_USER], - grp->ng_str[NG_DOM] =3D=3D= NULL ? "" : ",", - grp->ng_str[NG_DOM] =3D=3D= NULL ? "" : grp->ng_str[NG_DOM], - lp->l_groupname); + fprintf(stderr, "Bad entry (%s%s%s%s%s) = in netgroup \"%s\"\n", + grp->ng_str[NG_HOST] =3D=3D NULL ? = "" : grp->ng_str[NG_HOST], + grp->ng_str[NG_USER] =3D=3D NULL ? = "" : ",", + grp->ng_str[NG_USER] =3D=3D NULL ? = "" : grp->ng_str[NG_USER], + grp->ng_str[NG_DOM] =3D=3D NULL ? "" = : ",", + grp->ng_str[NG_DOM] =3D=3D NULL ? "" = : grp->ng_str[NG_DOM], + lp->l_groupname); #endif } else { spos =3D strsep(&pos, ", \t"); @@ -552,7 +553,7 @@ = if(yp_get_default_domain(&_netgr_yp_domain)) continue; if (yp_match(_netgr_yp_domain, "netgroup", = group, - strlen(group), &result, = &resultlen)) { + strlen(group), &result, &resultlen)) { free(result); if (_use_only_yp) return ((struct linelist *)0); @@ -613,7 +614,7 @@ } else cont =3D 0; if (len > 0) { - linep =3D (char = *)reallocf(linep, olen + len + 1); + linep =3D reallocf(linep, olen + = len + 1); if (linep =3D=3D NULL) { free(lp->l_groupname); free(lp); -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-head@FreeBSD.ORG Tue May 22 14:44:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B32106566C; Tue, 22 May 2012 14:44:36 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 50D798FC17; Tue, 22 May 2012 14:44:35 +0000 (UTC) Received: by qcsg15 with SMTP id g15so5076425qcs.13 for ; Tue, 22 May 2012 07:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=zRejOaO8OESRFMS7+XA8jlCiiMDx7qyYYk33c78BgdI=; b=b/yCzNoU9nRrgDtPDt7v1fgOPOz0Fig8xji0+RFyPaNznf8J13hGpV76bxB6CfHrjC BXjoNAzA3pxXc7ImLfBz3912lKQ3mlgPriS9F3NiveFCERFuzq4Z5uF5Vrrom0ZfSA4B olZTipM52S0MGMJp4veWnwqh1KexFMY6A4spGNjfzqSO+kpfE/Lnr31UGzQoFnoF8IcZ vfbo282ZGUBVI1OIuFjZN9rEX6gblNqdKhI1/bu7f6M9w1GZJKPBecyE+i+hXd03vGX3 3mAWcfmksMeGSxaH2tRcWfhT6F1FdDbC7isAbopUeIEnm9GDcGkUYnYjO6uo/fpsJvAd cr3w== MIME-Version: 1.0 Received: by 10.60.20.70 with SMTP id l6mr22911858oee.38.1337697874433; Tue, 22 May 2012 07:44:34 -0700 (PDT) Received: by 10.76.153.72 with HTTP; Tue, 22 May 2012 07:44:34 -0700 (PDT) In-Reply-To: <4FBB9551.6060407@FreeBSD.org> References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> <4FBB9551.6060407@FreeBSD.org> Date: Tue, 22 May 2012 07:44:34 -0700 Message-ID: From: Garrett Cooper To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= , Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 14:44:36 -0000 On Tue, May 22, 2012 at 6:32 AM, Dimitry Andric wrote: > On 2012-05-22 12:22, Dag-Erling Sm=F8rgrav wrote: >> Baptiste Daroussin writes: >>> Log: >>> =A0 Import byacc from invisible island, it brings us lots of compatibil= ities with >>> =A0 bison, keeping full compatibility with our previous yacc >>> =A0 implementation. >> >> This commit broke the build, in large part because Baptiste tested with >> Clang instead of GCC, and GCC generates a warning when compiling the >> generated code. > > It doesn't seem to compile with clang either, at least not as of r235777: > > /usr/src/bin/expr/expr.y:291:2: error: implicit declaration of function '= yyparse' is invalid in C99 [-Werror,-Wimplicit-function-declaration] > =A0 =A0 =A0 =A0yyparse(); > =A0 =A0 =A0 =A0^ > > Note that it looks like the expr.c file is still generated with the > system yacc, so I'm not entirely sure what's going on here... I mentioned it in a private email, but the issue is that the yacc used during the build seems to be coming from the base system (despite the fact that it's a bootstrap tool). Once I installed yacc onto my stable-9 system at work, all of the changes that should have been checked in with this commit became apparent. Thanks, -Garrett 1022 .if ${BOOTSTRAPPING} < 900006 1023 _lex=3D usr.bin/lex 1024 _yacc=3D usr.bin/yacc 1025 .endif # ... 1068 bootstrap-tools: 1069 .for _tool in \ 1070 ${_clang_tblgen} \ 1071 ${_kerberos5_bootstrap_tools} \ 1072 ${_dtrace_tools} \ 1073 ${_strfile} \ 1074 ${_gperf} \ 1075 ${_groff} \ 1076 ${_ar} \ 1077 ${_dtc} \ 1078 ${_awk} \ 1079 usr.bin/lorder \ 1080 usr.bin/makewhatis \ 1081 ${_mklocale} \ 1082 usr.bin/rpcgen \ 1083 ${_sed} \ 1084 ${_lex} \ 1085 ${_yacc} \ From owner-svn-src-head@FreeBSD.ORG Tue May 22 15:04:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E037106574B; Tue, 22 May 2012 15:04:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from springbank.echomania.com (andric.com [IPv6:2001:888:2003:1001:230:48ff:fe51:76b6]) by mx1.freebsd.org (Postfix) with ESMTP id 1A1CF8FC0A; Tue, 22 May 2012 15:04:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from [192.168.1.6] (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id A289CA7071; Tue, 22 May 2012 17:03:38 +0200 (CEST) Message-ID: <4FBBAADE.7000400@FreeBSD.org> Date: Tue, 22 May 2012 17:03:58 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120512 Thunderbird/13.0 MIME-Version: 1.0 To: Garrett Cooper References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> <4FBB9551.6060407@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 15:04:05 -0000 On 2012-05-22 16:44, Garrett Cooper wrote: ... > I mentioned it in a private email, but the issue is that the yacc > used during the build seems to be coming from the base system (despite > the fact that it's a bootstrap tool). Once I installed yacc onto my > stable-9 system at work, all of the changes that should have been > checked in with this commit became apparent. > Thanks, > -Garrett > > 1022 .if ${BOOTSTRAPPING} < 900006 Yes, Dag-Erling mentioned he will fix this particular test for head, which needs a version bump. Though I still think it might have been less churn if yacc had just continued to not declare yyparse()... :) From owner-svn-src-head@FreeBSD.ORG Tue May 22 15:08:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 402FB1065674; Tue, 22 May 2012 15:08:15 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id D7B6C8FC16; Tue, 22 May 2012 15:08:14 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 6438114E76B7; Tue, 22 May 2012 17:08:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qpB0VaAFqszY; Tue, 22 May 2012 17:08:07 +0200 (CEST) Received: from [192.168.1.117] (catv-80-98-232-12.catv.broadband.hu [80.98.232.12]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id B152C14E76B1; Tue, 22 May 2012 17:08:07 +0200 (CEST) Message-ID: <4FBBABD5.5070406@FreeBSD.org> Date: Tue, 22 May 2012 17:08:05 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120328 Thunderbird/13.0a2 MIME-Version: 1.0 To: Dimitry Andric References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> <4FBB9551.6060407@FreeBSD.org> <4FBBAADE.7000400@FreeBSD.org> In-Reply-To: <4FBBAADE.7000400@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Baptiste Daroussin , src-committers@freebsd.org, Garrett Cooper , svn-src-all@freebsd.org, =?ISO-8859-1?Q?Dag-Erling_Sm=F8?=, svn-src-head@freebsd.org, =?ISO-8859-1?Q?rgrav?= Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 15:08:15 -0000 On 2012.05.22. 17:03, Dimitry Andric wrote: > ... >> > I mentioned it in a private email, but the issue is that the yacc >> >used during the build seems to be coming from the base system (despite >> >the fact that it's a bootstrap tool). Once I installed yacc onto my >> >stable-9 system at work, all of the changes that should have been >> >checked in with this commit became apparent. >> >Thanks, >> >-Garrett >> > >> >1022 .if ${BOOTSTRAPPING} < 900006 > Yes, Dag-Erling mentioned he will fix this particular test for head, > which needs a version bump. Maybe I'm missing some point but what if we always use yacc and lex from the source tree instead of from the base system? That would be the most logical way of doing this and whether they are built early or just in the world phase does not make that much difference, does it? Gabor From owner-svn-src-head@FreeBSD.ORG Tue May 22 15:58:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E795B1065672; Tue, 22 May 2012 15:58:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D286F8FC15; Tue, 22 May 2012 15:58:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MFwRmh011480; Tue, 22 May 2012 15:58:27 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MFwRh6011477; Tue, 22 May 2012 15:58:27 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205221558.q4MFwRh6011477@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 22 May 2012 15:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235787 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 15:58:28 -0000 Author: trasz Date: Tue May 22 15:58:27 2012 New Revision: 235787 URL: http://svn.freebsd.org/changeset/base/235787 Log: Fix panic with RACCT that could occur in low memory (or out of swap) situations, due to fork1() calling racct_proc_exit() without calling racct_proc_fork() first. Submitted by: Mateusz Guzik (earlier version) Reviewed by: Mateusz Guzik Modified: head/sys/kern/kern_fork.c head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Tue May 22 15:26:55 2012 (r235786) +++ head/sys/kern/kern_fork.c Tue May 22 15:58:27 2012 (r235787) @@ -939,8 +939,8 @@ fail: #ifdef MAC mac_proc_destroy(newproc); #endif -fail1: racct_proc_exit(newproc); +fail1: if (vm2 != NULL) vmspace_free(vm2); uma_zfree(proc_zone, newproc); Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Tue May 22 15:26:55 2012 (r235786) +++ head/sys/kern/kern_racct.c Tue May 22 15:58:27 2012 (r235787) @@ -573,6 +573,9 @@ out: PROC_UNLOCK(child); PROC_UNLOCK(parent); + if (error != 0) + racct_proc_exit(child); + return (error); } From owner-svn-src-head@FreeBSD.ORG Tue May 22 15:59:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA21F106564A; Tue, 22 May 2012 15:59:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5AA28FC0A; Tue, 22 May 2012 15:59:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MFx7Ic011546; Tue, 22 May 2012 15:59:07 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MFx7li011543; Tue, 22 May 2012 15:59:07 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205221559.q4MFx7li011543@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 22 May 2012 15:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235788 - in head: . sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 15:59:07 -0000 Author: des Date: Tue May 22 15:59:07 2012 New Revision: 235788 URL: http://svn.freebsd.org/changeset/base/235788 Log: Bump __FreeBSD_version for the byacc import, and update _bootstrap_tools. Modified: head/Makefile.inc1 head/sys/sys/param.h Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 22 15:58:27 2012 (r235787) +++ head/Makefile.inc1 Tue May 22 15:59:07 2012 (r235788) @@ -1021,6 +1021,9 @@ _sed= usr.bin/sed .if ${BOOTSTRAPPING} < 900006 _lex= usr.bin/lex +.endif + +.if ${BOOTSTRAPPING} < 1000013 _yacc= usr.bin/yacc .endif @@ -1081,8 +1084,8 @@ bootstrap-tools: ${_mklocale} \ usr.bin/rpcgen \ ${_sed} \ - ${_lex} \ ${_yacc} \ + ${_lex} \ usr.bin/xinstall \ ${_gensnmptree} \ usr.sbin/config Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue May 22 15:58:27 2012 (r235787) +++ head/sys/sys/param.h Tue May 22 15:59:07 2012 (r235788) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000012 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000013 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Tue May 22 16:01:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF5B1106564A; Tue, 22 May 2012 16:01:38 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 974128FC12; Tue, 22 May 2012 16:01:38 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 904856BF4; Tue, 22 May 2012 16:01:32 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 374AD928A; Tue, 22 May 2012 18:01:32 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Gabor Kovesdan References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> <4FBB9551.6060407@FreeBSD.org> <4FBBAADE.7000400@FreeBSD.org> <4FBBABD5.5070406@FreeBSD.org> Date: Tue, 22 May 2012 18:01:31 +0200 In-Reply-To: <4FBBABD5.5070406@FreeBSD.org> (Gabor Kovesdan's message of "Tue, 22 May 2012 17:08:05 +0200") Message-ID: <86pq9wnr1g.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Baptiste Daroussin , src-committers@freebsd.org, Garrett Cooper , svn-src-all@freebsd.org, Dimitry Andric , svn-src-head@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 16:01:39 -0000 Gabor Kovesdan writes: > Maybe I'm missing some point but what if we always use yacc and lex > from the source tree instead of from the base system? That would be > the most logical way of doing this and whether they are built early or > just in the world phase does not make that much difference, does it? Bootstrap tools are built twice, so we try to only build them when we know that we need them, i.e. when cross-building (for machine-dependent tools) or when building on a system that has an older, incompatible version of the tool. For lex and yacc, the latter case applies, since they are machine-independent. My final test build just completed. I just committed the version bump and the bootstrap change; Baptiste will commit the yyparse() fix later today. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue May 22 16:33:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3D621065693; Tue, 22 May 2012 16:33:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89B4B8FC0C; Tue, 22 May 2012 16:33:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MGXBhU013183; Tue, 22 May 2012 16:33:11 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MGXBsk013178; Tue, 22 May 2012 16:33:11 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201205221633.q4MGXBsk013178@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 22 May 2012 16:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235789 - in head: sbin/devd sbin/hastd usr.bin/ar usr.bin/bc usr.bin/find usr.bin/m4 usr.bin/mkcsmapper usr.bin/mklocale usr.sbin/bluetooth/bthidd usr.sbin/bluetooth/hcsecd usr.sbin/co... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 16:33:11 -0000 Author: bapt Date: Tue May 22 16:33:10 2012 New Revision: 235789 URL: http://svn.freebsd.org/changeset/base/235789 Log: Fix world after byacc import: - old yacc(1) use to magicially append stdlib.h, while new one don't - new yacc(1) do declare yyparse by itself, fix redundant declaration of 'yyparse' Approved by: des (mentor) Modified: head/sbin/devd/parse.y head/sbin/hastd/hast.h head/sbin/hastd/parse.y head/usr.bin/ar/acpyacc.y head/usr.bin/bc/bc.y head/usr.bin/find/getdate.y head/usr.bin/m4/parser.y head/usr.bin/mkcsmapper/ldef.h head/usr.bin/mklocale/extern.h head/usr.sbin/bluetooth/bthidd/parser.y head/usr.sbin/bluetooth/hcsecd/parser.y head/usr.sbin/config/config.h head/usr.sbin/config/main.c head/usr.sbin/fifolog/lib/getdate.y head/usr.sbin/jail/config.c head/usr.sbin/jail/jailp.h Modified: head/sbin/devd/parse.y ============================================================================== --- head/sbin/devd/parse.y Tue May 22 15:59:07 2012 (r235788) +++ head/sbin/devd/parse.y Tue May 22 16:33:10 2012 (r235789) @@ -29,6 +29,7 @@ * $FreeBSD$ */ +#include #include "devd.h" #include #include Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Tue May 22 15:59:07 2012 (r235788) +++ head/sbin/hastd/hast.h Tue May 22 16:33:10 2012 (r235789) @@ -244,6 +244,5 @@ void yy_config_free(struct hastd_config void yyerror(const char *); int yylex(void); -int yyparse(void); #endif /* !_HAST_H_ */ Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Tue May 22 15:59:07 2012 (r235788) +++ head/sbin/hastd/parse.y Tue May 22 16:33:10 2012 (r235789) @@ -77,332 +77,483 @@ static int depth1_metaflush; extern void yyrestart(FILE *); -static int -isitme(const char *name) -{ - char buf[MAXHOSTNAMELEN]; - char *pos; - size_t bufsize; - - /* - * First check if the given name matches our full hostname. - */ - if (gethostname(buf, sizeof(buf)) < 0) { - pjdlog_errno(LOG_ERR, "gethostname() failed"); - return (-1); - } - if (strcmp(buf, name) == 0) - return (1); +static int isitme(const char *name); +static bool family_supported(int family); +static int node_names(char **namesp); +%} - /* - * Now check if it matches first part of the host name. - */ - pos = strchr(buf, '.'); - if (pos != NULL && (size_t)(pos - buf) == strlen(name) && - strncmp(buf, name, pos - buf) == 0) { - return (1); - } +%token CONTROL PIDFILE LISTEN REPLICATION CHECKSUM COMPRESSION METAFLUSH +%token TIMEOUT EXEC RESOURCE NAME LOCAL REMOTE SOURCE ON OFF +%token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 HOLE LZF +%token NUM STR OB CB - /* - * At the end check if name is equal to our host's UUID. - */ - bufsize = sizeof(buf); - if (sysctlbyname("kern.hostuuid", buf, &bufsize, NULL, 0) < 0) { - pjdlog_errno(LOG_ERR, "sysctlbyname(kern.hostuuid) failed"); - return (-1); - } - if (strcasecmp(buf, name) == 0) - return (1); +%type remote_str +%type replication_type +%type checksum_type +%type compression_type +%type boolean - /* - * Looks like this isn't about us. - */ - return (0); +%union +{ + int num; + char *str; } -static bool -family_supported(int family) -{ - int sock; +%token NUM +%token STR - sock = socket(family, SOCK_STREAM, 0); - if (sock == -1 && errno == EPROTONOSUPPORT) - return (false); - if (sock >= 0) - (void)close(sock); - return (true); -} +%% -static int -node_names(char **namesp) -{ - static char names[MAXHOSTNAMELEN * 3]; - char buf[MAXHOSTNAMELEN]; - char *pos; - size_t bufsize; +statements: + | + statements statement + ; - if (gethostname(buf, sizeof(buf)) < 0) { - pjdlog_errno(LOG_ERR, "gethostname() failed"); - return (-1); +statement: + control_statement + | + pidfile_statement + | + listen_statement + | + replication_statement + | + checksum_statement + | + compression_statement + | + timeout_statement + | + exec_statement + | + metaflush_statement + | + node_statement + | + resource_statement + ; + +control_statement: CONTROL STR + { + switch (depth) { + case 0: + if (strlcpy(depth0_control, $2, + sizeof(depth0_control)) >= + sizeof(depth0_control)) { + pjdlog_error("control argument is too long."); + free($2); + return (1); + } + break; + case 1: + if (!mynode) + break; + if (strlcpy(lconfig->hc_controladdr, $2, + sizeof(lconfig->hc_controladdr)) >= + sizeof(lconfig->hc_controladdr)) { + pjdlog_error("control argument is too long."); + free($2); + return (1); + } + break; + default: + PJDLOG_ABORT("control at wrong depth level"); + } + free($2); } + ; - /* First component of the host name. */ - pos = strchr(buf, '.'); - if (pos != NULL && pos != buf) { - (void)strlcpy(names, buf, MIN((size_t)(pos - buf + 1), - sizeof(names))); - (void)strlcat(names, ", ", sizeof(names)); +pidfile_statement: PIDFILE STR + { + switch (depth) { + case 0: + if (strlcpy(depth0_pidfile, $2, + sizeof(depth0_pidfile)) >= + sizeof(depth0_pidfile)) { + pjdlog_error("pidfile argument is too long."); + free($2); + return (1); + } + break; + case 1: + if (!mynode) + break; + if (strlcpy(lconfig->hc_pidfile, $2, + sizeof(lconfig->hc_pidfile)) >= + sizeof(lconfig->hc_pidfile)) { + pjdlog_error("pidfile argument is too long."); + free($2); + return (1); + } + break; + default: + PJDLOG_ABORT("pidfile at wrong depth level"); + } + free($2); } + ; - /* Full host name. */ - (void)strlcat(names, buf, sizeof(names)); - (void)strlcat(names, ", ", sizeof(names)); +listen_statement: LISTEN STR + { + struct hastd_listen *lst; - /* Host UUID. */ - bufsize = sizeof(buf); - if (sysctlbyname("kern.hostuuid", buf, &bufsize, NULL, 0) < 0) { - pjdlog_errno(LOG_ERR, "sysctlbyname(kern.hostuuid) failed"); - return (-1); + lst = calloc(1, sizeof(*lst)); + if (lst == NULL) { + pjdlog_error("Unable to allocate memory for listen address."); + free($2); + return (1); + } + if (strlcpy(lst->hl_addr, $2, sizeof(lst->hl_addr)) >= + sizeof(lst->hl_addr)) { + pjdlog_error("listen argument is too long."); + free($2); + free(lst); + return (1); + } + switch (depth) { + case 0: + TAILQ_INSERT_TAIL(&depth0_listen, lst, hl_next); + break; + case 1: + if (mynode) + TAILQ_INSERT_TAIL(&depth0_listen, lst, hl_next); + else + free(lst); + break; + default: + PJDLOG_ABORT("listen at wrong depth level"); + } + free($2); } - (void)strlcat(names, buf, sizeof(names)); - - *namesp = names; + ; - return (0); -} +replication_statement: REPLICATION replication_type + { + switch (depth) { + case 0: + depth0_replication = $2; + break; + case 1: + PJDLOG_ASSERT(curres != NULL); + curres->hr_replication = $2; + break; + default: + PJDLOG_ABORT("replication at wrong depth level"); + } + } + ; -void -yyerror(const char *str) -{ +replication_type: + FULLSYNC { $$ = HAST_REPLICATION_FULLSYNC; } + | + MEMSYNC { $$ = HAST_REPLICATION_MEMSYNC; } + | + ASYNC { $$ = HAST_REPLICATION_ASYNC; } + ; - pjdlog_error("Unable to parse configuration file at line %d near '%s': %s", - lineno, yytext, str); -} +checksum_statement: CHECKSUM checksum_type + { + switch (depth) { + case 0: + depth0_checksum = $2; + break; + case 1: + PJDLOG_ASSERT(curres != NULL); + curres->hr_checksum = $2; + break; + default: + PJDLOG_ABORT("checksum at wrong depth level"); + } + } + ; -struct hastd_config * -yy_config_parse(const char *config, bool exitonerror) -{ - int ret; - - curres = NULL; - mynode = false; - depth = 0; - lineno = 0; - - depth0_timeout = HAST_TIMEOUT; - depth0_replication = HAST_REPLICATION_FULLSYNC; - depth0_checksum = HAST_CHECKSUM_NONE; - depth0_compression = HAST_COMPRESSION_HOLE; - strlcpy(depth0_control, HAST_CONTROL, sizeof(depth0_control)); - strlcpy(depth0_pidfile, HASTD_PIDFILE, sizeof(depth0_pidfile)); - TAILQ_INIT(&depth0_listen); - strlcpy(depth0_listen_tcp4, HASTD_LISTEN_TCP4, - sizeof(depth0_listen_tcp4)); - strlcpy(depth0_listen_tcp6, HASTD_LISTEN_TCP6, - sizeof(depth0_listen_tcp6)); - depth0_exec[0] = '\0'; - depth0_metaflush = 1; +checksum_type: + NONE { $$ = HAST_CHECKSUM_NONE; } + | + CRC32 { $$ = HAST_CHECKSUM_CRC32; } + | + SHA256 { $$ = HAST_CHECKSUM_SHA256; } + ; - lconfig = calloc(1, sizeof(*lconfig)); - if (lconfig == NULL) { - pjdlog_error("Unable to allocate memory for configuration."); - if (exitonerror) - exit(EX_TEMPFAIL); - return (NULL); +compression_statement: COMPRESSION compression_type + { + switch (depth) { + case 0: + depth0_compression = $2; + break; + case 1: + PJDLOG_ASSERT(curres != NULL); + curres->hr_compression = $2; + break; + default: + PJDLOG_ABORT("compression at wrong depth level"); + } } + ; - TAILQ_INIT(&lconfig->hc_listen); - TAILQ_INIT(&lconfig->hc_resources); - - yyin = fopen(config, "r"); - if (yyin == NULL) { - pjdlog_errno(LOG_ERR, "Unable to open configuration file %s", - config); - yy_config_free(lconfig); - if (exitonerror) - exit(EX_OSFILE); - return (NULL); - } - yyrestart(yyin); - ret = yyparse(); - fclose(yyin); - if (ret != 0) { - yy_config_free(lconfig); - if (exitonerror) - exit(EX_CONFIG); - return (NULL); - } +compression_type: + NONE { $$ = HAST_COMPRESSION_NONE; } + | + HOLE { $$ = HAST_COMPRESSION_HOLE; } + | + LZF { $$ = HAST_COMPRESSION_LZF; } + ; - /* - * Let's see if everything is set up. - */ - if (lconfig->hc_controladdr[0] == '\0') { - strlcpy(lconfig->hc_controladdr, depth0_control, - sizeof(lconfig->hc_controladdr)); - } - if (lconfig->hc_pidfile[0] == '\0') { - strlcpy(lconfig->hc_pidfile, depth0_pidfile, - sizeof(lconfig->hc_pidfile)); +timeout_statement: TIMEOUT NUM + { + if ($2 <= 0) { + pjdlog_error("Negative or zero timeout."); + return (1); + } + switch (depth) { + case 0: + depth0_timeout = $2; + break; + case 1: + PJDLOG_ASSERT(curres != NULL); + curres->hr_timeout = $2; + break; + default: + PJDLOG_ABORT("timeout at wrong depth level"); + } } - if (!TAILQ_EMPTY(&depth0_listen)) - TAILQ_CONCAT(&lconfig->hc_listen, &depth0_listen, hl_next); - if (TAILQ_EMPTY(&lconfig->hc_listen)) { - struct hastd_listen *lst; + ; - if (family_supported(AF_INET)) { - lst = calloc(1, sizeof(*lst)); - if (lst == NULL) { - pjdlog_error("Unable to allocate memory for listen address."); - yy_config_free(lconfig); - if (exitonerror) - exit(EX_TEMPFAIL); - return (NULL); +exec_statement: EXEC STR + { + switch (depth) { + case 0: + if (strlcpy(depth0_exec, $2, sizeof(depth0_exec)) >= + sizeof(depth0_exec)) { + pjdlog_error("Exec path is too long."); + free($2); + return (1); } - (void)strlcpy(lst->hl_addr, depth0_listen_tcp4, - sizeof(lst->hl_addr)); - TAILQ_INSERT_TAIL(&lconfig->hc_listen, lst, hl_next); - } else { - pjdlog_debug(1, - "No IPv4 support in the kernel, not listening on IPv4 address."); - } - if (family_supported(AF_INET6)) { - lst = calloc(1, sizeof(*lst)); - if (lst == NULL) { - pjdlog_error("Unable to allocate memory for listen address."); - yy_config_free(lconfig); - if (exitonerror) - exit(EX_TEMPFAIL); - return (NULL); + break; + case 1: + PJDLOG_ASSERT(curres != NULL); + if (strlcpy(curres->hr_exec, $2, + sizeof(curres->hr_exec)) >= + sizeof(curres->hr_exec)) { + pjdlog_error("Exec path is too long."); + free($2); + return (1); } - (void)strlcpy(lst->hl_addr, depth0_listen_tcp6, - sizeof(lst->hl_addr)); - TAILQ_INSERT_TAIL(&lconfig->hc_listen, lst, hl_next); - } else { - pjdlog_debug(1, - "No IPv6 support in the kernel, not listening on IPv6 address."); - } - if (TAILQ_EMPTY(&lconfig->hc_listen)) { - pjdlog_error("No address to listen on."); - yy_config_free(lconfig); - if (exitonerror) - exit(EX_TEMPFAIL); - return (NULL); + break; + default: + PJDLOG_ABORT("exec at wrong depth level"); } + free($2); } - TAILQ_FOREACH(curres, &lconfig->hc_resources, hr_next) { - PJDLOG_ASSERT(curres->hr_provname[0] != '\0'); - PJDLOG_ASSERT(curres->hr_localpath[0] != '\0'); - PJDLOG_ASSERT(curres->hr_remoteaddr[0] != '\0'); + ; - if (curres->hr_replication == -1) { - /* - * Replication is not set at resource-level. - * Use global or default setting. - */ - curres->hr_replication = depth0_replication; - } - if (curres->hr_replication == HAST_REPLICATION_MEMSYNC) { - pjdlog_warning("Replication mode \"%s\" is not implemented, falling back to \"%s\".", - "memsync", "fullsync"); - curres->hr_replication = HAST_REPLICATION_FULLSYNC; - } - if (curres->hr_checksum == -1) { - /* - * Checksum is not set at resource-level. - * Use global or default setting. - */ - curres->hr_checksum = depth0_checksum; - } - if (curres->hr_compression == -1) { - /* - * Compression is not set at resource-level. - * Use global or default setting. - */ - curres->hr_compression = depth0_compression; - } - if (curres->hr_timeout == -1) { - /* - * Timeout is not set at resource-level. - * Use global or default setting. - */ - curres->hr_timeout = depth0_timeout; - } - if (curres->hr_exec[0] == '\0') { - /* - * Exec is not set at resource-level. - * Use global or default setting. - */ - strlcpy(curres->hr_exec, depth0_exec, - sizeof(curres->hr_exec)); - } - if (curres->hr_metaflush == -1) { - /* - * Metaflush is not set at resource-level. - * Use global or default setting. - */ - curres->hr_metaflush = depth0_metaflush; +metaflush_statement: METAFLUSH boolean + { + switch (depth) { + case 0: + depth0_metaflush = $2; + break; + case 1: + PJDLOG_ASSERT(curres != NULL); + depth1_metaflush = $2; + break; + case 2: + if (!mynode) + break; + PJDLOG_ASSERT(curres != NULL); + curres->hr_metaflush = $2; + break; + default: + PJDLOG_ABORT("metaflush at wrong depth level"); } } + ; - return (lconfig); -} - -void -yy_config_free(struct hastd_config *config) -{ - struct hastd_listen *lst; - struct hast_resource *res; +boolean: + ON { $$ = 1; } + | + OFF { $$ = 0; } + ; - while ((lst = TAILQ_FIRST(&depth0_listen)) != NULL) { - TAILQ_REMOVE(&depth0_listen, lst, hl_next); - free(lst); +node_statement: ON node_start OB node_entries CB + { + mynode = false; } - while ((lst = TAILQ_FIRST(&config->hc_listen)) != NULL) { - TAILQ_REMOVE(&config->hc_listen, lst, hl_next); - free(lst); - } - while ((res = TAILQ_FIRST(&config->hc_resources)) != NULL) { - TAILQ_REMOVE(&config->hc_resources, res, hr_next); - free(res); - } - free(config); -} -%} - -%token CONTROL PIDFILE LISTEN REPLICATION CHECKSUM COMPRESSION METAFLUSH -%token TIMEOUT EXEC RESOURCE NAME LOCAL REMOTE SOURCE ON OFF -%token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 HOLE LZF -%token NUM STR OB CB - -%type remote_str -%type replication_type -%type checksum_type -%type compression_type -%type boolean - -%union -{ - int num; - char *str; -} - -%token NUM -%token STR + ; -%% +node_start: STR + { + switch (isitme($1)) { + case -1: + free($1); + return (1); + case 0: + break; + case 1: + mynode = true; + break; + default: + PJDLOG_ABORT("invalid isitme() return value"); + } + free($1); + } + ; -statements: +node_entries: | - statements statement + node_entries node_entry ; -statement: +node_entry: control_statement | pidfile_statement | listen_statement + ; + +resource_statement: RESOURCE resource_start OB resource_entries CB + { + if (curres != NULL) { + /* + * There must be section for this node, at least with + * remote address configuration. + */ + if (!hadmynode) { + char *names; + + if (node_names(&names) != 0) + return (1); + pjdlog_error("No resource %s configuration for this node (acceptable node names: %s).", + curres->hr_name, names); + return (1); + } + + /* + * Let's see if there are some resource-level settings + * that we can use for node-level settings. + */ + if (curres->hr_provname[0] == '\0' && + depth1_provname[0] != '\0') { + /* + * Provider name is not set at node-level, + * but is set at resource-level, use it. + */ + strlcpy(curres->hr_provname, depth1_provname, + sizeof(curres->hr_provname)); + } + if (curres->hr_localpath[0] == '\0' && + depth1_localpath[0] != '\0') { + /* + * Path to local provider is not set at + * node-level, but is set at resource-level, + * use it. + */ + strlcpy(curres->hr_localpath, depth1_localpath, + sizeof(curres->hr_localpath)); + } + if (curres->hr_metaflush == -1 && depth1_metaflush != -1) { + /* + * Metaflush is not set at node-level, + * but is set at resource-level, use it. + */ + curres->hr_metaflush = depth1_metaflush; + } + + /* + * If provider name is not given, use resource name + * as provider name. + */ + if (curres->hr_provname[0] == '\0') { + strlcpy(curres->hr_provname, curres->hr_name, + sizeof(curres->hr_provname)); + } + + /* + * Remote address has to be configured at this point. + */ + if (curres->hr_remoteaddr[0] == '\0') { + pjdlog_error("Remote address not configured for resource %s.", + curres->hr_name); + return (1); + } + /* + * Path to local provider has to be configured at this + * point. + */ + if (curres->hr_localpath[0] == '\0') { + pjdlog_error("Path to local component not configured for resource %s.", + curres->hr_name); + return (1); + } + + /* Put it onto resource list. */ + TAILQ_INSERT_TAIL(&lconfig->hc_resources, curres, hr_next); + curres = NULL; + } + } + ; + +resource_start: STR + { + /* Check if there is no duplicate entry. */ + TAILQ_FOREACH(curres, &lconfig->hc_resources, hr_next) { + if (strcmp(curres->hr_name, $1) == 0) { + pjdlog_error("Resource %s configured more than once.", + curres->hr_name); + free($1); + return (1); + } + } + + /* + * Clear those, so we can tell if they were set at + * resource-level or not. + */ + depth1_provname[0] = '\0'; + depth1_localpath[0] = '\0'; + depth1_metaflush = -1; + hadmynode = false; + + curres = calloc(1, sizeof(*curres)); + if (curres == NULL) { + pjdlog_error("Unable to allocate memory for resource."); + free($1); + return (1); + } + if (strlcpy(curres->hr_name, $1, + sizeof(curres->hr_name)) >= + sizeof(curres->hr_name)) { + pjdlog_error("Resource name is too long."); + free(curres); + free($1); + return (1); + } + free($1); + curres->hr_role = HAST_ROLE_INIT; + curres->hr_previous_role = HAST_ROLE_INIT; + curres->hr_replication = -1; + curres->hr_checksum = -1; + curres->hr_compression = -1; + curres->hr_timeout = -1; + curres->hr_exec[0] = '\0'; + curres->hr_provname[0] = '\0'; + curres->hr_localpath[0] = '\0'; + curres->hr_localfd = -1; + curres->hr_localflush = true; + curres->hr_metaflush = -1; + curres->hr_remoteaddr[0] = '\0'; + curres->hr_sourceaddr[0] = '\0'; + curres->hr_ggateunit = -1; + } + ; + +resource_entries: | + resource_entries resource_entry + ; + +resource_entry: replication_statement | checksum_statement @@ -415,592 +566,447 @@ statement: | metaflush_statement | - node_statement + name_statement | - resource_statement + local_statement + | + resource_node_statement ; -control_statement: CONTROL STR +name_statement: NAME STR { switch (depth) { - case 0: - if (strlcpy(depth0_control, $2, - sizeof(depth0_control)) >= - sizeof(depth0_control)) { - pjdlog_error("control argument is too long."); + case 1: + if (strlcpy(depth1_provname, $2, + sizeof(depth1_provname)) >= + sizeof(depth1_provname)) { + pjdlog_error("name argument is too long."); free($2); return (1); } break; - case 1: + case 2: if (!mynode) break; - if (strlcpy(lconfig->hc_controladdr, $2, - sizeof(lconfig->hc_controladdr)) >= - sizeof(lconfig->hc_controladdr)) { - pjdlog_error("control argument is too long."); + PJDLOG_ASSERT(curres != NULL); + if (strlcpy(curres->hr_provname, $2, + sizeof(curres->hr_provname)) >= + sizeof(curres->hr_provname)) { + pjdlog_error("name argument is too long."); free($2); return (1); } break; default: - PJDLOG_ABORT("control at wrong depth level"); + PJDLOG_ABORT("name at wrong depth level"); } free($2); } ; -pidfile_statement: PIDFILE STR +local_statement: LOCAL STR { switch (depth) { - case 0: - if (strlcpy(depth0_pidfile, $2, - sizeof(depth0_pidfile)) >= - sizeof(depth0_pidfile)) { - pjdlog_error("pidfile argument is too long."); + case 1: + if (strlcpy(depth1_localpath, $2, + sizeof(depth1_localpath)) >= + sizeof(depth1_localpath)) { + pjdlog_error("local argument is too long."); free($2); return (1); } break; - case 1: + case 2: if (!mynode) break; - if (strlcpy(lconfig->hc_pidfile, $2, - sizeof(lconfig->hc_pidfile)) >= - sizeof(lconfig->hc_pidfile)) { - pjdlog_error("pidfile argument is too long."); + PJDLOG_ASSERT(curres != NULL); + if (strlcpy(curres->hr_localpath, $2, + sizeof(curres->hr_localpath)) >= + sizeof(curres->hr_localpath)) { + pjdlog_error("local argument is too long."); free($2); return (1); } break; default: - PJDLOG_ABORT("pidfile at wrong depth level"); + PJDLOG_ABORT("local at wrong depth level"); } free($2); } ; -listen_statement: LISTEN STR +resource_node_statement:ON resource_node_start OB resource_node_entries CB { - struct hastd_listen *lst; - - lst = calloc(1, sizeof(*lst)); - if (lst == NULL) { - pjdlog_error("Unable to allocate memory for listen address."); - free($2); - return (1); - } - if (strlcpy(lst->hl_addr, $2, sizeof(lst->hl_addr)) >= - sizeof(lst->hl_addr)) { - pjdlog_error("listen argument is too long."); - free($2); - free(lst); - return (1); - } - switch (depth) { - case 0: - TAILQ_INSERT_TAIL(&depth0_listen, lst, hl_next); - break; - case 1: - if (mynode) - TAILQ_INSERT_TAIL(&depth0_listen, lst, hl_next); - else - free(lst); - break; - default: - PJDLOG_ABORT("listen at wrong depth level"); - } - free($2); + mynode = false; } ; -replication_statement: REPLICATION replication_type +resource_node_start: STR { - switch (depth) { - case 0: - depth0_replication = $2; - break; - case 1: - PJDLOG_ASSERT(curres != NULL); - curres->hr_replication = $2; - break; - default: - PJDLOG_ABORT("replication at wrong depth level"); + if (curres != NULL) { + switch (isitme($1)) { + case -1: + free($1); + return (1); + case 0: + break; + case 1: + mynode = hadmynode = true; + break; + default: + PJDLOG_ABORT("invalid isitme() return value"); + } } + free($1); } ; -replication_type: - FULLSYNC { $$ = HAST_REPLICATION_FULLSYNC; } - | - MEMSYNC { $$ = HAST_REPLICATION_MEMSYNC; } +resource_node_entries: | - ASYNC { $$ = HAST_REPLICATION_ASYNC; } - ; - -checksum_statement: CHECKSUM checksum_type - { - switch (depth) { - case 0: - depth0_checksum = $2; - break; - case 1: - PJDLOG_ASSERT(curres != NULL); - curres->hr_checksum = $2; - break; - default: - PJDLOG_ABORT("checksum at wrong depth level"); - } - } + resource_node_entries resource_node_entry ; -checksum_type: - NONE { $$ = HAST_CHECKSUM_NONE; } +resource_node_entry: + name_statement | - CRC32 { $$ = HAST_CHECKSUM_CRC32; } + local_statement | - SHA256 { $$ = HAST_CHECKSUM_SHA256; } + remote_statement + | + source_statement + | + metaflush_statement ; -compression_statement: COMPRESSION compression_type +remote_statement: REMOTE remote_str { - switch (depth) { - case 0: - depth0_compression = $2; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue May 22 16:51:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7F9A1065783; Tue, 22 May 2012 16:51:07 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 799508FC08; Tue, 22 May 2012 16:51:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4MGp7Qp066992; Tue, 22 May 2012 16:51:07 GMT (envelope-from bapt@freebsd.org) Received: (from bapt@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4MGp6Qk066935; Tue, 22 May 2012 16:51:06 GMT (envelope-from bapt@freebsd.org) X-Authentication-Warning: freefall.freebsd.org: bapt set sender to bapt@freebsd.org using -f Date: Tue, 22 May 2012 18:51:02 +0200 From: Baptiste Daroussin To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20120522165102.GP63744@ithaqua.etoilebsd.net> References: <201205211331.q4LDVRvB060077@svn.freebsd.org> <86likkpla9.fsf@ds4.des.no> <4FBB9551.6060407@FreeBSD.org> <4FBBAADE.7000400@FreeBSD.org> <4FBBABD5.5070406@FreeBSD.org> <86pq9wnr1g.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="R3SAtXwgGp429mN7" Content-Disposition: inline In-Reply-To: <86pq9wnr1g.fsf@ds4.des.no> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, Garrett Cooper , svn-src-all@freebsd.org, Dimitry Andric , Gabor Kovesdan , svn-src-head@freebsd.org Subject: Re: svn commit: r235723 - in head: contrib/byacc tools/regression/usr.bin/yacc usr.bin/yacc usr.bin/yacc/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 16:51:07 -0000 --R3SAtXwgGp429mN7 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 22, 2012 at 06:01:31PM +0200, Dag-Erling Sm=F8rgrav wrote: > Gabor Kovesdan writes: > > Maybe I'm missing some point but what if we always use yacc and lex > > from the source tree instead of from the base system? That would be > > the most logical way of doing this and whether they are built early or > > just in the world phase does not make that much difference, does it? >=20 > Bootstrap tools are built twice, so we try to only build them when we > know that we need them, i.e. when cross-building (for machine-dependent > tools) or when building on a system that has an older, incompatible > version of the tool. For lex and yacc, the latter case applies, since > they are machine-independent. >=20 > My final test build just completed. I just committed the version bump > and the bootstrap change; Baptiste will commit the yyparse() fix later > today. >=20 Should be done, sorry all for the mess, lots of lessons learned. regards, Bapt --R3SAtXwgGp429mN7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+7w/YACgkQ8kTtMUmk6EyVDACgpsXpGQyZS6R/LT4OHm/Q+lCA SxgAnisRQoaCw82iHOWPx1EaLjtg5qiQ =4pme -----END PGP SIGNATURE----- --R3SAtXwgGp429mN7-- From owner-svn-src-head@FreeBSD.ORG Tue May 22 16:56:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C5B81065672; Tue, 22 May 2012 16:56:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id EE8568FC16; Tue, 22 May 2012 16:56:00 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id B797F25D39FD; Tue, 22 May 2012 16:55:59 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id E18E7BE780A; Tue, 22 May 2012 16:55:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id jXGDNTkV4cam; Tue, 22 May 2012 16:55:57 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id C9742BE7809; Tue, 22 May 2012 16:55:57 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201205220723.q4M7Ng2I091715@svn.freebsd.org> Date: Tue, 22 May 2012 16:55:56 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <8BFFA477-46C2-49F6-804F-6D38B10AE7F7@FreeBSD.org> References: <201205220723.q4M7Ng2I091715@svn.freebsd.org> To: Hartmut Brandt X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235777 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 16:56:01 -0000 On 22. May 2012, at 07:23 , Hartmut Brandt wrote: > Author: harti > Date: Tue May 22 07:23:41 2012 > New Revision: 235777 > URL: http://svn.freebsd.org/changeset/base/235777 >=20 > Log: > Make dumptid non-static. It is used by libkvm to detect whether > this is a VNET-kernel or not. Just for clarifications - it's used to detect whether we are operating = on a crash dump or not in the vnet case. > gcc used to put the static symbol into > the symbol table, clang does not. This fixes the 'netstat: no = namelist' > error seen on clang+VNET systems. >=20 > Modified: > head/sys/kern/kern_shutdown.c >=20 > Modified: head/sys/kern/kern_shutdown.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/kern_shutdown.c Tue May 22 07:04:23 2012 = (r235776) > +++ head/sys/kern/kern_shutdown.c Tue May 22 07:23:41 2012 = (r235777) > @@ -151,7 +151,7 @@ static struct dumperinfo dumper; /* our=20 >=20 > /* Context information for dump-debuggers. */ > static struct pcb dumppcb; /* Registers. */ > -static lwpid_t dumptid; /* Thread ID. */ > +lwpid_t dumptid; /* Thread ID. */ >=20 > static void poweroff_wait(void *, int); > static void shutdown_halt(void *junk, int howto); --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Tue May 22 17:11:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82CD9106566B; Tue, 22 May 2012 17:11:19 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 548C48FC19; Tue, 22 May 2012 17:11:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MHBJMh015306; Tue, 22 May 2012 17:11:19 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MHBJK4015305; Tue, 22 May 2012 17:11:19 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201205221711.q4MHBJK4015305@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 22 May 2012 17:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235794 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 17:11:19 -0000 Author: obrien Date: Tue May 22 17:11:18 2012 New Revision: 235794 URL: http://svn.freebsd.org/changeset/base/235794 Log: Record that r235793 (-objc) has been merged from vendor/gcc into HEAD. Modified: Directory Properties: head/contrib/gcc/ (props changed) From owner-svn-src-head@FreeBSD.ORG Tue May 22 17:30:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 254321065679; Tue, 22 May 2012 17:30:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 101338FC15; Tue, 22 May 2012 17:30:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MHU2dU016197; Tue, 22 May 2012 17:30:02 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MHU2fW016196; Tue, 22 May 2012 17:30:02 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205221730.q4MHU2fW016196@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 22 May 2012 17:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235795 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 17:30:03 -0000 Author: trasz Date: Tue May 22 17:30:02 2012 New Revision: 235795 URL: http://svn.freebsd.org/changeset/base/235795 Log: Don't leak locks in prison_racct_modify(). Submitted by: Mateusz Guzik MFC after: 2 weeks Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue May 22 17:11:18 2012 (r235794) +++ head/sys/kern/kern_jail.c Tue May 22 17:30:02 2012 (r235795) @@ -4491,8 +4491,11 @@ prison_racct_modify(struct prison *pr) sx_slock(&allproc_lock); sx_xlock(&allprison_lock); - if (strcmp(pr->pr_name, pr->pr_prison_racct->prr_name) == 0) + if (strcmp(pr->pr_name, pr->pr_prison_racct->prr_name) == 0) { + sx_xunlock(&allprison_lock); + sx_sunlock(&allproc_lock); return; + } oldprr = pr->pr_prison_racct; pr->pr_prison_racct = NULL; From owner-svn-src-head@FreeBSD.ORG Tue May 22 18:03:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 715CA106566B; Tue, 22 May 2012 18:03:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 084418FC14; Tue, 22 May 2012 18:03:23 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4MI38rn006979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 May 2012 04:03:10 +1000 Date: Wed, 23 May 2012 04:03:08 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hartmut Brandt In-Reply-To: Message-ID: <20120523023228.L2766@besplex.bde.org> References: <201205220723.q4M7Ng2I091715@svn.freebsd.org> <20120522212307.V1971@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hartmut Brandt , Bruce Evans Subject: Re: svn commit: r235777 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 18:03:24 -0000 On Tue, 22 May 2012, Hartmut Brandt wrote: > On Tue, 22 May 2012, Bruce Evans wrote: > > BE>On Tue, 22 May 2012, Hartmut Brandt wrote: > BE> > BE>> Log: > BE>> Make dumptid non-static. It is used by libkvm to detect whether > BE>> this is a VNET-kernel or not. gcc used to put the static symbol into > BE>> the symbol table, clang does not. This fixes the 'netstat: no namelist' > BE>> error seen on clang+VNET systems. > BE>> > BE>> Modified: > BE>> head/sys/kern/kern_shutdown.c > BE> > BE>That would be a bug in clang if it were done for static symbols generally, > BE>but here the bug seems to be that the symbol is not declared as __used. > > I don't get this. Why should a symbol declared static be in the symbol > table (except for debugging purposes) ? It must be there for debugging purposes and historical compatibility (mainly other debugging uses, including kvm). Static symbols are not really special here. The C standard doesn't even require a symbol table, and it is only implementation details and debugging and historical compatibility that require putting global symbols in symbol tables. > It has internal linkage and so has > a meaning only in the given file. What is the linker supposed to do with > several static symbols with the same name from several object files? Same as it always did. The names are in per-object-file namespaces for the linker, so they don't conflict for linking, but they mess up primitive debuggers starting with nm. > If > several files declared static dumptids, which one would kldsym be supposed > to return? libkvm and kldsym would be broken. I don't know of any even non-primitive debuggers that can handle this. In gdb the only way that I know of to print a non-unique variable is to display the source file that declares the variable using something like `l' on a function in that file; the variable scope is then that of the selected file. The address "file.c:foo" only works for displaying functions. The latter probably depends on a full symbol table. When there is no symbol table, `l' of course doesn't work; `disass foo" works. "disass file.c:foo" of course doesn't work. "disass file.o:foo" should work, but doesn't, even when there is a full symbol table. When the "file.*:" address doesn't work, this is is initially because it misparsed as the symbol "file". Actually, I know of the primitive way which works even using ddb with all symbols broken in ddb, and have had to use this several times: you find the address of things using nm or something less primitive on another system, and guess which address to use if several variables have the same name, and type it in. BTW, kernels have lots of conflicting symbols which mess up debugging using primitive debuggers like ddb. /usr/src/tools/tools/kernxref/kernxref.sh was supposed to be used to find and fix these as well as finding and fixing public variables that should be static, but it is rarely used. uniq reports removing 382 out of 28443 (non-unique) symbols in a fairly current kernel with not many features configured. Bruce From owner-svn-src-head@FreeBSD.ORG Tue May 22 18:18:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EA091065674; Tue, 22 May 2012 18:18:07 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79BFF8FC14; Tue, 22 May 2012 18:18:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MII7d0019628; Tue, 22 May 2012 18:18:07 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MII7lk019626; Tue, 22 May 2012 18:18:07 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201205221818.q4MII7lk019626@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 22 May 2012 18:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 18:18:07 -0000 Author: obrien Date: Tue May 22 18:18:06 2012 New Revision: 235797 URL: http://svn.freebsd.org/changeset/base/235797 Log: Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit platforms. Modified: head/contrib/gcc/c-format.c Modified: head/contrib/gcc/c-format.c ============================================================================== --- head/contrib/gcc/c-format.c Tue May 22 17:44:01 2012 (r235796) +++ head/contrib/gcc/c-format.c Tue May 22 18:18:06 2012 (r235797) @@ -287,7 +287,11 @@ static const format_length_info printf_l { { "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 }, { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L }, +#ifdef __LP64__ + { "q", FMT_LEN_l, STD_EXT, NULL, 0, 0 }, +#else { "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, +#endif { "L", FMT_LEN_L, STD_C89, NULL, 0, 0 }, { "z", FMT_LEN_z, STD_C99, NULL, 0, 0 }, { "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 }, From owner-svn-src-head@FreeBSD.ORG Tue May 22 18:30:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 133E410657F3; Tue, 22 May 2012 18:30:33 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F27988FC0A; Tue, 22 May 2012 18:30:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MIUW5x020290; Tue, 22 May 2012 18:30:32 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MIUW7G020288; Tue, 22 May 2012 18:30:32 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201205221830.q4MIUW7G020288@svn.freebsd.org> From: Jamie Gritton Date: Tue, 22 May 2012 18:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235799 - head/lib/libjail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 18:30:33 -0000 Author: jamie Date: Tue May 22 18:30:32 2012 New Revision: 235799 URL: http://svn.freebsd.org/changeset/base/235799 Log: The fix in r235291 re-broke the "allow.nomount" case. Re-fix it by testing for the right parameter name. Modified: head/lib/libjail/jail.c Modified: head/lib/libjail/jail.c ============================================================================== --- head/lib/libjail/jail.c Tue May 22 18:30:14 2012 (r235798) +++ head/lib/libjail/jail.c Tue May 22 18:30:32 2012 (r235799) @@ -853,7 +853,7 @@ jailparam_free(struct jailparam *jp, uns static int jailparam_type(struct jailparam *jp) { - char *p, *nname; + char *p, *name, *nname; size_t miblen, desclen; int i, isarray; struct { @@ -863,7 +863,8 @@ jailparam_type(struct jailparam *jp) int mib[CTL_MAXNAME]; /* The "lastjid" parameter isn't real. */ - if (!strcmp(jp->jp_name, "lastjid")) { + name = jp->jp_name; + if (!strcmp(name, "lastjid")) { jp->jp_valuelen = sizeof(int); jp->jp_ctltype = CTLTYPE_INT | CTLFLAG_WR; return (0); @@ -872,19 +873,19 @@ jailparam_type(struct jailparam *jp) /* Find the sysctl that describes the parameter. */ mib[0] = 0; mib[1] = 3; - snprintf(desc.s, sizeof(desc.s), SJPARAM ".%s", jp->jp_name); + snprintf(desc.s, sizeof(desc.s), SJPARAM ".%s", name); miblen = sizeof(mib) - 2 * sizeof(int); if (sysctl(mib, 2, mib + 2, &miblen, desc.s, strlen(desc.s)) < 0) { if (errno != ENOENT) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "sysctl(0.3.%s): %s", jp->jp_name, strerror(errno)); + "sysctl(0.3.%s): %s", name, strerror(errno)); return (-1); } /* * The parameter probably doesn't exist. But it might be * the "no" counterpart to a boolean. */ - nname = nononame(jp->jp_name); + nname = nononame(name); if (nname == NULL) { unknown_parameter: snprintf(jail_errmsg, JAIL_ERRMSGLEN, @@ -892,8 +893,10 @@ jailparam_type(struct jailparam *jp) errno = ENOENT; return (-1); } - snprintf(desc.s, sizeof(desc.s), SJPARAM ".%s", nname); + name = alloca(strlen(nname) + 1); + strcpy(name, nname); free(nname); + snprintf(desc.s, sizeof(desc.s), SJPARAM ".%s", name); miblen = sizeof(mib) - 2 * sizeof(int); if (sysctl(mib, 2, mib + 2, &miblen, desc.s, strlen(desc.s)) < 0) @@ -906,7 +909,7 @@ jailparam_type(struct jailparam *jp) if (sysctl(mib, (miblen / sizeof(int)) + 2, &desc, &desclen, NULL, 0) < 0) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "sysctl(0.4.%s): %s", jp->jp_name, strerror(errno)); + "sysctl(0.4.%s): %s", name, strerror(errno)); return (-1); } jp->jp_ctltype = desc.i; @@ -952,7 +955,7 @@ jailparam_type(struct jailparam *jp) if (sysctl(mib + 2, miblen / sizeof(int), desc.s, &desclen, NULL, 0) < 0) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "sysctl(" SJPARAM ".%s): %s", jp->jp_name, + "sysctl(" SJPARAM ".%s): %s", name, strerror(errno)); return (-1); } @@ -970,7 +973,7 @@ jailparam_type(struct jailparam *jp) if (sysctl(mib + 2, miblen / sizeof(int), NULL, &jp->jp_valuelen, NULL, 0) < 0) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, - "sysctl(" SJPARAM ".%s): %s", jp->jp_name, + "sysctl(" SJPARAM ".%s): %s", name, strerror(errno)); return (-1); } @@ -995,10 +998,9 @@ jailparam_type(struct jailparam *jp) "sysctl(0.1): %s", strerror(errno)); return (-1); } - if (desclen == - sizeof(SJPARAM) + strlen(jp->jp_name) + 2 && + if (desclen == sizeof(SJPARAM) + strlen(name) + 2 && memcmp(SJPARAM ".", desc.s, sizeof(SJPARAM)) == 0 && - memcmp(jp->jp_name, desc.s + sizeof(SJPARAM), + memcmp(name, desc.s + sizeof(SJPARAM), desclen - sizeof(SJPARAM) - 2) == 0 && desc.s[desclen - 2] == '.') goto mib_desc; From owner-svn-src-head@FreeBSD.ORG Tue May 22 18:48:10 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3AA89106566B; Tue, 22 May 2012 18:48:10 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 167AF8FC18; Tue, 22 May 2012 18:48:09 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q4MIRFZd083193; Tue, 22 May 2012 11:27:15 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.5/Submit) id q4MIRF3P083192; Tue, 22 May 2012 11:27:15 -0700 (PDT) (envelope-from obrien) Date: Tue, 22 May 2012 11:27:15 -0700 From: "David O'Brien" To: "Pedro F. Giffuni" Message-ID: <20120522182715.GA83169@dragon.NUXI.org> References: <201205181902.q4IJ2ecZ070498@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201205181902.q4IJ2ecZ070498@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235623 - in head/contrib/gcc: . config/rs6000 config/sparc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 18:48:10 -0000 On Fri, May 18, 2012 at 07:02:40PM +0000, Pedro F. Giffuni wrote: > Log: > Bring in a subset of gcc fixes that were back ported to > the GCC 4.1 branch and are available under GPLv2. I do not understand this -- We're using GCC 4.2.1 @r127959, but you are bringing in patches that are against 4.1. What version of GCC were the changes back ported from if not 4.2.0 or 4.2.1? BTW, these also should have been imported into ^/vendor/gcc/ and then merged into ^/head/contrib/gcc as there are commercial users of FreeBSD that have to modify their compiler to be able to consume FreeBSD source code. And provenance and licensing matters to these folks. -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Tue May 22 19:30:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA69C1065672 for ; Tue, 22 May 2012 19:30:29 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm11.bullet.mail.bf1.yahoo.com (nm11.bullet.mail.bf1.yahoo.com [98.139.212.170]) by mx1.freebsd.org (Postfix) with SMTP id 425F18FC0A for ; Tue, 22 May 2012 19:30:29 +0000 (UTC) Received: from [98.139.212.147] by nm11.bullet.mail.bf1.yahoo.com with NNFMP; 22 May 2012 19:30:22 -0000 Received: from [98.139.211.205] by tm4.bullet.mail.bf1.yahoo.com with NNFMP; 22 May 2012 19:30:22 -0000 Received: from [127.0.0.1] by smtp214.mail.bf1.yahoo.com with NNFMP; 22 May 2012 19:30:22 -0000 X-Yahoo-Newman-Id: 731511.24542.bm@smtp214.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: OqttDRcVM1kFG68p5.ZGkLr5z4HbKWM_5k42ZKO9dbtORYM VbNEtCIjT5ecW7TXL9t.Fqu2hEEHQTGOE4DqLiv3DGGK02rLFHrqtKMCUSo6 iaE3.wqY5V4F9iB0haQVQonk7.qKJL.0sCLvhiVkWjz0.aGi7lWz1yN80eyr T8liEcnkbgZZL7INltCcMX5j3Nxe17J6pAdLhCzmbuL94rE_sGzjQc8uHJMQ GFzBaY21oMhA24XQj.I83ZV7rKzxMLZwsx6NcxSlpann1AjEMD9NL_Ys58QX R0chdP9R_a0jCl4CwSWGmA.GLASGDV0EYn9uJjEKn5N4ucA6etlSCyXpVxu0 ldlTrszeTWbwl3GMrFJ3pVnk1rY_31Pk9rj4wdcyXBZ9x6B_E4TQe2B_rz7. oXCHdYJiblH0qmwxZCK7paxt5IsXnMDd2gcUz0UXRFRqXb80t5ye3Ig-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Received: from [192.168.10.102] (pfg@200.118.157.7 with plain) by smtp214.mail.bf1.yahoo.com with SMTP; 22 May 2012 12:30:22 -0700 PDT Message-ID: <4FBBE94C.8010907@FreeBSD.org> Date: Tue, 22 May 2012 14:30:20 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120506 Thunderbird/12.0.1 MIME-Version: 1.0 To: obrien@FreeBSD.org References: <201205181902.q4IJ2ecZ070498@svn.freebsd.org> <20120522182715.GA83169@dragon.NUXI.org> In-Reply-To: <20120522182715.GA83169@dragon.NUXI.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235623 - in head/contrib/gcc: . config/rs6000 config/sparc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 19:30:29 -0000 Hi David; On 05/22/12 13:27, David O'Brien wrote: > On Fri, May 18, 2012 at 07:02:40PM +0000, Pedro F. Giffuni wrote: >> Log: >> Bring in a subset of gcc fixes that were back ported to >> the GCC 4.1 branch and are available under GPLv2. > I do not understand this -- We're using GCC 4.2.1 @r127959, but you > are bringing in patches that are against 4.1. > > What version of GCC were the changes back ported from if not 4.2.0 or > 4.2.1? Most of them originated in gcc 4.3 branch and were backported to gcc > 4.2.2 under the GPLv3. Those patches were further backported to gcc 4.1.x which continued to be released under GPLv2. Technically I cannot take patches from the gcc 4.2.x where x >=2 so I took them from the gcc 4.1 branch. > > BTW, these also should have been imported into ^/vendor/gcc/ and then > merged into ^/head/contrib/gcc as there are commercial users of FreeBSD > that have to modify their compiler to be able to consume FreeBSD source > code. And provenance and licensing matters to these folks. > This was discussed in private with mm@, as he brought some GPLv2 changes from the gcc 4.3 branch. We don't carry gcc 4.3 or 4.1 in the vendors area and the code from those branches that we can merge is relatively small. (We do keep a changelog for gcc4.3 changes for reference.) FWIW, we also merged the complete libstdc++ from gcc 4.2.4 as libstdc++ remained under LGPLv2 for all the gcc 4.2 branch. Pedro. From owner-svn-src-head@FreeBSD.ORG Tue May 22 19:37:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F020106566B; Tue, 22 May 2012 19:37:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AABD8FC0A; Tue, 22 May 2012 19:37:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MJbC16023311; Tue, 22 May 2012 19:37:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MJbCQ5023309; Tue, 22 May 2012 19:37:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205221937.q4MJbCQ5023309@svn.freebsd.org> From: Adrian Chadd Date: Tue, 22 May 2012 19:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235801 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 19:37:13 -0000 Author: adrian Date: Tue May 22 19:37:12 2012 New Revision: 235801 URL: http://svn.freebsd.org/changeset/base/235801 Log: Fix some corner cases in the ieee80211_send_bar() handling. * If the first call succeeded but failed to transmit, a timer would reschedule it via bar_timeout(). Unfortunately bar_timeout() didn't check the return value from the ieee80211_send_bar() reattempt and if that failed (eg the driver ic_raw_xmit() failed), it would never re-arm the timer. * If BARPEND is cleared (which ieee80211_send_bar() will do if it can't TX), then re-arming the timer isn't enough - once bar_timeout() occurs, it'll see BARPEND is 0 and not run through the rest of the routine. So when rearming the timer, also set that flag. * If the TX wasn't occuring, bar_tx_complete() wouldn't be called and the driver callback wouldn't be called either. So the driver had no idea that the BAR TX attempt had failed. In the ath(4) case, TX would stay paused. (There's no callback to indicate that BAR TX had failed or not; only a "BAR TX was attempted". That's a separate, later problem.) So call the driver callback (ic_bar_response()) before the ADDBA session is torn down, so it has a chance of being notified that things didn't quite go to plan. I've verified that yes, this does suspend traffic for ath(4), retry BAR TX even if the driver is failing ic_raw_xmit(), and then eventually giving up and sending a DELBA. I'll address the "out of ath_buf" issue in ath(4) in a subsequent commit - this commit just fixes the edge case where any driver is (way) out of internal buffers/descriptors and fails frame TX. PR: kern/168170 Reviewed by: bschmidt MFC after: 1 month Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Tue May 22 18:31:56 2012 (r235800) +++ head/sys/net80211/ieee80211_ht.c Tue May 22 19:37:12 2012 (r235801) @@ -2166,6 +2166,9 @@ ieee80211_ampdu_stop(struct ieee80211_no } } +/* XXX */ +static void bar_start_timer(struct ieee80211_tx_ampdu *tap); + static void bar_timeout(void *arg) { @@ -2184,11 +2187,34 @@ bar_timeout(void *arg) return; /* XXX ? */ if (tap->txa_attempts >= ieee80211_bar_maxtries) { + struct ieee80211com *ic = ni->ni_ic; + ni->ni_vap->iv_stats.is_ampdu_bar_tx_fail++; + /* + * If (at least) the last BAR TX timeout was due to + * an ieee80211_send_bar() failures, then we need + * to make sure we notify the driver that a BAR + * TX did occur and fail. This gives the driver + * a chance to undo any queue pause that may + * have occured. + */ + ic->ic_bar_response(ni, tap, 1); ieee80211_ampdu_stop(ni, tap, IEEE80211_REASON_TIMEOUT); } else { ni->ni_vap->iv_stats.is_ampdu_bar_tx_retry++; - ieee80211_send_bar(ni, tap, tap->txa_seqpending); + if (ieee80211_send_bar(ni, tap, tap->txa_seqpending) != 0) { + /* + * If ieee80211_send_bar() fails here, the + * timer may have stopped and/or the pending + * flag may be clear. Because of this, + * fake the BARPEND and reset the timer. + * A retransmission attempt will then occur + * during the next timeout. + */ + /* XXX locking */ + tap->txa_flags |= IEEE80211_AGGR_BARPEND; + bar_start_timer(tap); + } } } From owner-svn-src-head@FreeBSD.ORG Tue May 22 19:40:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A48291065677; Tue, 22 May 2012 19:40:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 904AF8FC12; Tue, 22 May 2012 19:40:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MJesSI023505; Tue, 22 May 2012 19:40:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MJes9V023503; Tue, 22 May 2012 19:40:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205221940.q4MJes9V023503@svn.freebsd.org> From: Xin LI Date: Tue, 22 May 2012 19:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235802 - head/usr.bin/minigzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 19:40:54 -0000 Author: delphij Date: Tue May 22 19:40:54 2012 New Revision: 235802 URL: http://svn.freebsd.org/changeset/base/235802 Log: commandline -> command line MFC after: 1 week Modified: head/usr.bin/minigzip/minigzip.1 Modified: head/usr.bin/minigzip/minigzip.1 ============================================================================== --- head/usr.bin/minigzip/minigzip.1 Tue May 22 19:37:12 2012 (r235801) +++ head/usr.bin/minigzip/minigzip.1 Tue May 22 19:40:54 2012 (r235802) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 3, 2002 +.Dd May 22, 2012 .Dt MINIGZIP 1 .Os .Sh NAME @@ -48,7 +48,7 @@ output. The default operation is compression, decompression can be selected by supplying the .Fl d -flag on the commandline. +flag on the command line. .Pp If any .Ar file From owner-svn-src-head@FreeBSD.ORG Tue May 22 19:43:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60EFF1065672; Tue, 22 May 2012 19:43:21 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CABE8FC0A; Tue, 22 May 2012 19:43:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MJhLvq023642; Tue, 22 May 2012 19:43:21 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MJhLDV023640; Tue, 22 May 2012 19:43:21 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205221943.q4MJhLDV023640@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 22 May 2012 19:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235803 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 19:43:21 -0000 Author: trasz Date: Tue May 22 19:43:20 2012 New Revision: 235803 URL: http://svn.freebsd.org/changeset/base/235803 Log: Fix use-after-free in kern_jail_set() triggered e.g. by attempts to clear "persist" flag from empty persistent jail, like this: jail -c persist=1 jail -n 1 -m persist=0 Submitted by: Mateusz Guzik MFC after: 2 weeks Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue May 22 19:40:54 2012 (r235802) +++ head/sys/kern/kern_jail.c Tue May 22 19:43:20 2012 (r235803) @@ -1811,6 +1811,16 @@ kern_jail_set(struct thread *td, struct } } +#ifdef RACCT + if (!created) { + sx_sunlock(&allprison_lock); + prison_racct_modify(pr); + sx_slock(&allprison_lock); + } +#endif + + td->td_retval[0] = pr->pr_id; + /* * Now that it is all there, drop the temporary reference from existing * prisons. Or add a reference to newly created persistent prisons @@ -1832,12 +1842,6 @@ kern_jail_set(struct thread *td, struct sx_sunlock(&allprison_lock); } -#ifdef RACCT - if (!created) - prison_racct_modify(pr); -#endif - - td->td_retval[0] = pr->pr_id; goto done_errmsg; done_deref_locked: From owner-svn-src-head@FreeBSD.ORG Tue May 22 19:50:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 18D27106566C; Tue, 22 May 2012 19:50:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 057058FC15; Tue, 22 May 2012 19:50:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4MJoLaS023996; Tue, 22 May 2012 19:50:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4MJoLHG023994; Tue, 22 May 2012 19:50:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205221950.q4MJoLHG023994@svn.freebsd.org> From: Adrian Chadd Date: Tue, 22 May 2012 19:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235804 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 19:50:22 -0000 Author: adrian Date: Tue May 22 19:50:21 2012 New Revision: 235804 URL: http://svn.freebsd.org/changeset/base/235804 Log: Re-up the TX ath_buf limit from 128 to 512. I'll have to leave this high for now, until I've done some significant surgery with how ath_bufs (and descriptors) are handled. This should significantly cut down on the opportunities for a full TX queue hanging traffic. I'll continue making things work though; I'm mostly doing this for users. :) Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue May 22 19:43:20 2012 (r235803) +++ head/sys/dev/ath/if_athvar.h Tue May 22 19:50:21 2012 (r235804) @@ -47,7 +47,7 @@ * 802.11n requires more TX and RX buffers to do AMPDU. */ #ifdef ATH_ENABLE_11N -#define ATH_TXBUF 128 +#define ATH_TXBUF 512 #define ATH_RXBUF 512 #endif From owner-svn-src-head@FreeBSD.ORG Tue May 22 19:55:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A3F5106564A; Tue, 22 May 2012 19:55:50 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id B52AC8FC0C; Tue, 22 May 2012 19:55:48 +0000 (UTC) Received: by laai10 with SMTP id i10so6653911laa.13 for ; Tue, 22 May 2012 12:55:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=RbIoaTumwO9OIZ3MTkrmI0BD7iFPzxjD/cVAd9MKL4w=; b=WbpUliNVEYDSHKYllm7ncffEfii3tWYvgUgEE4uYIVAH9cA1VFeqIL2y2SEFX69nVE xc0iygBPENi1BEDBsJo18fK8kTxQS1CZZkQpdIODxXeA61xRAiqrpotNVPBSOVHNDpam Fy/jKDt+qJYAgFrfptxI4scdHO25v0tRdg22blzxUQKxDANhOfUsmluxI/ghJWlSrJRH KXBOI2WVpCnb7pEy4iPk5VB5V4wyqUzX9q9TtheyYu+lIKf57X84qzIM2VCRActFlD55 8tKRvJnW/u/qnjLgbKYwn1q8Y59BWUIWJiWJLt6HZNdf+zQM804EOp13kY+H4NYp3Hym YAoQ== MIME-Version: 1.0 Received: by 10.152.104.171 with SMTP id gf11mr24516919lab.5.1337716547603; Tue, 22 May 2012 12:55:47 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.27.65 with HTTP; Tue, 22 May 2012 12:55:47 -0700 (PDT) In-Reply-To: <20120422170842.GA18403@garage.freebsd.pl> References: <201204200650.q3K6oiqO026673@svn.freebsd.org> <20120422170842.GA18403@garage.freebsd.pl> Date: Tue, 22 May 2012 20:55:47 +0100 X-Google-Sender-Auth: pPvimYqWzXVn73rtjeOoWfffiGk Message-ID: From: Attilio Rao To: Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kirk McKusick Subject: Re: svn commit: r234482 - in head/sys: fs/msdosfs fs/nfsserver kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 19:55:50 -0000 2012/4/22 Pawel Jakub Dawidek : > On Fri, Apr 20, 2012 at 06:50:44AM +0000, Kirk McKusick wrote: >> Author: mckusick >> Date: Fri Apr 20 06:50:44 2012 >> New Revision: 234482 >> URL: http://svn.freebsd.org/changeset/base/234482 >> >> Log: >> =C2=A0 This change creates a new list of active vnodes associated with >> =C2=A0 a mount point. Active vnodes are those with a non-zero use or hol= d >> =C2=A0 count, e.g., those vnodes that are not on the free list. Note tha= t >> =C2=A0 this list is in addition to the list of all the vnodes associated >> =C2=A0 with a mount point. >> >> =C2=A0 To avoid adding another set of linkage pointers to the vnode >> =C2=A0 structure, the active list uses the existing linkage pointers >> =C2=A0 used by the free list (previously named v_freelist, now renamed >> =C2=A0 v_actfreelist). >> >> =C2=A0 This update adds the MNT_VNODE_FOREACH_ACTIVE interface that loop= s >> =C2=A0 over just the active vnodes associated with a mount point (typica= lly >> =C2=A0 less than 1% of the vnodes associated with the mount point). > [...] >> @@ -1099,6 +1128,14 @@ insmntque1(struct vnode *vp, struct moun >> =C2=A0 =C2=A0 =C2=A0 VNASSERT(mp->mnt_nvnodelistsize >=3D 0, vp, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("neg mount point vnode= list size")); >> =C2=A0 =C2=A0 =C2=A0 mp->mnt_nvnodelistsize++; >> + =C2=A0 =C2=A0 KASSERT((vp->v_iflag & VI_ACTIVE) =3D=3D 0, >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("Activating already active vnode")); >> + =C2=A0 =C2=A0 vp->v_iflag |=3D VI_ACTIVE; >> + =C2=A0 =C2=A0 mtx_lock(&vnode_free_list_mtx); >> + =C2=A0 =C2=A0 TAILQ_INSERT_HEAD(&mp->mnt_activevnodelist, vp, v_actfre= elist); >> + =C2=A0 =C2=A0 mp->mnt_activevnodelistsize++; >> + =C2=A0 =C2=A0 mtx_unlock(&vnode_free_list_mtx); >> + =C2=A0 =C2=A0 VI_UNLOCK(vp); >> =C2=A0 =C2=A0 =C2=A0 MNT_IUNLOCK(mp); >> =C2=A0 =C2=A0 =C2=A0 return (0); >> =C2=A0} > > > Now, for every vnode that is activated, it has to go through global > mutex, which seems like scalability issue to me. With ZFS it is typical > to have a lot of file systems and this global mutex was not needed > before (well, it was needed, but only to get vnode from the free list). > > If we require vnode interlock to be held during v_actfreelist > manipulation then why can't we use interlock+vnode_free_list_mtx when > operating on the free list and interlock+per-mountpoint-lock when > operating on mnt_activevnodelist? I think this is the better idea for this case and it should really be fixed= . However, note that a per-mount lock here is far from being ideal as you would contest a lot on the mountpoint if you have a lot of activated vnodes. Anyway the approach you propose doesn't introduce any scalability difference than what we already had in place for pre-234482. Also, it would be good to implement things like: mtx_assert(MNT_MTX(mp), MA_OWNED); by providing appropriate wrappers as we do in vnode interface. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue May 22 20:05:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C6FB106566B; Tue, 22 May 2012 20:05:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id CBBE68FC0A; Tue, 22 May 2012 20:05:15 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4MK57LV006392 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 May 2012 06:05:08 +1000 Date: Wed, 23 May 2012 06:05:06 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "David E. O'Brien" In-Reply-To: <201205221818.q4MII7lk019626@svn.freebsd.org> Message-ID: <20120523050739.H3621@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 20:05:39 -0000 On Tue, 22 May 2012, David E. O'Brien wrote: > Log: > Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit platforms. I think I like this, since it is technically correct, and will find a different set of type mismatches. > Modified: head/contrib/gcc/c-format.c > ============================================================================== > --- head/contrib/gcc/c-format.c Tue May 22 17:44:01 2012 (r235796) > +++ head/contrib/gcc/c-format.c Tue May 22 18:18:06 2012 (r235797) > @@ -287,7 +287,11 @@ static const format_length_info printf_l > { > { "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 }, > { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L }, > +#ifdef __LP64__ > + { "q", FMT_LEN_l, STD_EXT, NULL, 0, 0 }, > +#else > { "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, > +#endif > { "L", FMT_LEN_L, STD_C89, NULL, 0, 0 }, > { "z", FMT_LEN_z, STD_C99, NULL, 0, 0 }, > { "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 }, > Of course, %qd should never be used. On LP32, quad_t is long long, while on LP64, quad_t is long, so any use of %qd required messy ifdefs or casting a quad_t arg to long long to work on LP64. Now, %qd actually matches quad_t on LP64, so casting to long long is no longer needed, but anything that does it is broken and would require changing to cast to quad_t, or perhaps to omit the cast. You might find too much bugware that (1) uses %qd (2) uses it on args that don't always have type quad_t (3) casts to long long. Casting to quad_t didn't work on LP64 before, so probably nothing in FreeBSD does it. Grepping for %q in /sys finds only a few uses of %q with a few type mismatches (different mismatches before and after this commit). (I didn't grep for more compicated formats with stuff between the % and the q.): % ./compat/ndis/subr_ntoskrnl.c: printf("timer sets: %qu\n", ntoskrnl_timer_sets); % ./compat/ndis/subr_ntoskrnl.c: printf("timer reloads: %qu\n", ntoskrnl_timer_reloads); % ./compat/ndis/subr_ntoskrnl.c: printf("timer cancels: %qu\n", ntoskrnl_timer_cancels); % ./compat/ndis/subr_ntoskrnl.c: printf("timer fires: %qu\n", ntoskrnl_timer_fires); This was broken before on LP64. It now works accidentally. All these %qu formats are bogus, since the variables don't have type quad_t; they have type uint64_t. Now that %q works, quad_t's are actually easier to print that int64_t's since there is a format letter just for them. But this only helps if the variables actually have type quad_t. % ./dev/esp/ncr53c9x.c: panic("%s: lun %qx for ecb %p does not exist", __func__, % ./dev/esp/ncr53c9x.c: panic("%s: slot %d for lun %qx has %p instead of ecb " This is under DIAGNOSTIC and is now broken. Again the variable doesn't have type [u_]quad_t. It has type int64_t. This is printed using the doubly- incompatible format %qx (signed type but unsigned format; int64 type but quad format letter). Then to be bug for bug compatible with old gcc, this incompatible format was cast to a different doubly-incompatible type. % ./fs/msdosfs/msdosfs_vnops.c: printf(" va_blocksize %lx, va_rdev %x, va_bytes %qx, va_gen %lx\n", This is under the non-option MSDOSFS_DEBUG. It was broken before, but now works, since va_bytes actually has type u_quad_t and was not bogusly cast to unsigned long long). % ./fs/nfsclient/nfs_clstate.c: printf("lck typ=%d fst=%qd end=%qd\n", % ./fs/nfsclient/nfs_clstate.c: printf("lck typ=%d fst=%qd end=%qd\n", These are under !__FreeBSD__ ifdefs. The ifdefs are related to the type errors. The types are u_int64_t. Under FreeBSD, they are printed correctly with only 1 type error for each: they are bogusly cast to intmax_t (sign error), then printed with %ju (this matches the sign of the variables but is a sign error relative to the cast. The errors normally cancel). Under !__FreeBSD__, they are printed using %qd, without any casts. There is now a sign error in the format, and type mismatches. This would now compiler under FreeBSD despite all the type mismatches -- the sign error doesn't matter in practice; u_int64_t matches u_quad_t on all supported arches, and after your changes the logical mismatch is no longer detected by gcc. % ./geom/geom_map.c: ret = sscanf(line, "search:%qi:%qi:%63c", This has more than the usual density of bugs: - scanf() is unusable but is used - %q format is used - % the variables are further from being quad_t's than usual. They are off_t's. off_t happens to have type int64_t, so this works accidentally on all supported arches. - %qi is an unusual spelling of %qd. You didn't change gcc for scanf. "q" for it still maps to FMT_LEN_ll. The above should never have compiled on LP64. % ./gnu/fs/xfs/FreeBSD/xfs_buf.c: printf("bread failed specvp %p blkno %qd BBTOB(len) %ld\n", The variable has type xfs_daddr_t, which is __s64, which is signed long long int in xfs/FreeBSD. This used to be compatible with %qd, but no longer is. xfs shouldn't compile any more on LP64. Now I prefer the old way, after fixing the bugs found by switching. It finds more bugs under FreeBSD, and is bug for bug compatible with distribution gcc and probably with other system's headers under !FreeBSD. Except under FreeBSD, I prefer %q to be an error. The above shows it only being used 12 times in /sys, with most uses of it being bugs. Fixing these bugs would leave about 1 correct use of it -- for printing the quad_t in unreachable code in msdosfs. This use would be easy to avoid too (just cast to uintmax_t). Uses in userland are hopefully east to fix and avoid too. In an old userland, there were only about 50, with most in netstat/inet6.c, tcopy.c, ftpd, fsirand, and contrib'ed code. Of course you can't make it an error for the contrib'ed code. Bruce From owner-svn-src-head@FreeBSD.ORG Tue May 22 20:48:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C999C1065672; Tue, 22 May 2012 20:48:42 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id 7C81F8FC0A; Tue, 22 May 2012 20:48:42 +0000 (UTC) Received: from [209.249.190.124] (port=41221 helo=punk.neville-neil.com.neville-neil.com) by vps.hungerhost.com with esmtpa (Exim 4.77) (envelope-from ) id 1SWw0X-00010i-Pj; Tue, 22 May 2012 16:48:41 -0400 Date: Tue, 22 May 2012 16:49:37 -0400 Message-ID: <861umcx7oe.wl%gnn@neville-neil.com> From: gnn@freebsd.org To: Bruce Evans In-Reply-To: <20120523050739.H3621@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/23.4 (amd64-portbld-freebsd10.0) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 20:48:42 -0000 At Wed, 23 May 2012 06:05:06 +1000 (EST), Bruce Evans wrote: > > On Tue, 22 May 2012, David E. O'Brien wrote: > > > Log: > > Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit platforms. > > I think I like this, since it is technically correct, and will find a > different set of type mismatches. > > > Modified: head/contrib/gcc/c-format.c > > ============================================================================== > > --- head/contrib/gcc/c-format.c Tue May 22 17:44:01 2012 (r235796) > > +++ head/contrib/gcc/c-format.c Tue May 22 18:18:06 2012 (r235797) > > @@ -287,7 +287,11 @@ static const format_length_info printf_l > > { > > { "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 }, > > { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L }, > > +#ifdef __LP64__ > > + { "q", FMT_LEN_l, STD_EXT, NULL, 0, 0 }, > > +#else > > { "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, > > +#endif > > { "L", FMT_LEN_L, STD_C89, NULL, 0, 0 }, > > { "z", FMT_LEN_z, STD_C99, NULL, 0, 0 }, > > { "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 }, > > > > Of course, %qd should never be used. On LP32, quad_t is long long, while > on LP64, quad_t is long, so any use of %qd required messy ifdefs or > casting a quad_t arg to long long to work on LP64. Now, %qd actually > matches quad_t on LP64, so casting to long long is no longer needed, but > anything that does it is broken and would require changing to cast to > quad_t, or perhaps to omit the cast. You might find too much bugware that > (1) uses %qd > (2) uses it on args that don't always have type quad_t > (3) casts to long long. Casting to quad_t didn't work on LP64 before, so > probably nothing in FreeBSD does it. > > Grepping for %q in /sys finds only a few uses of %q with a few type > mismatches (different mismatches before and after this commit). (I > didn't grep for more compicated formats with stuff between the % and the > q.): > > % ./compat/ndis/subr_ntoskrnl.c: printf("timer sets: %qu\n", ntoskrnl_timer_sets); > % ./compat/ndis/subr_ntoskrnl.c: printf("timer reloads: %qu\n", ntoskrnl_timer_reloads); > % ./compat/ndis/subr_ntoskrnl.c: printf("timer cancels: %qu\n", ntoskrnl_timer_cancels); > % ./compat/ndis/subr_ntoskrnl.c: printf("timer fires: %qu\n", ntoskrnl_timer_fires); > > This was broken before on LP64. It now works accidentally. All these %qu > formats are bogus, since the variables don't have type quad_t; they have > type uint64_t. Now that %q works, quad_t's are actually easier to print > that int64_t's since there is a format letter just for them. But this > only helps if the variables actually have type quad_t. > > % ./dev/esp/ncr53c9x.c: panic("%s: lun %qx for ecb %p does not exist", __func__, > % ./dev/esp/ncr53c9x.c: panic("%s: slot %d for lun %qx has %p instead of ecb " > > This is under DIAGNOSTIC and is now broken. Again the variable doesn't have > type [u_]quad_t. It has type int64_t. This is printed using the doubly- > incompatible format %qx (signed type but unsigned format; int64 type but > quad format letter). Then to be bug for bug compatible with old gcc, this > incompatible format was cast to a different doubly-incompatible type. > > % ./fs/msdosfs/msdosfs_vnops.c: printf(" va_blocksize %lx, va_rdev %x, va_bytes %qx, va_gen %lx\n", > > This is under the non-option MSDOSFS_DEBUG. It was broken before, but now > works, since va_bytes actually has type u_quad_t and was not bogusly cast > to unsigned long long). > > % ./fs/nfsclient/nfs_clstate.c: printf("lck typ=%d fst=%qd end=%qd\n", > % ./fs/nfsclient/nfs_clstate.c: printf("lck typ=%d fst=%qd end=%qd\n", > > These are under !__FreeBSD__ ifdefs. The ifdefs are related to the type > errors. The types are u_int64_t. Under FreeBSD, they are printed > correctly with only 1 type error for each: they are bogusly cast to > intmax_t (sign error), then printed with %ju (this matches the sign of > the variables but is a sign error relative to the cast. The errors > normally cancel). Under !__FreeBSD__, they are printed using %qd, > without any casts. There is now a sign error in the format, and type > mismatches. This would now compiler under FreeBSD despite all the > type mismatches -- the sign error doesn't matter in practice; u_int64_t > matches u_quad_t on all supported arches, and after your changes the > logical mismatch is no longer detected by gcc. > > % ./geom/geom_map.c: ret = sscanf(line, "search:%qi:%qi:%63c", > > This has more than the usual density of bugs: > - scanf() is unusable but is used > - %q format is used > - % the variables are further from being quad_t's than usual. They are > off_t's. off_t happens to have type int64_t, so this works accidentally > on all supported arches. > - %qi is an unusual spelling of %qd. > > You didn't change gcc for scanf. "q" for it still maps to FMT_LEN_ll. > The above should never have compiled on LP64. > > % ./gnu/fs/xfs/FreeBSD/xfs_buf.c: printf("bread failed specvp %p blkno %qd BBTOB(len) %ld\n", > > The variable has type xfs_daddr_t, which is __s64, which is signed long long > int in xfs/FreeBSD. This used to be compatible with %qd, but no longer is. > xfs shouldn't compile any more on LP64. > > Now I prefer the old way, after fixing the bugs found by switching. > It finds more bugs under FreeBSD, and is bug for bug compatible with > distribution gcc and probably with other system's headers under > !FreeBSD. Except under FreeBSD, I prefer %q to be an error. The above > shows it only being used 12 times in /sys, with most uses of it being > bugs. Fixing these bugs would leave about 1 correct use of it -- for > printing the quad_t in unreachable code in msdosfs. This use would be > easy to avoid too (just cast to uintmax_t). Uses in userland are > hopefully east to fix and avoid too. In an old userland, there were > only about 50, with most in netstat/inet6.c, tcopy.c, ftpd, fsirand, > and contrib'ed code. Of course you can't make it an error for the > contrib'ed code. > Instead of replying to the original commit I'll just add to the chain. Note that this change broke buildworld: src/usr.sbin/ppp/throughput.c: In function 'throughput_disp': src/usr.sbin/ppp/throughput.c:119: warning: format '%6qu' expects type 'long unsigned int', but argu And several more. Best, George From owner-svn-src-head@FreeBSD.ORG Tue May 22 21:07:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F1F6106566B; Tue, 22 May 2012 21:07:23 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id D12398FC23; Tue, 22 May 2012 21:07:22 +0000 (UTC) Received: by dadv36 with SMTP id v36so9505296dad.13 for ; Tue, 22 May 2012 14:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=bQ5SH0aFxzkj3Aog1vsspkBM+ERDfE68kWgWEByryF4=; b=NNYTshrNmE9uedJutZjCAmUeMym9uXimDbRY9ddJcx+4Yp9cNTmmgK9MuC/ujsvB3g 8w1CPRmooZHBgATWgxe3TMrbnQHUh0H+3Hg30LiYJE3khpMCBFUkucVsJvv9xzVjkRZd MLQPQOviXDlAfSuMk/MRwutSRgaqz38Ca/RcXKQJYS0q7305fZqH4V+hbqA6CmrrHMb1 DNjI28BXljXmxJFUmcgn+OseL4SkVQeM2iomlffXsQyTovilMCVEgwnTiU8vyhUdn+yK wB6G9mV56YedzhcP4D+eKYn5fxdYHkuy8uzxSuAYW4YV3dwar1zfu4cjmSe6U2AfzS6B s7cg== MIME-Version: 1.0 Received: by 10.68.224.103 with SMTP id rb7mr2905721pbc.23.1337720842458; Tue, 22 May 2012 14:07:22 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.68.237.226 with HTTP; Tue, 22 May 2012 14:07:22 -0700 (PDT) In-Reply-To: <20120523050739.H3621@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> Date: Tue, 22 May 2012 14:07:22 -0700 X-Google-Sender-Auth: waTy4SSV8TkWFusznzhEYUw4-gw Message-ID: From: mdf@FreeBSD.org To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 21:07:23 -0000 On Tue, May 22, 2012 at 1:05 PM, Bruce Evans wrote: > On Tue, 22 May 2012, David E. O'Brien wrote: > >> Log: >> =A0Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit >> platforms. > > > I think I like this, since it is technically correct, and will find a > different set of type mismatches. We run with the following at Isilon, which is somewhat bogus because it allows a bit of sloppiness in types, but is also terribly convenient since it means no casting on printf arguments is needed: --- contrib/gcc/c-format.c 2012-05-22 14:08:23.538266746 -0700 +++ /data/sb/head/src/contrib/gcc/c-format.c 2012-05-16 12:59:40.937016702 -0700 @@ -2298,10 +2570,20 @@ check_format_types (format_wanted_type * equivalent but the above test won't consider them equivalent. */ if (wanted_type =3D=3D char_type_node && (!pedantic || i < 2) && char_type_flag) continue; + + /* Isilon: FreeBSD defines int64_t (and others) as one type (e.g. lo= ng + long) on i386 and another type (e.g. long) on amd64. This prevents + the use of a common format specifier. Treat equal sized integer ty= pes + as equivalent. */ + if (TREE_CODE (wanted_type) =3D=3D INTEGER_TYPE + && TREE_CODE (cur_type) =3D=3D INTEGER_TYPE + && int_size_in_bytes (wanted_type) =3D=3D int_size_in_bytes (cur_= type)) + continue; + /* Now we have a type mismatch. */ format_type_warning (types->name, format_start, format_length, wanted_type, types->pointer_count, types->wanted_type_name, orig_cur_type, arg_num)= ; } If there's no objections, I (or David or anyone else) can commit to the FreeBSD repository. Cheers, matthew From owner-svn-src-head@FreeBSD.ORG Wed May 23 00:04:32 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 79A69106566B; Wed, 23 May 2012 00:04:32 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 14BD68FC0C; Wed, 23 May 2012 00:04:32 +0000 (UTC) Received: from sa-nc-mfg-99.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q4N04MMB064893 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 22 May 2012 17:04:30 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: Marcel Moolenaar In-Reply-To: Date: Tue, 22 May 2012 17:04:16 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "David E. O'Brien" , Bruce Evans Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 00:04:32 -0000 On May 22, 2012, at 2:07 PM, mdf@FreeBSD.org wrote: > On Tue, May 22, 2012 at 1:05 PM, Bruce Evans = wrote: >> On Tue, 22 May 2012, David E. O'Brien wrote: >>=20 >>> Log: >>> Do not incorrectly warn when printing a quad_t using "%qd" on = 64-bit >>> platforms. >>=20 >>=20 >> I think I like this, since it is technically correct, and will find a >> different set of type mismatches. >=20 > We run with the following at Isilon, which is somewhat bogus because > it allows a bit of sloppiness in types, but is also terribly > convenient since it means no casting on printf arguments is needed: >=20 > --- contrib/gcc/c-format.c 2012-05-22 14:08:23.538266746 -0700 > +++ /data/sb/head/src/contrib/gcc/c-format.c 2012-05-16 > 12:59:40.937016702 -0700 > @@ -2298,10 +2570,20 @@ check_format_types (format_wanted_type * > equivalent but the above test won't consider them equivalent. = */ > if (wanted_type =3D=3D char_type_node > && (!pedantic || i < 2) > && char_type_flag) > continue; > + > + /* Isilon: FreeBSD defines int64_t (and others) as one type = (e.g. long > + long) on i386 and another type (e.g. long) on amd64. This = prevents > + the use of a common format specifier. Treat equal sized = integer types > + as equivalent. */ > + if (TREE_CODE (wanted_type) =3D=3D INTEGER_TYPE > + && TREE_CODE (cur_type) =3D=3D INTEGER_TYPE > + && int_size_in_bytes (wanted_type) =3D=3D int_size_in_bytes = (cur_type)) > + continue; > + > /* Now we have a type mismatch. */ > format_type_warning (types->name, format_start, format_length, > wanted_type, types->pointer_count, > types->wanted_type_name, orig_cur_type, = arg_num); > } >=20 >=20 > If there's no objections, I (or David or anyone else) can commit to > the FreeBSD repository. I think such would make support for external (i.e. non-FreeBSD) = toolchains even more problematic. Our format extensions are a big hurdle already. I think we should not tweak the compiler. --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Wed May 23 01:20:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B3A951065677; Wed, 23 May 2012 01:20:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DE9A8FC14; Wed, 23 May 2012 01:20:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4N1KPfG039882; Wed, 23 May 2012 01:20:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4N1KP0f039880; Wed, 23 May 2012 01:20:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201205230120.q4N1KP0f039880@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 23 May 2012 01:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235816 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 01:20:25 -0000 Author: yongari Date: Wed May 23 01:20:25 2012 New Revision: 235816 URL: http://svn.freebsd.org/changeset/base/235816 Log: Make IPMI work in the bce driver even when the interface is configured down. Formerly, IPMI communication was lost whenever the interface was not up. The reason was that the BCE_EMAC_MODE register was not configured with the correct media settings. There are two parts to the fix. First, resetting the chip in bce_reset() causes the BCE_EMAC_MODE register to be initialized to a default value that does not necessarily correspond to the actual media settings. The fix implemented here is a bit of a hack. Ideally, at the end of bce_reset() we would poll the PHY to determine the negotiated media, and then we would set the BCE_EMAC_MODE register accordingly. That is difficult, since the PHY is abstracted behind the MII layer and is not supposed to be queried directly from the MAC driver. Instead, we read the BCE_EMAC_MODE register at the beginning of bce_reset() and then restore its media bits to their original values before returning. If IPMI is up and running, then the link is already established and the BCE_EMAC_MODE register is already set appropriately when bce_reset() is called. If IPMI is not running, no harm is done by preserving the BCE_EMAC_MODE settings. The driver will set the register properly once the interface is configured up and link is established. Second, bce_miibus_statchg() is sometimes called when the link is down. In that case, the reported media settings are invalid. Formerly, the driver used them anyway to setup the BCE_EMAC_MODE register. We now avoid changing any MAC registers unless link is active and the reported media settings are valid. Submitted by: jdp Tested by: jdp MFC after: 5 days Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Wed May 23 00:46:19 2012 (r235815) +++ head/sys/dev/bce/if_bce.c Wed May 23 01:20:25 2012 (r235816) @@ -2062,6 +2062,11 @@ bce_miibus_statchg(device_t dev) media_status = mii->mii_media_status; } + /* Ignore invalid media status. */ + if ((media_status & (IFM_ACTIVE | IFM_AVALID)) != + (IFM_ACTIVE | IFM_AVALID)) + goto bce_miibus_statchg_exit; + val = REG_RD(sc, BCE_EMAC_MODE); val &= ~(BCE_EMAC_MODE_PORT | BCE_EMAC_MODE_HALF_DUPLEX | BCE_EMAC_MODE_MAC_LOOP | BCE_EMAC_MODE_FORCE_LINK | @@ -2131,6 +2136,7 @@ bce_miibus_statchg(device_t dev) /* ToDo: Update watermarks in bce_init_rx_context(). */ +bce_miibus_statchg_exit: DBEXIT(BCE_VERBOSE_PHY); } @@ -4997,14 +5003,25 @@ bce_stop(struct bce_softc *sc) static int bce_reset(struct bce_softc *sc, u32 reset_code) { - u32 val; + u32 emac_mode_save, val; int i, rc = 0; + static const u32 emac_mode_mask = BCE_EMAC_MODE_PORT | + BCE_EMAC_MODE_HALF_DUPLEX | BCE_EMAC_MODE_25G; DBENTER(BCE_VERBOSE_RESET); DBPRINT(sc, BCE_VERBOSE_RESET, "%s(): reset_code = 0x%08X\n", __FUNCTION__, reset_code); + /* + * If ASF/IPMI is operational, then the EMAC Mode register already + * contains appropriate values for the link settings that have + * been auto-negotiated. Resetting the chip will clobber those + * values. Save the important bits so we can restore them after + * the reset. + */ + emac_mode_save = REG_RD(sc, BCE_EMAC_MODE) & emac_mode_mask; + /* Wait for pending PCI transactions to complete. */ REG_WR(sc, BCE_MISC_ENABLE_CLR_BITS, BCE_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE | @@ -5094,6 +5111,11 @@ bce_reset(struct bce_softc *sc, u32 rese bce_fw_cap_init(sc); bce_reset_exit: + /* Restore EMAC Mode bits needed to keep ASF/IPMI running. */ + val = REG_RD(sc, BCE_EMAC_MODE); + val = (val & ~emac_mode_mask) | emac_mode_save; + REG_WR(sc, BCE_EMAC_MODE, val); + DBEXIT(BCE_VERBOSE_RESET); return (rc); } From owner-svn-src-head@FreeBSD.ORG Wed May 23 02:43:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF48F1065672; Wed, 23 May 2012 02:43:05 +0000 (UTC) (envelope-from bjk@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A89208FC0C; Wed, 23 May 2012 02:43:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4N2h5Zu030704; Wed, 23 May 2012 02:43:05 GMT (envelope-from bjk@freebsd.org) Received: from localhost (bjk@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) with ESMTP id q4N2h5jB030701; Wed, 23 May 2012 02:43:05 GMT (envelope-from bjk@freebsd.org) X-Authentication-Warning: freefall.freebsd.org: bjk owned process doing -bs Date: Wed, 23 May 2012 02:43:05 +0000 (UTC) From: Benjamin Kaduk To: John Baldwin In-Reply-To: <201205211127.34052.jhb@freebsd.org> Message-ID: References: <201205181001.q4IA1VED044374@svn.freebsd.org> <201205180941.48076.jhb@freebsd.org> <20120518152436.GA9116@reks> <201205211127.34052.jhb@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Gleb Kurtsou , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235601 - head/include/protocols X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 02:43:06 -0000 On Mon, 21 May 2012, John Baldwin wrote: > On Friday, May 18, 2012 11:24:36 am Gleb Kurtsou wrote: >> On (18/05/2012 09:41), John Baldwin wrote: >>> On Friday, May 18, 2012 6:01:31 am Gleb Kurtsou wrote: >>>> Author: gleb >>>> Date: Fri May 18 10:01:31 2012 >>>> New Revision: 235601 >>>> URL: http://svn.freebsd.org/changeset/base/235601 >>>> >>>> Log: >>>> Don't use ino_t in dumprestore protocol definition. >>>> >>>> Since ino_t size is about to change to 64-bits, replace ino_t used in >>>> dump protocol definition with 32-bit dump_ino_t to preserve backward >>>> compatibility. At some point, it may be necessary to use spare fields >>>> in struct in order to fully support 64-bit inode numbers. >>>> >>>> Sponsored by: Google Summer of Code 2011 >>> >>> A question about your stat changes: did you expand dev_t to 32 bits for > the >>> AFS folks, or did you leave it as 16 bits? >> >> dev_t is already 32-bit. Changing it to 64-bit was discussed at some >> point and from what I recall no decision was made: >> >> http://marc.info/?t=129119478700005&r=1&w=2 >> >> I'm going to commit preparatory changes only for now. Then publish diff >> for testing. We can still change dev_t to 64-bit if needed. Although I >> didn't work on it. > > Ah, it was 64-bit they asked for. If it is easy to do so, I'd favor changing > it since you've already done all the hard work of rolling a new stat > structure. I'd rather err on wasting 32-bits for dev_t than having to do all > this over again. Hi John, Thanks for remembering this -- I'm still pretty swamped with other stuff and missed it. It would indeed be nice for us to have a 64-bit dev_t to work with. -Ben From owner-svn-src-head@FreeBSD.ORG Wed May 23 03:35:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97A3A106564A; Wed, 23 May 2012 03:35:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82C668FC16; Wed, 23 May 2012 03:35:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4N3Z964046120; Wed, 23 May 2012 03:35:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4N3Z9Eo046118; Wed, 23 May 2012 03:35:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201205230335.q4N3Z9Eo046118@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 23 May 2012 03:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235821 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 03:35:09 -0000 Author: yongari Date: Wed May 23 03:35:08 2012 New Revision: 235821 URL: http://svn.freebsd.org/changeset/base/235821 Log: Don't force max payload size to 128. Root complex and Endpoint will negotiate with each other on the TLP payload size so blindly forcing the size to 128 can cause a completion error which in turn will stop device. Reported by: Geans Pin < geanspin <> broadcom dot com > MFC after: 5 days Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed May 23 02:43:28 2012 (r235820) +++ head/sys/dev/bge/if_bge.c Wed May 23 03:35:08 2012 (r235821) @@ -3638,8 +3638,6 @@ bge_reset(struct bge_softc *sc) /* Clear enable no snoop and disable relaxed ordering. */ devctl &= ~(PCIM_EXP_CTL_RELAXED_ORD_ENABLE | PCIM_EXP_CTL_NOSNOOP_ENABLE); - /* Set PCIE max payload size to 128. */ - devctl &= ~PCIM_EXP_CTL_MAX_PAYLOAD; pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, devctl, 2); /* Clear error status. */ From owner-svn-src-head@FreeBSD.ORG Wed May 23 06:41:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FF031065670; Wed, 23 May 2012 06:41:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from springbank.echomania.com (andric.com [IPv6:2001:888:2003:1001:230:48ff:fe51:76b6]) by mx1.freebsd.org (Postfix) with ESMTP id 14A6E8FC0C; Wed, 23 May 2012 06:41:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from [192.168.1.6] (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id 2A545A7071; Wed, 23 May 2012 08:41:33 +0200 (CEST) Message-ID: <4FBC86B3.8020105@FreeBSD.org> Date: Wed, 23 May 2012 08:41:55 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120512 Thunderbird/13.0 MIME-Version: 1.0 To: mdf@FreeBSD.org References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> In-Reply-To: X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" , Bruce Evans Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 06:41:55 -0000 On 2012-05-22 23:07, mdf@FreeBSD.org wrote: ... > We run with the following at Isilon, which is somewhat bogus because > it allows a bit of sloppiness in types, but is also terribly > convenient since it means no casting on printf arguments is needed: Please don't. If you want to write portable code, use the (admittedly horrible) PRId64 macros instead. From owner-svn-src-head@FreeBSD.ORG Wed May 23 06:49:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5250F1065670; Wed, 23 May 2012 06:49:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3240B8FC0A; Wed, 23 May 2012 06:49:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4N6npOK053891; Wed, 23 May 2012 06:49:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4N6nofV053886; Wed, 23 May 2012 06:49:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205230649.q4N6nofV053886@svn.freebsd.org> From: Xin LI Date: Wed, 23 May 2012 06:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235822 - in head: sys/dev/esp sys/gnu/fs/xfs/FreeBSD usr.sbin/ppp usr.sbin/rpc.lockd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 06:49:51 -0000 Author: delphij Date: Wed May 23 06:49:50 2012 New Revision: 235822 URL: http://svn.freebsd.org/changeset/base/235822 Log: Fix build: - Use %ll instead of %q for explicit long long casts; - Use %j instead of %q in XFS and cast to intmax_t. Tested with: make universe Modified: head/sys/dev/esp/ncr53c9x.c head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c head/usr.sbin/ppp/throughput.c head/usr.sbin/rpc.lockd/kern.c Modified: head/sys/dev/esp/ncr53c9x.c ============================================================================== --- head/sys/dev/esp/ncr53c9x.c Wed May 23 03:35:08 2012 (r235821) +++ head/sys/dev/esp/ncr53c9x.c Wed May 23 06:49:50 2012 (r235822) @@ -1504,7 +1504,7 @@ ncr53c9x_dequeue(struct ncr53c9x_softc * li = TINFO_LUN(ti, lun); #ifdef DIAGNOSTIC if (li == NULL || li->lun != lun) - panic("%s: lun %qx for ecb %p does not exist", __func__, + panic("%s: lun %llx for ecb %p does not exist", __func__, (long long)lun, ecb); #endif if (li->untagged == ecb) { @@ -1515,7 +1515,7 @@ ncr53c9x_dequeue(struct ncr53c9x_softc * #ifdef DIAGNOSTIC if (li->queued[ecb->tag[1]] != NULL && (li->queued[ecb->tag[1]] != ecb)) - panic("%s: slot %d for lun %qx has %p instead of ecb " + panic("%s: slot %d for lun %llx has %p instead of ecb " "%p", __func__, ecb->tag[1], (long long)lun, li->queued[ecb->tag[1]], ecb); #endif Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c ============================================================================== --- head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c Wed May 23 03:35:08 2012 (r235821) +++ head/sys/gnu/fs/xfs/FreeBSD/xfs_buf.c Wed May 23 06:49:50 2012 (r235822) @@ -50,8 +50,8 @@ xfs_buf_read_flags(xfs_buftarg_t *target KASSERT((target != NULL), ("got NULL buftarg_t")); if (bread(target->specvp, blkno, BBTOB(len), NOCRED, &bp)) { - printf("bread failed specvp %p blkno %qd BBTOB(len) %ld\n", - target->specvp, blkno, (long)BBTOB(len)); + printf("bread failed specvp %p blkno %jd BBTOB(len) %ld\n", + target->specvp, (intmax_t)blkno, (long)BBTOB(len)); bp = NULL; } Modified: head/usr.sbin/ppp/throughput.c ============================================================================== --- head/usr.sbin/ppp/throughput.c Wed May 23 03:35:08 2012 (r235821) +++ head/usr.sbin/ppp/throughput.c Wed May 23 06:49:50 2012 (r235822) @@ -115,14 +115,14 @@ throughput_disp(struct pppThroughput *t, prompt_Printf(prompt, "%llu packets in, %llu packets out\n", t->PacketsIn, t->PacketsOut); if (t->rolling) { - prompt_Printf(prompt, " overall %6qu bytes/sec\n", + prompt_Printf(prompt, " overall %6llu bytes/sec\n", (t->OctetsIn + t->OctetsOut) / divisor); - prompt_Printf(prompt, " %s %6qu bytes/sec in, %6qu bytes/sec out " + prompt_Printf(prompt, " %s %6llu bytes/sec in, %6llu bytes/sec out " "(over the last %d secs)\n", t->downtime ? "average " : "currently", t->in.OctetsPerSecond, t->out.OctetsPerSecond, secs_up > t->SamplePeriod ? t->SamplePeriod : secs_up); - prompt_Printf(prompt, " peak %6qu bytes/sec on %s", + prompt_Printf(prompt, " peak %6llu bytes/sec on %s", t->BestOctetsPerSecond, ctime(&t->BestOctetsPerSecondTime)); } else prompt_Printf(prompt, "Overall %llu bytes/sec\n", @@ -266,7 +266,7 @@ throughput_clear(struct pppThroughput *t if ((divisor = throughput_uptime(t)) == 0) divisor = 1; - prompt_Printf(prompt, "overall cleared (was %6qu bytes/sec)\n", + prompt_Printf(prompt, "overall cleared (was %6llu bytes/sec)\n", (t->OctetsIn + t->OctetsOut) / divisor); t->OctetsIn = t->OctetsOut = t->PacketsIn = t->PacketsOut = 0; t->downtime = 0; @@ -274,8 +274,8 @@ throughput_clear(struct pppThroughput *t } if (clear_type & THROUGHPUT_CURRENT) { - prompt_Printf(prompt, "current cleared (was %6qu bytes/sec in," - " %6qu bytes/sec out)\n", + prompt_Printf(prompt, "current cleared (was %6llu bytes/sec in," + " %6llu bytes/sec out)\n", t->in.OctetsPerSecond, t->out.OctetsPerSecond); t->in.OctetsPerSecond = t->out.OctetsPerSecond = 0; } @@ -287,7 +287,7 @@ throughput_clear(struct pppThroughput *t last = time_buf + strlen(time_buf); if (last > time_buf && *--last == '\n') *last = '\0'; - prompt_Printf(prompt, "peak cleared (was %6qu bytes/sec on %s)\n", + prompt_Printf(prompt, "peak cleared (was %6llu bytes/sec on %s)\n", t->BestOctetsPerSecond, time_buf); t->BestOctetsPerSecond = 0; time(&t->BestOctetsPerSecondTime); Modified: head/usr.sbin/rpc.lockd/kern.c ============================================================================== --- head/usr.sbin/rpc.lockd/kern.c Wed May 23 03:35:08 2012 (r235821) +++ head/usr.sbin/rpc.lockd/kern.c Wed May 23 06:49:50 2012 (r235822) @@ -595,7 +595,7 @@ show(LOCKD_MSG *mp) syslog(LOG_DEBUG, "fh_len %d, fh %s\n", (int)mp->lm_fh_len, buf); /* Show flock structure. */ - syslog(LOG_DEBUG, "start %qu; len %qu; pid %lu; type %d; whence %d\n", + syslog(LOG_DEBUG, "start %llu; len %llu; pid %lu; type %d; whence %d\n", (unsigned long long)mp->lm_fl.l_start, (unsigned long long)mp->lm_fl.l_len, (u_long)mp->lm_fl.l_pid, mp->lm_fl.l_type, mp->lm_fl.l_whence); From owner-svn-src-head@FreeBSD.ORG Wed May 23 07:01:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECCF51065673; Wed, 23 May 2012 07:01:36 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 98A4E8FC0C; Wed, 23 May 2012 07:01:36 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so10219700pbb.13 for ; Wed, 23 May 2012 00:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; bh=z57VCxhiYQtj+iHUqRva0J2wXgOSNtJYPSTKU+XqeBY=; b=aRfGmKC+3cPrV65lRJkCaiZC5ZpBdzWLETrOwiQZPIn0X0zBLRzuEEMuZ71haqLeKw 0VLKbShNsf28lcjq7wupvpxXva8zDav4kQkZ8cAFuoYBg4lip0uzdSCIOY+gM90xO2Y0 eVzOPzOHFs6totqZST7JKZbMEYaH7ak6emJb8ejswzTHgmYs4RM4Bfzu2ifJ87WvwCDt d6KvhrkXQur8yboYhd34gZXGULlNDEhDoZVFJfelOQSuLXQlqRGdPwwAWkMdFHrLTTWl b2YeBhSfs3UPl/Wx9KtgcLaU5RcZx/XI2+PS+nSeXAmyXp44TffshZjMmX3mLFODqnGm 7PKw== Received: by 10.68.197.166 with SMTP id iv6mr7658240pbc.40.1337756496391; Wed, 23 May 2012 00:01:36 -0700 (PDT) Received: from [10.65.51.135] (mobile-166-147-092-070.mycingular.net. [166.147.92.70]) by mx.google.com with ESMTPS id px4sm873141pbb.53.2012.05.23.00.01.34 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 May 2012 00:01:35 -0700 (PDT) References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> <4FBC86B3.8020105@FreeBSD.org> In-Reply-To: <4FBC86B3.8020105@FreeBSD.org> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: X-Mailer: iPhone Mail (9B206) From: Garrett Cooper Date: Wed, 23 May 2012 00:01:29 -0700 To: Dimitry Andric Cc: "mdf@FreeBSD.org" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "David E. O'Brien" , BruceEvans , "svn-src-head@freebsd.org" Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 07:01:37 -0000 On May 22, 2012, at 11:41 PM, Dimitry Andric wrote: > On 2012-05-22 23:07, mdf@FreeBSD.org wrote: > ... >> We run with the following at Isilon, which is somewhat bogus because >> it allows a bit of sloppiness in types, but is also terribly >> convenient since it means no casting on printf arguments is needed: >=20 > Please don't. If you want to write portable code, use the (admittedly > horrible) PRId64 macros instead. Agreed, because the patch attached earlier disguises issues with signedness (= for one) and I've seen some interesting bugs creep in because of issues like= that, an it's painful cleaning up those problems later on (esp. considering= that clang will replace gcc not too far down the line)... Thanks, -Garrett= From owner-svn-src-head@FreeBSD.ORG Wed May 23 09:03:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 021DA1065672; Wed, 23 May 2012 09:03:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx09.syd.optusnet.com.au (fallbackmx09.syd.optusnet.com.au [211.29.132.242]) by mx1.freebsd.org (Postfix) with ESMTP id 86F048FC08; Wed, 23 May 2012 09:03:11 +0000 (UTC) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by fallbackmx09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4N8vYSf004054; Wed, 23 May 2012 18:57:34 +1000 Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4N8vPc1017913 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 May 2012 18:57:26 +1000 Date: Wed, 23 May 2012 18:57:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: gnn@freebsd.org In-Reply-To: <861umcx7oe.wl%gnn@neville-neil.com> Message-ID: <20120523173439.I902@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> <861umcx7oe.wl%gnn@neville-neil.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" , Bruce Evans Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 09:03:12 -0000 On Tue, 22 May 2012 gnn@freebsd.org wrote: > At Wed, 23 May 2012 06:05:06 +1000 (EST), > Bruce Evans wrote: >> [... excessive quoting deleted] > >> Now I prefer the old way, after fixing the bugs found by switching. >> It finds more bugs under FreeBSD, and is bug for bug compatible with >> distribution gcc and probably with other system's headers under >> !FreeBSD. Except under FreeBSD, I prefer %q to be an error. The above >> shows it only being used 12 times in /sys, with most uses of it being >> bugs. Fixing these bugs would leave about 1 correct use of it -- for >> printing the quad_t in unreachable code in msdosfs. This use would be >> easy to avoid too (just cast to uintmax_t). Uses in userland are >> hopefully east to fix and avoid too. In an old userland, there were >> only about 50, with most in netstat/inet6.c, tcopy.c, ftpd, fsirand, >> and contrib'ed code. Of course you can't make it an error for the >> contrib'ed code. > > Instead of replying to the original commit I'll just add to the chain. Please don't quote the whole thing, especially when not replying to any of it. > Note that this change broke buildworld: > > src/usr.sbin/ppp/throughput.c: In function 'throughput_disp': > src/usr.sbin/ppp/throughput.c:119: warning: format '%6qu' expects type 'long unsigned int', but argu > > And several more. Of course ppp has several style bugs and type mismatches, else its brokenness wouldn't have been exposed: - the variables have the bogus type "unsigned long long" - they are printed with the mismatched format "%6qu", although there is a perfectly bogus format "%6llu" that matches them exactly. Another point is that libc printf doesn't really support %q. It just maps %q to %ll and accesses the arg using va_arg(ap, long long). Thus it is technically correct in userland for the format checker to also map %q to %ll and disallow printing int64_t with each in the LP64 case. This is also bug for bug compatible with the gcc distribution and perhaps with other OS's. However the kernel printf is more careful. It doesn't map %q to %ll, and it accesses %q args using va_arg(ap, quad_t). Thus it is technically correct in the kernel for the format checker to also _not_ map %q to %ll and _allow_ printing int64_t with %q. However, %q should never be used. The history of the kernel printf shows that I objected to adding %q support to it in 1999, but not strongly enough to keep it out. I should have objected more to adding support for %ll. This was slightly before C99 came out. %j support was needed before then but was not added until 2002. I had prepared for killing long long and quad_t in the kernel by removing many uses of them. When the %q mistake was committed, there were just 90 instances of 'long long' in /sys. 61 of these were in the i386 FPU emulator. 20 were in other code that I didn't care about and/or was soon to go away: alpha: 6 (half wrong and/or easy to avoid) coda: 3 (all wrong and/or easy to avoid) svr4: 4 (all wrong and/or easy to avoid) vinum: 4 (all easy to avoid?) powerpc: 3 (cloned from wrong ones for alpha) The remaining 9 were: 3 that I was responsible for in i386 clock code and a copy for pc98 (to avoid overflow in multiplication) 2 that I was responsible for in i386 basic typedefs (only used for non-gcc) 1 that I was responsible for in sys/param.h (to avoid overflow in shift) 3 in ntp code (all wrong and easy to avoid. The code wanted precisely 64 bits and assumed that long long gave that. The type that gives 64 bits, int64_t, has been standard in FreeBSD since FreeBSD-2. It came from 4.4BSD-Lite1. While counting the above, I noticed that in the middle of 1999 just before the %q changes, there were about 700 references to int64_t (now counting ones in comments). Just 1 year earlier, there were only about 300. The count of long longs didn't change much in that time. For quad_t, the raw counts were 419 in the middle of 1998 and 441 in the middle of 1999. About half were in nfs (183) and libkern (64). Now /sys has and oldnfs has 58. For long long, the raw count is 1577. So, 13 years after C99 stdint.h made long long unnecessary and after mostly avoiding long long when it was only a gcc misfeature, the use of long long has exploded by a factor of about 1577/91 = 17 :-(. The use of int64_t has also exploded: its raw count is 66730 (!); it has exploded by a factor of about 66730/700 = 95. int32_t is only used 46715 times. I fear than many of the uses of fixed width types are wrong too. The fixed widths become part of both APIs and ABIs so they will be hard to change to support 128-bit things. off_t is only used 2223 times. It has the opposite problem that its API is perfect and supports it having any width, but you can't actually change its width easily since bugware will have assumptions that it is precisely 64 bits, just like old bugware assumed that it and long are precisely 32 bits, but multiplied by a bloat factor of 95 or so. intmax_t is only used 1090 times. It has the same expansion problems for ABIs that long used to have. Bruce From owner-svn-src-head@FreeBSD.ORG Wed May 23 09:34:38 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3D9D1065673; Wed, 23 May 2012 09:34:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 5576E8FC21; Wed, 23 May 2012 09:34:38 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4N9YX1n008435 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 May 2012 19:34:35 +1000 Date: Wed, 23 May 2012 19:34:33 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcel Moolenaar In-Reply-To: Message-ID: <20120523193428.V902@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: mdf@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, "David E. O'Brien" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 09:34:38 -0000 On Tue, 22 May 2012, Marcel Moolenaar wrote: > On May 22, 2012, at 2:07 PM, mdf@FreeBSD.org wrote: > >> On Tue, May 22, 2012 at 1:05 PM, Bruce Evans wrote: >>> On Tue, 22 May 2012, David E. O'Brien wrote: >>> >>>> Log: >>>> Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit >>>> platforms. >>> >>> I think I like this, since it is technically correct, and will find a >>> different set of type mismatches. >> >> We run with the following at Isilon, which is somewhat bogus because >> it allows a bit of sloppiness in types, but is also terribly >> convenient since it means no casting on printf arguments is needed: Without casts, the code will be unportable (sideways and future). >> --- contrib/gcc/c-format.c 2012-05-22 14:08:23.538266746 -0700 >> +++ /data/sb/head/src/contrib/gcc/c-format.c 2012-05-16 >> 12:59:40.937016702 -0700 >> @@ -2298,10 +2570,20 @@ check_format_types (format_wanted_type * >> equivalent but the above test won't consider them equivalent. */ >> if (wanted_type == char_type_node >> && (!pedantic || i < 2) >> && char_type_flag) >> continue; >> + >> + /* Isilon: FreeBSD defines int64_t (and others) as one type (e.g. long >> + long) on i386 and another type (e.g. long) on amd64. This prevents >> + the use of a common format specifier. Treat equal sized integer types >> + as equivalent. */ >> + if (TREE_CODE (wanted_type) == INTEGER_TYPE >> + && TREE_CODE (cur_type) == INTEGER_TYPE >> + && int_size_in_bytes (wanted_type) == int_size_in_bytes (cur_type)) >> + continue; >> + >> /* Now we have a type mismatch. */ >> format_type_warning (types->name, format_start, format_length, >> wanted_type, types->pointer_count, >> types->wanted_type_name, orig_cur_type, arg_num); >> } >> >> >> If there's no objections, I (or David or anyone else) can commit to >> the FreeBSD repository. > > I think such would make support for external (i.e. non-FreeBSD) toolchains > even more problematic. Our format extensions are a big hurdle already. I > think we should not tweak the compiler. I certainly object. It breaks the warning, without even an option to control this. The current checking gives some chance of detecting type mismatches in printf formats without compiling all on arches. It is only for some 64-bit types and formats that the warnings don't correspond to runtime bugs on any currently supported arch. This is because 64 bits is the largest integer size on all supported arch. All of %ll, %q and %j are specified to have >= 64 bits and limited by this, so they have precisely 64 bits and there are no runtime incompatibilities. However, %l doesn't give 64 bits on 32-bit arches, and the compile time warning for using %l to print an int64_t value on a 64-bit system is useful on currently supported arches for preventing unportabilty to 32-bit systems, although %l is correct for this on 64 bit systems. Bruce From owner-svn-src-head@FreeBSD.ORG Wed May 23 10:35:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 75A771065673; Wed, 23 May 2012 10:35:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60CF48FC0C; Wed, 23 May 2012 10:35:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NAZepj063268; Wed, 23 May 2012 10:35:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NAZeTt063266; Wed, 23 May 2012 10:35:40 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205231035.q4NAZeTt063266@svn.freebsd.org> From: Michael Tuexen Date: Wed, 23 May 2012 10:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235827 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 10:35:41 -0000 Author: tuexen Date: Wed May 23 10:35:40 2012 New Revision: 235827 URL: http://svn.freebsd.org/changeset/base/235827 Log: Update copyright date. MFC after: 3 days Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Wed May 23 09:38:37 2012 (r235826) +++ head/lib/libc/net/sctp_sys_calls.c Wed May 23 10:35:40 2012 (r235827) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -32,6 +32,7 @@ #include __FBSDID("$FreeBSD$"); + #include #include #include From owner-svn-src-head@FreeBSD.ORG Wed May 23 10:46:31 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 68A231065673; Wed, 23 May 2012 10:46:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id CA4838FC0A; Wed, 23 May 2012 10:46:30 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4NAkPCK014082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 May 2012 20:46:26 +1000 Date: Wed, 23 May 2012 20:46:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper In-Reply-To: Message-ID: <20120523203051.J1464@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> <4FBC86B3.8020105@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: "mdf@FreeBSD.org" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Dimitry Andric , "David E. O'Brien" , BruceEvans , "svn-src-head@freebsd.org" Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 10:46:31 -0000 On Wed, 23 May 2012, Garrett Cooper wrote: > On May 22, 2012, at 11:41 PM, Dimitry Andric wrote: > >> On 2012-05-22 23:07, mdf@FreeBSD.org wrote: >> ... >>> We run with the following at Isilon, which is somewhat bogus because >>> it allows a bit of sloppiness in types, but is also terribly >>> convenient since it means no casting on printf arguments is needed: >> >> Please don't. If you want to write portable code, use the (admittedly >> horrible) PRId64 macros instead. Please don't. The PRI macros are almost as abominable as long long. > Agreed, because the patch attached earlier disguises issues with signedness (for one) and I've seen some interesting bugs creep in because of issues like that, an it's painful cleaning up those problems later on (esp. considering that clang will replace gcc not too far down the line)... Disagreed (except I always notice sign errors in printf formats too. I once fixed -Wformat to detect sign errors, but ran away since it found even more sign errors than size errors. Now I only notice the sign errors when a size error turns up). Apart from being even uglier looking than long long, the PRI macros are not even usable for printing an averaged typedefed type, since unless there is a format letter and a corresponding PRI macro for just that type, you have to peer inside the opaque details of the type to determine its size and perhaps its signedness and then hard-code the corresponding PRI macro. This breaks as soon as the opaque details change and thus defeats the point of having (semi-)opaque typedefed types. If a variable's type is known to be 64 bits, then you can hard-code PRI64 for it. This breaks as soon as the knowledge becomes out of date. Since the type isn't typedefed, it is less likely to change, but there is no guarantee. Everyone knew that all types were 32 bits and had to change too much to support 64 bit systems. Bruce From owner-svn-src-head@FreeBSD.ORG Wed May 23 11:26:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 250BE1065674; Wed, 23 May 2012 11:26:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A1F08FC0A; Wed, 23 May 2012 11:26:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NBQTLB069863; Wed, 23 May 2012 11:26:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NBQTIN069822; Wed, 23 May 2012 11:26:29 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205231126.q4NBQTIN069822@svn.freebsd.org> From: Michael Tuexen Date: Wed, 23 May 2012 11:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235828 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 11:26:30 -0000 Author: tuexen Date: Wed May 23 11:26:28 2012 New Revision: 235828 URL: http://svn.freebsd.org/changeset/base/235828 Log: Use consistent text at the begining of the files. MFC after: 3 days Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_asconf.h head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_auth.h head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_bsd_addr.h head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_crc32.c head/sys/netinet/sctp_crc32.h head/sys/netinet/sctp_dtrace_declare.h head/sys/netinet/sctp_dtrace_define.h head/sys/netinet/sctp_header.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_indata.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_input.h head/sys/netinet/sctp_lock_bsd.h head/sys/netinet/sctp_os.h head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_peeloff.c head/sys/netinet/sctp_peeloff.h head/sys/netinet/sctp_ss_functions.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_timer.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctp_var.h head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h head/sys/netinet6/sctp6_usrreq.c head/sys/netinet6/sctp6_var.h Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,7 +29,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp.h,v 1.18 2005/03/06 16:04:16 itojun Exp $ */ #include __FBSDID("$FreeBSD$"); @@ -37,6 +36,7 @@ __FBSDID("$FreeBSD$"); #ifndef _NETINET_SCTP_H_ #define _NETINET_SCTP_H_ + #include Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_asconf.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,10 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_asconf.c,v 1.24 2005/03/06 16:04:16 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); + #include #include #include Modified: head/sys/netinet/sctp_asconf.h ============================================================================== --- head/sys/netinet/sctp_asconf.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_asconf.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_asconf.h,v 1.8 2005/03/06 16:04:16 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_auth.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: head/sys/netinet/sctp_auth.h ============================================================================== --- head/sys/netinet/sctp_auth.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_auth.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -33,8 +33,8 @@ #include __FBSDID("$FreeBSD$"); -#ifndef __SCTP_AUTH_H__ -#define __SCTP_AUTH_H__ +#ifndef _NETINET_SCTP_AUTH_H_ +#define _NETINET_SCTP_AUTH_H_ /* digest lengths */ Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_bsd_addr.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_output.c,v 1.46 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_bsd_addr.h ============================================================================== --- head/sys/netinet/sctp_bsd_addr.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_bsd_addr.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -33,8 +33,9 @@ #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_bsd_addr_h__ -#define __sctp_bsd_addr_h__ +#ifndef _NETINET_SCTP_BSD_ADDR_H_ +#define _NETINET_SCTP_BSD_ADDR_H_ + #include #if defined(_KERNEL) || defined(__Userspace__) Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_cc_functions.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,6 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -44,8 +47,6 @@ #include #include #include -#include -__FBSDID("$FreeBSD$"); #define SHIFT_MPTCP_MULTI_N 40 #define SHIFT_MPTCP_MULTI_Z 16 Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_constants.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_constants.h,v 1.17 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_constants_h__ -#define __sctp_constants_h__ +#ifndef _NETINET_SCTP_CONSTANTS_H_ +#define _NETINET_SCTP_CONSTANTS_H_ /* IANA assigned port number for SCTP over UDP encapsulation */ /* For freebsd we cannot bind the port at Modified: head/sys/netinet/sctp_crc32.c ============================================================================== --- head/sys/netinet/sctp_crc32.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_crc32.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,9 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_crc32.c,v 1.12 2005/03/06 16:04:17 itojun Exp $ */ - - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_crc32.h ============================================================================== --- head/sys/netinet/sctp_crc32.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_crc32.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_crc32.h,v 1.5 2004/08/17 04:06:16 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __crc32c_h__ -#define __crc32c_h__ +#ifndef _NETINET_SCTP_CRC32_H_ +#define _NETINET_SCTP_CRC32_H_ #if defined(_KERNEL) #if !defined(SCTP_WITH_NO_CSUM) Modified: head/sys/netinet/sctp_dtrace_declare.h ============================================================================== --- head/sys/netinet/sctp_dtrace_declare.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_dtrace_declare.h Wed May 23 11:26:28 2012 (r235828) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -28,9 +28,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ + #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_dtrace_declare_h__ + +#ifndef _NETINET_SCTP_DTRACE_DECLARE_H_ +#define _NETINET_SCTP_DTRACE_DECLARE_H_ + #include "opt_kdtrace.h" #include #include Modified: head/sys/netinet/sctp_dtrace_define.h ============================================================================== --- head/sys/netinet/sctp_dtrace_define.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_dtrace_define.h Wed May 23 11:26:28 2012 (r235828) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -28,9 +28,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ + #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_dtrace_define_h__ + +#ifndef _NETINET_SCTP_DTRACE_DEFINE_H_ +#define _NETINET_SCTP_DTRACE_DEFINE_H_ + #include "opt_kdtrace.h" #include #include Modified: head/sys/netinet/sctp_header.h ============================================================================== --- head/sys/netinet/sctp_header.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_header.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_header.h,v 1.14 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_header_h__ -#define __sctp_header_h__ +#ifndef _NETINET_SCTP_HEADER_H_ +#define _NETINET_SCTP_HEADER_H_ #include #include Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_indata.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_indata.c,v 1.36 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_indata.h ============================================================================== --- head/sys/netinet/sctp_indata.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_indata.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_indata.h,v 1.9 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_indata_h__ -#define __sctp_indata_h__ +#ifndef _NETINET_SCTP_INDATA_H_ +#define _NETINET_SCTP_INDATA_H_ #if defined(_KERNEL) || defined(__Userspace__) Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_input.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_input.c,v 1.27 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_input.h ============================================================================== --- head/sys/netinet/sctp_input.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_input.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_input.h,v 1.6 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_input_h__ -#define __sctp_input_h__ +#ifndef _NETINET_SCTP_INPUT_H_ +#define _NETINET_SCTP_INPUT_H_ #if defined(_KERNEL) || defined(__Userspace__) void Modified: head/sys/netinet/sctp_lock_bsd.h ============================================================================== --- head/sys/netinet/sctp_lock_bsd.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_lock_bsd.h Wed May 23 11:26:28 2012 (r235828) @@ -1,9 +1,7 @@ -#ifndef __sctp_lock_bsd_h__ -#define __sctp_lock_bsd_h__ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -32,6 +30,12 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + +#ifndef _NETINET_SCTP_LOCK_BSD_H_ +#define _NETINET_SCTP_LOCK_BSD_H_ + /* * General locking concepts: The goal of our locking is to of course provide * consistency and yet minimize overhead. We will attempt to use @@ -70,9 +74,6 @@ * SCTP_INP_INFO_RLOCK() and then when we want to add a new association to * the SCTP_BASE_INFO() list's we will do a SCTP_INP_INFO_WLOCK(). */ -#include -__FBSDID("$FreeBSD$"); - extern struct sctp_foo_stuff sctp_logoff[]; extern int sctp_logoff_stuff; Modified: head/sys/netinet/sctp_os.h ============================================================================== --- head/sys/netinet/sctp_os.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_os.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,10 +29,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ + #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_os_h__ -#define __sctp_os_h__ + +#ifndef _NETINET_SCTP_OS_H_ +#define _NETINET_SCTP_OS_H_ /* * General kernel memory allocation: Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_os_bsd.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2006-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,10 +29,12 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ + #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_os_bsd_h__ -#define __sctp_os_bsd_h__ + +#ifndef _NETINET_SCTP_OS_BSD_H_ +#define _NETINET_SCTP_OS_BSD_H_ /* * includes */ Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_output.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_output.c,v 1.46 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_output.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_output.h,v 1.14 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_output_h__ -#define __sctp_output_h__ +#ifndef _NETINET_SCTP_OUTPUT_H_ +#define _NETINET_SCTP_OUTPUT_H_ #include Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_pcb.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_pcb.c,v 1.38 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_pcb.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,8 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -29,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_pcb.h,v 1.21 2005/07/16 01:18:47 suz Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_pcb_h__ -#define __sctp_pcb_h__ +#ifndef _NETINET_SCTP_PCB_H_ +#define _NETINET_SCTP_PCB_H_ #include #include Modified: head/sys/netinet/sctp_peeloff.c ============================================================================== --- head/sys/netinet/sctp_peeloff.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_peeloff.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,11 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ - -/* $KAME: sctp_peeloff.c,v 1.13 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); + #include #include #include Modified: head/sys/netinet/sctp_peeloff.h ============================================================================== --- head/sys/netinet/sctp_peeloff.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_peeloff.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_peeloff.h,v 1.6 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_peeloff_h__ -#define __sctp_peeloff_h__ +#ifndef _NETINET_SCTP_PEELOFF_H_ +#define _NETINET_SCTP_PEELOFF_H_ Modified: head/sys/netinet/sctp_ss_functions.c ============================================================================== --- head/sys/netinet/sctp_ss_functions.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_ss_functions.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- - * Copyright (c) 2010-2011, by Michael Tuexen. All rights reserved. - * Copyright (c) 2010-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2010-2011, by Robin Seggelmann. All rights reserved. + * Copyright (c) 2010-2012, by Michael Tuexen. All rights reserved. + * Copyright (c) 2010-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2010-2012, by Robin Seggelmann. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_structs.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_structs.h,v 1.13 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_structs_h__ -#define __sctp_structs_h__ +#ifndef _NETINET_SCTP_STRUCTS_H_ +#define _NETINET_SCTP_STRUCTS_H_ #include #include Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_sysctl.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_sysctl.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -33,8 +33,8 @@ #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_sysctl_h__ -#define __sctp_sysctl_h__ +#ifndef _NETINET_SCTP_SYSCTL_H_ +#define _NETINET_SCTP_SYSCTL_H_ #include #include Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_timer.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_timer.c,v 1.29 2005/03/06 16:04:18 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctp_timer.h ============================================================================== --- head/sys/netinet/sctp_timer.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_timer.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,12 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_timer.h,v 1.6 2005/03/06 16:04:18 itojun Exp $ */ #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_timer_h__ -#define __sctp_timer_h__ +#ifndef _NETINET_SCTP_TIMER_H_ +#define _NETINET_SCTP_TIMER_H_ #if defined(_KERNEL) || defined(__Userspace__) Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_uio.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,12 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_uio.h,v 1.11 2005/03/06 16:04:18 itojun Exp $ */ #include __FBSDID("$FreeBSD$"); -#ifndef __sctp_uio_h__ -#define __sctp_uio_h__ +#ifndef _NETINET_SCTP_UIO_H_ +#define _NETINET_SCTP_UIO_H_ #if ! defined(_KERNEL) Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_usrreq.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,10 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_usrreq.c,v 1.48 2005/03/07 23:26:08 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); + #include #include #include Modified: head/sys/netinet/sctp_var.h ============================================================================== --- head/sys/netinet/sctp_var.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctp_var.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp_var.h,v 1.24 2005/03/06 16:04:19 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctputil.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,8 +30,6 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctputil.c,v 1.37 2005/03/07 23:26:09 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet/sctputil.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,14 +30,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ - -/* $KAME: sctputil.h,v 1.15 2005/03/06 16:04:19 itojun Exp $ */ - #include __FBSDID("$FreeBSD$"); -#ifndef __sctputil_h__ -#define __sctputil_h__ +#ifndef _NETINET_SCTP_UTIL_H_ +#define _NETINET_SCTP_UTIL_H_ #if defined(_KERNEL) || defined(__Userspace__) Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet6/sctp6_usrreq.c Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,7 +29,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp6_usrreq.c,v 1.38 2005/08/24 08:08:56 suz Exp $ */ #include __FBSDID("$FreeBSD$"); Modified: head/sys/netinet6/sctp6_var.h ============================================================================== --- head/sys/netinet6/sctp6_var.h Wed May 23 10:35:40 2012 (r235827) +++ head/sys/netinet6/sctp6_var.h Wed May 23 11:26:28 2012 (r235828) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. - * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. + * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. + * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -29,14 +29,13 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -/* $KAME: sctp6_var.h,v 1.7 2004/08/17 04:06:22 itojun Exp $ */ - -#ifndef _NETINET6_SCTP6_VAR_H_ -#define _NETINET6_SCTP6_VAR_H_ #include __FBSDID("$FreeBSD$"); +#ifndef _NETINET6_SCTP6_VAR_H_ +#define _NETINET6_SCTP6_VAR_H_ + #if defined(_KERNEL) SYSCTL_DECL(_net_inet6_sctp6); From owner-svn-src-head@FreeBSD.ORG Wed May 23 11:49:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47851106566B; Wed, 23 May 2012 11:49:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from springbank.echomania.com (andric.com [IPv6:2001:888:2003:1001:230:48ff:fe51:76b6]) by mx1.freebsd.org (Postfix) with ESMTP id D3C6C8FC0A; Wed, 23 May 2012 11:49:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from [192.168.1.6] (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id 41E5BA7071; Wed, 23 May 2012 13:49:24 +0200 (CEST) Message-ID: <4FBCCED9.9050308@FreeBSD.org> Date: Wed, 23 May 2012 13:49:45 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120512 Thunderbird/13.0 MIME-Version: 1.0 To: "David E. O'Brien" References: <201205221818.q4MII7lk019626@svn.freebsd.org> In-Reply-To: <201205221818.q4MII7lk019626@svn.freebsd.org> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 11:49:43 -0000 On 2012-05-22 20:18, David E. O'Brien wrote: > Author: obrien > Date: Tue May 22 18:18:06 2012 > New Revision: 235797 > URL: http://svn.freebsd.org/changeset/base/235797 > > Log: > Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit platforms. > > Modified: > head/contrib/gcc/c-format.c > > Modified: head/contrib/gcc/c-format.c > ============================================================================== > --- head/contrib/gcc/c-format.c Tue May 22 17:44:01 2012 (r235796) > +++ head/contrib/gcc/c-format.c Tue May 22 18:18:06 2012 (r235797) > @@ -287,7 +287,11 @@ static const format_length_info printf_l > { > { "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 }, > { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L }, > +#ifdef __LP64__ > + { "q", FMT_LEN_l, STD_EXT, NULL, 0, 0 }, > +#else > { "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, > +#endif > { "L", FMT_LEN_L, STD_C89, NULL, 0, 0 }, > { "z", FMT_LEN_z, STD_C99, NULL, 0, 0 }, > { "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 }, Until all the additional warnings this causes have been fixed, can this commit please be reverted for now? From owner-svn-src-head@FreeBSD.ORG Wed May 23 12:51:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29A01106564A; Wed, 23 May 2012 12:51:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 143948FC08; Wed, 23 May 2012 12:51:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NCpnSD073342; Wed, 23 May 2012 12:51:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NCpnat073340; Wed, 23 May 2012 12:51:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201205231251.q4NCpnat073340@svn.freebsd.org> From: Andriy Gapon Date: Wed, 23 May 2012 12:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235829 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 12:51:50 -0000 Author: avg Date: Wed May 23 12:51:49 2012 New Revision: 235829 URL: http://svn.freebsd.org/changeset/base/235829 Log: vm_pager_object_lookup: small performance optimization do not needlessly lock an object if its handle doesn't match Reviewed by: kib, alc MFC after: 1 week Modified: head/sys/vm/vm_pager.c Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Wed May 23 11:26:28 2012 (r235828) +++ head/sys/vm/vm_pager.c Wed May 23 12:51:49 2012 (r235829) @@ -271,14 +271,15 @@ vm_pager_object_lookup(struct pagerlst * vm_object_t object; TAILQ_FOREACH(object, pg_list, pager_object_list) { - VM_OBJECT_LOCK(object); - if (object->handle == handle && - (object->flags & OBJ_DEAD) == 0) { - vm_object_reference_locked(object); + if (object->handle == handle) { + VM_OBJECT_LOCK(object); + if ((object->flags & OBJ_DEAD) == 0) { + vm_object_reference_locked(object); + VM_OBJECT_UNLOCK(object); + break; + } VM_OBJECT_UNLOCK(object); - break; } - VM_OBJECT_UNLOCK(object); } return (object); } From owner-svn-src-head@FreeBSD.ORG Wed May 23 13:23:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0079C1065672; Wed, 23 May 2012 13:23:41 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5D9B8FC08; Wed, 23 May 2012 13:23:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NDNePp074802; Wed, 23 May 2012 13:23:40 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NDNekx074798; Wed, 23 May 2012 13:23:40 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201205231323.q4NDNekx074798@svn.freebsd.org> From: Fabien Thomas Date: Wed, 23 May 2012 13:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235831 - in head/sys: arm/arm arm/include dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 13:23:41 -0000 Author: fabient Date: Wed May 23 13:23:40 2012 New Revision: 235831 URL: http://svn.freebsd.org/changeset/base/235831 Log: Soft PMC support for ARM. Callgraph is not captured, only current location. Sample system wide profiling: "pmcstat -Sclock.hard -T" Modified: head/sys/arm/arm/machdep.c head/sys/arm/include/pmc_mdep.h head/sys/dev/hwpmc/hwpmc_arm.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed May 23 13:01:22 2012 (r235830) +++ head/sys/arm/arm/machdep.c Wed May 23 13:23:40 2012 (r235831) @@ -674,9 +674,9 @@ fake_preload_metadata(void) static uint32_t fake_preload[35]; fake_preload[i++] = MODINFO_NAME; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; + fake_preload[i++] = strlen("kernel") + 1; + strcpy((char*)&fake_preload[i++], "kernel"); + i += 1; fake_preload[i++] = MODINFO_TYPE; fake_preload[i++] = strlen("elf kernel") + 1; strcpy((char*)&fake_preload[i++], "elf kernel"); Modified: head/sys/arm/include/pmc_mdep.h ============================================================================== --- head/sys/arm/include/pmc_mdep.h Wed May 23 13:01:22 2012 (r235830) +++ head/sys/arm/include/pmc_mdep.h Wed May 23 13:23:40 2012 (r235831) @@ -54,6 +54,12 @@ union pmc_md_pmc { #define PMC_TRAPFRAME_TO_FP(TF) ((TF)->tf_usr_lr) #define PMC_TRAPFRAME_TO_SP(TF) ((TF)->tf_usr_sp) +/* Build a fake kernel trapframe from current instruction pointer. */ +#define PMC_FAKE_TRAPFRAME(TF) \ + do { \ + __asm __volatile("mov %0, pc" : "=r" ((TF)->tf_pc)); \ + } while (0) + /* * Prototypes */ Modified: head/sys/dev/hwpmc/hwpmc_arm.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_arm.c Wed May 23 13:01:22 2012 (r235830) +++ head/sys/dev/hwpmc/hwpmc_arm.c Wed May 23 13:23:40 2012 (r235831) @@ -38,38 +38,47 @@ __FBSDID("$FreeBSD$"); struct pmc_mdep * pmc_md_initialize() { +#ifdef CPU_XSCALE_IXP425 if (cpu_class == CPU_CLASS_XSCALE) return pmc_xscale_initialize(); else +#endif return NULL; } void pmc_md_finalize(struct pmc_mdep *md) { +#ifdef CPU_XSCALE_IXP425 if (cpu_class == CPU_CLASS_XSCALE) pmc_xscale_finalize(md); else KASSERT(0, ("[arm,%d] Unknown CPU Class 0x%x", __LINE__, cpu_class)); +#endif +} + +static int +pmc_save_callchain(uintptr_t *cc, int maxsamples, + struct trapframe *tf) +{ + + *cc = PMC_TRAPFRAME_TO_PC(tf); + return (1); } int pmc_save_kernel_callchain(uintptr_t *cc, int maxsamples, struct trapframe *tf) { - (void) cc; - (void) maxsamples; - (void) tf; - return (0); + + return pmc_save_callchain(cc, maxsamples, tf); } int pmc_save_user_callchain(uintptr_t *cc, int maxsamples, struct trapframe *tf) { - (void) cc; - (void) maxsamples; - (void) tf; - return (0); + + return pmc_save_callchain(cc, maxsamples, tf); } From owner-svn-src-head@FreeBSD.ORG Wed May 23 13:41:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3883B106566B; Wed, 23 May 2012 13:41:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 239248FC1B; Wed, 23 May 2012 13:41:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NDfCuR075647; Wed, 23 May 2012 13:41:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NDfCRW075645; Wed, 23 May 2012 13:41:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201205231341.q4NDfCRW075645@svn.freebsd.org> From: John Baldwin Date: Wed, 23 May 2012 13:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235833 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 13:41:13 -0000 Author: jhb Date: Wed May 23 13:41:12 2012 New Revision: 235833 URL: http://svn.freebsd.org/changeset/base/235833 Log: Only check to see if a memory resource is a PCI ROM BAR when activating and deactivating PCI resources. Previously, if a device had more than 48 MSI interrupts, then activating message 48 (which has a rid == PCIR_BIOS) would incorrectly try to enable the PCI ROM BAR. Tested by: Olivier Cinquin ocinquin uci edu MFC after: 3 days Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed May 23 13:39:46 2012 (r235832) +++ head/sys/dev/pci/pci.c Wed May 23 13:41:12 2012 (r235833) @@ -4260,7 +4260,7 @@ pci_activate_resource(device_t dev, devi if (device_get_parent(child) == dev) { /* Device ROMs need their decoding explicitly enabled. */ dinfo = device_get_ivars(child); - if (PCIR_IS_BIOS(&dinfo->cfg, rid)) + if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) pci_write_bar(child, pci_find_bar(child, rid), rman_get_start(r) | PCIM_BIOS_ENABLE); switch (type) { @@ -4287,7 +4287,7 @@ pci_deactivate_resource(device_t dev, de /* Disable decoding for device ROMs. */ if (device_get_parent(child) == dev) { dinfo = device_get_ivars(child); - if (PCIR_IS_BIOS(&dinfo->cfg, rid)) + if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid)) pci_write_bar(child, pci_find_bar(child, rid), rman_get_start(r)); } From owner-svn-src-head@FreeBSD.ORG Wed May 23 13:45:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 23D60106564A; Wed, 23 May 2012 13:45:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D35D8FC18; Wed, 23 May 2012 13:45:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NDjqHB075935; Wed, 23 May 2012 13:45:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NDjq5d075932; Wed, 23 May 2012 13:45:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201205231345.q4NDjq5d075932@svn.freebsd.org> From: John Baldwin Date: Wed, 23 May 2012 13:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235834 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 13:45:53 -0000 Author: jhb Date: Wed May 23 13:45:52 2012 New Revision: 235834 URL: http://svn.freebsd.org/changeset/base/235834 Log: Rework the previous change to honor MADT processor IDs when probing processor objects. Instead of forcing the new-bus CPU objects to use a unit number equal to pc_cpuid, adjust acpi_pcpu_get_id() to honor the MADT IDs by default. As with the previous change, setting debug.acpi.cpu_unordered to 1 in the loader will revert to the old behavior. Tested by: jimharris MFC after: 1 month Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed May 23 13:41:12 2012 (r235833) +++ head/sys/dev/acpica/acpi.c Wed May 23 13:45:52 2012 (r235834) @@ -289,13 +289,6 @@ SYSCTL_INT(_debug_acpi, OID_AUTO, reset_ &acpi_reset_clock, 1, "Reset system clock while resuming."); #endif -/* Allow users to ignore processor orders in MADT. */ -static int acpi_cpu_unordered; -TUNABLE_INT("debug.acpi.cpu_unordered", &acpi_cpu_unordered); -SYSCTL_INT(_debug_acpi, OID_AUTO, cpu_unordered, CTLFLAG_RDTUN, - &acpi_cpu_unordered, 0, - "Do not use the MADT to match ACPI Processor objects to CPUs."); - /* Allow users to override quirks. */ TUNABLE_INT("debug.acpi.quirks", &acpi_quirks); @@ -1863,15 +1856,11 @@ static ACPI_STATUS acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status) { struct acpi_prw_data prw; - ACPI_BUFFER buf; - ACPI_OBJECT obj; ACPI_OBJECT_TYPE type; ACPI_HANDLE h; - struct pcpu *pc; device_t bus, child; char *handle_str; - u_int cpuid; - int order, unit; + int order; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -1909,31 +1898,6 @@ acpi_probe_child(ACPI_HANDLE handle, UIN case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL: case ACPI_TYPE_POWER: - unit = -1; - if (type == ACPI_TYPE_PROCESSOR && acpi_cpu_unordered == 0) { - ACPI_STATUS s; - buf.Pointer = &obj; - buf.Length = sizeof(obj); - s = AcpiEvaluateObject(handle, NULL, NULL, &buf); - if (ACPI_SUCCESS(s)) { - CPU_FOREACH(cpuid) { - pc = pcpu_find(cpuid); - if (pc->pc_acpi_id == obj.Processor.ProcId) { - unit = cpuid; - if (bootverbose) - printf("ACPI: %s (ACPI ID %u) -> cpu%d\n", - handle_str, obj.Processor.ProcId, unit); - break; - } - } - if (unit == -1) { - if (bootverbose) - printf("ACPI: %s (ACPI ID %u) ignored\n", - handle_str, obj.Processor.ProcId); - break; - } - } - } /* * Create a placeholder device for this node. Sort the * placeholder so that the probe/attach passes will run @@ -1944,7 +1908,7 @@ acpi_probe_child(ACPI_HANDLE handle, UIN ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "scanning '%s'\n", handle_str)); order = level * 10 + ACPI_DEV_BASE_ORDER; acpi_probe_order(handle, &order); - child = BUS_ADD_CHILD(bus, order, NULL, unit); + child = BUS_ADD_CHILD(bus, order, NULL, -1); if (child == NULL) break; Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Wed May 23 13:41:12 2012 (r235833) +++ head/sys/dev/acpica/acpi_cpu.c Wed May 23 13:45:52 2012 (r235834) @@ -124,6 +124,13 @@ struct acpi_cpu_device { #define PIIX4_STOP_BREAK_MASK (PIIX4_BRLD_EN_IRQ0 | PIIX4_BRLD_EN_IRQ | PIIX4_BRLD_EN_IRQ8) #define PIIX4_PCNTRL_BST_EN (1<<10) +/* Allow users to ignore processor orders in MADT. */ +static int cpu_unordered; +TUNABLE_INT("debug.acpi.cpu_unordered", &cpu_unordered); +SYSCTL_INT(_debug_acpi, OID_AUTO, cpu_unordered, CTLFLAG_RDTUN, + &cpu_unordered, 0, + "Do not use the MADT to match ACPI Processor objects to CPUs."); + /* Platform hardware resource information. */ static uint32_t cpu_smi_cmd; /* Value to write to SMI_CMD. */ static uint8_t cpu_cst_cnt; /* Indicate we are _CST aware. */ @@ -148,7 +155,7 @@ static int acpi_cpu_probe(device_t dev); static int acpi_cpu_attach(device_t dev); static int acpi_cpu_suspend(device_t dev); static int acpi_cpu_resume(device_t dev); -static int acpi_pcpu_get_id(uint32_t idx, uint32_t *acpi_id, +static int acpi_pcpu_get_id(device_t dev, uint32_t *acpi_id, uint32_t *cpu_id); static struct resource_list *acpi_cpu_get_rlist(device_t dev, device_t child); static device_t acpi_cpu_add_child(device_t dev, u_int order, const char *name, @@ -245,7 +252,7 @@ acpi_cpu_probe(device_t dev) */ acpi_id = obj->Processor.ProcId; AcpiOsFree(obj); - if (acpi_pcpu_get_id(device_get_unit(dev), &acpi_id, &cpu_id) != 0) + if (acpi_pcpu_get_id(dev, &acpi_id, &cpu_id) != 0) return (ENXIO); /* @@ -436,36 +443,64 @@ acpi_cpu_resume(device_t dev) } /* - * Find the nth present CPU and return its pc_cpuid as well as set the - * pc_acpi_id from the most reliable source. + * Find the processor associated with a given ACPI ID. By default, + * use the MADT to map ACPI IDs to APIC IDs and use that to locate a + * processor. Some systems have inconsistent ASL and MADT however. + * For these systems the cpu_unordered tunable can be set in which + * case we assume that Processor objects are listed in the same order + * in both the MADT and ASL. */ static int -acpi_pcpu_get_id(uint32_t idx, uint32_t *acpi_id, uint32_t *cpu_id) +acpi_pcpu_get_id(device_t dev, uint32_t *acpi_id, uint32_t *cpu_id) { - struct pcpu *pcpu_data; - uint32_t i; + struct pcpu *pc; + uint32_t i, idx; KASSERT(acpi_id != NULL, ("Null acpi_id")); KASSERT(cpu_id != NULL, ("Null cpu_id")); + idx = device_get_unit(dev); + + /* + * If pc_acpi_id for CPU 0 is not initialized (e.g. a non-APIC + * UP box) use the ACPI ID from the first processor we find. + */ + if (idx == 0 && mp_ncpus == 1) { + pc = pcpu_find(0); + if (pc->pc_acpi_id == 0xffffffff) + pc->pc_acpi_id = *acpi_id; + *cpu_id = 0; + return (0); + } + CPU_FOREACH(i) { - pcpu_data = pcpu_find(i); - KASSERT(pcpu_data != NULL, ("no pcpu data for %d", i)); - if (idx-- == 0) { - /* - * If pc_acpi_id was not initialized (e.g., a non-APIC UP box) - * override it with the value from the ASL. Otherwise, if the - * two don't match, prefer the MADT-derived value. Finally, - * return the pc_cpuid to reference this processor. - */ - if (pcpu_data->pc_acpi_id == 0xffffffff) - pcpu_data->pc_acpi_id = *acpi_id; - else if (pcpu_data->pc_acpi_id != *acpi_id) - *acpi_id = pcpu_data->pc_acpi_id; - *cpu_id = pcpu_data->pc_cpuid; - return (0); + pc = pcpu_find(i); + KASSERT(pc != NULL, ("no pcpu data for %d", i)); + if (cpu_unordered) { + if (idx-- == 0) { + /* + * If pc_acpi_id doesn't match the ACPI ID from the + * ASL, prefer the MADT-derived value. + */ + if (pc->pc_acpi_id != *acpi_id) + *acpi_id = pc->pc_acpi_id; + *cpu_id = pc->pc_cpuid; + return (0); + } + } else { + if (pc->pc_acpi_id == *acpi_id) { + if (bootverbose) + device_printf(dev, "(ACPI ID %u) -> APIC ID %d\n", + *acpi_id, pc->pc_cpuid); + *cpu_id = pc->pc_cpuid; + return (0); + } } } + if (bootverbose) + printf("ACPI: Processor %s (ACPI ID %u) ignored\n", + acpi_name(acpi_get_handle(dev)), *acpi_id); + return (ESRCH); } From owner-svn-src-head@FreeBSD.ORG Wed May 23 14:57:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31E70106566C; Wed, 23 May 2012 14:57:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id D208F8FC0C; Wed, 23 May 2012 14:57:06 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 4958525D385D; Wed, 23 May 2012 14:57:05 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 5B871BE7913; Wed, 23 May 2012 14:57:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id bL7JGtXK+vck; Wed, 23 May 2012 14:57:03 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 0EE00BE7911; Wed, 23 May 2012 14:57:02 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201205230649.q4N6nofV053886@svn.freebsd.org> Date: Wed, 23 May 2012 14:56:59 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205230649.q4N6nofV053886@svn.freebsd.org> To: Xin LI X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235822 - in head: sys/dev/esp sys/gnu/fs/xfs/FreeBSD usr.sbin/ppp usr.sbin/rpc.lockd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 14:57:07 -0000 On 23. May 2012, at 06:49 , Xin LI wrote: > Author: delphij > Date: Wed May 23 06:49:50 2012 > New Revision: 235822 > URL: http://svn.freebsd.org/changeset/base/235822 >=20 > Log: > Fix build: >=20 > - Use %ll instead of %q for explicit long long casts; > - Use %j instead of %q in XFS and cast to intmax_t. >=20 > Tested with: make universe I am still seeing XLP64 failing to compile: cc1: warnings being treated as errors /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c: In function = 'g_flashmap_print': /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: format = '%08llx' expects type 'long long unsigned int', but argument 2 has type = 'off_t' [-Wformat] /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: format = '%08llx' expects type 'long long unsigned int', but argument 3 has type = 'off_t' [-Wformat] /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: format = '%llu' expects type 'long long unsigned int', but argument 5 has type = 'off_t' [-Wformat] --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Wed May 23 15:06:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54BC7106564A; Wed, 23 May 2012 15:06:14 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 267DD8FC18; Wed, 23 May 2012 15:06:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NF6EVt079454; Wed, 23 May 2012 15:06:14 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NF6DVH079451; Wed, 23 May 2012 15:06:13 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205231506.q4NF6DVH079451@svn.freebsd.org> From: Joel Dahl Date: Wed, 23 May 2012 15:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235837 - in head/sbin: dump restore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 15:06:14 -0000 Author: joel (doc committer) Date: Wed May 23 15:06:13 2012 New Revision: 235837 URL: http://svn.freebsd.org/changeset/base/235837 Log: mdoc: move two sentences from synopsis to description (where they really belong). With this change, mandoc now formats these manpages properly. Modified: head/sbin/dump/dump.8 head/sbin/restore/restore.8 Modified: head/sbin/dump/dump.8 ============================================================================== --- head/sbin/dump/dump.8 Wed May 23 14:48:14 2012 (r235836) +++ head/sbin/dump/dump.8 Wed May 23 15:06:13 2012 (r235837) @@ -51,16 +51,6 @@ .Ar filesystem .Nm .Fl W | Fl w -.Pp -.Nm rdump -is an alternate name for -.Nm . -.Pp -.in \" XXX -(The -.Bx 4.3 -option syntax is implemented for backward compatibility, but -is not documented here.) .Sh DESCRIPTION The .Nm @@ -97,6 +87,14 @@ as either its device-special file or its (if that is in a standard entry in .Pa /etc/fstab ) . .Pp +.Nm +may also be invoked as +.Nm rdump . +The +.Bx 4.3 +option syntax is implemented for backward compatibility, but +is not documented here. +.Pp The following options are supported by .Nm : .Bl -tag -width Ds Modified: head/sbin/restore/restore.8 ============================================================================== --- head/sbin/restore/restore.8 Wed May 23 14:48:14 2012 (r235836) +++ head/sbin/restore/restore.8 Wed May 23 15:06:13 2012 (r235837) @@ -68,16 +68,6 @@ .Op Fl f Ar file | Fl P Ar pipecommand .Op Fl s Ar fileno .Op Ar -.Pp -.Nm rrestore -is an alternate name for -.Nm . -.Pp -.in \" XXX -(The -.Bx 4.3 -option syntax is implemented for backward compatibility, but -is not documented here.) .Sh DESCRIPTION The .Nm @@ -104,6 +94,14 @@ flag is specified (see below), the appearance of a directory name refers to the files and (recursively) subdirectories of that directory. .Pp +.Nm +may also be invoked as +.Nm rrestore . +The +.Bx 4.3 +option syntax is implemented for backward compatibility, but +is not documented here. +.Pp Exactly one of the following flags is required: .Bl -tag -width Ds .It Fl i From owner-svn-src-head@FreeBSD.ORG Wed May 23 15:30:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D2ADD1065670; Wed, 23 May 2012 15:30:13 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE3BE8FC0C; Wed, 23 May 2012 15:30:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NFUD3k080793; Wed, 23 May 2012 15:30:13 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NFUDIv080790; Wed, 23 May 2012 15:30:13 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201205231530.q4NFUDIv080790@svn.freebsd.org> From: Jamie Gritton Date: Wed, 23 May 2012 15:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235840 - head/usr.sbin/jail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 15:30:13 -0000 Author: jamie Date: Wed May 23 15:30:13 2012 New Revision: 235840 URL: http://svn.freebsd.org/changeset/base/235840 Log: Note that the new jail(8) will be appearing in 9.1. Modified: head/usr.sbin/jail/jail.8 head/usr.sbin/jail/jail.conf.5 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Wed May 23 15:29:34 2012 (r235839) +++ head/usr.sbin/jail/jail.8 Wed May 23 15:30:13 2012 (r235840) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2012 +.Dd May 23, 2012 .Dt JAIL 8 .Os .Sh NAME @@ -1183,7 +1183,7 @@ utility appeared in Hierarchical/extensible jails were introduced in .Fx 8.0 . The configuration file was introduced in -.Fx 10.0 . +.Fx 9.1 . .Sh AUTHORS .An -nosplit The jail feature was written by Modified: head/usr.sbin/jail/jail.conf.5 ============================================================================== --- head/usr.sbin/jail/jail.conf.5 Wed May 23 15:29:34 2012 (r235839) +++ head/usr.sbin/jail/jail.conf.5 Wed May 23 15:30:13 2012 (r235840) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2012 +.Dd May 23, 2012 .Dt JAIL.CONF 5 .Os .Sh NAME @@ -217,7 +217,7 @@ utility appeared in The .Nm file was added in -.Fx 10.0 . +.Fx 9.1 . .Sh AUTHORS .An -nosplit The jail feature was written by From owner-svn-src-head@FreeBSD.ORG Wed May 23 16:19:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4F5F106566C; Wed, 23 May 2012 16:19:19 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D02198FC14; Wed, 23 May 2012 16:19:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NGJJAB083071; Wed, 23 May 2012 16:19:19 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NGJJRE083069; Wed, 23 May 2012 16:19:19 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201205231619.q4NGJJRE083069@svn.freebsd.org> From: Warren Block Date: Wed, 23 May 2012 16:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235842 - head/bin/uuidgen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 16:19:20 -0000 Author: wblock (doc committer) Date: Wed May 23 16:19:19 2012 New Revision: 235842 URL: http://svn.freebsd.org/changeset/base/235842 Log: Mention the upper hard limit for -n option. Patch slightly modified from PR version. PR: 168255 Submitted by: Andy Kosela Approved by: gjb MFC after: 3 days Modified: head/bin/uuidgen/uuidgen.1 Modified: head/bin/uuidgen/uuidgen.1 ============================================================================== --- head/bin/uuidgen/uuidgen.1 Wed May 23 15:47:07 2012 (r235841) +++ head/bin/uuidgen/uuidgen.1 Wed May 23 16:19:19 2012 (r235842) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 7, 2005 +.Dd May 23, 2012 .Dt UUIDGEN 1 .Os .Sh NAME @@ -52,8 +52,11 @@ instructs to not generate them in batch, but one at a time. .It Fl n This option controls the number of identifiers generated. -By default, multiple -identifiers are generated in batch. +By default, multiple identifiers are generated in batch. +The upper hard limit is 2048 +.Po see +.Xr uuidgen 2 +.Pc . .It Fl o Redirect output to .Ar filename From owner-svn-src-head@FreeBSD.ORG Wed May 23 17:03:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB6C1106567F; Wed, 23 May 2012 17:03:09 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96E258FC15; Wed, 23 May 2012 17:03:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NH39fo085009; Wed, 23 May 2012 17:03:09 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NH39Yq085007; Wed, 23 May 2012 17:03:09 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201205231703.q4NH39Yq085007@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 23 May 2012 17:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235845 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 17:03:09 -0000 Author: jkim Date: Wed May 23 17:03:09 2012 New Revision: 235845 URL: http://svn.freebsd.org/changeset/base/235845 Log: Restore Processor object path for verbose boot message. Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Wed May 23 16:43:37 2012 (r235844) +++ head/sys/dev/acpica/acpi_cpu.c Wed May 23 17:03:09 2012 (r235845) @@ -489,8 +489,10 @@ acpi_pcpu_get_id(device_t dev, uint32_t } else { if (pc->pc_acpi_id == *acpi_id) { if (bootverbose) - device_printf(dev, "(ACPI ID %u) -> APIC ID %d\n", - *acpi_id, pc->pc_cpuid); + device_printf(dev, + "Processor %s (ACPI ID %u) -> APIC ID %d\n", + acpi_name(acpi_get_handle(dev)), *acpi_id, + pc->pc_cpuid); *cpu_id = pc->pc_cpuid; return (0); } From owner-svn-src-head@FreeBSD.ORG Wed May 23 17:09:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 75D3E1065677; Wed, 23 May 2012 17:09:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 618DA8FC16; Wed, 23 May 2012 17:09:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NH9FQR085297; Wed, 23 May 2012 17:09:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NH9Fqc085295; Wed, 23 May 2012 17:09:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205231709.q4NH9Fqc085295@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 May 2012 17:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235846 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 17:09:15 -0000 Author: kib Date: Wed May 23 17:09:14 2012 New Revision: 235846 URL: http://svn.freebsd.org/changeset/base/235846 Log: Add 'drmn' device as another drm child, to allow drm2 drivers to live in parallel with drm1. Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/sys/dev/pci/vga_pci.c Modified: head/sys/dev/pci/vga_pci.c ============================================================================== --- head/sys/dev/pci/vga_pci.c Wed May 23 17:03:09 2012 (r235845) +++ head/sys/dev/pci/vga_pci.c Wed May 23 17:09:14 2012 (r235846) @@ -105,6 +105,7 @@ vga_pci_attach(device_t dev) /* Always create a drm child for now to make it easier on drm. */ device_add_child(dev, "drm", -1); + device_add_child(dev, "drmn", -1); bus_generic_attach(dev); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed May 23 17:10:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E1FE106564A; Wed, 23 May 2012 17:10:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3F08FC12; Wed, 23 May 2012 17:10:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NHANLB085387; Wed, 23 May 2012 17:10:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NHAN9s085383; Wed, 23 May 2012 17:10:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205231710.q4NHAN9s085383@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 May 2012 17:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235847 - in head/sys/modules/drm2: . drm2 i915kms X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 17:10:23 -0000 Author: kib Date: Wed May 23 17:10:22 2012 New Revision: 235847 URL: http://svn.freebsd.org/changeset/base/235847 Log: The drm2 modules makefiles commit. Still not attached to the build. Sponsored by: The FreeBSD Foundation MFC after: 1 month Added: head/sys/modules/drm2/ head/sys/modules/drm2/Makefile (contents, props changed) head/sys/modules/drm2/Makefile.inc (contents, props changed) head/sys/modules/drm2/drm2/ head/sys/modules/drm2/drm2/Makefile (contents, props changed) head/sys/modules/drm2/i915kms/ head/sys/modules/drm2/i915kms/Makefile (contents, props changed) Added: head/sys/modules/drm2/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/drm2/Makefile Wed May 23 17:10:22 2012 (r235847) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +SUBDIR = \ + drm2 \ + i915kms + +.include Added: head/sys/modules/drm2/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/drm2/Makefile.inc Wed May 23 17:10:22 2012 (r235847) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Added: head/sys/modules/drm2/drm2/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/drm2/drm2/Makefile Wed May 23 17:10:22 2012 (r235847) @@ -0,0 +1,39 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/drm2 +KMOD = drm2 +SRCS = \ + drm_agpsupport.c \ + drm_auth.c \ + drm_bufs.c \ + drm_context.c \ + drm_crtc.c \ + drm_crtc_helper.c \ + drm_dma.c \ + drm_dp_iic_helper.c \ + drm_drawable.c \ + drm_drv.c \ + drm_edid.c \ + drm_fb_helper.c \ + drm_fops.c \ + drm_gem.c \ + drm_gem_names.c \ + drm_hashtab.c \ + drm_ioctl.c \ + drm_irq.c \ + drm_linux_list_sort.c \ + drm_lock.c \ + drm_memory.c \ + drm_mm.c \ + drm_modes.c \ + drm_pci.c \ + drm_scatter.c \ + drm_sman.c \ + drm_stub.c \ + drm_sysctl.c \ + drm_vm.c + +SRCS +=device_if.h bus_if.h pci_if.h device_if.h iicbus_if.h opt_drm.h \ + opt_vm.h + +.include Added: head/sys/modules/drm2/i915kms/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/drm2/i915kms/Makefile Wed May 23 17:10:22 2012 (r235847) @@ -0,0 +1,34 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/drm2/i915 +KMOD = i915kms +SRCS = \ + i915_debug.c \ + i915_dma.c \ + i915_drv.c \ + i915_gem.c \ + i915_gem_execbuffer.c \ + i915_gem_evict.c \ + i915_gem_gtt.c \ + i915_gem_tiling.c \ + i915_irq.c \ + i915_suspend.c \ + intel_bios.c \ + intel_crt.c \ + intel_display.c \ + intel_dp.c \ + intel_fb.c \ + intel_hdmi.c \ + intel_iic.c \ + intel_lvds.c \ + intel_modes.c \ + intel_opregion.c \ + intel_overlay.c \ + intel_panel.c \ + intel_ringbuffer.c \ + intel_sdvo.c \ + intel_sprite.c \ + intel_tv.c +SRCS += device_if.h bus_if.h pci_if.h iicbus_if.h iicbb_if.h opt_drm.h + +.include From owner-svn-src-head@FreeBSD.ORG Wed May 23 17:13:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AFAA106566B; Wed, 23 May 2012 17:13:31 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 042838FC16; Wed, 23 May 2012 17:13:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NHDU8O085576; Wed, 23 May 2012 17:13:30 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NHDUaR085572; Wed, 23 May 2012 17:13:30 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201205231713.q4NHDUaR085572@svn.freebsd.org> From: Isabell Long Date: Wed, 23 May 2012 17:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235848 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 17:13:31 -0000 Author: issyl0 (doc committer) Date: Wed May 23 17:13:30 2012 New Revision: 235848 URL: http://svn.freebsd.org/changeset/base/235848 Log: Add two new locale-specific man pages: - libc/stdio/scanf_l.3 - libc/stdio/printf_l.3 Reviewed by: theraven Approved by: gabor (mentor) MFC after: 5 days Added: head/lib/libc/stdio/printf_l.3 (contents, props changed) head/lib/libc/stdio/scanf_l.3 (contents, props changed) Modified: head/lib/libc/stdio/Makefile.inc Modified: head/lib/libc/stdio/Makefile.inc ============================================================================== --- head/lib/libc/stdio/Makefile.inc Wed May 23 17:10:22 2012 (r235847) +++ head/lib/libc/stdio/Makefile.inc Wed May 23 17:13:30 2012 (r235848) @@ -36,7 +36,8 @@ MAN+= fclose.3 ferror.3 fflush.3 fgetln. fopen.3 fputs.3 \ fputws.3 fread.3 fseek.3 funopen.3 fwide.3 getc.3 \ getline.3 getwc.3 mktemp.3 \ - printf.3 putc.3 putwc.3 remove.3 scanf.3 setbuf.3 stdio.3 tmpnam.3 \ + printf.3 printf_l.3 putc.3 putwc.3 remove.3 scanf.3 scanf_l.3 setbuf.3 \ + stdio.3 tmpnam.3 \ ungetc.3 ungetwc.3 wprintf.3 wscanf.3 MLINKS+=fclose.3 fcloseall.3 @@ -63,11 +64,16 @@ MLINKS+=printf.3 asprintf.3 printf.3 dpr printf.3 vasprintf.3 printf.3 vdprintf.3 \ printf.3 vfprintf.3 printf.3 vprintf.3 printf.3 vsnprintf.3 \ printf.3 vsprintf.3 +MLINKS+=printf_l.3 asprintf_l.3 printf_l.3 fprintf_l.3 printf_l.3 snprintf_l.3 \ + printf_l.3 sprintf_l.3 printf_l.3 vasprintf_l.3 printf_l.3 vfprintf_l.3 \ + printf_l.3 vprintf_l.3 printf_l.3 vsnprintf_l.3 printf_l.3 vsprintf_l.3 MLINKS+=putc.3 fputc.3 putc.3 putc_unlocked.3 putc.3 putchar.3 \ putc.3 putchar_unlocked.3 putc.3 putw.3 MLINKS+=putwc.3 fputwc.3 putwc.3 putwchar.3 MLINKS+=scanf.3 fscanf.3 scanf.3 sscanf.3 scanf.3 vfscanf.3 scanf.3 vscanf.3 \ scanf.3 vsscanf.3 +MLINKS+=scanf_l.3 fscanf_l.3 scanf_l.3 sscanf_l.3 scanf_l.3 vfscanf_l.3 \ + scanf_l.3 vscanf_l.3 scanf_l.3 vsscanf_l.3 MLINKS+=setbuf.3 setbuffer.3 setbuf.3 setlinebuf.3 setbuf.3 setvbuf.3 MLINKS+=tmpnam.3 tempnam.3 tmpnam.3 tmpfile.3 MLINKS+=wprintf.3 fwprintf.3 wprintf.3 swprintf.3 \ Added: head/lib/libc/stdio/printf_l.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdio/printf_l.3 Wed May 23 17:13:30 2012 (r235848) @@ -0,0 +1,80 @@ +.\" Copyright (c) 2012 Isabell Long +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 7, 2012 +.Dt PRINTF_L 3 +.Os +.Sh NAME +.Nm printf_l , +.Nm asprintf_l , +.Nm fprintf_l , +.Nm snprintf_l , +.Nm sprintf_l , +.Nm vasprintf_l , +.Nm vfprintf_l , +.Nm vprintf_l , +.Nm vsnprintf_l , +.Nm vsprintf_l +.Nd formatted output conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fn printf_l "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn asprintf_l "char **ret" "locale_t loc" "const char * format" "..." +.Ft int +.Fn fprintf_l "FILE * restrict stream" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn snprintf_l "char * restrict str" "size_t size" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn sprintf_l "char * restrict str" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn vasprintf_l "char **ret" "locale_t loc" "const char *format" "va_list ap" +.Ft int +.Fn vfprintf_l "FILE * restrict stream" "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vprintf_l "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vsnprintf_l "char * restrict str" "size_t size" "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vsprintf_l "char * restrict str" "locale_t loc" "const char * restrict format" "va_list ap" +.Sh DESCRIPTION +The above functions are used to convert formatted output in the locale +.Fa loc . +They behave in the same way as the versions without the _l suffix, but use +the specified locale rather than the global or per-thread locale. +See the specific manual pages for more information. +.Sh SEE ALSO +.Xr printf 3 , +.Xr xlocale 3 +.Sh STANDARDS +These functions do not conform to any specific standard so they should be +considered as non-portable local extensions. +.Sh HISTORY +These functions first appeared in Darwin and were first implemented in +.Fx 9.1 . Added: head/lib/libc/stdio/scanf_l.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdio/scanf_l.3 Wed May 23 17:13:30 2012 (r235848) @@ -0,0 +1,70 @@ +.\" Copyright (c) 2012 Isabell Long +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 8, 2012 +.Dt SCANF_L 3 +.Os +.Sh NAME +.Nm scanf_l , +.Nm fscanf_l , +.Nm sscanf_l , +.Nm vfscanf_l , +.Nm vscanf_l , +.Nm vsscanf_l +.Nd input format conversion +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdio.h +.Ft int +.Fn scanf_l "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn fscanf_l "FILE * restrict stream" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn sscanf_l "const char * restrict str" "locale_t loc" "const char * restrict format" "..." +.Ft int +.Fn vfscanf_l "FILE * restrict stream" "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vscanf_l "locale_t loc" "const char * restrict format" "va_list ap" +.Ft int +.Fn vsscanf_l "const char * restrict str" "locale_t loc" "const char * restrict format" "va_list ap" +.Sh DESCRIPTION +The above functions scan input according to a specified +.Fa format +in the locale +.Fa loc . +They behave in the same way as the versions without the _l suffix, but use +the specific locale rather than the the global or per-thread locale. +See the specific manual pages for more information. +.Sh SEE ALSO +.Xr scanf 3 , +.Xr xlocale 3 +.Sh STANDARDS +These functions do not conform to any specific standard so they should be +considered as non-portable local extensions. +.Sh HISTORY +These functions first appeared in Darwin and were first implemented in +.Fx 9.1 . From owner-svn-src-head@FreeBSD.ORG Wed May 23 17:50:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 490D0106566C; Wed, 23 May 2012 17:50:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 340448FC14; Wed, 23 May 2012 17:50:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NHo05m087062; Wed, 23 May 2012 17:50:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NHo0kJ087060; Wed, 23 May 2012 17:50:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205231750.q4NHo0kJ087060@svn.freebsd.org> From: Xin LI Date: Wed, 23 May 2012 17:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235849 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 17:50:00 -0000 Author: delphij Date: Wed May 23 17:49:59 2012 New Revision: 235849 URL: http://svn.freebsd.org/changeset/base/235849 Log: Use %j and cast off_t to intmax_t for now to fix build. Noticed by: bz Modified: head/sys/geom/geom_flashmap.c Modified: head/sys/geom/geom_flashmap.c ============================================================================== --- head/sys/geom/geom_flashmap.c Wed May 23 17:13:30 2012 (r235848) +++ head/sys/geom/geom_flashmap.c Wed May 23 17:49:59 2012 (r235849) @@ -78,8 +78,8 @@ static void g_flashmap_print(struct g_flashmap_slice *slice) { - printf("%08llx-%08llx: %s (%lluKB)\n", slice->sl_start, slice->sl_end, - slice->sl_name, (slice->sl_end - slice->sl_start) / 1024); + printf("%08jx-%08jx: %s (%lluKB)\n", (intmax_t)slice->sl_start, (intmax_t)slice->sl_end, + slice->sl_name, (uintmax_t)(slice->sl_end - slice->sl_start) / 1024); } static int From owner-svn-src-head@FreeBSD.ORG Wed May 23 17:51:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75ACC106564A; Wed, 23 May 2012 17:51:16 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 5498D8FC08; Wed, 23 May 2012 17:51:16 +0000 (UTC) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id EEA3D1213D; Wed, 23 May 2012 10:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1337795476; bh=KYalf5lV/HYPv0/pkJyD9XEhejhLN55UG7YXEIySTKQ=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=xkzrrIziT8+gmbyZuQSlzQ3AvWH4d9lC4XG4AY3idj10+VWdquN7vu/BroWX1KdXB PClXVWQDPLrVoikZHyrJnzot3EubGATMzcIxlOSMa0/4Pw0wjWYDrROlC+p2XCiPJT 58DA6CliLkzt81zjDBfXy3Rm6s37KTuhM0yofIoU= Message-ID: <4FBD2393.708@delphij.net> Date: Wed, 23 May 2012 10:51:15 -0700 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201205230649.q4N6nofV053886@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, d@delphij.net, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r235822 - in head: sys/dev/esp sys/gnu/fs/xfs/FreeBSD usr.sbin/ppp usr.sbin/rpc.lockd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 17:51:16 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 05/23/12 07:56, Bjoern A. Zeeb wrote: > > On 23. May 2012, at 06:49 , Xin LI wrote: > >> Author: delphij Date: Wed May 23 06:49:50 2012 New Revision: >> 235822 URL: http://svn.freebsd.org/changeset/base/235822 >> >> Log: Fix build: >> >> - Use %ll instead of %q for explicit long long casts; - Use %j >> instead of %q in XFS and cast to intmax_t. >> >> Tested with: make universe > > > I am still seeing XLP64 failing to compile: > > cc1: warnings being treated as errors > /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c: In function > 'g_flashmap_print': > /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: > format '%08llx' expects type 'long long unsigned int', but argument > 2 has type 'off_t' [-Wformat] > /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: > format '%08llx' expects type 'long long unsigned int', but argument > 3 has type 'off_t' [-Wformat] > /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: > format '%llu' expects type 'long long unsigned int', but argument 5 > has type 'off_t' [-Wformat] Weird, I don't know why I didn't caught this :-/ It seems that 'universe_kernel' does not do things after an existing universe build? Should be fixed in r235849. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJPvSOSAAoJEG80Jeu8UPuz6YwH/2zRaib16TwoUKMWPvRYgrDi JikyBmSqddhuN7uLJubT9KoiDNmX6dAjVHwGZt+p+EvIkYTCw96hUPR5XY/JrHXz YxKF0u5MsqpOGOkWWtlKIjwC3YE96TG5GAx9l8UzLU3FgGtM4OHjUmj3JUA1zXZ9 Fe4Cw1fzYcIW8xezghBbSzhfcOefWkizRY8gFSDRNUTn8GMEdngJ+f5uetzKBo7F juE3OtcgB6sHNaxf9rNup1RvfN7x9odlQyK/IAPrp2G/LlaeBN8szI1fcJjK2q8A qzA9/QPE3258slir0n8JGy809+9L8VZIC1edSanXqU8CAh/+6SLLNhtfd/XhCjU= =H/R1 -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed May 23 18:10:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6318B106566B; Wed, 23 May 2012 18:10:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4367B8FC17; Wed, 23 May 2012 18:10:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NIAtxx087929; Wed, 23 May 2012 18:10:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NIAteP087924; Wed, 23 May 2012 18:10:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205231810.q4NIAteP087924@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 May 2012 18:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235850 - in head/sys: kern sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 18:10:55 -0000 Author: kib Date: Wed May 23 18:10:54 2012 New Revision: 235850 URL: http://svn.freebsd.org/changeset/base/235850 Log: Calculate the count of per-process cow faults. Export the count to userspace using the obscure spare int field in struct kinfo_proc. Submitted by: Andrey Zonov MFC after: 1 week Modified: head/sys/kern/kern_proc.c head/sys/sys/proc.h head/sys/sys/user.h head/sys/vm/vm_fault.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed May 23 17:49:59 2012 (r235849) +++ head/sys/kern/kern_proc.c Wed May 23 18:10:54 2012 (r235850) @@ -878,6 +878,9 @@ fill_kinfo_proc_only(struct proc *p, str kp->ki_childtime = kp->ki_childstime; timevaladd(&kp->ki_childtime, &kp->ki_childutime); + FOREACH_THREAD_IN_PROC(p, td0) + kp->ki_cow += td0->td_cow; + tp = NULL; if (p->p_pgrp) { kp->ki_pgid = p->p_pgrp->pg_id; @@ -990,6 +993,7 @@ fill_kinfo_thread(struct thread *td, str kp->ki_runtime = cputick2usec(td->td_rux.rux_runtime); kp->ki_pctcpu = sched_pctcpu(td); kp->ki_estcpu = td->td_estcpu; + kp->ki_cow = td->td_cow; } /* We can't get this anymore but ps etc never used it anyway. */ Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed May 23 17:49:59 2012 (r235849) +++ head/sys/sys/proc.h Wed May 23 18:10:54 2012 (r235850) @@ -247,6 +247,7 @@ struct thread { int td_slptick; /* (t) Time at sleep. */ int td_blktick; /* (t) Time spent blocked. */ int td_swvoltick; /* (t) Time at last SW_VOL switch. */ + u_int td_cow; /* (*) Number of copy-on-write faults */ struct rusage td_ru; /* (t) rusage information. */ struct rusage_ext td_rux; /* (t) Internal rusage information. */ uint64_t td_incruntime; /* (t) Cpu ticks to transfer to proc. */ Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Wed May 23 17:49:59 2012 (r235849) +++ head/sys/sys/user.h Wed May 23 18:10:54 2012 (r235850) @@ -159,7 +159,7 @@ struct kinfo_proc { u_int ki_estcpu; /* Time averaged value of ki_cpticks */ u_int ki_slptime; /* Time since last blocked */ u_int ki_swtime; /* Time swapped in or out */ - int ki_spareint1; /* unused (just here for alignment) */ + u_int ki_cow; /* number of copy-on-write faults */ u_int64_t ki_runtime; /* Real time in microsec */ struct timeval ki_start; /* starting time */ struct timeval ki_childtime; /* time used by process children */ Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed May 23 17:49:59 2012 (r235849) +++ head/sys/vm/vm_fault.c Wed May 23 18:10:54 2012 (r235850) @@ -805,6 +805,7 @@ vnode_locked: if (!is_first_object_locked) VM_OBJECT_LOCK(fs.object); PCPU_INC(cnt.v_cow_faults); + curthread->td_cow++; } else { prot &= ~VM_PROT_WRITE; } From owner-svn-src-head@FreeBSD.ORG Wed May 23 18:11:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 828C31065670; Wed, 23 May 2012 18:11:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DE8A8FC0C; Wed, 23 May 2012 18:11:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NIBb0K088003; Wed, 23 May 2012 18:11:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NIBbHX088000; Wed, 23 May 2012 18:11:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205231811.q4NIBbHX088000@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 May 2012 18:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235851 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 18:11:37 -0000 Author: kib Date: Wed May 23 18:11:36 2012 New Revision: 235851 URL: http://svn.freebsd.org/changeset/base/235851 Log: Add 'cow' keyword to show per-process cow count. Submitted by: Andrey Zonov MFC after: 1 week Modified: head/bin/ps/keyword.c head/bin/ps/ps.1 Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Wed May 23 18:10:54 2012 (r235850) +++ head/bin/ps/keyword.c Wed May 23 18:11:36 2012 (r235851) @@ -76,6 +76,7 @@ static VAR var[] = { {"comm", "COMMAND", NULL, LJUST, ucomm, 0, CHAR, NULL, 0}, {"command", "COMMAND", NULL, COMM|LJUST|USER, command, 0, CHAR, NULL, 0}, + {"cow", "COW", NULL, 0, kvar, KOFF(ki_cow), UINT, "u", 0}, {"cpu", "CPU", NULL, 0, kvar, KOFF(ki_estcpu), UINT, "d", 0}, {"cputime", "", "time", 0, NULL, 0, CHAR, NULL, 0}, {"egid", "", "gid", 0, NULL, 0, CHAR, NULL, 0}, Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Wed May 23 18:10:54 2012 (r235850) +++ head/bin/ps/ps.1 Wed May 23 18:11:36 2012 (r235851) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 8, 2012 +.Dd May 20, 2012 .Dt PS 1 .Os .Sh NAME @@ -496,6 +496,8 @@ login class command .It Cm command command and arguments +.It Cm cow +number of copy-on-write faults .It Cm cpu short-term CPU usage factor (for scheduling) .It Cm emul From owner-svn-src-head@FreeBSD.ORG Wed May 23 18:17:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36D89106564A; Wed, 23 May 2012 18:17:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21A908FC08; Wed, 23 May 2012 18:17:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NIH2U8088269; Wed, 23 May 2012 18:17:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NIH2t7088267; Wed, 23 May 2012 18:17:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205231817.q4NIH2t7088267@svn.freebsd.org> From: Xin LI Date: Wed, 23 May 2012 18:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235852 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 18:17:03 -0000 Author: delphij Date: Wed May 23 18:17:02 2012 New Revision: 235852 URL: http://svn.freebsd.org/changeset/base/235852 Log: Use %ju to match uintmax_t usage Modified: head/sys/geom/geom_flashmap.c Modified: head/sys/geom/geom_flashmap.c ============================================================================== --- head/sys/geom/geom_flashmap.c Wed May 23 18:11:36 2012 (r235851) +++ head/sys/geom/geom_flashmap.c Wed May 23 18:17:02 2012 (r235852) @@ -78,7 +78,7 @@ static void g_flashmap_print(struct g_flashmap_slice *slice) { - printf("%08jx-%08jx: %s (%lluKB)\n", (intmax_t)slice->sl_start, (intmax_t)slice->sl_end, + printf("%08jx-%08jx: %s (%juKB)\n", (intmax_t)slice->sl_start, (intmax_t)slice->sl_end, slice->sl_name, (uintmax_t)(slice->sl_end - slice->sl_start) / 1024); } From owner-svn-src-head@FreeBSD.ORG Wed May 23 18:41:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C70AC1065672; Wed, 23 May 2012 18:41:45 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B25968FC14; Wed, 23 May 2012 18:41:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NIfjVt089273; Wed, 23 May 2012 18:41:45 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NIfjNG089271; Wed, 23 May 2012 18:41:45 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205231841.q4NIfjNG089271@svn.freebsd.org> From: Joel Dahl Date: Wed, 23 May 2012 18:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235853 - head/usr.bin/lex X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 18:41:45 -0000 Author: joel (doc committer) Date: Wed May 23 18:41:45 2012 New Revision: 235853 URL: http://svn.freebsd.org/changeset/base/235853 Log: Fix error reported by mandoc. Modified: head/usr.bin/lex/lex.1 Modified: head/usr.bin/lex/lex.1 ============================================================================== --- head/usr.bin/lex/lex.1 Wed May 23 18:17:02 2012 (r235852) +++ head/usr.bin/lex/lex.1 Wed May 23 18:41:45 2012 (r235853) @@ -2247,8 +2247,7 @@ automatically anyway. .TP .B \-F specifies that the -.ul -fast +.I fast scanner table representation should be used (and stdio bypassed). This representation is about as fast as the full table representation From owner-svn-src-head@FreeBSD.ORG Wed May 23 18:44:49 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA7491065672; Wed, 23 May 2012 18:44:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8974F8FC0A; Wed, 23 May 2012 18:44:49 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4NIintY074336; Wed, 23 May 2012 18:44:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4NIinMS074335; Wed, 23 May 2012 18:44:49 GMT (envelope-from bapt@FreeBSD.org) X-Authentication-Warning: freefall.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f Date: Wed, 23 May 2012 20:44:46 +0200 From: Baptiste Daroussin To: Bruce Evans Message-ID: <20120523184446.GB64580@ithaqua.etoilebsd.net> References: <201205220128.q4M1SXPv081576@svn.freebsd.org> <20120522183847.M1344@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" Content-Disposition: inline In-Reply-To: <20120522183847.M1344@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Garrett Cooper , Kevin Lo , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r235767 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 18:44:49 -0000 --8GpibOaaTibBMecb Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 22, 2012 at 08:51:44PM +1000, Bruce Evans wrote: > On Mon, 21 May 2012, Garrett Cooper wrote: >=20 > > On Mon, May 21, 2012 at 6:28 PM, Kevin Lo wrote: > >> Author: kevlo > >> Date: Tue May 22 01:28:32 2012 > >> New Revision: 235767 > >> URL: http://svn.freebsd.org/changeset/base/235767 > >> > >> Log: > >> =A0Add missing header needed by free() > >> > >> =A0Reported by: =A0tinderbox >=20 > Please don't use binary characters in mail. >=20 > > Thank you for saving my mailbox :)!!! > > > > FWIW, it's weird because my STABLE-9 box didn't reproduce this. >=20 > This seems to be a bug in both nsparser.y and the new yacc: > - new yacc: it is incompatible. >=20 > Old yacc includes stdlib.h and string.h as the first thing in the > generated file, so the C code copied from the .y part sees them too. >=20 > New yacc puts more its code including its all includes (which still > involve stdlib.h) at the end of the generated file. >=20 > Including stdlib.h nearly first is from Lite2 (skeleton.c 1.7 in 1997). > Much later, FreeBSD moved it to the very first thing in the generated > file, so as to use namespace pollution (__unused) from it early. > __unused was ifdefed and was defined by the yacc skeleton if > didn't define it. It took much churn to produce this, but it seems to > have been garbage, since old yacc didn't actually generate any use of > __unused. The definition was apparently compatibilty cruft to hide > unportabilities in .y files that use __unused (I guess these failed for > bootstrapping). New yacc doesn't define __unused. >=20 > - nsparser.y: it uses free() but never declared it. It depended on > namespace pollution in the yacc code, and this pollution being in a > particular order. >=20 > The yyparse() incompatibilities seem to be bugs on both sides too: > - Old yacc didn't declare yyparse() automatically, so .y files had to do > it, but probably shouldn't have. >=20 > - New yacc still doesn't declare yylex() or yyerror() automatically, so > applications still have to declare them. >=20 > - Some of these may be more the responsibility of the yacc library (to > supply defaults) than others. I couldn't see who is required to decla= re > them in POSIX.1-2001. However, a bad example in POSIX.1 has "extern i= nt > yyparse();" in main() just before calling yyparse(). Badness in this > example include several style bugs and the declaration being incomplete > (missing "void"). > Old yacc has about 20 lines of ifdefs half just to supply this "void" > for STDC but not for K&R. New yacc no longer supports K&R, at least > here, but it still has 11 lines of ifdefs to get the declaration of > yyparse() right for bison compatibility). > I don't know if the badness includes having the home made declaration. >=20 > Nearby bugs: all CSRG and FreeBSD changes including copyrights and > history seem to have been lost. Just after the old include of stdlib.h, > skeleton.c used to produce a string yyrcsid[] with __FBSDID() for > skeleton.c itself in it. New yacc generates a string yysccsid with > a hard-coded berkeley 1993 id in it, and the name in this id doesn't > even match the file name (it is "yaccpar"). Another FreeBSD change was > to remove this bogus id from the generated file. >=20 > Some relevant FreeBSD changes: >=20 > % Index: skeleton.c > % =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > % RCS file: /home/ncvs/src/usr.bin/yacc/skeleton.c,v > % retrieving revision 1.1.1.2 > % retrieving revision 1.37 > % diff -u -2 -r1.1.1.2 -r1.37 > % --- skeleton.c 6 Jan 1997 03:03:46 -0000 1.1.1.2 > % +++ skeleton.c 12 Feb 2003 18:03:55 -0000 1.37 > % @@ -35,7 +35,12 @@ > % */ > %=20 > % +#if 0 > % #ifndef lint > % static char sccsid[] =3D "@(#)skeleton.c 5.8 (Berkeley) 4/29/95"; > % -#endif /* not lint */ > % +#endif > % +#endif >=20 > FreeBSD normally comments out vendor ids like this. 5.8 is from Lite2; > Lite1 had 5.7. New yacc doesn't have any of this. It apparently started > from older yacc (before Lite1; indeed, it agrees with the FreeBSD-1 =3D= =3D Net/2 > version in not having any CSRG copyrights or this sccsid). >=20 > % + > % +#include > % +__FBSDID("$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.37 2003/02/12 18:0= 3:55 davidc Exp $"); >=20 > FreeBSD normally adds this to source files. Except in contrib. yacc is > now mostly in contrib, although it hasn't changed all that much. >=20 > %=20 > % #include "defs.h" > % @@ -53,31 +58,42 @@ > % /* are conditional. */ > %=20 > % -char *banner[] =3D > % +const char *banner[] =3D >=20 > New yacc has this change too. >=20 > % { > % + "#include ", >=20 > See above. >=20 > % "#ifndef lint", > % - "static char yysccsid[] =3D \"@(#)yaccpar 1.9 (Berkeley) 02/21/93\= ";", >=20 > Was in Net/2 (?), FreeBSD-1, Lite1 and Lite2. Came back with new yacc. > It's interesting that "yaccpar 1.9 (Berkeley) 1.9 02/21/93" is only 3 mon= ths > before the correct id "skeleton.c 5.7 (Berkeley) 5/24/93". >=20 > Hmm, the FreeBSD-1 history is even more instructive than I first > thought. FreeBSD-1 started with the CSRG version of skeleton.c on > 1993/06/12. This had CSRG copyrights and ids, and yaccpar was at 1.8 > 01/20/90. But this was upgraded to "the newest version on > vangogh.cs.berkeley.edu" 17 days later on 1993/06/29. This version > has no CSRG copyrights or ids, except for the above rotted one for > yaccpar (the 1.9 02/21/93 one). I think it was only missing CSRG > copyrights and ids because CSRG only added these to full releases. > This resulted in the version in FreeBSD-1 not having any copyright > notices inside most files, and none for the directory either. The > new byacc seems to be the same as the older yacc here too. >=20 > % + "#ifdef __unused", > % + "__unused", > % + "#endif", > % + "static char const ", > % + "yyrcsid[] =3D \"$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.37 2003= /02/12 18:03:55 davidc Exp $\";", > % "#endif", > % - "#include ", >=20 > See above. >=20 > % "#define YYBYACC 1", > % "#define YYMAJOR 1", > % "#define YYMINOR 9", > % - "#define yyclearin (yychar=3D(-1))", > % + "#define YYLEX yylex()", > % + "#define YYEMPTY -1", > % + "#define yyclearin (yychar=3D(YYEMPTY))", > % "#define yyerrok (yyerrflag=3D0)", > % - "#define YYRECOVERING (yyerrflag!=3D0)", > % + "#define YYRECOVERING() (yyerrflag!=3D0)", > % + "#if defined(__cplusplus) || __STDC__", > % + "static int yygrowstack(void);", > % + "#else", > % + "static int yygrowstack();", > % + "#endif", >=20 > % 0 > % }; >=20 > Hrmph. It was FreeBSD that added the STDC ifdefs, to avoid breaking > support for generating K&R code (older yacc generated fairly pure K&R > code without even "const"). For yygrowstack(), this was sloppy: > it only changed the declaration -- the function body still doesn't > say "void". >=20 > % @@ -151,13 +174,35 @@ > % "#define YYACCEPT goto yyaccept", > % "#define YYERROR goto yyerrlab", > % + "", > % + "#ifndef YYPARSE_PARAM", > % + "#if defined(__cplusplus) || __STDC__", > % + "#define YYPARSE_PARAM_ARG void", > % + "#define YYPARSE_PARAM_DECL", > % + "#else /* ! ANSI-C/C++ */", > % + "#define YYPARSE_PARAM_ARG", > % + "#define YYPARSE_PARAM_DECL", > % + "#endif /* ANSI-C/C++ */", > % + "#else /* YYPARSE_PARAM */", > % + "#ifndef YYPARSE_PARAM_TYPE", > % + "#define YYPARSE_PARAM_TYPE void *", > % + "#endif", > % + "#if defined(__cplusplus) || __STDC__", > % + "#define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM", > % + "#define YYPARSE_PARAM_DECL", > % + "#else /* ! ANSI-C/C++ */", > % + "#define YYPARSE_PARAM_ARG YYPARSE_PARAM", > % + "#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;", > % + "#endif /* ANSI-C/C++ */", > % + "#endif /* ! YYPARSE_PARAM */", > % + "", > % "int", > % - "yyparse()", > % + "yyparse (YYPARSE_PARAM_ARG)", > % + " YYPARSE_PARAM_DECL", > % "{", > % - " register int yym, yyn, yystate;", > % + " int yym, yyn, yystate;", > % "#if YYDEBUG", > % - " register char *yys;", > % - " extern char *getenv();", > % + " const char *yys;", > % "", > % - " if (yys =3D getenv(\"YYDEBUG\"))", > % + " if ((yys =3D getenv(\"YYDEBUG\")))", > % " {", > % " yyn =3D *yys;", >=20 > The STDC support was especially messy for yyparse(). >=20 > Bruce Thanks for all the remarks, I'll try to fix all issues you have spotted as = soon as possible. regards, Bapt --8GpibOaaTibBMecb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+9MB4ACgkQ8kTtMUmk6EyaMQCfeORSrtD3jcxwMhR2k1aJKqk0 8G8AniPcgzyUC3EuuVCNbqTY6glMNE1l =7Z87 -----END PGP SIGNATURE----- --8GpibOaaTibBMecb-- From owner-svn-src-head@FreeBSD.ORG Wed May 23 18:56:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2FFB9106566B; Wed, 23 May 2012 18:56:30 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0798FC12; Wed, 23 May 2012 18:56:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NIuTox089913; Wed, 23 May 2012 18:56:29 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NIuTBC089911; Wed, 23 May 2012 18:56:29 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201205231856.q4NIuTBC089911@svn.freebsd.org> From: Maksim Yevmenkin Date: Wed, 23 May 2012 18:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235854 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 18:56:30 -0000 Author: emax Date: Wed May 23 18:56:29 2012 New Revision: 235854 URL: http://svn.freebsd.org/changeset/base/235854 Log: Tweak condition for disabling allocation from per-CPU buckets in low memory situation. I've observed a situation where per-CPU allocations were disabled while there were enough free cached pages. Basically, cnt.v_free_count was sitting stable at a value lower than cnt.v_free_min and that caused massive performance drop. Reviewed by: alc MFC after: 1 week Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed May 23 18:41:45 2012 (r235853) +++ head/sys/vm/uma_core.c Wed May 23 18:56:29 2012 (r235854) @@ -272,10 +272,7 @@ SYSCTL_PROC(_vm, OID_AUTO, zone_stats, C static void bucket_enable(void) { - if (cnt.v_free_count < cnt.v_free_min) - bucketdisable = 1; - else - bucketdisable = 0; + bucketdisable = vm_page_count_min(); } /* From owner-svn-src-head@FreeBSD.ORG Wed May 23 19:24:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5333C1065673; Wed, 23 May 2012 19:24:25 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 015DC8FC12; Wed, 23 May 2012 19:24:25 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 62FEA32B; Wed, 23 May 2012 21:24:17 +0200 (CEST) Date: Wed, 23 May 2012 21:22:32 +0200 From: Pawel Jakub Dawidek To: Xin LI Message-ID: <20120523192232.GA1399@garage.freebsd.pl> References: <201205231817.q4NIH2t7088267@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline In-Reply-To: <201205231817.q4NIH2t7088267@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235852 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 19:24:25 -0000 --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 23, 2012 at 06:17:02PM +0000, Xin LI wrote: > Author: delphij > Date: Wed May 23 18:17:02 2012 > New Revision: 235852 > URL: http://svn.freebsd.org/changeset/base/235852 >=20 > Log: > Use %ju to match uintmax_t usage >=20 > Modified: > head/sys/geom/geom_flashmap.c >=20 > Modified: head/sys/geom/geom_flashmap.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/geom/geom_flashmap.c Wed May 23 18:11:36 2012 (r235851) > +++ head/sys/geom/geom_flashmap.c Wed May 23 18:17:02 2012 (r235852) > @@ -78,7 +78,7 @@ static void > g_flashmap_print(struct g_flashmap_slice *slice) > { > =20 > - printf("%08jx-%08jx: %s (%lluKB)\n", (intmax_t)slice->sl_start, (intmax= _t)slice->sl_end, > + printf("%08jx-%08jx: %s (%juKB)\n", (intmax_t)slice->sl_start, (intmax_= t)slice->sl_end, > slice->sl_name, (uintmax_t)(slice->sl_end - slice->sl_start) / 1024= ); BTW, %jx is also uintmax_t, not intmax_t, right? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --2oS5YaxWCcQjTEyO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+9OPgACgkQForvXbEpPzRtjwCgrJG3TjGRhilrq/jbnSJYgw1v zh0AoNBxqk2AisHWQxv1UpJzvSA4jJrw =RtsC -----END PGP SIGNATURE----- --2oS5YaxWCcQjTEyO-- From owner-svn-src-head@FreeBSD.ORG Wed May 23 19:25:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B32C106564A; Wed, 23 May 2012 19:25:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 665A98FC14; Wed, 23 May 2012 19:25:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NJPlkJ091180; Wed, 23 May 2012 19:25:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NJPlWX091178; Wed, 23 May 2012 19:25:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201205231925.q4NJPlWX091178@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 23 May 2012 19:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235855 - head/sbin/shutdown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 19:25:47 -0000 Author: jilles Date: Wed May 23 19:25:46 2012 New Revision: 235855 URL: http://svn.freebsd.org/changeset/base/235855 Log: shutdown: Remove unnecessary 2-second delay. Modified: head/sbin/shutdown/shutdown.c Modified: head/sbin/shutdown/shutdown.c ============================================================================== --- head/sbin/shutdown/shutdown.c Wed May 23 18:56:29 2012 (r235854) +++ head/sbin/shutdown/shutdown.c Wed May 23 19:25:46 2012 (r235855) @@ -356,7 +356,6 @@ perform_shutdown(void) syslog(LOG_NOTICE, "%s by %s: %s", doreboot ? "reboot" : dohalt ? "halt" : dopower ? "power-down" : "shutdown", whom, mbuf); - (void)sleep(2); (void)printf("\r\nSystem shutdown time has arrived\007\007\r\n"); if (killflg) { From owner-svn-src-head@FreeBSD.ORG Wed May 23 19:57:38 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7880B1065672; Wed, 23 May 2012 19:57:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 03C4D8FC16; Wed, 23 May 2012 19:57:36 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA26437; Wed, 23 May 2012 22:57:29 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1SXHgX-0002dC-4d; Wed, 23 May 2012 22:57:29 +0300 Message-ID: <4FBD4124.5030205@FreeBSD.org> Date: Wed, 23 May 2012 22:57:24 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120503 Thunderbird/12.0.1 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201205231817.q4NIH2t7088267@svn.freebsd.org> <20120523192232.GA1399@garage.freebsd.pl> In-Reply-To: <20120523192232.GA1399@garage.freebsd.pl> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Xin LI Subject: Re: svn commit: r235852 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 19:57:38 -0000 on 23/05/2012 22:22 Pawel Jakub Dawidek said the following: > On Wed, May 23, 2012 at 06:17:02PM +0000, Xin LI wrote: >> Author: delphij Date: Wed May 23 18:17:02 2012 New Revision: 235852 URL: >> http://svn.freebsd.org/changeset/base/235852 >> >> Log: Use %ju to match uintmax_t usage >> >> Modified: head/sys/geom/geom_flashmap.c >> >> Modified: head/sys/geom/geom_flashmap.c >> ============================================================================== >> >> --- head/sys/geom/geom_flashmap.c Wed May 23 18:11:36 2012 (r235851) >> +++ head/sys/geom/geom_flashmap.c Wed May 23 18:17:02 2012 (r235852) @@ >> -78,7 +78,7 @@ static void g_flashmap_print(struct g_flashmap_slice >> *slice) { >> >> - printf("%08jx-%08jx: %s (%lluKB)\n", (intmax_t)slice->sl_start, >> (intmax_t)slice->sl_end, + printf("%08jx-%08jx: %s (%juKB)\n", >> (intmax_t)slice->sl_start, (intmax_t)slice->sl_end, slice->sl_name, >> (uintmax_t)(slice->sl_end - slice->sl_start) / 1024); > > BTW, %jx is also uintmax_t, not intmax_t, right? > I think that non-decimal representation generally implies unsigned-ness. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed May 23 20:22:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41866106564A; Wed, 23 May 2012 20:22:10 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C7B18FC12; Wed, 23 May 2012 20:22:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NKMAtE093503; Wed, 23 May 2012 20:22:10 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NKM9mO093501; Wed, 23 May 2012 20:22:09 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205232022.q4NKM9mO093501@svn.freebsd.org> From: Joel Dahl Date: Wed, 23 May 2012 20:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235856 - head/libexec/rbootd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 20:22:10 -0000 Author: joel (doc committer) Date: Wed May 23 20:22:09 2012 New Revision: 235856 URL: http://svn.freebsd.org/changeset/base/235856 Log: mdoc: fix .Bl -offset. Modified: head/libexec/rbootd/rbootd.8 Modified: head/libexec/rbootd/rbootd.8 ============================================================================== --- head/libexec/rbootd/rbootd.8 Wed May 23 19:25:46 2012 (r235855) +++ head/libexec/rbootd/rbootd.8 Wed May 23 20:22:09 2012 (r235856) @@ -126,7 +126,7 @@ The following signals have the specified process using the .Xr kill 1 command: -.Bl -tag -width SIGUSR1 -offset -compact +.Bl -tag -width SIGUSR1 -offset xxxxxxxx .It SIGHUP Drop all active connections and reconfigure. .It SIGUSR1 From owner-svn-src-head@FreeBSD.ORG Wed May 23 20:29:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F6E8106564A; Wed, 23 May 2012 20:29:17 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AAE88FC15; Wed, 23 May 2012 20:29:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NKTHgi093826; Wed, 23 May 2012 20:29:17 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NKTHBL093824; Wed, 23 May 2012 20:29:17 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205232029.q4NKTHBL093824@svn.freebsd.org> From: Joel Dahl Date: Wed, 23 May 2012 20:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235857 - head/libexec/tftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 20:29:17 -0000 Author: joel (doc committer) Date: Wed May 23 20:29:16 2012 New Revision: 235857 URL: http://svn.freebsd.org/changeset/base/235857 Log: mdoc: Only use macros inside a reference block. Modified: head/libexec/tftpd/tftpd.8 Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Wed May 23 20:22:09 2012 (r235856) +++ head/libexec/tftpd/tftpd.8 Wed May 23 20:29:16 2012 (r235857) @@ -238,20 +238,16 @@ option. .Pp The following RFC's are supported: .Rs -RFC 1350 -.%T The TFTP Protocol (Revision 2) +.%T RFC 1350: The TFTP Protocol (Revision 2) .Re .Rs -RFC 2347 -.%T TFTP Option Extension +.%T RFC 2347: TFTP Option Extension .Re .Rs -RFC 2348 -.%T TFTP Blocksize Option +.%T RFC 2348: TFTP Blocksize Option .Re .Rs -RFC 2349 -.%T TFTP Timeout Interval and Transfer Size Options +.%T RFC 2349: TFTP Timeout Interval and Transfer Size Options .Re .Pp The non-standard From owner-svn-src-head@FreeBSD.ORG Wed May 23 20:51:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C01B0106564A; Wed, 23 May 2012 20:51:21 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB49D8FC08; Wed, 23 May 2012 20:51:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NKpLGe094789; Wed, 23 May 2012 20:51:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NKpL9i094787; Wed, 23 May 2012 20:51:21 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205232051.q4NKpL9i094787@svn.freebsd.org> From: Xin LI Date: Wed, 23 May 2012 20:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235858 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 20:51:21 -0000 Author: delphij Date: Wed May 23 20:51:21 2012 New Revision: 235858 URL: http://svn.freebsd.org/changeset/base/235858 Log: - Correct signedness for casts; - Wrap long line while I'm there. Noticed by: pjd, avg Modified: head/sys/geom/geom_flashmap.c Modified: head/sys/geom/geom_flashmap.c ============================================================================== --- head/sys/geom/geom_flashmap.c Wed May 23 20:29:16 2012 (r235857) +++ head/sys/geom/geom_flashmap.c Wed May 23 20:51:21 2012 (r235858) @@ -78,8 +78,9 @@ static void g_flashmap_print(struct g_flashmap_slice *slice) { - printf("%08jx-%08jx: %s (%juKB)\n", (intmax_t)slice->sl_start, (intmax_t)slice->sl_end, - slice->sl_name, (uintmax_t)(slice->sl_end - slice->sl_start) / 1024); + printf("%08jx-%08jx: %s (%juKB)\n", (uintmax_t)slice->sl_start, + (uintmax_t)slice->sl_end, slice->sl_name, + (uintmax_t)(slice->sl_end - slice->sl_start) / 1024); } static int From owner-svn-src-head@FreeBSD.ORG Wed May 23 21:07:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2262E106566C; Wed, 23 May 2012 21:07:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D8D28FC1B; Wed, 23 May 2012 21:07:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NL712H095463; Wed, 23 May 2012 21:07:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NL71dw095460; Wed, 23 May 2012 21:07:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205232107.q4NL71dw095460@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 May 2012 21:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235859 - in head/sys: i386/conf modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 21:07:02 -0000 Author: kib Date: Wed May 23 21:07:01 2012 New Revision: 235859 URL: http://svn.freebsd.org/changeset/base/235859 Log: Enable drm2 modules build. Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/sys/i386/conf/XEN head/sys/modules/Makefile Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Wed May 23 20:51:21 2012 (r235858) +++ head/sys/i386/conf/XEN Wed May 23 21:07:01 2012 (r235859) @@ -7,7 +7,7 @@ cpu I686_CPU ident XEN makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions WITHOUT_MODULES="aha ahb amd cxgb dpt drm hptmv ida malo mps mwl nve sound sym trm xfs" +makeoptions WITHOUT_MODULES="aha ahb amd cxgb dpt drm drm2 hptmv ida malo mps mwl nve sound sym trm xfs" options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed May 23 20:51:21 2012 (r235858) +++ head/sys/modules/Makefile Wed May 23 21:07:01 2012 (r235859) @@ -87,6 +87,7 @@ SUBDIR= ${_3dfx} \ ${_dpms} \ ${_dpt} \ ${_drm} \ + ${_drm2} \ ${_dtrace} \ dummynet \ ${_ed} \ @@ -461,6 +462,7 @@ _cyclic= cyclic .endif _dpms= dpms _drm= drm +_drm2= drm2 .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _dtrace= dtrace .endif @@ -630,6 +632,7 @@ _cyclic= cyclic .endif _dpms= dpms _drm= drm +_drm2= drm2 .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _dtrace= dtrace .endif From owner-svn-src-head@FreeBSD.ORG Wed May 23 21:37:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4D76106564A; Wed, 23 May 2012 21:37:34 +0000 (UTC) (envelope-from zeising@daemonic.se) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 35BEF8FC0A; Wed, 23 May 2012 21:37:34 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 6E56140009; Wed, 23 May 2012 23:37:33 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 63D1C40010; Wed, 23 May 2012 23:37:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (h-45-105.a163.priv.bahnhof.se [94.254.45.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 590E040009; Wed, 23 May 2012 23:37:32 +0200 (CEST) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3VyRs80YJMz8ggx; Wed, 23 May 2012 23:37:32 +0200 (CEST) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id sRMUR2cChm_O; Wed, 23 May 2012 23:37:29 +0200 (CEST) Received: from mail.daemonic.se (mail.daemonic.se [10.1.0.4]) by mx.daemonic.se (Postfix) with ESMTPS id 3VyRs554G0z8ggv; Wed, 23 May 2012 23:37:29 +0200 (CEST) Received: from tifa.daemonic.se (tifa.daemonic.se [IPv6:2001:470:dca9:1::6]) by mail.daemonic.se (Postfix) with ESMTPSA id 3VyRs54Tpjz9Ctq; Wed, 23 May 2012 23:37:29 +0200 (CEST) Received: from tifa.daemonic.se (localhost [IPv6:::1]) by tifa.daemonic.se (Postfix) with ESMTP id 713F922AC3; Wed, 23 May 2012 23:37:29 +0200 (CEST) Message-ID: <4FBD5899.9000808@daemonic.se> Date: Wed, 23 May 2012 23:37:29 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Konstantin Belousov References: <201205232107.q4NL71dw095460@svn.freebsd.org> In-Reply-To: <201205232107.q4NL71dw095460@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235859 - in head/sys: i386/conf modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 21:37:34 -0000 On 05/23/12 23:07, Konstantin Belousov wrote: > Author: kib > Date: Wed May 23 21:07:01 2012 > New Revision: 235859 > URL: http://svn.freebsd.org/changeset/base/235859 > > Log: > Enable drm2 modules build. > > Sponsored by: The FreeBSD Foundation > MFC after: 1 month > > Modified: > head/sys/i386/conf/XEN > head/sys/modules/Makefile > Hi! Thank you very much for all your work! With this commit, is there any need for any patches from you, or have they all been incorporated by now? Perhaps a note in UPDATING would be good, at least to make people more aware of the fact that GEM/KMS finally has come to FreeBSD as well. An update to the wiki might be good as well. I can help you with patches and updating the wiki, just let me know. Once again, a big thank you! Regards! -- Niclas Zeising From owner-svn-src-head@FreeBSD.ORG Wed May 23 21:48:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1C20106564A; Wed, 23 May 2012 21:48:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B79638FC08; Wed, 23 May 2012 21:48:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NLmoZe097403; Wed, 23 May 2012 21:48:50 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NLmoXp097382; Wed, 23 May 2012 21:48:50 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205232148.q4NLmoXp097382@svn.freebsd.org> From: Dimitry Andric Date: Wed, 23 May 2012 21:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235864 - in head: contrib/llvm/lib/CodeGen/SelectionDAG contrib/llvm/tools/clang/include/clang/AST contrib/llvm/tools/clang/include/clang/Basic contrib/llvm/tools/clang/include/clang/P... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 21:48:50 -0000 Author: dim Date: Wed May 23 21:48:49 2012 New Revision: 235864 URL: http://svn.freebsd.org/changeset/base/235864 Log: Upgrade our copy of llvm/clang to 3.1 release. Release notes can be found at: http://llvm.org/releases/3.1/docs/ReleaseNotes.html MFC after: 3 days Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp head/contrib/llvm/tools/clang/include/clang/AST/Decl.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/llvm/Config/config.h Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Wed May 23 21:48:49 2012 (r235864) @@ -131,30 +131,16 @@ static void CheckForPhysRegDependency(SD } } -static void AddGlue(SDNode *N, SDValue Glue, bool AddGlue, SelectionDAG *DAG) { - SmallVector VTs; - SDNode *GlueDestNode = Glue.getNode(); - - // Don't add glue from a node to itself. - if (GlueDestNode == N) return; - - // Don't add glue to something that already has it, either as a use or value. - if (N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Glue || - N->getValueType(N->getNumValues() - 1) == MVT::Glue) { - return; - } - for (unsigned I = 0, E = N->getNumValues(); I != E; ++I) - VTs.push_back(N->getValueType(I)); - - if (AddGlue) - VTs.push_back(MVT::Glue); - +// Helper for AddGlue to clone node operands. +static void CloneNodeWithValues(SDNode *N, SelectionDAG *DAG, + SmallVectorImpl &VTs, + SDValue ExtraOper = SDValue()) { SmallVector Ops; for (unsigned I = 0, E = N->getNumOperands(); I != E; ++I) Ops.push_back(N->getOperand(I)); - if (GlueDestNode) - Ops.push_back(Glue); + if (ExtraOper.getNode()) + Ops.push_back(ExtraOper); SDVTList VTList = DAG->getVTList(&VTs[0], VTs.size()); MachineSDNode::mmo_iterator Begin = 0, End = 0; @@ -173,6 +159,46 @@ static void AddGlue(SDNode *N, SDValue G MN->setMemRefs(Begin, End); } +static bool AddGlue(SDNode *N, SDValue Glue, bool AddGlue, SelectionDAG *DAG) { + SmallVector VTs; + SDNode *GlueDestNode = Glue.getNode(); + + // Don't add glue from a node to itself. + if (GlueDestNode == N) return false; + + // Don't add a glue operand to something that already uses glue. + if (GlueDestNode && + N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Glue) { + return false; + } + // Don't add glue to something that already has a glue value. + if (N->getValueType(N->getNumValues() - 1) == MVT::Glue) return false; + + for (unsigned I = 0, E = N->getNumValues(); I != E; ++I) + VTs.push_back(N->getValueType(I)); + + if (AddGlue) + VTs.push_back(MVT::Glue); + + CloneNodeWithValues(N, DAG, VTs, Glue); + + return true; +} + +// Cleanup after unsuccessful AddGlue. Use the standard method of morphing the +// node even though simply shrinking the value list is sufficient. +static void RemoveUnusedGlue(SDNode *N, SelectionDAG *DAG) { + assert((N->getValueType(N->getNumValues() - 1) == MVT::Glue && + !N->hasAnyUseOfValue(N->getNumValues() - 1)) && + "expected an unused glue value"); + + SmallVector VTs; + for (unsigned I = 0, E = N->getNumValues()-1; I != E; ++I) + VTs.push_back(N->getValueType(I)); + + CloneNodeWithValues(N, DAG, VTs); +} + /// ClusterNeighboringLoads - Force nearby loads together by "gluing" them. /// This function finds loads of the same base and different offsets. If the /// offsets are not far apart (target specific), it add MVT::Glue inputs and @@ -240,19 +266,23 @@ void ScheduleDAGSDNodes::ClusterNeighbor // Cluster loads by adding MVT::Glue outputs and inputs. This also // ensure they are scheduled in order of increasing addresses. SDNode *Lead = Loads[0]; - AddGlue(Lead, SDValue(0, 0), true, DAG); - - SDValue InGlue = SDValue(Lead, Lead->getNumValues() - 1); + SDValue InGlue = SDValue(0, 0); + if (AddGlue(Lead, InGlue, true, DAG)) + InGlue = SDValue(Lead, Lead->getNumValues() - 1); for (unsigned I = 1, E = Loads.size(); I != E; ++I) { bool OutGlue = I < E - 1; SDNode *Load = Loads[I]; - AddGlue(Load, InGlue, OutGlue, DAG); + // If AddGlue fails, we could leave an unsused glue value. This should not + // cause any + if (AddGlue(Load, InGlue, OutGlue, DAG)) { + if (OutGlue) + InGlue = SDValue(Load, Load->getNumValues() - 1); - if (OutGlue) - InGlue = SDValue(Load, Load->getNumValues() - 1); - - ++LoadsClustered; + ++LoadsClustered; + } + else if (!OutGlue && InGlue.getNode()) + RemoveUnusedGlue(InGlue.getNode(), DAG); } } Modified: head/contrib/llvm/tools/clang/include/clang/AST/Decl.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/AST/Decl.h Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/AST/Decl.h Wed May 23 21:48:49 2012 (r235864) @@ -64,9 +64,6 @@ public: /// \brief Return the TypeLoc wrapper for the type source info. TypeLoc getTypeLoc() const; // implemented in TypeLoc.h - - /// \brief Override the type stored in this TypeSourceInfo. Use with caution! - void overrideType(QualType T) { Ty = T; } }; /// TranslationUnitDecl - The top declaration context. Modified: head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td Wed May 23 21:48:49 2012 (r235864) @@ -410,8 +410,6 @@ def ext_ellipsis_exception_spec : Extens "exception specification of '...' is a Microsoft extension">; def err_dynamic_and_noexcept_specification : Error< "cannot have both throw() and noexcept() clause on the same function">; -def err_except_spec_unparsed : Error< - "unexpected end of exception specification">; def warn_cxx98_compat_noexcept_decl : Warning< "noexcept specifications are incompatible with C++98">, InGroup, DefaultIgnore; Modified: head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def Wed May 23 21:48:49 2012 (r235864) @@ -105,7 +105,6 @@ TOK(eod) // End of prepr // directive). TOK(code_completion) // Code completion marker TOK(cxx_defaultarg_end) // C++ default argument end marker -TOK(cxx_exceptspec_end) // C++ exception-specification end marker // C99 6.4.9: Comments. TOK(comment) // Comment (only in -E -C[C] mode) Modified: head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h Wed May 23 21:48:49 2012 (r235864) @@ -584,11 +584,15 @@ private: class TentativeParsingAction { Parser &P; Token PrevTok; + unsigned short PrevParenCount, PrevBracketCount, PrevBraceCount; bool isActive; public: explicit TentativeParsingAction(Parser& p) : P(p) { PrevTok = P.Tok; + PrevParenCount = P.ParenCount; + PrevBracketCount = P.BracketCount; + PrevBraceCount = P.BraceCount; P.PP.EnableBacktrackAtThisPos(); isActive = true; } @@ -601,6 +605,9 @@ private: assert(isActive && "Parsing action was finished!"); P.PP.Backtrack(); P.Tok = PrevTok; + P.ParenCount = PrevParenCount; + P.BracketCount = PrevBracketCount; + P.BraceCount = PrevBraceCount; isActive = false; } ~TentativeParsingAction() { @@ -1422,12 +1429,10 @@ private: ExprResult ParseThrowExpression(); ExceptionSpecificationType tryParseExceptionSpecification( - bool Delayed, SourceRange &SpecificationRange, SmallVectorImpl &DynamicExceptions, SmallVectorImpl &DynamicExceptionRanges, - ExprResult &NoexceptExpr, - CachedTokens *&ExceptionSpecTokens); + ExprResult &NoexceptExpr); // EndLoc is filled with the location of the last token of the specification. ExceptionSpecificationType ParseDynamicExceptionSpecification( Modified: head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h Wed May 23 21:48:49 2012 (r235864) @@ -1150,10 +1150,6 @@ struct DeclaratorChunk { /// \brief Pointer to the expression in the noexcept-specifier of this /// function, if it has one. Expr *NoexceptExpr; - - /// \brief Pointer to the cached tokens for an exception-specification - /// that has not yet been parsed. - CachedTokens *ExceptionSpecTokens; }; /// TrailingReturnType - If this isn't null, it's the trailing return type @@ -1176,8 +1172,6 @@ struct DeclaratorChunk { delete[] ArgInfo; if (getExceptionSpecType() == EST_Dynamic) delete[] Exceptions; - else if (getExceptionSpecType() == EST_Delayed) - delete ExceptionSpecTokens; } /// isKNRPrototype - Return true if this is a K&R style identifier list, @@ -1353,7 +1347,6 @@ struct DeclaratorChunk { SourceRange *ExceptionRanges, unsigned NumExceptions, Expr *NoexceptExpr, - CachedTokens *ExceptionSpecTokens, SourceLocation LocalRangeBegin, SourceLocation LocalRangeEnd, Declarator &TheDeclarator, Modified: head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h Wed May 23 21:48:49 2012 (r235864) @@ -225,7 +225,9 @@ public: /// \brief Create the initialization entity for a temporary. static InitializedEntity InitializeTemporary(QualType Type) { - return InitializedEntity(EK_Temporary, SourceLocation(), Type); + InitializedEntity Result(EK_Temporary, SourceLocation(), Type); + Result.TypeInfo = 0; + return Result; } /// \brief Create the initialization entity for a temporary. Modified: head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h Wed May 23 21:48:49 2012 (r235864) @@ -331,6 +331,11 @@ public: /// cycle detection at the end of the TU. DelegatingCtorDeclsType DelegatingCtorDecls; + /// \brief All the destructors seen during a class definition that had their + /// exception spec computation delayed because it depended on an unparsed + /// exception spec. + SmallVector DelayedDestructorExceptionSpecs; + /// \brief All the overriding destructors seen during a class definition /// (there could be multiple due to nested classes) that had their exception /// spec checks delayed, plus the overridden destructor. @@ -653,23 +658,19 @@ public: /// SpecialMemberOverloadResult - The overloading result for a special member /// function. /// - /// This is basically a wrapper around PointerIntPair. The lowest bit of the - /// integer is used to determine whether we have a parameter qualification - /// match, the second-lowest is whether we had success in resolving the - /// overload to a unique non-deleted function. - /// - /// The ConstParamMatch bit represents whether, when looking up a copy - /// constructor or assignment operator, we found a potential copy - /// constructor/assignment operator whose first parameter is const-qualified. - /// This is used for determining parameter types of other objects and is - /// utterly meaningless on other types of special members. + /// This is basically a wrapper around PointerIntPair. The lowest bits of the + /// integer are used to determine whether overload resolution succeeded, and + /// whether, when looking up a copy constructor or assignment operator, we + /// found a potential copy constructor/assignment operator whose first + /// parameter is const-qualified. This is used for determining parameter types + /// of other objects and is utterly meaningless on other types of special + /// members. class SpecialMemberOverloadResult : public llvm::FastFoldingSetNode { public: enum Kind { NoMemberOrDeleted, Ambiguous, - SuccessNonConst, - SuccessConst + Success }; private: @@ -685,9 +686,6 @@ public: Kind getKind() const { return static_cast(Pair.getInt()); } void setKind(Kind K) { Pair.setInt(K); } - - bool hasSuccess() const { return getKind() >= SuccessNonConst; } - bool hasConstParamMatch() const { return getKind() == SuccessConst; } }; /// \brief A cache of special member function overload resolution results @@ -1909,11 +1907,9 @@ public: DeclContextLookupResult LookupConstructors(CXXRecordDecl *Class); CXXConstructorDecl *LookupDefaultConstructor(CXXRecordDecl *Class); CXXConstructorDecl *LookupCopyingConstructor(CXXRecordDecl *Class, - unsigned Quals, - bool *ConstParam = 0); + unsigned Quals); CXXMethodDecl *LookupCopyingAssignment(CXXRecordDecl *Class, unsigned Quals, - bool RValueThis, unsigned ThisQuals, - bool *ConstParam = 0); + bool RValueThis, unsigned ThisQuals); CXXConstructorDecl *LookupMovingConstructor(CXXRecordDecl *Class); CXXMethodDecl *LookupMovingAssignment(CXXRecordDecl *Class, bool RValueThis, unsigned ThisQuals); @@ -3158,16 +3154,6 @@ public: llvm::SmallVectorImpl &Exceptions, FunctionProtoType::ExtProtoInfo &EPI); - /// \brief Add an exception-specification to the given member function - /// (or member function template). The exception-specification was parsed - /// after the method itself was declared. - void actOnDelayedExceptionSpecification(Decl *Method, - ExceptionSpecificationType EST, - SourceRange SpecificationRange, - ArrayRef DynamicExceptions, - ArrayRef DynamicExceptionRanges, - Expr *NoexceptExpr); - /// \brief Determine if a special member function should have a deleted /// definition when it is defaulted. bool ShouldDeleteSpecialMember(CXXMethodDecl *MD, CXXSpecialMember CSM, @@ -3205,7 +3191,8 @@ public: /// C++11 says that user-defined destructors with no exception spec get one /// that looks as if the destructor was implicitly declared. void AdjustDestructorExceptionSpec(CXXRecordDecl *ClassDecl, - CXXDestructorDecl *Destructor); + CXXDestructorDecl *Destructor, + bool WasDelayed = false); /// \brief Declare all inherited constructors for the given class. /// @@ -4043,6 +4030,7 @@ public: SourceLocation LBrac, SourceLocation RBrac, AttributeList *AttrList); + void ActOnFinishCXXMemberDecls(); void ActOnReenterTemplateScope(Scope *S, Decl *Template); void ActOnReenterDeclaratorTemplateScope(Scope *S, DeclaratorDecl *D); Modified: head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp Wed May 23 21:48:49 2012 (r235864) @@ -168,7 +168,8 @@ static const BinaryOperator *getLogicalO if (block->empty()) return 0; - const CFGStmt *cstmt = block->front().getAs(); + CFGElement front = block->front(); + const CFGStmt *cstmt = front.getAs(); if (!cstmt) return 0; Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Wed May 23 21:48:49 2012 (r235864) @@ -1830,6 +1830,7 @@ enum LinuxDistro { OpenSuse11_3, OpenSuse11_4, OpenSuse12_1, + OpenSuse12_2, UbuntuHardy, UbuntuIntrepid, UbuntuJaunty, @@ -1848,7 +1849,7 @@ static bool IsRedhat(enum LinuxDistro Di } static bool IsOpenSuse(enum LinuxDistro Distro) { - return Distro >= OpenSuse11_3 && Distro <= OpenSuse12_1; + return Distro >= OpenSuse11_3 && Distro <= OpenSuse12_2; } static bool IsDebian(enum LinuxDistro Distro) { @@ -1925,6 +1926,7 @@ static LinuxDistro DetectLinuxDistro(llv .StartsWith("openSUSE 11.3", OpenSuse11_3) .StartsWith("openSUSE 11.4", OpenSuse11_4) .StartsWith("openSUSE 12.1", OpenSuse12_1) + .StartsWith("openSUSE 12.2", OpenSuse12_2) .Default(UnknownDistro); bool Exists; Modified: head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp Wed May 23 21:48:49 2012 (r235864) @@ -348,77 +348,7 @@ void Parser::ParseLexedMethodDeclaration LM.DefaultArgs[I].Toks = 0; } } - - // Parse a delayed exception-specification, if there is one. - if (CachedTokens *Toks = LM.ExceptionSpecTokens) { - // Save the current token position. - SourceLocation origLoc = Tok.getLocation(); - - // Parse the default argument from its saved token stream. - Toks->push_back(Tok); // So that the current token doesn't get lost - PP.EnterTokenStream(&Toks->front(), Toks->size(), true, false); - - // Consume the previously-pushed token. - ConsumeAnyToken(); - - // C++11 [expr.prim.general]p3: - // If a declaration declares a member function or member function - // template of a class X, the expression this is a prvalue of type - // "pointer to cv-qualifier-seq X" between the optional cv-qualifer-seq - // and the end of the function-definition, member-declarator, or - // declarator. - CXXMethodDecl *Method; - if (FunctionTemplateDecl *FunTmpl - = dyn_cast(LM.Method)) - Method = cast(FunTmpl->getTemplatedDecl()); - else - Method = cast(LM.Method); - - Sema::CXXThisScopeRAII ThisScope(Actions, Method->getParent(), - Method->getTypeQualifiers(), - getLangOpts().CPlusPlus0x); - - // Parse the exception-specification. - SourceRange SpecificationRange; - SmallVector DynamicExceptions; - SmallVector DynamicExceptionRanges; - ExprResult NoexceptExpr; - CachedTokens *ExceptionSpecTokens; - - ExceptionSpecificationType EST - = tryParseExceptionSpecification(/*Delayed=*/false, SpecificationRange, - DynamicExceptions, - DynamicExceptionRanges, NoexceptExpr, - ExceptionSpecTokens); - - // Clean up the remaining tokens. - if (Tok.is(tok::cxx_exceptspec_end)) - ConsumeToken(); - else if (EST != EST_None) - Diag(Tok.getLocation(), diag::err_except_spec_unparsed); - // Attach the exception-specification to the method. - if (EST != EST_None) - Actions.actOnDelayedExceptionSpecification(LM.Method, EST, - SpecificationRange, - DynamicExceptions, - DynamicExceptionRanges, - NoexceptExpr.isUsable()? - NoexceptExpr.get() : 0); - - assert(!PP.getSourceManager().isBeforeInTranslationUnit(origLoc, - Tok.getLocation()) && - "tryParseExceptionSpecification went over the exception tokens!"); - - // There could be leftover tokens (e.g. because of an error). - // Skip through until we reach the original token position. - while (Tok.getLocation() != origLoc && Tok.isNot(tok::eof)) - ConsumeAnyToken(); - - delete LM.ExceptionSpecTokens; - LM.ExceptionSpecTokens = 0; - } - PrototypeScope.Exit(); // Finish the delayed C++ method declaration. Modified: head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp Wed May 23 21:48:49 2012 (r235864) @@ -4197,7 +4197,6 @@ void Parser::ParseFunctionDeclarator(Dec SmallVector DynamicExceptions; SmallVector DynamicExceptionRanges; ExprResult NoexceptExpr; - CachedTokens *ExceptionSpecTokens = 0; ParsedAttributes FnAttrs(AttrFactory); ParsedType TrailingReturnType; @@ -4264,18 +4263,12 @@ void Parser::ParseFunctionDeclarator(Dec dyn_cast(Actions.CurContext), DS.getTypeQualifiers(), IsCXX11MemberFunction); - + // Parse exception-specification[opt]. - bool Delayed = (D.getContext() == Declarator::MemberContext && - D.getDeclSpec().getStorageClassSpec() - != DeclSpec::SCS_typedef && - !D.getDeclSpec().isFriendSpecified()); - ESpecType = tryParseExceptionSpecification(Delayed, - ESpecRange, + ESpecType = tryParseExceptionSpecification(ESpecRange, DynamicExceptions, DynamicExceptionRanges, - NoexceptExpr, - ExceptionSpecTokens); + NoexceptExpr); if (ESpecType != EST_None) EndLoc = ESpecRange.getEnd(); @@ -4310,7 +4303,6 @@ void Parser::ParseFunctionDeclarator(Dec DynamicExceptions.size(), NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, - ExceptionSpecTokens, Tracker.getOpenLocation(), EndLoc, D, TrailingReturnType), Modified: head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp Wed May 23 21:48:49 2012 (r235864) @@ -1535,34 +1535,16 @@ AccessSpecifier Parser::getAccessSpecifi } /// \brief If the given declarator has any parts for which parsing has to be -/// delayed, e.g., default arguments or an exception-specification, create a -/// late-parsed method declaration record to handle the parsing at the end of -/// the class definition. +/// delayed, e.g., default arguments, create a late-parsed method declaration +/// record to handle the parsing at the end of the class definition. void Parser::HandleMemberFunctionDeclDelays(Declarator& DeclaratorInfo, Decl *ThisDecl) { // We just declared a member function. If this member function - // has any default arguments or an exception-specification, we'll need to - // parse them later. + // has any default arguments, we'll need to parse them later. LateParsedMethodDeclaration *LateMethod = 0; DeclaratorChunk::FunctionTypeInfo &FTI = DeclaratorInfo.getFunctionTypeInfo(); - - // If there was a delayed exception-specification, hold onto its tokens. - if (FTI.getExceptionSpecType() == EST_Delayed) { - // Push this method onto the stack of late-parsed method - // declarations. - LateMethod = new LateParsedMethodDeclaration(this, ThisDecl); - getCurrentClass().LateParsedDeclarations.push_back(LateMethod); - LateMethod->TemplateScope = getCurScope()->isTemplateParamScope(); - - // Stash the exception-specification tokens in the late-pased mthod. - LateMethod->ExceptionSpecTokens = FTI.ExceptionSpecTokens; - FTI.ExceptionSpecTokens = 0; - // Reserve space for the parameters. - LateMethod->DefaultArgs.reserve(FTI.NumArgs); - } - for (unsigned ParamIdx = 0; ParamIdx < FTI.NumArgs; ++ParamIdx) { if (LateMethod || FTI.ArgInfo[ParamIdx].DefaultArgTokens) { if (!LateMethod) { @@ -1846,7 +1828,7 @@ void Parser::ParseCXXClassMemberDeclarat // Parse the first declarator. ParseDeclarator(DeclaratorInfo); - // Error parsin g the declarator? + // Error parsing the declarator? if (!DeclaratorInfo.hasName()) { // If so, skip until the semi-colon or a }. SkipUntil(tok::r_brace, true, true); @@ -2065,7 +2047,7 @@ void Parser::ParseCXXClassMemberDeclarat DeclsInGroup.push_back(ThisDecl); } - if (DeclaratorInfo.isFunctionDeclarator() && + if (ThisDecl && DeclaratorInfo.isFunctionDeclarator() && DeclaratorInfo.getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_typedef) { HandleMemberFunctionDeclDelays(DeclaratorInfo, ThisDecl); @@ -2358,7 +2340,7 @@ void Parser::ParseCXXMemberSpecification // C++11 [class.mem]p2: // Within the class member-specification, the class is regarded as complete - // within function bodies, default arguments, exception-specifications, and + // within function bodies, default arguments, and // brace-or-equal-initializers for non-static data members (including such // things in nested classes). if (TagDecl && NonNestedClass) { @@ -2369,6 +2351,10 @@ void Parser::ParseCXXMemberSpecification SourceLocation SavedPrevTokLocation = PrevTokLocation; ParseLexedAttributes(getCurrentClass()); ParseLexedMethodDeclarations(getCurrentClass()); + + // We've finished with all pending member declarations. + Actions.ActOnFinishCXXMemberDecls(); + ParseLexedMemberInitializers(getCurrentClass()); ParseLexedMethodDefs(getCurrentClass()); PrevTokLocation = SavedPrevTokLocation; @@ -2555,63 +2541,13 @@ Parser::MemInitResult Parser::ParseMemIn /// 'noexcept' /// 'noexcept' '(' constant-expression ')' ExceptionSpecificationType -Parser::tryParseExceptionSpecification(bool Delayed, +Parser::tryParseExceptionSpecification( SourceRange &SpecificationRange, SmallVectorImpl &DynamicExceptions, SmallVectorImpl &DynamicExceptionRanges, - ExprResult &NoexceptExpr, - CachedTokens *&ExceptionSpecTokens) { + ExprResult &NoexceptExpr) { ExceptionSpecificationType Result = EST_None; - ExceptionSpecTokens = 0; - - // Handle delayed parsing of exception-specifications. - if (Delayed) { - if (Tok.isNot(tok::kw_throw) && Tok.isNot(tok::kw_noexcept)) - return EST_None; - - // Consume and cache the starting token. - bool IsNoexcept = Tok.is(tok::kw_noexcept); - Token StartTok = Tok; - SpecificationRange = SourceRange(ConsumeToken()); - - // Check for a '('. - if (!Tok.is(tok::l_paren)) { - // If this is a bare 'noexcept', we're done. - if (IsNoexcept) { - Diag(Tok, diag::warn_cxx98_compat_noexcept_decl); - NoexceptExpr = 0; - return EST_BasicNoexcept; - } - - Diag(Tok, diag::err_expected_lparen_after) << "throw"; - return EST_DynamicNone; - } - - // Cache the tokens for the exception-specification. - ExceptionSpecTokens = new CachedTokens; - ExceptionSpecTokens->push_back(StartTok); // 'throw' or 'noexcept' - ExceptionSpecTokens->push_back(Tok); // '(' - SpecificationRange.setEnd(ConsumeParen()); // '(' - - if (!ConsumeAndStoreUntil(tok::r_paren, *ExceptionSpecTokens, - /*StopAtSemi=*/true, - /*ConsumeFinalToken=*/true)) { - NoexceptExpr = 0; - delete ExceptionSpecTokens; - ExceptionSpecTokens = 0; - return IsNoexcept? EST_BasicNoexcept : EST_DynamicNone; - } - SpecificationRange.setEnd(Tok.getLocation()); - - // Add the 'stop' token. - Token End; - End.startToken(); - End.setKind(tok::cxx_exceptspec_end); - End.setLocation(Tok.getLocation()); - ExceptionSpecTokens->push_back(End); - return EST_Delayed; - } - + // See if there's a dynamic specification. if (Tok.is(tok::kw_throw)) { Result = ParseDynamicExceptionSpecification(SpecificationRange, Modified: head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp Wed May 23 21:48:49 2012 (r235864) @@ -2392,7 +2392,7 @@ ExprResult Parser::ParseBlockLiteralExpr SourceLocation(), EST_None, SourceLocation(), - 0, 0, 0, 0, 0, + 0, 0, 0, 0, CaretLoc, CaretLoc, ParamInfo), attrs, CaretLoc); Modified: head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp Wed May 23 21:48:49 2012 (r235864) @@ -780,13 +780,10 @@ ExprResult Parser::ParseLambdaExpression llvm::SmallVector DynamicExceptions; llvm::SmallVector DynamicExceptionRanges; ExprResult NoexceptExpr; - CachedTokens *ExceptionSpecTokens; - ESpecType = tryParseExceptionSpecification(/*Delayed=*/false, - ESpecRange, + ESpecType = tryParseExceptionSpecification(ESpecRange, DynamicExceptions, DynamicExceptionRanges, - NoexceptExpr, - ExceptionSpecTokens); + NoexceptExpr); if (ESpecType != EST_None) DeclEndLoc = ESpecRange.getEnd(); @@ -821,7 +818,6 @@ ExprResult Parser::ParseLambdaExpression DynamicExceptions.size(), NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, - 0, DeclLoc, DeclEndLoc, D, TrailingReturnType), Attr, DeclEndLoc); @@ -867,7 +863,6 @@ ExprResult Parser::ParseLambdaExpression /*ExceptionRanges=*/0, /*NumExceptions=*/0, /*NoexceptExpr=*/0, - /*ExceptionSpecTokens=*/0, DeclLoc, DeclEndLoc, D, TrailingReturnType), Attr, DeclEndLoc); Modified: head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp Wed May 23 21:48:49 2012 (r235864) @@ -162,7 +162,6 @@ DeclaratorChunk DeclaratorChunk::getFunc SourceRange *ExceptionRanges, unsigned NumExceptions, Expr *NoexceptExpr, - CachedTokens *ExceptionSpecTokens, SourceLocation LocalRangeBegin, SourceLocation LocalRangeEnd, Declarator &TheDeclarator, @@ -227,10 +226,6 @@ DeclaratorChunk DeclaratorChunk::getFunc case EST_ComputedNoexcept: I.Fun.NoexceptExpr = NoexceptExpr; break; - - case EST_Delayed: - I.Fun.ExceptionSpecTokens = ExceptionSpecTokens; - break; } return I; } Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Wed May 23 21:48:49 2012 (r235864) @@ -7635,7 +7635,7 @@ NamedDecl *Sema::ImplicitlyDefineFunctio SourceLocation(), SourceLocation(), SourceLocation(), EST_None, SourceLocation(), - 0, 0, 0, 0, 0, Loc, Loc, D), + 0, 0, 0, 0, Loc, Loc, D), DS.getAttributes(), SourceLocation()); D.SetIdentifier(&II, Loc); @@ -9784,21 +9784,6 @@ void Sema::ActOnFields(Scope* S, if (!Completed) Record->completeDefinition(); - // Now that the record is complete, do any delayed exception spec checks - // we were missing. - while (!DelayedDestructorExceptionSpecChecks.empty()) { - const CXXDestructorDecl *Dtor = - DelayedDestructorExceptionSpecChecks.back().first; - if (Dtor->getParent() != Record) - break; - - assert(!Dtor->getParent()->isDependentType() && - "Should not ever add destructors of templates into the list."); - CheckOverridingFunctionExceptionSpec(Dtor, - DelayedDestructorExceptionSpecChecks.back().second); - DelayedDestructorExceptionSpecChecks.pop_back(); - } - } else { ObjCIvarDecl **ClsFields = reinterpret_cast(RecFields.data()); Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp Wed May 23 21:48:49 2012 (r235864) @@ -7319,15 +7319,42 @@ void Sema::DefineImplicitDestructor(Sour } } +/// \brief Perform any semantic analysis which needs to be delayed until all +/// pending class member declarations have been parsed. +void Sema::ActOnFinishCXXMemberDecls() { + // Now we have parsed all exception specifications, determine the implicit + // exception specifications for destructors. + for (unsigned i = 0, e = DelayedDestructorExceptionSpecs.size(); + i != e; ++i) { + CXXDestructorDecl *Dtor = DelayedDestructorExceptionSpecs[i]; + AdjustDestructorExceptionSpec(Dtor->getParent(), Dtor, true); + } + DelayedDestructorExceptionSpecs.clear(); + + // Perform any deferred checking of exception specifications for virtual + // destructors. + for (unsigned i = 0, e = DelayedDestructorExceptionSpecChecks.size(); + i != e; ++i) { + const CXXDestructorDecl *Dtor = + DelayedDestructorExceptionSpecChecks[i].first; + assert(!Dtor->getParent()->isDependentType() && + "Should not ever add destructors of templates into the list."); + CheckOverridingFunctionExceptionSpec(Dtor, + DelayedDestructorExceptionSpecChecks[i].second); + } + DelayedDestructorExceptionSpecChecks.clear(); +} + void Sema::AdjustDestructorExceptionSpec(CXXRecordDecl *classDecl, - CXXDestructorDecl *destructor) { + CXXDestructorDecl *destructor, + bool WasDelayed) { // C++11 [class.dtor]p3: // A declaration of a destructor that does not have an exception- // specification is implicitly considered to have the same exception- // specification as an implicit declaration. const FunctionProtoType *dtorType = destructor->getType()-> getAs(); - if (dtorType->hasExceptionSpec()) + if (!WasDelayed && dtorType->hasExceptionSpec()) return; ImplicitExceptionSpecification exceptSpec = @@ -7344,6 +7371,14 @@ void Sema::AdjustDestructorExceptionSpec destructor->setType(ty); + // If we can't compute the exception specification for this destructor yet + // (because it depends on an exception specification which we have not parsed + // yet), make a note that we need to try again when the class is complete. + if (epi.ExceptionSpecType == EST_Delayed) { + assert(!WasDelayed && "couldn't compute destructor exception spec"); + DelayedDestructorExceptionSpecs.push_back(destructor); + } + // FIXME: If the destructor has a body that could throw, and the newly created // spec doesn't allow exceptions, we should emit a warning, because this // change in behavior can break conforming C++03 programs at runtime. @@ -7579,8 +7614,9 @@ Sema::ComputeDefaultedCopyAssignmentExce assert(!Base->getType()->isDependentType() && "Cannot generate implicit members for class with dependent bases."); CXXRecordDecl *BaseClassDecl = Base->getType()->getAsCXXRecordDecl(); - LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, false, 0, - &HasConstCopyAssignment); + HasConstCopyAssignment &= + (bool)LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, + false, 0); } // In C++11, the above citation has "or virtual" added @@ -7591,8 +7627,9 @@ Sema::ComputeDefaultedCopyAssignmentExce assert(!Base->getType()->isDependentType() && "Cannot generate implicit members for class with dependent bases."); CXXRecordDecl *BaseClassDecl = Base->getType()->getAsCXXRecordDecl(); - LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, false, 0, - &HasConstCopyAssignment); + HasConstCopyAssignment &= + (bool)LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, + false, 0); } } @@ -7606,8 +7643,9 @@ Sema::ComputeDefaultedCopyAssignmentExce ++Field) { QualType FieldType = Context.getBaseElementType((*Field)->getType()); if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) { - LookupCopyingAssignment(FieldClassDecl, Qualifiers::Const, false, 0, - &HasConstCopyAssignment); + HasConstCopyAssignment &= + (bool)LookupCopyingAssignment(FieldClassDecl, Qualifiers::Const, + false, 0); } } @@ -8610,8 +8648,8 @@ Sema::ComputeDefaultedCopyCtorExceptionS CXXRecordDecl *BaseClassDecl = cast(Base->getType()->getAs()->getDecl()); - LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const, - &HasConstCopyConstructor); + HasConstCopyConstructor &= + (bool)LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const); } for (CXXRecordDecl::base_class_iterator Base = ClassDecl->vbases_begin(), @@ -8620,8 +8658,8 @@ Sema::ComputeDefaultedCopyCtorExceptionS ++Base) { CXXRecordDecl *BaseClassDecl = cast(Base->getType()->getAs()->getDecl()); - LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const, - &HasConstCopyConstructor); + HasConstCopyConstructor &= + (bool)LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const); } // -- for all the nonstatic data members of X that are of a @@ -8634,8 +8672,8 @@ Sema::ComputeDefaultedCopyCtorExceptionS ++Field) { QualType FieldType = Context.getBaseElementType((*Field)->getType()); if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) { - LookupCopyingConstructor(FieldClassDecl, Qualifiers::Const, - &HasConstCopyConstructor); + HasConstCopyConstructor &= + (bool)LookupCopyingConstructor(FieldClassDecl, Qualifiers::Const); } } // Otherwise, the implicitly declared copy constructor will have @@ -11260,66 +11298,6 @@ Sema::checkExceptionSpecification(Except } } -void Sema::actOnDelayedExceptionSpecification(Decl *MethodD, - ExceptionSpecificationType EST, - SourceRange SpecificationRange, - ArrayRef DynamicExceptions, - ArrayRef DynamicExceptionRanges, - Expr *NoexceptExpr) { - if (!MethodD) - return; - - // Dig out the method we're referring to. - CXXMethodDecl *Method = 0; - if (FunctionTemplateDecl *FunTmpl = dyn_cast(MethodD)) - Method = dyn_cast(FunTmpl->getTemplatedDecl()); - else - Method = dyn_cast(MethodD); - - if (!Method) - return; - - // Dig out the prototype. This should never fail. - const FunctionProtoType *Proto - = dyn_cast(Method->getType()); - if (!Proto) - return; - - // Check the exception specification. - llvm::SmallVector Exceptions; - FunctionProtoType::ExtProtoInfo EPI = Proto->getExtProtoInfo(); - checkExceptionSpecification(EST, DynamicExceptions, DynamicExceptionRanges, - NoexceptExpr, Exceptions, EPI); - - // Rebuild the function type. - QualType T = Context.getFunctionType(Proto->getResultType(), - Proto->arg_type_begin(), - Proto->getNumArgs(), - EPI); - if (TypeSourceInfo *TSInfo = Method->getTypeSourceInfo()) { - // FIXME: When we get proper type location information for exceptions, - // we'll also have to rebuild the TypeSourceInfo. For now, we just patch - // up the TypeSourceInfo; - assert(TypeLoc::getFullDataSizeForType(T) - == TypeLoc::getFullDataSizeForType(Method->getType()) && - "TypeLoc size mismatch with delayed exception specification"); - TSInfo->overrideType(T); - } - - Method->setType(T); - - if (Method->isStatic()) - checkThisInStaticMemberFunctionExceptionSpec(Method); - - if (Method->isVirtual()) { - // Check overrides, which we previously had to delay. - for (CXXMethodDecl::method_iterator O = Method->begin_overridden_methods(), - OEnd = Method->end_overridden_methods(); - O != OEnd; ++O) - CheckOverridingFunctionExceptionSpec(Method, *O); - } -} - /// IdentifyCUDATarget - Determine the CUDA compilation target for this function Sema::CUDAFunctionTarget Sema::IdentifyCUDATarget(const FunctionDecl *D) { // Implicitly declared functions (e.g. copy constructors) are Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp Wed May 23 21:39:39 2012 (r235863) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp Wed May 23 21:48:49 2012 (r235864) @@ -2277,7 +2277,7 @@ Sema::SpecialMemberOverloadResult *Sema: Result->setMethod(DD); Result->setKind(DD->isDeleted() ? SpecialMemberOverloadResult::NoMemberOrDeleted : - SpecialMemberOverloadResult::SuccessNonConst); + SpecialMemberOverloadResult::Success); return Result; } @@ -2288,6 +2288,9 @@ Sema::SpecialMemberOverloadResult *Sema: Expr *Arg = 0; unsigned NumArgs; + QualType ArgType = CanTy; + ExprValueKind VK = VK_LValue; + if (SM == CXXDefaultConstructor) { Name = Context.DeclarationNames.getCXXConstructorName(CanTy); NumArgs = 0; @@ -2308,7 +2311,6 @@ Sema::SpecialMemberOverloadResult *Sema: DeclareImplicitMoveAssignment(RD); } - QualType ArgType = CanTy; if (ConstArg) ArgType.addConst(); if (VolatileArg) @@ -2321,14 +2323,17 @@ Sema::SpecialMemberOverloadResult *Sema: // Possibly an XValue is actually correct in the case of move, but // there is no semantic difference for class types in this restricted // case. - ExprValueKind VK; if (SM == CXXCopyConstructor || SM == CXXCopyAssignment) VK = VK_LValue; else VK = VK_RValue; + } + OpaqueValueExpr FakeArg(SourceLocation(), ArgType, VK); + + if (SM != CXXDefaultConstructor) { NumArgs = 1; - Arg = new (Context) OpaqueValueExpr(SourceLocation(), ArgType, VK); + Arg = &FakeArg; } // Create the object argument @@ -2338,17 +2343,14 @@ Sema::SpecialMemberOverloadResult *Sema: if (VolatileThis) ThisTy.addVolatile(); Expr::Classification Classification = - (new (Context) OpaqueValueExpr(SourceLocation(), ThisTy, - RValueThis ? VK_RValue : VK_LValue))-> - Classify(Context); + OpaqueValueExpr(SourceLocation(), ThisTy, + RValueThis ? VK_RValue : VK_LValue).Classify(Context); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed May 23 23:42:00 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54501106564A; Wed, 23 May 2012 23:42:00 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 318988FC08; Wed, 23 May 2012 23:42:00 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q4NNfsh1022421; Wed, 23 May 2012 16:41:54 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.5/Submit) id q4NNfsQI022420; Wed, 23 May 2012 16:41:54 -0700 (PDT) (envelope-from obrien) Date: Wed, 23 May 2012 16:41:54 -0700 From: "David O'Brien" To: Dimitry Andric Message-ID: <20120523234154.GA22380@dragon.NUXI.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <4FBCCED9.9050308@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FBCCED9.9050308@FreeBSD.org> X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 23:42:00 -0000 On Wed, May 23, 2012 at 01:49:45PM +0200, Dimitry Andric wrote: > On 2012-05-22 20:18, David E. O'Brien wrote: > > Log: > > Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit platforms. ... > Until all the additional warnings this causes have been fixed, can this > commit please be reverted for now? Yes. I cannot believe we've been abusing "%q" this badly. -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Wed May 23 23:43:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DA381065670; Wed, 23 May 2012 23:43:56 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68DAE8FC0A; Wed, 23 May 2012 23:43:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NNhuVB002237; Wed, 23 May 2012 23:43:56 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NNhuKp002235; Wed, 23 May 2012 23:43:56 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201205232343.q4NNhuKp002235@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 23 May 2012 23:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235865 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 23:43:56 -0000 Author: obrien Date: Wed May 23 23:43:55 2012 New Revision: 235865 URL: http://svn.freebsd.org/changeset/base/235865 Log: Revert r235797. GCC's mis-assumptions has led to incorrect usage of "%q[diouxX]" within FreeBSD sources. Modified: head/contrib/gcc/c-format.c Modified: head/contrib/gcc/c-format.c ============================================================================== --- head/contrib/gcc/c-format.c Wed May 23 21:48:49 2012 (r235864) +++ head/contrib/gcc/c-format.c Wed May 23 23:43:55 2012 (r235865) @@ -287,11 +287,7 @@ static const format_length_info printf_l { { "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 }, { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L }, -#ifdef __LP64__ - { "q", FMT_LEN_l, STD_EXT, NULL, 0, 0 }, -#else { "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, -#endif { "L", FMT_LEN_L, STD_C89, NULL, 0, 0 }, { "z", FMT_LEN_z, STD_C99, NULL, 0, 0 }, { "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 }, From owner-svn-src-head@FreeBSD.ORG Wed May 23 23:47:53 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B12E61065673; Wed, 23 May 2012 23:47:53 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8B14D8FC16; Wed, 23 May 2012 23:47:53 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q4NNlraI022515; Wed, 23 May 2012 16:47:53 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.5/Submit) id q4NNlqtK022514; Wed, 23 May 2012 16:47:52 -0700 (PDT) (envelope-from obrien) Date: Wed, 23 May 2012 16:47:52 -0700 From: "David O'Brien" To: mdf@FreeBSD.org Message-ID: <20120523234752.GB22380@dragon.NUXI.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 23:47:53 -0000 On Tue, May 22, 2012 at 02:07:22PM -0700, mdf@FreeBSD.org wrote: > We run with the following at Isilon, which is somewhat bogus because > it allows a bit of sloppiness in types, but is also terribly > convenient since it means no casting on printf arguments is needed: ... > If there's no objections, I (or David or anyone else) can commit to > the FreeBSD repository. Unfortunately I don't like this change -- it promotes type sloppiness that flies in the face of ISO/IEC 9899:1999 (E). the mixed definition of [u]_?int64_t as it catches improper code -- such as assuming you can printf an int64_t with "%lld" when that is against the standard. -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Thu May 24 00:18:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC889106564A; Thu, 24 May 2012 00:18:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3BC128FC0A; Thu, 24 May 2012 00:18:46 +0000 (UTC) Message-ID: <4FBD7E65.1060205@FreeBSD.org> Date: Wed, 23 May 2012 20:18:45 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0.1 MIME-Version: 1.0 To: "Alexander V. Chernikov" References: <201205212219.q4LMJKR9076035@svn.freebsd.org> In-Reply-To: <201205212219.q4LMJKR9076035@svn.freebsd.org> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235746 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 00:18:46 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-05-21 18:19:20 -0400, Alexander V. Chernikov wrote: > Author: melifaro Date: Mon May 21 22:19:19 2012 New Revision: > 235746 URL: http://svn.freebsd.org/changeset/base/235746 > > Log: Call bpf_jitter() before acquiring BPF global lock due to > malloc() being used inside bpf_jitter. > > Eliminate bpf_buffer_alloc() and allocate BPF buffers on descriptor > creation and BIOCSBLEN ioctl. This permits us not to allocate > buffers inside bpf_attachd() which is protected by global lock. > > Approved by: kib(mentor) MFC in: 4 weeks > > Modified: head/sys/net/bpf.c head/sys/net/bpf_buffer.c > head/sys/net/bpf_buffer.h > > Modified: head/sys/net/bpf.c > ============================================================================== > > - --- head/sys/net/bpf.c Mon May 21 22:17:29 2012 (r235745) > +++ head/sys/net/bpf.c Mon May 21 22:19:19 2012 (r235746) ... > @@ -1664,7 +1668,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro > struct bpf_insn *fcode, *old; u_int wfilter, flen, size; #ifdef > BPF_JITTER - bpf_jit_filter *ofunc; + bpf_jit_filter *ofunc, > *jfunc; #endif int need_upgrade; #ifdef COMPAT_FREEBSD32 @@ -1695,6 > +1699,13 @@ bpf_setf(struct bpf_d *d, struct bpf_pro else fcode = > NULL; /* Make compiler happy */ > > +#ifdef BPF_JITTER + if (fp->bf_insns != NULL) + jfunc = > bpf_jitter(fcode, flen); + else + jfunc = NULL; /* Make compiler > happy */ +#endif + BPF_LOCK(); > > if (cmd == BIOCSETWF) { ... This is completely wrong. First, fcode has not been initialized with copyin(). Second, you must not compile random filter code without validation, i.e., bpf_validate(). Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk+9fmUACgkQmlay1b9qnVOlBACgtljVNwOiFb7Ds7GgeoQMyRRr jU4An3b43yEND8yPs8GSn20ZeCRrI9pu =z4sw -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Thu May 24 01:31:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96739106564A; Thu, 24 May 2012 01:31:11 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 780CA8FC15; Thu, 24 May 2012 01:31:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4O1VBtU006930; Thu, 24 May 2012 01:31:11 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O1VBiO006927; Thu, 24 May 2012 01:31:11 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205240131.q4O1VBiO006927@svn.freebsd.org> From: Andrew Thompson Date: Thu, 24 May 2012 01:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235870 - head/usr.bin/sockstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 01:31:11 -0000 Author: thompsa Date: Thu May 24 01:31:10 2012 New Revision: 235870 URL: http://svn.freebsd.org/changeset/base/235870 Log: Allow the socket list to be limited to a specific jail id. No objections: current@ Modified: head/usr.bin/sockstat/sockstat.1 head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.1 ============================================================================== --- head/usr.bin/sockstat/sockstat.1 Thu May 24 01:30:17 2012 (r235869) +++ head/usr.bin/sockstat/sockstat.1 Thu May 24 01:31:10 2012 (r235870) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2012 +.Dd May 16, 2012 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -36,6 +36,7 @@ .Sh SYNOPSIS .Nm .Op Fl 46cLlu +.Op Fl j Ar jid .Op Fl p Ar ports .Op Fl P Ar protocols .Sh DESCRIPTION @@ -57,6 +58,8 @@ Show (IPv6) sockets. .It Fl c Show connected sockets. +.It Fl j Ar jid +Show only sockets belonging to the specified jail ID. .It Fl L Only show Internet sockets if the local or foreign addresses are not in the loopback network prefix Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Thu May 24 01:30:17 2012 (r235869) +++ head/usr.bin/sockstat/sockstat.c Thu May 24 01:31:10 2012 (r235870) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); static int opt_4; /* Show IPv4 sockets */ static int opt_6; /* Show IPv6 sockets */ static int opt_c; /* Show connected sockets */ +static int opt_j; /* Show specified jail */ static int opt_L; /* Don't show IPv4 or IPv6 loopback sockets */ static int opt_l; /* Show listening sockets */ static int opt_u; /* Show Unix domain sockets */ @@ -549,6 +550,27 @@ getprocname(pid_t pid) } static int +getprocjid(pid_t pid) +{ + static struct kinfo_proc proc; + size_t len; + int mib[4]; + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PID; + mib[3] = (int)pid; + len = sizeof proc; + if (sysctl(mib, 4, &proc, &len, NULL, 0) == -1) { + /* Do not warn if the process exits before we get its jid. */ + if (errno != ESRCH) + warn("sysctl()"); + return (-1); + } + return (proc.ki_jid); +} + +static int check_ports(struct sock *s) { int port; @@ -643,6 +665,8 @@ display(void) for (xf = xfiles, n = 0; n < nxfiles; ++n, ++xf) { if (xf->xf_data == NULL) continue; + if (opt_j >= 0 && opt_j != getprocjid(xf->xf_pid)) + continue; hash = (int)((uintptr_t)xf->xf_data % HASHSIZE); for (s = sockhash[hash]; s != NULL; s = s->next) if ((void *)s->socket == xf->xf_data) @@ -668,6 +692,8 @@ display(void) pos += xprintf("%d ", xf->xf_fd); displaysock(s, pos); } + if (opt_j >= 0) + return; for (hash = 0; hash < HASHSIZE; hash++) { for (s = sockhash[hash]; s != NULL; s = s->next) { if (s->shown) @@ -716,7 +742,8 @@ main(int argc, char *argv[]) int protos_defined = -1; int o, i; - while ((o = getopt(argc, argv, "46cLlp:P:uv")) != -1) + opt_j = -1; + while ((o = getopt(argc, argv, "46cj:Llp:P:uv")) != -1) switch (o) { case '4': opt_4 = 1; @@ -727,6 +754,9 @@ main(int argc, char *argv[]) case 'c': opt_c = 1; break; + case 'j': + opt_j = atoi(optarg); + break; case 'L': opt_L = 1; break; From owner-svn-src-head@FreeBSD.ORG Thu May 24 02:24:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CEB221065672; Thu, 24 May 2012 02:24:04 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B666D8FC08; Thu, 24 May 2012 02:24:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4O2O45f009577; Thu, 24 May 2012 02:24:04 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O2O4OY009544; Thu, 24 May 2012 02:24:04 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201205240224.q4O2O4OY009544@svn.freebsd.org> From: Warren Block Date: Thu, 24 May 2012 02:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235873 - in head: lib/libpam/modules/pam_exec sbin/atacontrol sbin/etherswitchcfg sbin/geom/class/part sbin/geom/class/raid sbin/geom/class/virstor sbin/gvinum sbin/hastctl sbin/hastd ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 02:24:04 -0000 Author: wblock (doc committer) Date: Thu May 24 02:24:03 2012 New Revision: 235873 URL: http://svn.freebsd.org/changeset/base/235873 Log: Fixes to man8 groff mandoc style, usage mistakes, or typos. PR: 168016 Submitted by: Nobuyuki Koganemaru Approved by: gjb MFC after: 3 days Modified: head/lib/libpam/modules/pam_exec/pam_exec.8 head/sbin/atacontrol/atacontrol.8 head/sbin/etherswitchcfg/etherswitchcfg.8 head/sbin/geom/class/part/gpart.8 head/sbin/geom/class/raid/graid.8 head/sbin/geom/class/virstor/gvirstor.8 head/sbin/gvinum/gvinum.8 head/sbin/hastctl/hastctl.8 head/sbin/hastd/hastd.8 head/sbin/mount/mount.8 head/sbin/natd/natd.8 head/share/man/man8/picobsd.8 head/share/man/man8/rc.8 head/sys/boot/common/loader.8 head/sys/boot/forth/beastie.4th.8 head/sys/boot/forth/brand.4th.8 head/sys/boot/forth/check-password.4th.8 head/sys/boot/forth/color.4th.8 head/sys/boot/forth/delay.4th.8 head/sys/boot/forth/menu.4th.8 head/sys/boot/forth/version.4th.8 head/usr.bin/ctlstat/ctlstat.8 head/usr.sbin/cpucontrol/cpucontrol.8 head/usr.sbin/ctladm/ctladm.8 head/usr.sbin/flowctl/flowctl.8 head/usr.sbin/freebsd-update/freebsd-update.8 head/usr.sbin/i2c/i2c.8 head/usr.sbin/jail/jail.8 head/usr.sbin/rtadvctl/rtadvctl.8 head/usr.sbin/rtadvd/rtadvd.8 head/usr.sbin/smbmsg/smbmsg.8 head/usr.sbin/wpa/ndis_events/ndis_events.8 Modified: head/lib/libpam/modules/pam_exec/pam_exec.8 ============================================================================== --- head/lib/libpam/modules/pam_exec/pam_exec.8 Thu May 24 01:43:08 2012 (r235872) +++ head/lib/libpam/modules/pam_exec/pam_exec.8 Thu May 24 02:24:03 2012 (r235873) @@ -131,10 +131,10 @@ This is useful in shell scripts for inst .Xr pam 8 , .Xr pam_sm_acct_mgmt 8 , .Xr pam_sm_authenticate 8 , -.Xr pam_sm_chauthtok 8, +.Xr pam_sm_chauthtok 8 , .Xr pam_sm_close_session 8 , .Xr pam_sm_open_session 8 , -.Xr pam_sm_setcred 8 . +.Xr pam_sm_setcred 8 .Sh AUTHORS The .Nm Modified: head/sbin/atacontrol/atacontrol.8 ============================================================================== --- head/sbin/atacontrol/atacontrol.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/atacontrol/atacontrol.8 Thu May 24 02:24:03 2012 (r235873) @@ -367,8 +367,8 @@ You should not set a spindown timeout on or syslog logging on it as the disk will be worn out spinning down and up all the time. .Sh SEE ALSO -.Xr ata 4 -.Xr cam 4 +.Xr ata 4 , +.Xr cam 4 , .Xr camcontrol 8 .Sh HISTORY The Modified: head/sbin/etherswitchcfg/etherswitchcfg.8 ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/etherswitchcfg/etherswitchcfg.8 Thu May 24 02:24:03 2012 (r235873) @@ -71,7 +71,8 @@ Specifies the physical media configurati Specifies a list of media options for a port. See .Xr ifconfig 8 for details on -.Ar media and +.Ar media +and .Ar mediaopt . .El .Ss reg Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/geom/class/part/gpart.8 Thu May 24 02:24:03 2012 (r235873) @@ -650,7 +650,7 @@ for MBR, for GPT. .It Cm ms-ldm-metadata A partition that contains Logical Disk Manager (LDM) database. -The scheme-specifig type is +The scheme-specific type is .Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3" for GPT. .El @@ -971,7 +971,7 @@ By default mirrored volumes are shown as .Sx "PARTITION TYPES" section). If this variable set to 1 each component of the mirrored volume will be -present as independet partition. +present as independent partition. .Em NOTE : This may break a mirrored volume and lead to data damage. .El Modified: head/sbin/geom/class/raid/graid.8 ============================================================================== --- head/sbin/geom/class/raid/graid.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/geom/class/raid/graid.8 Thu May 24 02:24:03 2012 (r235873) @@ -294,7 +294,7 @@ Debug level of the .Nm RAID GEOM class. .It Va kern.geom.raid.idle_threshold : No 1000000 -Time in microseconds to consider a volume idle for rebuild puroses. +Time in microseconds to consider a volume idle for rebuild purposes. .It Va kern.geom.raid.name_format : No 0 Providers name format: 0 -- raid/r{num}, 1 -- raid/{label}. .It Va kern.geom.raid.read_err_thresh : No 10 Modified: head/sbin/geom/class/virstor/gvirstor.8 ============================================================================== --- head/sbin/geom/class/virstor/gvirstor.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/geom/class/virstor/gvirstor.8 Thu May 24 02:24:03 2012 (r235873) @@ -113,7 +113,7 @@ Adds new components to existing virtual The specified virstor device must exist and be active .Pq i.e. module loaded, device present in Pa /dev . This action can be safely performed while the virstor device is in use -.Pq Qo hot Qc operation +.Pq Qo hot Qc operation . .It Cm remove Removes components from existing virtual device with the given .Ar name . @@ -268,7 +268,8 @@ change once it is set, and that the size components will always remain constant during their existence. For alternative ways to implement virtual or resizable file systems see .Xr zfs 1M , -.Xr gconcat 8 and +.Xr gconcat 8 +and .Xr growfs 8 . .Pp Note that Modified: head/sbin/gvinum/gvinum.8 ============================================================================== --- head/sbin/gvinum/gvinum.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/gvinum/gvinum.8 Thu May 24 02:24:03 2012 (r235873) @@ -58,7 +58,8 @@ All subdisks in the plex must be up for a parity check. .It Ic concat Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives Create a concatenated volume from the specified drives. -If no name is specified, a unique name will be set by gvinum. +If no name is specified, a unique name will be set by +.Ic gvinum . .It Ic create Oo Fl f Oc Op Ar description-file Create a volume as described in .Ar description-file . @@ -148,8 +149,8 @@ Normally this would be done by entering EOF character. .It Ic raid5 Oo Fl fv Oc Oo Fl s Ar stripesize Oc Oo Fl n Ar name Oc Ar drives Create a RAID-5 volume from the specified drives. -If no name is specified,a unique name will be set by -.Ic gvinum. +If no name is specified, a unique name will be set by +.Ic gvinum . This organization requires at least three drives. .It Ic rename Oo Fl r Oc Ar drive | subdisk | plex | volume newname Change the name of the specified object. @@ -202,8 +203,9 @@ Terminate access to the objects, or stop if no parameters are specified. .It Ic stripe Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives Create a striped volume from the specified drives. If no name is specified, -a unique name will be set by Ic gvinum. This organization requires at least two -drives. +a unique name will be set by +.Ic gvinum . +This organization requires at least two drives. .El .Sh DESCRIPTION The @@ -278,7 +280,8 @@ objects .El .Sh EXAMPLES To create a mirror on disks /dev/ad1 and /dev/ad2, create a filesystem, mount, -unmount and then stop Ic gvinum: +unmount and then stop +.Ic gvinum : .Pp .Dl "gvinum mirror /dev/ad1 /dev/ad2" .Dl "newfs /dev/gvinum/gvinumvolume0" Modified: head/sbin/hastctl/hastctl.8 ============================================================================== --- head/sbin/hastctl/hastctl.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/hastctl/hastctl.8 Thu May 24 02:24:03 2012 (r235873) @@ -211,7 +211,7 @@ nodeB# application_start .Xr ggatel 8 , .Xr hastd 8 , .Xr mount 8 , -.Xr newfs 8 . +.Xr newfs 8 .Sh AUTHORS The .Nm Modified: head/sbin/hastd/hastd.8 ============================================================================== --- head/sbin/hastd/hastd.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/hastd/hastd.8 Thu May 24 02:24:03 2012 (r235873) @@ -223,7 +223,7 @@ nodeA# mount -o noatime /dev/hast/shared .Xr hastctl 8 , .Xr mount 8 , .Xr newfs 8 , -.Xr g_bio 9 . +.Xr g_bio 9 .Sh AUTHORS The .Nm Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/mount/mount.8 Thu May 24 02:24:03 2012 (r235873) @@ -448,7 +448,7 @@ However, for the following file system t .Cm smbfs , .Cm udf , and -.Cm unionfs , +.Cm unionfs . .Nm will not call .Xr nmount 2 Modified: head/sbin/natd/natd.8 ============================================================================== --- head/sbin/natd/natd.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sbin/natd/natd.8 Thu May 24 02:24:03 2012 (r235873) @@ -787,7 +787,7 @@ ipfw add allow ip from any to any .Pp Here the packet from internal network to Internet goes out via .Ql sis0 -(rule number 2000) and gets catched by the +(rule number 2000) and gets caught by the .Ic globalport socket (3000). After that, either a match is found in a translation table Modified: head/share/man/man8/picobsd.8 ============================================================================== --- head/share/man/man8/picobsd.8 Thu May 24 01:43:08 2012 (r235872) +++ head/share/man/man8/picobsd.8 Thu May 24 02:24:03 2012 (r235873) @@ -54,7 +54,7 @@ The most important options for common op .Fl src , .Fl init , .Fl n and -.Fl v. +.Fl v . .Bl -tag -width indent .\" .It Fl -all_in_mfs @@ -94,7 +94,10 @@ subtree as necessary to subsequently bui images. .\" .It Fl -iso -Generate an ISO image, picobsd.iso, in addition to the disk image picobsd.bin +Generate an ISO image, +.Pa picobsd.iso , +in addition to the disk image +.Pa picobsd.bin . .\" .It Fl -modules Also build kernel modules. Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Thu May 24 01:43:08 2012 (r235872) +++ head/share/man/man8/rc.8 Thu May 24 02:24:03 2012 (r235873) @@ -253,7 +253,7 @@ The boot does not stop if such a script but a script can stop the boot if necessary by invoking the .Fn stop_boot function (from -.Xr rc.subr 8 ). +.Xr rc.subr 8 ) . .El .Pp Each script should contain Modified: head/sys/boot/common/loader.8 ============================================================================== --- head/sys/boot/common/loader.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/common/loader.8 Thu May 24 02:24:03 2012 (r235873) @@ -423,7 +423,7 @@ variable take effect immediately. Defines the base i/o port used to access console UART (i386 and amd64 only). If the variable is not set, its assumed value is 0x3F8, which -corresponds to PC port COM1, unless overriden by +corresponds to PC port COM1, unless overridden by .Va BOOT_COMCONSOLE_PORT variable during the compilation of .Nm . Modified: head/sys/boot/forth/beastie.4th.8 ============================================================================== --- head/sys/boot/forth/beastie.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/beastie.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm beastie.4th -.Nd FreeBSD ASCII art boot module. +.Nd FreeBSD ASCII art boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/sys/boot/forth/brand.4th.8 ============================================================================== --- head/sys/boot/forth/brand.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/brand.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm brand.4th -.Nd FreeBSD ASCII art boot module. +.Nd FreeBSD ASCII art boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/sys/boot/forth/check-password.4th.8 ============================================================================== --- head/sys/boot/forth/check-password.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/check-password.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm check-password.4th -.Nd FreeBSD password-checking boot module. +.Nd FreeBSD password-checking boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/sys/boot/forth/color.4th.8 ============================================================================== --- head/sys/boot/forth/color.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/color.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm color.4th -.Nd FreeBSD color-detection boot module. +.Nd FreeBSD color-detection boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/sys/boot/forth/delay.4th.8 ============================================================================== --- head/sys/boot/forth/delay.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/delay.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm delay.4th -.Nd FreeBSD debugging boot module. +.Nd FreeBSD debugging boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/sys/boot/forth/menu.4th.8 ============================================================================== --- head/sys/boot/forth/menu.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/menu.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm menu.4th -.Nd FreeBSD dynamic menu boot module. +.Nd FreeBSD dynamic menu boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/sys/boot/forth/version.4th.8 ============================================================================== --- head/sys/boot/forth/version.4th.8 Thu May 24 01:43:08 2012 (r235872) +++ head/sys/boot/forth/version.4th.8 Thu May 24 02:24:03 2012 (r235873) @@ -29,7 +29,7 @@ .Os .Sh NAME .Nm version.4th -.Nd FreeBSD version string boot module. +.Nd FreeBSD version string boot module .Sh DESCRIPTION The file that goes by the name of .Nm Modified: head/usr.bin/ctlstat/ctlstat.8 ============================================================================== --- head/usr.bin/ctlstat/ctlstat.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.bin/ctlstat/ctlstat.8 Thu May 24 02:24:03 2012 (r235873) @@ -86,8 +86,8 @@ Notation (JSON) format. No statistics are computed in this mode, only raw numbers are displayed. .It Fl l Ar lun Request statistics for the specified LUN. -This option is incompatible with total ( -.Fl t ) +This option is incompatible with total +.Fl ( t ) mode. .It Fl n Ar numdevs Display statistics for this many devices. Modified: head/usr.sbin/cpucontrol/cpucontrol.8 ============================================================================== --- head/usr.sbin/cpucontrol/cpucontrol.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/cpucontrol/cpucontrol.8 Thu May 24 02:24:03 2012 (r235873) @@ -31,7 +31,7 @@ .Nm cpucontrol .Nd control utility for the .Xr cpuctl 4 -device. +device .Sh SYNOPSIS .Nm .Op Fl vh Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/ctladm/ctladm.8 Thu May 24 02:24:03 2012 (r235873) @@ -542,7 +542,7 @@ List all LUNs registered with CTL. Because this command uses the ioctl port, it will only work when the FETDs (Front End Target Drivers) are enabled. This command is the equivalent of doing a REPORT LUNS on one LUN and then -and then an INQUIRY on each LUN in the system. +an INQUIRY on each LUN in the system. .It Ic delay Delay commands at the given location. There are two places where commands may be delayed currently: before data is transferred @@ -749,7 +749,7 @@ single port. As a general rule, the WWNN should be the same across all ports on the system. .It Fl W Ar wwpn -Set the World Wide Node Name for the given port. +Set the World Wide Port Name for the given port. The .Fl n argument must be specified, since this is only possible to implement on a @@ -939,10 +939,10 @@ Create a LUN using the block backend, sp .Pa src/usr.sbin/ctladm/ctladm.8 as the backing store, and specify the .Tn SCSI -VPD page 0x80 and 0x83 serial number ( -.Fl S) -and device ID ( -.Fl d). +VPD page 0x80 and 0x83 serial number +.Fl ( S ) +and device ID +.Fl ( d ) . .Pp .Dl ctladm remove -b block -l 12 .Pp Modified: head/usr.sbin/flowctl/flowctl.8 ============================================================================== --- head/usr.sbin/flowctl/flowctl.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/flowctl/flowctl.8 Thu May 24 02:24:03 2012 (r235873) @@ -60,7 +60,7 @@ This command is the analog of the .Dq "show ip cache flow" command of a Cisco router. It dumps the contents of the flow cache in Cisco-like format. -Specifing either +Specifying either .Cm ipv4 or .Cm ipv6 Modified: head/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/freebsd-update/freebsd-update.8 Thu May 24 02:24:03 2012 (r235873) @@ -62,7 +62,7 @@ Release Engineering Team, e.g., .Fx 9.0-CURRENT. .Sh OPTIONS -The following options are supported +The following options are supported: .Bl -tag -width "-f conffile" .It Fl b Ar basedir Operate on a system mounted at Modified: head/usr.sbin/i2c/i2c.8 ============================================================================== --- head/usr.sbin/i2c/i2c.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/i2c/i2c.8 Thu May 24 02:24:03 2012 (r235873) @@ -88,7 +88,7 @@ reset the controller. .It Fl s scan the bus for devices. .It Fl v -be verbose +be verbose. .It Fl w Ar 0|8|16 device addressing width (in bits). .El Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/jail/jail.8 Thu May 24 02:24:03 2012 (r235873) @@ -255,7 +255,7 @@ They can also be given the values .Dq true and .Dq false . -Other partameters may have more than one value, specified as a +Other parameters may have more than one value, specified as a comma-separated list or with .Dq += in the configuration file (see @@ -269,7 +269,7 @@ parameters that are passed to the kernel can be seen with .Xr jls 8 , and can (usually) be changed with -.Dq Nm Fl m. +.Dq Nm Fl m . Then there are pseudo-parameters that are only used by .Nm itself. @@ -580,7 +580,7 @@ command parameters are command lines that are run in either the system or prison environment. They may be given multiple values, which run would the specified commands in sequence. -All commands must succed (return a zero exit status), or the jail will +All commands must succeed (return a zero exit status), or the jail will not be created or removed. .Pp The pseudo-parameters are: @@ -657,7 +657,8 @@ The maximum amount of time to wait for a after sending them a .Dv SIGTERM signal (which happens after the -.Va exec.stop commands have completed). +.Va exec.stop +commands have completed). After this many seconds have passed, the prison will be removed, which will kill any remaining processes. If this is set to zero, no Modified: head/usr.sbin/rtadvctl/rtadvctl.8 ============================================================================== --- head/usr.sbin/rtadvctl/rtadvctl.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/rtadvctl/rtadvctl.8 Thu May 24 02:24:03 2012 (r235873) @@ -31,7 +31,8 @@ .Sh NAME .Nm rtadvctl .Nd control program for -.Xr rtadvd 8 daemon +.Xr rtadvd 8 +daemon .Sh SYNOPSIS .Nm .Op Fl v Modified: head/usr.sbin/rtadvd/rtadvd.8 ============================================================================== --- head/usr.sbin/rtadvd/rtadvd.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/rtadvd/rtadvd.8 Thu May 24 02:24:03 2012 (r235873) @@ -140,7 +140,7 @@ option, which enables routing renumberin .It Fl p Specify an alternative file in which to store the process ID. The default is -.Pa /var/run/rtadvd.pid. +.Pa /var/run/rtadvd.pid . .It Fl R Accept router renumbering requests. If you enable it, certain IPsec setup is suggested for security reasons. Modified: head/usr.sbin/smbmsg/smbmsg.8 ============================================================================== --- head/usr.sbin/smbmsg/smbmsg.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/smbmsg/smbmsg.8 Thu May 24 02:24:03 2012 (r235873) @@ -70,7 +70,7 @@ and writeable, respectively. The only valid additional option for this modus of operation (besides the .Fl p -option that choses the modus) is +option that chooses the modus) is .Fl f Ar dev . See below for a description. .Pp Modified: head/usr.sbin/wpa/ndis_events/ndis_events.8 ============================================================================== --- head/usr.sbin/wpa/ndis_events/ndis_events.8 Thu May 24 01:43:08 2012 (r235872) +++ head/usr.sbin/wpa/ndis_events/ndis_events.8 Thu May 24 02:24:03 2012 (r235873) @@ -71,7 +71,7 @@ When it detects an event that was genera interface, it transmits it via UDP packet on the loopback interface, where .Xr wpa_supplicant 8 -is presumeably listening. +is presumably listening. The standard .Xr wpa_supplicant 8 distribution includes its own version of this utility for use with From owner-svn-src-head@FreeBSD.ORG Thu May 24 04:10:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D69C41065670; Thu, 24 May 2012 04:10:35 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86D268FC16; Thu, 24 May 2012 04:10:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4O4AZCD014413; Thu, 24 May 2012 04:10:35 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O4AZDE014411; Thu, 24 May 2012 04:10:35 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201205240410.q4O4AZDE014411@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 24 May 2012 04:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235879 - head/sys/modules/aesni X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 04:10:35 -0000 Author: obrien Date: Thu May 24 04:10:34 2012 New Revision: 235879 URL: http://svn.freebsd.org/changeset/base/235879 Log: style.Makefile(5) Modified: head/sys/modules/aesni/Makefile Modified: head/sys/modules/aesni/Makefile ============================================================================== --- head/sys/modules/aesni/Makefile Thu May 24 04:09:47 2012 (r235878) +++ head/sys/modules/aesni/Makefile Thu May 24 04:10:34 2012 (r235879) @@ -4,7 +4,7 @@ KMOD= aesni SRCS= aesni.c aesni_wrap.c -SRCS+= aesencdec_$(MACHINE_CPUARCH).S aeskeys_$(MACHINE_CPUARCH).S +SRCS+= aesencdec_${MACHINE_CPUARCH}.S aeskeys_${MACHINE_CPUARCH}.S SRCS+= device_if.h bus_if.h opt_bus.h cryptodev_if.h .include From owner-svn-src-head@FreeBSD.ORG Thu May 24 06:37:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60300106564A; Thu, 24 May 2012 06:37:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by mx1.freebsd.org (Postfix) with ESMTP id D18008FC18; Thu, 24 May 2012 06:37:32 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4O6bNkM019413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 May 2012 16:37:24 +1000 Date: Thu, 24 May 2012 16:37:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "David O'Brien" In-Reply-To: <20120523234154.GA22380@dragon.NUXI.org> Message-ID: <20120524163545.T1094@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <4FBCCED9.9050308@FreeBSD.org> <20120523234154.GA22380@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 06:37:33 -0000 On Wed, 23 May 2012, David O'Brien wrote: > On Wed, May 23, 2012 at 01:49:45PM +0200, Dimitry Andric wrote: >> On 2012-05-22 20:18, David E. O'Brien wrote: >>> Log: >>> Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit platforms. > ... >> Until all the additional warnings this causes have been fixed, can this >> commit please be reverted for now? > > Yes. I cannot believe we've been abusing "%q" this badly. Using it at all is using it badly, so your change should have had no effect. But when it was used to print quad_t's, its use was almost reasonable, and the change broke that too. Bruce From owner-svn-src-head@FreeBSD.ORG Thu May 24 07:06:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3FAC106566B; Thu, 24 May 2012 07:06:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 1B8108FC18; Thu, 24 May 2012 07:06:42 +0000 (UTC) Received: from mail11.syd.optusnet.com.au (mail11.syd.optusnet.com.au [211.29.132.192]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4O70fmZ004936; Thu, 24 May 2012 17:00:42 +1000 Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail11.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4O70MnT008164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 May 2012 17:00:24 +1000 Date: Thu, 24 May 2012 17:00:22 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: d@delphij.net In-Reply-To: <4FBD2393.708@delphij.net> Message-ID: <20120524163735.E1094@besplex.bde.org> References: <201205230649.q4N6nofV053886@svn.freebsd.org> <4FBD2393.708@delphij.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, "Bjoern A. Zeeb" , svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r235822 - in head: sys/dev/esp sys/gnu/fs/xfs/FreeBSD usr.sbin/ppp usr.sbin/rpc.lockd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 07:06:43 -0000 On Wed, 23 May 2012, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 05/23/12 07:56, Bjoern A. Zeeb wrote: >> >> On 23. May 2012, at 06:49 , Xin LI wrote: >> >>> Author: delphij Date: Wed May 23 06:49:50 2012 New Revision: >>> 235822 URL: http://svn.freebsd.org/changeset/base/235822 >>> >>> Log: Fix build: >>> >>> - Use %ll instead of %q for explicit long long casts; - Use %j >>> instead of %q in XFS and cast to intmax_t. >>> >>> Tested with: make universe >> >> >> I am still seeing XLP64 failing to compile: >> >> cc1: warnings being treated as errors >> /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c: In function >> 'g_flashmap_print': >> /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: >> format '%08llx' expects type 'long long unsigned int', but argument >> 2 has type 'off_t' [-Wformat] >> /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: >> format '%08llx' expects type 'long long unsigned int', but argument >> 3 has type 'off_t' [-Wformat] >> /scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning: >> format '%llu' expects type 'long long unsigned int', but argument 5 >> has type 'off_t' [-Wformat] > > Weird, I don't know why I didn't caught this :-/ It seems that > 'universe_kernel' does not do things after an existing universe build? Well, new printf format errors/style bugs involving %ll have little to do with old ones involving %q, even if they are not even style bugs but fatal type mismatches. > Should be fixed in r235849. The following bugs remain: - bogus types off_t for sl_start and sl_end. The typedef for file offsets is very inappropriate for disk offsets. But this seems to be a generic bug in geom. - printing the signed type off_t using the unsigned formats %...x and %...u. (The casts are to unsigned to match the formats.) - printing sl_start and sl_end in hex format - printing sl_start and sl_end in %08jx format: - this hex format doesn't even use '%#' or '0x%', so it is ambiguous - the output is not in tab format, so '08' is not needed to line it up - 08 doesn't even work for lining things up, except for 32-bit values. 016 might work for 64-bit values. But for general uint64_t values, there is no correct field width to use. Bruce From owner-svn-src-head@FreeBSD.ORG Thu May 24 07:52:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 545111065670; Thu, 24 May 2012 07:52:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id DE8F58FC0C; Thu, 24 May 2012 07:52:02 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4O7prha005272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 May 2012 17:51:55 +1000 Date: Thu, 24 May 2012 17:51:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon In-Reply-To: <4FBD4124.5030205@FreeBSD.org> Message-ID: <20120524174234.O1352@besplex.bde.org> References: <201205231817.q4NIH2t7088267@svn.freebsd.org> <20120523192232.GA1399@garage.freebsd.pl> <4FBD4124.5030205@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Xin LI , svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r235852 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 07:52:03 -0000 On Wed, 23 May 2012, Andriy Gapon wrote: > on 23/05/2012 22:22 Pawel Jakub Dawidek said the following: >> On Wed, May 23, 2012 at 06:17:02PM +0000, Xin LI wrote: >>> Author: delphij Date: Wed May 23 18:17:02 2012 New Revision: 235852 URL: >>> http://svn.freebsd.org/changeset/base/235852 >>> >>> Log: Use %ju to match uintmax_t usage >>> >>> Modified: head/sys/geom/geom_flashmap.c >>> >>> Modified: head/sys/geom/geom_flashmap.c >>> ============================================================================== >>> >>> > --- head/sys/geom/geom_flashmap.c Wed May 23 18:11:36 2012 (r235851) >>> +++ head/sys/geom/geom_flashmap.c Wed May 23 18:17:02 2012 (r235852) @@ >>> -78,7 +78,7 @@ static void g_flashmap_print(struct g_flashmap_slice >>> *slice) { >>> >>> - printf("%08jx-%08jx: %s (%lluKB)\n", (intmax_t)slice->sl_start, >>> (intmax_t)slice->sl_end, + printf("%08jx-%08jx: %s (%juKB)\n", >>> (intmax_t)slice->sl_start, (intmax_t)slice->sl_end, slice->sl_name, >>> (uintmax_t)(slice->sl_end - slice->sl_start) / 1024); >> >> BTW, %jx is also uintmax_t, not intmax_t, right? > > I think that non-decimal representation generally implies unsigned-ness. But it is another bug. I already pointed this out. but didn't notice then that it took 3-4 commits to get this far. Sometimes negative values need to be printed in hex, with the burden of interpreting the sign bit left to the user. Then the correct cast to use is problematic -- if you actually want to see the bits, then you don't want casting to change them, but perhaps it does change them for the 1's complement and other exotic cases. So hex printing of negative values probably shouldn't use casts at all, but should point at the object using u_char * and print the bits 1 byte at a time. These complications probably don't apply here. Probably the values are always nonnegative, so they can be printed in hex by simply casting them, and the casts should be to an unsigned type to match the format. The hex format is just bad here, with 2 or 3 internal bugs starting with it never having an 0x prefix -- see a previous reply. Bruce From owner-svn-src-head@FreeBSD.ORG Thu May 24 08:00:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06608106566B; Thu, 24 May 2012 08:00:27 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4F2E8FC0A; Thu, 24 May 2012 08:00:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4O80QlY023998; Thu, 24 May 2012 08:00:26 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4O80QQk023994; Thu, 24 May 2012 08:00:26 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201205240800.q4O80QQk023994@svn.freebsd.org> From: Gleb Kurtsou Date: Thu, 24 May 2012 08:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235886 - in head/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 08:00:27 -0000 Author: gleb Date: Thu May 24 08:00:26 2012 New Revision: 235886 URL: http://svn.freebsd.org/changeset/base/235886 Log: Add kern_fhstat(), adjust sys_fhstat() to use it. Extend kern_getdirentries() to accept uio segflag and optionally return buffer residue. Sponsored by: Google Summer of Code 2011 Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Thu May 24 05:30:17 2012 (r235885) +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu May 24 08:00:26 2012 (r235886) @@ -1528,7 +1528,8 @@ freebsd32_getdirentries(struct thread *t int32_t base32; int error; - error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base); + error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base, + NULL, UIO_USERSPACE); if (error) return (error); if (uap->basep != NULL) { Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu May 24 05:30:17 2012 (r235885) +++ head/sys/kern/vfs_syscalls.c Thu May 24 08:00:26 2012 (r235886) @@ -4136,7 +4136,8 @@ sys_getdirentries(td, uap) long base; int error; - error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base); + error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base, + NULL, UIO_USERSPACE); if (error) return (error); if (uap->basep != NULL) @@ -4146,7 +4147,7 @@ sys_getdirentries(td, uap) int kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, - long *basep) + long *basep, ssize_t *residp, enum uio_seg bufseg) { struct vnode *vp; struct file *fp; @@ -4180,7 +4181,7 @@ unionread: auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_rw = UIO_READ; - auio.uio_segflg = UIO_USERSPACE; + auio.uio_segflg = bufseg; auio.uio_td = td; vn_lock(vp, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(vp); @@ -4213,6 +4214,8 @@ unionread: VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); *basep = loff; + if (residp != NULL) + *residp = auio.uio_resid; td->td_retval[0] = count - auio.uio_resid; fail: fdrop(fp, td); @@ -4679,7 +4682,22 @@ sys_fhstat(td, uap) } */ *uap; { struct stat sb; - fhandle_t fh; + struct fhandle fh; + int error; + + error = copyin(uap->u_fhp, &fh, sizeof(fh)); + if (error != 0) + return (error); + error = kern_fhstat(td, fh, &sb); + if (error != 0) + return (error); + error = copyout(&sb, uap->sb, sizeof(sb)); + return (error); +} + +int +kern_fhstat(struct thread *td, struct fhandle fh, struct stat *sb) +{ struct mount *mp; struct vnode *vp; int vfslocked; @@ -4688,9 +4706,6 @@ sys_fhstat(td, uap) error = priv_check(td, PRIV_VFS_FHSTAT); if (error) return (error); - error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t)); - if (error) - return (error); if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL) return (ESTALE); vfslocked = VFS_LOCK_GIANT(mp); @@ -4700,12 +4715,9 @@ sys_fhstat(td, uap) VFS_UNLOCK_GIANT(vfslocked); return (error); } - error = vn_stat(vp, &sb, td->td_ucred, NOCRED, td); + error = vn_stat(vp, sb, td->td_ucred, NOCRED, td); vput(vp); VFS_UNLOCK_GIANT(vfslocked); - if (error) - return (error); - error = copyout(&sb, uap->sb, sizeof(sb)); return (error); } Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Thu May 24 05:30:17 2012 (r235885) +++ head/sys/sys/syscallsubr.h Thu May 24 08:00:26 2012 (r235886) @@ -89,6 +89,7 @@ int kern_fchmodat(struct thread *td, int int kern_fchownat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int uid, int gid, int flag); int kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg); +int kern_fhstat(struct thread *td, fhandle_t fh, struct stat *buf); int kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf); int kern_fstat(struct thread *td, int fd, struct stat *sbp); int kern_fstatfs(struct thread *td, int fd, struct statfs *buf); @@ -96,7 +97,7 @@ int kern_ftruncate(struct thread *td, in int kern_futimes(struct thread *td, int fd, struct timeval *tptr, enum uio_seg tptrseg); int kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, - long *basep); + long *basep, ssize_t *residp, enum uio_seg bufseg); int kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize, enum uio_seg bufseg, int flags); int kern_getgroups(struct thread *td, u_int *ngrp, gid_t *groups); From owner-svn-src-head@FreeBSD.ORG Thu May 24 09:27:42 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E775106564A; Thu, 24 May 2012 09:27:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id F2F5E8FC0C; Thu, 24 May 2012 09:27:40 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4O9QoZp060366; Thu, 24 May 2012 12:26:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4O9QobQ063966; Thu, 24 May 2012 12:26:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4O9QnL2063965; Thu, 24 May 2012 12:26:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 May 2012 12:26:49 +0300 From: Konstantin Belousov To: Niclas Zeising Message-ID: <20120524092649.GH2358@deviant.kiev.zoral.com.ua> References: <201205232107.q4NL71dw095460@svn.freebsd.org> <4FBD5899.9000808@daemonic.se> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VfjHX4a4S/LzE4mr" Content-Disposition: inline In-Reply-To: <4FBD5899.9000808@daemonic.se> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235859 - in head/sys: i386/conf modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 09:27:42 -0000 --VfjHX4a4S/LzE4mr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 23, 2012 at 11:37:29PM +0200, Niclas Zeising wrote: > On 05/23/12 23:07, Konstantin Belousov wrote: > >Author: kib > >Date: Wed May 23 21:07:01 2012 > >New Revision: 235859 > >URL: http://svn.freebsd.org/changeset/base/235859 > > > >Log: > > Enable drm2 modules build. > > > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 month > > > >Modified: > > head/sys/i386/conf/XEN > > head/sys/modules/Makefile > > >=20 > Hi! > Thank you very much for all your work! > With this commit, is there any need for any patches from you, or have=20 > they all been incorporated by now? Perhaps a note in UPDATING would be=20 > good, at least to make people more aware of the fact that GEM/KMS=20 > finally has come to FreeBSD as well. An update to the wiki might be=20 > good as well. I can help you with patches and updating the wiki, just=20 > let me know. > Once again, a big thank you! ATM no more patches are needed to run new driver. I do not see a need in any UPDATING entry, since nothing should have been changed for users who did not used my patch before. Wiki ought to get complete rewrite, I might get time to do it at the end of week. --VfjHX4a4S/LzE4mr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+9/tkACgkQC3+MBN1Mb4iP8ACeJbRtUbuktUgQjDteJwTpxL/g yAYAoJJYTsWBA/MTgdSRYF7U4vpOkwxQ =h1I+ -----END PGP SIGNATURE----- --VfjHX4a4S/LzE4mr-- From owner-svn-src-head@FreeBSD.ORG Thu May 24 09:34:19 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38CBF1065674; Thu, 24 May 2012 09:34:19 +0000 (UTC) (envelope-from zeising@daemonic.se) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id A4DF18FC08; Thu, 24 May 2012 09:34:18 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 7BC1840014; Thu, 24 May 2012 11:34:17 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 6F6DC4000B; Thu, 24 May 2012 11:34:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (h-45-105.a163.priv.bahnhof.se [94.254.45.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 27BDE40002; Thu, 24 May 2012 11:34:17 +0200 (CEST) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3Vylm862msz8ggx; Thu, 24 May 2012 11:34:16 +0200 (CEST) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id GLouEDiNJmvf; Thu, 24 May 2012 11:34:11 +0200 (CEST) Received: from mail.daemonic.se (mail.daemonic.se [10.1.0.4]) by mx.daemonic.se (Postfix) with ESMTPS id 3Vylm32V6sz8ggv; Thu, 24 May 2012 11:34:11 +0200 (CEST) Received: from [IPv6:2001:470:dca9:1::4] (vivi.daemonic.se [IPv6:2001:470:dca9:1::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 3Vylm31mDrz9Ctq; Thu, 24 May 2012 11:34:11 +0200 (CEST) Message-ID: <4FBE0086.1050801@daemonic.se> Date: Thu, 24 May 2012 11:33:58 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Konstantin Belousov References: <201205232107.q4NL71dw095460@svn.freebsd.org> <4FBD5899.9000808@daemonic.se> <20120524092649.GH2358@deviant.kiev.zoral.com.ua> In-Reply-To: <20120524092649.GH2358@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235859 - in head/sys: i386/conf modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 09:34:19 -0000 On 2012-05-24 11:26, Konstantin Belousov wrote: > On Wed, May 23, 2012 at 11:37:29PM +0200, Niclas Zeising wrote: >> On 05/23/12 23:07, Konstantin Belousov wrote: >>> Author: kib >>> Date: Wed May 23 21:07:01 2012 >>> New Revision: 235859 >>> URL: http://svn.freebsd.org/changeset/base/235859 >>> >>> Log: >>> Enable drm2 modules build. >>> >>> Sponsored by: The FreeBSD Foundation >>> MFC after: 1 month >>> >>> Modified: >>> head/sys/i386/conf/XEN >>> head/sys/modules/Makefile >>> >> >> Hi! >> Thank you very much for all your work! >> With this commit, is there any need for any patches from you, or have >> they all been incorporated by now? Perhaps a note in UPDATING would be >> good, at least to make people more aware of the fact that GEM/KMS >> finally has come to FreeBSD as well. An update to the wiki might be >> good as well. I can help you with patches and updating the wiki, just >> let me know. >> Once again, a big thank you! > > ATM no more patches are needed to run new driver. > > I do not see a need in any UPDATING entry, since nothing should have > been changed for users who did not used my patch before. > > Wiki ought to get complete rewrite, I might get time to do it at the end > of week. Hi! Thank you for the clarifications! Regards! -- Niclas From owner-svn-src-head@FreeBSD.ORG Thu May 24 10:47:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C083106564A; Thu, 24 May 2012 10:47:22 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mail.ipfw.ru (unknown [IPv6:2a01:4f8:120:6141::2]) by mx1.freebsd.org (Postfix) with ESMTP id F039A8FC0A; Thu, 24 May 2012 10:47:21 +0000 (UTC) Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1SXVZp-000HKC-BZ; Thu, 24 May 2012 14:47:29 +0400 Message-ID: <4FBE1120.8020704@FreeBSD.org> Date: Thu, 24 May 2012 14:44:48 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120121 Thunderbird/9.0 MIME-Version: 1.0 To: Jung-uk Kim References: <201205212219.q4LMJKR9076035@svn.freebsd.org> <4FBD7E65.1060205@FreeBSD.org> In-Reply-To: <4FBD7E65.1060205@FreeBSD.org> Content-Type: multipart/mixed; boundary="------------010906000107090302010705" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235746 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 10:47:22 -0000 This is a multi-part message in MIME format. --------------010906000107090302010705 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 24.05.2012 04:18, Jung-uk Kim wrote: ... >> @@ -1664,7 +1668,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro >> struct bpf_insn *fcode, *old; u_int wfilter, flen, size; #ifdef >> BPF_JITTER - bpf_jit_filter *ofunc; + bpf_jit_filter *ofunc, >> *jfunc; #endif int need_upgrade; #ifdef COMPAT_FREEBSD32 @@ -1695,6 >> +1699,13 @@ bpf_setf(struct bpf_d *d, struct bpf_pro else fcode = >> NULL; /* Make compiler happy */ >> >> +#ifdef BPF_JITTER + if (fp->bf_insns != NULL) + jfunc = >> bpf_jitter(fcode, flen); + else + jfunc = NULL; /* Make compiler >> happy */ +#endif + BPF_LOCK(); >> >> if (cmd == BIOCSETWF) { > ... > > This is completely wrong. First, fcode has not been initialized with Ups. Does the attached patch look ok to you? --------------010906000107090302010705 Content-Type: text/plain; name="bpf_jitter.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bpf_jitter.diff" SW5kZXg6IHN5cy9uZXQvYnBmLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL25ldC9icGYuYwko cmV2aXNpb24gMjM1NzUwKQorKysgc3lzL25ldC9icGYuYwkod29ya2luZyBjb3B5KQpAQCAt MTczNyw5ICsxNzM3LDE2IEBAIGJwZl9zZXRmKHN0cnVjdCBicGZfZCAqZCwgc3RydWN0IGJw Zl9wcm9ncmFtICpmcCwKIAogCW5lZWRfdXBncmFkZSA9IDA7CiAJc2l6ZSA9IGZsZW4gKiBz aXplb2YoKmZwLT5iZl9pbnNucyk7Ci0JaWYgKHNpemUgPiAwKQorCWlmIChzaXplID4gMCkg eworCQkvKiBXZSdyZSBzZXR0aW5nIHVwIG5ldyBmaWx0ZXIuIENvcHkgYW5kIGNoZWNrIGFj dHVhbCBkYXRhICovCiAJCWZjb2RlID0gKHN0cnVjdCBicGZfaW5zbiAqKW1hbGxvYyhzaXpl LCBNX0JQRiwgTV9XQUlUT0spOwotCWVsc2UKKwkJaWYgKGNvcHlpbigoY2FkZHJfdClmcC0+ YmZfaW5zbnMsIChjYWRkcl90KWZjb2RlLCBzaXplKSAhPSAwIHx8CisJCSAgICAoYnBmX3Zh bGlkYXRlKGZjb2RlLCAoaW50KWZsZW4pID09IDApKSB7CisJCQlmcmVlKGZjb2RlLCBNX0JQ Rik7CisJCQlyZXR1cm4gKEVJTlZBTCk7CisJCX0KKwkJLyogRmlsdGVyIGlzIGNvcGllZCBp bnNpZGUgZmNvZGUgYW5kIGlzIHBlcmZlY3RseSB2YWxpZCAqLworCX0gZWxzZQogCQlmY29k ZSA9IE5VTEw7IC8qIE1ha2UgY29tcGlsZXIgaGFwcHkgKi8KIAogI2lmZGVmIEJQRl9KSVRU RVIKQEAgLTE3OTUsNTUgKzE4MDIsNTAgQEAgYnBmX3NldGYoc3RydWN0IGJwZl9kICpkLCBz dHJ1Y3QgYnBmX3Byb2dyYW0gKmZwLAogCQlyZXR1cm4gKDApOwogCX0KIAotCWlmIChjb3B5 aW4oKGNhZGRyX3QpZnAtPmJmX2luc25zLCAoY2FkZHJfdClmY29kZSwgc2l6ZSkgPT0gMCAm JgotCSAgICBicGZfdmFsaWRhdGUoZmNvZGUsIChpbnQpZmxlbikpIHsKLQkJLyogCi0JCSAq IFByb3RlY3QgZmlsdGVyIGNoYW5nZSBieSBpbnRlcmZhY2UgbG9jawotCQkgKiBBZGRpdGlv bmFsbHksIHdlIGFyZSBwcm90ZWN0ZWQgYnkgZ2xvYmFsIGxvY2sgaGVyZS4KLQkJICovCi0J CWlmIChkLT5iZF9iaWYgIT0gTlVMTCkKLQkJCUJQRklGX1dMT0NLKGQtPmJkX2JpZik7Ci0J CUJQRkRfTE9DSyhkKTsKLQkJaWYgKHdmaWx0ZXIpCi0JCQlkLT5iZF93ZmlsdGVyID0gZmNv ZGU7Ci0JCWVsc2UgewotCQkJZC0+YmRfcmZpbHRlciA9IGZjb2RlOworCS8qIAorCSAqIFNl dCB1cCBuZXcgZmlsdGVyLgorCSAqIFByb3RlY3QgZmlsdGVyIGNoYW5nZSBieSBpbnRlcmZh Y2UgbG9jaworCSAqIEFkZGl0aW9uYWxseSwgd2UgYXJlIHByb3RlY3RlZCBieSBnbG9iYWwg bG9jayBoZXJlLgorCSAqLworCWlmIChkLT5iZF9iaWYgIT0gTlVMTCkKKwkJQlBGSUZfV0xP Q0soZC0+YmRfYmlmKTsKKwlCUEZEX0xPQ0soZCk7CisJaWYgKHdmaWx0ZXIpCisJCWQtPmJk X3dmaWx0ZXIgPSBmY29kZTsKKwllbHNlIHsKKwkJZC0+YmRfcmZpbHRlciA9IGZjb2RlOwog I2lmZGVmIEJQRl9KSVRURVIKLQkJCWQtPmJkX2JmaWx0ZXIgPSBqZnVuYzsKKwkJZC0+YmRf YmZpbHRlciA9IGpmdW5jOwogI2VuZGlmCi0JCQlpZiAoY21kID09IEJJT0NTRVRGKQotCQkJ CXJlc2V0X2QoZCk7CisJCWlmIChjbWQgPT0gQklPQ1NFVEYpCisJCQlyZXNldF9kKGQpOwog Ci0JCQkvKgotCQkJICogRG8gbm90IHJlcXVpcmUgdXBncmFkZSBieSBmaXJzdCBCSU9DU0VU RgotCQkJICogKHVzZWQgdG8gc2V0IHNuYXBsZW4pIGJ5IHBjYXBfb3Blbl9saXZlKCkKLQkJ CSAqLwotCQkJaWYgKChkLT5iZF93cml0ZXIgIT0gMCkgJiYgKC0tZC0+YmRfd3JpdGVyID09 IDApKQotCQkJCW5lZWRfdXBncmFkZSA9IDE7Ci0JCQlDVFI0KEtUUl9ORVQsICIlczogZmls dGVyIGZ1bmN0aW9uIHNldCBieSBwaWQgJWQsICIKLQkJCSAgICAiYmRfd3JpdGVyIGNvdW50 ZXIgJWQsIG5lZWRfdXBncmFkZSAlZCIsCi0JCQkgICAgX19mdW5jX18sIGQtPmJkX3BpZCwg ZC0+YmRfd3JpdGVyLCBuZWVkX3VwZ3JhZGUpOwotCQl9Ci0JCUJQRkRfVU5MT0NLKGQpOwot CQlpZiAoZC0+YmRfYmlmICE9IE5VTEwpCi0JCQlCUEZJRl9XVU5MT0NLKGQtPmJkX2JpZik7 Ci0JCWlmIChvbGQgIT0gTlVMTCkKLQkJCWZyZWUoKGNhZGRyX3Qpb2xkLCBNX0JQRik7CisJ CS8qCisJCSAqIERvIG5vdCByZXF1aXJlIHVwZ3JhZGUgYnkgZmlyc3QgQklPQ1NFVEYKKwkJ ICogKHVzZWQgdG8gc2V0IHNuYXBsZW4pIGJ5IHBjYXBfb3Blbl9saXZlKCkKKwkJICovCisJ CWlmICgoZC0+YmRfd3JpdGVyICE9IDApICYmICgtLWQtPmJkX3dyaXRlciA9PSAwKSkKKwkJ CW5lZWRfdXBncmFkZSA9IDE7CisJCUNUUjQoS1RSX05FVCwgIiVzOiBmaWx0ZXIgZnVuY3Rp b24gc2V0IGJ5IHBpZCAlZCwgIgorCQkgICAgImJkX3dyaXRlciBjb3VudGVyICVkLCBuZWVk X3VwZ3JhZGUgJWQiLAorCQkgICAgX19mdW5jX18sIGQtPmJkX3BpZCwgZC0+YmRfd3JpdGVy LCBuZWVkX3VwZ3JhZGUpOworCX0KKwlCUEZEX1VOTE9DSyhkKTsKKwlpZiAoZC0+YmRfYmlm ICE9IE5VTEwpCisJCUJQRklGX1dVTkxPQ0soZC0+YmRfYmlmKTsKKwlpZiAob2xkICE9IE5V TEwpCisJCWZyZWUoKGNhZGRyX3Qpb2xkLCBNX0JQRik7CiAjaWZkZWYgQlBGX0pJVFRFUgot CQlpZiAob2Z1bmMgIT0gTlVMTCkKLQkJCWJwZl9kZXN0cm95X2ppdF9maWx0ZXIob2Z1bmMp OworCWlmIChvZnVuYyAhPSBOVUxMKQorCQlicGZfZGVzdHJveV9qaXRfZmlsdGVyKG9mdW5j KTsKICNlbmRpZgogCi0JCS8qIE1vdmUgZCB0byBhY3RpdmUgcmVhZGVycyBsaXN0ICovCi0J CWlmIChuZWVkX3VwZ3JhZGUgIT0gMCkKLQkJCWJwZl91cGdyYWRlZChkKTsKKwkvKiBNb3Zl IGQgdG8gYWN0aXZlIHJlYWRlcnMgbGlzdCAqLworCWlmIChuZWVkX3VwZ3JhZGUgIT0gMCkK KwkJYnBmX3VwZ3JhZGVkKGQpOwogCi0JCUJQRl9VTkxPQ0soKTsKLQkJcmV0dXJuICgwKTsK LQl9Ci0JZnJlZSgoY2FkZHJfdClmY29kZSwgTV9CUEYpOwogCUJQRl9VTkxPQ0soKTsKLQly ZXR1cm4gKEVJTlZBTCk7CisJcmV0dXJuICgwKTsKIH0KIAogLyoKSW5kZXg6IHN5cy9uZXQv YnBmX2ppdHRlci5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9uZXQvYnBmX2ppdHRlci5jCShy ZXZpc2lvbiAyMzU3NTApCisrKyBzeXMvbmV0L2JwZl9qaXR0ZXIuYwkod29ya2luZyBjb3B5 KQpAQCAtNzEsNyArNzEsNyBAQCBicGZfaml0dGVyKHN0cnVjdCBicGZfaW5zbiAqZnAsIGlu dCBuaW5zKQogCS8qIEFsbG9jYXRlIHRoZSBmaWx0ZXIgc3RydWN0dXJlLiAqLwogI2lmZGVm IF9LRVJORUwKIAlmaWx0ZXIgPSAoc3RydWN0IGJwZl9qaXRfZmlsdGVyICopbWFsbG9jKHNp emVvZigqZmlsdGVyKSwKLQkgICAgTV9CUEZKSVQsIE1fTk9XQUlUKTsKKwkgICAgTV9CUEZK SVQsIE1fV0FJVE9LKTsKICNlbHNlCiAJZmlsdGVyID0gKHN0cnVjdCBicGZfaml0X2ZpbHRl ciAqKW1hbGxvYyhzaXplb2YoKmZpbHRlcikpOwogI2VuZGlmCg== --------------010906000107090302010705-- From owner-svn-src-head@FreeBSD.ORG Thu May 24 11:07:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9751106564A; Thu, 24 May 2012 11:07:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B16D68FC08; Thu, 24 May 2012 11:07:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OB7dZf034292; Thu, 24 May 2012 11:07:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OB7d41034281; Thu, 24 May 2012 11:07:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205241107.q4OB7d41034281@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 11:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235897 - in head: sbin/camcontrol sys/cam sys/cam/ata sys/cam/scsi sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 11:07:39 -0000 Author: mav Date: Thu May 24 11:07:39 2012 New Revision: 235897 URL: http://svn.freebsd.org/changeset/base/235897 Log: MFprojects/zfsd: - Add low-level support for SATA Enclosure Management Bridge (SEMB) devices -- SATA equivalents of the SCSI SES/SAF-TE devices. - Add some utility functions for SCSI SAF-TE devices access. Sponsored by: iXsystems, Inc. Modified: head/sbin/camcontrol/camcontrol.c head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_all.h head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt.c head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/sys/ata.h Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu May 24 11:03:03 2012 (r235896) +++ head/sbin/camcontrol/camcontrol.c Thu May 24 11:07:39 2012 (r235897) @@ -456,7 +456,7 @@ getdevtree(void) case DEV_MATCH_DEVICE: { struct device_match_result *dev_result; char vendor[16], product[48], revision[16]; - char tmpstr[256]; + char fw[5], tmpstr[256]; dev_result = &ccb.cdm.matches[i].result.device_result; @@ -495,6 +495,25 @@ getdevtree(void) sizeof(revision)); sprintf(tmpstr, "<%s %s>", product, revision); + } else if (dev_result->protocol == PROTO_SEMB) { + struct sep_identify_data *sid; + + sid = (struct sep_identify_data *) + &dev_result->ident_data; + cam_strvis(vendor, sid->vendor_id, + sizeof(sid->vendor_id), + sizeof(vendor)); + cam_strvis(product, sid->product_id, + sizeof(sid->product_id), + sizeof(product)); + cam_strvis(revision, sid->product_rev, + sizeof(sid->product_rev), + sizeof(revision)); + cam_strvis(fw, sid->firmware_rev, + sizeof(sid->firmware_rev), + sizeof(fw)); + sprintf(tmpstr, "<%s %s %s %s>", + vendor, product, revision, fw); } else { sprintf(tmpstr, "<>"); } Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/ata/ata_all.c Thu May 24 11:07:39 2012 (r235897) @@ -108,6 +108,16 @@ ata_op_string(struct ata_cmd *cmd) case 0x51: return ("CONFIGURE_STREAM"); case 0x60: return ("READ_FPDMA_QUEUED"); case 0x61: return ("WRITE_FPDMA_QUEUED"); + case 0x67: + if (cmd->features == 0xec) + return ("SEP_ATTN IDENTIFY"); + switch (cmd->lba_low) { + case 0x00: return ("SEP_ATTN READ BUFFER"); + case 0x02: return ("SEP_ATTN RECEIVE DIAGNOSTIC RESULTS"); + case 0x80: return ("SEP_ATTN WRITE BUFFER"); + case 0x82: return ("SEP_ATTN SEND DIAGNOSTIC"); + } + return ("SEP_ATTN"); case 0x70: return ("SEEK"); case 0x87: return ("CFA_TRANSLATE_SECTOR"); case 0x90: return ("EXECUTE_DEVICE_DIAGNOSTIC"); @@ -286,6 +296,21 @@ ata_print_ident(struct ata_params *ident printf(" device\n"); } +void +semb_print_ident(struct sep_identify_data *ident_data) +{ + char vendor[9], product[17], revision[5], fw[5], in[7], ins[5]; + + cam_strvis(vendor, ident_data->vendor_id, 8, sizeof(vendor)); + cam_strvis(product, ident_data->product_id, 16, sizeof(product)); + cam_strvis(revision, ident_data->product_rev, 4, sizeof(revision)); + cam_strvis(fw, ident_data->firmware_rev, 4, sizeof(fw)); + cam_strvis(in, ident_data->interface_id, 6, sizeof(in)); + cam_strvis(ins, ident_data->interface_rev, 4, sizeof(ins)); + printf("<%s %s %s %s> SEMB %s %s device\n", + vendor, product, revision, fw, in, ins); +} + uint32_t ata_logical_sector_size(struct ata_params *ident_data) { @@ -695,3 +720,86 @@ ata_static_identify_match(caddr_t identb } return (-1); } + +void +semb_receive_diagnostic_results(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, int pcv, uint8_t page_code, + uint8_t *data_ptr, uint16_t length, uint32_t timeout) +{ + + length = min(length, 1020); + length = (length + 3) & ~3; + cam_fill_ataio(ataio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + data_ptr, + length, + timeout); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, + pcv ? page_code : 0, 0x02, length / 4); +} + +void +semb_send_diagnostic(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t *data_ptr, uint16_t length, uint32_t timeout) +{ + + length = min(length, 1020); + length = (length + 3) & ~3; + cam_fill_ataio(ataio, + retries, + cbfcnp, + /*flags*/length ? CAM_DIR_OUT : CAM_DIR_NONE, + tag_action, + data_ptr, + length, + timeout); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, + length > 0 ? data_ptr[0] : 0, 0x82, length / 4); +} + +void +semb_read_buffer(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, uint8_t page_code, + uint8_t *data_ptr, uint16_t length, uint32_t timeout) +{ + + length = min(length, 1020); + length = (length + 3) & ~3; + cam_fill_ataio(ataio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + data_ptr, + length, + timeout); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, + page_code, 0x00, length / 4); +} + +void +semb_write_buffer(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t *data_ptr, uint16_t length, uint32_t timeout) +{ + + length = min(length, 1020); + length = (length + 3) & ~3; + cam_fill_ataio(ataio, + retries, + cbfcnp, + /*flags*/length ? CAM_DIR_OUT : CAM_DIR_NONE, + tag_action, + data_ptr, + length, + timeout); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, + length > 0 ? data_ptr[0] : 0, 0x80, length / 4); +} + Modified: head/sys/cam/ata/ata_all.h ============================================================================== --- head/sys/cam/ata/ata_all.h Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/ata/ata_all.h Thu May 24 11:07:39 2012 (r235897) @@ -83,6 +83,20 @@ struct ata_res { u_int8_t sector_count_exp; }; +struct sep_identify_data { + uint8_t length; /* Enclosure descriptor length */ + uint8_t subenc_id; /* Sub-enclosure identifier */ + uint8_t logical_id[8]; /* Enclosure logical identifier (WWN) */ + uint8_t vendor_id[8]; /* Vendor identification string */ + uint8_t product_id[16]; /* Product identification string */ + uint8_t product_rev[4]; /* Product revision string */ + uint8_t channel_id; /* Channel identifier */ + uint8_t firmware_rev[4];/* Firmware revision */ + uint8_t interface_id[6];/* Interface spec ("S-E-S "/"SAF-TE")*/ + uint8_t interface_rev[4];/* Interface spec revision */ + uint8_t vend_spec[11]; /* Vendor specific information */ +}; + int ata_version(int ver); char * ata_op_string(struct ata_cmd *cmd); @@ -126,4 +140,26 @@ int ata_speed2revision(u_int speed); int ata_identify_match(caddr_t identbuffer, caddr_t table_entry); int ata_static_identify_match(caddr_t identbuffer, caddr_t table_entry); +void semb_print_ident(struct sep_identify_data *ident_data); + +void semb_receive_diagnostic_results(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, int pcv, uint8_t page_code, + uint8_t *data_ptr, uint16_t allocation_length, uint32_t timeout); + +void semb_send_diagnostic(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t *data_ptr, uint16_t param_list_length, + uint32_t timeout); + +void semb_read_buffer(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, uint8_t page_code, + uint8_t *data_ptr, uint16_t allocation_length, uint32_t timeout); + +void semb_write_buffer(struct ccb_ataio *ataio, + u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t *data_ptr, uint16_t param_list_length, + uint32_t timeout); + #endif Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/ata/ata_da.c Thu May 24 11:07:39 2012 (r235897) @@ -776,6 +776,20 @@ adaasync(void *callback_arg, u_int32_t c "due to status 0x%x\n", status); break; } + case AC_ADVINFO_CHANGED: + { + uintptr_t buftype; + + buftype = (uintptr_t)arg; + if (buftype == CDAI_TYPE_PHYS_PATH) { + struct ada_softc *softc; + + softc = periph->softc; + disk_attr_changed(softc->disk, "GEOM::physpath", + M_NOWAIT); + } + break; + } case AC_SENT_BDR: case AC_BUS_RESET: { @@ -1088,8 +1102,8 @@ adaregister(struct cam_periph *periph, v * them and the only alternative would be to * not attach the device on failure. */ - xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE, - adaasync, periph, periph->path); + xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE | + AC_ADVINFO_CHANGED, adaasync, periph, periph->path); /* * Schedule a periodic event to occasionally send an Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/ata/ata_xpt.c Thu May 24 11:07:39 2012 (r235897) @@ -93,6 +93,8 @@ typedef enum { PROBE_FULL_INQUIRY, PROBE_PM_PID, PROBE_PM_PRV, + PROBE_IDENTIFY_SES, + PROBE_IDENTIFY_SAFTE, PROBE_INVALID } probe_action; @@ -110,6 +112,8 @@ static char *probe_action_text[] = { "PROBE_FULL_INQUIRY", "PROBE_PM_PID", "PROBE_PM_PRV", + "PROBE_IDENTIFY_SES", + "PROBE_IDENTIFY_SAFTE", "PROBE_INVALID" }; @@ -266,7 +270,8 @@ probeschedule(struct cam_periph *periph) ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs); if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) || - periph->path->device->protocol == PROTO_SATAPM) + periph->path->device->protocol == PROTO_SATAPM || + periph->path->device->protocol == PROTO_SEMB) PROBE_SET_ACTION(softc, PROBE_RESET); else PROBE_SET_ACTION(softc, PROBE_IDENTIFY); @@ -300,7 +305,8 @@ probestart(struct cam_periph *periph, un if (softc->restart) { softc->restart = 0; if ((path->device->flags & CAM_DEV_UNCONFIGURED) || - path->device->protocol == PROTO_SATAPM) + path->device->protocol == PROTO_SATAPM || + path->device->protocol == PROTO_SEMB) softc->action = PROBE_RESET; else softc->action = PROBE_IDENTIFY; @@ -622,6 +628,30 @@ negotiate: 10 * 1000); ata_pm_read_cmd(ataio, 1, 15); break; + case PROBE_IDENTIFY_SES: + cam_fill_ataio(ataio, + 1, + probedone, + /*flags*/CAM_DIR_IN, + 0, + /*data_ptr*/(u_int8_t *)&softc->ident_data, + /*dxfer_len*/sizeof(softc->ident_data), + 30 * 1000); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, 0xEC, 0x02, + sizeof(softc->ident_data) / 4); + break; + case PROBE_IDENTIFY_SAFTE: + cam_fill_ataio(ataio, + 1, + probedone, + /*flags*/CAM_DIR_IN, + 0, + /*data_ptr*/(u_int8_t *)&softc->ident_data, + /*dxfer_len*/sizeof(softc->ident_data), + 30 * 1000); + ata_28bit_cmd(ataio, ATA_SEP_ATTN, 0xEC, 0x00, + sizeof(softc->ident_data) / 4); + break; case PROBE_INVALID: CAM_DEBUG(path, CAM_DEBUG_INFO, ("probestart: invalid action state\n")); @@ -758,12 +788,16 @@ probedone(struct cam_periph *periph, uni { struct ccb_trans_settings cts; struct ata_params *ident_buf; + struct scsi_inquiry_data *inq_buf; probe_softc *softc; struct cam_path *path; cam_status status; u_int32_t priority; u_int caps; - int found = 1; + int changed = 1, found = 1; + static const uint8_t fake_device_id_hdr[8] = + {0, SVPD_DEVICE_ID, 0, 12, + SVPD_ID_CODESET_BINARY, SVPD_ID_TYPE_NAA, 0, 8}; CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probedone\n")); @@ -771,6 +805,7 @@ probedone(struct cam_periph *periph, uni path = done_ccb->ccb_h.path; priority = done_ccb->ccb_h.pinfo.priority; ident_buf = &path->device->ident_data; + inq_buf = &path->device->inq_data; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if (softc->restart) { @@ -819,6 +854,18 @@ probedone(struct cam_periph *periph, uni } else if (softc->action == PROBE_SETDMAAA && status == CAM_ATA_STATUS_ERROR) { goto noerror; + + /* + * SES and SAF-TE SEPs have different IDENTIFY commands, + * but SATA specification doesn't tell how to identify them. + * Until better way found, just try another if first fail. + */ + } else if (softc->action == PROBE_IDENTIFY_SES && + status == CAM_ATA_STATUS_ERROR) { + PROBE_SET_ACTION(softc, PROBE_IDENTIFY_SAFTE); + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; } /* @@ -862,6 +909,10 @@ noerror: xpt_action((union ccb *)&cts); path->device->protocol = PROTO_SATAPM; PROBE_SET_ACTION(softc, PROBE_PM_PID); + } else if (sign == 0xc33c && + done_ccb->ccb_h.target_id != 15) { + path->device->protocol = PROTO_SEMB; + PROBE_SET_ACTION(softc, PROBE_IDENTIFY_SES); } else if (sign == 0xeb14 && done_ccb->ccb_h.target_id != 15) { path->device->protocol = PROTO_SCSI; @@ -881,7 +932,6 @@ noerror: { struct ccb_pathinq cpi; int16_t *ptr; - int changed = 1; ident_buf = &softc->ident_data; for (ptr = (int16_t *)ident_buf; @@ -936,6 +986,11 @@ noerror: path->device->serial_num = NULL; path->device->serial_num_len = 0; } + if (path->device->device_id != NULL) { + free(path->device->device_id, M_CAMXPT); + path->device->device_id = NULL; + path->device->device_id_len = 0; + } path->device->serial_num = (u_int8_t *)malloc((sizeof(ident_buf->serial) + 1), M_CAMXPT, M_NOWAIT); @@ -948,6 +1003,18 @@ noerror: path->device->serial_num_len = strlen(path->device->serial_num); } + if (ident_buf->enabled.extension & + ATA_SUPPORT_64BITWWN) { + path->device->device_id = + malloc(16, M_CAMXPT, M_NOWAIT); + if (path->device->device_id != NULL) { + path->device->device_id_len = 16; + bcopy(&fake_device_id_hdr, + path->device->device_id, 8); + bcopy(ident_buf->wwn, + path->device->device_id + 8, 8); + } + } path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; } @@ -1092,11 +1159,9 @@ notsata: case PROBE_INQUIRY: case PROBE_FULL_INQUIRY: { - struct scsi_inquiry_data *inq_buf; u_int8_t periph_qual, len; path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID; - inq_buf = &path->device->inq_data; periph_qual = SID_QUAL(inq_buf); @@ -1200,6 +1265,48 @@ notsata: xpt_async(AC_SCSI_AEN, done_ccb->ccb_h.path, done_ccb); } break; + case PROBE_IDENTIFY_SES: + case PROBE_IDENTIFY_SAFTE: + if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { + /* Check that it is the same device. */ + if (bcmp(&softc->ident_data, ident_buf, 53)) { + /* Device changed. */ + xpt_async(AC_LOST_DEVICE, path, NULL); + } else { + bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); + changed = 0; + } + } + if (changed) { + bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); + /* Clean up from previous instance of this device */ + if (path->device->device_id != NULL) { + free(path->device->device_id, M_CAMXPT); + path->device->device_id = NULL; + path->device->device_id_len = 0; + } + path->device->device_id = + malloc(16, M_CAMXPT, M_NOWAIT); + if (path->device->device_id != NULL) { + path->device->device_id_len = 16; + bcopy(&fake_device_id_hdr, + path->device->device_id, 8); + bcopy(((uint8_t*)ident_buf) + 2, + path->device->device_id + 8, 8); + } + + path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; + } + + if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { + path->device->flags &= ~CAM_DEV_UNCONFIGURED; + xpt_acquire_device(path->device); + done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action(done_ccb); + xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, + done_ccb); + } + break; case PROBE_INVALID: CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_INFO, ("probedone: invalid action state\n")); @@ -1624,10 +1731,20 @@ ata_dev_advinfo(union ccb *start_ccb) device = start_ccb->ccb_h.path->device; cdai = &start_ccb->cdai; switch(cdai->buftype) { - case CDAI_TYPE_SERIAL_NUM: + case CDAI_TYPE_SCSI_DEVID: if (cdai->flags & CDAI_FLAG_STORE) + return; + cdai->provsiz = device->device_id_len; + if (device->device_id_len == 0) break; - start_ccb->ccb_h.status = CAM_REQ_CMP; + amt = device->device_id_len; + if (cdai->provsiz > cdai->bufsiz) + amt = cdai->bufsiz; + memcpy(cdai->buf, device->device_id, amt); + break; + case CDAI_TYPE_SERIAL_NUM: + if (cdai->flags & CDAI_FLAG_STORE) + return; cdai->provsiz = device->serial_num_len; if (device->serial_num_len == 0) break; @@ -1636,8 +1753,45 @@ ata_dev_advinfo(union ccb *start_ccb) amt = cdai->bufsiz; memcpy(cdai->buf, device->serial_num, amt); break; - default: + case CDAI_TYPE_PHYS_PATH: + if (cdai->flags & CDAI_FLAG_STORE) { + if (device->physpath != NULL) + free(device->physpath, M_CAMXPT); + device->physpath_len = cdai->bufsiz; + /* Clear existing buffer if zero length */ + if (cdai->bufsiz == 0) + break; + device->physpath = malloc(cdai->bufsiz, M_CAMXPT, M_NOWAIT); + if (device->physpath == NULL) { + start_ccb->ccb_h.status = CAM_REQ_ABORTED; + return; + } + memcpy(device->physpath, cdai->buf, cdai->bufsiz); + } else { + cdai->provsiz = device->physpath_len; + if (device->physpath_len == 0) + break; + amt = device->physpath_len; + if (cdai->provsiz > cdai->bufsiz) + amt = cdai->bufsiz; + memcpy(cdai->buf, device->physpath, amt); + } break; + default: + return; + } + start_ccb->ccb_h.status = CAM_REQ_CMP; + + if (cdai->flags & CDAI_FLAG_STORE) { + int owned; + + owned = mtx_owned(start_ccb->ccb_h.path->bus->sim->mtx); + if (owned == 0) + mtx_lock(start_ccb->ccb_h.path->bus->sim->mtx); + xpt_async(AC_ADVINFO_CHANGED, start_ccb->ccb_h.path, + (void *)(uintptr_t)cdai->buftype); + if (owned == 0) + mtx_unlock(start_ccb->ccb_h.path->bus->sim->mtx); } } Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/cam_ccb.h Thu May 24 11:07:39 2012 (r235897) @@ -242,6 +242,7 @@ typedef enum { PROTO_ATA, /* AT Attachment */ PROTO_ATAPI, /* AT Attachment Packetized Interface */ PROTO_SATAPM, /* SATA Port Multiplier */ + PROTO_SEMB, /* SATA Enclosure Management Bridge */ } cam_proto; typedef enum { Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/cam_xpt.c Thu May 24 11:07:39 2012 (r235897) @@ -1080,6 +1080,9 @@ xpt_announce_periph(struct cam_periph *p else if (path->device->protocol == PROTO_ATA || path->device->protocol == PROTO_SATAPM) ata_print_ident(&path->device->ident_data); + else if (path->device->protocol == PROTO_SEMB) + semb_print_ident( + (struct sep_identify_data *)&path->device->ident_data); else printf("Unknown protocol device\n"); if (bootverbose && path->device->serial_num_len > 0) { @@ -4859,7 +4862,8 @@ xpt_finishconfig_task(void *context, int * attached. For any devices like that, announce the * passthrough driver so the user will see something. */ - xpt_for_all_devices(xptpassannouncefunc, NULL); + if (!bootverbose) + xpt_for_all_devices(xptpassannouncefunc, NULL); /* Release our hook so that the boot can continue. */ config_intrhook_disestablish(xsoftc.xpt_config_hook); Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/scsi/scsi_all.c Thu May 24 11:07:39 2012 (r235897) @@ -5740,6 +5740,66 @@ scsi_send_diagnostic(struct ccb_scsiio * timeout); } +void +scsi_read_buffer(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, int mode, + uint8_t buffer_id, u_int32_t offset, + uint8_t *data_ptr, uint32_t allocation_length, + uint8_t sense_len, uint32_t timeout) +{ + struct scsi_read_buffer *scsi_cmd; + + scsi_cmd = (struct scsi_read_buffer *)&csio->cdb_io.cdb_bytes; + memset(scsi_cmd, 0, sizeof(*scsi_cmd)); + scsi_cmd->opcode = READ_BUFFER; + scsi_cmd->byte2 = mode; + scsi_cmd->buffer_id = buffer_id; + scsi_ulto3b(offset, scsi_cmd->offset); + scsi_ulto3b(allocation_length, scsi_cmd->length); + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + data_ptr, + allocation_length, + sense_len, + sizeof(*scsi_cmd), + timeout); +} + +void +scsi_write_buffer(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, int mode, + uint8_t buffer_id, u_int32_t offset, + uint8_t *data_ptr, uint32_t param_list_length, + uint8_t sense_len, uint32_t timeout) +{ + struct scsi_write_buffer *scsi_cmd; + + scsi_cmd = (struct scsi_write_buffer *)&csio->cdb_io.cdb_bytes; + memset(scsi_cmd, 0, sizeof(*scsi_cmd)); + scsi_cmd->opcode = WRITE_BUFFER; + scsi_cmd->byte2 = mode; + scsi_cmd->buffer_id = buffer_id; + scsi_ulto3b(offset, scsi_cmd->offset); + scsi_ulto3b(param_list_length, scsi_cmd->length); + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/param_list_length ? CAM_DIR_OUT : CAM_DIR_NONE, + tag_action, + data_ptr, + param_list_length, + sense_len, + sizeof(*scsi_cmd), + timeout); +} + void scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Thu May 24 11:03:03 2012 (r235896) +++ head/sys/cam/scsi/scsi_all.h Thu May 24 11:07:39 2012 (r235897) @@ -1267,6 +1267,8 @@ struct scsi_vpd_id_descriptor #define SCSI_PROTO_RDMA 0x04 #define SCSI_PROTO_iSCSI 0x05 #define SCSI_PROTO_SAS 0x06 +#define SCSI_PROTO_ADT 0x07 +#define SCSI_PROTO_ATA 0x08 #define SVPD_ID_PROTO_SHIFT 4 #define SVPD_ID_CODESET_BINARY 0x01 #define SVPD_ID_CODESET_ASCII 0x02 @@ -1400,6 +1402,13 @@ struct scsi_service_action_in uint8_t control; }; +struct scsi_diag_page { + uint8_t page_code; + uint8_t page_specific_flags; + uint8_t length[2]; + uint8_t params[0]; +}; + struct scsi_read_capacity { u_int8_t opcode; @@ -2352,6 +2361,20 @@ void scsi_send_diagnostic(struct ccb_scs uint16_t param_list_length, uint8_t sense_len, uint32_t timeout); +void scsi_read_buffer(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, int mode, + uint8_t buffer_id, u_int32_t offset, + uint8_t *data_ptr, uint32_t allocation_length, + uint8_t sense_len, uint32_t timeout); + +void scsi_write_buffer(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, int mode, + uint8_t buffer_id, u_int32_t offset, + uint8_t *data_ptr, uint32_t param_list_length, + uint8_t sense_len, uint32_t timeout); + void scsi_read_write(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int readop, u_int8_t byte2, Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Thu May 24 11:03:03 2012 (r235896) +++ head/sys/sys/ata.h Thu May 24 11:07:39 2012 (r235897) @@ -318,6 +318,7 @@ struct ata_params { #define ATA_READ_VERIFY48 0x42 #define ATA_READ_FPDMA_QUEUED 0x60 /* read DMA NCQ */ #define ATA_WRITE_FPDMA_QUEUED 0x61 /* write DMA NCQ */ +#define ATA_SEP_ATTN 0x67 /* SEP request */ #define ATA_SEEK 0x70 /* seek */ #define ATA_PACKET_CMD 0xa0 /* packet command */ #define ATA_ATAPI_IDENTIFY 0xa1 /* get ATAPI params*/ From owner-svn-src-head@FreeBSD.ORG Thu May 24 11:20:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D86AE1065670; Thu, 24 May 2012 11:20:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B92E28FC0C; Thu, 24 May 2012 11:20:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OBKprp034874; Thu, 24 May 2012 11:20:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OBKpcg034868; Thu, 24 May 2012 11:20:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205241120.q4OBKpcg034868@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 11:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235898 - in head/sys: arm/conf conf mips/conf pc98/conf sparc64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 11:20:51 -0000 Author: mav Date: Thu May 24 11:20:51 2012 New Revision: 235898 URL: http://svn.freebsd.org/changeset/base/235898 Log: MFprojects/zfsd: Generalize and unify ses device description. Modified: head/sys/arm/conf/ETHERNUT5 head/sys/conf/NOTES head/sys/mips/conf/OCTEON1 head/sys/pc98/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Thu May 24 11:07:39 2012 (r235897) +++ head/sys/arm/conf/ETHERNUT5 Thu May 24 11:20:51 2012 (r235898) @@ -141,7 +141,7 @@ device ether # Ethernet support #device sa # Sequential Access (tape etc) #device cd # CD #device pass # Passthrough device (direct ATA/SCSI access) -#device ses # SCSI Environmental Services (and SAF-TE) +#device ses # Enclosure Services (SES and SAF-TE) #device ctl # CAM Target Layer # Serial (COM) ports Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu May 24 11:07:39 2012 (r235897) +++ head/sys/conf/NOTES Thu May 24 11:20:51 2012 (r235898) @@ -1295,7 +1295,7 @@ device ch #SCSI media changers device da #SCSI direct access devices (aka disks) device sa #SCSI tapes device cd #SCSI CD-ROMs -device ses #SCSI Environmental Services (and SAF-TE) +device ses #Enclosure Services (SES and SAF-TE) device pt #SCSI processor device targ #SCSI Target Mode Code device targbh #SCSI Target Mode Blackhole Device Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Thu May 24 11:07:39 2012 (r235897) +++ head/sys/mips/conf/OCTEON1 Thu May 24 11:20:51 2012 (r235898) @@ -135,7 +135,7 @@ device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) -device ses # SCSI Environmental Services (and SAF-TE) +device ses # Enclosure Services (SES and SAF-TE) # RAID controllers interfaced to the SCSI subsystem device amr # AMI MegaRAID Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Thu May 24 11:07:39 2012 (r235897) +++ head/sys/pc98/conf/GENERIC Thu May 24 11:20:51 2012 (r235898) @@ -110,7 +110,7 @@ device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) -device ses # SCSI Environmental Services (and SAF-TE) +device ses # Enclosure Services (SES and SAF-TE) # keyboard driver device pckbd # PC98 keyboard Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Thu May 24 11:07:39 2012 (r235897) +++ head/sys/sparc64/conf/GENERIC Thu May 24 11:20:51 2012 (r235898) @@ -118,7 +118,7 @@ device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) -device ses # SCSI Environmental Services (and SAF-TE) +device ses # Enclosure Services (SES and SAF-TE) device ctl # CAM Target Layer # RAID controllers From owner-svn-src-head@FreeBSD.ORG Thu May 24 11:24:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 669981065673; Thu, 24 May 2012 11:24:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51E3A8FC0A; Thu, 24 May 2012 11:24:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OBOjQA035074; Thu, 24 May 2012 11:24:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OBOj1A035072; Thu, 24 May 2012 11:24:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205241124.q4OBOj1A035072@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 11:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235899 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 11:24:45 -0000 Author: mav Date: Thu May 24 11:24:44 2012 New Revision: 235899 URL: http://svn.freebsd.org/changeset/base/235899 Log: MFprojects/zfsd: Hide warning behind bootverbose. Average user has nothing to do about it. Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Thu May 24 11:20:51 2012 (r235898) +++ head/sys/kern/kern_conf.c Thu May 24 11:24:44 2012 (r235899) @@ -993,9 +993,10 @@ make_dev_physpath_alias(int flags, struc max_parentpath_len = SPECNAMELEN - physpath_len - /*/*/1; parentpath_len = strlen(pdev->si_name); if (max_parentpath_len < parentpath_len) { - printf("make_dev_physpath_alias: WARNING - Unable to alias %s " - "to %s/%s - path too long\n", - pdev->si_name, physpath, pdev->si_name); + if (bootverbose) + printf("WARNING: Unable to alias %s " + "to %s/%s - path too long\n", + pdev->si_name, physpath, pdev->si_name); ret = ENAMETOOLONG; goto out; } From owner-svn-src-head@FreeBSD.ORG Thu May 24 11:52:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E68BA1065673; Thu, 24 May 2012 11:52:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1D488FC1D; Thu, 24 May 2012 11:52:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OBqvev036454; Thu, 24 May 2012 11:52:57 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OBqvUi036452; Thu, 24 May 2012 11:52:57 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205241152.q4OBqvUi036452@svn.freebsd.org> From: Michael Tuexen Date: Thu, 24 May 2012 11:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235903 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 11:52:58 -0000 Author: tuexen Date: Thu May 24 11:52:57 2012 New Revision: 235903 URL: http://svn.freebsd.org/changeset/base/235903 Log: Add sn_send_failed_event to sctp_notification. MFC after: 3 days Modified: head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Thu May 24 11:50:14 2012 (r235902) +++ head/sys/netinet/sctp_uio.h Thu May 24 11:52:57 2012 (r235903) @@ -523,10 +523,10 @@ union sctp_notification { struct sctp_pdapi_event sn_pdapi_event; struct sctp_authkey_event sn_auth_event; struct sctp_sender_dry_event sn_sender_dry_event; + struct sctp_send_failed_event sn_send_failed_event; struct sctp_stream_reset_event sn_strreset_event; struct sctp_assoc_reset_event sn_assocreset_event; struct sctp_stream_change_event sn_strchange_event; - }; /* notification types */ From owner-svn-src-head@FreeBSD.ORG Thu May 24 12:38:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E15651065679; Thu, 24 May 2012 12:38:24 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBDE08FC18; Thu, 24 May 2012 12:38:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OCcOkS038495; Thu, 24 May 2012 12:38:24 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OCcOqR038493; Thu, 24 May 2012 12:38:24 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205241238.q4OCcOqR038493@svn.freebsd.org> From: Grzegorz Bernacki Date: Thu, 24 May 2012 12:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235907 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 12:38:25 -0000 Author: gber Date: Thu May 24 12:38:24 2012 New Revision: 235907 URL: http://svn.freebsd.org/changeset/base/235907 Log: ARMs don't have motherboards. Obtained from: Semihalf Modified: head/sys/arm/arm/nexus.c Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Thu May 24 12:28:11 2012 (r235906) +++ head/sys/arm/arm/nexus.c Thu May 24 12:38:24 2012 (r235907) @@ -160,7 +160,7 @@ nexus_print_child(device_t bus, device_t int retval = 0; retval += bus_print_child_header(bus, child); - retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */ + retval += printf("\n"); return (retval); } From owner-svn-src-head@FreeBSD.ORG Thu May 24 12:41:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FF9D106566C; Thu, 24 May 2012 12:41:57 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A2948FC0A; Thu, 24 May 2012 12:41:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OCfvch038661; Thu, 24 May 2012 12:41:57 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OCfvKa038659; Thu, 24 May 2012 12:41:57 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205241241.q4OCfvKa038659@svn.freebsd.org> From: Grzegorz Bernacki Date: Thu, 24 May 2012 12:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235908 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 12:41:57 -0000 Author: gber Date: Thu May 24 12:41:57 2012 New Revision: 235908 URL: http://svn.freebsd.org/changeset/base/235908 Log: Return Supervisor SP and LR registers instead of User ones while in KDB thread. Obtained from: Semihalf Modified: head/sys/arm/arm/gdb_machdep.c Modified: head/sys/arm/arm/gdb_machdep.c ============================================================================== --- head/sys/arm/arm/gdb_machdep.c Thu May 24 12:38:24 2012 (r235907) +++ head/sys/arm/arm/gdb_machdep.c Thu May 24 12:41:57 2012 (r235908) @@ -54,8 +54,12 @@ gdb_cpu_getreg(int regnum, size_t *regsz *regsz = gdb_cpu_regsz(regnum); if (kdb_thread == curthread) { - if (regnum < 15) + if (regnum < 13) return (&kdb_frame->tf_r0 + regnum); + if (regnum == 13) + return (&kdb_frame->tf_svc_sp); + if (regnum == 14) + return (&kdb_frame->tf_svc_lr); if (regnum == 15) return (&kdb_frame->tf_pc); if (regnum == 25) From owner-svn-src-head@FreeBSD.ORG Thu May 24 14:07:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B21891065799; Thu, 24 May 2012 14:07:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98FFF8FC12; Thu, 24 May 2012 14:07:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OE7iJI042327; Thu, 24 May 2012 14:07:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OE7i47042313; Thu, 24 May 2012 14:07:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205241407.q4OE7i47042313@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 14:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235911 - in head: share/examples/ses share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 14:07:44 -0000 Author: mav Date: Thu May 24 14:07:44 2012 New Revision: 235911 URL: http://svn.freebsd.org/changeset/base/235911 Log: MFprojects/zfsd: Revamp the CAM enclosure services driver. This updated driver uses an in-kernel daemon to track state changes and publishes physical path location information\for disk elements into the CAM device database. Sponsored by: Spectra Logic Corporation Sponsored by: iXsystems, Inc. Submitted by: gibbs, will, mav Added: head/sys/cam/scsi/scsi_enc.c (contents, props changed) head/sys/cam/scsi/scsi_enc.h (contents, props changed) head/sys/cam/scsi/scsi_enc_internal.h (contents, props changed) head/sys/cam/scsi/scsi_enc_safte.c (contents, props changed) head/sys/cam/scsi/scsi_enc_ses.c (contents, props changed) Deleted: head/sys/cam/scsi/scsi_ses.c Modified: head/share/examples/ses/Makefile.inc head/share/examples/ses/srcs/eltsub.c head/share/examples/ses/srcs/getencstat.c head/share/examples/ses/srcs/getnobj.c head/share/examples/ses/srcs/getobjmap.c head/share/examples/ses/srcs/getobjstat.c head/share/examples/ses/srcs/inienc.c head/share/examples/ses/srcs/sesd.c head/share/examples/ses/srcs/setencstat.c head/share/examples/ses/srcs/setobjstat.c head/sys/cam/scsi/scsi_ses.h head/sys/conf/files head/sys/fs/devfs/devfs_vnops.c head/sys/modules/cam/Makefile head/usr.bin/kdump/mkioctls Modified: head/share/examples/ses/Makefile.inc ============================================================================== --- head/share/examples/ses/Makefile.inc Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/Makefile.inc Thu May 24 14:07:44 2012 (r235911) @@ -32,7 +32,6 @@ # mjacob@feral.com # -CFLAGS+= -I/usr/include/cam/scsi -DSESINC="" BINDIR?= /usr/sbin CLEANFILES+= ${MAN} Modified: head/share/examples/ses/srcs/eltsub.c ============================================================================== --- head/share/examples/ses/srcs/eltsub.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/eltsub.c Thu May 24 14:07:44 2012 (r235911) @@ -33,10 +33,13 @@ */ #include +#include +#include #include #include #include -#include SESINC +#include +#include #include "eltsub.h" @@ -46,79 +49,82 @@ geteltnm(int type) static char rbuf[132]; switch (type) { - case SESTYP_UNSPECIFIED: + case ELMTYP_UNSPECIFIED: sprintf(rbuf, "Unspecified"); break; - case SESTYP_DEVICE: - sprintf(rbuf, "Device"); + case ELMTYP_DEVICE: + sprintf(rbuf, "Device Slot"); break; - case SESTYP_POWER: - sprintf(rbuf, "Power supply"); + case ELMTYP_POWER: + sprintf(rbuf, "Power Supply"); break; - case SESTYP_FAN: - sprintf(rbuf, "Cooling element"); + case ELMTYP_FAN: + sprintf(rbuf, "Cooling"); break; - case SESTYP_THERM: - sprintf(rbuf, "Temperature sensors"); + case ELMTYP_THERM: + sprintf(rbuf, "Temperature Sensors"); break; - case SESTYP_DOORLOCK: + case ELMTYP_DOORLOCK: sprintf(rbuf, "Door Lock"); break; - case SESTYP_ALARM: + case ELMTYP_ALARM: sprintf(rbuf, "Audible alarm"); break; - case SESTYP_ESCC: - sprintf(rbuf, "Enclosure services controller electronics"); + case ELMTYP_ESCC: + sprintf(rbuf, "Enclosure Eervices Controller Electronics"); break; - case SESTYP_SCC: - sprintf(rbuf, "SCC controller electronics"); + case ELMTYP_SCC: + sprintf(rbuf, "SCC Controller Electronics"); break; - case SESTYP_NVRAM: - sprintf(rbuf, "Nonvolatile cache"); + case ELMTYP_NVRAM: + sprintf(rbuf, "Nonvolatile Cache"); break; - case SESTYP_UPS: - sprintf(rbuf, "Uninterruptible power supply"); + case ELMTYP_INV_OP_REASON: + sprintf(rbuf, "Invalid Operation Reason"); break; - case SESTYP_DISPLAY: + case ELMTYP_UPS: + sprintf(rbuf, "Uninterruptible Power Supply"); + break; + case ELMTYP_DISPLAY: sprintf(rbuf, "Display"); break; - case SESTYP_KEYPAD: - sprintf(rbuf, "Key pad entry device"); + case ELMTYP_KEYPAD: + sprintf(rbuf, "Key Pad Entry"); break; - case SESTYP_ENCLOSURE: + case ELMTYP_ENCLOSURE: sprintf(rbuf, "Enclosure"); break; - case SESTYP_SCSIXVR: - sprintf(rbuf, "SCSI port/transceiver"); + case ELMTYP_SCSIXVR: + sprintf(rbuf, "SCSI Port/Transceiver"); break; - case SESTYP_LANGUAGE: + case ELMTYP_LANGUAGE: sprintf(rbuf, "Language"); break; - case SESTYP_COMPORT: + case ELMTYP_COMPORT: sprintf(rbuf, "Communication Port"); break; - case SESTYP_VOM: + case ELMTYP_VOM: sprintf(rbuf, "Voltage Sensor"); break; - case SESTYP_AMMETER: + case ELMTYP_AMMETER: sprintf(rbuf, "Current Sensor"); break; - case SESTYP_SCSI_TGT: - sprintf(rbuf, "SCSI target port"); + case ELMTYP_SCSI_TGT: + sprintf(rbuf, "SCSI Target Port"); break; - case SESTYP_SCSI_INI: - sprintf(rbuf, "SCSI initiator port"); + case ELMTYP_SCSI_INI: + sprintf(rbuf, "SCSI Initiator Port"); break; - case SESTYP_SUBENC: - sprintf(rbuf, "Simple sub-enclosure"); + case ELMTYP_SUBENC: + sprintf(rbuf, "Simple Subenclosure"); break; - case SESTYP_ARRAY: - sprintf(rbuf, "Array device"); + case ELMTYP_ARRAY_DEV: + sprintf(rbuf, "Array Device Slot"); break; - case SESTYP_SASEXPANDER: + case ELMTYP_SAS_EXP: sprintf(rbuf, "SAS Expander"); break; - case SESTYP_SASCONNECTOR: + case ELMTYP_SAS_CONN: sprintf(rbuf, "SAS Connector"); break; default: @@ -134,31 +140,34 @@ scode2ascii(u_char code) static char rbuf[32]; switch (code & 0xf) { case SES_OBJSTAT_UNSUPPORTED: - sprintf(rbuf, "status not supported"); + sprintf(rbuf, "Unsupported"); break; case SES_OBJSTAT_OK: - sprintf(rbuf, "ok"); + sprintf(rbuf, "OK"); break; case SES_OBJSTAT_CRIT: - sprintf(rbuf, "critical"); + sprintf(rbuf, "Critical"); break; case SES_OBJSTAT_NONCRIT: - sprintf(rbuf, "non-critical"); + sprintf(rbuf, "Noncritical"); break; case SES_OBJSTAT_UNRECOV: - sprintf(rbuf, "unrecoverable"); + sprintf(rbuf, "Unrecoverable"); break; case SES_OBJSTAT_NOTINSTALLED: - sprintf(rbuf, "not installed"); + sprintf(rbuf, "Not Installed"); break; case SES_OBJSTAT_UNKNOWN: - sprintf(rbuf, "unknown status"); + sprintf(rbuf, "Unknown"); break; case SES_OBJSTAT_NOTAVAIL: - sprintf(rbuf, "status not available"); + sprintf(rbuf, "Not Available"); + break; + case SES_OBJSTAT_NOACCESS: + sprintf(rbuf, "No Access Allowed"); break; default: - sprintf(rbuf, "unknown status code %x", code & 0xf); + sprintf(rbuf, "", code & 0xf); break; } return (rbuf); @@ -171,7 +180,7 @@ stat2ascii(int eletype __unused, u_char static char ebuf[256], *scode; scode = scode2ascii(cstat[0]); - sprintf(ebuf, "Status=%s (bytes=0x%02x 0x%02x 0x%02x 0x%02x)", + sprintf(ebuf, "status: %s (0x%02x 0x%02x 0x%02x 0x%02x)", scode, cstat[0], cstat[1], cstat[2], cstat[3]); return (ebuf); } Modified: head/share/examples/ses/srcs/getencstat.c ============================================================================== --- head/share/examples/ses/srcs/getencstat.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/getencstat.c Thu May 24 14:07:44 2012 (r235911) @@ -33,20 +33,25 @@ */ #include +#include +#include #include #include #include #include #include -#include SESINC +#include +#include #include "eltsub.h" int main(int a, char **v) { - ses_object *objp; - ses_objstat ob; + encioc_element_t *objp; + encioc_elm_status_t ob; + encioc_elm_desc_t objd; + encioc_elm_devnames_t objdn; int fd, nobj, f, i, verbose, quiet, errors; u_char estat; @@ -73,13 +78,13 @@ main(int a, char **v) perror(*v); continue; } - if (ioctl(fd, SESIOC_GETNOBJ, (caddr_t) &nobj) < 0) { - perror("SESIOC_GETNOBJ"); + if (ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj) < 0) { + perror("ENCIOC_GETNELM"); (void) close(fd); continue; } - if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &estat) < 0) { - perror("SESIOC_GETENCSTAT"); + if (ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &estat) < 0) { + perror("ENCIOC_GETENCSTAT"); (void) close(fd); continue; } @@ -113,38 +118,64 @@ main(int a, char **v) } } fprintf(stdout, ">\n"); - objp = calloc(nobj, sizeof (ses_object)); + objp = calloc(nobj, sizeof (encioc_element_t)); if (objp == NULL) { perror("calloc"); (void) close(fd); continue; } - if (ioctl(fd, SESIOC_GETOBJMAP, (caddr_t) objp) < 0) { - perror("SESIOC_GETOBJMAP"); + if (ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) objp) < 0) { + perror("ENCIOC_GETELMMAP"); (void) close(fd); continue; } for (i = 0; i < nobj; i++) { - ob.obj_id = objp[i].obj_id; - if (ioctl(fd, SESIOC_GETOBJSTAT, (caddr_t) &ob) < 0) { - perror("SESIOC_GETOBJSTAT"); + ob.elm_idx = objp[i].elm_idx; + if (ioctl(fd, ENCIOC_GETELMSTAT, (caddr_t) &ob) < 0) { + perror("ENCIOC_GETELMSTAT"); (void) close(fd); break; } - if ((ob.cstat[0] & 0xf) == SES_OBJSTAT_OK) { - if (verbose) { - fprintf(stdout, - "Element 0x%x: %s OK (%s)\n", - ob.obj_id, - geteltnm(objp[i].object_type), - stat2ascii(objp[i].object_type, - ob.cstat)); - } + bzero(&objd, sizeof(objd)); + objd.elm_idx = objp[i].elm_idx; + objd.elm_desc_len = UINT16_MAX; + objd.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); + if (objd.elm_desc_str == NULL) { + perror("calloc"); + (void) close(fd); continue; } - fprintf(stdout, "Element 0x%x: %s, %s\n", - ob.obj_id, geteltnm(objp[i].object_type), - stat2ascii(objp[i].object_type, ob.cstat)); + if (ioctl(fd, ENCIOC_GETELMDESC, (caddr_t)&objd) < 0) { + perror("ENCIOC_GETELMDESC"); + (void) close(fd); + break; + } + bzero(&objdn, sizeof(objdn)); + objdn.elm_idx = objp[i].elm_idx; + objdn.elm_names_size = 128; + objdn.elm_devnames = calloc(128, sizeof(char)); + if (objdn.elm_devnames == NULL) { + perror("calloc"); + (void) close(fd); + break; + } + /* + * This ioctl isn't critical and has a good chance + * of returning -1. + */ + (void)ioctl(fd, ENCIOC_GETELMDEVNAMES, (caddr_t)&objdn); + fprintf(stdout, "Element 0x%x: %s", ob.elm_idx, + geteltnm(objp[i].elm_type)); + fprintf(stdout, ", %s", + stat2ascii(objp[i].elm_type, ob.cstat)); + if (objd.elm_desc_len > 0) + fprintf(stdout, ", descriptor: '%s'", + objd.elm_desc_str); + if (objdn.elm_names_len > 0) + fprintf(stdout, ", dev: '%s'", + objdn.elm_devnames); + fprintf(stdout, "\n"); + free(objdn.elm_devnames); } free(objp); (void) close(fd); Modified: head/share/examples/ses/srcs/getnobj.c ============================================================================== --- head/share/examples/ses/srcs/getnobj.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/getnobj.c Thu May 24 14:07:44 2012 (r235911) @@ -33,12 +33,15 @@ */ #include +#include +#include #include #include #include #include #include -#include SESINC +#include +#include int main(int argc, char **argv) Modified: head/share/examples/ses/srcs/getobjmap.c ============================================================================== --- head/share/examples/ses/srcs/getobjmap.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/getobjmap.c Thu May 24 14:07:44 2012 (r235911) @@ -33,11 +33,14 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include #include "eltsub.h" Modified: head/share/examples/ses/srcs/getobjstat.c ============================================================================== --- head/share/examples/ses/srcs/getobjstat.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/getobjstat.c Thu May 24 14:07:44 2012 (r235911) @@ -32,11 +32,14 @@ * mjacob@feral.com */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) Modified: head/share/examples/ses/srcs/inienc.c ============================================================================== --- head/share/examples/ses/srcs/inienc.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/inienc.c Thu May 24 14:07:44 2012 (r235911) @@ -33,11 +33,14 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) Modified: head/share/examples/ses/srcs/sesd.c ============================================================================== --- head/share/examples/ses/srcs/sesd.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/sesd.c Thu May 24 14:07:44 2012 (r235911) @@ -32,6 +32,8 @@ * mjacob@feral.com */ #include +#include +#include #include #include #include @@ -39,7 +41,8 @@ #include #include #include -#include SESINC +#include +#include #define ALLSTAT (SES_ENCSTAT_UNRECOV | SES_ENCSTAT_CRITICAL | \ SES_ENCSTAT_NONCRITICAL | SES_ENCSTAT_INFO) @@ -54,7 +57,7 @@ main(int a, char **v) static const char *usage = "usage: %s [ -d ] [ -t pollinterval ] device [ device ]\n"; int fd, polltime, dev, devbase, nodaemon; - ses_encstat stat, *carray; + encioc_enc_status_t stat, *carray; if (a < 2) { fprintf(stderr, usage, *v); @@ -83,7 +86,7 @@ main(int a, char **v) return (1); } for (dev = devbase; dev < a; dev++) - carray[dev] = (ses_encstat) -1; + carray[dev] = (encioc_enc_status_t) -1; /* * Check to make sure we can open all devices @@ -94,8 +97,8 @@ main(int a, char **v) perror(v[dev]); return (1); } - if (ioctl(fd, SESIOC_INIT, NULL) < 0) { - fprintf(stderr, "%s: SESIOC_INIT fails- %s\n", + if (ioctl(fd, ENCIOC_INIT, NULL) < 0) { + fprintf(stderr, "%s: ENCIOC_INIT fails- %s\n", v[dev], strerror(errno)); return (1); } @@ -122,9 +125,9 @@ main(int a, char **v) /* * Get the actual current enclosure status. */ - if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &stat) < 0) { + if (ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &stat) < 0) { syslog(LOG_ERR, - "%s: SESIOC_GETENCSTAT- %m", v[dev]); + "%s: ENCIOC_GETENCSTAT- %m", v[dev]); (void) close(fd); continue; } Modified: head/share/examples/ses/srcs/setencstat.c ============================================================================== --- head/share/examples/ses/srcs/setencstat.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/setencstat.c Thu May 24 14:07:44 2012 (r235911) @@ -33,18 +33,21 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) { int fd; long val; - ses_encstat stat; + encioc_enc_status_t stat; if (a != 3) { fprintf(stderr, "usage: %s device enclosure_status\n", *v); @@ -57,9 +60,9 @@ main(int a, char **v) } val = strtol(v[2], NULL, 0); - stat = (ses_encstat) val; - if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &stat) < 0) { - perror("SESIOC_SETENCSTAT"); + stat = (encioc_enc_status_t)val; + if (ioctl(fd, ENCIOC_SETENCSTAT, (caddr_t) &stat) < 0) { + perror("ENCIOC_SETENCSTAT"); } (void) close(fd); return (0); Modified: head/share/examples/ses/srcs/setobjstat.c ============================================================================== --- head/share/examples/ses/srcs/setobjstat.c Thu May 24 13:15:15 2012 (r235910) +++ head/share/examples/ses/srcs/setobjstat.c Thu May 24 14:07:44 2012 (r235911) @@ -33,18 +33,21 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) { int fd; int i; - ses_objstat obj; + encioc_elm_status_t obj; long cvt; char *x; @@ -64,7 +67,7 @@ usage: if (x == v[2]) { goto usage; } - obj.obj_id = cvt; + obj.elm_idx = cvt; for (i = 0; i < 4; i++) { x = v[3 + i]; cvt = strtol(v[3 + i], &x, 0); @@ -73,8 +76,8 @@ usage: } obj.cstat[i] = cvt; } - if (ioctl(fd, SESIOC_SETOBJSTAT, (caddr_t) &obj) < 0) { - perror("SESIOC_SETOBJSTAT"); + if (ioctl(fd, ENCIOC_SETELMSTAT, (caddr_t) &obj) < 0) { + perror("ENCIOC_SETELMSTAT"); } (void) close(fd); return (0); Added: head/sys/cam/scsi/scsi_enc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cam/scsi/scsi_enc.c Thu May 24 14:07:44 2012 (r235911) @@ -0,0 +1,1011 @@ +/*- + * Copyright (c) 2000 Matthew Jacob + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +MALLOC_DEFINE(M_SCSIENC, "SCSI ENC", "SCSI ENC buffers"); + +/* Enclosure type independent driver */ + +#define SEN_ID "UNISYS SUN_SEN" +#define SEN_ID_LEN 24 + +static d_open_t enc_open; +static d_close_t enc_close; +static d_ioctl_t enc_ioctl; +static periph_init_t enc_init; +static periph_ctor_t enc_ctor; +static periph_oninv_t enc_oninvalidate; +static periph_dtor_t enc_dtor; +static periph_start_t enc_start; + +static void enc_async(void *, uint32_t, struct cam_path *, void *); +static enctyp enc_type(struct ccb_getdev *); + +SYSCTL_NODE(_kern_cam, OID_AUTO, enc, CTLFLAG_RD, 0, + "CAM Enclosure Services driver"); + +static struct periph_driver encdriver = { + enc_init, "ses", + TAILQ_HEAD_INITIALIZER(encdriver.units), /* generation */ 0 +}; + +PERIPHDRIVER_DECLARE(enc, encdriver); + +static struct cdevsw enc_cdevsw = { + .d_version = D_VERSION, + .d_open = enc_open, + .d_close = enc_close, + .d_ioctl = enc_ioctl, + .d_name = "ses", + .d_flags = 0, +}; + +static void +enc_init(void) +{ + cam_status status; + + /* + * Install a global async callback. This callback will + * receive async callbacks like "new device found". + */ + status = xpt_register_async(AC_FOUND_DEVICE, enc_async, NULL, NULL); + + if (status != CAM_REQ_CMP) { + printf("enc: Failed to attach master async callback " + "due to status 0x%x!\n", status); + } +} + +static void +enc_oninvalidate(struct cam_periph *periph) +{ + struct enc_softc *enc; + + enc = periph->softc; + + enc->enc_flags |= ENC_FLAG_INVALID; + + /* If the sub-driver has an invalidate routine, call it */ + if (enc->enc_vec.softc_invalidate != NULL) + enc->enc_vec.softc_invalidate(enc); + + /* + * Unregister any async callbacks. + */ + xpt_register_async(0, enc_async, periph, periph->path); + + /* + * Shutdown our daemon. + */ + enc->enc_flags |= ENC_FLAG_SHUTDOWN; + if (enc->enc_daemon != NULL) { + /* Signal and wait for the ses daemon to terminate. */ + wakeup(enc->enc_daemon); + /* + * We're called with the SIM mutex held, but we're dropping + * the update mutex here on sleep. So we have to manually + * drop the SIM mutex. + */ + cam_periph_sleep(enc->periph, enc->enc_daemon, + PUSER, "thtrm", 0); + } + callout_drain(&enc->status_updater); + + xpt_print(periph->path, "lost device\n"); +} + +static void +enc_dtor(struct cam_periph *periph) +{ + struct enc_softc *enc; + + enc = periph->softc; + + xpt_print(periph->path, "removing device entry\n"); + cam_periph_unlock(periph); + destroy_dev(enc->enc_dev); + cam_periph_lock(periph); + + /* If the sub-driver has a cleanup routine, call it */ + if (enc->enc_vec.softc_cleanup != NULL) + enc->enc_vec.softc_cleanup(enc); + + if (enc->enc_boot_hold_ch.ich_func != NULL) { + config_intrhook_disestablish(&enc->enc_boot_hold_ch); + enc->enc_boot_hold_ch.ich_func = NULL; + } + + ENC_FREE(enc); +} + +static void +enc_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg) +{ + struct cam_periph *periph; + + periph = (struct cam_periph *)callback_arg; + + switch(code) { + case AC_FOUND_DEVICE: + { + struct ccb_getdev *cgd; + cam_status status; + path_id_t path_id; + + cgd = (struct ccb_getdev *)arg; + if (arg == NULL) { + break; + } + + if (enc_type(cgd) == ENC_NONE) { + /* + * Schedule announcement of the ENC bindings for + * this device if it is managed by a SEP. + */ + path_id = xpt_path_path_id(path); + xpt_lock_buses(); + TAILQ_FOREACH(periph, &encdriver.units, unit_links) { + struct enc_softc *softc; + + softc = (struct enc_softc *)periph->softc; + if (xpt_path_path_id(periph->path) != path_id + || softc == NULL + || (softc->enc_flags & ENC_FLAG_INITIALIZED) + == 0 + || softc->enc_vec.device_found == NULL) + continue; + + softc->enc_vec.device_found(softc); + } + xpt_unlock_buses(); + return; + } + + status = cam_periph_alloc(enc_ctor, enc_oninvalidate, + enc_dtor, enc_start, "ses", CAM_PERIPH_BIO, + cgd->ccb_h.path, enc_async, AC_FOUND_DEVICE, cgd); + + if (status != CAM_REQ_CMP && status != CAM_REQ_INPROG) { + printf("enc_async: Unable to probe new device due to " + "status 0x%x\n", status); + } + break; + } + default: + cam_periph_async(periph, code, path, arg); + break; + } +} + +static int +enc_open(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + struct cam_periph *periph; + struct enc_softc *softc; + int error = 0; + + periph = (struct cam_periph *)dev->si_drv1; + if (periph == NULL) { + return (ENXIO); + } + + if (cam_periph_acquire(periph) != CAM_REQ_CMP) + return (ENXIO); + + cam_periph_lock(periph); + + softc = (struct enc_softc *)periph->softc; + + if ((softc->enc_flags & ENC_FLAG_INITIALIZED) == 0) { + error = ENXIO; + goto out; + } + if (softc->enc_flags & ENC_FLAG_INVALID) { + error = ENXIO; + goto out; + } + +out: + cam_periph_unlock(periph); + if (error) { + cam_periph_release(periph); + } + return (error); +} + +static int +enc_close(struct cdev *dev, int flag, int fmt, struct thread *td) +{ + struct cam_periph *periph; + struct enc_softc *softc; + + periph = (struct cam_periph *)dev->si_drv1; + if (periph == NULL) + return (ENXIO); + + cam_periph_lock(periph); + + softc = (struct enc_softc *)periph->softc; + + cam_periph_unlock(periph); + cam_periph_release(periph); + + return (0); +} + +static void +enc_start(struct cam_periph *p, union ccb *sccb) +{ + struct enc_softc *enc; + + enc = p->softc; + ENC_DLOG(enc, "%s enter imm=%d prio=%d\n", + __func__, p->immediate_priority, p->pinfo.priority); + if (p->immediate_priority <= p->pinfo.priority) { + SLIST_INSERT_HEAD(&p->ccb_list, &sccb->ccb_h, periph_links.sle); + p->immediate_priority = CAM_PRIORITY_NONE; + wakeup(&p->ccb_list); + } else + xpt_release_ccb(sccb); + ENC_DLOG(enc, "%s exit\n", __func__); +} + +void +enc_done(struct cam_periph *periph, union ccb *dccb) +{ + wakeup(&dccb->ccb_h.cbfcnp); +} + +int +enc_error(union ccb *ccb, uint32_t cflags, uint32_t sflags) +{ + struct enc_softc *softc; + struct cam_periph *periph; + + periph = xpt_path_periph(ccb->ccb_h.path); + softc = (struct enc_softc *)periph->softc; + + return (cam_periph_error(ccb, cflags, sflags, &softc->saved_ccb)); +} + +static int +enc_ioctl(struct cdev *dev, u_long cmd, caddr_t arg_addr, int flag, + struct thread *td) +{ + struct cam_periph *periph; + encioc_enc_status_t tmp; + encioc_string_t sstr; + encioc_elm_status_t elms; + encioc_elm_desc_t elmd; + encioc_elm_devnames_t elmdn; + encioc_element_t *uelm; + enc_softc_t *enc; + enc_cache_t *cache; + void *addr; + int error, i; + + + if (arg_addr) + addr = *((caddr_t *) arg_addr); + else + addr = NULL; + + periph = (struct cam_periph *)dev->si_drv1; + if (periph == NULL) + return (ENXIO); + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering encioctl\n")); + + cam_periph_lock(periph); + enc = (struct enc_softc *)periph->softc; + cache = &enc->enc_cache; + + /* + * Now check to see whether we're initialized or not. + * This actually should never fail as we're not supposed + * to get past enc_open w/o successfully initializing + * things. + */ + if ((enc->enc_flags & ENC_FLAG_INITIALIZED) == 0) { + cam_periph_unlock(periph); + return (ENXIO); + } + cam_periph_unlock(periph); + + error = 0; + + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, + ("trying to do ioctl %#lx\n", cmd)); + + /* + * If this command can change the device's state, + * we must have the device open for writing. + * + * For commands that get information about the + * device- we don't need to lock the peripheral + * if we aren't running a command. The periph + * also can't go away while a user process has + * it open. + */ + switch (cmd) { + case ENCIOC_GETNELM: + case ENCIOC_GETELMMAP: + case ENCIOC_GETENCSTAT: + case ENCIOC_GETELMSTAT: + case ENCIOC_GETELMDESC: + case ENCIOC_GETELMDEVNAMES: + break; + default: + if ((flag & FWRITE) == 0) { + return (EBADF); + } + } + + /* + * XXX The values read here are only valid for the current + * configuration generation. We need these ioctls + * to also pass in/out a generation number. + */ + sx_slock(&enc->enc_cache_lock); + switch (cmd) { + case ENCIOC_GETNELM: + error = copyout(&cache->nelms, addr, sizeof (cache->nelms)); + break; + + case ENCIOC_GETELMMAP: + for (uelm = addr, i = 0; i != cache->nelms; i++) { + encioc_element_t kelm; + kelm.elm_idx = i; + kelm.elm_subenc_id = cache->elm_map[i].subenclosure; + kelm.elm_type = cache->elm_map[i].enctype; + error = copyout(&kelm, &uelm[i], sizeof(kelm)); + if (error) + break; + } + break; + + case ENCIOC_GETENCSTAT: + cam_periph_lock(periph); + error = enc->enc_vec.get_enc_status(enc, 1); + if (error) { + cam_periph_unlock(periph); + break; + } + tmp = cache->enc_status; + cam_periph_unlock(periph); + error = copyout(&tmp, addr, sizeof(tmp)); + cache->enc_status = tmp; + break; + + case ENCIOC_SETENCSTAT: + error = copyin(addr, &tmp, sizeof(tmp)); + if (error) + break; + cam_periph_lock(periph); + error = enc->enc_vec.set_enc_status(enc, tmp, 1); + cam_periph_unlock(periph); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 24 14:32:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 201AB106566B; Thu, 24 May 2012 14:32:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id ACB228FC08; Thu, 24 May 2012 14:32:40 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4OEWXZ8016088; Thu, 24 May 2012 17:32:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4OEWWC3065727; Thu, 24 May 2012 17:32:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4OEWWIu065726; Thu, 24 May 2012 17:32:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 May 2012 17:32:32 +0300 From: Konstantin Belousov To: Alexander Motin Message-ID: <20120524143232.GM2358@deviant.kiev.zoral.com.ua> References: <201205241407.q4OE7i47042313@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3ALZ8E19BIoSIFJn" Content-Disposition: inline In-Reply-To: <201205241407.q4OE7i47042313@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235911 - in head: share/examples/ses share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 14:32:41 -0000 --3ALZ8E19BIoSIFJn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 24, 2012 at 02:07:44PM +0000, Alexander Motin wrote: > Author: mav > Date: Thu May 24 14:07:44 2012 > New Revision: 235911 > URL: http://svn.freebsd.org/changeset/base/235911 >=20 > Log: > MFprojects/zfsd: > Revamp the CAM enclosure services driver. > This updated driver uses an in-kernel daemon to track state changes and > publishes physical path location information\for disk elements into the > CAM device database. > =20 > Sponsored by: Spectra Logic Corporation > Sponsored by: iXsystems, Inc. > Submitted by: gibbs, will, mav >=20 > Added: > head/sys/cam/scsi/scsi_enc.c (contents, props changed) > head/sys/cam/scsi/scsi_enc.h (contents, props changed) > head/sys/cam/scsi/scsi_enc_internal.h (contents, props changed) > head/sys/cam/scsi/scsi_enc_safte.c (contents, props changed) > head/sys/cam/scsi/scsi_enc_ses.c (contents, props changed) > Deleted: > head/sys/cam/scsi/scsi_ses.c > Modified: > head/share/examples/ses/Makefile.inc > head/share/examples/ses/srcs/eltsub.c > head/share/examples/ses/srcs/getencstat.c > head/share/examples/ses/srcs/getnobj.c > head/share/examples/ses/srcs/getobjmap.c > head/share/examples/ses/srcs/getobjstat.c > head/share/examples/ses/srcs/inienc.c > head/share/examples/ses/srcs/sesd.c > head/share/examples/ses/srcs/setencstat.c > head/share/examples/ses/srcs/setobjstat.c > head/sys/cam/scsi/scsi_ses.h > head/sys/conf/files > head/sys/fs/devfs/devfs_vnops.c > head/sys/modules/cam/Makefile > head/usr.bin/kdump/mkioctls The devfs change should have been committed separately. Also, I do not see why devfs should do this to aliases at all. Also, your change only handles jails and not chroots, why ? Index: devfs_vnops.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- devfs_vnops.c (revision 235910) +++ devfs_vnops.c (revision 235911) @@ -1266,8 +1266,53 @@ static int devfs_readlink(struct vop_readlink_args *ap) { struct devfs_dirent *de; + struct cdev_priv *cdp; =20 de =3D ap->a_vp->v_data; + cdp =3D de->de_cdp; + + if (cdp !=3D NULL && (cdp->cdp_c.si_flags & SI_ALIAS) !=3D 0) { + struct devfs_mount *dmp; + struct prison *pr; + char *mp; + int mp_len; + int pr_path_len; + int err; The declarations should be placed at the start of the function, not at the start of the block. + + /* + * For device aliases, construct an absolute symlink (to + * shorten its length and avoid the ugliness of a relative + * link) by prepending the fully qualified path to the root + * of this devfs. For a non-jailed process, the devfs root + * is our mount point. For a jailed process, we must remove + * any jail prefix in our mount point so that our response + * matches the user process's world view. + */ + dmp =3D VFSTODEVFS(ap->a_vp->v_mount); + mp =3D dmp->dm_mount->mnt_stat.f_mntonname; + mp_len =3D strlen(mp); + + pr =3D ap->a_cred->cr_prison; + pr_path_len =3D strlen(pr->pr_path); + + if (strncmp(pr->pr_path, mp, pr_path_len) =3D=3D 0 + && mp[pr_path_len] =3D=3D '/') { Style prefers to put '&&' on the first line, and not on the continuation line. I suspect that you may access mp past the end of its memory there, no ? + mp +=3D pr_path_len; + mp_len -=3D pr_path_len; + } + + err =3D uiomove(mp, mp_len, ap->a_uio); + if (err !=3D 0) + return (err); + + /* + * Devfs cannot be the root file system, so its + * mount point must always be terminated by a '/'. + */ + err =3D uiomove("/", 1, ap->a_uio); + if (err !=3D 0) + return (err); + } return (uiomove(de->de_symlink, strlen(de->de_symlink), ap->a_uio)); } =20 --3ALZ8E19BIoSIFJn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk++RoAACgkQC3+MBN1Mb4gqeQCaA6EWcqa8XjZJ1CXvzcJ5eTcC nKkAn1Spf4091kLGqz3FKcUCpSsg3krT =UtQq -----END PGP SIGNATURE----- --3ALZ8E19BIoSIFJn-- From owner-svn-src-head@FreeBSD.ORG Thu May 24 15:25:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54A451065673; Thu, 24 May 2012 15:25:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25BA88FC16; Thu, 24 May 2012 15:25:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OFPagU045570; Thu, 24 May 2012 15:25:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OFPZes045568; Thu, 24 May 2012 15:25:35 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205241525.q4OFPZes045568@svn.freebsd.org> From: Alan Cox Date: Thu, 24 May 2012 15:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235912 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 15:25:36 -0000 Author: alc Date: Thu May 24 15:25:35 2012 New Revision: 235912 URL: http://svn.freebsd.org/changeset/base/235912 Log: MF amd64 r233097, r233122 With the changes over the past year to how accesses to the page's dirty field are synchronized, there is no need for pmap_protect() to acquire the page queues lock unless it is going to access the pv lists or PMAP1/PADDR1. Style fix to pmap_protect(). Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu May 24 14:07:44 2012 (r235911) +++ head/sys/i386/i386/pmap.c Thu May 24 15:25:35 2012 (r235912) @@ -3050,7 +3050,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv vm_offset_t pdnxt; pd_entry_t ptpaddr; pt_entry_t *pte; - int anychanged; + boolean_t anychanged, pv_lists_locked; if ((prot & VM_PROT_READ) == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); @@ -3066,10 +3066,16 @@ pmap_protect(pmap_t pmap, vm_offset_t sv return; #endif - anychanged = 0; + if (pmap_is_current(pmap)) + pv_lists_locked = FALSE; + else { + pv_lists_locked = TRUE; +resume: + vm_page_lock_queues(); + sched_pin(); + } + anychanged = FALSE; - vm_page_lock_queues(); - sched_pin(); PMAP_LOCK(pmap); for (; sva < eva; sva = pdnxt) { pt_entry_t obits, pbits; @@ -3104,12 +3110,27 @@ pmap_protect(pmap_t pmap, vm_offset_t sv */ if (pmap_protect_pde(pmap, &pmap->pm_pdir[pdirindex], sva, prot)) - anychanged = 1; - continue; - } else if (!pmap_demote_pde(pmap, - &pmap->pm_pdir[pdirindex], sva)) { - /* The large page mapping was destroyed. */ + anychanged = TRUE; continue; + } else { + if (!pv_lists_locked) { + pv_lists_locked = TRUE; + if (!mtx_trylock(&vm_page_queue_mtx)) { + if (anychanged) + pmap_invalidate_all( + pmap); + PMAP_UNLOCK(pmap); + goto resume; + } + } + if (!pmap_demote_pde(pmap, + &pmap->pm_pdir[pdirindex], sva)) { + /* + * The large page mapping was + * destroyed. + */ + continue; + } } } @@ -3155,14 +3176,16 @@ retry: if (obits & PG_G) pmap_invalidate_page(pmap, sva); else - anychanged = 1; + anychanged = TRUE; } } } - sched_unpin(); if (anychanged) pmap_invalidate_all(pmap); - vm_page_unlock_queues(); + if (pv_lists_locked) { + sched_unpin(); + vm_page_unlock_queues(); + } PMAP_UNLOCK(pmap); } From owner-svn-src-head@FreeBSD.ORG Thu May 24 16:11:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6DA9C106568C; Thu, 24 May 2012 16:11:52 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F1238FC15; Thu, 24 May 2012 16:11:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OGBqOE047553; Thu, 24 May 2012 16:11:52 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OGBqDn047551; Thu, 24 May 2012 16:11:52 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201205241611.q4OGBqDn047551@svn.freebsd.org> From: Josh Paetzel Date: Thu, 24 May 2012 16:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235915 - head/usr.bin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 16:11:52 -0000 Author: jpaetzel Date: Thu May 24 16:11:51 2012 New Revision: 235915 URL: http://svn.freebsd.org/changeset/base/235915 Log: Hook up mkulzma to the build. MFC after: 3 days Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu May 24 16:11:13 2012 (r235914) +++ head/usr.bin/Makefile Thu May 24 16:11:51 2012 (r235915) @@ -105,6 +105,7 @@ SUBDIR= alias \ mkfifo \ mklocale \ mktemp \ + mkulzma \ mkuzip \ mt \ ncal \ From owner-svn-src-head@FreeBSD.ORG Thu May 24 16:30:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB2A8106566B; Thu, 24 May 2012 16:30:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B60F28FC12; Thu, 24 May 2012 16:30:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OGUEVe048363; Thu, 24 May 2012 16:30:14 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OGUEnd048360; Thu, 24 May 2012 16:30:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205241630.q4OGUEnd048360@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 16:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235916 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 16:30:14 -0000 Author: bz Date: Thu May 24 16:30:13 2012 New Revision: 235916 URL: http://svn.freebsd.org/changeset/base/235916 Log: MFp4 bz_ipv6_fast: Introduce in6_getscope() to allow more effective checksum computations without the need to copy the address to clear the scope. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/scope6.c head/sys/netinet6/scope6_var.h Modified: head/sys/netinet6/scope6.c ============================================================================== --- head/sys/netinet6/scope6.c Thu May 24 16:11:51 2012 (r235915) +++ head/sys/netinet6/scope6.c Thu May 24 16:30:13 2012 (r235916) @@ -494,3 +494,16 @@ in6_clearscope(struct in6_addr *in6) return (modified); } + +/* + * Return the scope identifier or zero. + */ +uint16_t +in6_getscope(struct in6_addr *in6) +{ + + if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6)) + return (in6->s6_addr16[1]); + + return (0); +} Modified: head/sys/netinet6/scope6_var.h ============================================================================== --- head/sys/netinet6/scope6_var.h Thu May 24 16:11:51 2012 (r235915) +++ head/sys/netinet6/scope6_var.h Thu May 24 16:30:13 2012 (r235916) @@ -54,6 +54,7 @@ int sa6_embedscope __P((struct sockaddr_ int sa6_recoverscope __P((struct sockaddr_in6 *)); int in6_setscope __P((struct in6_addr *, struct ifnet *, u_int32_t *)); int in6_clearscope __P((struct in6_addr *)); +uint16_t in6_getscope(struct in6_addr *); #endif /* _KERNEL */ #endif /* _NETINET6_SCOPE6_VAR_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu May 24 16:38:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27F1C106575A; Thu, 24 May 2012 16:38:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9C22B8FC0A; Thu, 24 May 2012 16:38:25 +0000 (UTC) Message-ID: <4FBE6401.1010009@FreeBSD.org> Date: Thu, 24 May 2012 12:38:25 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0.1 MIME-Version: 1.0 To: "Alexander V. Chernikov" References: <201205212219.q4LMJKR9076035@svn.freebsd.org> <4FBD7E65.1060205@FreeBSD.org> <4FBE1120.8020704@FreeBSD.org> In-Reply-To: <4FBE1120.8020704@FreeBSD.org> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235746 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 16:38:26 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-05-24 06:44:48 -0400, Alexander V. Chernikov wrote: > Does the attached patch look ok to you? Generally looks good. Few nits: - --- bpf.c --- 1713: #ifdef BPF_JITTER 1714: bpf_jit_filter *ofunc, *jfunc; 1715: #endif Please add jfunc before ofunc, i.e., style(9). 1743: if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) != 0 || 1744: (bpf_validate(fcode, (int)flen) == 0)) { 1745: free(fcode, M_BPF); 1746: return (EINVAL); 1747: } Excessive parens @ L1744. 1752: #ifdef BPF_JITTER 1753: if (fp->bf_insns != NULL) 1754: jfunc = bpf_jitter(fcode, flen); 1755: else 1756: jfunc = NULL; /* Make compiler happy */ 1757: #endif Please test 'fcode' instead of 'fp->bf_insns' for consistency. - --- bpf_jitter.c --- 72: #ifdef _KERNEL 73: filter = (struct bpf_jit_filter *)malloc(sizeof(*filter), 74: M_BPFJIT, M_WAITOK); 75: #else This change is bogus because bpf_jit_compile() does more malloc(9) calls with M_NOWAIT, bpf_jitter() failures are not fatal (i.e., all consumers fall back to bpf_filter(9)), all consumers (e.g., ng_bpf.c) assume M_NOWAIT, etc, etc... Please note I haven't looked at other locking changes. Thanks, Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk++ZAAACgkQmlay1b9qnVObOgCfZmKOtPC8BhsnUK4I9LC5fW53 ePwAnipYRZFYNSi/5KFs2J3+L62zUMId =CASZ -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Thu May 24 16:48:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED9B2106564A; Thu, 24 May 2012 16:48:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8C488FC14; Thu, 24 May 2012 16:48:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OGmXjA049189; Thu, 24 May 2012 16:48:33 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OGmXha049187; Thu, 24 May 2012 16:48:33 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205241648.q4OGmXha049187@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 May 2012 16:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235918 - head/sys/geom/label X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 16:48:34 -0000 Author: trasz Date: Thu May 24 16:48:33 2012 New Revision: 235918 URL: http://svn.freebsd.org/changeset/base/235918 Log: Make g_label(4) ignore provider size when looking for UFS labels. Without it, it fails to create labels for filesystems resized by growfs(8). PR: kern/165962 Submitted by: Olivier Cochard-Labbe Modified: head/sys/geom/label/g_label_ufs.c Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Thu May 24 16:41:26 2012 (r235917) +++ head/sys/geom/label/g_label_ufs.c Thu May 24 16:48:33 2012 (r235918) @@ -81,12 +81,10 @@ g_label_ufs_taste_common(struct g_consum fs = (struct fs *)g_read_data(cp, superblock, SBLOCKSIZE, NULL); if (fs == NULL) continue; - /* Check for magic and make sure things are the right size */ - if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 0 && - pp->mediasize / fs->fs_fsize == fs->fs_old_size) { + /* Check for magic */ + if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 0) { /* Valid UFS1. */ - } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0 && - pp->mediasize / fs->fs_fsize == fs->fs_size) { + } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0) { /* Valid UFS2. */ } else { g_free(fs); From owner-svn-src-head@FreeBSD.ORG Thu May 24 17:39:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD261106564A; Thu, 24 May 2012 17:39:54 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C84D18FC0A; Thu, 24 May 2012 17:39:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OHdsRd051351; Thu, 24 May 2012 17:39:54 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OHdsS8051349; Thu, 24 May 2012 17:39:54 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201205241739.q4OHdsS8051349@svn.freebsd.org> From: Jack F Vogel Date: Thu, 24 May 2012 17:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235920 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 17:39:55 -0000 Author: jfv Date: Thu May 24 17:39:54 2012 New Revision: 235920 URL: http://svn.freebsd.org/changeset/base/235920 Log: Fix to kern/168294 - add flow director support into the static kernel build of ixgbe. Thanks Sergey for pointing this out. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 24 17:10:54 2012 (r235919) +++ head/sys/conf/files Thu May 24 17:39:54 2012 (r235920) @@ -1522,7 +1522,7 @@ dev/ixgb/if_ixgb.c optional ixgb dev/ixgb/ixgb_ee.c optional ixgb dev/ixgb/ixgb_hw.c optional ixgb dev/ixgbe/ixgbe.c optional ixgbe inet \ - compile-with "${NORMAL_C} -I$S/dev/ixgbe" + compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP -DIXGBE_FDIR" dev/ixgbe/ixv.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_phy.c optional ixgbe inet \ From owner-svn-src-head@FreeBSD.ORG Thu May 24 18:05:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60473106564A; Thu, 24 May 2012 18:05:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A48C8FC0A; Thu, 24 May 2012 18:05:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OI5BhU052409; Thu, 24 May 2012 18:05:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OI5B2R052407; Thu, 24 May 2012 18:05:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205241805.q4OI5B2R052407@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 18:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235921 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 18:05:11 -0000 Author: bz Date: Thu May 24 18:05:10 2012 New Revision: 235921 URL: http://svn.freebsd.org/changeset/base/235921 Log: MFp4 bz_ipv6_fast: Optimize in6_cksum(), re-ordering work and limiting variable initialization, removing a bzero() for mostly re-initialized struct values, making use of the newly introduced in6_getscope(), as well as converting an if/panic to a KASSERT(). Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/in6_cksum.c Modified: head/sys/netinet6/in6_cksum.c ============================================================================== --- head/sys/netinet6/in6_cksum.c Thu May 24 17:39:54 2012 (r235920) +++ head/sys/netinet6/in6_cksum.c Thu May 24 18:05:10 2012 (r235921) @@ -89,12 +89,10 @@ __FBSDID("$FreeBSD$"); int in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len) { - u_int16_t *w; - int sum = 0; - int mlen = 0; - int byte_swapped = 0; struct ip6_hdr *ip6; - struct in6_addr in6; + u_int16_t *w, scope; + int byte_swapped, mlen; + int sum; union { u_int16_t phs[4]; struct { @@ -112,42 +110,38 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t l; } l_util; - /* sanity check */ - if (m->m_pkthdr.len < off + len) { - panic("in6_cksum: mbuf len (%d) < off+len (%d+%d)", - m->m_pkthdr.len, off, len); - } - - bzero(&uph, sizeof(uph)); + /* Sanity check. */ + KASSERT(m->m_pkthdr.len >= off + len, ("%s: mbuf len (%d) < off(%d)+" + "len(%d)", __func__, m->m_pkthdr.len, off, len)); /* * First create IP6 pseudo header and calculate a summary. */ - ip6 = mtod(m, struct ip6_hdr *); uph.ph.ph_len = htonl(len); + uph.ph.ph_zero[0] = uph.ph.ph_zero[1] = uph.ph.ph_zero[2] = 0; uph.ph.ph_nxt = nxt; - /* - * IPv6 source address. - * XXX: we'd like to avoid copying the address, but we can't due to - * the possibly embedded scope zone ID. - */ - in6 = ip6->ip6_src; - in6_clearscope(&in6); - w = (u_int16_t *)&in6; + /* Payload length and upper layer identifier. */ + sum = uph.phs[0]; sum += uph.phs[1]; + sum += uph.phs[2]; sum += uph.phs[3]; + + ip6 = mtod(m, struct ip6_hdr *); + + /* IPv6 source address. */ + scope = in6_getscope(&ip6->ip6_src); + w = (u_int16_t *)&ip6->ip6_src; sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; + if (scope != 0) + sum -= scope; - /* IPv6 destination address */ - in6 = ip6->ip6_dst; - in6_clearscope(&in6); - w = (u_int16_t *)&in6; + /* IPv6 destination address. */ + scope = in6_getscope(&ip6->ip6_dst); + w = (u_int16_t *)&ip6->ip6_dst; sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; - - /* Payload length and upper layer identifier */ - sum += uph.phs[0]; sum += uph.phs[1]; - sum += uph.phs[2]; sum += uph.phs[3]; + if (scope != 0) + sum -= scope; /* * Secondly calculate a summary of the first mbuf excluding offset. @@ -167,14 +161,16 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, /* * Force to even boundary. */ - if ((1 & (long) w) && (mlen > 0)) { + if ((1 & (long)w) && (mlen > 0)) { REDUCE; sum <<= 8; s_util.c[0] = *(u_char *)w; w = (u_int16_t *)((char *)w + 1); mlen--; byte_swapped = 1; - } + } else + byte_swapped = 0; + /* * Unroll the loop to make overhead from * branches &c small. From owner-svn-src-head@FreeBSD.ORG Thu May 24 18:19:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32AEC106566C; Thu, 24 May 2012 18:19:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C1B48FC08; Thu, 24 May 2012 18:19:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OIJNV0053093; Thu, 24 May 2012 18:19:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OIJNJu053091; Thu, 24 May 2012 18:19:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205241819.q4OIJNJu053091@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 May 2012 18:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235922 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 18:19:24 -0000 Author: mav Date: Thu May 24 18:19:23 2012 New Revision: 235922 URL: http://svn.freebsd.org/changeset/base/235922 Log: Revert devfs part of r235911. I was unaware about old but unfinished discussion between kib@ and gibbs@ about it. Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Thu May 24 18:05:10 2012 (r235921) +++ head/sys/fs/devfs/devfs_vnops.c Thu May 24 18:19:23 2012 (r235922) @@ -1266,53 +1266,8 @@ static int devfs_readlink(struct vop_readlink_args *ap) { struct devfs_dirent *de; - struct cdev_priv *cdp; de = ap->a_vp->v_data; - cdp = de->de_cdp; - - if (cdp != NULL && (cdp->cdp_c.si_flags & SI_ALIAS) != 0) { - struct devfs_mount *dmp; - struct prison *pr; - char *mp; - int mp_len; - int pr_path_len; - int err; - - /* - * For device aliases, construct an absolute symlink (to - * shorten its length and avoid the ugliness of a relative - * link) by prepending the fully qualified path to the root - * of this devfs. For a non-jailed process, the devfs root - * is our mount point. For a jailed process, we must remove - * any jail prefix in our mount point so that our response - * matches the user process's world view. - */ - dmp = VFSTODEVFS(ap->a_vp->v_mount); - mp = dmp->dm_mount->mnt_stat.f_mntonname; - mp_len = strlen(mp); - - pr = ap->a_cred->cr_prison; - pr_path_len = strlen(pr->pr_path); - - if (strncmp(pr->pr_path, mp, pr_path_len) == 0 - && mp[pr_path_len] == '/') { - mp += pr_path_len; - mp_len -= pr_path_len; - } - - err = uiomove(mp, mp_len, ap->a_uio); - if (err != 0) - return (err); - - /* - * Devfs cannot be the root file system, so its - * mount point must always be terminated by a '/'. - */ - err = uiomove("/", 1, ap->a_uio); - if (err != 0) - return (err); - } return (uiomove(de->de_symlink, strlen(de->de_symlink), ap->a_uio)); } From owner-svn-src-head@FreeBSD.ORG Thu May 24 18:22:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AF46106566B; Thu, 24 May 2012 18:22:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B5EA8FC0A; Thu, 24 May 2012 18:22:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OIMwBq053273; Thu, 24 May 2012 18:22:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OIMwZU053270; Thu, 24 May 2012 18:22:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201205241822.q4OIMwZU053270@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 24 May 2012 18:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235923 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 18:22:58 -0000 Author: glebius Date: Thu May 24 18:22:57 2012 New Revision: 235923 URL: http://svn.freebsd.org/changeset/base/235923 Log: Revert r220768 for ng_ksocket. This node is special and when it is cloning, its constructor method may be called in a context that isn't allowed to sleep. Noticed by: Vadim Goncharov Modified: head/sys/netgraph/ng_ksocket.c head/sys/netgraph/ng_mppc.c Modified: head/sys/netgraph/ng_ksocket.c ============================================================================== --- head/sys/netgraph/ng_ksocket.c Thu May 24 18:19:23 2012 (r235922) +++ head/sys/netgraph/ng_ksocket.c Thu May 24 18:22:57 2012 (r235923) @@ -524,7 +524,9 @@ ng_ksocket_constructor(node_p node) priv_p priv; /* Allocate private structure */ - priv = malloc(sizeof(*priv), M_NETGRAPH_KSOCKET, M_WAITOK | M_ZERO); + priv = malloc(sizeof(*priv), M_NETGRAPH_KSOCKET, M_NOWAIT | M_ZERO); + if (priv == NULL) + return (ENOMEM); LIST_INIT(&priv->embryos); /* cross link them */ Modified: head/sys/netgraph/ng_mppc.c ============================================================================== --- head/sys/netgraph/ng_mppc.c Thu May 24 18:19:23 2012 (r235922) +++ head/sys/netgraph/ng_mppc.c Thu May 24 18:22:57 2012 (r235923) @@ -98,15 +98,6 @@ static MALLOC_DEFINE(M_NETGRAPH_MPPC, "n /* Key length */ #define KEYLEN(b) (((b) & MPPE_128) ? 16 : 8) -/* - * When packets are lost with MPPE, we may have to re-key arbitrarily - * many times to 'catch up' to the new jumped-ahead sequence number. - * Since this can be expensive, we pose a limit on how many re-keyings - * we will do at one time to avoid a possible D.O.S. vulnerability. - * This should instead be a configurable parameter. - */ -#define MPPE_MAX_REKEY 1000 - /* MPPC packet header bits */ #define MPPC_FLAG_FLUSHED 0x8000 /* xmitter reset state */ #define MPPC_FLAG_RESTART 0x4000 /* compress history restart */ @@ -641,20 +632,22 @@ ng_mppc_decompress(node_p node, struct m #endif #ifdef NETGRAPH_MPPC_ENCRYPTION if ((d->cfg.bits & MPPE_BITS) != 0) { - u_int rekey; - - /* How many times are we going to have to re-key? */ - rekey = ((d->cfg.bits & MPPE_STATELESS) != 0) ? - numLost : (numLost / (MPPE_UPDATE_MASK + 1)); - if (rekey > MPPE_MAX_REKEY) { - log(LOG_ERR, "%s: too many (%d) packets" - " dropped, disabling node %p!", - __func__, numLost, node); - priv->recv.cfg.enable = 0; - goto failed; - } - - /* Re-key as necessary to catch up to peer */ + u_int rekey; + + /* How many times are we going to have to re-key? */ + rekey = ((d->cfg.bits & MPPE_STATELESS) != 0) ? + numLost : (numLost / (MPPE_UPDATE_MASK + 1)); + if (rekey > 1000) + log(LOG_ERR, "%s: %d packets dropped, " + "node [%x]\n", __func__, numLost, + node->nd_ID); + + /* + * When packets are lost or re-ordered with MPPE, + * we may have to re-key up to 0xfff times to 'catch + * up' to the new jumped-ahead sequence number. Yep, + * this is heavy, but what else can we do? + */ while (d->cc != cc) { if ((d->cfg.bits & MPPE_STATELESS) != 0 || (d->cc & MPPE_UPDATE_MASK) From owner-svn-src-head@FreeBSD.ORG Thu May 24 18:25:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29F311065678; Thu, 24 May 2012 18:25:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AD108FC19; Thu, 24 May 2012 18:25:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OIP9Gu053397; Thu, 24 May 2012 18:25:09 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OIP9RN053394; Thu, 24 May 2012 18:25:09 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205241825.q4OIP9RN053394@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 18:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235924 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 18:25:10 -0000 Author: bz Date: Thu May 24 18:25:09 2012 New Revision: 235924 URL: http://svn.freebsd.org/changeset/base/235924 Log: MFp4 bz_ipv6_fast: Introduce a (for now copied stripped down) in6_cksum_pseudo() function. We should be able to use this from in6_cksum() but we should also ponder possible MD specific improvements. It takes an extra csum argument to allow for easy checks as will be done by the upper layer protocol input paths. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/in6.h head/sys/netinet6/in6_cksum.c Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Thu May 24 18:22:57 2012 (r235923) +++ head/sys/netinet6/in6.h Thu May 24 18:25:09 2012 (r235924) @@ -632,7 +632,9 @@ struct ip6_mtuinfo { #ifdef _KERNEL struct cmsghdr; +struct ip6_hdr; +int in6_cksum_pseudo(struct ip6_hdr *, uint32_t, uint8_t, uint16_t); int in6_cksum __P((struct mbuf *, u_int8_t, u_int32_t, u_int32_t)); int in6_localaddr __P((struct in6_addr *)); int in6_localip(struct in6_addr *); Modified: head/sys/netinet6/in6_cksum.c ============================================================================== --- head/sys/netinet6/in6_cksum.c Thu May 24 18:22:57 2012 (r235923) +++ head/sys/netinet6/in6_cksum.c Thu May 24 18:25:09 2012 (r235924) @@ -80,6 +80,66 @@ __FBSDID("$FreeBSD$"); #define ADDCARRY(x) (x > 65535 ? x -= 65535 : x) #define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; (void)ADDCARRY(sum);} +static int +_in6_cksum_pseudo(struct ip6_hdr *ip6, uint32_t len, uint8_t nxt, uint16_t csum) +{ + int sum; + uint16_t scope, *w; + union { + u_int16_t phs[4]; + struct { + u_int32_t ph_len; + u_int8_t ph_zero[3]; + u_int8_t ph_nxt; + } __packed ph; + } uph; + + sum = csum; + + /* + * First create IP6 pseudo header and calculate a summary. + */ + uph.ph.ph_len = htonl(len); + uph.ph.ph_zero[0] = uph.ph.ph_zero[1] = uph.ph.ph_zero[2] = 0; + uph.ph.ph_nxt = nxt; + + /* Payload length and upper layer identifier. */ + sum += uph.phs[0]; sum += uph.phs[1]; + sum += uph.phs[2]; sum += uph.phs[3]; + + /* IPv6 source address. */ + scope = in6_getscope(&ip6->ip6_src); + w = (u_int16_t *)&ip6->ip6_src; + sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; + sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; + if (scope != 0) + sum -= scope; + + /* IPv6 destination address. */ + scope = in6_getscope(&ip6->ip6_dst); + w = (u_int16_t *)&ip6->ip6_dst; + sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; + sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; + if (scope != 0) + sum -= scope; + + return (sum); +} + +int +in6_cksum_pseudo(struct ip6_hdr *ip6, uint32_t len, uint8_t nxt, uint16_t csum) +{ + int sum; + union { + u_int16_t s[2]; + u_int32_t l; + } l_util; + + sum = _in6_cksum_pseudo(ip6, len, nxt, csum); + REDUCE; + return (sum); +} + /* * m MUST contain a contiguous IP6 header. * off is an offset where TCP/UDP/ICMP6 header starts. From owner-svn-src-head@FreeBSD.ORG Thu May 24 19:13:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6F861065676; Thu, 24 May 2012 19:13:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B20888FC1D; Thu, 24 May 2012 19:13:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OJDs6f055415; Thu, 24 May 2012 19:13:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OJDsXg055413; Thu, 24 May 2012 19:13:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201205241913.q4OJDsXg055413@svn.freebsd.org> From: Dimitry Andric Date: Thu, 24 May 2012 19:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235925 - head/sys/dev/drm2/i915 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 19:13:54 -0000 Author: dim Date: Thu May 24 19:13:54 2012 New Revision: 235925 URL: http://svn.freebsd.org/changeset/base/235925 Log: Fix the following clang warning in drm2: sys/dev/drm2/i915/intel_display.c:8861:3: error: expression result unused [-Werror,-Wunused-value] _intel_wait_for(dev, ^~~~~~~~~~~~~~~~~~~~ @/dev/drm2/i915/intel_drv.h:55:2: note: expanded from macro '_intel_wait_for' ret; \ ^~~ Reviewed by: kib MFC after: 1 week Modified: head/sys/dev/drm2/i915/intel_display.c Modified: head/sys/dev/drm2/i915/intel_display.c ============================================================================== --- head/sys/dev/drm2/i915/intel_display.c Thu May 24 18:25:09 2012 (r235924) +++ head/sys/dev/drm2/i915/intel_display.c Thu May 24 19:13:54 2012 (r235925) @@ -8858,7 +8858,7 @@ static void ironlake_disable_rc6(struct if (I915_READ(PWRCTXA)) { /* Wake the GPU, prevent RC6, then restore RSTDBYCTL */ I915_WRITE(RSTDBYCTL, I915_READ(RSTDBYCTL) | RCX_SW_EXIT); - _intel_wait_for(dev, + (void)_intel_wait_for(dev, ((I915_READ(RSTDBYCTL) & RSX_STATUS_MASK) == RSX_STATUS_ON), 50, 1, "915pro"); From owner-svn-src-head@FreeBSD.ORG Thu May 24 19:48:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 255A61065670; Thu, 24 May 2012 19:48:16 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC0058FC08; Thu, 24 May 2012 19:48:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OJmFh6056932; Thu, 24 May 2012 19:48:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OJmFlY056929; Thu, 24 May 2012 19:48:15 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205241948.q4OJmFlY056929@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 19:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235927 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 19:48:16 -0000 Author: marcel Date: Thu May 24 19:48:15 2012 New Revision: 235927 URL: http://svn.freebsd.org/changeset/base/235927 Log: Work better with how make/bmake works: 1. Avoid a cd back into ${.CURDIR} to run mkbuiltins when we know make will first cd into ${.OBJDIR}. Keep the cwd to what make sets it to. 2. Don't tell mkbuiltins where to write to (= ${.OBJDIR}), but where to get sources from (= ${.CURDIR}). This to compensate for point 1. This fixes a problem with bmake's mk files that optimize ${.OBJDIR} to expand to "." after changing cwd, not taking into account that the target is pretty much undoing that and not getting the full path to the object tree anymore. Modified: head/bin/sh/Makefile head/bin/sh/mkbuiltins Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Thu May 24 19:24:31 2012 (r235926) +++ head/bin/sh/Makefile Thu May 24 19:48:15 2012 (r235927) @@ -38,7 +38,7 @@ build-tools: mkinit mknodes mksyntax .ORDER: builtins.c builtins.h builtins.c builtins.h: mkbuiltins builtins.def - cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR} + sh ${.CURDIR}/mkbuiltins ${.CURDIR} init.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \ redir.c trap.c var.c Modified: head/bin/sh/mkbuiltins ============================================================================== --- head/bin/sh/mkbuiltins Thu May 24 19:24:31 2012 (r235926) +++ head/bin/sh/mkbuiltins Thu May 24 19:48:15 2012 (r235927) @@ -35,17 +35,17 @@ # $FreeBSD$ temp=`/usr/bin/mktemp -t ka` -havejobs=0 -if grep '^#define[ ]*JOBS[ ]*1' shell.h > /dev/null -then havejobs=1 -fi havehist=1 if [ "X$1" = "X-h" ]; then havehist=0 shift fi -objdir=$1 -exec > ${objdir}/builtins.c +srcdir=$1 +havejobs=0 +if grep '^#define[ ]*JOBS[ ]*1' $srcdir/shell.h > /dev/null +then havejobs=1 +fi +exec > builtins.c cat <<\! /* * This file was generated by the mkbuiltins program. @@ -57,7 +57,7 @@ cat <<\! ! awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \ - print $0}' builtins.def | sed 's/-[hj]//' > $temp + print $0}' $srcdir/builtins.def | sed 's/-[hj]//' > $temp echo 'int (*const builtinfunc[])(int, char **) = {' awk '/^[^#]/ { printf "\t%s,\n", $1}' $temp echo '}; @@ -74,7 +74,7 @@ awk '{ for (i = 2 ; i <= NF ; i++) { echo ' { NULL, 0, 0 } };' -exec > ${objdir}/builtins.h +exec > builtins.h cat <<\! /* * This file was generated by the mkbuiltins program. From owner-svn-src-head@FreeBSD.ORG Thu May 24 20:00:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F1631065672; Thu, 24 May 2012 20:00:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7733F8FC14; Thu, 24 May 2012 20:00:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OK0xSJ057483; Thu, 24 May 2012 20:00:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OK0xLu057481; Thu, 24 May 2012 20:00:59 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242000.q4OK0xLu057481@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 20:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235928 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:00:59 -0000 Author: marcel Date: Thu May 24 20:00:58 2012 New Revision: 235928 URL: http://svn.freebsd.org/changeset/base/235928 Log: Fix an inconsistency I just ran into for LDADD and DPADD. The description for both of them use different, and presumably wrong, variables in the example. They set LDFILES and SRCLIB respectively. I guess that's what DPADD and LDADD were called first ... Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Thu May 24 19:48:15 2012 (r235927) +++ head/share/mk/bsd.README Thu May 24 20:00:58 2012 (r235928) @@ -228,7 +228,7 @@ LDADD Additional loader objects. Usual For example, to load with the compatibility and utility libraries, use: - LDFILES=-lutil -lcompat + LDADD=-lutil -lcompat LDFLAGS Additional loader flags. @@ -261,7 +261,7 @@ DPADD Additional dependencies for the p libraries. For example, to depend on the compatibility and utility libraries use: - SRCLIB=${LIBCOMPAT} ${LIBUTIL} + DPADD=${LIBCOMPAT} ${LIBUTIL} There is a predefined identifier for each (non-profiled, non-shared) library and object. Library file names are From owner-svn-src-head@FreeBSD.ORG Thu May 24 20:12:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 267641065674; Thu, 24 May 2012 20:12:47 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 078988FC0A; Thu, 24 May 2012 20:12:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OKCkb0057989; Thu, 24 May 2012 20:12:46 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OKCkv9057985; Thu, 24 May 2012 20:12:46 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242012.q4OKCkv9057985@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 20:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235929 - in head/lib/libc/powerpc: . gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:12:47 -0000 Author: marcel Date: Thu May 24 20:12:46 2012 New Revision: 235929 URL: http://svn.freebsd.org/changeset/base/235929 Log: Allow building for the PowerPC EABI by providing a dummy __eabi() function. The purpose of the __eabi() function is to set up the runtime and is called first thing by main(). The runtime is already set up for us prior to caling main, so there's nothing to do for us in the EABI case. Added: head/lib/libc/powerpc/gen/eabi.S (contents, props changed) Modified: head/lib/libc/powerpc/Symbol.map head/lib/libc/powerpc/gen/Makefile.inc Modified: head/lib/libc/powerpc/Symbol.map ============================================================================== --- head/lib/libc/powerpc/Symbol.map Thu May 24 20:00:58 2012 (r235928) +++ head/lib/libc/powerpc/Symbol.map Thu May 24 20:12:46 2012 (r235929) @@ -11,6 +11,7 @@ FBSD_1.0 { /* PSEUDO syscalls */ _exit; + __eabi; _mcount; _setjmp; _longjmp; Modified: head/lib/libc/powerpc/gen/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/gen/Makefile.inc Thu May 24 20:00:58 2012 (r235928) +++ head/lib/libc/powerpc/gen/Makefile.inc Thu May 24 20:12:46 2012 (r235929) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCS += _ctx_start.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ +SRCS += _ctx_start.S eabi.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ fpgetsticky.c fpsetmask.c fpsetround.c getcontextx.c \ infinity.c ldexp.c makecontext.c _setjmp.S \ setjmp.S sigsetjmp.S signalcontext.c syncicache.c \ Added: head/lib/libc/powerpc/gen/eabi.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc/gen/eabi.S Thu May 24 20:12:46 2012 (r235929) @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2011 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +ENTRY(__eabi) + blr + + .section .note.GNU-stack,"",%progbits From owner-svn-src-head@FreeBSD.ORG Thu May 24 20:24:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5BD5C106566B; Thu, 24 May 2012 20:24:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46C098FC19; Thu, 24 May 2012 20:24:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OKOoDs058474; Thu, 24 May 2012 20:24:50 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OKOoFQ058472; Thu, 24 May 2012 20:24:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242024.q4OKOoFQ058472@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 20:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235930 - head/sys/dev/fdt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:24:50 -0000 Author: marcel Date: Thu May 24 20:24:49 2012 New Revision: 235930 URL: http://svn.freebsd.org/changeset/base/235930 Log: Preset (clear) the ranges we're supposed to fill from the FDT. If a particular range (either I/O memory or I/O port) is not defined in the FDT, we're not handing uninitialized structures back to our caller. Modified: head/sys/dev/fdt/fdt_pci.c Modified: head/sys/dev/fdt/fdt_pci.c ============================================================================== --- head/sys/dev/fdt/fdt_pci.c Thu May 24 20:12:46 2012 (r235929) +++ head/sys/dev/fdt/fdt_pci.c Thu May 24 20:24:49 2012 (r235930) @@ -100,6 +100,14 @@ fdt_pci_ranges_decode(phandle_t node, st size_cells); tuples = len / tuple_size; + /* + * Initialize the ranges so that we don't have to worry about + * having them all defined in the FDT. In particular, it is + * perfectly fine not to want I/O space on PCI busses. + */ + bzero(io_space, sizeof(*io_space)); + bzero(mem_space, sizeof(*mem_space)); + rangesptr = &ranges[0]; offset_cells = 0; for (i = 0; i < tuples; i++) { From owner-svn-src-head@FreeBSD.ORG Thu May 24 20:45:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA018106564A; Thu, 24 May 2012 20:45:44 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B35C8FC14; Thu, 24 May 2012 20:45:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OKji9H059400; Thu, 24 May 2012 20:45:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OKjipb059398; Thu, 24 May 2012 20:45:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242045.q4OKjipb059398@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 20:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:45:44 -0000 Author: marcel Date: Thu May 24 20:45:44 2012 New Revision: 235931 URL: http://svn.freebsd.org/changeset/base/235931 Log: Fix the memory barriers for CPUs that do not like lwsync and wedge or cause exceptions early enough during boot that the kernel will do ithe same. Use lwsync only when compiling for LP64 and revert to the more proven isync when compiling for ILP32. Note that in the end (i.e. between revision 222198 and this change) ILP32 changed from using sync to using isync. As per Nathan the isync is needed to make sure I/O accesses are properly serialized with locks and isync tends to be more effecient than sync. While here, undefine __ATOMIC_ACQ and __ATOMIC_REL at the end of the file so as not to leak their definitions. Discussed with: nwhitehorn Modified: head/sys/powerpc/include/atomic.h Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Thu May 24 20:24:49 2012 (r235930) +++ head/sys/powerpc/include/atomic.h Thu May 24 20:45:44 2012 (r235931) @@ -36,23 +36,30 @@ #error this file needs sys/cdefs.h as a prerequisite #endif -/* NOTE: lwsync is equivalent to sync on systems without lwsync */ -#define mb() __asm __volatile("lwsync" : : : "memory") -#ifdef __powerpc64__ -#define rmb() __asm __volatile("lwsync" : : : "memory") -#define wmb() __asm __volatile("lwsync" : : : "memory") -#else -#define rmb() __asm __volatile("lwsync" : : : "memory") -#define wmb() __asm __volatile("eieio" : : : "memory") -#endif - /* * The __ATOMIC_REL/ACQ() macros provide memory barriers only in conjunction - * with the atomic lXarx/stXcx. sequences below. See Appendix B.2 of Book II - * of the architecture manual. + * with the atomic lXarx/stXcx. sequences below. They are not exposed outside + * of this file. See also Appendix B.2 of Book II of the architecture manual. + * + * Note that not all Book-E processors accept the light-weight sync variant. + * In particular, early models of E500 cores are known to wedge. Bank on all + * 64-bit capable CPUs to accept lwsync properly and pressimize 32-bit CPUs + * to use the heavier-weight sync. */ + +#ifdef __powerpc64__ +#define mb() __asm __volatile("lwsync" : : : "memory") +#define rmb() __asm __volatile("lwsync" : : : "memory") +#define wmb() __asm __volatile("lwsync" : : : "memory") #define __ATOMIC_REL() __asm __volatile("lwsync" : : : "memory") +#define __ATOMIC_ACQ() __asm __volatile("lwsync" : : : "memory") +#else +#define mb() __asm __volatile("isync" : : : "memory") +#define rmb() __asm __volatile("isync" : : : "memory") +#define wmb() __asm __volatile("isync" : : : "memory") +#define __ATOMIC_REL() __asm __volatile("isync" : : : "memory") #define __ATOMIC_ACQ() __asm __volatile("isync" : : : "memory") +#endif /* * atomic_add(p, v) @@ -683,4 +690,7 @@ atomic_fetchadd_long(volatile u_long *p, #define atomic_fetchadd_64 atomic_fetchadd_long #endif +#undef __ATOMIC_REL +#undef __ATOMIC_ACQ + #endif /* ! _MACHINE_ATOMIC_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu May 24 20:58:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 80E06106566C; Thu, 24 May 2012 20:58:41 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A7B58FC08; Thu, 24 May 2012 20:58:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OKwfff059928; Thu, 24 May 2012 20:58:41 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OKwfmE059924; Thu, 24 May 2012 20:58:41 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242058.q4OKwfmE059924@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 20:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235932 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:58:41 -0000 Author: marcel Date: Thu May 24 20:58:40 2012 New Revision: 235932 URL: http://svn.freebsd.org/changeset/base/235932 Log: o Rename kernload_ap to bp_kernelload. This to introduce a common prefix for variables that live in the boot page. o Add bp_trace (yes, it's in the boot page) that gets zeroed before we try to wake a core and to which the core being woken can write markers so that we know where the core was in case it doesn't wake up. The boot code does not yet write markers (too follow). o Disable the boot page translation to allow the last 4K page to be used for whatever we please. It would get mapped otherwise. o Fix kernstart in the case of SMP. The start argument is typically page aligned due to the alignment requirements that come with having a boot page. The point of using trunc_page is that we get the actual load address given that the entry point is immediately following the ELF headers. In the SMP case this ended up exactly 4K after the load address. Hence subtracting 1 from start. Modified: head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/platform_bare.c head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Thu May 24 20:45:44 2012 (r235931) +++ head/sys/powerpc/booke/locore.S Thu May 24 20:58:40 2012 (r235932) @@ -242,14 +242,20 @@ done_mapping: __boot_page: bl 1f - .globl kernload_ap -kernload_ap: + .globl bp_trace +bp_trace: + .long 0 + + .globl bp_kernload +bp_kernload: .long 0 /* * Initial configuration */ 1: + mflr %r31 /* r31 hold the address of bp_trace */ + /* Set HIDs */ lis %r3, HID0_E500_DEFAULT_SET@h ori %r3, %r3, HID0_E500_DEFAULT_SET@l @@ -318,15 +324,15 @@ kernload_ap: mtspr SPR_MAS2, %r3 isync - /* Retrieve kernel load [physical] address from kernload_ap */ + /* Retrieve kernel load [physical] address from bp_kernload */ bl 4f 4: mflr %r3 rlwinm %r3, %r3, 0, 0, 19 - lis %r4, kernload_ap@h - ori %r4, %r4, kernload_ap@l + lis %r4, bp_kernload@h + ori %r4, %r4, bp_kernload@l lis %r5, __boot_page@h ori %r5, %r5, __boot_page@l - sub %r4, %r4, %r5 /* offset of kernload_ap within __boot_page */ + sub %r4, %r4, %r5 /* offset of bp_kernload within __boot_page */ lwzx %r3, %r4, %r3 /* Set RPN and protection */ Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Thu May 24 20:45:44 2012 (r235931) +++ head/sys/powerpc/booke/platform_bare.c Thu May 24 20:58:40 2012 (r235932) @@ -56,7 +56,8 @@ __FBSDID("$FreeBSD$"); #ifdef SMP extern void *ap_pcpu; extern uint8_t __boot_page[]; /* Boot page body */ -extern uint32_t kernload_ap; /* Kernel physical load address */ +extern uint32_t bp_kernload; /* Kernel physical load address */ +extern uint32_t bp_trace; /* AP boot trace field */ #endif extern uint32_t *bootinfo; @@ -262,8 +263,8 @@ bare_smp_start_cpu(platform_t plat, stru eebpcr = ccsr_read4(OCP85XX_EEBPCR); if ((eebpcr & (1 << (pc->pc_cpuid + 24))) != 0) { - printf("%s: CPU=%d already out of hold-off state!\n", - __func__, pc->pc_cpuid); + printf("SMP: CPU %d already out of hold-off state!\n", + pc->pc_cpuid); return (ENXIO); } @@ -273,12 +274,13 @@ bare_smp_start_cpu(platform_t plat, stru /* * Set BPTR to the physical address of the boot page */ - bptr = ((uint32_t)__boot_page - KERNBASE) + kernload_ap; + bptr = ((uint32_t)__boot_page - KERNBASE) + bp_kernload; ccsr_write4(OCP85XX_BPTR, (bptr >> 12) | 0x80000000); /* * Release AP from hold-off state */ + bp_trace = 0; eebpcr |= (1 << (pc->pc_cpuid + 24)); ccsr_write4(OCP85XX_EEBPCR, eebpcr); __asm __volatile("isync; msync"); @@ -287,6 +289,16 @@ bare_smp_start_cpu(platform_t plat, stru while (!pc->pc_awake && timeout--) DELAY(1000); /* wait 1ms */ + /* + * Disable boot page translation so that the 4K page at the default + * address (= 0xfffff000) isn't permanently remapped and thus not + * usable otherwise. + */ + ccsr_write4(OCP85XX_BPTR, 0); + + if (!pc->pc_awake) + printf("SMP: CPU %d didn't wake up (trace code %#x).\n", + pc->pc_awake, bp_trace); return ((pc->pc_awake) ? 0 : EBUSY); #else /* No SMP support */ Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu May 24 20:45:44 2012 (r235931) +++ head/sys/powerpc/booke/pmap.c Thu May 24 20:58:40 2012 (r235932) @@ -115,7 +115,7 @@ extern unsigned char _end[]; extern uint32_t *bootinfo; #ifdef SMP -extern uint32_t kernload_ap; +extern uint32_t bp_kernload; #endif vm_paddr_t kernload; @@ -967,10 +967,9 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset debugf("mmu_booke_bootstrap: entered\n"); #ifdef SMP - kernload_ap = kernload; + bp_kernload = kernload; #endif - /* Initialize invalidation mutex */ mtx_init(&tlbivax_mutex, "tlbivax", NULL, MTX_SPIN); @@ -981,8 +980,13 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset * Align kernel start and end address (kernel image). * Note that kernel end does not necessarily relate to kernsize. * kernsize is the size of the kernel that is actually mapped. + * Also note that "start - 1" is deliberate. With SMP, the + * entry point is exactly a page from the actual load address. + * As such, trunc_page() has no effect and we're off by a page. + * Since we always have the ELF header between the load address + * and the entry point, we can safely subtract 1 to compensate. */ - kernstart = trunc_page(start); + kernstart = trunc_page(start - 1); data_start = round_page(kernelend); data_end = data_start; @@ -1233,9 +1237,9 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset * entries, but for pte_vatopa() to work correctly with kernel area * addresses. */ - for (va = KERNBASE; va < data_end; va += PAGE_SIZE) { + for (va = kernstart; va < data_end; va += PAGE_SIZE) { pte = &(kernel_pmap->pm_pdir[PDIR_IDX(va)][PTBL_IDX(va)]); - pte->rpn = kernload + (va - KERNBASE); + pte->rpn = kernload + (va - kernstart); pte->flags = PTE_M | PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; } @@ -1397,9 +1401,7 @@ mmu_booke_kenter(mmu_t mmu, vm_offset_t KASSERT(((va >= VM_MIN_KERNEL_ADDRESS) && (va <= VM_MAX_KERNEL_ADDRESS)), ("mmu_booke_kenter: invalid va")); - flags = 0; - flags |= (PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID); - flags |= PTE_M; + flags = PTE_M | PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; pte = &(kernel_pmap->pm_pdir[pdir_idx][ptbl_idx]); From owner-svn-src-head@FreeBSD.ORG Thu May 24 20:59:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B234F1065675; Thu, 24 May 2012 20:59:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 37BE18FC17; Thu, 24 May 2012 20:59:59 +0000 (UTC) Message-ID: <4FBEA14E.2060802@FreeBSD.org> Date: Thu, 24 May 2012 16:59:58 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0.1 MIME-Version: 1.0 To: Edward Tomasz Napierala References: <201205241648.q4OGmXha049187@svn.freebsd.org> In-Reply-To: <201205241648.q4OGmXha049187@svn.freebsd.org> X-Enigmail-Version: 1.5pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235918 - head/sys/geom/label X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:59:59 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-05-24 12:48:33 -0400, Edward Tomasz Napierala wrote: > Author: trasz Date: Thu May 24 16:48:33 2012 New Revision: 235918 > URL: http://svn.freebsd.org/changeset/base/235918 > > Log: Make g_label(4) ignore provider size when looking for UFS > labels. Without it, it fails to create labels for filesystems > resized by growfs(8). > > PR: kern/165962 Submitted by: Olivier Cochard-Labbe cochard dot me> > > Modified: head/sys/geom/label/g_label_ufs.c This commit broke my fstab based on ufsid. I have something like this in my fstab: /dev/ufsid/44b3df81873011b5 / ufs rw,noatime 1 1 /dev/ufsid/463b935456452bbd /tmp ufs rw,noatime 2 2 /dev/ufsid/44b3dfc4bfcc4c30 /usr ufs rw,noatime 2 2 /dev/ufsid/463b934b955f63ff /var ufs rw,noatime 2 2 Mounting / as read-only went fine and I had /dev/ada0s1a, /dev/ada0s1d, etc. Strangely, I also had matching ufsid's under /dev/ufsid, e.g., /dev/ufsid/a, /dev/ufsid/d, etc. However, once I do 'mount -u -w /', everything disappears except for root's ufsid. Reverting this commit fixed the problem for me. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk++oU4ACgkQmlay1b9qnVO2dQCfUT8+Z3pKORnH+htSgMUB7+un TK8AnRvL5Oc4vOic1yvceJpyTD5YQOFK =HEVp -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Thu May 24 21:01:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8704106564A; Thu, 24 May 2012 21:01:35 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B39528FC19; Thu, 24 May 2012 21:01:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OL1ZFj060101; Thu, 24 May 2012 21:01:35 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OL1ZNs060098; Thu, 24 May 2012 21:01:35 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242101.q4OL1ZNs060098@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 21:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235933 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:01:35 -0000 Author: marcel Date: Thu May 24 21:01:35 2012 New Revision: 235933 URL: http://svn.freebsd.org/changeset/base/235933 Log: Either the I/O port range or the memory mapped I/O range may not be defined in the FDT. The range will have a zero size in that case. Modified: head/sys/powerpc/mpc85xx/pci_fdt.c Modified: head/sys/powerpc/mpc85xx/pci_fdt.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_fdt.c Thu May 24 20:58:40 2012 (r235932) +++ head/sys/powerpc/mpc85xx/pci_fdt.c Thu May 24 21:01:35 2012 (r235933) @@ -816,8 +816,13 @@ fsl_pcib_set_range(struct fsl_pcib_softc } *allocp = pci_start + alloc; - *vap = (uintptr_t)pmap_mapdev(start, size); - fsl_pcib_outbound(sc, wnd, type, start, size, pci_start); + if (size > 0) { + *vap = (uintptr_t)pmap_mapdev(start, size); + fsl_pcib_outbound(sc, wnd, type, start, size, pci_start); + } else { + *vap = 0; + fsl_pcib_outbound(sc, wnd, -1, 0, 0, 0); + } return (0); } From owner-svn-src-head@FreeBSD.ORG Thu May 24 21:07:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A5D6106564A; Thu, 24 May 2012 21:07:11 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8537C8FC19; Thu, 24 May 2012 21:07:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OL7BmL060356; Thu, 24 May 2012 21:07:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OL7B7p060354; Thu, 24 May 2012 21:07:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242107.q4OL7B7p060354@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 21:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235934 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:07:11 -0000 Author: marcel Date: Thu May 24 21:07:10 2012 New Revision: 235934 URL: http://svn.freebsd.org/changeset/base/235934 Log: Just return if the size of the window is 0. This can happen when the FDT does not define all ranges possible for a particular node (e.g. PCI). While here, only update the trgt_mem and trgt_io pointers if there's no error. This avoids that we knowingly write an invalid target (= -1). Modified: head/sys/powerpc/mpc85xx/mpc85xx.c Modified: head/sys/powerpc/mpc85xx/mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.c Thu May 24 21:01:35 2012 (r235933) +++ head/sys/powerpc/mpc85xx/mpc85xx.c Thu May 24 21:07:10 2012 (r235934) @@ -88,6 +88,9 @@ law_enable(int trgt, u_long addr, u_long uint32_t bar, sr; int i, law_max; + if (size == 0) + return (0); + law_max = law_getmax(); bar = _LAW_BAR(addr); sr = _LAW_SR(trgt, size); @@ -168,7 +171,10 @@ law_pci_target(struct resource *res, int default: rv = ENXIO; } - *trgt_mem = *trgt_io = trgt; + if (rv == 0) { + *trgt_mem = trgt; + *trgt_io = trgt; + } return (rv); } From owner-svn-src-head@FreeBSD.ORG Thu May 24 21:09:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C42F2106566B; Thu, 24 May 2012 21:09:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF6948FC08; Thu, 24 May 2012 21:09:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OL9cS9060486; Thu, 24 May 2012 21:09:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OL9cxI060484; Thu, 24 May 2012 21:09:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242109.q4OL9cxI060484@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 21:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235935 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:09:38 -0000 Author: marcel Date: Thu May 24 21:09:38 2012 New Revision: 235935 URL: http://svn.freebsd.org/changeset/base/235935 Log: Remove Semihakf-ism. DEBUG is a kernel configuration option. It should not be defined in source files. Modified: head/sys/powerpc/mpc85xx/i2c.c Modified: head/sys/powerpc/mpc85xx/i2c.c ============================================================================== --- head/sys/powerpc/mpc85xx/i2c.c Thu May 24 21:07:10 2012 (r235934) +++ head/sys/powerpc/mpc85xx/i2c.c Thu May 24 21:09:38 2012 (r235935) @@ -72,9 +72,6 @@ __FBSDID("$FreeBSD$"); #define I2C_BAUD_RATE_DEF 0x3F #define I2C_DFSSR_DIV 0x10 -#define DEBUG -#undef DEBUG - #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); printf(fmt,##args); } while (0) #else From owner-svn-src-head@FreeBSD.ORG Thu May 24 21:13:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37CD4106564A; Thu, 24 May 2012 21:13:25 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 208F78FC08; Thu, 24 May 2012 21:13:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OLDOeL060687; Thu, 24 May 2012 21:13:24 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OLDOWO060681; Thu, 24 May 2012 21:13:24 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205242113.q4OLDOWO060681@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 24 May 2012 21:13:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235936 - in head/sys/powerpc: aim booke include powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:13:25 -0000 Author: raj Date: Thu May 24 21:13:24 2012 New Revision: 235936 URL: http://svn.freebsd.org/changeset/base/235936 Log: Fix physical address type to vm_paddr_t. Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/pmap.h head/sys/powerpc/powerpc/platform.c head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Thu May 24 21:09:38 2012 (r235935) +++ head/sys/powerpc/aim/mmu_oea.c Thu May 24 21:13:24 2012 (r235936) @@ -289,7 +289,7 @@ boolean_t moea_is_modified(mmu_t, vm_pag boolean_t moea_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea_is_referenced(mmu_t, vm_page_t); boolean_t moea_ts_referenced(mmu_t, vm_page_t); -vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int); +vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea_page_exists_quick(mmu_t, pmap_t, vm_page_t); int moea_page_wired_mappings(mmu_t, vm_page_t); void moea_pinit(mmu_t, pmap_t); @@ -308,14 +308,14 @@ void moea_activate(mmu_t, struct thread void moea_deactivate(mmu_t, struct thread *); void moea_cpu_bootstrap(mmu_t, int); void moea_bootstrap(mmu_t, vm_offset_t, vm_offset_t); -void *moea_mapdev(mmu_t, vm_offset_t, vm_size_t); +void *moea_mapdev(mmu_t, vm_paddr_t, vm_size_t); void *moea_mapdev_attr(mmu_t, vm_offset_t, vm_size_t, vm_memattr_t); void moea_unmapdev(mmu_t, vm_offset_t, vm_size_t); -vm_offset_t moea_kextract(mmu_t, vm_offset_t); +vm_paddr_t moea_kextract(mmu_t, vm_offset_t); void moea_kenter_attr(mmu_t, vm_offset_t, vm_offset_t, vm_memattr_t); -void moea_kenter(mmu_t, vm_offset_t, vm_offset_t); +void moea_kenter(mmu_t, vm_offset_t, vm_paddr_t); void moea_page_set_memattr(mmu_t mmu, vm_page_t m, vm_memattr_t ma); -boolean_t moea_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); +boolean_t moea_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); static void moea_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t); static mmu_method_t moea_methods[] = { @@ -1436,7 +1436,7 @@ moea_page_set_memattr(mmu_t mmu, vm_page * Map a wired page into kernel virtual address space. */ void -moea_kenter(mmu_t mmu, vm_offset_t va, vm_offset_t pa) +moea_kenter(mmu_t mmu, vm_offset_t va, vm_paddr_t pa) { moea_kenter_attr(mmu, va, pa, VM_MEMATTR_DEFAULT); @@ -1471,7 +1471,7 @@ moea_kenter_attr(mmu_t mmu, vm_offset_t * Extract the physical page address associated with the given kernel virtual * address. */ -vm_offset_t +vm_paddr_t moea_kextract(mmu_t mmu, vm_offset_t va) { struct pvo_entry *pvo; @@ -1512,8 +1512,8 @@ moea_kremove(mmu_t mmu, vm_offset_t va) * first usable address after the mapped region. */ vm_offset_t -moea_map(mmu_t mmu, vm_offset_t *virt, vm_offset_t pa_start, - vm_offset_t pa_end, int prot) +moea_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t pa_start, + vm_paddr_t pa_end, int prot) { vm_offset_t sva, va; @@ -2408,7 +2408,7 @@ moea_bat_mapped(int idx, vm_offset_t pa, } boolean_t -moea_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size) +moea_dev_direct_mapped(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { int i; @@ -2431,7 +2431,7 @@ moea_dev_direct_mapped(mmu_t mmu, vm_off * NOT real memory. */ void * -moea_mapdev(mmu_t mmu, vm_offset_t pa, vm_size_t size) +moea_mapdev(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { return (moea_mapdev_attr(mmu, pa, size, VM_MEMATTR_DEFAULT)); Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu May 24 21:09:38 2012 (r235935) +++ head/sys/powerpc/booke/pmap.c Thu May 24 21:13:24 2012 (r235936) @@ -291,7 +291,7 @@ static boolean_t mmu_booke_is_modified(m static boolean_t mmu_booke_is_prefaultable(mmu_t, pmap_t, vm_offset_t); static boolean_t mmu_booke_is_referenced(mmu_t, vm_page_t); static boolean_t mmu_booke_ts_referenced(mmu_t, vm_page_t); -static vm_offset_t mmu_booke_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, +static vm_offset_t mmu_booke_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); static int mmu_booke_mincore(mmu_t, pmap_t, vm_offset_t, vm_paddr_t *); @@ -316,12 +316,12 @@ static void mmu_booke_zero_page_idle(mm static void mmu_booke_activate(mmu_t, struct thread *); static void mmu_booke_deactivate(mmu_t, struct thread *); static void mmu_booke_bootstrap(mmu_t, vm_offset_t, vm_offset_t); -static void *mmu_booke_mapdev(mmu_t, vm_offset_t, vm_size_t); +static void *mmu_booke_mapdev(mmu_t, vm_paddr_t, vm_size_t); static void mmu_booke_unmapdev(mmu_t, vm_offset_t, vm_size_t); -static vm_offset_t mmu_booke_kextract(mmu_t, vm_offset_t); -static void mmu_booke_kenter(mmu_t, vm_offset_t, vm_offset_t); +static vm_paddr_t mmu_booke_kextract(mmu_t, vm_offset_t); +static void mmu_booke_kenter(mmu_t, vm_offset_t, vm_paddr_t); static void mmu_booke_kremove(mmu_t, vm_offset_t); -static boolean_t mmu_booke_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); +static boolean_t mmu_booke_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); static void mmu_booke_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t); static vm_offset_t mmu_booke_dumpsys_map(mmu_t, struct pmap_md *, @@ -1391,7 +1391,7 @@ mmu_booke_qremove(mmu_t mmu, vm_offset_t * Map a wired page into kernel virtual address space. */ static void -mmu_booke_kenter(mmu_t mmu, vm_offset_t va, vm_offset_t pa) +mmu_booke_kenter(mmu_t mmu, vm_offset_t va, vm_paddr_t pa) { unsigned int pdir_idx = PDIR_IDX(va); unsigned int ptbl_idx = PTBL_IDX(va); @@ -1814,8 +1814,8 @@ mmu_booke_remove_all(mmu_t mmu, vm_page_ * Map a range of physical addresses into kernel virtual address space. */ static vm_offset_t -mmu_booke_map(mmu_t mmu, vm_offset_t *virt, vm_offset_t pa_start, - vm_offset_t pa_end, int prot) +mmu_booke_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t pa_start, + vm_paddr_t pa_end, int prot) { vm_offset_t sva = *virt; vm_offset_t va = sva; @@ -2441,7 +2441,7 @@ mmu_booke_page_wired_mappings(mmu_t mmu, } static int -mmu_booke_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size) +mmu_booke_dev_direct_mapped(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { int i; vm_offset_t va; @@ -2599,7 +2599,7 @@ mmu_booke_scan_md(mmu_t mmu, struct pmap * for mapping device memory, NOT real memory. */ static void * -mmu_booke_mapdev(mmu_t mmu, vm_offset_t pa, vm_size_t size) +mmu_booke_mapdev(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { void *res; uintptr_t va; Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Thu May 24 21:09:38 2012 (r235935) +++ head/sys/powerpc/include/pmap.h Thu May 24 21:13:24 2012 (r235936) @@ -224,16 +224,16 @@ extern struct pmap kernel_pmap_store; #define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) void pmap_bootstrap(vm_offset_t, vm_offset_t); -void pmap_kenter(vm_offset_t va, vm_offset_t pa); +void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void pmap_kenter_attr(vm_offset_t va, vm_offset_t pa, vm_memattr_t); void pmap_kremove(vm_offset_t); -void *pmap_mapdev(vm_offset_t, vm_size_t); +void *pmap_mapdev(vm_paddr_t, vm_size_t); void *pmap_mapdev_attr(vm_offset_t, vm_size_t, vm_memattr_t); void pmap_unmapdev(vm_offset_t, vm_size_t); void pmap_page_set_memattr(vm_page_t, vm_memattr_t); void pmap_deactivate(struct thread *); -vm_offset_t pmap_kextract(vm_offset_t); -int pmap_dev_direct_mapped(vm_offset_t, vm_size_t); +vm_paddr_t pmap_kextract(vm_offset_t); +int pmap_dev_direct_mapped(vm_paddr_t, vm_size_t); boolean_t pmap_mmu_install(char *name, int prio); #define vtophys(va) pmap_kextract((vm_offset_t)(va)) Modified: head/sys/powerpc/powerpc/platform.c ============================================================================== --- head/sys/powerpc/powerpc/platform.c Thu May 24 21:09:38 2012 (r235935) +++ head/sys/powerpc/powerpc/platform.c Thu May 24 21:13:24 2012 (r235936) @@ -92,7 +92,7 @@ mem_valid(vm_offset_t addr, int len) &aregions, &naregions); for (i = 0; i < npregions; i++) - if ((addr >= pregions[i].mr_start) + if ((addr >= pregions[i].mr_start) && (addr + len <= pregions[i].mr_start + pregions[i].mr_size)) return (0); @@ -116,7 +116,7 @@ platform_timebase_freq(struct cpuref *cp { return (PLATFORM_TIMEBASE_FREQ(plat_obj, cpu)); } - + int platform_smp_first_cpu(struct cpuref *cpu) { Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Thu May 24 21:09:38 2012 (r235935) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Thu May 24 21:13:24 2012 (r235936) @@ -440,7 +440,7 @@ pmap_cpu_bootstrap(int ap) } void * -pmap_mapdev(vm_offset_t pa, vm_size_t size) +pmap_mapdev(vm_paddr_t pa, vm_size_t size) { CTR3(KTR_PMAP, "%s(%#x, %#x)", __func__, pa, size); @@ -471,7 +471,7 @@ pmap_unmapdev(vm_offset_t va, vm_size_t MMU_UNMAPDEV(mmu_obj, va, size); } -vm_offset_t +vm_paddr_t pmap_kextract(vm_offset_t va) { @@ -480,7 +480,7 @@ pmap_kextract(vm_offset_t va) } void -pmap_kenter(vm_offset_t va, vm_offset_t pa) +pmap_kenter(vm_offset_t va, vm_paddr_t pa) { CTR3(KTR_PMAP, "%s(%#x, %#x)", __func__, va, pa); @@ -496,7 +496,7 @@ pmap_kenter_attr(vm_offset_t va, vm_offs } boolean_t -pmap_dev_direct_mapped(vm_offset_t pa, vm_size_t size) +pmap_dev_direct_mapped(vm_paddr_t pa, vm_size_t size) { CTR3(KTR_PMAP, "%s(%#x, %#x)", __func__, pa, size); From owner-svn-src-head@FreeBSD.ORG Thu May 24 21:13:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33521106564A; Thu, 24 May 2012 21:13:58 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id F3F4F8FC14; Thu, 24 May 2012 21:13:57 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M4J00500PN87P00@smtpauth3.wiscmail.wisc.edu>; Thu, 24 May 2012 16:13:57 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-user-nat.icecube.wisc.edu [128.104.255.12]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M4J00GRIPN7QS30@smtpauth3.wiscmail.wisc.edu>; Thu, 24 May 2012 16:13:56 -0500 (CDT) Date: Thu, 24 May 2012 16:13:55 -0500 From: Nathan Whitehorn In-reply-to: <201205242045.q4OKjipb059398@svn.freebsd.org> To: Marcel Moolenaar Message-id: <4FBEA493.4020702@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.255.12 X-Spam-PmxInfo: Server=avs-14, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.24.210315, SenderIP=128.104.255.12 References: <201205242045.q4OKjipb059398@svn.freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:13:58 -0000 On 05/24/12 15:45, Marcel Moolenaar wrote: > Author: marcel > Date: Thu May 24 20:45:44 2012 > New Revision: 235931 > URL: http://svn.freebsd.org/changeset/base/235931 > > Log: > Fix the memory barriers for CPUs that do not like lwsync and wedge or cause > exceptions early enough during boot that the kernel will do ithe same. > Use lwsync only when compiling for LP64 and revert to the more proven isync > when compiling for ILP32. Note that in the end (i.e. between revision 222198 > and this change) ILP32 changed from using sync to using isync. As per Nathan > the isync is needed to make sure I/O accesses are properly serialized with > locks and isync tends to be more effecient than sync. > This badly breaks the synchronization primitives. The functions mb()/wmb()/rmb() need to be sync or lwsync on ILP32, not isync. As the comment notes, isync only provides a barrier in conjunction with the atomic operations and atomic retry loop -- this is why there is a distinction between *mb() and __ATOMIC_*(). Moreover, __ATOMIC_ACQ() *must* be isync, not lwsync, on PPC64 without changes to the bus_space accessors. Using lwsync causes bus space operations to leak across mutex acquisition which causes the expected severe problems on at least my machine. Summary: 1. *mb() must be lwsync or sync on all machines, except for wmb() which could be eieio 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync with bus_space changes) 3. __ATOMIC_REL() must be lwsync or sync -Nathan From owner-svn-src-head@FreeBSD.ORG Thu May 24 21:23:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B7C2C106564A; Thu, 24 May 2012 21:23:13 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A15FB8FC0A; Thu, 24 May 2012 21:23:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OLNDPU061111; Thu, 24 May 2012 21:23:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OLNDv7061108; Thu, 24 May 2012 21:23:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242123.q4OLNDv7061108@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 21:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235937 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:23:13 -0000 Author: marcel Date: Thu May 24 21:23:13 2012 New Revision: 235937 URL: http://svn.freebsd.org/changeset/base/235937 Log: A few improvements: 1. Define all registers. These definitions are needed to support the FCM driver for direct-connect NAND. 2. Repurpose lbc_read_reg() and lbc_write_reg() for use by localbus attached device drivers. Use bus_space functions directly in the lbc driver itself. 3. Be smarter about programming LAWs and mapping memory. The ranges defined in the FDT are per bank (= chip select) and since we can have up to 8 banks, we could easily use more than 8 LAWs or TLB enrties when per-bank memory ranges need multiple LAWs or TLBs due to alignment or size constraints. We now combine all memory ranges into the fewest possible set of contiguous regions and program the hardware for that. Thus, a cleverly written FDT with 8 devices may still only need 1 LAW or 1 TLB entry. Note that the memory ranges can be assigned randomly to the banks. We sort as we build to handle that. 4. Support the FCM when programming the OR register. This is mostly for documention purposes as we do not have a way to define the mode for a bank. 5. Remove Semihalf-ism: do not define DEBUG (only to undefine it again). Modified: head/sys/powerpc/mpc85xx/lbc.c head/sys/powerpc/mpc85xx/lbc.h Modified: head/sys/powerpc/mpc85xx/lbc.c ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.c Thu May 24 21:13:24 2012 (r235936) +++ head/sys/powerpc/mpc85xx/lbc.c Thu May 24 21:23:13 2012 (r235937) @@ -56,9 +56,6 @@ __FBSDID("$FreeBSD$"); #include "ofw_bus_if.h" #include "lbc.h" -#define DEBUG -#undef DEBUG - #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ printf(fmt,##args); } while (0) @@ -66,20 +63,6 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif -static __inline void -lbc_write_reg(struct lbc_softc *sc, bus_size_t off, uint32_t val) -{ - - bus_space_write_4(sc->sc_bst, sc->sc_bsh, off, val); -} - -static __inline uint32_t -lbc_read_reg(struct lbc_softc *sc, bus_size_t off) -{ - - return (bus_space_read_4(sc->sc_bst, sc->sc_bsh, off)); -} - static MALLOC_DEFINE(M_LBC, "localbus", "localbus devices information"); static int lbc_probe(device_t); @@ -161,46 +144,123 @@ lbc_address_mask(uint32_t size) static void lbc_banks_unmap(struct lbc_softc *sc) { - int i; - - for (i = 0; i < LBC_DEV_MAX; i++) { - if (sc->sc_banks[i].size == 0) - continue; + int r; - law_disable(OCP85XX_TGTIF_LBC, sc->sc_banks[i].pa, - sc->sc_banks[i].size); - pmap_unmapdev(sc->sc_banks[i].va, sc->sc_banks[i].size); + r = 0; + while (r < LBC_DEV_MAX) { + if (sc->sc_range[r].size == 0) + return; + + pmap_unmapdev(sc->sc_range[r].kva, sc->sc_range[r].size); + law_disable(OCP85XX_TGTIF_LBC, sc->sc_range[r].addr, + sc->sc_range[r].size); + r++; } } static int lbc_banks_map(struct lbc_softc *sc) { - u_long start, size; - int error, i; + vm_paddr_t end, start; + vm_size_t size; + u_int i, r, ranges, s; + int error; + bzero(sc->sc_range, sizeof(sc->sc_range)); + + /* + * Determine number of discontiguous address ranges to program. + */ + ranges = 0; for (i = 0; i < LBC_DEV_MAX; i++) { - if (sc->sc_banks[i].size == 0) + size = sc->sc_banks[i].size; + if (size == 0) continue; - /* Physical address start/size. */ - start = sc->sc_banks[i].pa; - size = sc->sc_banks[i].size; + start = sc->sc_banks[i].addr; + for (r = 0; r < ranges; r++) { + /* Avoid wrap-around bugs. */ + end = sc->sc_range[r].addr - 1 + sc->sc_range[r].size; + if (start > 0 && end == start - 1) { + sc->sc_range[r].size += size; + break; + } + /* Avoid wrap-around bugs. */ + end = start - 1 + size; + if (sc->sc_range[r].addr > 0 && + end == sc->sc_range[r].addr - 1) { + sc->sc_range[r].addr = start; + sc->sc_range[r].size += size; + break; + } + } + if (r == ranges) { + /* New range; add using insertion sort */ + r = 0; + while (r < ranges && sc->sc_range[r].addr < start) + r++; + for (s = ranges; s > r; s--) + sc->sc_range[s] = sc->sc_range[s-1]; + sc->sc_range[r].addr = start; + sc->sc_range[r].size = size; + ranges++; + } + } - /* - * Configure LAW for this LBC bank (CS) and map its physical - * memory region into KVA. - */ + /* + * Ranges are sorted so quickly go over the list to merge ranges + * that grew toward each other while building the ranges. + */ + r = 0; + while (r < ranges - 1) { + end = sc->sc_range[r].addr + sc->sc_range[r].size; + if (end != sc->sc_range[r+1].addr) { + r++; + continue; + } + sc->sc_range[r].size += sc->sc_range[r+1].size; + for (s = r + 1; s < ranges - 1; s++) + sc->sc_range[s] = sc->sc_range[s+1]; + bzero(&sc->sc_range[s], sizeof(sc->sc_range[s])); + ranges--; + } + + /* + * Configure LAW for the LBC ranges and map the physical memory + * range into KVA. + */ + for (r = 0; r < ranges; r++) { + start = sc->sc_range[r].addr; + size = sc->sc_range[r].size; error = law_enable(OCP85XX_TGTIF_LBC, start, size); if (error) return (error); + sc->sc_range[r].kva = (vm_offset_t)pmap_mapdev(start, size); + } + + /* XXX: need something better here? */ + if (ranges == 0) + return (EINVAL); + + /* Assign KVA to banks based on the enclosing range. */ + for (i = 0; i < LBC_DEV_MAX; i++) { + size = sc->sc_banks[i].size; + if (size == 0) + continue; - sc->sc_banks[i].va = (vm_offset_t)pmap_mapdev(start, size); - if (sc->sc_banks[i].va == 0) { - lbc_banks_unmap(sc); - return (ENOSPC); + start = sc->sc_banks[i].addr; + for (r = 0; r < ranges; r++) { + end = sc->sc_range[r].addr - 1 + sc->sc_range[r].size; + if (start >= sc->sc_range[r].addr && + start - 1 + size <= end) + break; + } + if (r < ranges) { + sc->sc_banks[i].kva = sc->sc_range[r].kva + + (start - sc->sc_range[r].addr); } } + return (0); } @@ -213,14 +273,18 @@ lbc_banks_enable(struct lbc_softc *sc) for (i = 0; i < LBC_DEV_MAX; i++) { size = sc->sc_banks[i].size; - if (size == 0) + if (size == 0) { + bus_space_write_4(sc->sc_bst, sc->sc_bsh, + LBC85XX_BR(i), 0); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, + LBC85XX_OR(i), 0); continue; + } + /* * Compute and program BR value. */ - regval = 0; - regval |= sc->sc_banks[i].pa; - + regval = sc->sc_banks[i].addr; switch (sc->sc_banks[i].width) { case 8: regval |= (1 << 11); @@ -240,24 +304,22 @@ lbc_banks_enable(struct lbc_softc *sc) regval |= (sc->sc_banks[i].msel << 5); regval |= (sc->sc_banks[i].atom << 2); regval |= 1; - - lbc_write_reg(sc, LBC85XX_BR(i), regval); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, + LBC85XX_BR(i), regval); /* * Compute and program OR value. */ - regval = 0; - regval |= lbc_address_mask(size); - + regval = lbc_address_mask(size); switch (sc->sc_banks[i].msel) { case LBCRES_MSEL_GPCM: /* TODO Add flag support for option registers */ - regval |= 0x00000ff7; + regval |= 0x0ff7; break; case LBCRES_MSEL_FCM: - printf("FCM mode not supported yet!"); - error = ENOSYS; - goto fail; + /* TODO Add flag support for options register */ + regval |= 0x0796; + break; case LBCRES_MSEL_UPMA: case LBCRES_MSEL_UPMB: case LBCRES_MSEL_UPMC: @@ -265,7 +327,8 @@ lbc_banks_enable(struct lbc_softc *sc) error = ENOSYS; goto fail; } - lbc_write_reg(sc, LBC85XX_OR(i), regval); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, + LBC85XX_OR(i), regval); } /* @@ -276,7 +339,7 @@ lbc_banks_enable(struct lbc_softc *sc) * - set ECC parity type * - set bus monitor timing and timer prescale */ - lbc_write_reg(sc, LBC85XX_LBCR, 0); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_LBCR, 0); /* * Initialize clock ratio register: @@ -284,8 +347,7 @@ lbc_banks_enable(struct lbc_softc *sc) * - configure LCLK delay cycles for the assertion of LALE * - set system clock divider */ - lbc_write_reg(sc, LBC85XX_LCRR, 0x00030008); - + bus_space_write_4(sc->sc_bst, sc->sc_bsh, LBC85XX_LCRR, 0x00030008); return (0); fail: @@ -348,7 +410,7 @@ fdt_lbc_reg_decode(phandle_t node, struc reg += addr_cells - 1 + size_cells; /* Calculate address range relative to VA base. */ - start = sc->sc_banks[bank].va + start; + start = sc->sc_banks[bank].kva + start; end = start + count - 1; debugf("reg addr bank = %d, start = %lx, end = %lx, " @@ -479,7 +541,7 @@ lbc_attach(device_t dev) debugf("bank = %d, start = %lx, size = %lx\n", bank, start, size); - sc->sc_banks[bank].pa = start + offset; + sc->sc_banks[bank].addr = start + offset; sc->sc_banks[bank].size = size; /* @@ -676,3 +738,21 @@ lbc_get_devinfo(device_t bus, device_t c di = device_get_ivars(child); return (&di->di_ofw); } + +void +lbc_write_reg(device_t child, u_int off, uint32_t val) +{ + struct lbc_softc *sc; + + sc = device_get_softc(device_get_parent(child)); + bus_space_write_4(sc->sc_bst, sc->sc_bsh, off, val); +} + +uint32_t +lbc_read_reg(device_t child, u_int off) +{ + struct lbc_softc *sc; + + sc = device_get_softc(device_get_parent(child)); + return (bus_space_read_4(sc->sc_bst, sc->sc_bsh, off)); +} Modified: head/sys/powerpc/mpc85xx/lbc.h ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.h Thu May 24 21:13:24 2012 (r235936) +++ head/sys/powerpc/mpc85xx/lbc.h Thu May 24 21:23:13 2012 (r235937) @@ -33,10 +33,35 @@ #define LBC_DEV_MAX 8 /* Local access registers */ -#define LBC85XX_BR(n) (8 * n) -#define LBC85XX_OR(n) (4 + (8 * n)) -#define LBC85XX_LBCR (0xd0) -#define LBC85XX_LCRR (0xd4) +#define LBC85XX_BR(n) (0x0 + (8 * n)) /* Base register 0-7 */ +#define LBC85XX_OR(n) (0x4 + (8 * n)) /* Options register 0-7 */ +#define LBC85XX_MAR 0x068 /* UPM address register */ +#define LBC85XX_MAMR 0x070 /* UPMA mode register */ +#define LBC85XX_MBMR 0x074 /* UPMB mode register */ +#define LBC85XX_MCMR 0x078 /* UPMC mode register */ +#define LBC85XX_MRTPR 0x084 /* Memory refresh timer prescaler */ +#define LBC85XX_MDR 0x088 /* UPM data register */ +#define LBC85XX_LSOR 0x090 /* Special operation initiation */ +#define LBC85XX_LURT 0x0a0 /* UPM refresh timer */ +#define LBC85XX_LSRT 0x0a4 /* SDRAM refresh timer */ +#define LBC85XX_LTESR 0x0b0 /* Transfer error status register */ +#define LBC85XX_LTEDR 0x0b4 /* Transfer error disable register */ +#define LBC85XX_LTEIR 0x0b8 /* Transfer error interrupt register */ +#define LBC85XX_LTEATR 0x0bc /* Transfer error attributes register */ +#define LBC85XX_LTEAR 0x0c0 /* Transfer error address register */ +#define LBC85XX_LTECCR 0x0c4 /* Transfer error ECC register */ +#define LBC85XX_LBCR 0x0d0 /* Configuration register */ +#define LBC85XX_LCRR 0x0d4 /* Clock ratio register */ +#define LBC85XX_FMR 0x0e0 /* Flash mode register */ +#define LBC85XX_FIR 0x0e4 /* Flash instruction register */ +#define LBC85XX_FCR 0x0e8 /* Flash command register */ +#define LBC85XX_FBAR 0x0ec /* Flash block address register */ +#define LBC85XX_FPAR 0x0f0 /* Flash page address register */ +#define LBC85XX_FBCR 0x0f4 /* Flash byte count register */ +#define LBC85XX_FECC0 0x100 /* Flash ECC block 0 register */ +#define LBC85XX_FECC1 0x104 /* Flash ECC block 0 register */ +#define LBC85XX_FECC2 0x108 /* Flash ECC block 0 register */ +#define LBC85XX_FECC3 0x10c /* Flash ECC block 0 register */ /* LBC machine select */ #define LBCRES_MSEL_GPCM 0 @@ -55,10 +80,16 @@ #define LBCRES_ATOM_RAWA 1 #define LBCRES_ATOM_WARA 2 +struct lbc_memrange { + vm_paddr_t addr; + vm_size_t size; + vm_offset_t kva; +}; + struct lbc_bank { - u_long pa; /* physical addr of the bank */ - u_long size; /* bank size */ - vm_offset_t va; /* VA of the bank */ + vm_paddr_t addr; /* physical addr of the bank */ + vm_size_t size; /* bank size */ + vm_offset_t kva; /* VA of the bank */ /* * XXX the following bank attributes do not have properties specified @@ -84,6 +115,7 @@ struct lbc_softc { int sc_addr_cells; int sc_size_cells; + struct lbc_memrange sc_range[LBC_DEV_MAX]; struct lbc_bank sc_banks[LBC_DEV_MAX]; }; @@ -93,4 +125,7 @@ struct lbc_devinfo { int di_bank; }; +uint32_t lbc_read_reg(device_t child, u_int off); +void lbc_write_reg(device_t child, u_int off, uint32_t val); + #endif /* _MACHINE_LBC_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu May 24 21:24:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74D18106564A; Thu, 24 May 2012 21:24:24 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 601FB8FC16; Thu, 24 May 2012 21:24:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OLOOSS061194; Thu, 24 May 2012 21:24:24 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OLOOM8061191; Thu, 24 May 2012 21:24:24 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205242124.q4OLOOM8061191@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 24 May 2012 21:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235938 - head/sys/dev/sec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:24:24 -0000 Author: raj Date: Thu May 24 21:24:23 2012 New Revision: 235938 URL: http://svn.freebsd.org/changeset/base/235938 Log: Recognize version 3.1 of the SEC crypto engine. Modified: head/sys/dev/sec/sec.c head/sys/dev/sec/sec.h Modified: head/sys/dev/sec/sec.c ============================================================================== --- head/sys/dev/sec/sec.c Thu May 24 21:23:13 2012 (r235937) +++ head/sys/dev/sec/sec.c Thu May 24 21:24:23 2012 (r235938) @@ -227,6 +227,10 @@ sec_probe(device_t dev) device_set_desc(dev, "Freescale Security Engine 3.0"); sc->sc_version = 3; break; + case SEC_31_ID: + device_set_desc(dev, "Freescale Security Engine 3.1"); + sc->sc_version = 3; + break; default: device_printf(dev, "unknown SEC ID 0x%016llx!\n", id); return (ENXIO); Modified: head/sys/dev/sec/sec.h ============================================================================== --- head/sys/dev/sec/sec.h Thu May 24 21:23:13 2012 (r235937) +++ head/sys/dev/sec/sec.h Thu May 24 21:24:23 2012 (r235938) @@ -46,6 +46,7 @@ /* SEC information */ #define SEC_20_ID 0x0000000000000040ULL #define SEC_30_ID 0x0030030000000000ULL +#define SEC_31_ID 0x0030030100000000ULL #define SEC_CHANNELS 4 #define SEC_POINTERS 7 #define SEC_MAX_DMA_BLOCK_SIZE 0xFFFF From owner-svn-src-head@FreeBSD.ORG Thu May 24 21:44:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 820B81065673; Thu, 24 May 2012 21:44:47 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 622ED8FC24; Thu, 24 May 2012 21:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OLilBu062099; Thu, 24 May 2012 21:44:47 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OLilHY062093; Thu, 24 May 2012 21:44:47 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201205242144.q4OLilHY062093@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 24 May 2012 21:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235939 - in head: lib/libstand sys/x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:44:47 -0000 Author: obrien Date: Thu May 24 21:44:46 2012 New Revision: 235939 URL: http://svn.freebsd.org/changeset/base/235939 Log: Consitently use "__LP64__". [there are 33 __LP64__'s in the kernel (minus cddl/ and contrib/), and 11 _LP64's] Modified: head/lib/libstand/bswap.c head/sys/x86/include/_limits.h head/sys/x86/include/_stdint.h head/sys/x86/include/_types.h head/sys/x86/include/float.h Modified: head/lib/libstand/bswap.c ============================================================================== --- head/lib/libstand/bswap.c Thu May 24 21:24:23 2012 (r235938) +++ head/lib/libstand/bswap.c Thu May 24 21:44:46 2012 (r235939) @@ -31,7 +31,7 @@ bswap32(u_int32_t x) u_int64_t bswap64(u_int64_t x) { -#ifdef _LP64 +#ifdef __LP64__ /* * Assume we have wide enough registers to do it without touching * memory. Modified: head/sys/x86/include/_limits.h ============================================================================== --- head/sys/x86/include/_limits.h Thu May 24 21:24:23 2012 (r235938) +++ head/sys/x86/include/_limits.h Thu May 24 21:44:46 2012 (r235939) @@ -57,7 +57,7 @@ #define __INT_MAX 0x7fffffff /* max value for an int */ #define __INT_MIN (-0x7fffffff - 1) /* min value for an int */ -#ifdef _LP64 +#ifdef __LP64__ #define __ULONG_MAX 0xffffffffffffffff /* max for an unsigned long */ #define __LONG_MAX 0x7fffffffffffffff /* max for a long */ #define __LONG_MIN (-0x7fffffffffffffff - 1) /* min for a long */ @@ -72,7 +72,7 @@ #define __LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ #define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ -#ifdef _LP64 +#ifdef __LP64__ #define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */ #define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */ #define __OFF_MAX __LONG_MAX /* max value for an off_t */ Modified: head/sys/x86/include/_stdint.h ============================================================================== --- head/sys/x86/include/_stdint.h Thu May 24 21:24:23 2012 (r235938) +++ head/sys/x86/include/_stdint.h Thu May 24 21:44:46 2012 (r235939) @@ -50,7 +50,7 @@ #define UINT16_C(c) (c) #define UINT32_C(c) (c ## U) -#ifdef _LP64 +#ifdef __LP64__ #define INT64_C(c) (c ## L) #define UINT64_C(c) (c ## UL) #else @@ -81,7 +81,7 @@ #define UINT16_MAX 0xffff #define UINT32_MAX 0xffffffffU -#ifdef _LP64 +#ifdef __LP64__ #define INT64_MIN (-0x7fffffffffffffff-1) #define INT64_MAX 0x7fffffffffffffff #define UINT64_MAX 0xffffffffffffffff @@ -139,7 +139,7 @@ * ISO/IEC 9899:1999 * 7.18.2.4 Limits of integer types capable of holding object pointers */ -#ifdef _LP64 +#ifdef __LP64__ #define INTPTR_MIN INT64_MIN #define INTPTR_MAX INT64_MAX #define UINTPTR_MAX UINT64_MAX @@ -161,7 +161,7 @@ * ISO/IEC 9899:1999 * 7.18.3 Limits of other integer types */ -#ifdef _LP64 +#ifdef __LP64__ /* Limits of ptrdiff_t. */ #define PTRDIFF_MIN INT64_MIN #define PTRDIFF_MAX INT64_MAX Modified: head/sys/x86/include/_types.h ============================================================================== --- head/sys/x86/include/_types.h Thu May 24 21:24:23 2012 (r235938) +++ head/sys/x86/include/_types.h Thu May 24 21:44:46 2012 (r235939) @@ -54,7 +54,7 @@ typedef short __int16_t; typedef unsigned short __uint16_t; typedef int __int32_t; typedef unsigned int __uint32_t; -#ifdef _LP64 +#ifdef __LP64__ typedef long __int64_t; typedef unsigned long __uint64_t; #else @@ -73,7 +73,7 @@ typedef unsigned long long __uint64_t; /* * Standard type definitions. */ -#ifdef _LP64 +#ifdef __LP64__ typedef __int32_t __clock_t; /* clock()... */ typedef __int64_t __critical_t; typedef double __double_t; @@ -97,7 +97,7 @@ typedef __int8_t __int_least8_t; typedef __int16_t __int_least16_t; typedef __int32_t __int_least32_t; typedef __int64_t __int_least64_t; -#ifdef _LP64 +#ifdef __LP64__ typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ typedef __int64_t __register_t; typedef __int64_t __segsz_t; /* segment size (in pages) */ @@ -125,7 +125,7 @@ typedef __uint8_t __uint_least8_t; typedef __uint16_t __uint_least16_t; typedef __uint32_t __uint_least32_t; typedef __uint64_t __uint_least64_t; -#ifdef _LP64 +#ifdef __LP64__ typedef __uint64_t __u_register_t; typedef __uint64_t __vm_offset_t; typedef __uint64_t __vm_paddr_t; Modified: head/sys/x86/include/float.h ============================================================================== --- head/sys/x86/include/float.h Thu May 24 21:24:23 2012 (r235938) +++ head/sys/x86/include/float.h Thu May 24 21:44:46 2012 (r235939) @@ -42,7 +42,7 @@ __END_DECLS #define FLT_RADIX 2 /* b */ #define FLT_ROUNDS __flt_rounds() #if __ISO_C_VISIBLE >= 1999 -#ifdef _LP64 +#ifdef __LP64__ #define FLT_EVAL_METHOD 0 /* no promotions */ #else #define FLT_EVAL_METHOD (-1) /* i387 semantics are...interesting */ From owner-svn-src-head@FreeBSD.ORG Thu May 24 22:00:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0FAB106564A; Thu, 24 May 2012 22:00:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 898BC8FC15; Thu, 24 May 2012 22:00:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OM0nlk062859; Thu, 24 May 2012 22:00:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OM0nAa062851; Thu, 24 May 2012 22:00:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205242200.q4OM0nAa062851@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 22:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235941 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:00:49 -0000 Author: bz Date: Thu May 24 22:00:48 2012 New Revision: 235941 URL: http://svn.freebsd.org/changeset/base/235941 Log: MFp4 bz_ipv6_fast: in_cksum.h required ip.h to be included for struct ip. To be able to use some general checksum functions like in_addword() in a non-IPv4 context, limit the (also exported to user space) IPv4 specific functions to the times, when the ip.h header is present and IPVERSION is defined (to 4). We should consider more general checksum (updating) functions to also allow easier incremental checksum updates in the L3/4 stack and firewalls, as well as ponder further requirements by certain NIC drivers needing slightly different pseudo values in offloading cases. Thinking in terms of a better "library". Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/amd64/include/in_cksum.h head/sys/arm/include/in_cksum.h head/sys/i386/include/in_cksum.h head/sys/ia64/include/in_cksum.h head/sys/mips/include/in_cksum.h head/sys/powerpc/include/in_cksum.h head/sys/sparc64/include/in_cksum.h Modified: head/sys/amd64/include/in_cksum.h ============================================================================== --- head/sys/amd64/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/amd64/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -43,6 +43,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) /* * It it useful to have an Internet checksum routine which is inlineable * and optimized specifically for the task of computing IP header checksums @@ -69,9 +70,12 @@ in_cksum_update(struct ip *ip) } while(0) #endif +#endif #ifdef _KERNEL +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); u_short in_cksum_skip(struct mbuf *m, int len, int skip); Modified: head/sys/arm/include/in_cksum.h ============================================================================== --- head/sys/arm/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/arm/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -46,7 +46,9 @@ u_short in_cksum(struct mbuf *m, int len u_short in_addword(u_short sum, u_short b); u_short in_cksum_skip(struct mbuf *m, int len, int skip); u_int do_cksum(const void *, int); +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *); +#endif static __inline u_short in_pseudo(u_int sum, u_int b, u_int c) Modified: head/sys/i386/include/in_cksum.h ============================================================================== --- head/sys/i386/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/i386/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -54,6 +54,7 @@ * therefore always exactly five 32-bit words. */ #if defined(__GNUCLIKE_ASM) && !defined(__INTEL_COMPILER) +#if defined(IPVERSION) && (IPVERSION == 4) static __inline u_int in_cksum_hdr(const struct ip *ip) { @@ -88,6 +89,7 @@ in_cksum_update(struct ip *ip) __tmpsum = (int)ntohs(ip->ip_sum) + 256; ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); } +#endif static __inline u_short in_addword(u_short sum, u_short b) @@ -121,6 +123,7 @@ in_pseudo(u_int sum, u_int b, u_int c) } #else +#if defined(IPVERSION) && (IPVERSION == 4) #define in_cksum_update(ip) \ do { \ int __tmpsum; \ @@ -129,10 +132,13 @@ in_pseudo(u_int sum, u_int b, u_int c) } while(0) #endif +#endif #ifdef _KERNEL #if !defined(__GNUCLIKE_ASM) || defined(__INTEL_COMPILER) +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); #endif Modified: head/sys/ia64/include/in_cksum.h ============================================================================== --- head/sys/ia64/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/ia64/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -39,6 +39,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) /* * It it useful to have an Internet checksum routine which is inlineable * and optimized specifically for the task of computing IP header checksums @@ -65,9 +66,12 @@ in_cksum_update(struct ip *ip) } while(0) #endif +#endif #ifdef _KERNEL +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); u_short in_cksum_skip(struct mbuf *m, int len, int skip); Modified: head/sys/mips/include/in_cksum.h ============================================================================== --- head/sys/mips/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/mips/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -40,6 +40,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) /* * It it useful to have an Internet checksum routine which is inlineable * and optimized specifically for the task of computing IP header checksums @@ -66,9 +67,12 @@ in_cksum_update(struct ip *ip) } while(0) #endif +#endif #ifdef _KERNEL +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); u_short in_cksum_skip(struct mbuf *m, int len, int skip); Modified: head/sys/powerpc/include/in_cksum.h ============================================================================== --- head/sys/powerpc/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/powerpc/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -39,6 +39,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) /* * It it useful to have an Internet checksum routine which is inlineable * and optimized specifically for the task of computing IP header checksums @@ -65,9 +66,12 @@ in_cksum_update(struct ip *ip) } while(0) #endif +#endif #ifdef _KERNEL +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); u_short in_cksum_skip(struct mbuf *m, int len, int skip); Modified: head/sys/sparc64/include/in_cksum.h ============================================================================== --- head/sys/sparc64/include/in_cksum.h Thu May 24 21:55:36 2012 (r235940) +++ head/sys/sparc64/include/in_cksum.h Thu May 24 22:00:48 2012 (r235941) @@ -65,6 +65,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) static __inline void in_cksum_update(struct ip *ip) { @@ -73,6 +74,7 @@ in_cksum_update(struct ip *ip) __tmp = (int)ip->ip_sum + 1; ip->ip_sum = __tmp + (__tmp >> 16); } +#endif static __inline u_short in_addword(u_short sum, u_short b) @@ -106,6 +108,7 @@ in_pseudo(u_int sum, u_int b, u_int c) return (sum); } +#if defined(IPVERSION) && (IPVERSION == 4) static __inline u_int in_cksum_hdr(struct ip *ip) { @@ -163,6 +166,7 @@ in_cksum_hdr(struct ip *ip) #undef __LD_ADD return (__ret); } +#endif #ifdef _KERNEL u_short in_cksum_skip(struct mbuf *m, int len, int skip); From owner-svn-src-head@FreeBSD.ORG Thu May 24 22:06:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2FBB1065672; Thu, 24 May 2012 22:06:00 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADEF18FC0A; Thu, 24 May 2012 22:06:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OM60eJ063120; Thu, 24 May 2012 22:06:00 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OM60Nl063117; Thu, 24 May 2012 22:06:00 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242206.q4OM60Nl063117@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 22:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235942 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:06:00 -0000 Author: marcel Date: Thu May 24 22:06:00 2012 New Revision: 235942 URL: http://svn.freebsd.org/changeset/base/235942 Log: Revert isync for ILP32 to sync as per my original change that I discussed with Nathan. Leave __ATOMIC_ACQ as an isync as per Nathan. Modified: head/sys/powerpc/include/atomic.h Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Thu May 24 22:00:48 2012 (r235941) +++ head/sys/powerpc/include/atomic.h Thu May 24 22:06:00 2012 (r235942) @@ -54,10 +54,10 @@ #define __ATOMIC_REL() __asm __volatile("lwsync" : : : "memory") #define __ATOMIC_ACQ() __asm __volatile("lwsync" : : : "memory") #else -#define mb() __asm __volatile("isync" : : : "memory") -#define rmb() __asm __volatile("isync" : : : "memory") -#define wmb() __asm __volatile("isync" : : : "memory") -#define __ATOMIC_REL() __asm __volatile("isync" : : : "memory") +#define mb() __asm __volatile("sync" : : : "memory") +#define rmb() __asm __volatile("sync" : : : "memory") +#define wmb() __asm __volatile("sync : : : "memory") +#define __ATOMIC_REL() __asm __volatile("sync" : : : "memory") #define __ATOMIC_ACQ() __asm __volatile("isync" : : : "memory") #endif From owner-svn-src-head@FreeBSD.ORG Thu May 24 22:07:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 623851065780; Thu, 24 May 2012 22:07:20 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 29C0E8FC15; Thu, 24 May 2012 22:07:20 +0000 (UTC) Received: from marcelm-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q4OM78iQ075353 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 24 May 2012 15:07:13 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4FBEA493.4020702@freebsd.org> Date: Thu, 24 May 2012 15:07:03 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205242045.q4OKjipb059398@svn.freebsd.org> <4FBEA493.4020702@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:07:20 -0000 On May 24, 2012, at 2:13 PM, Nathan Whitehorn wrote: > On 05/24/12 15:45, Marcel Moolenaar wrote: >> Author: marcel >> Date: Thu May 24 20:45:44 2012 >> New Revision: 235931 >> URL: http://svn.freebsd.org/changeset/base/235931 >>=20 >> Log: >> Fix the memory barriers for CPUs that do not like lwsync and wedge = or cause >> exceptions early enough during boot that the kernel will do ithe = same. >> Use lwsync only when compiling for LP64 and revert to the more = proven isync >> when compiling for ILP32. Note that in the end (i.e. between = revision 222198 >> and this change) ILP32 changed from using sync to using isync. As = per Nathan >> the isync is needed to make sure I/O accesses are properly = serialized with >> locks and isync tends to be more effecient than sync. >>=20 >=20 > This badly breaks the synchronization primitives. The functions = mb()/wmb()/rmb() need to be sync or lwsync on ILP32, not isync. I guess I misinterpreted your email in which you stated that isync is = better. > Summary: > 1. *mb() must be lwsync or sync on all machines, except for wmb() = which could be eieio > 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync = with bus_space changes) > 3. __ATOMIC_REL() must be lwsync or sync This is absolutely not what I concluded from our discussions. I have no = idea how we could end up so out of sync... --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Thu May 24 22:14:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7E57106564A; Thu, 24 May 2012 22:14:39 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2A348FC0C; Thu, 24 May 2012 22:14:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OMEd55063524; Thu, 24 May 2012 22:14:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OMEdY2063522; Thu, 24 May 2012 22:14:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201205242214.q4OMEdY2063522@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 24 May 2012 22:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235943 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:14:39 -0000 Author: nwhitehorn Date: Thu May 24 22:14:39 2012 New Revision: 235943 URL: http://svn.freebsd.org/changeset/base/235943 Log: Atomic operation acquire barriers also need to be isync on 64-bit systems. Modified: head/sys/powerpc/include/atomic.h Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Thu May 24 22:06:00 2012 (r235942) +++ head/sys/powerpc/include/atomic.h Thu May 24 22:14:39 2012 (r235943) @@ -52,7 +52,7 @@ #define rmb() __asm __volatile("lwsync" : : : "memory") #define wmb() __asm __volatile("lwsync" : : : "memory") #define __ATOMIC_REL() __asm __volatile("lwsync" : : : "memory") -#define __ATOMIC_ACQ() __asm __volatile("lwsync" : : : "memory") +#define __ATOMIC_ACQ() __asm __volatile("isync" : : : "memory") #else #define mb() __asm __volatile("sync" : : : "memory") #define rmb() __asm __volatile("sync" : : : "memory") From owner-svn-src-head@FreeBSD.ORG Thu May 24 22:15:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A57710656D0; Thu, 24 May 2012 22:15:17 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 658948FC16; Thu, 24 May 2012 22:15:17 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M4J00A00SHGYI00@smtpauth3.wiscmail.wisc.edu>; Thu, 24 May 2012 17:15:16 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-user-nat.icecube.wisc.edu [128.104.255.12]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M4J006N6SHFFY10@smtpauth3.wiscmail.wisc.edu>; Thu, 24 May 2012 17:15:16 -0500 (CDT) Date: Thu, 24 May 2012 17:15:15 -0500 From: Nathan Whitehorn In-reply-to: To: Marcel Moolenaar Message-id: <4FBEB2F3.4060405@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.255.12 X-Spam-PmxInfo: Server=avs-14, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.24.220630, SenderIP=128.104.255.12 References: <201205242045.q4OKjipb059398@svn.freebsd.org> <4FBEA493.4020702@freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:15:17 -0000 On 05/24/12 17:07, Marcel Moolenaar wrote: > > On May 24, 2012, at 2:13 PM, Nathan Whitehorn wrote: > >> On 05/24/12 15:45, Marcel Moolenaar wrote: >>> Author: marcel >>> Date: Thu May 24 20:45:44 2012 >>> New Revision: 235931 >>> URL: http://svn.freebsd.org/changeset/base/235931 >>> >>> Log: >>> Fix the memory barriers for CPUs that do not like lwsync and wedge or cause >>> exceptions early enough during boot that the kernel will do ithe same. >>> Use lwsync only when compiling for LP64 and revert to the more proven isync >>> when compiling for ILP32. Note that in the end (i.e. between revision 222198 >>> and this change) ILP32 changed from using sync to using isync. As per Nathan >>> the isync is needed to make sure I/O accesses are properly serialized with >>> locks and isync tends to be more effecient than sync. >>> >> >> This badly breaks the synchronization primitives. The functions mb()/wmb()/rmb() need to be sync or lwsync on ILP32, not isync. > > I guess I misinterpreted your email in which you stated that isync is better. It's just in this one single case. Otherwise, it's still faster but doesn't work :) >> Summary: >> 1. *mb() must be lwsync or sync on all machines, except for wmb() which could be eieio >> 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync with bus_space changes) >> 3. __ATOMIC_REL() must be lwsync or sync > > This is absolutely not what I concluded from our discussions. I have no idea > how we could end up so out of sync... > Thanks for the quick change. No idea how we got out of sync. I find all of this synchronization stuff a little mind-bending, so sorry for any miscommunication. __ATOMIC_ACQ() needed to also be isync on ppc64, so I've fixed that up. Things should be good now. -Nathan From owner-svn-src-head@FreeBSD.ORG Thu May 24 22:17:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C7D48106566B; Thu, 24 May 2012 22:17:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 47E7D8FC21; Thu, 24 May 2012 22:17:43 +0000 (UTC) Message-ID: <4FBEB386.7000503@FreeBSD.org> Date: Thu, 24 May 2012 18:17:42 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0.1 MIME-Version: 1.0 To: Edward Tomasz Napierala References: <201205241648.q4OGmXha049187@svn.freebsd.org> <4FBEA14E.2060802@FreeBSD.org> In-Reply-To: <4FBEA14E.2060802@FreeBSD.org> X-Enigmail-Version: 1.5pre Content-Type: multipart/mixed; boundary="------------030401010906040706090801" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235918 - head/sys/geom/label X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:17:43 -0000 This is a multi-part message in MIME format. --------------030401010906040706090801 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-05-24 16:59:58 -0400, Jung-uk Kim wrote: > On 2012-05-24 12:48:33 -0400, Edward Tomasz Napierala wrote: >> Author: trasz Date: Thu May 24 16:48:33 2012 New Revision: 235918 >> URL: http://svn.freebsd.org/changeset/base/235918 >> >> Log: Make g_label(4) ignore provider size when looking for UFS >> labels. Without it, it fails to create labels for filesystems >> resized by growfs(8). >> >> PR: kern/165962 Submitted by: Olivier Cochard-Labbe > cochard dot me> >> >> Modified: head/sys/geom/label/g_label_ufs.c > > This commit broke my fstab based on ufsid. I have something like > this in my fstab: > > /dev/ufsid/44b3df81873011b5 / ufs rw,noatime 1 1 > /dev/ufsid/463b935456452bbd /tmp ufs rw,noatime 2 2 > /dev/ufsid/44b3dfc4bfcc4c30 /usr ufs rw,noatime 2 2 > /dev/ufsid/463b934b955f63ff /var ufs rw,noatime 2 2 > > Mounting / as read-only went fine and I had /dev/ada0s1a, > /dev/ada0s1d, etc. Strangely, I also had matching ufsid's under > /dev/ufsid, e.g., /dev/ufsid/a, > /dev/ufsid/d, etc. However, once I do 'mount -u -w /', > everything disappears except for root's ufsid. > > Reverting this commit fixed the problem for me. The attached patch fixed my problem and kern/165962. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk++s4YACgkQmlay1b9qnVO5uACglaXhj9ZXwpUiroMUxqkbHF/v Qm0An0lHidiRMenHsDLTaiC0Wqz0cYB6 =k1Ff -----END PGP SIGNATURE----- --------------030401010906040706090801 Content-Type: text/plain; charset=UTF-8; name="ufsid.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ufsid.diff" SW5kZXg6IHN5cy9nZW9tL2xhYmVsL2dfbGFiZWxfdWZzLmMKPT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0g c3lzL2dlb20vbGFiZWwvZ19sYWJlbF91ZnMuYwkocmV2aXNpb24gMjM1OTQxKQorKysgc3lz L2dlb20vbGFiZWwvZ19sYWJlbF91ZnMuYwkod29ya2luZyBjb3B5KQpAQCAtNTEsOCArNTEs OSBAQCBzdGF0aWMgdm9pZAogZ19sYWJlbF91ZnNfdGFzdGVfY29tbW9uKHN0cnVjdCBnX2Nv bnN1bWVyICpjcCwgY2hhciAqbGFiZWwsIHNpemVfdCBzaXplLCBpbnQgd2hhdCkKIHsKIAlz dHJ1Y3QgZ19wcm92aWRlciAqcHA7CisJc3RydWN0IGZzICpmczsKKwlvZmZfdCBmc19zaXpl OwogCWludCBzYiwgc3VwZXJibG9jazsKLQlzdHJ1Y3QgZnMgKmZzOwogCiAJZ190b3BvbG9n eV9hc3NlcnRfbm90KCk7CiAJcHAgPSBjcC0+cHJvdmlkZXI7CkBAIC04MiwxMSArODMsMTkg QEAgZ19sYWJlbF91ZnNfdGFzdGVfY29tbW9uKHN0cnVjdCBnX2NvbnN1bWVyICpjcCwgY2gK IAkJaWYgKGZzID09IE5VTEwpCiAJCQljb250aW51ZTsKIAkJLyogQ2hlY2sgZm9yIG1hZ2lj ICovCi0JCWlmIChmcy0+ZnNfbWFnaWMgPT0gRlNfVUZTMV9NQUdJQyAmJiBmcy0+ZnNfZnNp emUgPiAwKSB7Ci0JCSAgICAJLyogVmFsaWQgVUZTMS4gKi8KLQkJfSBlbHNlIGlmIChmcy0+ ZnNfbWFnaWMgPT0gRlNfVUZTMl9NQUdJQyAmJiBmcy0+ZnNfZnNpemUgPiAwKSB7Ci0JCSAg ICAJLyogVmFsaWQgVUZTMi4gKi8KLQkJfSBlbHNlIHsKKwkJc3dpdGNoIChmcy0+ZnNfbWFn aWMpIHsKKwkJY2FzZSBGU19VRlMxX01BR0lDOgorCQljYXNlIEZTX1VGUzJfTUFHSUM6CisJ CQlpZiAoZnMtPmZzX2ZzaXplID4gMCkgeworCQkJCWlmICh3aGF0ID09IEdfTEFCRUxfVUZT X1ZPTFVNRSkKKwkJCQkJYnJlYWs7CisJCQkJZnNfc2l6ZSA9IChmcy0+ZnNfbWFnaWMgPT0g RlNfVUZTMV9NQUdJQykgPworCQkJCSAgICBmcy0+ZnNfb2xkX3NpemUgOiBmcy0+ZnNfc2l6 ZTsKKwkJCQlpZiAocHAtPm1lZGlhc2l6ZSAvIGZzLT5mc19mc2l6ZSA9PSBmc19zaXplKQor CQkJCQlicmVhazsKKwkJCX0KKwkJCS8qIEZBTExUSFJPVUdIICovCisJCWRlZmF1bHQ6CiAJ CQlnX2ZyZWUoZnMpOwogCQkJY29udGludWU7CiAJCX0K --------------030401010906040706090801-- From owner-svn-src-head@FreeBSD.ORG Thu May 24 22:22:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4C9F1065670; Thu, 24 May 2012 22:22:22 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 9C5898FC12; Thu, 24 May 2012 22:22:22 +0000 (UTC) Received: from marcelm-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q4OMMEFg075478 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 24 May 2012 15:22:21 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4FBEB2F3.4060405@freebsd.org> Date: Thu, 24 May 2012 15:22:09 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <358A54BA-6B8E-4685-8CDD-CCAC305ACA2B@xcllnt.net> References: <201205242045.q4OKjipb059398@svn.freebsd.org> <4FBEA493.4020702@freebsd.org> <4FBEB2F3.4060405@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:22:22 -0000 On May 24, 2012, at 3:15 PM, Nathan Whitehorn wrote: >>> Summary: >>> 1. *mb() must be lwsync or sync on all machines, except for wmb() = which could be eieio >>> 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync = with bus_space changes) >>> 3. __ATOMIC_REL() must be lwsync or sync >>=20 >> This is absolutely not what I concluded from our discussions. I have = no idea >> how we could end up so out of sync... >>=20 >=20 > Thanks for the quick change. No idea how we got out of sync. I find = all of this synchronization stuff a little mind-bending, so sorry for = any miscommunication. __ATOMIC_ACQ() needed to also be isync on ppc64, = so I've fixed that up. Things should be good now. Ok. I didn't change wmb() to eieio as I wanted to avoid a pendulum = effect. I'll reread our emails and make sure wmb() is what we think it is and if so I'll do a followup commit. FYI, --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Thu May 24 22:46:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 958D9106564A; Thu, 24 May 2012 22:46:15 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id 602068FC0A; Thu, 24 May 2012 22:46:15 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M4J00100TWXSV00@smtpauth1.wiscmail.wisc.edu>; Thu, 24 May 2012 17:46:09 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-user-nat.icecube.wisc.edu [128.104.255.12]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M4J00C29TWW1J30@smtpauth1.wiscmail.wisc.edu>; Thu, 24 May 2012 17:46:09 -0500 (CDT) Date: Thu, 24 May 2012 17:46:08 -0500 From: Nathan Whitehorn In-reply-to: <358A54BA-6B8E-4685-8CDD-CCAC305ACA2B@xcllnt.net> To: Marcel Moolenaar Message-id: <4FBEBA30.6050901@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.255.12 X-Spam-PmxInfo: Server=avs-16, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.24.223633, SenderIP=128.104.255.12 References: <201205242045.q4OKjipb059398@svn.freebsd.org> <4FBEA493.4020702@freebsd.org> <4FBEB2F3.4060405@freebsd.org> <358A54BA-6B8E-4685-8CDD-CCAC305ACA2B@xcllnt.net> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 22:46:15 -0000 On 05/24/12 17:22, Marcel Moolenaar wrote: > > On May 24, 2012, at 3:15 PM, Nathan Whitehorn wrote: > >>>> Summary: >>>> 1. *mb() must be lwsync or sync on all machines, except for wmb() which could be eieio >>>> 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync with bus_space changes) >>>> 3. __ATOMIC_REL() must be lwsync or sync >>> >>> This is absolutely not what I concluded from our discussions. I have no idea >>> how we could end up so out of sync... >>> >> >> Thanks for the quick change. No idea how we got out of sync. I find all of this synchronization stuff a little mind-bending, so sorry for any miscommunication. __ATOMIC_ACQ() needed to also be isync on ppc64, so I've fixed that up. Things should be good now. > > Ok. I didn't change wmb() to eieio as I wanted to avoid a pendulum effect. > I'll reread our emails and make sure wmb() is what we think it is and if > so I'll do a followup commit. > FYI, > I don't think it really makes a difference. Basically nothing uses wmb(), and those things that do mostly use it wrong and need sync. So it should probably stay as [lw]sync. -Nathan From owner-svn-src-head@FreeBSD.ORG Thu May 24 23:03:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE32C106566B; Thu, 24 May 2012 23:03:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C77858FC18; Thu, 24 May 2012 23:03:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4ON3OeV065610; Thu, 24 May 2012 23:03:24 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ON3OpM065605; Thu, 24 May 2012 23:03:24 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205242303.q4ON3OpM065605@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 23:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235944 - in head/sys: dev/cxgb dev/cxgbe netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 23:03:25 -0000 Author: bz Date: Thu May 24 23:03:23 2012 New Revision: 235944 URL: http://svn.freebsd.org/changeset/base/235944 Log: MFp4 bz_ipv6_fast: Significantly update tcp_lro for mostly two things: 1) introduce basic support for IPv6 without extension headers. 2) try hard to also get the incremental checksum updates right, especially also in the IPv4 case for the IP and TCP header. Move variables around for better locality, factor things out into functions, allow checksum updates to be compiled out, ... Leave a few comments on further things to look at in the future, though that is not the full list. Update drivers with appropriate #includes as needed for IPv6 data type in LRO. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgbe/adapter.h head/sys/netinet/tcp_lro.c head/sys/netinet/tcp_lro.h Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Thu May 24 22:14:39 2012 (r235943) +++ head/sys/dev/cxgb/cxgb_adapter.h Thu May 24 23:03:23 2012 (r235944) @@ -46,6 +46,7 @@ $FreeBSD$ #include #include #include +#include #include #include Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu May 24 22:14:39 2012 (r235943) +++ head/sys/dev/cxgbe/adapter.h Thu May 24 23:03:23 2012 (r235944) @@ -44,6 +44,7 @@ #include #include #include +#include #include #include "offload.h" Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Thu May 24 22:14:39 2012 (r235943) +++ head/sys/netinet/tcp_lro.c Thu May 24 23:03:23 2012 (r235944) @@ -1,8 +1,12 @@ /*- * Copyright (c) 2007, Myricom Inc. * Copyright (c) 2008, Intel Corporation. + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Bjoern Zeeb + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -27,365 +31,565 @@ * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_inet6.h" + #include #include -#include #include #include #include #include +#include #include -#include #include #include +#include #include #include #include -#include #include +#ifndef LRO_ENTRIES +#define LRO_ENTRIES 8 /* # of LRO entries per RX queue. */ +#endif + +#define TCP_LRO_UPDATE_CSUM 1 +#ifndef TCP_LRO_UPDATE_CSUM +#define TCP_LRO_INVALID_CSUM 0x0000 +#endif -static uint16_t do_csum_data(uint16_t *raw, int len) -{ - uint32_t csum; - csum = 0; - while (len > 0) { - csum += *raw; - raw++; - csum += *raw; - raw++; - len -= 4; - } - csum = (csum >> 16) + (csum & 0xffff); - csum = (csum >> 16) + (csum & 0xffff); - return (uint16_t)csum; -} - -/* - * Allocate and init the LRO data structures - */ int -tcp_lro_init(struct lro_ctrl *cntl) +tcp_lro_init(struct lro_ctrl *lc) { - struct lro_entry *lro; - int i, error = 0; - - SLIST_INIT(&cntl->lro_free); - SLIST_INIT(&cntl->lro_active); + struct lro_entry *le; + int error, i; - cntl->lro_bad_csum = 0; - cntl->lro_queued = 0; - cntl->lro_flushed = 0; + lc->lro_bad_csum = 0; + lc->lro_queued = 0; + lc->lro_flushed = 0; + lc->lro_cnt = 0; + SLIST_INIT(&lc->lro_free); + SLIST_INIT(&lc->lro_active); + error = 0; for (i = 0; i < LRO_ENTRIES; i++) { - lro = (struct lro_entry *) malloc(sizeof (struct lro_entry), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (lro == NULL) { + le = (struct lro_entry *)malloc(sizeof(*le), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (le == NULL) { if (i == 0) error = ENOMEM; break; } - cntl->lro_cnt = i; - SLIST_INSERT_HEAD(&cntl->lro_free, lro, next); + lc->lro_cnt = i + 1; + SLIST_INSERT_HEAD(&lc->lro_free, le, next); } return (error); } void -tcp_lro_free(struct lro_ctrl *cntl) +tcp_lro_free(struct lro_ctrl *lc) { - struct lro_entry *entry; + struct lro_entry *le; + + while (!SLIST_EMPTY(&lc->lro_free)) { + le = SLIST_FIRST(&lc->lro_free); + SLIST_REMOVE_HEAD(&lc->lro_free, next); + free(le, M_DEVBUF); + } +} - while (!SLIST_EMPTY(&cntl->lro_free)) { - entry = SLIST_FIRST(&cntl->lro_free); - SLIST_REMOVE_HEAD(&cntl->lro_free, next); - free(entry, M_DEVBUF); +#ifdef TCP_LRO_UPDATE_CSUM +static uint16_t +tcp_lro_csum_th(struct tcphdr *th) +{ + uint32_t ch; + uint16_t *p, l; + + ch = th->th_sum = 0x0000; + l = th->th_off; + p = (uint16_t *)th; + while (l > 0) { + ch += *p; + p++; + ch += *p; + p++; + l--; + } + while (ch > 0xffff) + ch = (ch >> 16) + (ch & 0xffff); + + return (ch & 0xffff); +} + +static uint16_t +tcp_lro_rx_csum_fixup(struct lro_entry *le, void *l3hdr, struct tcphdr *th, + uint16_t tcp_data_len, uint16_t csum) +{ + uint32_t c; + uint16_t cs; + + c = csum; + + /* Remove length from checksum. */ + switch (le->eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + { + struct ip6_hdr *ip6; + + ip6 = (struct ip6_hdr *)l3hdr; + if (le->append_cnt == 0) + cs = ip6->ip6_plen; + else { + uint32_t cx; + + cx = ntohs(ip6->ip6_plen); + cs = in6_cksum_pseudo(ip6, cx, ip6->ip6_nxt, 0); + } + break; + } +#endif +#ifdef INET + case ETHERTYPE_IP: + { + struct ip *ip4; + + ip4 = (struct ip *)l3hdr; + if (le->append_cnt == 0) + cs = ip4->ip_len; + else { + cs = in_addword(ntohs(ip4->ip_len) - sizeof(*ip4), + IPPROTO_TCP); + cs = in_pseudo(ip4->ip_src.s_addr, ip4->ip_dst.s_addr, + htons(cs)); + } + break; + } +#endif + default: + cs = 0; /* Keep compiler happy. */ } + + cs = ~cs; + c += cs; + + /* Remove TCP header csum. */ + cs = ~tcp_lro_csum_th(th); + c += cs; + while (c > 0xffff) + c = (c >> 16) + (c & 0xffff); + + return (c & 0xffff); } +#endif void -tcp_lro_flush(struct lro_ctrl *cntl, struct lro_entry *lro) +tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *le) { - struct ifnet *ifp; - struct ip *ip; - struct tcphdr *tcp; - uint32_t *ts_ptr; - uint32_t tcplen, tcp_csum; + if (le->append_cnt > 0) { + struct tcphdr *th; + uint16_t p_len; + + p_len = htons(le->p_len); + switch (le->eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + { + struct ip6_hdr *ip6; + + ip6 = le->le_ip6; + ip6->ip6_plen = p_len; + th = (struct tcphdr *)(ip6 + 1); + le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + le->p_len += ETHER_HDR_LEN + sizeof(*ip6); + break; + } +#endif +#ifdef INET + case ETHERTYPE_IP: + { + struct ip *ip4; +#ifdef TCP_LRO_UPDATE_CSUM + uint32_t cl; + uint16_t c; +#endif + + ip4 = le->le_ip4; +#ifdef TCP_LRO_UPDATE_CSUM + /* Fix IP header checksum for new length. */ + c = ~ip4->ip_sum; + cl = c; + c = ~ip4->ip_len; + cl += c + p_len; + while (cl > 0xffff) + cl = (cl >> 16) + (cl & 0xffff); + c = cl; + ip4->ip_sum = ~c; +#else + ip4->ip_sum = TCP_LRO_INVALID_CSUM; +#endif + ip4->ip_len = p_len; + th = (struct tcphdr *)(ip4 + 1); + le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | + CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID; + le->p_len += ETHER_HDR_LEN; + break; + } +#endif + default: + th = NULL; /* Keep compiler happy. */ + } + le->m_head->m_pkthdr.csum_data = 0xffff; + le->m_head->m_pkthdr.len = le->p_len; - if (lro->append_cnt) { - /* incorporate the new len into the ip header and - * re-calculate the checksum */ - ip = lro->ip; - ip->ip_len = htons(lro->len - ETHER_HDR_LEN); - ip->ip_sum = 0; - ip->ip_sum = 0xffff ^ - do_csum_data((uint16_t*)ip, - sizeof (*ip)); - - lro->m_head->m_pkthdr.csum_flags = CSUM_IP_CHECKED | - CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR; - lro->m_head->m_pkthdr.csum_data = 0xffff; - lro->m_head->m_pkthdr.len = lro->len; - - /* incorporate the latest ack into the tcp header */ - tcp = (struct tcphdr *) (ip + 1); - tcp->th_ack = lro->ack_seq; - tcp->th_win = lro->window; - /* incorporate latest timestamp into the tcp header */ - if (lro->timestamp) { - ts_ptr = (uint32_t *)(tcp + 1); - ts_ptr[1] = htonl(lro->tsval); - ts_ptr[2] = lro->tsecr; - } - /* - * update checksum in tcp header by re-calculating the - * tcp pseudoheader checksum, and adding it to the checksum - * of the tcp payload data - */ - tcp->th_sum = 0; - tcplen = lro->len - sizeof(*ip) - ETHER_HDR_LEN; - tcp_csum = lro->data_csum; - tcp_csum += in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, - htons(tcplen + IPPROTO_TCP)); - tcp_csum += do_csum_data((uint16_t*)tcp, - tcp->th_off << 2); - tcp_csum = (tcp_csum & 0xffff) + (tcp_csum >> 16); - tcp_csum = (tcp_csum & 0xffff) + (tcp_csum >> 16); - tcp->th_sum = 0xffff ^ tcp_csum; - } - ifp = cntl->ifp; - (*ifp->if_input)(cntl->ifp, lro->m_head); - cntl->lro_queued += lro->append_cnt + 1; - cntl->lro_flushed++; - lro->m_head = NULL; - lro->timestamp = 0; - lro->append_cnt = 0; - SLIST_INSERT_HEAD(&cntl->lro_free, lro, next); + /* Incorporate the latest ACK into the TCP header. */ + th->th_ack = le->ack_seq; + th->th_win = le->window; + /* Incorporate latest timestamp into the TCP header. */ + if (le->timestamp != 0) { + uint32_t *ts_ptr; + + ts_ptr = (uint32_t *)(th + 1); + ts_ptr[1] = htonl(le->tsval); + ts_ptr[2] = le->tsecr; + } +#ifdef TCP_LRO_UPDATE_CSUM + /* Update the TCP header checksum. */ + le->ulp_csum += p_len; + le->ulp_csum += tcp_lro_csum_th(th); + while (le->ulp_csum > 0xffff) + le->ulp_csum = (le->ulp_csum >> 16) + + (le->ulp_csum & 0xffff); + th->th_sum = (le->ulp_csum & 0xffff); + th->th_sum = ~th->th_sum; +#else + th->th_sum = TCP_LRO_INVALID_CSUM; +#endif + } + + (*lc->ifp->if_input)(lc->ifp, le->m_head); + lc->lro_queued += le->append_cnt + 1; + lc->lro_flushed++; + bzero(le, sizeof(*le)); + SLIST_INSERT_HEAD(&lc->lro_free, le, next); } -int -tcp_lro_rx(struct lro_ctrl *cntl, struct mbuf *m_head, uint32_t csum) +#ifdef INET6 +static int +tcp_lro_rx_ipv6(struct lro_ctrl *lc, struct mbuf *m, struct ip6_hdr *ip6, + struct tcphdr **th) { - struct ether_header *eh; - struct ip *ip; - struct tcphdr *tcp; - uint32_t *ts_ptr; - struct mbuf *m_nxt, *m_tail; - struct lro_entry *lro; - int hlen, ip_len, tcp_hdr_len, tcp_data_len, tot_len; - int opt_bytes, trim, csum_flags; - uint32_t seq, tmp_csum, device_mtu; - - - eh = mtod(m_head, struct ether_header *); - if (eh->ether_type != htons(ETHERTYPE_IP)) - return 1; - ip = (struct ip *) (eh + 1); - if (ip->ip_p != IPPROTO_TCP) - return 1; - - /* ensure there are no options */ - if ((ip->ip_hl << 2) != sizeof (*ip)) - return -1; - - /* .. and the packet is not fragmented */ - if (ip->ip_off & htons(IP_MF|IP_OFFMASK)) - return -1; - /* verify that the IP header checksum is correct */ - csum_flags = m_head->m_pkthdr.csum_flags; + /* XXX-BZ we should check the flow-label. */ + + /* XXX-BZ We do not yet support ext. hdrs. */ + if (ip6->ip6_nxt != IPPROTO_TCP) + return (TCP_LRO_NOT_SUPPORTED); + + /* Find the TCP header. */ + *th = (struct tcphdr *)(ip6 + 1); + + return (0); +} +#endif + +#ifdef INET +static int +tcp_lro_rx_ipv4(struct lro_ctrl *lc, struct mbuf *m, struct ip *ip4, + struct tcphdr **th) +{ + int csum_flags; + uint16_t csum; + + if (ip4->ip_p != IPPROTO_TCP) + return (TCP_LRO_NOT_SUPPORTED); + + /* Ensure there are no options. */ + if ((ip4->ip_hl << 2) != sizeof (*ip4)) + return (TCP_LRO_CANNOT); + + /* .. and the packet is not fragmented. */ + if (ip4->ip_off & htons(IP_MF|IP_OFFMASK)) + return (TCP_LRO_CANNOT); + + /* Legacy IP has a header checksum that needs to be correct. */ + csum_flags = m->m_pkthdr.csum_flags; if (csum_flags & CSUM_IP_CHECKED) { if (__predict_false((csum_flags & CSUM_IP_VALID) == 0)) { - cntl->lro_bad_csum++; - return -1; + lc->lro_bad_csum++; + return (TCP_LRO_CANNOT); } } else { - tmp_csum = do_csum_data((uint16_t *)ip, sizeof (*ip)); - if (__predict_false((tmp_csum ^ 0xffff) != 0)) { - cntl->lro_bad_csum++; - return -1; - } - } - - /* find the TCP header */ - tcp = (struct tcphdr *) (ip + 1); - - /* Get the TCP checksum if we dont have it */ - if (!csum) - csum = tcp->th_sum; - - /* ensure no bits set besides ack or psh */ - if ((tcp->th_flags & ~(TH_ACK | TH_PUSH)) != 0) - return -1; - - /* check for timestamps. Since the only option we handle are - timestamps, we only have to handle the simple case of - aligned timestamps */ - - opt_bytes = (tcp->th_off << 2) - sizeof (*tcp); - tcp_hdr_len = sizeof (*tcp) + opt_bytes; - ts_ptr = (uint32_t *)(tcp + 1); - if (opt_bytes != 0) { - if (__predict_false(opt_bytes != TCPOLEN_TSTAMP_APPA) || - (*ts_ptr != ntohl(TCPOPT_NOP<<24|TCPOPT_NOP<<16| - TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP))) - return -1; - } - - ip_len = ntohs(ip->ip_len); - tcp_data_len = ip_len - (tcp->th_off << 2) - sizeof (*ip); - - - /* - * If frame is padded beyond the end of the IP packet, - * then we must trim the extra bytes off the end. + csum = in_cksum_hdr(ip4); + if (__predict_false((csum ^ 0xffff) != 0)) { + lc->lro_bad_csum++; + return (TCP_LRO_CANNOT); + } + } + + /* Find the TCP header (we assured there are no IP options). */ + *th = (struct tcphdr *)(ip4 + 1); + + return (0); +} +#endif + +int +tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum) +{ + struct lro_entry *le; + struct ether_header *eh; +#ifdef INET6 + struct ip6_hdr *ip6 = NULL; /* Keep compiler happy. */ +#endif +#ifdef INET + struct ip *ip4 = NULL; /* Keep compiler happy. */ +#endif + struct tcphdr *th; + void *l3hdr = NULL; /* Keep compiler happy. */ + uint32_t *ts_ptr; + tcp_seq seq; + int error, ip_len, l; + uint16_t eh_type, tcp_data_len; + + /* We expect a contiguous header [eh, ip, tcp]. */ + + eh = mtod(m, struct ether_header *); + eh_type = ntohs(eh->ether_type); + switch (eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + l3hdr = ip6 = (struct ip6_hdr *)(eh + 1); + error = tcp_lro_rx_ipv6(lc, m, ip6, &th); + if (error != 0) + return (error); + tcp_data_len = ntohs(ip6->ip6_plen); + ip_len = sizeof(*ip6) + tcp_data_len; + break; +#endif +#ifdef INET + case ETHERTYPE_IP: + l3hdr = ip4 = (struct ip *)(eh + 1); + error = tcp_lro_rx_ipv4(lc, m, ip4, &th); + if (error != 0) + return (error); + ip_len = ntohs(ip4->ip_len); + tcp_data_len = ip_len - sizeof(*ip4); + break; +#endif + /* XXX-BZ what happens in case of VLAN(s)? */ + default: + return (TCP_LRO_NOT_SUPPORTED); + } + + /* + * If the frame is padded beyond the end of the IP packet, then we must + * trim the extra bytes off. + */ + l = m->m_pkthdr.len - (ETHER_HDR_LEN + ip_len); + if (l != 0) { + if (l < 0) + /* Truncated packet. */ + return (TCP_LRO_CANNOT); + + m_adj(m, -l); + } + + /* + * Check TCP header constraints. */ - tot_len = m_head->m_pkthdr.len; - trim = tot_len - (ip_len + ETHER_HDR_LEN); - if (trim != 0) { - if (trim < 0) { - /* truncated packet */ - return -1; - } - m_adj(m_head, -trim); - tot_len = m_head->m_pkthdr.len; - } - - m_nxt = m_head; - m_tail = NULL; /* -Wuninitialized */ - while (m_nxt != NULL) { - m_tail = m_nxt; - m_nxt = m_tail->m_next; - } - - hlen = ip_len + ETHER_HDR_LEN - tcp_data_len; - seq = ntohl(tcp->th_seq); - - SLIST_FOREACH(lro, &cntl->lro_active, next) { - if (lro->source_port == tcp->th_sport && - lro->dest_port == tcp->th_dport && - lro->source_ip == ip->ip_src.s_addr && - lro->dest_ip == ip->ip_dst.s_addr) { - /* Flush now if appending will result in overflow. */ - if (lro->len > (65535 - tcp_data_len)) { - SLIST_REMOVE(&cntl->lro_active, lro, - lro_entry, next); - tcp_lro_flush(cntl, lro); - break; - } - - /* Try to append it */ - - if (__predict_false(seq != lro->next_seq || - (tcp_data_len == 0 && - lro->ack_seq == tcp->th_ack))) { - /* out of order packet or dup ack */ - SLIST_REMOVE(&cntl->lro_active, lro, - lro_entry, next); - tcp_lro_flush(cntl, lro); - return -1; - } - - if (opt_bytes) { - uint32_t tsval = ntohl(*(ts_ptr + 1)); - /* make sure timestamp values are increasing */ - if (__predict_false(lro->tsval > tsval || - *(ts_ptr + 2) == 0)) { - return -1; - } - lro->tsval = tsval; - lro->tsecr = *(ts_ptr + 2); - } - - lro->next_seq += tcp_data_len; - lro->ack_seq = tcp->th_ack; - lro->window = tcp->th_win; - lro->append_cnt++; - if (tcp_data_len == 0) { - m_freem(m_head); - return 0; - } - /* subtract off the checksum of the tcp header - * from the hardware checksum, and add it to the - * stored tcp data checksum. Byteswap the checksum - * if the total length so far is odd - */ - tmp_csum = do_csum_data((uint16_t*)tcp, - tcp_hdr_len); - csum = csum + (tmp_csum ^ 0xffff); - csum = (csum & 0xffff) + (csum >> 16); - csum = (csum & 0xffff) + (csum >> 16); - if (lro->len & 0x1) { - /* Odd number of bytes so far, flip bytes */ - csum = ((csum << 8) | (csum >> 8)) & 0xffff; - } - csum = csum + lro->data_csum; - csum = (csum & 0xffff) + (csum >> 16); - csum = (csum & 0xffff) + (csum >> 16); - lro->data_csum = csum; - - lro->len += tcp_data_len; - - /* adjust mbuf so that m->m_data points to - the first byte of the payload */ - m_adj(m_head, hlen); - /* append mbuf chain */ - lro->m_tail->m_next = m_head; - /* advance the last pointer */ - lro->m_tail = m_tail; - /* flush packet if required */ - device_mtu = cntl->ifp->if_mtu; - if (lro->len > (65535 - device_mtu)) { - SLIST_REMOVE(&cntl->lro_active, lro, - lro_entry, next); - tcp_lro_flush(cntl, lro); - } - return 0; - } - } - - if (SLIST_EMPTY(&cntl->lro_free)) - return -1; - - /* start a new chain */ - lro = SLIST_FIRST(&cntl->lro_free); - SLIST_REMOVE_HEAD(&cntl->lro_free, next); - SLIST_INSERT_HEAD(&cntl->lro_active, lro, next); - lro->source_port = tcp->th_sport; - lro->dest_port = tcp->th_dport; - lro->source_ip = ip->ip_src.s_addr; - lro->dest_ip = ip->ip_dst.s_addr; - lro->next_seq = seq + tcp_data_len; - lro->mss = tcp_data_len; - lro->ack_seq = tcp->th_ack; - lro->window = tcp->th_win; - - /* save the checksum of just the TCP payload by - * subtracting off the checksum of the TCP header from - * the entire hardware checksum - * Since IP header checksum is correct, checksum over - * the IP header is -0. Substracting -0 is unnecessary. + /* Ensure no bits set besides ACK or PSH. */ + if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0) + return (TCP_LRO_CANNOT); + + /* XXX-BZ We lose a AKC|PUSH flag concatinating multiple segments. */ + /* XXX-BZ Ideally we'd flush on PUSH? */ + + /* + * Check for timestamps. + * Since the only option we handle are timestamps, we only have to + * handle the simple case of aligned timestamps. + */ + l = (th->th_off << 2); + tcp_data_len -= l; + l -= sizeof(*th); + ts_ptr = (uint32_t *)(th + 1); + if (l != 0 && (__predict_false(l != TCPOLEN_TSTAMP_APPA) || + (*ts_ptr != ntohl(TCPOPT_NOP<<24|TCPOPT_NOP<<16| + TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)))) + return (TCP_LRO_CANNOT); + + /* If the driver did not pass in the checksum, set it now. */ + if (csum == 0x0000) + csum = th->th_sum; + + seq = ntohl(th->th_seq); + + /* Try to find a matching previous segment. */ + SLIST_FOREACH(le, &lc->lro_active, next) { + if (le->eh_type != eh_type) + continue; + if (le->source_port != th->th_sport || + le->dest_port != th->th_dport) + continue; + switch (eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + if (bcmp(&le->source_ip6, &ip6->ip6_src, + sizeof(struct in6_addr)) != 0 || + bcmp(&le->dest_ip6, &ip6->ip6_dst, + sizeof(struct in6_addr)) != 0) + continue; + break; +#endif +#ifdef INET + case ETHERTYPE_IP: + if (le->source_ip4 != ip4->ip_src.s_addr || + le->dest_ip4 != ip4->ip_dst.s_addr) + continue; + break; +#endif + } + + /* Flush now if appending will result in overflow. */ + if (le->p_len > (65535 - tcp_data_len)) { + SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); + tcp_lro_flush(lc, le); + break; + } + + /* Try to append the new segment. */ + if (__predict_false(seq != le->next_seq || + (tcp_data_len == 0 && le->ack_seq == th->th_ack))) { + /* Out of order packet or duplicate ACK. */ + SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); + tcp_lro_flush(lc, le); + return (TCP_LRO_CANNOT); + } + + if (l != 0) { + uint32_t tsval = ntohl(*(ts_ptr + 1)); + /* Make sure timestamp values are increasing. */ + /* XXX-BZ flip and use TSTMP_GEQ macro for this? */ + if (__predict_false(le->tsval > tsval || + *(ts_ptr + 2) == 0)) + return (TCP_LRO_CANNOT); + le->tsval = tsval; + le->tsecr = *(ts_ptr + 2); + } + + le->next_seq += tcp_data_len; + le->ack_seq = th->th_ack; + le->window = th->th_win; + le->append_cnt++; + +#ifdef TCP_LRO_UPDATE_CSUM + le->ulp_csum += tcp_lro_rx_csum_fixup(le, l3hdr, th, + tcp_data_len, ~csum); +#endif + + if (tcp_data_len == 0) { + m_freem(m); + return (0); + } + + le->p_len += tcp_data_len; + + /* + * Adjust the mbuf so that m_data points to the first byte of + * the ULP payload. Adjust the mbuf to avoid complications and + * append new segment to existing mbuf chain. + */ + m_adj(m, m->m_pkthdr.len - tcp_data_len); + m->m_flags &= ~M_PKTHDR; + + le->m_tail->m_next = m; + le->m_tail = m_last(m); + + /* + * If a possible next full length packet would cause an + * overflow, pro-actively flush now. + */ + if (le->p_len > (65535 - lc->ifp->if_mtu)) { + SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); + tcp_lro_flush(lc, le); + } + + return (0); + } + + /* Try to find an empty slot. */ + if (SLIST_EMPTY(&lc->lro_free)) + return (TCP_LRO_CANNOT); + + /* Start a new segment chain. */ + le = SLIST_FIRST(&lc->lro_free); + SLIST_REMOVE_HEAD(&lc->lro_free, next); + SLIST_INSERT_HEAD(&lc->lro_active, le, next); + + /* Start filling in details. */ + switch (eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + le->le_ip6 = ip6; + le->source_ip6 = ip6->ip6_src; + le->dest_ip6 = ip6->ip6_dst; + le->eh_type = eh_type; + le->p_len = m->m_pkthdr.len - ETHER_HDR_LEN - sizeof(*ip6); + break; +#endif +#ifdef INET + case ETHERTYPE_IP: + le->le_ip4 = ip4; + le->source_ip4 = ip4->ip_src.s_addr; + le->dest_ip4 = ip4->ip_dst.s_addr; + le->eh_type = eh_type; + le->p_len = m->m_pkthdr.len - ETHER_HDR_LEN; + break; +#endif + } + le->source_port = th->th_sport; + le->dest_port = th->th_dport; + + le->next_seq = seq + tcp_data_len; + le->ack_seq = th->th_ack; + le->window = th->th_win; + if (l != 0) { + le->timestamp = 1; + le->tsval = ntohl(*(ts_ptr + 1)); + le->tsecr = *(ts_ptr + 2); + } + +#ifdef TCP_LRO_UPDATE_CSUM + /* + * Do not touch the csum of the first packet. However save the + * "adjusted" checksum of just the source and destination addresses, + * the next header and the TCP payload. The length and TCP header + * parts may change, so we remove those from the saved checksum and + * re-add with final values on tcp_lro_flush() if needed. */ - tmp_csum = do_csum_data((uint16_t*)tcp, tcp_hdr_len); - csum = csum + (tmp_csum ^ 0xffff); - csum = (csum & 0xffff) + (csum >> 16); - csum = (csum & 0xffff) + (csum >> 16); - lro->data_csum = csum; - - lro->ip = ip; - /* record timestamp if it is present */ - if (opt_bytes) { - lro->timestamp = 1; - lro->tsval = ntohl(*(ts_ptr + 1)); - lro->tsecr = *(ts_ptr + 2); - } - lro->len = tot_len; - lro->m_head = m_head; - lro->m_tail = m_tail; - return 0; + KASSERT(le->ulp_csum == 0, ("%s: le=%p le->ulp_csum=0x%04x\n", + __func__, le, le->ulp_csum)); + + le->ulp_csum = tcp_lro_rx_csum_fixup(le, l3hdr, th, tcp_data_len, + ~csum); + th->th_sum = csum; /* Restore checksum on first packet. */ +#endif + + le->m_head = m; + le->m_tail = m_last(m); + + return (0); } + +/* end */ Modified: head/sys/netinet/tcp_lro.h ============================================================================== --- head/sys/netinet/tcp_lro.h Thu May 24 22:14:39 2012 (r235943) +++ head/sys/netinet/tcp_lro.h Thu May 24 23:03:23 2012 (r235944) @@ -30,31 +30,46 @@ #ifndef _TCP_LRO_H_ #define _TCP_LRO_H_ -struct lro_entry; struct lro_entry { - SLIST_ENTRY(lro_entry) next; - struct mbuf *m_head; - struct mbuf *m_tail; - int timestamp; - struct ip *ip; - uint32_t tsval; - uint32_t tsecr; - uint32_t source_ip; - uint32_t dest_ip; - uint32_t next_seq; - uint32_t ack_seq; - uint32_t len; - uint32_t data_csum; - uint16_t window; - uint16_t source_port; - uint16_t dest_port; - uint16_t append_cnt; - uint16_t mss; - + SLIST_ENTRY(lro_entry) next; + struct mbuf *m_head; + struct mbuf *m_tail; + union { + struct ip *ip4; + struct ip6_hdr *ip6; + } leip; + union { + in_addr_t s_ip4; + struct in6_addr s_ip6; + } lesource; + union { + in_addr_t d_ip4; + struct in6_addr d_ip6; + } ledest; + uint16_t source_port; + uint16_t dest_port; + uint16_t eh_type; /* EthernetHeader type. */ + uint16_t append_cnt; + uint32_t p_len; /* IP header payload length. */ + uint32_t ulp_csum; /* TCP, etc. checksum. */ + uint32_t next_seq; /* tcp_seq */ + uint32_t ack_seq; /* tcp_seq */ + uint32_t tsval; + uint32_t tsecr; + uint16_t window; + uint16_t timestamp; /* flag, not a TCP hdr field. */ }; SLIST_HEAD(lro_head, lro_entry); +#define le_ip4 leip.ip4 +#define le_ip6 leip.ip6 +#define source_ip4 lesource.s_ip4 +#define dest_ip4 ledest.d_ip4 +#define source_ip6 lesource.s_ip6 +#define dest_ip6 ledest.d_ip6 + +/* NB: This is part of driver structs. */ struct lro_ctrl { struct ifnet *ifp; int lro_queued; @@ -66,13 +81,12 @@ struct lro_ctrl { struct lro_head lro_free; }; - int tcp_lro_init(struct lro_ctrl *); void tcp_lro_free(struct lro_ctrl *); void tcp_lro_flush(struct lro_ctrl *, struct lro_entry *); int tcp_lro_rx(struct lro_ctrl *, struct mbuf *, uint32_t); -/* Number of LRO entries - these are per rx queue */ -#define LRO_ENTRIES 8 +#define TCP_LRO_CANNOT -1 +#define TCP_LRO_NOT_SUPPORTED 1 #endif /* _TCP_LRO_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu May 24 23:12:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 562251065678; Thu, 24 May 2012 23:12:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D29E8FC1C; Thu, 24 May 2012 23:12:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4ONCV4X066052; Thu, 24 May 2012 23:12:31 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ONCUXr066028; Thu, 24 May 2012 23:12:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201205242312.q4ONCUXr066028@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 24 May 2012 23:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235945 - in head/sys: contrib/dev/acpica contrib/dev/acpica/common contrib/dev/acpica/compiler contrib/dev/acpica/components/debugger contrib/dev/acpica/components/dispatcher contrib/d... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 23:12:31 -0000 Author: jkim Date: Thu May 24 23:12:30 2012 New Revision: 235945 URL: http://svn.freebsd.org/changeset/base/235945 Log: Merge ACPICA 20120518. Modified: head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/aslcompiler.y head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/compiler/prutils.c head/sys/contrib/dev/acpica/components/debugger/dbfileio.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/events/evxface.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c head/sys/dev/acpica/Osd/OsdSchedule.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/common/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/dispatcher/ (props changed) head/sys/contrib/dev/acpica/components/events/ (props changed) head/sys/contrib/dev/acpica/components/tables/ (props changed) head/sys/contrib/dev/acpica/components/utilities/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) head/sys/contrib/dev/acpica/os_specific/ (props changed) Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Thu May 24 23:12:30 2012 (r235945) @@ -10,8 +10,8 @@ if [ ! $# -eq 1 ]; then fi src=$1 -wrk=`realpath ./_acpi_ca_unpack` -dst=`realpath ./acpi_ca_destination` +wrk="$(realpath .)/_acpi_ca_unpack" +dst="$(realpath .)/acpi_ca_destination" # files that should keep their full directory path fulldirs="common compiler components include os_specific" @@ -67,7 +67,8 @@ for H in ${src_headers}; do xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" done for H in ${comp_headers}; do - find ${dst}/common ${dst}/compiler -name "*.[chly]" -type f | \ + find ${dst}/common ${dst}/compiler ${dst}/components \ + -name "*.[chly]" -type f | \ xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" done for H in ${platform_headers}; do Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/changes.txt Thu May 24 23:12:30 2012 (r235945) @@ -1,8 +1,70 @@ ---------------------------------------- +18 May 2012. Summary of changes for version 20120518: + + +1) ACPICA Core Subsystem: + +Added a new OSL interface, AcpiOsWaitEventsComplete. This interface is defined +to block until asynchronous events such as notifies and GPEs have completed. +Within ACPICA, it is only called before a notify or GPE handler is +removed/uninstalled. It also may be useful for the host OS within related +drivers such as the Embedded Controller driver. See the ACPICA reference for +additional information. ACPICA BZ 868. + +ACPI Tables: Added a new error message for a possible overflow failure during +the conversion of FADT 32-bit legacy register addresses to internal common 64- +bit GAS structure representation. The GAS has a one-byte "bit length" field, +thus limiting the register length to 255 bits. ACPICA BZ 953. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug +version of the code includes the debug output trace mechanism and has a much +larger code and data size. + + Previous Release: + Non-Debug Version: 92.9K Code, 25.0K Data, 117.9K Total + Debug Version: 172.6K Code, 73.4K Data, 246.0K Total + Current Release: + Non-Debug Version: 93.0K Code, 25.1K Data, 118.1K Total + Debug Version: 172.7K Code, 73.6K Data, 246.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Added the ACPI 5.0 "PCC" keyword for use in the Register() ASL macro. +This keyword was added late in the ACPI 5.0 release cycle and was not +implemented until now. + +Disassembler: Added support for Operation Region externals. Adds missing +support for operation regions that are defined in another table, and +referenced locally via a Field or BankField ASL operator. Now generates the +correct External statement. + +Disassembler: Several additional fixes for the External() statement generation +related to some ASL operators. Also, order the External() statements +alphabetically in the disassembler output. Fixes the External() generation for +the Create* field, Alias, and Scope operators: + 1) Create* buffer field operators - fix type mismatch warning on disassembly + 2) Alias - implement missing External support + 3) Scope - fix to make sure all necessary externals are emitted. + +iASL: Improved pathname support. For include files, merge the prefix pathname +with the file pathname and eliminate unnecessary components. Convert +backslashes in all pathnames to forward slashes, for readability. Include file +pathname changes affect both #include and Include() type operators. + +iASL/DTC/Preprocessor: Gracefully handle early EOF. Handle an EOF at the end +of a valid line by inserting a newline and then returning the EOF during the +next call to GetNextLine. Prevents the line from being ignored due to EOF +condition. + +iASL: Implemented some changes to enhance the IDE support (-vi option.) Error +and Warning messages are now correctly recognized for both the source code +browser and the global error and warning counts. + +---------------------------------------- 20 April 2012. Summary of changes for version 20120420: -This release is available at www.acpica.org/downloads. -The ACPI 5.0 specification is available at www.acpi.info. 1) ACPICA Core Subsystem: @@ -68,8 +130,6 @@ several extraneous "unrecognized operato ---------------------------------------- 20 March 2012. Summary of changes for version 20120320: -This release is available at www.acpica.org/downloads. -The ACPI 5.0 specification is available at www.acpi.info. 1) ACPICA Core Subsystem: @@ -160,8 +220,6 @@ Versions supported: ---------------------------------------- 15 February 2012. Summary of changes for version 20120215: -This release is available at www.acpica.org/downloads. -The ACPI 5.0 specification is available at www.acpi.info. 1) ACPICA Core Subsystem: @@ -252,8 +310,6 @@ specification. ---------------------------------------- 11 January 2012. Summary of changes for version 20120111: -This release is available at www.acpica.org/downloads. -The ACPI 5.0 specification is available at www.acpi.info. 1) ACPICA Core Subsystem: Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/common/adfile.c Thu May 24 23:12:30 2012 (r235945) @@ -298,20 +298,24 @@ FlSplitInputPathname ( return (AE_NO_MEMORY); } - Substring = strrchr (DirectoryPath, '\\'); + /* Convert backslashes to slashes in the entire path */ + + UtConvertBackslashes (DirectoryPath); + + /* Backup to last slash or colon */ + + Substring = strrchr (DirectoryPath, '/'); if (!Substring) { - Substring = strrchr (DirectoryPath, '/'); - if (!Substring) - { - Substring = strrchr (DirectoryPath, ':'); - } + Substring = strrchr (DirectoryPath, ':'); } + /* Extract the simple filename */ + if (!Substring) { + Filename = FlStrdup (DirectoryPath); DirectoryPath[0] = 0; - Filename = FlStrdup (InputPath); } else { @@ -326,7 +330,6 @@ FlSplitInputPathname ( *OutDirectoryPath = DirectoryPath; *OutFilename = Filename; - return (AE_OK); } Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/common/adwalk.c Thu May 24 23:12:30 2012 (r235945) @@ -521,6 +521,7 @@ AcpiDmFindOrphanDescending ( if ((OpInfo->Class != AML_CLASS_EXECUTE) && (OpInfo->Class != AML_CLASS_CREATE) && + (OpInfo->ObjectType != ACPI_TYPE_LOCAL_ALIAS) && (ParentOp->Common.AmlOpcode != AML_INT_METHODCALL_OP) && !Op->Common.Node) { @@ -743,13 +744,23 @@ AcpiDmXrefDescendingOp ( if (OpInfo->Flags & AML_NAMED) { - if ((Op->Common.AmlOpcode == AML_ALIAS_OP) || - (Op->Common.AmlOpcode == AML_SCOPE_OP)) + /* + * Only these two operators (Alias, Scope) refer to an existing + * name, it is the first argument + */ + if (Op->Common.AmlOpcode == AML_ALIAS_OP) + { + ObjectType = ACPI_TYPE_ANY; + + NextOp = Op->Common.Value.Arg; + NextOp = NextOp->Common.Value.Arg; + if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP) + { + Path = NextOp->Common.Value.String; + } + } + else if (Op->Common.AmlOpcode == AML_SCOPE_OP) { - /* - * Only these two operators refer to an existing name, - * first argument - */ Path = (char *) Op->Named.Path; } } @@ -757,6 +768,8 @@ AcpiDmXrefDescendingOp ( { /* Referenced Buffer Name is the first child */ + ObjectType = ACPI_TYPE_BUFFER; /* Change from TYPE_BUFFER_FIELD */ + NextOp = Op->Common.Value.Arg; if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP) { @@ -783,6 +796,11 @@ AcpiDmXrefDescendingOp ( Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, WalkState, &Node); + if (ACPI_SUCCESS (Status) && (Node->Flags & ANOBJ_IS_EXTERNAL)) + { + Status = AE_NOT_FOUND; + } + if (ACPI_FAILURE (Status)) { if (Status == AE_NOT_FOUND) Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/common/dmextern.c Thu May 24 23:12:30 2012 (r235945) @@ -454,12 +454,12 @@ AcpiDmAddToExternalList ( NewExternal->InternalPath = Path; - /* Link the new descriptor into the global list, ordered by string length */ + /* Link the new descriptor into the global list, alphabetically ordered */ NextExternal = AcpiGbl_ExternalList; while (NextExternal) { - if (NewExternal->Length <= NextExternal->Length) + if (AcpiUtStricmp (NewExternal->Path, NextExternal->Path) < 0) { if (PrevExternal) { @@ -508,7 +508,7 @@ AcpiDmAddExternalsToNamespace ( { ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; - ACPI_OPERAND_OBJECT *MethodDesc; + ACPI_OPERAND_OBJECT *ObjDesc; ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; @@ -527,13 +527,29 @@ AcpiDmAddExternalsToNamespace ( "while adding external to namespace [%s]", External->Path)); } - else if (External->Type == ACPI_TYPE_METHOD) + + else switch (External->Type) { + case ACPI_TYPE_METHOD: + /* For methods, we need to save the argument count */ - MethodDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); - MethodDesc->Method.ParamCount = (UINT8) External->Value; - Node->Object = MethodDesc; + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); + ObjDesc->Method.ParamCount = (UINT8) External->Value; + Node->Object = ObjDesc; + break; + + case ACPI_TYPE_REGION: + + /* Regions require a region sub-object */ + + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); + ObjDesc->Region.Node = Node; + Node->Object = ObjDesc; + break; + + default: + break; } External = External->Next; Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Thu May 24 23:12:30 2012 (r235945) @@ -59,12 +59,12 @@ CmFlushSourceCode ( static void FlConsumeAnsiComment ( - ASL_FILE_INFO *FileInfo, + FILE *Handle, ASL_FILE_STATUS *Status); static void FlConsumeNewComment ( - ASL_FILE_INFO *FileInfo, + FILE *Handle, ASL_FILE_STATUS *Status); @@ -253,7 +253,8 @@ CmFlushSourceCode ( * * FUNCTION: FlConsume* * - * PARAMETERS: FileInfo - Points to an open input file + * PARAMETERS: Handle - Open input file + * Status - File current status struct * * RETURN: Number of lines consumed * @@ -263,14 +264,14 @@ CmFlushSourceCode ( static void FlConsumeAnsiComment ( - ASL_FILE_INFO *FileInfo, + FILE *Handle, ASL_FILE_STATUS *Status) { UINT8 Byte; BOOLEAN ClosingComment = FALSE; - while (fread (&Byte, 1, 1, FileInfo->Handle)) + while (fread (&Byte, 1, 1, Handle)) { /* Scan until comment close is found */ @@ -307,13 +308,13 @@ FlConsumeAnsiComment ( static void FlConsumeNewComment ( - ASL_FILE_INFO *FileInfo, + FILE *Handle, ASL_FILE_STATUS *Status) { UINT8 Byte; - while (fread (&Byte, 1, 1, FileInfo->Handle)) + while (fread (&Byte, 1, 1, Handle)) { Status->Offset++; @@ -332,7 +333,9 @@ FlConsumeNewComment ( * * FUNCTION: FlCheckForAscii * - * PARAMETERS: FileInfo - Points to an open input file + * PARAMETERS: Handle - Open input file + * Filename - Input filename + * DisplayErrors - TRUE if error messages desired * * RETURN: Status * @@ -347,7 +350,9 @@ FlConsumeNewComment ( ACPI_STATUS FlCheckForAscii ( - ASL_FILE_INFO *FileInfo) + FILE *Handle, + char *Filename, + BOOLEAN DisplayErrors) { UINT8 Byte; ACPI_SIZE BadBytes = 0; @@ -360,7 +365,7 @@ FlCheckForAscii ( /* Read the entire file */ - while (fread (&Byte, 1, 1, FileInfo->Handle)) + while (fread (&Byte, 1, 1, Handle)) { /* Ignore comment fields (allow non-ascii within) */ @@ -370,12 +375,12 @@ FlCheckForAscii ( if (Byte == '*') { - FlConsumeAnsiComment (FileInfo, &Status); + FlConsumeAnsiComment (Handle, &Status); } if (Byte == '/') { - FlConsumeNewComment (FileInfo, &Status); + FlConsumeNewComment (Handle, &Status); } /* Reset */ @@ -391,7 +396,7 @@ FlCheckForAscii ( if (!ACPI_IS_ASCII (Byte)) { - if (BadBytes < 10) + if ((BadBytes < 10) && (DisplayErrors)) { AcpiOsPrintf ( "Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n", @@ -413,20 +418,24 @@ FlCheckForAscii ( /* Seek back to the beginning of the source file */ - fseek (FileInfo->Handle, 0, SEEK_SET); + fseek (Handle, 0, SEEK_SET); /* Were there any non-ASCII characters in the file? */ if (BadBytes) { - AcpiOsPrintf ( - "%u non-ASCII characters found in input source text, could be a binary file\n", - BadBytes); - AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, FileInfo->Filename); + if (DisplayErrors) + { + AcpiOsPrintf ( + "%u non-ASCII characters found in input source text, could be a binary file\n", + BadBytes); + AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename); + } + return (AE_BAD_CHARACTER); } - /* File is OK */ + /* File is OK (100% ASCII) */ return (AE_OK); } Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Thu May 24 23:12:30 2012 (r235945) @@ -166,7 +166,9 @@ CmCleanupAndExit ( ACPI_STATUS FlCheckForAscii ( - ASL_FILE_INFO *FileInfo); + FILE *Handle, + char *Filename, + BOOLEAN DisplayErrors); /* @@ -608,6 +610,11 @@ void FlAddIncludeDirectory ( char *Dir); +char * +FlMergePathnames ( + char *PrefixDir, + char *FilePathname); + void FlOpenIncludeFile ( ACPI_PARSE_OBJECT *Op); Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.l Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.l Thu May 24 23:12:30 2012 (r235945) @@ -523,6 +523,7 @@ NamePathTail [.]{NameSeg} "IPMI" { count (0); return (PARSEOP_REGIONSPACE_IPMI); } "GeneralPurposeIo" { count (0); return (PARSEOP_REGIONSPACE_GPIO); } /* ACPI 5.0 */ "GenericSerialBus" { count (0); return (PARSEOP_REGIONSPACE_GSBUS); } /* ACPI 5.0 */ +"PCC" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */ "FFixedHW" { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); } /* ResourceTypeKeyword: Resource Usage - Resource Descriptors */ Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.y Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.y Thu May 24 23:12:30 2012 (r235945) @@ -363,6 +363,7 @@ void * AslLocalAllo %token PARSEOP_REGIONSPACE_IO %token PARSEOP_REGIONSPACE_IPMI %token PARSEOP_REGIONSPACE_MEM +%token PARSEOP_REGIONSPACE_PCC %token PARSEOP_REGIONSPACE_PCI %token PARSEOP_REGIONSPACE_PCIBAR %token PARSEOP_REGIONSPACE_SMBUS @@ -2359,6 +2360,7 @@ RegionSpaceKeyword | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} + | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} ; Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Thu May 24 23:12:30 2012 (r235945) @@ -315,12 +315,16 @@ AePrintException ( } else { + /* + * Less verbose version of the error message, enabled via the + * -vi switch. The format is compatible with MS Visual Studio. + */ fprintf (OutputFile, "%s", Enode->Filename); if (Enode->LineNumber) { - fprintf (OutputFile, "(%u) i:%6u : ", - Enode->LineNumber, Enode->LineNumber); + fprintf (OutputFile, "(%u) : ", + Enode->LineNumber); } } } @@ -335,9 +339,18 @@ AePrintException ( { /* Decode the message ID */ - fprintf (OutputFile, "%s %4.4d - ", - AslErrorLevel[Enode->Level], - Enode->MessageId + ((Enode->Level+1) * 1000)); + if (Gbl_VerboseErrors) + { + fprintf (OutputFile, "%s %4.4d - ", + AslErrorLevel[Enode->Level], + Enode->MessageId + ((Enode->Level+1) * 1000)); + } + else /* IDE case */ + { + fprintf (OutputFile, "%s %4.4d:", + AslErrorLevelIde[Enode->Level], + Enode->MessageId + ((Enode->Level+1) * 1000)); + } MainMessage = AslMessages[Enode->MessageId]; ExtraMessage = Enode->Message; Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Thu May 24 23:12:30 2012 (r235945) @@ -492,6 +492,107 @@ FlAddIncludeDirectory ( /******************************************************************************* * + * FUNCTION: FlMergePathnames + * + * PARAMETERS: PrefixDir - Prefix directory pathname. Can be NULL or + * a zero length string. + * FilePathname - The include filename from the source ASL. + * + * RETURN: Merged pathname string + * + * DESCRIPTION: Merge two pathnames that (probably) have common elements, to + * arrive at a minimal length string. Merge can occur if the + * FilePathname is relative to the PrefixDir. + * + ******************************************************************************/ + +char * +FlMergePathnames ( + char *PrefixDir, + char *FilePathname) +{ + char *CommonPath; + char *Pathname; + char *LastElement; + + + DbgPrint (ASL_PARSE_OUTPUT, "Include: Prefix path - \"%s\"\n" + "Include: FilePathname - \"%s\"\n", + PrefixDir, FilePathname); + + /* + * If there is no prefix directory or if the file pathname is absolute, + * just return the original file pathname + */ + if (!PrefixDir || (!*PrefixDir) || + (*FilePathname == '/') || + (FilePathname[1] == ':')) + { + Pathname = ACPI_ALLOCATE (strlen (FilePathname) + 1); + strcpy (Pathname, FilePathname); + goto ConvertBackslashes; + } + + /* Need a local copy of the prefix directory path */ + + CommonPath = ACPI_ALLOCATE (strlen (PrefixDir) + 1); + strcpy (CommonPath, PrefixDir); + + /* + * Walk forward through the file path, and simultaneously backward + * through the prefix directory path until there are no more + * relative references at the start of the file path. + */ + while (*FilePathname && (!strncmp (FilePathname, "../", 3))) + { + /* Remove last element of the prefix directory path */ + + LastElement = strrchr (CommonPath, '/'); + if (!LastElement) + { + goto ConcatenatePaths; + } + + *LastElement = 0; /* Terminate CommonPath string */ + FilePathname += 3; /* Point to next path element */ + } + + /* + * Remove the last element of the prefix directory path (it is the same as + * the first element of the file pathname), and build the final merged + * pathname. + */ + LastElement = strrchr (CommonPath, '/'); + if (LastElement) + { + *LastElement = 0; + } + + /* Build the final merged pathname */ + +ConcatenatePaths: + Pathname = ACPI_ALLOCATE_ZEROED (strlen (CommonPath) + strlen (FilePathname) + 2); + if (LastElement && *CommonPath) + { + strcpy (Pathname, CommonPath); + strcat (Pathname, "/"); + } + strcat (Pathname, FilePathname); + ACPI_FREE (CommonPath); + + /* Convert all backslashes to normal slashes */ + +ConvertBackslashes: + UtConvertBackslashes (Pathname); + + DbgPrint (ASL_PARSE_OUTPUT, "Include: Merged Pathname - \"%s\"\n", + Pathname); + return (Pathname); +} + + +/******************************************************************************* + * * FUNCTION: FlOpenIncludeWithPrefix * * PARAMETERS: PrefixDir - Prefix directory pathname. Can be a zero @@ -515,12 +616,9 @@ FlOpenIncludeWithPrefix ( /* Build the full pathname to the file */ - Pathname = ACPI_ALLOCATE (strlen (PrefixDir) + strlen (Filename) + 1); - - strcpy (Pathname, PrefixDir); - strcat (Pathname, Filename); + Pathname = FlMergePathnames (PrefixDir, Filename); - DbgPrint (ASL_PARSE_OUTPUT, "\nAttempt to open include file: path %s\n\n", + DbgPrint (ASL_PARSE_OUTPUT, "Include: Opening file - \"%s\"\n\n", Pathname); /* Attempt to open the file, push if successful */ Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Thu May 24 23:12:30 2012 (r235945) @@ -765,9 +765,18 @@ AslDoOptions ( break; case 'i': - /* Less verbose error messages */ - + /* + * Support for integrated development environment(s). + * + * 1) No compiler signon + * 2) Send stderr messages to stdout + * 3) Less verbose error messages (single line only for each) + * 4) Error/warning messages are formatted appropriately to + * be recognized by MS Visual Studio + */ Gbl_VerboseErrors = FALSE; + Gbl_DoSignon = FALSE; + Gbl_Files[ASL_FILE_STDERR].Handle = stdout; break; case 'o': Modified: head/sys/contrib/dev/acpica/compiler/aslmap.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmap.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslmap.c Thu May 24 23:12:30 2012 (r235945) @@ -367,6 +367,7 @@ const ASL_MAPPING_ENTRY AslKeywordMa /* REGIONSPACE_IO */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SYSTEM_IO, 0, 0), /* REGIONSPACE_IPMI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_IPMI, 0, 0), /* REGIONSPACE_MEM */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SYSTEM_MEMORY, 0, 0), +/* REGIONSPACE_PCC */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PLATFORM_COMM, 0, 0), /* REGIONSPACE_PCI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PCI_CONFIG, 0, 0), /* REGIONSPACE_PCIBAR */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PCI_BAR_TARGET, 0, 0), /* REGIONSPACE_SMBUS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SMBUS, 0, 0), Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Thu May 24 23:12:30 2012 (r235945) @@ -402,7 +402,7 @@ char *AslMessages }; -char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = { +const char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = { "Warning ", "Warning ", "Warning ", @@ -411,6 +411,15 @@ char *AslErrorLevel [ "Optimize" }; +const char *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = { + "warning ", + "warning ", + "warning ", + "error ", + "remark ", + "optimize" +}; + #define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */ #endif /* ASL_EXCEPTIONS */ Modified: head/sys/contrib/dev/acpica/compiler/aslstartup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstartup.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/aslstartup.c Thu May 24 23:12:30 2012 (r235945) @@ -227,7 +227,7 @@ AslDetectSourceFileType ( /* Check for 100% ASCII source file (comments are ignored) */ - Status = FlCheckForAscii (Info); + Status = FlCheckForAscii (Info->Handle, Info->Filename, TRUE); if (ACPI_FAILURE (Status)) { printf ("Non-ascii input file - %s\n", Info->Filename); Modified: head/sys/contrib/dev/acpica/compiler/dtio.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtio.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/dtio.c Thu May 24 23:12:30 2012 (r235945) @@ -427,7 +427,6 @@ DtGetNextLine ( { case DT_START_QUOTED_STRING: case DT_SLASH_ASTERISK_COMMENT: - case DT_SLASH_SLASH_COMMENT: AcpiOsPrintf ("**** EOF within comment/string %u\n", State); break; @@ -436,7 +435,22 @@ DtGetNextLine ( break; } - return (ASL_EOF); + /* Standalone EOF is OK */ + + if (i == 0) + { + return (ASL_EOF); + } + + /* + * Received an EOF in the middle of a line. Terminate the + * line with a newline. The next call to this function will + * return a standalone EOF. Thus, the upper parsing software + * never has to deal with an EOF within a valid line (or + * the last line does not get tossed on the floor.) + */ + c = '\n'; + State = DT_NORMAL_TEXT; } switch (State) Modified: head/sys/contrib/dev/acpica/compiler/prscan.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/prscan.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/prscan.c Thu May 24 23:12:30 2012 (r235945) @@ -654,7 +654,7 @@ PrDoDirective ( } DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID - "Start #include file %s\n", Gbl_CurrentLineNumber, + "Start #include file \"%s\"\n", Gbl_CurrentLineNumber, Token, Gbl_CurrentLineNumber); PrOpenIncludeFile (Token); Modified: head/sys/contrib/dev/acpica/compiler/prutils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/prutils.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/compiler/prutils.c Thu May 24 23:12:30 2012 (r235945) @@ -246,13 +246,11 @@ PrOpenIncludeFile ( ASL_INCLUDE_DIR *NextDir; - /* - * start the actual include file on the next line - */ + /* Start the actual include file on the next line */ + Gbl_CurrentLineOffset++; /* Attempt to open the include file */ - /* If the file specifies an absolute path, just open it */ if ((Filename[0] == '/') || @@ -330,13 +328,10 @@ PrOpenIncludeWithPrefix ( /* Build the full pathname to the file */ - Pathname = ACPI_ALLOCATE (strlen (PrefixDir) + strlen (Filename) + 1); + Pathname = FlMergePathnames (PrefixDir, Filename); - strcpy (Pathname, PrefixDir); - strcat (Pathname, Filename); - - DbgPrint (ASL_PARSE_OUTPUT, "\n" PR_PREFIX_ID - "Opening include file: path %s\n", + DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID + "Include: Opening file - \"%s\"\n", Gbl_CurrentLineNumber, Pathname); /* Attempt to open the file, push if successful */ Modified: head/sys/contrib/dev/acpica/components/debugger/dbfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbfileio.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/components/debugger/dbfileio.c Thu May 24 23:12:30 2012 (r235945) @@ -51,6 +51,10 @@ #include #endif +#ifdef ACPI_ASL_COMPILER +#include +#endif + #if (defined ACPI_DEBUGGER || defined ACPI_DISASSEMBLER) #define _COMPONENT ACPI_CA_DEBUGGER @@ -309,6 +313,15 @@ AcpiDbReadTable ( AcpiOsPrintf ( "TableHeader length [0x%X] greater than the input file size [0x%X]\n", TableHeader.Length, FileSize); + +#ifdef ACPI_ASL_COMPILER + Status = FlCheckForAscii (fp, NULL, FALSE); + if (ACPI_SUCCESS (Status)) + { + AcpiOsPrintf ("File appears to be ASCII only, must be binary\n", + TableHeader.Length, FileSize); + } +#endif return (AE_BAD_HEADER); } Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c Thu May 24 23:12:30 2012 (r235945) @@ -57,6 +57,18 @@ /* Local prototypes */ +#ifdef ACPI_ASL_COMPILER +#include + +static ACPI_STATUS +AcpiDsCreateExternalRegion ( + ACPI_STATUS LookupStatus, + ACPI_PARSE_OBJECT *Op, + char *Path, + ACPI_WALK_STATE *WalkState, + ACPI_NAMESPACE_NODE **Node); +#endif + static ACPI_STATUS AcpiDsGetFieldNames ( ACPI_CREATE_FIELD_INFO *Info, @@ -64,6 +76,69 @@ AcpiDsGetFieldNames ( ACPI_PARSE_OBJECT *Arg); +#ifdef ACPI_ASL_COMPILER +/******************************************************************************* + * + * FUNCTION: AcpiDsCreateExternalRegion (iASL Disassembler only) + * + * PARAMETERS: LookupStatus - Status from NsLookup operation + * Op - Op containing the Field definition and args + * Path - Pathname of the region + * ` WalkState - Current method state + * Node - Where the new region node is returned + * + * RETURN: Status + * + * DESCRIPTION: Add region to the external list if NOT_FOUND. Create a new + * region node/object. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDsCreateExternalRegion ( + ACPI_STATUS LookupStatus, + ACPI_PARSE_OBJECT *Op, + char *Path, + ACPI_WALK_STATE *WalkState, + ACPI_NAMESPACE_NODE **Node) +{ + ACPI_STATUS Status; + ACPI_OPERAND_OBJECT *ObjDesc; + + + if (LookupStatus != AE_NOT_FOUND) + { + return (LookupStatus); + } + + /* + * Table disassembly: + * OperationRegion not found. Generate an External for it, and + * insert the name into the namespace. + */ + AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_REGION, 0); + Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION, + ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Must create and install a region object for the new node */ + + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); + if (!ObjDesc) + { + return (AE_NO_MEMORY); + } + + ObjDesc->Region.Node = *Node; + Status = AcpiNsAttachObject (*Node, ObjDesc, ACPI_TYPE_REGION); + return (Status); +} +#endif + + /******************************************************************************* * * FUNCTION: AcpiDsCreateBufferField @@ -438,11 +513,16 @@ AcpiDsCreateField ( /* First arg is the name of the parent OpRegion (must already exist) */ Arg = Op->Common.Value.Arg; + if (!RegionNode) { Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name, ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode); +#ifdef ACPI_ASL_COMPILER + Status = AcpiDsCreateExternalRegion (Status, Arg, + Arg->Common.Value.Name, WalkState, &RegionNode); +#endif if (ACPI_FAILURE (Status)) { ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status); @@ -628,6 +708,10 @@ AcpiDsCreateBankField ( Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name, ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode); +#ifdef ACPI_ASL_COMPILER + Status = AcpiDsCreateExternalRegion (Status, Arg, + Arg->Common.Value.Name, WalkState, &RegionNode); +#endif if (ACPI_FAILURE (Status)) { ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status); Modified: head/sys/contrib/dev/acpica/components/events/evxface.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evxface.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/components/events/evxface.c Thu May 24 23:12:30 2012 (r235945) @@ -280,11 +280,9 @@ AcpiRemoveNotifyHandler ( return_ACPI_STATUS (AE_BAD_PARAMETER); } -#ifdef _UNDER_DEVELOPMENT - /* Make sure all deferred tasks are completed */ + /* Make sure all deferred notify tasks are completed */ - AcpiOsWaitEventsComplete (NULL); -#endif + AcpiOsWaitEventsComplete (); Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) @@ -802,6 +800,10 @@ AcpiRemoveGpeHandler ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* Make sure all deferred GPE tasks are completed */ + + AcpiOsWaitEventsComplete (); + Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); if (ACPI_FAILURE (Status)) { Modified: head/sys/contrib/dev/acpica/components/tables/tbfadt.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbfadt.c Thu May 24 23:03:23 2012 (r235944) +++ head/sys/contrib/dev/acpica/components/tables/tbfadt.c Thu May 24 23:12:30 2012 (r235945) @@ -52,12 +52,13 @@ /* Local prototypes */ -static ACPI_INLINE void +static void AcpiTbInitGenericAddress ( ACPI_GENERIC_ADDRESS *GenericAddress, UINT8 SpaceId, UINT8 ByteWidth, - UINT64 Address); + UINT64 Address, + char *RegisterName); static void AcpiTbConvertFadt ( @@ -202,13 +203,30 @@ static ACPI_FADT_PM_INFO FadtPmInfoTa *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 24 23:46:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED497106566B; Thu, 24 May 2012 23:46:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D92A68FC15; Thu, 24 May 2012 23:46:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4ONkHaj067474; Thu, 24 May 2012 23:46:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ONkHDi067472; Thu, 24 May 2012 23:46:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205242346.q4ONkHDi067472@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 24 May 2012 23:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235946 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 23:46:18 -0000 Author: bz Date: Thu May 24 23:46:17 2012 New Revision: 235946 URL: http://svn.freebsd.org/changeset/base/235946 Log: Add a missing " to get closer to compiling. Modified: head/sys/powerpc/include/atomic.h Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Thu May 24 23:12:30 2012 (r235945) +++ head/sys/powerpc/include/atomic.h Thu May 24 23:46:17 2012 (r235946) @@ -56,7 +56,7 @@ #else #define mb() __asm __volatile("sync" : : : "memory") #define rmb() __asm __volatile("sync" : : : "memory") -#define wmb() __asm __volatile("sync : : : "memory") +#define wmb() __asm __volatile("sync" : : : "memory") #define __ATOMIC_REL() __asm __volatile("sync" : : : "memory") #define __ATOMIC_ACQ() __asm __volatile("isync" : : : "memory") #endif From owner-svn-src-head@FreeBSD.ORG Fri May 25 00:04:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 06B74106566B; Fri, 25 May 2012 00:04:57 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id C02738FC18; Fri, 25 May 2012 00:04:51 +0000 (UTC) Received: from marcelm-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q4P04c1g075837 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 24 May 2012 17:04:44 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4FBEBA30.6050901@freebsd.org> Date: Thu, 24 May 2012 17:04:33 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205242045.q4OKjipb059398@svn.freebsd.org> <4FBEA493.4020702@freebsd.org> <4FBEB2F3.4060405@freebsd.org> <358A54BA-6B8E-4685-8CDD-CCAC305ACA2B@xcllnt.net> <4FBEBA30.6050901@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r235931 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 00:04:57 -0000 On May 24, 2012, at 3:46 PM, Nathan Whitehorn wrote: > On 05/24/12 17:22, Marcel Moolenaar wrote: >>=20 >> On May 24, 2012, at 3:15 PM, Nathan Whitehorn wrote: >>=20 >>>>> Summary: >>>>> 1. *mb() must be lwsync or sync on all machines, except for wmb() = which could be eieio >>>>> 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync = with bus_space changes) >>>>> 3. __ATOMIC_REL() must be lwsync or sync >>>>=20 >>>> This is absolutely not what I concluded from our discussions. I = have no idea >>>> how we could end up so out of sync... >>>>=20 >>>=20 >>> Thanks for the quick change. No idea how we got out of sync. I find = all of this synchronization stuff a little mind-bending, so sorry for = any miscommunication. __ATOMIC_ACQ() needed to also be isync on ppc64, = so I've fixed that up. Things should be good now. >>=20 >> Ok. I didn't change wmb() to eieio as I wanted to avoid a pendulum = effect. >> I'll reread our emails and make sure wmb() is what we think it is and = if >> so I'll do a followup commit. >> FYI, >>=20 >=20 > I don't think it really makes a difference. Basically nothing uses = wmb(), and those things that do mostly use it wrong and need sync. So it = should probably stay as [lw]sync. Works for me. Thanks! --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Fri May 25 00:18:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3AD02106566B; Fri, 25 May 2012 00:18:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2631D8FC14; Fri, 25 May 2012 00:18:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P0IKAZ068913; Fri, 25 May 2012 00:18:20 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P0IJeJ068911; Fri, 25 May 2012 00:18:19 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201205250018.q4P0IJeJ068911@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 25 May 2012 00:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235948 - head/usr.sbin/acpi/acpidump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 00:18:20 -0000 Author: jkim Date: Fri May 25 00:18:19 2012 New Revision: 235948 URL: http://svn.freebsd.org/changeset/base/235948 Log: Catch up with realpath(3) changes (r235266) and unbreak acpidump(8). Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Thu May 24 23:55:08 2012 (r235947) +++ head/usr.sbin/acpi/acpidump/acpi.c Fri May 25 00:18:19 2012 (r235948) @@ -1196,13 +1196,13 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt, if (tmpdir == NULL) tmpdir = _PATH_TMP; strncpy(tmpstr, tmpdir, sizeof(tmpstr)); - strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(tmpdir)); if (realpath(tmpstr, buf) == NULL) { - perror("realpath tmp file"); + perror("realpath tmp dir"); return; } strncpy(tmpstr, buf, sizeof(tmpstr)); - len = strlen(buf); + strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(buf)); + len = strlen(tmpstr); tmpext = tmpstr + len; strncpy(tmpext, "XXXXXX", sizeof(tmpstr) - len); fd = mkstemp(tmpstr); From owner-svn-src-head@FreeBSD.ORG Fri May 25 00:38:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0BC1D106566C; Fri, 25 May 2012 00:38:07 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EADBD8FC0A; Fri, 25 May 2012 00:38:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P0c63E069706; Fri, 25 May 2012 00:38:06 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P0c62j069704; Fri, 25 May 2012 00:38:06 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201205250038.q4P0c62j069704@svn.freebsd.org> From: Jamie Gritton Date: Fri, 25 May 2012 00:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235949 - head/usr.sbin/jail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 00:38:07 -0000 Author: jamie Date: Fri May 25 00:38:06 2012 New Revision: 235949 URL: http://svn.freebsd.org/changeset/base/235949 Log: Don't try to set a null TERM environment. Submitted by: Mateusz Guzik Modified: head/usr.sbin/jail/command.c Modified: head/usr.sbin/jail/command.c ============================================================================== --- head/usr.sbin/jail/command.c Fri May 25 00:18:19 2012 (r235948) +++ head/usr.sbin/jail/command.c Fri May 25 00:38:06 2012 (r235949) @@ -584,7 +584,8 @@ run_command(struct cfjail *j) term = getenv("TERM"); environ = &cleanenv; setenv("PATH", "/bin:/usr/bin", 0); - setenv("TERM", term, 1); + if (term != NULL) + setenv("TERM", term, 1); } if (setusercontext(lcap, pwd, pwd->pw_uid, username ? LOGIN_SETALL & ~LOGIN_SETGROUP & ~LOGIN_SETLOGIN From owner-svn-src-head@FreeBSD.ORG Fri May 25 01:13:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAEE31065680; Fri, 25 May 2012 01:13:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 960F48FC16; Fri, 25 May 2012 01:13:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P1Dd5B071211; Fri, 25 May 2012 01:13:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P1DdI9071209; Fri, 25 May 2012 01:13:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250113.q4P1DdI9071209@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 01:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235950 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 01:13:39 -0000 Author: bz Date: Fri May 25 01:13:39 2012 New Revision: 235950 URL: http://svn.freebsd.org/changeset/base/235950 Log: MFp4 bz_ipv6_fast: Factor out the tcp_hc_getmtu() call. As the comments say it applies to both v4 and v6, so only write it once making it easier to read the protocol family specifc code. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri May 25 00:38:06 2012 (r235949) +++ head/sys/netinet/tcp_input.c Fri May 25 01:13:39 2012 (r235950) @@ -3542,7 +3542,6 @@ tcp_mssopt(struct in_conninfo *inc) if (inc->inc_flags & INC_ISIPV6) { mss = V_tcp_v6mssdflt; maxmtu = tcp_maxmtu6(inc, NULL); - thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ min_protoh = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); } #endif @@ -3553,10 +3552,13 @@ tcp_mssopt(struct in_conninfo *inc) { mss = V_tcp_mssdflt; maxmtu = tcp_maxmtu(inc, NULL); - thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ min_protoh = sizeof(struct tcpiphdr); } #endif +#if defined(INET6) || defined(INET) + thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ +#endif + if (maxmtu && thcmtu) mss = min(maxmtu, thcmtu) - min_protoh; else if (maxmtu || thcmtu) From owner-svn-src-head@FreeBSD.ORG Fri May 25 01:42:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E9DC106566B; Fri, 25 May 2012 01:42:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 594BF8FC0A; Fri, 25 May 2012 01:42:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P1gn7x072505; Fri, 25 May 2012 01:42:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P1gnNG072503; Fri, 25 May 2012 01:42:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250142.q4P1gnNG072503@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 01:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235953 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 01:42:49 -0000 Author: bz Date: Fri May 25 01:42:48 2012 New Revision: 235953 URL: http://svn.freebsd.org/changeset/base/235953 Log: MFp4 bz_ipv6_fast: No need to hold the (expensive) rt lock over (expensive) logging. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Fri May 25 01:21:17 2012 (r235952) +++ head/sys/netinet6/icmp6.c Fri May 25 01:42:48 2012 (r235953) @@ -2418,23 +2418,23 @@ icmp6_redirect_input(struct mbuf *m, int if (rt) { if (rt->rt_gateway == NULL || rt->rt_gateway->sa_family != AF_INET6) { + RTFREE_LOCKED(rt); nd6log((LOG_ERR, "ICMP6 redirect rejected; no route " "with inet6 gateway found for redirect dst: %s\n", icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); - RTFREE_LOCKED(rt); goto bad; } gw6 = &(((struct sockaddr_in6 *)rt->rt_gateway)->sin6_addr); if (bcmp(&src6, gw6, sizeof(struct in6_addr)) != 0) { + RTFREE_LOCKED(rt); nd6log((LOG_ERR, "ICMP6 redirect rejected; " "not equal to gw-for-src=%s (must be same): " "%s\n", ip6_sprintf(ip6buf, gw6), icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); - RTFREE_LOCKED(rt); goto bad; } } else { From owner-svn-src-head@FreeBSD.ORG Fri May 25 01:43:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41C2B1065680; Fri, 25 May 2012 01:43:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D9B88FC0A; Fri, 25 May 2012 01:43:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P1hrY9072578; Fri, 25 May 2012 01:43:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P1hqMl072576; Fri, 25 May 2012 01:43:52 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250143.q4P1hqMl072576@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 01:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235954 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 01:43:53 -0000 Author: bz Date: Fri May 25 01:43:52 2012 New Revision: 235954 URL: http://svn.freebsd.org/changeset/base/235954 Log: MFp4 bz_ipv6_fast: We currently nowhere set IP6A_SWAP making the entire check useless with the current code. Keep around but do not compile in. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/route6.c Modified: head/sys/netinet6/route6.c ============================================================================== --- head/sys/netinet6/route6.c Fri May 25 01:42:48 2012 (r235953) +++ head/sys/netinet6/route6.c Fri May 25 01:43:52 2012 (r235954) @@ -62,6 +62,7 @@ route6_input(struct mbuf **mp, int *offp struct mbuf *m = *mp; struct ip6_rthdr *rh; int off = *offp, rhlen; +#ifdef __notyet__ struct ip6aux *ip6a; ip6a = ip6_findaux(m); @@ -73,6 +74,7 @@ route6_input(struct mbuf **mp, int *offp return IPPROTO_DONE; } } +#endif #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, off, sizeof(*rh), IPPROTO_DONE); From owner-svn-src-head@FreeBSD.ORG Fri May 25 01:45:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DC85106564A; Fri, 25 May 2012 01:45:06 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED6848FC0A; Fri, 25 May 2012 01:45:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P1j56g072686; Fri, 25 May 2012 01:45:05 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P1j5nN072684; Fri, 25 May 2012 01:45:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250145.q4P1j5nN072684@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 01:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235955 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 01:45:06 -0000 Author: bz Date: Fri May 25 01:45:05 2012 New Revision: 235955 URL: http://svn.freebsd.org/changeset/base/235955 Log: MFp4 bz_ipv6_fast: Simplify the code removing a return from an earlier else case, not differing from the default function return called now. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Fri May 25 01:43:52 2012 (r235954) +++ head/sys/netinet6/in6_src.c Fri May 25 01:45:05 2012 (r235955) @@ -873,8 +873,7 @@ in6_selecthlim(struct inpcb *in6p, struc RTFREE(ro6.ro_rt); if (lifp) return (ND_IFINFO(lifp)->chlim); - } else - return (V_ip6_defhlim); + } } return (V_ip6_defhlim); } From owner-svn-src-head@FreeBSD.ORG Fri May 25 01:48:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 198401065678; Fri, 25 May 2012 01:48:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFE6A8FC17; Fri, 25 May 2012 01:48:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P1mFp5072846; Fri, 25 May 2012 01:48:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P1mFei072843; Fri, 25 May 2012 01:48:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250148.q4P1mFei072843@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 01:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235956 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 01:48:16 -0000 Author: bz Date: Fri May 25 01:48:15 2012 New Revision: 235956 URL: http://svn.freebsd.org/changeset/base/235956 Log: MFp4 bz_ipv6_fast: Hide the ip6aux functions. The only one referenced outside ip6_input.c is not compiled in yet (__notyet__) in route6.c (r235954). We do have accessor functions that should be used. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days X-MFC: KPI? Modified: head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_var.h Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Fri May 25 01:45:05 2012 (r235955) +++ head/sys/netinet6/ip6_input.c Fri May 25 01:48:15 2012 (r235956) @@ -146,6 +146,9 @@ RW_SYSINIT(in6_ifaddr_lock, &in6_ifaddr_ static void ip6_init2(void *); static struct ip6aux *ip6_setdstifaddr(struct mbuf *, struct in6_ifaddr *); +static struct ip6aux *ip6_addaux(struct mbuf *); +static struct ip6aux *ip6_findaux(struct mbuf *m); +static void ip6_delaux (struct mbuf *); static int ip6_hopopts_input(u_int32_t *, u_int32_t *, struct mbuf **, int *); #ifdef PULLDOWN_TEST static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int); @@ -1772,7 +1775,7 @@ ip6_lasthdr(struct mbuf *m, int off, int } } -struct ip6aux * +static struct ip6aux * ip6_addaux(struct mbuf *m) { struct m_tag *mtag; @@ -1789,7 +1792,7 @@ ip6_addaux(struct mbuf *m) return mtag ? (struct ip6aux *)(mtag + 1) : NULL; } -struct ip6aux * +static struct ip6aux * ip6_findaux(struct mbuf *m) { struct m_tag *mtag; @@ -1798,7 +1801,7 @@ ip6_findaux(struct mbuf *m) return mtag ? (struct ip6aux *)(mtag + 1) : NULL; } -void +static void ip6_delaux(struct mbuf *m) { struct m_tag *mtag; Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Fri May 25 01:45:05 2012 (r235955) +++ head/sys/netinet6/ip6_var.h Fri May 25 01:48:15 2012 (r235956) @@ -388,9 +388,9 @@ char * ip6_get_prevhdr __P((struct mbuf int ip6_nexthdr __P((struct mbuf *, int, int, int *)); int ip6_lasthdr __P((struct mbuf *, int, int, int *)); -struct ip6aux *ip6_addaux __P((struct mbuf *)); +#ifdef __notyet__ struct ip6aux *ip6_findaux __P((struct mbuf *)); -void ip6_delaux __P((struct mbuf *)); +#endif extern int (*ip6_mforward)(struct ip6_hdr *, struct ifnet *, struct mbuf *); From owner-svn-src-head@FreeBSD.ORG Fri May 25 02:08:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 961B1106566B; Fri, 25 May 2012 02:08:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F8678FC0A; Fri, 25 May 2012 02:08:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P2802S073676; Fri, 25 May 2012 02:08:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P2801i073669; Fri, 25 May 2012 02:08:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205250208.q4P2801i073669@svn.freebsd.org> From: Adrian Chadd Date: Fri, 25 May 2012 02:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235957 - in head/sys/dev/ath: . ath_hal/ar5416 ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:08:00 -0000 Author: adrian Date: Fri May 25 02:07:59 2012 New Revision: 235957 URL: http://svn.freebsd.org/changeset/base/235957 Log: Prepare for improved (read: pcie) suspend/resume support. * Flesh out the pcie disable method for 11n chips, as they were defaulting to the AR5212 (empty) PCIe disable method. * Add accessor macros for the HAL PCIe enable/disable calls. * Call disable on ath_suspend() * Call enable on ath_resume() NOTE: * This has nothing to do with the NIC sleep/run state - the NIC still will stay in network-run state rather than supporting network-sleep state. This is preparation work for supporting correct suspend/resume WARs for the 11n PCIe NICs. TODO: * It may be feasible at this point to keep the chip powered down during initial probe/attach and only power it up upon the first configure/reset pass. This however would require correct (for values of "correct") tracking of the NIC power configuration state from the driver and that just isn't attempted at the moment. Tested: * AR9280 on my Lenovo T60, but with no suspend/resume pass (yet). Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 01:48:15 2012 (r235956) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 02:07:59 2012 (r235957) @@ -31,6 +31,7 @@ #include "ar5416/ar5416.ini" static void ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar5416DisablePCIE(struct ath_hal *ah); static void ar5416WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan); static void ar5416SpurMitigate(struct ath_hal *ah, @@ -99,6 +100,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_phyDisable = ar5416PhyDisable; ah->ah_disable = ar5416Disable; ah->ah_configPCIE = ar5416ConfigPCIE; + ah->ah_disablePCIE = ar5416DisablePCIE; ah->ah_perCalibration = ar5416PerCalibration; ah->ah_perCalibrationN = ar5416PerCalibrationN, ah->ah_resetCalValid = ar5416ResetCalValid, @@ -474,6 +476,12 @@ ar5416ConfigPCIE(struct ath_hal *ah, HAL } static void +ar5416DisablePCIE(struct ath_hal *ah) +{ + /* XXX TODO */ +} + +static void ar5416WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan) { u_int modesIndex, freqIndex; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri May 25 01:48:15 2012 (r235956) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri May 25 02:07:59 2012 (r235957) @@ -62,6 +62,7 @@ static const HAL_PERCAL_DATA ar9280_adc_ }; static void ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar9280DisablePCIE(struct ath_hal *ah); static HAL_BOOL ar9280FillCapabilityInfo(struct ath_hal *ah); static void ar9280WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan); @@ -187,6 +188,7 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s ah->ah_setAntennaSwitch = ar9280SetAntennaSwitch; ah->ah_configPCIE = ar9280ConfigPCIE; + ah->ah_disablePCIE = ar9280DisablePCIE; AH5416(ah)->ah_cal.iqCalData.calData = &ar9280_iq_cal; AH5416(ah)->ah_cal.adcGainCalData.calData = &ar9280_adc_gain_cal; @@ -426,6 +428,12 @@ ar9280ConfigPCIE(struct ath_hal *ah, HAL } static void +ar9280DisablePCIE(struct ath_hal *ah) +{ + /* XXX TODO */ +} + +static void ar9280WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan) { u_int modesIndex, freqIndex; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri May 25 01:48:15 2012 (r235956) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri May 25 02:07:59 2012 (r235957) @@ -67,6 +67,7 @@ static const HAL_PERCAL_DATA ar9280_adc_ }; static void ar9285ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar9285DisablePCIE(struct ath_hal *ah); static HAL_BOOL ar9285FillCapabilityInfo(struct ath_hal *ah); static void ar9285WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan); @@ -152,6 +153,7 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s ah->ah_setAntennaSwitch = ar9285SetAntennaSwitch; ah->ah_configPCIE = ar9285ConfigPCIE; + ah->ah_disablePCIE = ar9285DisablePCIE; ah->ah_setTxPower = ar9285SetTransmitPower; ah->ah_setBoardValues = ar9285SetBoardValues; @@ -373,6 +375,12 @@ ar9285ConfigPCIE(struct ath_hal *ah, HAL } static void +ar9285DisablePCIE(struct ath_hal *ah) +{ + /* XXX TODO */ +} + +static void ar9285WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan) { u_int modesIndex, freqIndex; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Fri May 25 01:48:15 2012 (r235956) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Fri May 25 02:07:59 2012 (r235957) @@ -66,6 +66,7 @@ static const HAL_PERCAL_DATA ar9287_adc_ }; static void ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar9287DisablePCIE(struct ath_hal *ah); static HAL_BOOL ar9287FillCapabilityInfo(struct ath_hal *ah); static void ar9287WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan); @@ -141,6 +142,7 @@ ar9287Attach(uint16_t devid, HAL_SOFTC s ah->ah_setAntennaSwitch = ar9287SetAntennaSwitch; ah->ah_configPCIE = ar9287ConfigPCIE; + ah->ah_disablePCIE = ar9287DisablePCIE; AH5416(ah)->ah_cal.iqCalData.calData = &ar9287_iq_cal; AH5416(ah)->ah_cal.adcGainCalData.calData = &ar9287_adc_gain_cal; @@ -368,6 +370,12 @@ ar9287ConfigPCIE(struct ath_hal *ah, HAL } static void +ar9287DisablePCIE(struct ath_hal *ah) +{ + /* XXX TODO */ +} + +static void ar9287WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan) { u_int modesIndex, freqIndex; Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri May 25 01:48:15 2012 (r235956) +++ head/sys/dev/ath/if_ath.c Fri May 25 02:07:59 2012 (r235957) @@ -1318,6 +1318,9 @@ ath_suspend(struct ath_softc *sc) * mode; pci will power off our socket on suspend and * CardBus detaches the device. */ + + /* For PCIe, this matters */ + ath_hal_disablepcie(sc->sc_ah); } /* @@ -1350,6 +1353,9 @@ ath_resume(struct ath_softc *sc) DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n", __func__, ifp->if_flags); + /* Re-enable PCIe, re-enable the PCIe bus */ + ath_hal_enablepcie(ah, 1); + /* * Must reset the chip before we reload the * keycache as we were powered down on suspend. Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri May 25 01:48:15 2012 (r235956) +++ head/sys/dev/ath/if_athvar.h Fri May 25 02:07:59 2012 (r235957) @@ -996,6 +996,14 @@ void ath_intr(void *); ((*(_ah)->ah_gpioSetIntr)((_ah), (_gpio), (_b))) /* + * PCIe suspend/resume/poweron/poweroff related macros + */ +#define ath_hal_enablepcie(_ah, _restore) \ + ((*(_ah)->ah_configPCIE)((_ah), (_restore))) +#define ath_hal_disablepcie(_ah) \ + ((*(_ah)->ah_disablePCIE)((_ah))) + +/* * This is badly-named; you need to set the correct parameters * to begin to receive useful radar events; and even then * it doesn't "enable" DFS. See the ath_dfs/null/ module for From owner-svn-src-head@FreeBSD.ORG Fri May 25 02:17:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 68BC4106577F; Fri, 25 May 2012 02:17:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 490588FC16; Fri, 25 May 2012 02:17:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P2HHTY074072; Fri, 25 May 2012 02:17:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P2HHiG074069; Fri, 25 May 2012 02:17:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250217.q4P2HHiG074069@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 02:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235958 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:17:17 -0000 Author: bz Date: Fri May 25 02:17:16 2012 New Revision: 235958 URL: http://svn.freebsd.org/changeset/base/235958 Log: MFp4 bz_ipv6_fast: Add support for delayed checksum calculations in the IPv6 output path. We currently cannot offload to the card if we add extension headers (which incl. fragmentation). Fix two SCTP offload support copy&paste bugs: calculate checksums if fragmenting and no need to flag IPv4 header checksums in the IPv6 forwarding path. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Fri May 25 02:07:59 2012 (r235957) +++ head/sys/netinet6/ip6_forward.c Fri May 25 02:17:16 2012 (r235958) @@ -586,8 +586,6 @@ skip_routing: CSUM_DATA_VALID | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } - m->m_pkthdr.csum_flags |= - CSUM_IP_CHECKED | CSUM_IP_VALID; #ifdef SCTP if (m->m_pkthdr.csum_flags & CSUM_SCTP) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Fri May 25 02:07:59 2012 (r235957) +++ head/sys/netinet6/ip6_output.c Fri May 25 02:17:16 2012 (r235958) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -182,6 +184,29 @@ static int copypktopts(struct ip6_pktopt }\ } while (/*CONSTCOND*/ 0) +static void +in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset) +{ + u_short csum; + + csum = in_cksum_skip(m, ntohl(plen), offset); + if (m->m_pkthdr.csum_flags & CSUM_UDP && csum == 0) + csum = 0xffff; + offset += m->m_pkthdr.csum_data; /* checksum offset */ + + if (offset + sizeof(u_short) > m->m_len) { + printf("%s: delayed m_pullup, m->len: %d off: %d\n", + __func__, m->m_len, offset); + /* + * XXX this should not happen, but if it does, the correct + * behavior may be to insert the checksum in the appropriate + * next mbuf in the chain. + */ + return; + } + *(u_short *)(m->m_data + offset) = csum; +} + /* * IP6 output. The packet in mbuf chain m contains a skeletal IP6 * header (with pri, len, nxt, hlim, src, dst). @@ -221,9 +246,7 @@ ip6_output(struct mbuf *m0, struct ip6_p int flevalid = 0; int hdrsplit = 0; int needipsec = 0; -#ifdef SCTP - int sw_csum; -#endif + int sw_csum, tso; #ifdef IPSEC struct ipsec_output_state state; struct ip6_rthdr *rh = NULL; @@ -867,8 +890,6 @@ again: CSUM_DATA_VALID | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } - m->m_pkthdr.csum_flags |= - CSUM_IP_CHECKED | CSUM_IP_VALID; #ifdef SCTP if (m->m_pkthdr.csum_flags & CSUM_SCTP) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; @@ -891,7 +912,7 @@ again: } #ifdef SCTP if (m->m_pkthdr.csum_flags & CSUM_SCTP) - m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; + m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; #endif error = netisr_queue(NETISR_IPV6, m); goto done; @@ -927,16 +948,32 @@ passout: * 4: if dontfrag == 1 && alwaysfrag == 1 * error, as we cannot handle this conflicting request */ + sw_csum = m->m_pkthdr.csum_flags; + if (!hdrsplit) { + tso = ((sw_csum & ifp->if_hwassist & CSUM_TSO) != 0) ? 1 : 0; + sw_csum &= ~ifp->if_hwassist; + } else + tso = 0; + /* + * If we added extension headers, we will not do TSO and calculate the + * checksums ourselves for now. + * XXX-BZ Need a framework to know when the NIC can handle it, even + * with ext. hdrs. + */ + if (sw_csum & CSUM_DELAY_DATA) { + sw_csum &= ~CSUM_DELAY_DATA; + in6_delayed_cksum(m, ip6->ip6_plen, sizeof(struct ip6_hdr)); + } #ifdef SCTP - sw_csum = m->m_pkthdr.csum_flags & ~ifp->if_hwassist; if (sw_csum & CSUM_SCTP) { - sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); sw_csum &= ~CSUM_SCTP; + sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); } #endif + m->m_pkthdr.csum_flags &= ifp->if_hwassist; tlen = m->m_pkthdr.len; - if (opt && (opt->ip6po_flags & IP6PO_DONTFRAG)) + if ((opt && (opt->ip6po_flags & IP6PO_DONTFRAG)) || tso) dontfrag = 1; else dontfrag = 0; @@ -945,7 +982,7 @@ passout: error = EMSGSIZE; goto bad; } - if (dontfrag && tlen > IN6_LINKMTU(ifp)) { /* case 2-b */ + if (dontfrag && tlen > IN6_LINKMTU(ifp) && !tso) { /* case 2-b */ /* * Even if the DONTFRAG option is specified, we cannot send the * packet when the data length is larger than the MTU of the @@ -1033,6 +1070,22 @@ passout: goto bad; } + + /* + * If the interface will not calculate checksums on + * fragmented packets, then do it here. + * XXX-BZ handle the hw offloading case. Need flags. + */ + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + in6_delayed_cksum(m, ip6->ip6_plen, sizeof(*ip6)); + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; + } +#ifdef SCTP + if (m->m_pkthdr.csum_flags & CSUM_SCTP) { + sctp_delayed_cksum(m, hlen); + m->m_pkthdr.csum_flags &= ~CSUM_SCTP; + } +#endif mnext = &m->m_nextpkt; /* From owner-svn-src-head@FreeBSD.ORG Fri May 25 02:19:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EB871106564A; Fri, 25 May 2012 02:19:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D73CB8FC19; Fri, 25 May 2012 02:19:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P2JH4x074201; Fri, 25 May 2012 02:19:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P2JH00074198; Fri, 25 May 2012 02:19:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250219.q4P2JH00074198@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 02:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235959 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:19:18 -0000 Author: bz Date: Fri May 25 02:19:17 2012 New Revision: 235959 URL: http://svn.freebsd.org/changeset/base/235959 Log: MFp4 bz_ipv6_fast: Defer checksum calulations on UDP6 output and respect the mbuf flags set by NICs having done checksum validation for us already, thus saving the computing time in the input path as well. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Fri May 25 02:17:16 2012 (r235958) +++ head/sys/netinet6/udp6_usrreq.c Fri May 25 02:19:17 2012 (r235959) @@ -185,6 +185,7 @@ udp6_input(struct mbuf **mp, int *offp, #ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag; #endif + uint16_t uh_sum; ifp = m->m_pkthdr.rcvif; ip6 = mtod(m, struct ip6_hdr *); @@ -228,7 +229,18 @@ udp6_input(struct mbuf **mp, int *offp, UDPSTAT_INC(udps_nosum); goto badunlocked; } - if (in6_cksum(m, IPPROTO_UDP, off, ulen) != 0) { + + if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { + if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) + uh_sum = m->m_pkthdr.csum_data; + else + uh_sum = in6_cksum_pseudo(ip6, ulen, + IPPROTO_UDP, m->m_pkthdr.csum_data); + uh_sum ^= 0xffff; + } else + uh_sum = in6_cksum(m, IPPROTO_UDP, off, ulen); + + if (uh_sum != 0) { UDPSTAT_INC(udps_badsum); goto badunlocked; } @@ -771,10 +783,9 @@ udp6_output(struct inpcb *inp, struct mb ip6->ip6_src = *laddr; ip6->ip6_dst = *faddr; - if ((udp6->uh_sum = in6_cksum(m, IPPROTO_UDP, - sizeof(struct ip6_hdr), plen)) == 0) { - udp6->uh_sum = 0xffff; - } + udp6->uh_sum = in6_cksum_pseudo(ip6, plen, IPPROTO_UDP, 0); + m->m_pkthdr.csum_flags = CSUM_UDP; + m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); flags = 0; From owner-svn-src-head@FreeBSD.ORG Fri May 25 02:21:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6118C1065670; Fri, 25 May 2012 02:21:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DA168FC12; Fri, 25 May 2012 02:21:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P2LIvb074328; Fri, 25 May 2012 02:21:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P2LIVn074326; Fri, 25 May 2012 02:21:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250221.q4P2LIVn074326@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 02:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235960 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:21:18 -0000 Author: bz Date: Fri May 25 02:21:17 2012 New Revision: 235960 URL: http://svn.freebsd.org/changeset/base/235960 Log: MFp4 bz_ipv6_fast: Simple yet effective change enabling checksum "offload" on loopback for IPv6 to avoid expensive computations. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/net/if_loop.c Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Fri May 25 02:19:17 2012 (r235959) +++ head/sys/net/if_loop.c Fri May 25 02:21:17 2012 (r235960) @@ -247,12 +247,12 @@ looutput(struct ifnet *ifp, struct mbuf #if 1 /* XXX */ switch (dst->sa_family) { case AF_INET: + case AF_INET6: if (ifp->if_capenable & IFCAP_RXCSUM) { m->m_pkthdr.csum_data = 0xffff; m->m_pkthdr.csum_flags = LO_CSUM_SET; } m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES; - case AF_INET6: case AF_IPX: case AF_APPLETALK: break; From owner-svn-src-head@FreeBSD.ORG Fri May 25 02:23:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8CEC61065670; Fri, 25 May 2012 02:23:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 779FE8FC0A; Fri, 25 May 2012 02:23:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P2NRBF074457; Fri, 25 May 2012 02:23:27 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P2NRqV074451; Fri, 25 May 2012 02:23:27 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250223.q4P2NRqV074451@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 02:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235961 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:23:27 -0000 Author: bz Date: Fri May 25 02:23:26 2012 New Revision: 235961 URL: http://svn.freebsd.org/changeset/base/235961 Log: MFp4 bz_ipv6_fast: Add code to handle pre-checked TCP checksums as indicated by mbuf flags to save the entire computation for validation if not needed. In the IPv6 TCP output path only compute the pseudo-header checksum, set the checksum offset in the mbuf field along the appropriate flag as done in IPv4. In tcp_respond() just initialize the IPv6 payload length to 0 as ip6_output() will properly set it. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri May 25 02:21:17 2012 (r235960) +++ head/sys/netinet/tcp_input.c Fri May 25 02:23:26 2012 (r235961) @@ -577,13 +577,31 @@ tcp_input(struct mbuf *m, int off0) #ifdef INET6 if (isipv6) { /* IP6_EXTHDR_CHECK() is already done at tcp6_input(). */ + + if (m->m_len < (sizeof(*ip6) + sizeof(*th))) { + m = m_pullup(m, sizeof(*ip6) + sizeof(*th)); + if (m == NULL) { + TCPSTAT_INC(tcps_rcvshort); + return; + } + } + ip6 = mtod(m, struct ip6_hdr *); + th = (struct tcphdr *)((caddr_t)ip6 + off0); tlen = sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0; - if (in6_cksum(m, IPPROTO_TCP, off0, tlen)) { + if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { + if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) + th->th_sum = m->m_pkthdr.csum_data; + else + th->th_sum = in6_cksum_pseudo(ip6, tlen, + IPPROTO_TCP, m->m_pkthdr.csum_data); + th->th_sum ^= 0xffff; + } else + th->th_sum = in6_cksum(m, IPPROTO_TCP, off0, tlen); + if (th->th_sum) { TCPSTAT_INC(tcps_rcvbadsum); goto drop; } - th = (struct tcphdr *)((caddr_t)ip6 + off0); /* * Be proactive about unspecified IPv6 address in source. Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Fri May 25 02:21:17 2012 (r235960) +++ head/sys/netinet/tcp_output.c Fri May 25 02:23:26 2012 (r235961) @@ -1047,19 +1047,23 @@ send: * checksum extended header and data. */ m->m_pkthdr.len = hdrlen + len; /* in6_cksum() need this */ + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 - if (isipv6) + if (isipv6) { /* * ip6_plen is not need to be filled now, and will be filled * in ip6_output. */ - th->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(struct ip6_hdr), - sizeof(struct tcphdr) + optlen + len); + th->th_sum = in6_cksum_pseudo(ip6, sizeof(struct tcphdr) + + optlen + len, IPPROTO_TCP, 0); + } +#endif +#if defined(INET6) && defined(INET) else -#endif /* INET6 */ +#endif +#ifdef INET { - m->m_pkthdr.csum_flags = CSUM_TCP; - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(sizeof(struct tcphdr) + IPPROTO_TCP + len + optlen)); @@ -1067,6 +1071,7 @@ send: KASSERT(ip->ip_v == IPVERSION, ("%s: IP version incorrect: %d", __func__, ip->ip_v)); } +#endif /* * Enable TSO and specify the size of the segments. Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Fri May 25 02:21:17 2012 (r235960) +++ head/sys/netinet/tcp_subr.c Fri May 25 02:23:26 2012 (r235961) @@ -573,8 +573,7 @@ tcp_respond(struct tcpcb *tp, void *ipge ip6->ip6_flow = 0; ip6->ip6_vfc = IPV6_VERSION; ip6->ip6_nxt = IPPROTO_TCP; - ip6->ip6_plen = htons((u_short)(sizeof (struct tcphdr) + - tlen)); + ip6->ip6_plen = 0; /* Set in ip6_output(). */ tlen += sizeof (struct ip6_hdr) + sizeof (struct tcphdr); } #endif @@ -619,12 +618,13 @@ tcp_respond(struct tcpcb *tp, void *ipge else nth->th_win = htons((u_short)win); nth->th_urp = 0; + + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 if (isipv6) { - nth->th_sum = 0; - nth->th_sum = in6_cksum(m, IPPROTO_TCP, - sizeof(struct ip6_hdr), - tlen - sizeof(struct ip6_hdr)); + nth->th_sum = in6_cksum_pseudo(ip6, + tlen - sizeof(struct ip6_hdr), IPPROTO_TCP, 0); ip6->ip6_hlim = in6_selecthlim(tp != NULL ? tp->t_inpcb : NULL, NULL); } @@ -636,8 +636,6 @@ tcp_respond(struct tcpcb *tp, void *ipge { nth->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons((u_short)(tlen - sizeof(struct ip) + ip->ip_p))); - m->m_pkthdr.csum_flags = CSUM_TCP; - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); } #endif /* INET */ #ifdef TCPDEBUG Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Fri May 25 02:21:17 2012 (r235960) +++ head/sys/netinet/tcp_syncache.c Fri May 25 02:23:26 2012 (r235961) @@ -1473,11 +1473,12 @@ syncache_respond(struct syncache *sc) optlen = 0; M_SETFIB(m, sc->sc_inc.inc_fibnum); + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) { - th->th_sum = 0; - th->th_sum = in6_cksum(m, IPPROTO_TCP, hlen, - tlen + optlen - hlen); + th->th_sum = in6_cksum_pseudo(ip6, tlen + optlen - hlen, + IPPROTO_TCP, 0); ip6->ip6_hlim = in6_selecthlim(NULL, NULL); error = ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); } @@ -1489,8 +1490,6 @@ syncache_respond(struct syncache *sc) { th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(tlen + optlen - hlen + IPPROTO_TCP)); - m->m_pkthdr.csum_flags = CSUM_TCP; - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); error = ip_output(m, sc->sc_ipopts, NULL, 0, NULL, NULL); } #endif Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Fri May 25 02:21:17 2012 (r235960) +++ head/sys/netinet/tcp_timewait.c Fri May 25 02:23:26 2012 (r235961) @@ -574,10 +574,12 @@ tcp_twrespond(struct tcptw *tw, int flag th->th_flags = flags; th->th_win = htons(tw->last_win); + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 if (isipv6) { - th->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(struct ip6_hdr), - sizeof(struct tcphdr) + optlen); + th->th_sum = in6_cksum_pseudo(ip6, + sizeof(struct tcphdr) + optlen, IPPROTO_TCP, 0); ip6->ip6_hlim = in6_selecthlim(inp, NULL); error = ip6_output(m, inp->in6p_outputopts, NULL, (tw->tw_so_options & SO_DONTROUTE), NULL, NULL, inp); @@ -590,8 +592,6 @@ tcp_twrespond(struct tcptw *tw, int flag { th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(sizeof(struct tcphdr) + optlen + IPPROTO_TCP)); - m->m_pkthdr.csum_flags = CSUM_TCP; - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); ip->ip_len = m->m_pkthdr.len; if (V_path_mtu_discovery) ip->ip_off |= IP_DF; From owner-svn-src-head@FreeBSD.ORG Fri May 25 02:25:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A29B106566C; Fri, 25 May 2012 02:25:36 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id 193F08FC0C; Fri, 25 May 2012 02:25:36 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id C7A6125D3A96; Fri, 25 May 2012 02:25:34 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id F364EBE7AA6; Fri, 25 May 2012 02:25:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 71JMtj3aJTaG; Fri, 25 May 2012 02:25:33 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 2E535BE7AA4; Fri, 25 May 2012 02:25:33 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201205250221.q4P2LIVn074326@svn.freebsd.org> Date: Fri, 25 May 2012 02:25:32 +0000 Content-Transfer-Encoding: 7bit Message-Id: <65E90ABF-7AB0-42C8-8882-89232FEDB52B@FreeBSD.org> References: <201205250221.q4P2LIVn074326@svn.freebsd.org> To: src-committers@freebsd.org X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235960 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:25:36 -0000 On 25. May 2012, at 02:21 , Bjoern A. Zeeb wrote: > Author: bz > Date: Fri May 25 02:21:17 2012 > New Revision: 235960 > URL: http://svn.freebsd.org/changeset/base/235960 > > Log: > MFp4 bz_ipv6_fast: > > Simple yet effective change enabling checksum "offload" on loopback > for IPv6 to avoid expensive computations. While not particularly related but a good example: if we would provide a better library KPI we could possibly even defer (pseudo-header) checksum calculations to drivers, which expect different calculations already anyway, and even save these cycles on loop as well. Something more to ponder along with other factoring out of drivers etc. /bz -- Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Fri May 25 02:58:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07125106564A; Fri, 25 May 2012 02:58:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBBA68FC0A; Fri, 25 May 2012 02:58:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P2wLVo075938; Fri, 25 May 2012 02:58:21 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P2wLYF075936; Fri, 25 May 2012 02:58:21 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250258.q4P2wLYF075936@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 02:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235962 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 02:58:23 -0000 Author: bz Date: Fri May 25 02:58:21 2012 New Revision: 235962 URL: http://svn.freebsd.org/changeset/base/235962 Log: MFp4 bz_ipv6_fast: Factor out Hop-By-Hop option processing. It's still not heavily used, it reduces the footprint of ip6_input() and makes ip6_input() more readable. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/ip6_input.c Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Fri May 25 02:23:26 2012 (r235961) +++ head/sys/netinet6/ip6_input.c Fri May 25 02:58:21 2012 (r235962) @@ -331,6 +331,83 @@ ip6_init2(void *dummy) /* This must be after route_init(), which is now SI_ORDER_THIRD */ SYSINIT(netinet6init2, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ip6_init2, NULL); +static int +ip6_input_hbh(struct mbuf *m, uint32_t *plen, uint32_t *rtalert, int *off, + int *nxt, int *ours) +{ + struct ip6_hdr *ip6; + struct ip6_hbh *hbh; + + if (ip6_hopopts_input(plen, rtalert, &m, off)) { +#if 0 /*touches NULL pointer*/ + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); +#endif + goto out; /* m have already been freed */ + } + + /* adjust pointer */ + ip6 = mtod(m, struct ip6_hdr *); + + /* + * if the payload length field is 0 and the next header field + * indicates Hop-by-Hop Options header, then a Jumbo Payload + * option MUST be included. + */ + if (ip6->ip6_plen == 0 && *plen == 0) { + /* + * Note that if a valid jumbo payload option is + * contained, ip6_hopopts_input() must set a valid + * (non-zero) payload length to the variable plen. + */ + V_ip6stat.ip6s_badoptions++; + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr); + icmp6_error(m, ICMP6_PARAM_PROB, + ICMP6_PARAMPROB_HEADER, + (caddr_t)&ip6->ip6_plen - (caddr_t)ip6); + goto out; + } +#ifndef PULLDOWN_TEST + /* ip6_hopopts_input() ensures that mbuf is contiguous */ + hbh = (struct ip6_hbh *)(ip6 + 1); +#else + IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr), + sizeof(struct ip6_hbh)); + if (hbh == NULL) { + V_ip6stat.ip6s_tooshort++; + goto out; + } +#endif + *nxt = hbh->ip6h_nxt; + + /* + * If we are acting as a router and the packet contains a + * router alert option, see if we know the option value. + * Currently, we only support the option value for MLD, in which + * case we should pass the packet to the multicast routing + * daemon. + */ + if (*rtalert != ~0) { + switch (*rtalert) { + case IP6OPT_RTALERT_MLD: + if (V_ip6_forwarding) + *ours = 1; + break; + default: + /* + * RFC2711 requires unrecognized values must be + * silently ignored. + */ + break; + } + } + + return (0); + +out: + return (1); +} + void ip6_input(struct mbuf *m) { @@ -825,71 +902,11 @@ passin: */ plen = (u_int32_t)ntohs(ip6->ip6_plen); if (ip6->ip6_nxt == IPPROTO_HOPOPTS) { - struct ip6_hbh *hbh; + int error; - if (ip6_hopopts_input(&plen, &rtalert, &m, &off)) { -#if 0 /*touches NULL pointer*/ - in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); -#endif - goto out; /* m have already been freed */ - } - - /* adjust pointer */ - ip6 = mtod(m, struct ip6_hdr *); - - /* - * if the payload length field is 0 and the next header field - * indicates Hop-by-Hop Options header, then a Jumbo Payload - * option MUST be included. - */ - if (ip6->ip6_plen == 0 && plen == 0) { - /* - * Note that if a valid jumbo payload option is - * contained, ip6_hopopts_input() must set a valid - * (non-zero) payload length to the variable plen. - */ - V_ip6stat.ip6s_badoptions++; - in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); - in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr); - icmp6_error(m, ICMP6_PARAM_PROB, - ICMP6_PARAMPROB_HEADER, - (caddr_t)&ip6->ip6_plen - (caddr_t)ip6); + error = ip6_input_hbh(m, &plen, &rtalert, &off, &nxt, &ours); + if (error != 0) goto out; - } -#ifndef PULLDOWN_TEST - /* ip6_hopopts_input() ensures that mbuf is contiguous */ - hbh = (struct ip6_hbh *)(ip6 + 1); -#else - IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr), - sizeof(struct ip6_hbh)); - if (hbh == NULL) { - V_ip6stat.ip6s_tooshort++; - goto out; - } -#endif - nxt = hbh->ip6h_nxt; - - /* - * If we are acting as a router and the packet contains a - * router alert option, see if we know the option value. - * Currently, we only support the option value for MLD, in which - * case we should pass the packet to the multicast routing - * daemon. - */ - if (rtalert != ~0) { - switch (rtalert) { - case IP6OPT_RTALERT_MLD: - if (V_ip6_forwarding) - ours = 1; - break; - default: - /* - * RFC2711 requires unrecognized values must be - * silently ignored. - */ - break; - } - } } else nxt = ip6->ip6_nxt; From owner-svn-src-head@FreeBSD.ORG Fri May 25 03:00:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5220106564A; Fri, 25 May 2012 03:00:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFC6F8FC08; Fri, 25 May 2012 03:00:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P30YdO076086; Fri, 25 May 2012 03:00:34 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P30Y2G076083; Fri, 25 May 2012 03:00:34 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250300.q4P30Y2G076083@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 03:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235963 - in head/sys: dev/cxgb modules/cxgb/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 03:00:34 -0000 Author: bz Date: Fri May 25 03:00:34 2012 New Revision: 235963 URL: http://svn.freebsd.org/changeset/base/235963 Log: MFp4 bz_ipv6_fast: Allow LRO to work on IPv6 as well. Fix the module Makefile to at least properly inlcude opt_inet6.h and allow builds without INET or INET6. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/modules/cxgb/cxgb/Makefile Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Fri May 25 02:58:21 2012 (r235962) +++ head/sys/dev/cxgb/cxgb_sge.c Fri May 25 03:00:34 2012 (r235963) @@ -30,6 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. #include __FBSDID("$FreeBSD$"); +#include "opt_inet6.h" #include "opt_inet.h" #include @@ -2085,7 +2086,7 @@ t3_free_qset(adapter_t *sc, struct sge_q MTX_DESTROY(&q->rspq.lock); } -#ifdef INET +#if defined(INET6) || defined(INET) tcp_lro_free(&q->lro.ctrl); #endif @@ -2668,7 +2669,7 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i /* Allocate and setup the lro_ctrl structure */ q->lro.enabled = !!(pi->ifp->if_capenable & IFCAP_LRO); -#ifdef INET +#if defined(INET6) || defined(INET) ret = tcp_lro_init(&q->lro.ctrl); if (ret) { printf("error %d from tcp_lro_init\n", ret); @@ -2961,9 +2962,11 @@ process_responses(adapter_t *adap, struc struct rsp_desc *r = &rspq->desc[rspq->cidx]; int budget_left = budget; unsigned int sleeping = 0; +#if defined(INET6) || defined(INET) int lro_enabled = qs->lro.enabled; int skip_lro; struct lro_ctrl *lro_ctrl = &qs->lro.ctrl; +#endif struct mbuf *offload_mbufs[RX_BUNDLE_SIZE]; int ngathered = 0; struct t3_mbuf_hdr *mh = &rspq->rspq_mh; @@ -3082,15 +3085,16 @@ process_responses(adapter_t *adap, struc * The mbuf's rcvif was derived from the cpl header and * is accurate. Skip LRO and just use that. */ +#if defined(INET6) || defined(INET) skip_lro = __predict_false(qs->port->ifp != m->m_pkthdr.rcvif); if (lro_enabled && lro_ctrl->lro_cnt && !skip_lro -#ifdef INET && (tcp_lro_rx(lro_ctrl, m, 0) == 0) -#endif ) { /* successfully queue'd for LRO */ - } else { + } else +#endif + { /* * LRO not enabled, packet unsuitable for LRO, * or unable to queue. Pass it up right now in @@ -3109,7 +3113,7 @@ process_responses(adapter_t *adap, struc deliver_partial_bundle(&adap->tdev, rspq, offload_mbufs, ngathered); -#ifdef INET +#if defined(INET6) || defined(INET) /* Flush LRO */ while (!SLIST_EMPTY(&lro_ctrl->lro_active)) { struct lro_entry *queued = SLIST_FIRST(&lro_ctrl->lro_active); Modified: head/sys/modules/cxgb/cxgb/Makefile ============================================================================== --- head/sys/modules/cxgb/cxgb/Makefile Fri May 25 02:58:21 2012 (r235962) +++ head/sys/modules/cxgb/cxgb/Makefile Fri May 25 03:00:34 2012 (r235963) @@ -8,9 +8,21 @@ SRCS= cxgb_mc5.c cxgb_vsc8211.c cxgb_ael SRCS+= cxgb_xgmac.c cxgb_vsc7323.c cxgb_t3_hw.c cxgb_main.c cxgb_aq100x.c SRCS+= cxgb_sge.c cxgb_offload.c cxgb_tn1010.c SRCS+= device_if.h bus_if.h pci_if.h -SRCS+= opt_inet.h opt_zero.h opt_sched.h +SRCS+= opt_inet.h opt_inet6.h opt_zero.h opt_sched.h SRCS+= uipc_mvec.c CFLAGS+= -g -DDEFAULT_JUMBO -I${CXGB} +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif + .include From owner-svn-src-head@FreeBSD.ORG Fri May 25 03:02:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 049CD106566C; Fri, 25 May 2012 03:02:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2A178FC19; Fri, 25 May 2012 03:02:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P32ukw076350; Fri, 25 May 2012 03:02:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P32u1b076347; Fri, 25 May 2012 03:02:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250302.q4P32u1b076347@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 03:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235964 - in head/sys: dev/ixgbe modules/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 03:02:57 -0000 Author: bz Date: Fri May 25 03:02:56 2012 New Revision: 235964 URL: http://svn.freebsd.org/changeset/base/235964 Log: MFp4 bz_ipv6_fast: Add TSO6 and LRO/IPv6 support. Fix the module Makefile to at least properly inlcude opt_inet6.h and allow builds without INET or INET6. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/modules/ixgbe/Makefile Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri May 25 03:00:34 2012 (r235963) +++ head/sys/dev/ixgbe/ixgbe.c Fri May 25 03:02:56 2012 (r235964) @@ -162,7 +162,7 @@ static void ixgbe_dma_free(struct ad static void ixgbe_add_rx_process_limit(struct adapter *, const char *, const char *, int *, int); static bool ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *); -static bool ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *); +static bool ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *); static void ixgbe_set_ivar(struct adapter *, u8, u8, s8); static void ixgbe_configure_ivars(struct adapter *); static u8 * ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *); @@ -997,6 +997,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_capenable ^= IFCAP_HWCSUM; if (mask & IFCAP_TSO4) ifp->if_capenable ^= IFCAP_TSO4; + if (mask & IFCAP_TSO6) + ifp->if_capenable ^= IFCAP_TSO6; if (mask & IFCAP_LRO) ifp->if_capenable ^= IFCAP_LRO; if (mask & IFCAP_VLAN_HWTAGGING) @@ -1061,7 +1063,7 @@ ixgbe_init_locked(struct adapter *adapte /* Set the various hardware offload abilities */ ifp->if_hwassist = 0; - if (ifp->if_capenable & IFCAP_TSO4) + if (ifp->if_capenable & IFCAP_TSO) ifp->if_hwassist |= CSUM_TSO; if (ifp->if_capenable & IFCAP_TXCSUM) { ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); @@ -1767,9 +1769,8 @@ ixgbe_xmit(struct tx_ring *txr, struct m ** a packet. */ if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { - if (ixgbe_tso_setup(txr, m_head, &paylen)) { + if (ixgbe_tso_setup(txr, m_head, &paylen, &olinfo_status)) { cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE; - olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT; ++adapter->tso_tx; @@ -2562,7 +2563,7 @@ ixgbe_setup_interface(device_t dev, stru */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); - ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO4 | IFCAP_VLAN_HWCSUM; + ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO | IFCAP_VLAN_HWCSUM; ifp->if_capabilities |= IFCAP_JUMBO_MTU; ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO @@ -3234,6 +3235,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, case ETHERTYPE_IPV6: ip6 = (struct ip6_hdr *)(mp->m_data + ehdrlen); ip_hlen = sizeof(struct ip6_hdr); + /* XXX-BZ this will go badly in case of ext hdrs. */ ipproto = ip6->ip6_nxt; type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; break; @@ -3292,17 +3294,23 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, * **********************************************************************/ static bool -ixgbe_tso_setup(struct tx_ring *txr, struct mbuf *mp, u32 *paylen) +ixgbe_tso_setup(struct tx_ring *txr, struct mbuf *mp, u32 *paylen, + u32 *olinfo_status) { struct adapter *adapter = txr->adapter; struct ixgbe_adv_tx_context_desc *TXD; struct ixgbe_tx_buf *tx_buffer; u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0; - u32 mss_l4len_idx = 0; - u16 vtag = 0; - int ctxd, ehdrlen, hdrlen, ip_hlen, tcp_hlen; + u32 mss_l4len_idx = 0, len; + u16 vtag = 0, eh_type; + int ctxd, ehdrlen, ip_hlen, tcp_hlen; struct ether_vlan_header *eh; +#ifdef INET6 + struct ip6_hdr *ip6; +#endif +#ifdef INET struct ip *ip; +#endif struct tcphdr *th; @@ -3311,32 +3319,62 @@ ixgbe_tso_setup(struct tx_ring *txr, str * Jump over vlan headers if already present */ eh = mtod(mp, struct ether_vlan_header *); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) + if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; - else + eh_type = eh->evl_proto; + } else { ehdrlen = ETHER_HDR_LEN; + eh_type = eh->evl_encap_proto; + } /* Ensure we have at least the IP+TCP header in the first mbuf. */ - if (mp->m_len < ehdrlen + sizeof(struct ip) + sizeof(struct tcphdr)) - return FALSE; + len = ehdrlen + sizeof(struct tcphdr); + switch (ntohs(eh_type)) { +#ifdef INET6 + case ETHERTYPE_IPV6: + if (mp->m_len < len + sizeof(struct ip6_hdr)) + return FALSE; + ip6 = (struct ip6_hdr *)(mp->m_data + ehdrlen); + /* XXX-BZ For now we do not pretend to support ext. hdrs. */ + if (ip6->ip6_nxt != IPPROTO_TCP) + return FALSE; + ip_hlen = sizeof(struct ip6_hdr); + th = (struct tcphdr *)((caddr_t)ip6 + ip_hlen); + th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); + type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; + break; +#endif +#ifdef INET + case ETHERTYPE_IP: + if (mp->m_len < len + sizeof(struct ip)) + return FALSE; + ip = (struct ip *)(mp->m_data + ehdrlen); + if (ip->ip_p != IPPROTO_TCP) + return FALSE; + ip->ip_sum = 0; + ip_hlen = ip->ip_hl << 2; + th = (struct tcphdr *)((caddr_t)ip + ip_hlen); + th->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(IPPROTO_TCP)); + type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; + /* Tell transmit desc to also do IPv4 checksum. */ + *olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; + break; +#endif + default: + panic("%s: CSUM_TSO but no supported IP version (0x%04x)", + __func__, ntohs(eh_type)); + break; + } ctxd = txr->next_avail_desc; tx_buffer = &txr->tx_buffers[ctxd]; TXD = (struct ixgbe_adv_tx_context_desc *) &txr->tx_base[ctxd]; - ip = (struct ip *)(mp->m_data + ehdrlen); - if (ip->ip_p != IPPROTO_TCP) - return FALSE; /* 0 */ - ip->ip_sum = 0; - ip_hlen = ip->ip_hl << 2; - th = (struct tcphdr *)((caddr_t)ip + ip_hlen); - th->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, htons(IPPROTO_TCP)); tcp_hlen = th->th_off << 2; - hdrlen = ehdrlen + ip_hlen + tcp_hlen; /* This is used in the transmit desc in encap */ - *paylen = mp->m_pkthdr.len - hdrlen; + *paylen = mp->m_pkthdr.len - ehdrlen - ip_hlen - tcp_hlen; /* VLAN MACLEN IPLEN */ if (mp->m_flags & M_VLANTAG) { @@ -3351,10 +3389,8 @@ ixgbe_tso_setup(struct tx_ring *txr, str /* ADV DTYPE TUCMD */ type_tucmd_mlhl |= IXGBE_ADVTXD_DCMD_DEXT | IXGBE_ADVTXD_DTYP_CTXT; type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; - type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; TXD->type_tucmd_mlhl |= htole32(type_tucmd_mlhl); - /* MSS L4LEN IDX */ mss_l4len_idx |= (mp->m_pkthdr.tso_segsz << IXGBE_ADVTXD_MSS_SHIFT); mss_l4len_idx |= (tcp_hlen << IXGBE_ADVTXD_L4LEN_SHIFT); @@ -4295,15 +4331,17 @@ ixgbe_rx_input(struct rx_ring *rxr, stru { /* - * ATM LRO is only for IPv4/TCP packets and TCP checksum of the packet + * ATM LRO is only for IP/TCP packets and TCP checksum of the packet * should be computed by hardware. Also it should not have VLAN tag in - * ethernet header. + * ethernet header. In case of IPv6 we do not yet support ext. hdrs. */ if (rxr->lro_enabled && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0 && (ptype & IXGBE_RXDADV_PKTTYPE_ETQF) == 0 && - (ptype & (IXGBE_RXDADV_PKTTYPE_IPV4 | IXGBE_RXDADV_PKTTYPE_TCP)) == - (IXGBE_RXDADV_PKTTYPE_IPV4 | IXGBE_RXDADV_PKTTYPE_TCP) && + ((ptype & (IXGBE_RXDADV_PKTTYPE_IPV4 | IXGBE_RXDADV_PKTTYPE_TCP)) == + (IXGBE_RXDADV_PKTTYPE_IPV4 | IXGBE_RXDADV_PKTTYPE_TCP) || + (ptype & (IXGBE_RXDADV_PKTTYPE_IPV6 | IXGBE_RXDADV_PKTTYPE_TCP)) == + (IXGBE_RXDADV_PKTTYPE_IPV6 | IXGBE_RXDADV_PKTTYPE_TCP)) && (m->m_pkthdr.csum_flags & (CSUM_DATA_VALID | CSUM_PSEUDO_HDR)) == (CSUM_DATA_VALID | CSUM_PSEUDO_HDR)) { /* Modified: head/sys/modules/ixgbe/Makefile ============================================================================== --- head/sys/modules/ixgbe/Makefile Fri May 25 03:00:34 2012 (r235963) +++ head/sys/modules/ixgbe/Makefile Fri May 25 03:02:56 2012 (r235964) @@ -2,10 +2,23 @@ .PATH: ${.CURDIR}/../../dev/ixgbe KMOD = ixgbe SRCS = device_if.h bus_if.h pci_if.h +SRCS += opt_inet.h opt_inet6.h SRCS += ixgbe.c ixv.c # Shared source SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c SRCS += ixgbe_82599.c ixgbe_82598.c ixgbe_x540.c CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP -DIXGBE_FDIR +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif + .include From owner-svn-src-head@FreeBSD.ORG Fri May 25 03:04:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3BC70106566B; Fri, 25 May 2012 03:04:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id B945B8FC14; Fri, 25 May 2012 03:04:33 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id AB07D25D388E; Fri, 25 May 2012 03:04:32 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 262F7BE7AC3; Fri, 25 May 2012 03:04:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id vXXQeJHcKZZN; Fri, 25 May 2012 03:04:31 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 22F90BE7AC6; Fri, 25 May 2012 03:04:31 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201205250300.q4P30Y2G076083@svn.freebsd.org> Date: Fri, 25 May 2012 03:04:30 +0000 Content-Transfer-Encoding: 7bit Message-Id: <083C2C87-F613-485C-B37F-64A46689BD9E@FreeBSD.org> References: <201205250300.q4P30Y2G076083@svn.freebsd.org> To: src-committers@freebsd.org X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r235963 - in head/sys: dev/cxgb modules/cxgb/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 03:04:34 -0000 On 25. May 2012, at 03:00 , Bjoern A. Zeeb wrote: > Author: bz > Date: Fri May 25 03:00:34 2012 > New Revision: 235963 > URL: http://svn.freebsd.org/changeset/base/235963 > > Log: > MFp4 bz_ipv6_fast: > > Allow LRO to work on IPv6 as well. Note that TSO6 support had been present in cxgb(4) since r231317. /bz -- Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Fri May 25 03:46:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C464F106566B; Fri, 25 May 2012 03:46:56 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B01028FC18; Fri, 25 May 2012 03:46:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P3kuP5078430; Fri, 25 May 2012 03:46:56 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P3ku6w078428; Fri, 25 May 2012 03:46:56 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201205250346.q4P3ku6w078428@svn.freebsd.org> From: Warren Block Date: Fri, 25 May 2012 03:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235967 - head/usr.sbin/utx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 03:46:56 -0000 Author: wblock (doc committer) Date: Fri May 25 03:46:56 2012 New Revision: 235967 URL: http://svn.freebsd.org/changeset/base/235967 Log: Fixes to man8 groff mandoc style, usage mistakes, or typos. PR: 168016 Submitted by: Nobuyuki Koganemaru Approved by: gjb MFC after: 3 days Modified: head/usr.sbin/utx/utx.8 Modified: head/usr.sbin/utx/utx.8 ============================================================================== --- head/usr.sbin/utx/utx.8 Fri May 25 03:08:46 2012 (r235966) +++ head/usr.sbin/utx/utx.8 Fri May 25 03:46:56 2012 (r235967) @@ -94,7 +94,7 @@ database, its use is limited to the supe .Sh SEE ALSO .Xr getent 1 , .Xr w 1 , -.Xr pututxline 3 . +.Xr pututxline 3 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Fri May 25 04:10:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE34F1065674; Fri, 25 May 2012 04:10:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mail-new.kirov.so-ups.ru (mail-new.kirov.so-ups.ru [178.74.170.12]) by mx1.freebsd.org (Postfix) with ESMTP id 9D0A68FC1A; Fri, 25 May 2012 04:10:29 +0000 (UTC) Received: from kirov.so-ups.ru (unknown [172.21.81.1]) by mail-new.kirov.so-ups.ru (Postfix) with ESMTP id BBB3CA1E3C; Fri, 25 May 2012 08:10:26 +0400 (MSK) Received: by ns.kirov.so-ups.ru (Postfix, from userid 1010) id 472B2B9FCA; Fri, 25 May 2012 08:10:22 +0400 (MSK) Received: from [127.0.0.1] (unknown [10.118.3.52]) by ns.kirov.so-ups.ru (Postfix) with ESMTP id 0978CB9FC0; Fri, 25 May 2012 08:10:22 +0400 (MSK) Message-ID: <4FBF062D.10607@FreeBSD.org> Date: Fri, 25 May 2012 08:10:21 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Edward Tomasz Napierala References: <201205241648.q4OGmXha049187@svn.freebsd.org> In-Reply-To: <201205241648.q4OGmXha049187@svn.freebsd.org> X-Enigmail-Version: 1.4.1 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235918 - head/sys/geom/label X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 04:10:30 -0000 On 24.05.2012 20:48, Edward Tomasz Napierala wrote: > Log: > Make g_label(4) ignore provider size when looking for UFS labels. > Without it, it fails to create labels for filesystems resized by > growfs(8). > > PR: kern/165962 I think it should be fixed in the growfs(8), not here. It seems to me that growfs(8) incorrectly calculates some values. -- WBR, Andrey V. Elsukov From owner-svn-src-head@FreeBSD.ORG Fri May 25 05:01:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A1631065670; Fri, 25 May 2012 05:01:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22ACC8FC0A; Fri, 25 May 2012 05:01:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P51RBP081656; Fri, 25 May 2012 05:01:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P51R1u081644; Fri, 25 May 2012 05:01:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205250501.q4P51R1u081644@svn.freebsd.org> From: Adrian Chadd Date: Fri, 25 May 2012 05:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235972 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5416 ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 05:01:28 -0000 Author: adrian Date: Fri May 25 05:01:27 2012 New Revision: 235972 URL: http://svn.freebsd.org/changeset/base/235972 Log: oops - ath_hal_disablepcie is actually destined for another purpose, not to disable the PCIe PHY in prepration for reset. Extend the enablepci method to have a "poweroff" flag, which if equal to true means the hardware is about to go to sleep. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ah.h Fri May 25 05:01:27 2012 (r235972) @@ -832,7 +832,8 @@ struct ath_hal { HAL_BOOL bChannelChange, HAL_STATUS *status); HAL_BOOL __ahdecl(*ah_phyDisable)(struct ath_hal *); HAL_BOOL __ahdecl(*ah_disable)(struct ath_hal *); - void __ahdecl(*ah_configPCIE)(struct ath_hal *, HAL_BOOL restore); + void __ahdecl(*ah_configPCIE)(struct ath_hal *, HAL_BOOL restore, + HAL_BOOL power_off); void __ahdecl(*ah_disablePCIE)(struct ath_hal *); void __ahdecl(*ah_setPCUConfig)(struct ath_hal *); HAL_BOOL __ahdecl(*ah_perCalibration)(struct ath_hal*, Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ah_internal.h Fri May 25 05:01:27 2012 (r235972) @@ -355,8 +355,8 @@ struct ath_hal_private { AH_PRIVATE(_ah)->ah_getNfAdjust(_ah, _c) #define ath_hal_getNoiseFloor(_ah, _nfArray) \ AH_PRIVATE(_ah)->ah_getNoiseFloor(_ah, _nfArray) -#define ath_hal_configPCIE(_ah, _reset) \ - (_ah)->ah_configPCIE(_ah, _reset) +#define ath_hal_configPCIE(_ah, _reset, _poweroff) \ + (_ah)->ah_configPCIE(_ah, _reset, _poweroff) #define ath_hal_disablePCIE(_ah) \ (_ah)->ah_disablePCIE(_ah) #define ath_hal_setInterrupts(_ah, _mask) \ Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -33,7 +33,8 @@ static HAL_BOOL ar5210GetChannelEdges(st static HAL_BOOL ar5210GetChipPowerLimits(struct ath_hal *ah, struct ieee80211_channel *chan); -static void ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_on); static void ar5210DisablePCIE(struct ath_hal *ah); static const struct ath_hal_private ar5210hal = {{ @@ -332,7 +333,7 @@ ar5210GetChipPowerLimits(struct ath_hal } static void -ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { } Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -33,7 +33,8 @@ static HAL_BOOL ar5211GetChannelEdges(st static HAL_BOOL ar5211GetChipPowerLimits(struct ath_hal *ah, struct ieee80211_channel *chan); -static void ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_off); static void ar5211DisablePCIE(struct ath_hal *ah); static const struct ath_hal_private ar5211hal = {{ @@ -455,7 +456,7 @@ ar5211GetChipPowerLimits(struct ath_hal } static void -ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { } Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -29,7 +29,8 @@ #define AH_5212_COMMON #include "ar5212/ar5212.ini" -static void ar5212ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar5212ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_off); static void ar5212DisablePCIE(struct ath_hal *ah); static const struct ath_hal_private ar5212hal = {{ @@ -370,7 +371,7 @@ ar5212Attach(uint16_t devid, HAL_SOFTC s if (AH_PRIVATE(ah)->ah_ispcie) { /* XXX: build flag to disable this? */ - ath_hal_configPCIE(ah, AH_FALSE); + ath_hal_configPCIE(ah, AH_FALSE, AH_FALSE); } if (!ar5212ChipTest(ah)) { @@ -666,7 +667,7 @@ ar5212GetChannelEdges(struct ath_hal *ah * XXX Clean up the magic numbers. */ static void -ar5212ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar5212ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x9248fc00); OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x24924924); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -30,7 +30,8 @@ #include "ar5416/ar5416.ini" -static void ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_off); static void ar5416DisablePCIE(struct ath_hal *ah); static void ar5416WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan); @@ -459,13 +460,13 @@ void ar5416AttachPCIE(struct ath_hal *ah) { if (AH_PRIVATE(ah)->ah_ispcie) - ath_hal_configPCIE(ah, AH_FALSE); + ath_hal_configPCIE(ah, AH_FALSE, AH_FALSE); else ath_hal_disablePCIE(ah); } static void -ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { if (AH_PRIVATE(ah)->ah_ispcie && !restore) { ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -61,7 +61,8 @@ static const HAL_PERCAL_DATA ar9280_adc_ .calPostProc = ar5416AdcDcCalibration }; -static void ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_off); static void ar9280DisablePCIE(struct ath_hal *ah); static HAL_BOOL ar9280FillCapabilityInfo(struct ath_hal *ah); static void ar9280WriteIni(struct ath_hal *ah, @@ -417,7 +418,7 @@ bad: } static void -ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { if (AH_PRIVATE(ah)->ah_ispcie && !restore) { ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -66,7 +66,8 @@ static const HAL_PERCAL_DATA ar9280_adc_ .calPostProc = ar5416AdcDcCalibration }; -static void ar9285ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar9285ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_off); static void ar9285DisablePCIE(struct ath_hal *ah); static HAL_BOOL ar9285FillCapabilityInfo(struct ath_hal *ah); static void ar9285WriteIni(struct ath_hal *ah, @@ -364,7 +365,7 @@ bad: } static void -ar9285ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar9285ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { if (AH_PRIVATE(ah)->ah_ispcie && !restore) { ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Fri May 25 05:01:27 2012 (r235972) @@ -65,7 +65,8 @@ static const HAL_PERCAL_DATA ar9287_adc_ .calPostProc = ar5416AdcDcCalibration }; -static void ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static void ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, + HAL_BOOL power_off); static void ar9287DisablePCIE(struct ath_hal *ah); static HAL_BOOL ar9287FillCapabilityInfo(struct ath_hal *ah); static void ar9287WriteIni(struct ath_hal *ah, @@ -359,13 +360,14 @@ bad: } static void -ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { if (AH_PRIVATE(ah)->ah_ispcie && !restore) { ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); OS_DELAY(1000); OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); - OS_REG_WRITE(ah, AR_WA, AR9285_WA_DEFAULT); /* Yes, Kiwi uses the Kite PCIe PHY WA */ + /* Yes, Kiwi uses the Kite PCIe PHY WA */ + OS_REG_WRITE(ah, AR_WA, AR9285_WA_DEFAULT); } } Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/if_ath.c Fri May 25 05:01:27 2012 (r235972) @@ -1319,8 +1319,14 @@ ath_suspend(struct ath_softc *sc) * CardBus detaches the device. */ - /* For PCIe, this matters */ - ath_hal_disablepcie(sc->sc_ah); + /* + * XXX ensure none of the taskqueues are running + * XXX ensure sc_invalid is 1 + * XXX ensure the calibration callout is disabled + */ + + /* Disable the PCIe PHY, complete with workarounds */ + ath_hal_enablepcie(sc->sc_ah, 1, 1); } /* @@ -1354,7 +1360,7 @@ ath_resume(struct ath_softc *sc) __func__, ifp->if_flags); /* Re-enable PCIe, re-enable the PCIe bus */ - ath_hal_enablepcie(ah, 1); + ath_hal_enablepcie(ah, 0, 0); /* * Must reset the chip before we reload the Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri May 25 04:42:18 2012 (r235971) +++ head/sys/dev/ath/if_athvar.h Fri May 25 05:01:27 2012 (r235972) @@ -998,8 +998,8 @@ void ath_intr(void *); /* * PCIe suspend/resume/poweron/poweroff related macros */ -#define ath_hal_enablepcie(_ah, _restore) \ - ((*(_ah)->ah_configPCIE)((_ah), (_restore))) +#define ath_hal_enablepcie(_ah, _restore, _poweroff) \ + ((*(_ah)->ah_configPCIE)((_ah), (_restore), (_poweroff))) #define ath_hal_disablepcie(_ah) \ ((*(_ah)->ah_disablePCIE)((_ah))) From owner-svn-src-head@FreeBSD.ORG Fri May 25 05:28:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 97EBD106566B; Fri, 25 May 2012 05:28:14 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83B558FC14; Fri, 25 May 2012 05:28:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P5SEp6082739; Fri, 25 May 2012 05:28:14 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P5SEGl082737; Fri, 25 May 2012 05:28:14 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205250528.q4P5SEGl082737@svn.freebsd.org> From: Alan Cox Date: Fri, 25 May 2012 05:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235973 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 05:28:14 -0000 Author: alc Date: Fri May 25 05:28:14 2012 New Revision: 235973 URL: http://svn.freebsd.org/changeset/base/235973 Log: Correct an error in pmap_pv_reclaim(). In a rare case, when it should have returned NULL, it might instead return a pointer to a page that it had just unmapped. Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri May 25 05:01:27 2012 (r235972) +++ head/sys/amd64/amd64/pmap.c Fri May 25 05:28:14 2012 (r235973) @@ -2058,14 +2058,14 @@ pmap_pv_reclaim(pmap_t locked_pmap) pt_entry_t *pte, tpte; pv_entry_t pv; vm_offset_t va; - vm_page_t free, m; + vm_page_t free, m, m_pc; uint64_t inuse, freemask; int bit, field, freed; rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); pmap = NULL; - free = m = NULL; + free = m_pc = NULL; TAILQ_INIT(&newtail); while ((pc = TAILQ_FIRST(&pv_chunks)) != NULL && free == NULL) { TAILQ_REMOVE(&pv_chunks, pc, pc_lru); @@ -2141,8 +2141,8 @@ pmap_pv_reclaim(pmap_t locked_pmap) PV_STAT(pc_chunk_count--); PV_STAT(pc_chunk_frees++); /* Entire chunk is free; return it. */ - m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); - dump_drop_page(m->phys_addr); + m_pc = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); + dump_drop_page(m_pc->phys_addr); break; } TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); @@ -2157,15 +2157,15 @@ pmap_pv_reclaim(pmap_t locked_pmap) if (pmap != locked_pmap) PMAP_UNLOCK(pmap); } - if (m == NULL && free != NULL) { - m = free; - free = m->right; + if (m_pc == NULL && free != NULL) { + m_pc = free; + free = m_pc->right; /* Recycle a freed page table page. */ - m->wire_count = 1; + m_pc->wire_count = 1; atomic_add_int(&cnt.v_wire_count, 1); } pmap_free_zero_pages(free); - return (m); + return (m_pc); } /* From owner-svn-src-head@FreeBSD.ORG Fri May 25 06:48:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 678A7106566B; Fri, 25 May 2012 06:48:43 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 525DB8FC0C; Fri, 25 May 2012 06:48:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P6mhM0086074; Fri, 25 May 2012 06:48:43 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P6mhPP086072; Fri, 25 May 2012 06:48:43 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205250648.q4P6mhPP086072@svn.freebsd.org> From: Grzegorz Bernacki Date: Fri, 25 May 2012 06:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235975 - head/usr.bin/gprof X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 06:48:43 -0000 Author: gber Date: Fri May 25 06:48:42 2012 New Revision: 235975 URL: http://svn.freebsd.org/changeset/base/235975 Log: Fix resolving symbol names on ARM. On ARM, binutils are adding '$a' symbols in the symbol table for every function (in addition to normal symbol). When gprof(1) looks up symbol name, it often reads '$a' instead of proper function name, because it find it first. With this fix, when read symbol name begins with '$' and previous symbol has the same address, it will use previous symbol name (which is proper function name). Obtained from: Semihalf Modified: head/usr.bin/gprof/lookup.c Modified: head/usr.bin/gprof/lookup.c ============================================================================== --- head/usr.bin/gprof/lookup.c Fri May 25 06:41:08 2012 (r235974) +++ head/usr.bin/gprof/lookup.c Fri May 25 06:48:42 2012 (r235975) @@ -66,6 +66,12 @@ nllookup( address ) printf( "[nllookup] %d (%d) probes\n" , probes , nname-1 ); } # endif /* DEBUG */ +#if defined(__arm__) + if (nl[middle].name[0] == '$' && + nl[middle-1].value == nl[middle].value) + middle--; +#endif + return &nl[ middle ]; } if ( nl[ middle ].value > address ) { From owner-svn-src-head@FreeBSD.ORG Fri May 25 07:32:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6CC6D106566B; Fri, 25 May 2012 07:32:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 574A18FC0A; Fri, 25 May 2012 07:32:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P7WRnS088002; Fri, 25 May 2012 07:32:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P7WRE2088000; Fri, 25 May 2012 07:32:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201205250732.q4P7WRE2088000@svn.freebsd.org> From: Andriy Gapon Date: Fri, 25 May 2012 07:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235978 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 07:32:27 -0000 Author: avg Date: Fri May 25 07:32:26 2012 New Revision: 235978 URL: http://svn.freebsd.org/changeset/base/235978 Log: device_add_child: protect against child device with no driver but fixed unit number This combination doesn't make sense, unit numbers should be hardwired only in context of a known driver. The wildcard devices should have wildcard unit numbers. Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri May 25 07:25:30 2012 (r235977) +++ head/sys/kern/subr_bus.c Fri May 25 07:32:26 2012 (r235978) @@ -1810,6 +1810,8 @@ device_add_child_ordered(device_t dev, u PDEBUG(("%s at %s with order %u as unit %d", name, DEVICENAME(dev), order, unit)); + KASSERT(name != NULL || unit == -1, + ("child device with wildcard name and specific unit number")); child = make_device(dev, name, unit); if (child == NULL) From owner-svn-src-head@FreeBSD.ORG Fri May 25 07:46:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5C91106564A; Fri, 25 May 2012 07:46:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 975C08FC0C; Fri, 25 May 2012 07:46:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P7kOtJ088667; Fri, 25 May 2012 07:46:24 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P7kODU088665; Fri, 25 May 2012 07:46:24 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201205250746.q4P7kODU088665@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 25 May 2012 07:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235979 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 07:46:24 -0000 Author: glebius Date: Fri May 25 07:46:24 2012 New Revision: 235979 URL: http://svn.freebsd.org/changeset/base/235979 Log: Revert my local not yet properly tested changes, that leaked in with r235923. Modified: head/sys/netgraph/ng_mppc.c Modified: head/sys/netgraph/ng_mppc.c ============================================================================== --- head/sys/netgraph/ng_mppc.c Fri May 25 07:32:26 2012 (r235978) +++ head/sys/netgraph/ng_mppc.c Fri May 25 07:46:24 2012 (r235979) @@ -98,6 +98,15 @@ static MALLOC_DEFINE(M_NETGRAPH_MPPC, "n /* Key length */ #define KEYLEN(b) (((b) & MPPE_128) ? 16 : 8) +/* + * When packets are lost with MPPE, we may have to re-key arbitrarily + * many times to 'catch up' to the new jumped-ahead sequence number. + * Since this can be expensive, we pose a limit on how many re-keyings + * we will do at one time to avoid a possible D.O.S. vulnerability. + * This should instead be a configurable parameter. + */ +#define MPPE_MAX_REKEY 1000 + /* MPPC packet header bits */ #define MPPC_FLAG_FLUSHED 0x8000 /* xmitter reset state */ #define MPPC_FLAG_RESTART 0x4000 /* compress history restart */ @@ -632,22 +641,20 @@ ng_mppc_decompress(node_p node, struct m #endif #ifdef NETGRAPH_MPPC_ENCRYPTION if ((d->cfg.bits & MPPE_BITS) != 0) { - u_int rekey; - - /* How many times are we going to have to re-key? */ - rekey = ((d->cfg.bits & MPPE_STATELESS) != 0) ? - numLost : (numLost / (MPPE_UPDATE_MASK + 1)); - if (rekey > 1000) - log(LOG_ERR, "%s: %d packets dropped, " - "node [%x]\n", __func__, numLost, - node->nd_ID); - - /* - * When packets are lost or re-ordered with MPPE, - * we may have to re-key up to 0xfff times to 'catch - * up' to the new jumped-ahead sequence number. Yep, - * this is heavy, but what else can we do? - */ + u_int rekey; + + /* How many times are we going to have to re-key? */ + rekey = ((d->cfg.bits & MPPE_STATELESS) != 0) ? + numLost : (numLost / (MPPE_UPDATE_MASK + 1)); + if (rekey > MPPE_MAX_REKEY) { + log(LOG_ERR, "%s: too many (%d) packets" + " dropped, disabling node %p!", + __func__, numLost, node); + priv->recv.cfg.enable = 0; + goto failed; + } + + /* Re-key as necessary to catch up to peer */ while (d->cc != cc) { if ((d->cfg.bits & MPPE_STATELESS) != 0 || (d->cc & MPPE_UPDATE_MASK) From owner-svn-src-head@FreeBSD.ORG Fri May 25 07:57:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6410F106564A; Fri, 25 May 2012 07:57:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35CE18FC0C; Fri, 25 May 2012 07:57:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P7vINb089170; Fri, 25 May 2012 07:57:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P7vIC0089168; Fri, 25 May 2012 07:57:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205250757.q4P7vIC0089168@svn.freebsd.org> From: Alexander Motin Date: Fri, 25 May 2012 07:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235980 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 07:57:18 -0000 Author: mav Date: Fri May 25 07:57:17 2012 New Revision: 235980 URL: http://svn.freebsd.org/changeset/base/235980 Log: Remove sleep() from invalidate call in ses driver, waiting for daemon process exit. Instead use CAM's standard reference counting to prevent periph going away until process won't complete. I think that sleep in single CAM SWI thread is not a good idea and may lead to deadlocks if daemon process waits for some command completion. Combined with recent patch avoiding use of CAM SWI for ATA it just causes panics because of sleeps prohibited in interrupt thread context. Modified: head/sys/cam/scsi/scsi_enc.c Modified: head/sys/cam/scsi/scsi_enc.c ============================================================================== --- head/sys/cam/scsi/scsi_enc.c Fri May 25 07:46:24 2012 (r235979) +++ head/sys/cam/scsi/scsi_enc.c Fri May 25 07:57:17 2012 (r235980) @@ -136,15 +136,8 @@ enc_oninvalidate(struct cam_periph *peri */ enc->enc_flags |= ENC_FLAG_SHUTDOWN; if (enc->enc_daemon != NULL) { - /* Signal and wait for the ses daemon to terminate. */ + /* Signal the ses daemon to terminate. */ wakeup(enc->enc_daemon); - /* - * We're called with the SIM mutex held, but we're dropping - * the update mutex here on sleep. So we have to manually - * drop the SIM mutex. - */ - cam_periph_sleep(enc->periph, enc->enc_daemon, - PUSER, "thtrm", 0); } callout_drain(&enc->status_updater); @@ -839,6 +832,7 @@ enc_daemon(void *arg) } enc->enc_daemon = NULL; cam_periph_unlock(enc->periph); + cam_periph_release(enc->periph); kproc_exit(0); } @@ -849,6 +843,9 @@ enc_kproc_init(enc_softc_t *enc) callout_init_mtx(&enc->status_updater, enc->periph->sim->mtx, 0); + if (cam_periph_acquire(enc->periph) != CAM_REQ_CMP) + return (ENXIO); + result = kproc_create(enc_daemon, enc, &enc->enc_daemon, /*flags*/0, /*stackpgs*/0, "enc_daemon%d", enc->periph->unit_number); @@ -857,7 +854,8 @@ enc_kproc_init(enc_softc_t *enc) cam_periph_lock(enc->periph); enc->enc_vec.poll_status(enc); cam_periph_unlock(enc->periph); - } + } else + cam_periph_release(enc->periph); return (result); } @@ -955,7 +953,7 @@ enc_ctor(struct cam_periph *periph, void err = enc_kproc_init(enc); if (err) { xpt_print(periph->path, - "error %d string enc_daemon\n", err); + "error %d starting enc_daemon\n", err); goto out; } } From owner-svn-src-head@FreeBSD.ORG Fri May 25 08:18:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21B9F106566B; Fri, 25 May 2012 08:18:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CCAD8FC16; Fri, 25 May 2012 08:18:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P8Hxlr090053; Fri, 25 May 2012 08:17:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P8Hxl1090051; Fri, 25 May 2012 08:17:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250817.q4P8Hxl1090051@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 08:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235981 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 08:18:00 -0000 Author: bz Date: Fri May 25 08:17:59 2012 New Revision: 235981 URL: http://svn.freebsd.org/changeset/base/235981 Log: In case forwarding is turned on for a given address family, refuse to queue the packet for LRO and tell the driver to directly pass it on. This avoids re-assembly and later re-fragmentation problems when forwarding. It's not the best solution but the simplest and most effective for the moment. Should have been done: ages ago Discussed with and by: many MFC after: 3 days Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Fri May 25 07:57:17 2012 (r235980) +++ head/sys/netinet/tcp_lro.c Fri May 25 08:17:59 2012 (r235981) @@ -51,9 +51,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include + #include #ifndef LRO_ENTRIES @@ -369,6 +372,10 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m switch (eh_type) { #ifdef INET6 case ETHERTYPE_IPV6: + if (V_ip6_forwarding != 0) { + /* XXX-BZ stats but changing lro_ctrl is a problem. */ + return (TCP_LRO_CANNOT); + } l3hdr = ip6 = (struct ip6_hdr *)(eh + 1); error = tcp_lro_rx_ipv6(lc, m, ip6, &th); if (error != 0) @@ -379,6 +386,10 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m #endif #ifdef INET case ETHERTYPE_IP: + if (V_ipforwarding != 0) { + /* XXX-BZ stats but changing lro_ctrl is a problem. */ + return (TCP_LRO_CANNOT); + } l3hdr = ip4 = (struct ip *)(eh + 1); error = tcp_lro_rx_ipv4(lc, m, ip4, &th); if (error != 0) From owner-svn-src-head@FreeBSD.ORG Fri May 25 08:27:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D12B1065670; Fri, 25 May 2012 08:27:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 7A0038FC08; Fri, 25 May 2012 08:27:41 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4P8RNKJ085807; Fri, 25 May 2012 11:27:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4P8RMNA071192; Fri, 25 May 2012 11:27:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4P8RMmi071191; Fri, 25 May 2012 11:27:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 25 May 2012 11:27:22 +0300 From: Konstantin Belousov To: Marcel Moolenaar Message-ID: <20120525082722.GO2358@deviant.kiev.zoral.com.ua> References: <201205242012.q4OKCkv9057985@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qi0WovVLX58BkhBU" Content-Disposition: inline In-Reply-To: <201205242012.q4OKCkv9057985@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235929 - in head/lib/libc/powerpc: . gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 08:27:42 -0000 --qi0WovVLX58BkhBU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 24, 2012 at 08:12:46PM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Thu May 24 20:12:46 2012 > New Revision: 235929 > URL: http://svn.freebsd.org/changeset/base/235929 >=20 > Log: > Allow building for the PowerPC EABI by providing a dummy __eabi() > function. The purpose of the __eabi() function is to set up the > runtime and is called first thing by main(). The runtime is already > set up for us prior to caling main, so there's nothing to do for > us in the EABI case. >=20 > Added: > head/lib/libc/powerpc/gen/eabi.S (contents, props changed) > Modified: > head/lib/libc/powerpc/Symbol.map > head/lib/libc/powerpc/gen/Makefile.inc >=20 > Modified: head/lib/libc/powerpc/Symbol.map > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/powerpc/Symbol.map Thu May 24 20:00:58 2012 (r235928) > +++ head/lib/libc/powerpc/Symbol.map Thu May 24 20:12:46 2012 (r235929) > @@ -11,6 +11,7 @@ FBSD_1.0 { > /* PSEUDO syscalls */ > _exit; > =20 > + __eabi; > _mcount; > _setjmp; > _longjmp; I think the symbol should have been added to FBSD_1.3 version. --qi0WovVLX58BkhBU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+/QmoACgkQC3+MBN1Mb4h3nQCg6YRaxd/1odJrtKt9Go9dAcfs IVcAn3FpClBZEifN+gTvXdadmlMhpCOh =lnbr -----END PGP SIGNATURE----- --qi0WovVLX58BkhBU-- From owner-svn-src-head@FreeBSD.ORG Fri May 25 08:30:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6262B1065676; Fri, 25 May 2012 08:30:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DABA8FC1A; Fri, 25 May 2012 08:30:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P8UA9V090639; Fri, 25 May 2012 08:30:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P8UAwV090637; Fri, 25 May 2012 08:30:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205250830.q4P8UAwV090637@svn.freebsd.org> From: Alexander Motin Date: Fri, 25 May 2012 08:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235982 - head/sys/cam/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 08:30:10 -0000 Author: mav Date: Fri May 25 08:30:09 2012 New Revision: 235982 URL: http://svn.freebsd.org/changeset/base/235982 Log: Add tunable/sysctl kern.cam.pmp.hide_special, controlling whether special PMP ports such as PMP configuration or SEMB should be exposed or hidden. These ports were always hidden before as useless and sometimes promatic. But with updated ses driver supporting SEMB it is no longer so straight. Keep ports hidden by default to avoid probe request ttimeouts if SEP is not connected to PMP's SEMB via I2C, that is very often situation. Modified: head/sys/cam/ata/ata_pmp.c Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Fri May 25 08:17:59 2012 (r235981) +++ head/sys/cam/ata/ata_pmp.c Fri May 25 08:30:09 2012 (r235982) @@ -126,8 +126,13 @@ static void pmpdone(struct cam_periph * #define PMP_DEFAULT_RETRY 1 #endif +#ifndef PMP_DEFAULT_HIDE_SPECIAL +#define PMP_DEFAULT_HIDE_SPECIAL 1 +#endif + static int pmp_retry_count = PMP_DEFAULT_RETRY; static int pmp_default_timeout = PMP_DEFAULT_TIMEOUT; +static int pmp_hide_special = PMP_DEFAULT_HIDE_SPECIAL; static SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); @@ -137,6 +142,9 @@ TUNABLE_INT("kern.cam.pmp.retry_count", SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RW, &pmp_default_timeout, 0, "Normal I/O timeout (in seconds)"); TUNABLE_INT("kern.cam.pmp.default_timeout", &pmp_default_timeout); +SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RW, + &pmp_hide_special, 0, "Hide extra ports"); +TUNABLE_INT("kern.cam.pmp.hide_special", &pmp_hide_special); static struct periph_driver pmpdriver = { @@ -583,23 +591,33 @@ pmpdone(struct cam_periph *periph, union (ataio->res.lba_mid << 16) + (ataio->res.lba_low << 8) + ataio->res.sector_count; - /* This PMP declares 6 ports, while only 5 of them are real. - * Port 5 is enclosure management bridge port, which has implementation - * problems, causing probe faults. Hide it for now. */ - if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6) - softc->pm_ports = 5; - /* This PMP declares 7 ports, while only 5 of them are real. - * Port 5 is some fake "Config Disk" with 640 sectors size, - * port 6 is enclosure management bridge port. - * Both fake ports has implementation problems, causing - * probe faults. Hide them for now. */ - if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7) - softc->pm_ports = 5; - /* These PMPs declare one more port then actually have, - * for configuration purposes. Hide it for now. */ - if (softc->pm_pid == 0x57231095 || softc->pm_pid == 0x57331095 || - softc->pm_pid == 0x57341095 || softc->pm_pid == 0x57441095) - softc->pm_ports--; + if (pmp_hide_special) { + /* + * This PMP declares 6 ports, while only 5 of them + * are real. Port 5 is a SEMB port, probing which + * causes timeouts if external SEP is not connected + * to PMP over I2C. + */ + if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6) + softc->pm_ports = 5; + + /* + * This PMP declares 7 ports, while only 5 of them + * are real. Port 5 is a fake "Config Disk" with + * 640 sectors size. Port 6 is a SEMB port. + */ + if (softc->pm_pid == 0x47261095 && softc->pm_ports == 7) + softc->pm_ports = 5; + + /* + * These PMPs have extra configuration port. + */ + if (softc->pm_pid == 0x57231095 || + softc->pm_pid == 0x57331095 || + softc->pm_pid == 0x57341095 || + softc->pm_pid == 0x57441095) + softc->pm_ports--; + } printf("%s%d: %d fan-out ports\n", periph->periph_name, periph->unit_number, softc->pm_ports); From owner-svn-src-head@FreeBSD.ORG Fri May 25 08:32:28 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 106BE106564A; Fri, 25 May 2012 08:32:28 +0000 (UTC) (envelope-from zeising@daemonic.se) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 7D3558FC16; Fri, 25 May 2012 08:32:27 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 7EF044003E; Fri, 25 May 2012 10:32:26 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 73FC540030; Fri, 25 May 2012 10:32:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (mx.daemonic.se [IPv6:2001:470:dca9:0:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 2C6CF40022; Fri, 25 May 2012 10:32:26 +0200 (CEST) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3VzLLK5Zh2z8ggx; Fri, 25 May 2012 10:32:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id VfaP2KCqs8WC; Fri, 25 May 2012 10:32:20 +0200 (CEST) Received: from mail.daemonic.se (mail.daemonic.se [10.1.0.4]) by mx.daemonic.se (Postfix) with ESMTPS id 3VzLLD1qzMz8ggv; Fri, 25 May 2012 10:32:20 +0200 (CEST) Received: from [IPv6:2001:470:dca9:1::4] (vivi.daemonic.se [IPv6:2001:470:dca9:1::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 3VzLLD1LQ6z9CvV; Fri, 25 May 2012 10:32:20 +0200 (CEST) Message-ID: <4FBF438C.5080805@daemonic.se> Date: Fri, 25 May 2012 10:32:12 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Konstantin Belousov References: <201205232107.q4NL71dw095460@svn.freebsd.org> <4FBD5899.9000808@daemonic.se> <20120524092649.GH2358@deviant.kiev.zoral.com.ua> <4FBE0086.1050801@daemonic.se> In-Reply-To: <4FBE0086.1050801@daemonic.se> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235859 - in head/sys: i386/conf modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 08:32:28 -0000 On 2012-05-24 11:33, Niclas Zeising wrote: > On 2012-05-24 11:26, Konstantin Belousov wrote: >> On Wed, May 23, 2012 at 11:37:29PM +0200, Niclas Zeising wrote: >>> On 05/23/12 23:07, Konstantin Belousov wrote: >>>> Author: kib >>>> Date: Wed May 23 21:07:01 2012 >>>> New Revision: 235859 >>>> URL: http://svn.freebsd.org/changeset/base/235859 >>>> >>>> Log: >>>> Enable drm2 modules build. >>>> >>>> Sponsored by: The FreeBSD Foundation >>>> MFC after: 1 month >>>> >>>> Modified: >>>> head/sys/i386/conf/XEN >>>> head/sys/modules/Makefile >>>> >>> >>> Hi! >>> Thank you very much for all your work! >>> With this commit, is there any need for any patches from you, or have >>> they all been incorporated by now? Perhaps a note in UPDATING would be >>> good, at least to make people more aware of the fact that GEM/KMS >>> finally has come to FreeBSD as well. An update to the wiki might be >>> good as well. I can help you with patches and updating the wiki, just >>> let me know. >>> Once again, a big thank you! >> >> ATM no more patches are needed to run new driver. >> >> I do not see a need in any UPDATING entry, since nothing should have >> been changed for users who did not used my patch before. >> >> Wiki ought to get complete rewrite, I might get time to do it at the end >> of week. > > Hi! > Thank you for the clarifications! > > Regards! Hi! Would it be possible to bump the FreeBSD version to reflect this commit? It would be helpful when working with the xorg ports, amongst other things. Thanks! Regards! -- Niclas Zeising From owner-svn-src-head@FreeBSD.ORG Fri May 25 09:16:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D68001065673; Fri, 25 May 2012 09:16:59 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8A828FC15; Fri, 25 May 2012 09:16:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P9GxHR092844; Fri, 25 May 2012 09:16:59 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P9GxQv092841; Fri, 25 May 2012 09:16:59 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201205250916.q4P9GxQv092841@svn.freebsd.org> From: Gleb Kurtsou Date: Fri, 25 May 2012 09:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235984 - in head/sys/fs: hpfs ntfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 09:16:59 -0000 Author: gleb Date: Fri May 25 09:16:59 2012 New Revision: 235984 URL: http://svn.freebsd.org/changeset/base/235984 Log: Use C99-style initialization for struct dirent in preparation for changing the structure. Sponsored by: Google Summer of Code 2011 Modified: head/sys/fs/hpfs/hpfs_vnops.c head/sys/fs/ntfs/ntfs_vnops.c Modified: head/sys/fs/hpfs/hpfs_vnops.c ============================================================================== --- head/sys/fs/hpfs/hpfs_vnops.c Fri May 25 08:55:59 2012 (r235983) +++ head/sys/fs/hpfs/hpfs_vnops.c Fri May 25 09:16:59 2012 (r235984) @@ -797,10 +797,21 @@ hpfs_de_uiomove ( } -static struct dirent hpfs_de_dot = - { 0, sizeof(struct dirent), DT_DIR, 1, "." }; -static struct dirent hpfs_de_dotdot = - { 0, sizeof(struct dirent), DT_DIR, 2, ".." }; +static struct dirent hpfs_de_dot = { + .d_fileno = 0, + .d_reclen = sizeof(struct dirent), + .d_type = DT_DIR, + .d_namlen = 1, + .d_name = "." +}; +static struct dirent hpfs_de_dotdot = { + .d_fileno = 0, + .d_reclen = sizeof(struct dirent), + .d_type = DT_DIR, + .d_namlen = 2, + .d_name = ".." +}; + int hpfs_readdir(ap) struct vop_readdir_args /* { Modified: head/sys/fs/ntfs/ntfs_vnops.c ============================================================================== --- head/sys/fs/ntfs/ntfs_vnops.c Fri May 25 08:55:59 2012 (r235983) +++ head/sys/fs/ntfs/ntfs_vnops.c Fri May 25 09:16:59 2012 (r235984) @@ -493,8 +493,13 @@ ntfs_readdir(ap) /* Simulate . in every dir except ROOT */ if( ip->i_number != NTFS_ROOTINO ) { - struct dirent dot = { NTFS_ROOTINO, - sizeof(struct dirent), DT_DIR, 1, "." }; + struct dirent dot = { + .d_fileno = NTFS_ROOTINO, + .d_reclen = sizeof(struct dirent), + .d_type = DT_DIR, + .d_namlen = 1, + .d_name = "." + }; if( uio->uio_offset < sizeof(struct dirent) ) { dot.d_fileno = ip->i_number; @@ -508,8 +513,13 @@ ntfs_readdir(ap) /* Simulate .. in every dir including ROOT */ if( uio->uio_offset < 2 * sizeof(struct dirent) ) { - struct dirent dotdot = { NTFS_ROOTINO, - sizeof(struct dirent), DT_DIR, 2, ".." }; + struct dirent dotdot = { + .d_fileno = NTFS_ROOTINO, + .d_reclen = sizeof(struct dirent), + .d_type = DT_DIR, + .d_namlen = 2, + .d_name = ".." + }; error = uiomove((char *)&dotdot,sizeof(struct dirent),uio); if(error) From owner-svn-src-head@FreeBSD.ORG Fri May 25 09:24:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B780A1065672; Fri, 25 May 2012 09:24:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2B868FC15; Fri, 25 May 2012 09:24:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P9Oj0N093193; Fri, 25 May 2012 09:24:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P9OjIP093191; Fri, 25 May 2012 09:24:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250924.q4P9OjIP093191@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 09:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235985 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 09:24:45 -0000 Author: bz Date: Fri May 25 09:24:45 2012 New Revision: 235985 URL: http://svn.freebsd.org/changeset/base/235985 Log: MFp4 bz_ipv6_fast: Properly protect the inp read access when handling the control code. In the past this was expensive but given the rlock it's not so much anymore. Spotted while: optimizing udp6 Discussed with: rwatson (a few months ago) Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Fri May 25 09:16:59 2012 (r235984) +++ head/sys/netinet/udp_usrreq.c Fri May 25 09:24:45 2012 (r235985) @@ -971,12 +971,14 @@ udp_output(struct inpcb *inp, struct mbu } src.sin_family = 0; + INP_RLOCK(inp); if (control != NULL) { /* * XXX: Currently, we assume all the optional information is * stored in a single mbuf. */ if (control->m_next) { + INP_RUNLOCK(inp); m_freem(control); m_freem(m); return (EINVAL); @@ -1018,6 +1020,7 @@ udp_output(struct inpcb *inp, struct mbu m_freem(control); } if (error) { + INP_RUNLOCK(inp); m_freem(m); return (error); } @@ -1039,7 +1042,6 @@ udp_output(struct inpcb *inp, struct mbu * XXXRW: Check that hash locking update here is correct. */ sin = (struct sockaddr_in *)addr; - INP_RLOCK(inp); if (sin != NULL && (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { INP_RUNLOCK(inp); From owner-svn-src-head@FreeBSD.ORG Fri May 25 09:27:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79B051065672; Fri, 25 May 2012 09:27:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64A718FC0A; Fri, 25 May 2012 09:27:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P9RH9Z093331; Fri, 25 May 2012 09:27:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P9RH0i093329; Fri, 25 May 2012 09:27:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205250927.q4P9RH0i093329@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 25 May 2012 09:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235986 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 09:27:17 -0000 Author: bz Date: Fri May 25 09:27:16 2012 New Revision: 235986 URL: http://svn.freebsd.org/changeset/base/235986 Log: MFp4 bz_ipv6_fast: Use M_ZERO with malloc rather than calling bzero() ourselves. Change if () panic() checks to KASSERT()s as they are only catching invariants in code flow but not dependent on network input/output. Move initial assigments indirecting pointers after the lock has been aquired. Passing layer boundries, reset M_PROTOFLAGS. Remove a NULL assignment before free. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Fri May 25 09:24:45 2012 (r235985) +++ head/sys/netinet6/nd6.c Fri May 25 09:27:16 2012 (r235986) @@ -174,9 +174,7 @@ nd6_ifattach(struct ifnet *ifp) { struct nd_ifinfo *nd; - nd = (struct nd_ifinfo *)malloc(sizeof(*nd), M_IP6NDP, M_WAITOK); - bzero(nd, sizeof(*nd)); - + nd = (struct nd_ifinfo *)malloc(sizeof(*nd), M_IP6NDP, M_WAITOK|M_ZERO); nd->initialized = 1; nd->chlim = IPV6_DEFHLIM; @@ -284,10 +282,9 @@ nd6_option(union nd_opts *ndopts) struct nd_opt_hdr *nd_opt; int olen; - if (ndopts == NULL) - panic("ndopts == NULL in nd6_option"); - if (ndopts->nd_opts_last == NULL) - panic("uninitialized ndopts in nd6_option"); + KASSERT(ndopts != NULL, ("%s: ndopts == NULL", __func__)); + KASSERT(ndopts->nd_opts_last != NULL, ("%s: uninitialized ndopts", + __func__)); if (ndopts->nd_opts_search == NULL) return NULL; if (ndopts->nd_opts_done) @@ -335,10 +332,9 @@ nd6_options(union nd_opts *ndopts) struct nd_opt_hdr *nd_opt; int i = 0; - if (ndopts == NULL) - panic("ndopts == NULL in nd6_options"); - if (ndopts->nd_opts_last == NULL) - panic("uninitialized ndopts in nd6_options"); + KASSERT(ndopts != NULL, ("%s: ndopts == NULL", __func__)); + KASSERT(ndopts->nd_opts_last != NULL, ("%s: uninitialized ndopts", + __func__)); if (ndopts->nd_opts_search == NULL) return 0; @@ -1174,11 +1170,13 @@ done: void nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info) { - struct sockaddr_in6 *gateway = (struct sockaddr_in6 *)rt->rt_gateway; + struct sockaddr_in6 *gateway; struct nd_defrouter *dr; - struct ifnet *ifp = rt->rt_ifp; + struct ifnet *ifp; RT_LOCK_ASSERT(rt); + gateway = (struct sockaddr_in6 *)rt->rt_gateway; + ifp = rt->rt_ifp; switch (req) { case RTM_ADD: @@ -1547,10 +1545,8 @@ nd6_cache_lladdr(struct ifnet *ifp, stru IF_AFDATA_UNLOCK_ASSERT(ifp); - if (ifp == NULL) - panic("ifp == NULL in nd6_cache_lladdr"); - if (from == NULL) - panic("from == NULL in nd6_cache_lladdr"); + KASSERT(ifp != NULL, ("%s: ifp == NULL", __func__)); + KASSERT(from != NULL, ("%s: from == NULL", __func__)); /* nothing must be updated for unspecified address */ if (IN6_IS_ADDR_UNSPECIFIED(from)) @@ -2074,6 +2070,8 @@ nd6_output_lle(struct ifnet *ifp, struct } return (error); } + /* Reset layer specific mbuf flags to avoid confusing lower layers. */ + m->m_flags &= ~(M_PROTOFLAGS); if ((ifp->if_flags & IFF_LOOPBACK) != 0) { return ((*ifp->if_output)(origifp, m, (struct sockaddr *)dst, NULL)); @@ -2239,7 +2237,6 @@ clear_llinfo_pqueue(struct llentry *ln) for (m_hold = ln->la_hold; m_hold; m_hold = m_hold_next) { m_hold_next = m_hold->m_nextpkt; - m_hold->m_nextpkt = NULL; m_freem(m_hold); } From owner-svn-src-head@FreeBSD.ORG Fri May 25 09:30:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DBC3106566B; Fri, 25 May 2012 09:30:17 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 790318FC16; Fri, 25 May 2012 09:30:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P9UHSh093526; Fri, 25 May 2012 09:30:17 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P9UHk2093518; Fri, 25 May 2012 09:30:17 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201205250930.q4P9UHk2093518@svn.freebsd.org> From: Gabor Kovesdan Date: Fri, 25 May 2012 09:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235987 - head/usr.bin/sort X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 09:30:17 -0000 Author: gabor Date: Fri May 25 09:30:16 2012 New Revision: 235987 URL: http://svn.freebsd.org/changeset/base/235987 Log: - Only use multi-threading for large files - Do not use mmap() by default; it can be enabled by --mmap - Add some minor optimizations for -u - Update manual page according to the changes Submitted by: Oleg Moskalenko Modified: head/usr.bin/sort/bwstring.c head/usr.bin/sort/file.c head/usr.bin/sort/file.h head/usr.bin/sort/radixsort.c head/usr.bin/sort/sort.1.in head/usr.bin/sort/sort.c head/usr.bin/sort/sort.h Modified: head/usr.bin/sort/bwstring.c ============================================================================== --- head/usr.bin/sort/bwstring.c Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/bwstring.c Fri May 25 09:30:16 2012 (r235987) @@ -499,6 +499,22 @@ bwsfgetln(FILE *f, size_t *len, bool zer } return (bwssbdup(ret, *len)); + } else if (!zero_ended && (MB_CUR_MAX == 1)) { + char *ret; + + ret = fgetln(f, len); + + if (ret == NULL) { + if (!feof(f)) + err(2, NULL); + return (NULL); + } + if (*len > 0) { + if (ret[*len - 1] == '\n') + --(*len); + } + return (bwscsbdup(ret, *len)); + } else { wchar_t c = 0; Modified: head/usr.bin/sort/file.c ============================================================================== --- head/usr.bin/sort/file.c Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/file.c Fri May 25 09:30:16 2012 (r235987) @@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); unsigned long long free_memory = 1000000; unsigned long long available_free_memory = 1000000; +bool use_mmap; + const char *tmpdir = "/var/tmp"; const char *compress_program; @@ -404,23 +406,21 @@ sort_list_dump(struct sort_list *l, cons err(2, NULL); if (l->list) { - struct sort_list_item *last_printed_item; size_t i; - - last_printed_item = NULL; - - for (i = 0; i < l->count; i++) { - struct sort_list_item *item; - - item = l->list[i]; - - if (!(sort_opts_vals.uflag) || - (last_printed_item == NULL) || - list_coll(&last_printed_item, &item)) { - bwsfwrite(item->str, f, + if (!(sort_opts_vals.uflag)) { + for (i = 0; i < l->count; ++i) + bwsfwrite(l->list[i]->str, f, sort_opts_vals.zflag); - if (sort_opts_vals.uflag) + } else { + struct sort_list_item *last_printed_item = NULL; + struct sort_list_item *item; + for (i = 0; i < l->count; ++i) { + item = l->list[i]; + if ((last_printed_item == NULL) || + list_coll(&last_printed_item, &item)) { + bwsfwrite(item->str, f, sort_opts_vals.zflag); last_printed_item = item; + } } } } @@ -657,7 +657,7 @@ file_reader_init(const char *fsrc) ret->fname = sort_strdup(fsrc); - if (strcmp(fsrc, "-") && (compress_program == NULL)) { + if (strcmp(fsrc, "-") && (compress_program == NULL) && use_mmap) { do { struct stat stat_buf; @@ -1539,7 +1539,9 @@ mt_sort(struct sort_list *list, const char* fn) { #if defined(SORT_THREADS) - if (nthreads < 2 || list->count < nthreads) { + if (nthreads < 2 || list->count < MT_SORT_THRESHOLD) { + size_t nthreads_save = nthreads; + nthreads = 1; #endif /* if single thread or small data, do simple sort */ sort_func(list->list, list->count, @@ -1547,6 +1549,7 @@ mt_sort(struct sort_list *list, (int(*)(const void *, const void *)) list_coll); sort_list_dump(list, fn); #if defined(SORT_THREADS) + nthreads = nthreads_save; } else { /* multi-threaded sort */ struct sort_list **parts; @@ -1590,7 +1593,18 @@ mt_sort(struct sort_list *list, pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_DETACHED); - pthread_create(&pth, &attr, mt_sort_thread, parts[i]); + for (;;) { + int res = pthread_create(&pth, &attr, + mt_sort_thread, parts[i]); + + if (res >= 0) + break; + if (errno == EAGAIN) { + pthread_yield(); + continue; + } + err(2, NULL); + } pthread_attr_destroy(&attr); } Modified: head/usr.bin/sort/file.h ============================================================================== --- head/usr.bin/sort/file.h Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/file.h Fri May 25 09:30:16 2012 (r235987) @@ -84,6 +84,9 @@ struct file0_reader extern unsigned long long free_memory; extern unsigned long long available_free_memory; +/* Are we using mmap ? */ +extern bool use_mmap; + /* temporary file dir */ extern const char *tmpdir; Modified: head/usr.bin/sort/radixsort.c ============================================================================== --- head/usr.bin/sort/radixsort.c Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/radixsort.c Fri May 25 09:30:16 2012 (r235987) @@ -609,7 +609,17 @@ run_top_sort_level(struct sort_level *sl pthread_attr_setdetachstate(&attr, PTHREAD_DETACHED); - pthread_create(&pth, &attr, sort_thread, NULL); + for (;;) { + int res = pthread_create(&pth, &attr, + sort_thread, NULL); + if (res >= 0) + break; + if (errno == EAGAIN) { + pthread_yield(); + continue; + } + err(2, NULL); + } pthread_attr_destroy(&attr); } @@ -626,6 +636,10 @@ run_sort(struct sort_list_item **base, s struct sort_level *sl; #if defined(SORT_THREADS) + size_t nthreads_save = nthreads; + if (nmemb < MT_SORT_THRESHOLD) + nthreads = 1; + if (nthreads > 1) { pthread_mutexattr_t mattr; @@ -663,6 +677,7 @@ run_sort(struct sort_list_item **base, s pthread_mutex_destroy(&g_ls_mutex); pthread_mutex_destroy(&sort_left_mutex); } + nthreads = nthreads_save; #endif } Modified: head/usr.bin/sort/sort.1.in ============================================================================== --- head/usr.bin/sort/sort.1.in Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/sort.1.in Fri May 25 09:30:16 2012 (r235987) @@ -33,7 +33,7 @@ .\" .\" @(#)sort.1 8.1 (Berkeley) 6/6/93 .\" -.Dd May 6, 2012 +.Dd May 25, 2012 .Dt SORT 1 .Os .Sh NAME @@ -358,6 +358,9 @@ This sort algorithm cannot be used with .Fl u and .Fl s . +.It Fl Fl mmap +Try to use file memory mapping system call. +It may increase speed in some cases. .El .Pp The following operands are available: Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/sort.c Fri May 25 09:30:16 2012 (r235987) @@ -89,6 +89,7 @@ const char *nlsstr[] = { "", "[+POS1 [-POS2]] [-S memsize] [-T tmpdir] [-t separator] " "[-o outfile] [--batch-size size] [--files0-from file] " "[--heapsort] [--mergesort] [--radixsort] [--qsort] " + "[--mmap] " #if defined(SORT_THREADS) "[--nthreads thread_no] " #endif @@ -138,7 +139,8 @@ enum QSORT_OPT, MERGESORT_OPT, HEAPSORT_OPT, - RADIXSORT_OPT + RADIXSORT_OPT, + MMAP_OPT }; #define NUMBER_OF_MUTUALLY_EXCLUSIVE_FLAGS 6 @@ -164,6 +166,7 @@ struct option long_options[] = { { "key", required_argument, NULL, 'k' }, { "merge", no_argument, NULL, 'm' }, { "mergesort", no_argument, NULL, MERGESORT_OPT }, + { "mmap", no_argument, NULL, MMAP_OPT }, { "month-sort", no_argument, NULL, 'M' }, { "numeric-sort", no_argument, NULL, 'n' }, { "output", required_argument, NULL, 'o' }, @@ -1063,12 +1066,16 @@ main(int argc, char **argv) tmpdir = sort_strdup(optarg); break; case 't': - if (strlen(optarg) > 1) { - if (strcmp(optarg, "\\0")) { + while (strlen(optarg) > 1) { + if (optarg[0] != '\\') { errx(2, "%s: %s\n", strerror(EINVAL), optarg); } - *optarg = 0; + optarg += 1; + if (*optarg == '0') { + *optarg = 0; + break; + } } sort_opts_vals.tflag = true; sort_opts_vals.field_sep = btowc(optarg[0]); @@ -1126,6 +1133,9 @@ main(int argc, char **argv) case MERGESORT_OPT: sort_opts_vals.sort_method = SORT_MERGESORT; break; + case MMAP_OPT: + use_mmap = true; + break; case HEAPSORT_OPT: sort_opts_vals.sort_method = SORT_HEAPSORT; break; @@ -1258,6 +1268,11 @@ main(int argc, char **argv) } } +#if defined(SORT_THREADS) + if ((argc < 1) || (strcmp(outfile, "-") == 0) || (*outfile == 0)) + nthreads = 1; +#endif + if (!sort_opts_vals.cflag && !sort_opts_vals.mflag) { struct file_list fl; struct sort_list list; Modified: head/usr.bin/sort/sort.h ============================================================================== --- head/usr.bin/sort/sort.h Fri May 25 09:27:16 2012 (r235986) +++ head/usr.bin/sort/sort.h Fri May 25 09:30:16 2012 (r235987) @@ -55,6 +55,7 @@ extern nl_catd catalog; extern const char *nlsstr[]; #if defined(SORT_THREADS) +#define MT_SORT_THRESHOLD (10000) extern size_t ncpu; extern size_t nthreads; #endif From owner-svn-src-head@FreeBSD.ORG Fri May 25 09:35:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A8F5106566B; Fri, 25 May 2012 09:35:50 +0000 (UTC) (envelope-from etnapierala@googlemail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 283268FC16; Fri, 25 May 2012 09:35:48 +0000 (UTC) Received: by bkvi18 with SMTP id i18so707135bkv.13 for ; Fri, 25 May 2012 02:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=bC7KAYj64ksg0PsBT+SEWAxIYJxBnTFYCy7g5mIxcQk=; b=RkJAjaeQAe/nSLw/VQQs9ikA3K58Vwwp2w8fgU3d4QnIWOZI2fFXlnMKKWUFkK2eFA zvuzQtb9v4p0n8aeN4vuXHBZbBeoW+yI6fQv8+/PM9ZfOWGjj3DT6VPRj2zJBiVILcyo RChm1XIOLp/TeP0NEb7UYThsW9RCpAoVBkQh06Qs92UzyNe1QbUPw9M5Xc/8E/REykoV w8yZFvKgnDICOcMXO+hBPJAt6bP3F8+rcGotWxAEswruR7fpbclHQicwhdZ2c+zK1jHw HjJxr5/9znLClKPrTYRQvioSN/b93NktmRPvkzlUTAJnrRgtMx6NIx8VWVcT7UKucN2U w6Kg== Received: by 10.204.10.70 with SMTP id o6mr1147187bko.70.1337938548183; Fri, 25 May 2012 02:35:48 -0700 (PDT) Received: from [192.168.1.104] (45.81.datacomsa.pl. [195.34.81.45]) by mx.google.com with ESMTPS id h18sm5666438bkh.8.2012.05.25.02.35.42 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 May 2012 02:35:46 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <4FBF32B7.8080902@FreeBSD.org> Date: Fri, 25 May 2012 11:35:38 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <4B789EE7-1833-4964-9AC7-3983257AD207@FreeBSD.org> References: <201205241648.q4OGmXha049187@svn.freebsd.org> <4FBF32B7.8080902@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235918 - head/sys/geom/label X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 09:35:50 -0000 Wiadomo=B6=E6 napisana przez Andriy Gapon w dniu 25 maj 2012, o godz. = 09:20: > on 24/05/2012 19:48 Edward Tomasz Napierala said the following: >> Author: trasz >> Date: Thu May 24 16:48:33 2012 >> New Revision: 235918 >> URL: http://svn.freebsd.org/changeset/base/235918 >>=20 >> Log: >> Make g_label(4) ignore provider size when looking for UFS labels. >> Without it, it fails to create labels for filesystems resized by >> growfs(8). >>=20 >> PR: kern/165962 >> Submitted by: Olivier Cochard-Labbe >=20 > Was this change discussed somewhere? Reviewed even? >=20 > I was once curious why the size check was there and there was a very = valid > reason to have it: > http://lists.freebsd.org/pipermail/freebsd-geom/2009-April/003473.html > Has anything changed? Nope, I just didn't investigate it enough. I'm testing a fix by Jung-uk = Kim; if it works, I'll commit it, otherwise I'll revert it. In any case, = I'll add a comment describing why it's there. Sorry for the breakage. --=20 If you cut off my head, what would I say? Me and my head, or me and my = body? From owner-svn-src-head@FreeBSD.ORG Fri May 25 09:36:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C97FE10656D1; Fri, 25 May 2012 09:36:39 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B227D8FC12; Fri, 25 May 2012 09:36:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4P9adqq093823; Fri, 25 May 2012 09:36:39 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4P9adck093814; Fri, 25 May 2012 09:36:39 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201205250936.q4P9adck093814@svn.freebsd.org> From: Gleb Kurtsou Date: Fri, 25 May 2012 09:36:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235988 - in head/sys/boot: arm/at91/boot2 arm/ixp425/boot2 common i386/boot2 i386/gptboot pc98/boot2 powerpc/boot1.chrp sparc64/boot1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 09:36:39 -0000 Author: gleb Date: Fri May 25 09:36:39 2012 New Revision: 235988 URL: http://svn.freebsd.org/changeset/base/235988 Log: Use 32-bit ufs_ino_t instead of ino_t to keep boot2 small and prevent unnecessary 64-bit math on 32-bit machines. Sponsored by: Google Summer of Code 2011 Modified: head/sys/boot/arm/at91/boot2/boot2.c head/sys/boot/arm/ixp425/boot2/boot2.c head/sys/boot/common/ufsread.c head/sys/boot/i386/boot2/boot2.c head/sys/boot/i386/gptboot/gptboot.c head/sys/boot/pc98/boot2/boot2.c head/sys/boot/powerpc/boot1.chrp/boot1.c head/sys/boot/sparc64/boot1/boot1.c Modified: head/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- head/sys/boot/arm/at91/boot2/boot2.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/arm/at91/boot2/boot2.c Fri May 25 09:36:39 2012 (r235988) @@ -95,7 +95,6 @@ static uint8_t dsk_meta; static void load(void); static int parse(void); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); #ifdef FIXUP_BOOT_DRV static void fixup_boot_drv(caddr_t, int, int, int); @@ -111,7 +110,7 @@ static void fixup_boot_drv(caddr_t, int, #endif static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) return -1; @@ -154,7 +153,7 @@ int main(void) { int autoboot, c = 0; - ino_t ino; + ufs_ino_t ino; dmadat = (void *)(0x20000000 + (16 << 20)); board_init(); @@ -199,7 +198,7 @@ load(void) Elf32_Ehdr eh; static Elf32_Phdr ep[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr; int i, j; #ifdef FIXUP_BOOT_DRV Modified: head/sys/boot/arm/ixp425/boot2/boot2.c ============================================================================== --- head/sys/boot/arm/ixp425/boot2/boot2.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/arm/ixp425/boot2/boot2.c Fri May 25 09:36:39 2012 (r235988) @@ -98,7 +98,6 @@ static int disk_layout; static void load(void); static int parse(void); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); static int drvread(void *, unsigned, unsigned); #ifdef FIXUP_BOOT_DRV @@ -114,7 +113,7 @@ static void fixup_boot_drv(caddr_t, int, #endif static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) return -1; @@ -158,7 +157,7 @@ main(void) { const char *bt; int autoboot, c = 0; - ino_t ino; + ufs_ino_t ino; dmadat = (void *)(0x1c0000); p_memset((char *)dmadat, 0, 32 * 1024); @@ -207,7 +206,7 @@ load(void) Elf32_Ehdr eh; static Elf32_Phdr ep[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr; int i, j; #ifdef FIXUP_BOOT_DRV Modified: head/sys/boot/common/ufsread.c ============================================================================== --- head/sys/boot/common/ufsread.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/common/ufsread.c Fri May 25 09:36:39 2012 (r235988) @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); #define cgbase(fs, c) ((ufs2_daddr_t)((fs)->fs_fpg * (c))) #endif +typedef uint32_t ufs_ino_t; + /* * We use 4k `virtual' blocks for filesystem data, whatever the actual * filesystem block size. FFS blocks are always a multiple of 4k. @@ -85,14 +87,14 @@ struct dmadat { }; static struct dmadat *dmadat; -static ino_t lookup(const char *); -static ssize_t fsread(ino_t, void *, size_t); +static ufs_ino_t lookup(const char *); +static ssize_t fsread(ufs_ino_t, void *, size_t); static uint8_t ls, dsk_meta; static uint32_t fs_off; static __inline uint8_t -fsfind(const char *name, ino_t * ino) +fsfind(const char *name, ufs_ino_t * ino) { static char buf[DEV_BSIZE]; struct direct *d; @@ -116,12 +118,12 @@ fsfind(const char *name, ino_t * ino) return 0; } -static ino_t +static ufs_ino_t lookup(const char *path) { static char name[MAXNAMLEN + 1]; const char *s; - ino_t ino; + ufs_ino_t ino; ssize_t n; uint8_t dt; @@ -163,7 +165,7 @@ static int sblock_try[] = SBLOCKSEARCH; #endif static ssize_t -fsread(ino_t inode, void *buf, size_t nbyte) +fsread(ufs_ino_t inode, void *buf, size_t nbyte) { #ifndef UFS2_ONLY static struct ufs1_dinode dp1; @@ -173,7 +175,7 @@ fsread(ino_t inode, void *buf, size_t nb static struct ufs2_dinode dp2; #endif static struct fs fs; - static ino_t inomap; + static ufs_ino_t inomap; char *blkbuf; void *indbuf; char *s; Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/i386/boot2/boot2.c Fri May 25 09:36:39 2012 (r235988) @@ -138,7 +138,6 @@ static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); static int parse(void); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); @@ -170,7 +169,7 @@ strcmp(const char *s1, const char *s2) #include "ufsread.c" static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) { printf("Invalid %s\n", "format"); @@ -222,7 +221,7 @@ int main(void) { uint8_t autoboot; - ino_t ino; + ufs_ino_t ino; size_t nbyte; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -307,7 +306,7 @@ load(void) static Elf32_Phdr ep[2]; static Elf32_Shdr es[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr; int i, j; Modified: head/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- head/sys/boot/i386/gptboot/gptboot.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/i386/gptboot/gptboot.c Fri May 25 09:36:39 2012 (r235988) @@ -90,14 +90,13 @@ static struct bootinfo bootinfo; void exit(int); static void load(void); static int parse(char *, int *); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, daddr_t, unsigned); static uint32_t memsize(void); #include "ufsread.c" static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) { @@ -138,7 +137,7 @@ main(void) { char cmd[512], cmdtmp[512]; int autoboot, dskupdated; - ino_t ino; + ufs_ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; @@ -247,7 +246,7 @@ load(void) static Elf32_Phdr ep[2]; static Elf32_Shdr es[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr, x; int fmt, i, j; Modified: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- head/sys/boot/pc98/boot2/boot2.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/pc98/boot2/boot2.c Fri May 25 09:36:39 2012 (r235988) @@ -140,7 +140,6 @@ static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); static int parse(void); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); @@ -172,7 +171,7 @@ strcmp(const char *s1, const char *s2) #include "ufsread.c" static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) { printf("Invalid %s\n", "format"); @@ -351,7 +350,7 @@ main(void) int i; #endif uint8_t autoboot; - ino_t ino; + ufs_ino_t ino; size_t nbyte; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -446,7 +445,7 @@ load(void) static Elf32_Phdr ep[2]; static Elf32_Shdr es[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr; int i, j; Modified: head/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/boot1.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/powerpc/boot1.chrp/boot1.c Fri May 25 09:36:39 2012 (r235988) @@ -45,7 +45,6 @@ static char bootargs[128]; static ofwh_t bootdev; static struct fs fs; -static ino_t inomap; static char blkbuf[BSIZEMAX]; static unsigned int fsblks; @@ -492,7 +491,7 @@ load(const char *fname) Elf32_Ehdr eh; Elf32_Phdr ph; caddr_t p; - ino_t ino; + ufs_ino_t ino; int i; if ((ino = lookup(fname)) == 0) { Modified: head/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- head/sys/boot/sparc64/boot1/boot1.c Fri May 25 09:30:16 2012 (r235987) +++ head/sys/boot/sparc64/boot1/boot1.c Fri May 25 09:36:39 2012 (r235988) @@ -415,7 +415,6 @@ loadzfs(void) Elf64_Ehdr eh; Elf64_Phdr ph; caddr_t p; - ino_t ino; int i; if (zbread((char *)&eh, 0, sizeof(eh)) != sizeof(eh)) { @@ -459,7 +458,7 @@ load(const char *fname) Elf64_Ehdr eh; Elf64_Phdr ph; caddr_t p; - ino_t ino; + ufs_ino_t ino; int i; if ((ino = lookup(fname)) == 0) { From owner-svn-src-head@FreeBSD.ORG Fri May 25 10:08:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D61E9106566C; Fri, 25 May 2012 10:08:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C14428FC0C; Fri, 25 May 2012 10:08:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PA8mrx004488; Fri, 25 May 2012 10:08:48 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PA8mKD004486; Fri, 25 May 2012 10:08:48 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205251008.q4PA8mKD004486@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 25 May 2012 10:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235989 - head/sys/geom/label X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 10:08:48 -0000 Author: trasz Date: Fri May 25 10:08:48 2012 New Revision: 235989 URL: http://svn.freebsd.org/changeset/base/235989 Log: Revert r235918 for now and add comment explaining the reason for the size check. Modified: head/sys/geom/label/g_label_ufs.c Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Fri May 25 09:36:39 2012 (r235988) +++ head/sys/geom/label/g_label_ufs.c Fri May 25 10:08:48 2012 (r235989) @@ -81,10 +81,16 @@ g_label_ufs_taste_common(struct g_consum fs = (struct fs *)g_read_data(cp, superblock, SBLOCKSIZE, NULL); if (fs == NULL) continue; - /* Check for magic */ - if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 0) { + /* Check for magic. We also need to check if file system size is equal + * to providers size, because sysinstall(8) used to bogusly put first + * partition at offset 0 instead of 16, and glabel/ufs would find file + * system on slice instead of partition. + */ + if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 0 && + pp->mediasize / fs->fs_fsize == fs->fs_old_size) { /* Valid UFS1. */ - } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0) { + } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0 && + pp->mediasize / fs->fs_fsize == fs->fs_size) { /* Valid UFS2. */ } else { g_free(fs); From owner-svn-src-head@FreeBSD.ORG Fri May 25 10:32:36 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EEBA106564A; Fri, 25 May 2012 10:32:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id EBE878FC15; Fri, 25 May 2012 10:32:35 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4PAW3rN012310; Fri, 25 May 2012 13:32:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4PAW2KE074022; Fri, 25 May 2012 13:32:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4PAW24a074021; Fri, 25 May 2012 13:32:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 25 May 2012 13:32:02 +0300 From: Konstantin Belousov To: Niclas Zeising Message-ID: <20120525103202.GR2358@deviant.kiev.zoral.com.ua> References: <201205232107.q4NL71dw095460@svn.freebsd.org> <4FBD5899.9000808@daemonic.se> <20120524092649.GH2358@deviant.kiev.zoral.com.ua> <4FBE0086.1050801@daemonic.se> <4FBF438C.5080805@daemonic.se> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E5Kv0g4zpMKTBL4W" Content-Disposition: inline In-Reply-To: <4FBF438C.5080805@daemonic.se> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235859 - in head/sys: i386/conf modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 10:32:36 -0000 --E5Kv0g4zpMKTBL4W Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 25, 2012 at 10:32:12AM +0200, Niclas Zeising wrote: > Hi! > Would it be possible to bump the FreeBSD version to reflect this commit? > It would be helpful when working with the xorg ports, amongst other thin= gs. > Thanks! > Regards! > --=20 There is absolutely no use for version bump. Port builds (libdrm, mesa and ddx) do not depend on any base system headers or libraries. They come with private copies of the ABI headers. --E5Kv0g4zpMKTBL4W Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+/X6IACgkQC3+MBN1Mb4gB5wCg0GTGqIn49u15YWd0PLww6LdS Y/MAnAgzQ/kBfM7LiA2Svw1vLl2Bt1ay =yqdD -----END PGP SIGNATURE----- --E5Kv0g4zpMKTBL4W-- From owner-svn-src-head@FreeBSD.ORG Fri May 25 11:14:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7C25106564A; Fri, 25 May 2012 11:14:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2C0E8FC0C; Fri, 25 May 2012 11:14:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PBE8do007143; Fri, 25 May 2012 11:14:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PBE8FC007141; Fri, 25 May 2012 11:14:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205251114.q4PBE8FC007141@svn.freebsd.org> From: Michael Tuexen Date: Fri, 25 May 2012 11:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235990 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 11:14:08 -0000 Author: tuexen Date: Fri May 25 11:14:08 2012 New Revision: 235990 URL: http://svn.freebsd.org/changeset/base/235990 Log: Undefine SCTP_PACKED before including sctp_uio.h, which doesn't use it. Spotted by Irene Ruengeler. MFC after: 3 days Modified: head/sys/netinet/sctp.h Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Fri May 25 10:08:48 2012 (r235989) +++ head/sys/netinet/sctp.h Fri May 25 11:14:08 2012 (r235990) @@ -556,6 +556,8 @@ struct sctp_error_unrecognized_chunk { #define SCTP_SMALLEST_PMTU 512 /* smallest pmtu allowed when disabling PMTU * discovery */ +#undef SCTP_PACKED + #include /* This dictates the size of the packet @@ -607,7 +609,4 @@ struct sctp_error_unrecognized_chunk { #define SCTP_LOG_AT_SEND_2_OUTQ 0x08000000 #define SCTP_LOG_TRY_ADVANCE 0x10000000 - -#undef SCTP_PACKED - #endif /* !_NETINET_SCTP_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri May 25 14:52:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A817106566B; Fri, 25 May 2012 14:52:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D03248FC14; Fri, 25 May 2012 14:52:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PEq5ZY016247; Fri, 25 May 2012 14:52:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PEq5Cb016245; Fri, 25 May 2012 14:52:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205251452.q4PEq5Cb016245@svn.freebsd.org> From: Marius Strobl Date: Fri, 25 May 2012 14:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235994 - head/sys/sparc64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 14:52:06 -0000 Author: marius Date: Fri May 25 14:52:05 2012 New Revision: 235994 URL: http://svn.freebsd.org/changeset/base/235994 Log: Merge from x86: r232521 Exclude USB drivers (except umass and ukbd) from main kernel image. Modified: head/sys/sparc64/conf/GENERIC Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri May 25 14:49:51 2012 (r235993) +++ head/sys/sparc64/conf/GENERIC Fri May 25 14:52:05 2012 (r235994) @@ -234,35 +234,8 @@ device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) device usb # USB Bus (required) -#device udbp # USB Double Bulk Pipe devices (needs netgraph) -device uhid # "Human Interface Devices" device ukbd # Keyboard -device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da -device ums # Mouse -device urio # Diamond Rio 500 MP3 player -# USB Serial devices -device uark # Technologies ARK3116 based serial adapters -device ubsa # Belkin F5U103 and compatible serial adapters -device uftdi # For FTDI usb serial adapters -device uipaq # Some WinCE based devices -device uplcom # Prolific PL-2303 serial adapters -device uslcom # SI Labs CP2101/CP2102 serial adapters -device uvisor # Visor and Palm devices -device uvscom # USB serial support for DDI pocket's PHS -# USB Ethernet, requires miibus -device aue # ADMtek USB Ethernet -device axe # ASIX Electronics USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet -device rue # RealTek RTL8150 USB Ethernet -device udav # Davicom DM9601E USB -# USB Wireless -device rum # Ralink Technology RT2501USB wireless NICs -device uath # Atheros AR5523 wireless NICs -device ural # Ralink Technology RT2500USB wireless NICs -device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support device firewire # FireWire bus code @@ -278,4 +251,3 @@ device sound # Generic sound driver (r device snd_audiocs # Crystal Semiconductor CS4231 device snd_es137x # Ensoniq AudioPCI ES137x device snd_t4dwave # Acer Labs M5451 -device snd_uaudio # USB Audio From owner-svn-src-head@FreeBSD.ORG Fri May 25 15:05:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4EF5106564A; Fri, 25 May 2012 15:05:18 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84B988FC0C; Fri, 25 May 2012 15:05:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PF5IKK017065; Fri, 25 May 2012 15:05:18 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PF5IrG017062; Fri, 25 May 2012 15:05:18 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205251505.q4PF5IrG017062@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 25 May 2012 15:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235999 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 15:05:18 -0000 Author: raj Date: Fri May 25 15:05:17 2012 New Revision: 235999 URL: http://svn.freebsd.org/changeset/base/235999 Log: More Cicada/Vitesse PHY ids. Obtained from: Semihalf Modified: head/sys/dev/mii/ciphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/ciphy.c ============================================================================== --- head/sys/dev/mii/ciphy.c Fri May 25 14:57:02 2012 (r235998) +++ head/sys/dev/mii/ciphy.c Fri May 25 15:05:17 2012 (r235999) @@ -91,8 +91,10 @@ static const struct mii_phydesc ciphys[] MII_PHY_DESC(xxCICADA, CS8201B), MII_PHY_DESC(xxCICADA, CS8204), MII_PHY_DESC(xxCICADA, VSC8211), + MII_PHY_DESC(xxCICADA, VSC8221), MII_PHY_DESC(xxCICADA, CS8244), MII_PHY_DESC(xxVITESSE, VSC8601), + MII_PHY_DESC(xxVITESSE, VSC8641), MII_PHY_END }; @@ -368,8 +370,10 @@ ciphy_fixup(struct mii_softc *sc) break; case MII_MODEL_xxCICADA_VSC8211: + case MII_MODEL_xxCICADA_VSC8221: case MII_MODEL_xxCICADA_CS8244: case MII_MODEL_xxVITESSE_VSC8601: + case MII_MODEL_xxVITESSE_VSC8641: break; default: device_printf(sc->mii_dev, "unknown CICADA PHY model %x\n", Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Fri May 25 14:57:02 2012 (r235998) +++ head/sys/dev/mii/miidevs Fri May 25 15:05:17 2012 (r235999) @@ -52,7 +52,7 @@ oui AMD 0x00001a Advanced Micro Devic oui BROADCOM 0x001018 Broadcom Corporation oui BROADCOM2 0x000af7 Broadcom Corporation oui BROADCOM3 0x001be9 Broadcom Corporation -oui CICADA 0x0003F1 Cicada Semiconductor +oui CICADA 0x0003f1 Cicada Semiconductor oui DAVICOM 0x00606e Davicom Semiconductor oui ENABLESEMI 0x0010dd Enable Semiconductor oui ICPLUS 0x0090c3 IC Plus Corp. @@ -71,6 +71,7 @@ oui SEEQ 0x00a07d Seeq Technology oui SIS 0x00e006 Silicon Integrated Systems oui TI 0x080028 Texas Instruments oui TSC 0x00c039 TDK Semiconductor +oui VITESSE 0x0001c1 Vitesse Semiconductor oui XAQTI 0x00e0ae XaQti Corp. /* Some Intel 82553's use an alternative OUI. */ @@ -190,6 +191,7 @@ model xxBROADCOM_ALT1 BCM5906 0x0004 BCM model xxCICADA CS8201 0x0001 Cicada CS8201 10/100/1000TX PHY model xxCICADA CS8204 0x0004 Cicada CS8204 10/100/1000TX PHY model xxCICADA VSC8211 0x000b Cicada VSC8211 10/100/1000TX PHY +model xxCICADA VSC8221 0x0015 Cicada CS8201 10/100/1000TX PHY model xxCICADA CS8201A 0x0020 Cicada CS8201 10/100/1000TX PHY model xxCICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY model xxCICADA CS8244 0x002c Cicada CS8244 10/100/1000TX PHY @@ -318,5 +320,8 @@ model TI TNETE2101 0x0003 TNETE2101 med model xxTSC 78Q2120 0x0014 78Q2120 10/100 media interface model xxTSC 78Q2121 0x0015 78Q2121 100BASE-TX media interface +/* Vitesse Semiconductor */ +model xxVITESSE VSC8641 0x0003 Vitesse VSC8641 10/100/1000TX PHY + /* XaQti Corp. PHYs */ model xxXAQTI XMACII 0x0000 XaQti Corp. XMAC II gigabit interface From owner-svn-src-head@FreeBSD.ORG Fri May 25 15:13:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4201E1065688; Fri, 25 May 2012 15:13:56 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CD3E8FC1D; Fri, 25 May 2012 15:13:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PFDugA017461; Fri, 25 May 2012 15:13:56 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PFDtrU017459; Fri, 25 May 2012 15:13:55 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205251513.q4PFDtrU017459@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 25 May 2012 15:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236000 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 15:13:56 -0000 Author: raj Date: Fri May 25 15:13:55 2012 New Revision: 236000 URL: http://svn.freebsd.org/changeset/base/236000 Log: Missing vm_paddr_t bits which should have been part of r235936. Modified: head/sys/powerpc/powerpc/mmu_if.m Modified: head/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- head/sys/powerpc/powerpc/mmu_if.m Fri May 25 15:05:17 2012 (r235999) +++ head/sys/powerpc/powerpc/mmu_if.m Fri May 25 15:13:55 2012 (r236000) @@ -761,7 +761,7 @@ METHOD void cpu_bootstrap { */ METHOD void * mapdev { mmu_t _mmu; - vm_offset_t _pa; + vm_paddr_t _pa; vm_size_t _size; }; @@ -818,7 +818,7 @@ METHOD void unmapdev { * * @retval pa physical address corresponding to mapping */ -METHOD vm_offset_t kextract { +METHOD vm_paddr_t kextract { mmu_t _mmu; vm_offset_t _va; }; @@ -833,7 +833,7 @@ METHOD vm_offset_t kextract { METHOD void kenter { mmu_t _mmu; vm_offset_t _va; - vm_offset_t _pa; + vm_paddr_t _pa; }; /** @@ -860,7 +860,7 @@ METHOD void kenter_attr { */ METHOD boolean_t dev_direct_mapped { mmu_t _mmu; - vm_offset_t _pa; + vm_paddr_t _pa; vm_size_t _size; }; From owner-svn-src-head@FreeBSD.ORG Fri May 25 16:28:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3E311065675; Fri, 25 May 2012 16:28:31 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id A19BE8FC0C; Fri, 25 May 2012 16:28:31 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M4L001024BC4300@smtpauth2.wiscmail.wisc.edu>; Fri, 25 May 2012 10:28:25 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-user-nat.icecube.wisc.edu [128.104.255.12]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M4L00BR24BBGN20@smtpauth2.wiscmail.wisc.edu>; Fri, 25 May 2012 10:28:24 -0500 (CDT) Date: Fri, 25 May 2012 10:28:23 -0500 From: Nathan Whitehorn In-reply-to: <201205251513.q4PFDtrU017459@svn.freebsd.org> To: Rafal Jaworowski Message-id: <4FBFA517.8080601@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.255.12 X-Spam-PmxInfo: Server=avs-15, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.25.151816, SenderIP=128.104.255.12 References: <201205251513.q4PFDtrU017459@svn.freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236000 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:28:31 -0000 On 05/25/12 10:13, Rafal Jaworowski wrote: > Author: raj > Date: Fri May 25 15:13:55 2012 > New Revision: 236000 > URL: http://svn.freebsd.org/changeset/base/236000 > > Log: > Missing vm_paddr_t bits which should have been part of r235936. I think you also need equivalent changes to aim/mmu_oea64.c. -Nathan > Modified: > head/sys/powerpc/powerpc/mmu_if.m > > Modified: head/sys/powerpc/powerpc/mmu_if.m > ============================================================================== > --- head/sys/powerpc/powerpc/mmu_if.m Fri May 25 15:05:17 2012 (r235999) > +++ head/sys/powerpc/powerpc/mmu_if.m Fri May 25 15:13:55 2012 (r236000) > @@ -761,7 +761,7 @@ METHOD void cpu_bootstrap { > */ > METHOD void * mapdev { > mmu_t _mmu; > - vm_offset_t _pa; > + vm_paddr_t _pa; > vm_size_t _size; > }; > > @@ -818,7 +818,7 @@ METHOD void unmapdev { > * > * @retval pa physical address corresponding to mapping > */ > -METHOD vm_offset_t kextract { > +METHOD vm_paddr_t kextract { > mmu_t _mmu; > vm_offset_t _va; > }; > @@ -833,7 +833,7 @@ METHOD vm_offset_t kextract { > METHOD void kenter { > mmu_t _mmu; > vm_offset_t _va; > - vm_offset_t _pa; > + vm_paddr_t _pa; > }; > > /** > @@ -860,7 +860,7 @@ METHOD void kenter_attr { > */ > METHOD boolean_t dev_direct_mapped { > mmu_t _mmu; > - vm_offset_t _pa; > + vm_paddr_t _pa; > vm_size_t _size; > }; > From owner-svn-src-head@FreeBSD.ORG Fri May 25 16:30:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 703F11065679; Fri, 25 May 2012 16:30:43 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0098FC0A; Fri, 25 May 2012 16:30:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PGUhHg020879; Fri, 25 May 2012 16:30:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PGUhOH020877; Fri, 25 May 2012 16:30:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205251630.q4PGUhOH020877@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 25 May 2012 16:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236006 - head/lib/libc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:30:43 -0000 Author: marcel Date: Fri May 25 16:30:42 2012 New Revision: 236006 URL: http://svn.freebsd.org/changeset/base/236006 Log: Doh... Don't add __eabi to an old version tag (i.e. FBSD_1.0). Add it to the current one (= FBSD_1.3). Pointed out by: kib Modified: head/lib/libc/powerpc/Symbol.map Modified: head/lib/libc/powerpc/Symbol.map ============================================================================== --- head/lib/libc/powerpc/Symbol.map Fri May 25 16:09:06 2012 (r236005) +++ head/lib/libc/powerpc/Symbol.map Fri May 25 16:30:42 2012 (r236006) @@ -11,7 +11,6 @@ FBSD_1.0 { /* PSEUDO syscalls */ _exit; - __eabi; _mcount; _setjmp; _longjmp; @@ -39,6 +38,10 @@ FBSD_1.0 { vfork; }; +FBSD_1.3 { + __eabi; +}; + FBSDprivate_1.0 { /* PSEUDO syscalls */ __sys_getlogin; From owner-svn-src-head@FreeBSD.ORG Fri May 25 16:45:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C1EF1065674; Fri, 25 May 2012 16:45:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 770F98FC0C; Fri, 25 May 2012 16:45:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PGjvd7021689; Fri, 25 May 2012 16:45:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PGjvYQ021687; Fri, 25 May 2012 16:45:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205251645.q4PGjvYQ021687@svn.freebsd.org> From: Adrian Chadd Date: Fri, 25 May 2012 16:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236009 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 16:45:57 -0000 Author: adrian Date: Fri May 25 16:45:56 2012 New Revision: 236009 URL: http://svn.freebsd.org/changeset/base/236009 Log: * According to the reference code, AR_WA_D3_L1_DISBABLE is bit 14. * Add some other WAR bits (very usefully described too) in preparation for porting over some suspend/resume fixes from ath9k/Atheros. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Fri May 25 16:40:31 2012 (r236008) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Fri May 25 16:45:56 2012 (r236009) @@ -253,11 +253,15 @@ #define AR_MAC_LED_ASSOC_PEND 0x2 /* STA is trying to associate */ #define AR_MAC_LED_ASSOC_S 10 +#define AR_WA_BIT6 0x00000040 +#define AR_WA_BIT7 0x00000080 +#define AR_WA_D3_L1_DISABLE 0x00004000 /* */ #define AR_WA_UNTIE_RESET_EN 0x00008000 /* ena PCI reset to POR */ #define AR_WA_RESET_EN 0x00040000 /* ena AR_WA_UNTIE_RESET_EN */ #define AR_WA_ANALOG_SHIFT 0x00100000 #define AR_WA_POR_SHORT 0x00200000 /* PCIE phy reset control */ -#define AR_WA_D3_L1_DISABLE 0x00800000 /* bit 23 */ +#define AR_WA_BIT22 0x00400000 +#define AR_WA_BIT23 0x00800000 #define AR_WA_DEFAULT 0x0000073f #define AR9280_WA_DEFAULT 0x0040073b /* disable bit 2, see commit */ From owner-svn-src-head@FreeBSD.ORG Fri May 25 17:06:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D01941065692; Fri, 25 May 2012 17:06:44 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 7DFD98FC0A; Fri, 25 May 2012 17:06:44 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 72C20C3845; Fri, 25 May 2012 19:06:33 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id 4yCUp36jnfsv; Fri, 25 May 2012 19:06:32 +0200 (CEST) Received: from [10.0.0.112] (nat3-133.ghnet.pl [91.150.222.133]) by smtp.semihalf.com (Postfix) with ESMTPSA id CCBEAC3833; Fri, 25 May 2012 19:06:32 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <4FBFA517.8080601@freebsd.org> Date: Fri, 25 May 2012 19:06:42 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205251513.q4PFDtrU017459@svn.freebsd.org> <4FBFA517.8080601@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236000 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 17:06:44 -0000 On 2012-05-25, at 17:28, Nathan Whitehorn wrote: > On 05/25/12 10:13, Rafal Jaworowski wrote: >> Author: raj >> Date: Fri May 25 15:13:55 2012 >> New Revision: 236000 >> URL: http://svn.freebsd.org/changeset/base/236000 >>=20 >> Log: >> Missing vm_paddr_t bits which should have been part of r235936. >=20 > I think you also need equivalent changes to aim/mmu_oea64.c. Yes, but the GENERIC64 build appears currently broken, so I could not = compile test it. Rafal From owner-svn-src-head@FreeBSD.ORG Fri May 25 17:19:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9806B106564A; Fri, 25 May 2012 17:19:30 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 832388FC18; Fri, 25 May 2012 17:19:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PHJUNT023441; Fri, 25 May 2012 17:19:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PHJUAl023439; Fri, 25 May 2012 17:19:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201205251719.q4PHJUAl023439@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 25 May 2012 17:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236013 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 17:19:30 -0000 Author: pjd Date: Fri May 25 17:19:30 2012 New Revision: 236013 URL: http://svn.freebsd.org/changeset/base/236013 Log: Correct error message. MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri May 25 17:15:53 2012 (r236012) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri May 25 17:19:30 2012 (r236013) @@ -3168,7 +3168,7 @@ zfs_do_rename(int argc, char **argv) } if (flags.nounmount && parents) { - (void) fprintf(stderr, gettext("-u and -r options are mutually " + (void) fprintf(stderr, gettext("-u and -p options are mutually " "exclusive\n")); usage(B_FALSE); } From owner-svn-src-head@FreeBSD.ORG Fri May 25 17:53:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77B82106566C; Fri, 25 May 2012 17:53:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 627048FC08; Fri, 25 May 2012 17:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PHrwsk025082; Fri, 25 May 2012 17:53:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PHrw0O025080; Fri, 25 May 2012 17:53:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205251753.q4PHrw0O025080@svn.freebsd.org> From: Adrian Chadd Date: Fri, 25 May 2012 17:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236017 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 17:53:58 -0000 Author: adrian Date: Fri May 25 17:53:57 2012 New Revision: 236017 URL: http://svn.freebsd.org/changeset/base/236017 Log: Add some AR5416/AR5418 WAR's for power-on and suspend/resume: * Now that ah_configPCIE is called for both power on and suspend/resume, make sure the right bit(s) are cleared and set when suspending and resuming. Specifically: + force disable/enable the PCIe PHY upon suspend/resume; + reprogram the PCIe WAR register when resuming and upon power-on. * Add a recipe which powers down any PCIe PHY hardware inside the AR5416 (which is the PCI variant) to save on power. I have (currently) no way to test exactly how much power is saved, if any. Tested on: * AR5416 cardbus - although unfortunately pccard/cbb/cardbus currently detaches the NIC upon suspend, I don't think it's a proper test case. * AR5418 PCIe attached to expresscard - since we're not doing PCIe APSM, it's also not likely a full/good test case. In both instances I went through a handful of suspend/resume cycles and ensured that the STA vap reassociated correctly. TODO: * Setup a laptop to simply sit in a suspend/resume loop, making sure that the NIC always correctly comes back; * Start doing suspend/resume tests with actual traffic going on in the background, as I bet this process is all quite racy at the present; * Test adhoc/hostap mode, just to be completely sure it's working correctly; * See if I can jury rig an external power source to an AR5416 to test out whether ah_disablePCIE() works. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 17:50:50 2012 (r236016) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 17:53:57 2012 (r236017) @@ -468,18 +468,63 @@ ar5416AttachPCIE(struct ath_hal *ah) static void ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { - if (AH_PRIVATE(ah)->ah_ispcie && !restore) { + + /* This is only applicable for AR5418 (AR5416 PCIe) */ + if (! AH_PRIVATE(ah)->ah_ispcie) + return; + + if (! restore) { ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); OS_DELAY(1000); - OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); + } + + if (power_off) { /* Power-off */ + /* clear bit 19 to disable L1 */ + OS_REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); + } else { /* Power-on */ + /* Set default WAR values for Owl */ OS_REG_WRITE(ah, AR_WA, AR_WA_DEFAULT); + + /* set bit 19 to allow forcing of pcie core into L1 state */ + OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); } } +/* + * Disable PCIe PHY if PCIe isn't used. + */ static void ar5416DisablePCIE(struct ath_hal *ah) { - /* XXX TODO */ + + /* PCIe? Don't */ + if (AH_PRIVATE(ah)->ah_ispcie) + return; + + /* .. Only applicable for AR5416v2 or later */ + if (! (AR_SREV_OWL(ah) && AR_SREV_OWL_20_OR_LATER(ah))) + return; + + OS_REG_WRITE_BUFFER_ENABLE(ah); + + /* + * Disable the PCIe PHY. + */ + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x9248fc00); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x24924924); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x28000029); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x57160824); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x25980579); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x00000000); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x1aaabe40); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0xbe105554); + OS_REG_WRITE(ah, AR_PCIE_SERDES, 0x000e1007); + + /* Load the new settings */ + OS_REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000); + + OS_REG_WRITE_BUFFER_FLUSH(ah); + OS_REG_WRITE_BUFFER_DISABLE(ah); } static void From owner-svn-src-head@FreeBSD.ORG Fri May 25 18:14:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA7AE106566B; Fri, 25 May 2012 18:14:39 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 59C5D8FC0A; Fri, 25 May 2012 18:14:39 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 8558CC3845; Fri, 25 May 2012 20:14:27 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id zdGc9qDg+nQ3; Fri, 25 May 2012 20:14:27 +0200 (CEST) Received: from [10.0.0.112] (nat3-133.ghnet.pl [91.150.222.133]) by smtp.semihalf.com (Postfix) with ESMTPSA id CCDB9C3833; Fri, 25 May 2012 20:14:26 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: Date: Fri, 25 May 2012 20:14:36 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205251513.q4PFDtrU017459@svn.freebsd.org> <4FBFA517.8080601@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r236000 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 18:14:39 -0000 On 2012-05-25, at 19:06, Rafal Jaworowski wrote: >=20 > On 2012-05-25, at 17:28, Nathan Whitehorn wrote: >=20 >> On 05/25/12 10:13, Rafal Jaworowski wrote: >>> Author: raj >>> Date: Fri May 25 15:13:55 2012 >>> New Revision: 236000 >>> URL: http://svn.freebsd.org/changeset/base/236000 >>>=20 >>> Log: >>> Missing vm_paddr_t bits which should have been part of r235936. >>=20 >> I think you also need equivalent changes to aim/mmu_oea64.c. >=20 > Yes, but the GENERIC64 build appears currently broken, so I could not = compile test it. Sorry for the noise, I had some old powerpc64 build env locally, the = build is fine. I'll commit the vm_paddr_t fix shortly. Rafal From owner-svn-src-head@FreeBSD.ORG Fri May 25 18:17:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E11C41065670; Fri, 25 May 2012 18:17:26 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C93358FC18; Fri, 25 May 2012 18:17:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PIHQQS026085; Fri, 25 May 2012 18:17:26 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PIHQDJ026083; Fri, 25 May 2012 18:17:26 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205251817.q4PIHQDJ026083@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 25 May 2012 18:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236019 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 18:17:27 -0000 Author: raj Date: Fri May 25 18:17:26 2012 New Revision: 236019 URL: http://svn.freebsd.org/changeset/base/236019 Log: Fix physical address type to vm_paddr_t also for powerpc64. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Fri May 25 17:56:27 2012 (r236018) +++ head/sys/powerpc/aim/mmu_oea64.c Fri May 25 18:17:26 2012 (r236019) @@ -306,7 +306,7 @@ boolean_t moea64_is_modified(mmu_t, vm_p boolean_t moea64_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea64_is_referenced(mmu_t, vm_page_t); boolean_t moea64_ts_referenced(mmu_t, vm_page_t); -vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int); +vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea64_page_exists_quick(mmu_t, pmap_t, vm_page_t); int moea64_page_wired_mappings(mmu_t, vm_page_t); void moea64_pinit(mmu_t, pmap_t); @@ -324,14 +324,14 @@ void moea64_zero_page_area(mmu_t, vm_pag void moea64_zero_page_idle(mmu_t, vm_page_t); void moea64_activate(mmu_t, struct thread *); void moea64_deactivate(mmu_t, struct thread *); -void *moea64_mapdev(mmu_t, vm_offset_t, vm_size_t); +void *moea64_mapdev(mmu_t, vm_paddr_t, vm_size_t); void *moea64_mapdev_attr(mmu_t, vm_offset_t, vm_size_t, vm_memattr_t); void moea64_unmapdev(mmu_t, vm_offset_t, vm_size_t); -vm_offset_t moea64_kextract(mmu_t, vm_offset_t); +vm_paddr_t moea64_kextract(mmu_t, vm_offset_t); void moea64_page_set_memattr(mmu_t, vm_page_t m, vm_memattr_t ma); void moea64_kenter_attr(mmu_t, vm_offset_t, vm_offset_t, vm_memattr_t ma); -void moea64_kenter(mmu_t, vm_offset_t, vm_offset_t); -boolean_t moea64_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); +void moea64_kenter(mmu_t, vm_offset_t, vm_paddr_t); +boolean_t moea64_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); static void moea64_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t); static mmu_method_t moea64_methods[] = { @@ -1641,7 +1641,7 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_ } void -moea64_kenter(mmu_t mmu, vm_offset_t va, vm_offset_t pa) +moea64_kenter(mmu_t mmu, vm_offset_t va, vm_paddr_t pa) { moea64_kenter_attr(mmu, va, pa, VM_MEMATTR_DEFAULT); @@ -1651,7 +1651,7 @@ moea64_kenter(mmu_t mmu, vm_offset_t va, * Extract the physical page address associated with the given kernel virtual * address. */ -vm_offset_t +vm_paddr_t moea64_kextract(mmu_t mmu, vm_offset_t va) { struct pvo_entry *pvo; @@ -1692,8 +1692,8 @@ moea64_kremove(mmu_t mmu, vm_offset_t va * first usable address after the mapped region. */ vm_offset_t -moea64_map(mmu_t mmu, vm_offset_t *virt, vm_offset_t pa_start, - vm_offset_t pa_end, int prot) +moea64_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t pa_start, + vm_paddr_t pa_end, int prot) { vm_offset_t sva, va; @@ -2440,7 +2440,7 @@ moea64_clear_bit(mmu_t mmu, vm_page_t m, } boolean_t -moea64_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size) +moea64_dev_direct_mapped(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { struct pvo_entry *pvo, key; vm_offset_t ppa; @@ -2493,7 +2493,7 @@ moea64_mapdev_attr(mmu_t mmu, vm_offset_ } void * -moea64_mapdev(mmu_t mmu, vm_offset_t pa, vm_size_t size) +moea64_mapdev(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { return moea64_mapdev_attr(mmu, pa, size, VM_MEMATTR_DEFAULT); From owner-svn-src-head@FreeBSD.ORG Fri May 25 19:36:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17111106564A; Fri, 25 May 2012 19:36:31 +0000 (UTC) (envelope-from Cy.Schubert@komquats.com) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by mx1.freebsd.org (Postfix) with ESMTP id B692E8FC14; Fri, 25 May 2012 19:36:30 +0000 (UTC) Received: from pd2ml1so-ssvc.prod.shaw.ca ([10.0.141.139]) by pd2mo1so-svcs.prod.shaw.ca with ESMTP; 25 May 2012 13:36:30 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=2TvZ7eE48NdEYeaL5Xf58dNzJU178UzT+2lxUZ5Mhss= c=1 sm=1 a=jlShZm689jMA:10 a=QrugwKR0C_UA:10 a=wAGQQ9Az6v0A:10 a=BLceEmwcHowA:10 a=ICAaq7hcmGcA:10 a=kj9zAlcOel0A:10 a=IbtKDeXwb2+SRU442/pi3A==:17 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=7MS6cYxJ5hD-Fg6uabkA:9 a=CjuIK1q_8ugA:10 a=V7tsTZBp22UA:10 a=SV7veod9ZcQA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO spqr.komquats.com) ([96.50.7.119]) by pd2ml1so-dmz.prod.shaw.ca with ESMTP; 25 May 2012 13:36:30 -0600 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTP id D5D57D0; Fri, 25 May 2012 12:36:29 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.14.5/8.14.5) with ESMTP id q4PJaT6a004609; Fri, 25 May 2012 12:36:29 -0700 (PDT) (envelope-from Cy.Schubert@komquats.com) Message-Id: <201205251936.q4PJaT6a004609@slippy.cwsent.com> X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.3 From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.komquats.com/ To: Konstantin Belousov In-Reply-To: Message from Konstantin Belousov of "Wed, 23 May 2012 17:10:23 -0000." <201205231710.q4NHAN9s085383@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 25 May 2012 12:36:29 -0700 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235847 - in head/sys/modules/drm2: . drm2 i915kms X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Cy Schubert List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 19:36:31 -0000 In message <201205231710.q4NHAN9s085383@svn.freebsd.org>, Konstantin Belousov w rites: > Author: kib > Date: Wed May 23 17:10:22 2012 > New Revision: 235847 > URL: http://svn.freebsd.org/changeset/base/235847 > > Log: > The drm2 modules makefiles commit. > Still not attached to the build. > > Sponsored by: The FreeBSD Foundation > MFC after: 1 month > Thank you. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@FreeBSD.ORG Fri May 25 19:45:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3DF6106566B; Fri, 25 May 2012 19:45:01 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEE8A8FC0A; Fri, 25 May 2012 19:45:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PJj13Y029638; Fri, 25 May 2012 19:45:01 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PJj1o6029637; Fri, 25 May 2012 19:45:01 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201205251945.q4PJj1o6029637@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 25 May 2012 19:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236020 - head/sbin/init X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 19:45:01 -0000 Author: jilles Date: Fri May 25 19:45:01 2012 New Revision: 236020 URL: http://svn.freebsd.org/changeset/base/236020 Log: init: Remove unnecessary 2-second delay before calling reboot(2). Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Fri May 25 18:17:26 2012 (r236019) +++ head/sbin/init/init.c Fri May 25 19:45:01 2012 (r236020) @@ -646,8 +646,6 @@ single_user(void) if (Reboot) { /* Instead of going single user, let's reboot the machine */ sync(); - alarm(2); - pause(); reboot(howto); _exit(0); } From owner-svn-src-head@FreeBSD.ORG Fri May 25 20:33:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C978106566C; Fri, 25 May 2012 20:33:35 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76D788FC1C; Fri, 25 May 2012 20:33:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PKXZXK031825; Fri, 25 May 2012 20:33:35 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PKXZqG031813; Fri, 25 May 2012 20:33:35 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205252033.q4PKXZqG031813@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 25 May 2012 20:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236023 - in head/sys: geom/part sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 20:33:35 -0000 Author: marcel Date: Fri May 25 20:33:34 2012 New Revision: 236023 URL: http://svn.freebsd.org/changeset/base/236023 Log: Add a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes. The gpart alias for these partition types is "freebsd-nandfs". Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_apm.c head/sys/geom/part/g_part_bsd.c head/sys/geom/part/g_part_gpt.c head/sys/geom/part/g_part_vtoc8.c head/sys/sys/apm.h head/sys/sys/disklabel.h head/sys/sys/gpt.h head/sys/sys/vtoc.h Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part.c Fri May 25 20:33:34 2012 (r236023) @@ -83,6 +83,7 @@ struct g_part_alias_list { { "fat32", G_PART_ALIAS_MS_FAT32 }, { "freebsd", G_PART_ALIAS_FREEBSD }, { "freebsd-boot", G_PART_ALIAS_FREEBSD_BOOT }, + { "freebsd-nandfs", G_PART_ALIAS_FREEBSD_NANDFS }, { "freebsd-swap", G_PART_ALIAS_FREEBSD_SWAP }, { "freebsd-ufs", G_PART_ALIAS_FREEBSD_UFS }, { "freebsd-vinum", G_PART_ALIAS_FREEBSD_VINUM }, Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part.h Fri May 25 20:33:34 2012 (r236023) @@ -46,6 +46,7 @@ enum g_part_alias { G_PART_ALIAS_EFI, /* A EFI system partition entry. */ G_PART_ALIAS_FREEBSD, /* A BSD labeled partition entry. */ G_PART_ALIAS_FREEBSD_BOOT, /* A FreeBSD boot partition entry. */ + G_PART_ALIAS_FREEBSD_NANDFS, /* A FreeBSD nandfs partition entry. */ G_PART_ALIAS_FREEBSD_SWAP, /* A swap partition entry. */ G_PART_ALIAS_FREEBSD_UFS, /* A UFS/UFS2 file system entry. */ G_PART_ALIAS_FREEBSD_VINUM, /* A Vinum partition entry. */ Modified: head/sys/geom/part/g_part_apm.c ============================================================================== --- head/sys/geom/part/g_part_apm.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part_apm.c Fri May 25 20:33:34 2012 (r236023) @@ -159,6 +159,11 @@ apm_parse_type(const char *type, char *b strcpy(buf, APM_ENT_TYPE_FREEBSD); return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + strcpy(buf, APM_ENT_TYPE_FREEBSD_NANDFS); + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { strcpy(buf, APM_ENT_TYPE_FREEBSD_SWAP); @@ -485,6 +490,8 @@ g_part_apm_type(struct g_part_table *bas return (g_part_alias_name(G_PART_ALIAS_APPLE_UFS)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD)) return (g_part_alias_name(G_PART_ALIAS_FREEBSD)); + if (!strcmp(type, APM_ENT_TYPE_FREEBSD_NANDFS)) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD_SWAP)) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD_UFS)) Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part_bsd.c Fri May 25 20:33:34 2012 (r236023) @@ -126,6 +126,11 @@ bsd_parse_type(const char *type, uint8_t *fstype = (u_int)lt; return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + *fstype = FS_NANDFS; + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { *fstype = FS_SWAP; @@ -450,6 +455,8 @@ g_part_bsd_type(struct g_part_table *bas entry = (struct g_part_bsd_entry *)baseentry; type = entry->part.p_fstype; + if (type == FS_NANDFS) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (type == FS_SWAP) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (type == FS_BSDFFS) Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part_gpt.c Fri May 25 20:33:34 2012 (r236023) @@ -155,6 +155,7 @@ static struct uuid gpt_uuid_bios_boot = static struct uuid gpt_uuid_efi = GPT_ENT_TYPE_EFI; static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; static struct uuid gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; +static struct uuid gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; static struct uuid gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; static struct uuid gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; static struct uuid gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; @@ -195,6 +196,7 @@ static struct g_part_uuid_alias { { &gpt_uuid_efi, G_PART_ALIAS_EFI, 0xee }, { &gpt_uuid_freebsd, G_PART_ALIAS_FREEBSD, 0xa5 }, { &gpt_uuid_freebsd_boot, G_PART_ALIAS_FREEBSD_BOOT, 0 }, + { &gpt_uuid_freebsd_nandfs, G_PART_ALIAS_FREEBSD_NANDFS, 0 }, { &gpt_uuid_freebsd_swap, G_PART_ALIAS_FREEBSD_SWAP, 0 }, { &gpt_uuid_freebsd_ufs, G_PART_ALIAS_FREEBSD_UFS, 0 }, { &gpt_uuid_freebsd_vinum, G_PART_ALIAS_FREEBSD_VINUM, 0 }, Modified: head/sys/geom/part/g_part_vtoc8.c ============================================================================== --- head/sys/geom/part/g_part_vtoc8.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part_vtoc8.c Fri May 25 20:33:34 2012 (r236023) @@ -114,6 +114,11 @@ vtoc8_parse_type(const char *type, uint1 *tag = (uint16_t)lt; return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + *tag = VTOC_TAG_FREEBSD_NANDFS; + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { *tag = VTOC_TAG_FREEBSD_SWAP; @@ -487,6 +492,8 @@ g_part_vtoc8_type(struct g_part_table *b table = (struct g_part_vtoc8_table *)basetable; tag = be16dec(&table->vtoc.part[entry->gpe_index - 1].tag); + if (tag == VTOC_TAG_FREEBSD_NANDFS) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (tag == VTOC_TAG_FREEBSD_SWAP) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (tag == VTOC_TAG_FREEBSD_UFS) Modified: head/sys/sys/apm.h ============================================================================== --- head/sys/sys/apm.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/sys/apm.h Fri May 25 20:33:34 2012 (r236023) @@ -56,6 +56,7 @@ struct apm_ent { #define APM_ENT_TYPE_UNUSED "Apple_Free" #define APM_ENT_TYPE_FREEBSD "FreeBSD" +#define APM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs" #define APM_ENT_TYPE_FREEBSD_SWAP "FreeBSD-swap" #define APM_ENT_TYPE_FREEBSD_UFS "FreeBSD-UFS" #define APM_ENT_TYPE_FREEBSD_VINUM "FreeBSD-Vinum" Modified: head/sys/sys/disklabel.h ============================================================================== --- head/sys/sys/disklabel.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/sys/disklabel.h Fri May 25 20:33:34 2012 (r236023) @@ -232,6 +232,7 @@ static const char *dktypenames[] = { #define FS_UDF 24 /* UDF */ #define FS_EFS 26 /* SGI's Extent File system */ #define FS_ZFS 27 /* Sun's ZFS */ +#define FS_NANDFS 30 /* FreeBSD nandfs (NiLFS derived) */ #ifdef FSTYPENAMES static const char *fstypenames[] = { @@ -263,6 +264,9 @@ static const char *fstypenames[] = { "?", "EFS", "ZFS", + "?", + "?", + "nandfs", NULL }; #define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1) Modified: head/sys/sys/gpt.h ============================================================================== --- head/sys/sys/gpt.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/sys/gpt.h Fri May 25 20:33:34 2012 (r236023) @@ -79,6 +79,10 @@ struct gpt_ent { {0x024dee41,0x33e7,0x11d3,0x9d,0x69,{0x00,0x08,0xc7,0x81,0xf3,0x9f}} #define GPT_ENT_TYPE_FREEBSD \ {0x516e7cb4,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} +#define GPT_ENT_TYPE_FREEBSD_BOOT \ + {0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}} +#define GPT_ENT_TYPE_FREEBSD_NANDFS \ + {0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}} #define GPT_ENT_TYPE_FREEBSD_SWAP \ {0x516e7cb5,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} #define GPT_ENT_TYPE_FREEBSD_UFS \ @@ -87,8 +91,6 @@ struct gpt_ent { {0x516e7cb8,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} #define GPT_ENT_TYPE_FREEBSD_ZFS \ {0x516e7cba,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} -#define GPT_ENT_TYPE_FREEBSD_BOOT \ - {0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}} /* * The following are unused but documented here to avoid reuse. Modified: head/sys/sys/vtoc.h ============================================================================== --- head/sys/sys/vtoc.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/sys/vtoc.h Fri May 25 20:33:34 2012 (r236023) @@ -51,6 +51,7 @@ #define VTOC_TAG_FREEBSD_UFS 0x0902 #define VTOC_TAG_FREEBSD_VINUM 0x0903 #define VTOC_TAG_FREEBSD_ZFS 0x0904 +#define VTOC_TAG_FREEBSD_NANDFS 0x0905 #define VTOC_FLAG_UNMNT 0x01 /* unmountable partition */ #define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ From owner-svn-src-head@FreeBSD.ORG Fri May 25 20:43:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F696106564A; Fri, 25 May 2012 20:43:39 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49ADF8FC08; Fri, 25 May 2012 20:43:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PKhd10032253; Fri, 25 May 2012 20:43:39 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PKhdpQ032250; Fri, 25 May 2012 20:43:39 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205252043.q4PKhdpQ032250@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 25 May 2012 20:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236024 - head/sys/boot/fdt/dts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 20:43:39 -0000 Author: raj Date: Fri May 25 20:43:38 2012 New Revision: 236024 URL: http://svn.freebsd.org/changeset/base/236024 Log: Import DTS files for the upcoming DPAA QorIQ (PowerPC) support. - P2041RDB - P3041DS - P5020DS Obtained from: Freescale Added: head/sys/boot/fdt/dts/p2041rdb.dts (contents, props changed) head/sys/boot/fdt/dts/p2041si.dtsi (contents, props changed) head/sys/boot/fdt/dts/p3041si.dtsi (contents, props changed) head/sys/boot/fdt/dts/p5020ds.dts (contents, props changed) head/sys/boot/fdt/dts/p5020si.dtsi (contents, props changed) Modified: head/sys/boot/fdt/dts/p3041ds.dts Added: head/sys/boot/fdt/dts/p2041rdb.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/p2041rdb.dts Fri May 25 20:43:38 2012 (r236024) @@ -0,0 +1,490 @@ +/* + * P2041RDB Device Tree Source + * + * Copyright 2011 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* $FreeBSD$ */ + +/include/ "p2041si.dtsi" + +/ { + model = "fsl,P2041RDB"; + compatible = "fsl,P2041RDB"; + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&mpic>; + + aliases { + phy_rgmii_0 = &phy_rgmii_0; + phy_rgmii_1 = &phy_rgmii_1; + phy_sgmii_2 = &phy_sgmii_2; + phy_sgmii_3 = &phy_sgmii_3; + phy_sgmii_4 = &phy_sgmii_4; + phy_sgmii_1c = &phy_sgmii_1c; + phy_sgmii_1d = &phy_sgmii_1d; + phy_sgmii_1e = &phy_sgmii_1e; + phy_sgmii_1f = &phy_sgmii_1f; + phy_xgmii_2 = &phy_xgmii_2; + }; + + memory { + device_type = "memory"; + reg = <0x00000000 0x00000000 0x00000000 0x80000000>; + }; + + dcsr: dcsr@f00000000 { + ranges = <0x00000000 0xf 0x00000000 0x01008000>; + }; + + bman-portals@ff4000000 { + bman-portal@0 { + cpu-handle = <&cpu0>; + }; + bman-portal@4000 { + cpu-handle = <&cpu1>; + }; + bman-portal@8000 { + cpu-handle = <&cpu2>; + }; + bman-portal@c000 { + cpu-handle = <&cpu3>; + }; + bman-portal@10000 { + }; + bman-portal@14000 { + }; + bman-portal@18000 { + }; + bman-portal@1c000 { + }; + bman-portal@20000 { + }; + bman-portal@24000 { + }; + + buffer-pool@0 { + compatible = "fsl,p2041-bpool", "fsl,bpool"; + fsl,bpid = <0>; + fsl,bpool-cfg = <0 0x100 0 1 0 0x100>; + }; + }; + + qman-portals@ff4200000 { + qportal0: qman-portal@0 { + cpu-handle = <&cpu0>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal1: qman-portal@4000 { + cpu-handle = <&cpu1>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal2: qman-portal@8000 { + cpu-handle = <&cpu2>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal3: qman-portal@c000 { + cpu-handle = <&cpu3>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal4: qman-portal@10000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal5: qman-portal@14000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal6: qman-portal@18000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal7: qman-portal@1c000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal8: qman-portal@20000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal9: qman-portal@24000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + }; + + soc: soc@ffe000000 { + spi@110000 { + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spansion,s25sl12801"; + reg = <0>; + spi-max-frequency = <40000000>; /* input clock */ + partition@u-boot { + label = "u-boot"; + reg = <0x00000000 0x00100000>; + read-only; + }; + partition@kernel { + label = "kernel"; + reg = <0x00100000 0x00500000>; + read-only; + }; + partition@dtb { + label = "dtb"; + reg = <0x00600000 0x00100000>; + read-only; + }; + partition@fs { + label = "file system"; + reg = <0x00700000 0x00900000>; + }; + }; + }; + + i2c@118000 { + lm75b@48 { + compatible = "nxp,lm75a"; + reg = <0x48>; + }; + eeprom@50 { + compatible = "at24,24c256"; + reg = <0x50>; + }; + rtc@68 { + compatible = "pericom,pt7c4338"; + reg = <0x68>; + }; + }; + + i2c@118100 { + eeprom@50 { + compatible = "at24,24c256"; + reg = <0x50>; + }; + }; + + usb1: usb@211000 { + dr_mode = "host"; + }; + + pme: pme@316000 { + /* Commented out, use default allocation */ + /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ + /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ + }; + + qman: qman@318000 { + /* Commented out, use default allocation */ + /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ + /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ + }; + + bman: bman@31a000 { + /* Same as fsl,qman-*, use default allocation */ + /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ + }; + + fman0: fman@400000 { + enet0: ethernet@e0000 { + tbi-handle = <&tbi0>; + phy-handle = <&phy_sgmii_2>; + phy-connection-type = "sgmii"; + }; + + mdio0: mdio@e1120 { + tbi0: tbi-phy@8 { + reg = <0x8>; + device_type = "tbi-phy"; + }; + + phy_rgmii_0: ethernet-phy@0 { + reg = <0x0>; + }; + phy_rgmii_1: ethernet-phy@1 { + reg = <0x1>; + }; + phy_sgmii_2: ethernet-phy@2 { + reg = <0x2>; + }; + phy_sgmii_3: ethernet-phy@3 { + reg = <0x3>; + }; + phy_sgmii_4: ethernet-phy@4 { + reg = <0x4>; + }; + phy_sgmii_1c: ethernet-phy@1c { + reg = <0x1c>; + }; + phy_sgmii_1d: ethernet-phy@1d { + reg = <0x1d>; + }; + phy_sgmii_1e: ethernet-phy@1e { + reg = <0x1e>; + }; + phy_sgmii_1f: ethernet-phy@1f { + reg = <0x1f>; + }; + }; + + enet1: ethernet@e2000 { + tbi-handle = <&tbi1>; + phy-handle = <&phy_sgmii_3>; + phy-connection-type = "sgmii"; + }; + + mdio@e3120 { + tbi1: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet2: ethernet@e4000 { + tbi-handle = <&tbi2>; + phy-handle = <&phy_sgmii_4>; + phy-connection-type = "sgmii"; + }; + + mdio@e5120 { + tbi2: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet3: ethernet@e6000 { + tbi-handle = <&tbi3>; + phy-handle = <&phy_rgmii_1>; + phy-connection-type = "rgmii"; + }; + + mdio@e7120 { + tbi3: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet4: ethernet@e8000 { + tbi-handle = <&tbi4>; + phy-handle = <&phy_rgmii_0>; + phy-connection-type = "rgmii"; + }; + + mdio@e9120 { + tbi4: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet5: ethernet@f0000 { + /* + * phy-handle will be updated by U-Boot to + * reflect the actual slot the XAUI card is in. + */ + phy-handle = <&phy_xgmii_2>; + phy-connection-type = "xgmii"; + }; + + mdio@f1000 { + /* XAUI card in slot 2 */ + phy_xgmii_2: ethernet-phy@0 { + reg = <0x0>; + }; + }; + }; + }; + + rapidio@ffe0c0000 { + reg = <0xf 0xfe0c0000 0 0x11000>; + + port1 { + ranges = <0 0 0xc 0x20000000 0 0x10000000>; + }; + port2 { + ranges = <0 0 0xc 0x30000000 0 0x10000000>; + }; + }; + + localbus@ffe124000 { + reg = <0xf 0xfe124000 0 0x1000>; + ranges = <0 0 0xf 0xb8000000 0x04000000>; + + flash@0,0 { + compatible = "cfi-flash"; + /* + * Map 64Mb of 128MB NOR flash memory. Since highest + * line of address of NOR flash memory are set by + * FPGA, memory are divided into two pages equal to + * 64MB. One of the pages can be accessed at once. + */ + reg = <0 0 0x04000000>; + bank-width = <2>; + device-width = <2>; + }; + }; + + pci0: pcie@ffe200000 { + reg = <0xf 0xfe200000 0 0x1000>; + ranges = <0x02000000 0 0x80000000 0x0 0x80000000 0x0 0x10000000 + 0x01000000 0 0x00000000 0x0 0xff000000 0x0 0x00010000>; + pcie@0 { + ranges = <0x02000000 0 0x80000000 + 0x02000000 0 0x80000000 + 0 0x10000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0xff000000 + 0 0x00010000>; + }; + }; + + pci1: pcie@ffe201000 { + reg = <0xf 0xfe201000 0 0x1000>; + ranges = <0x02000000 0x0 0x90000000 0x0 0x90000000 0x0 0x10000000 + 0x01000000 0x0 0x00000000 0x0 0xff010000 0x0 0x00010000>; + pcie@0 { + ranges = <0x02000000 0 0x90000000 + 0x02000000 0 0x90000000 + 0 0x10000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0xff010000 + 0 0x00010000>; + }; + }; + + pci2: pcie@ffe202000 { + reg = <0xf 0xfe202000 0 0x1000>; + ranges = <0x02000000 0 0xa0000000 0x0 0xa0000000 0 0x10000000 + 0x01000000 0 0x00000000 0x0 0xff020000 0 0x00010000>; + pcie@0 { + ranges = <0x02000000 0 0xa0000000 + 0x02000000 0 0xa0000000 + 0 0x10000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0xff020000 + 0 0x00010000>; + }; + }; + + fsl,dpaa { + compatible = "fsl,p2041-dpaa", "fsl,dpaa"; + + ethernet@0 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet0>; + status = "okay"; + }; + ethernet@1 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet1>; + status = "okay"; + }; + ethernet@2 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet2>; + status = "okay"; + }; + ethernet@3 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet3>; + status = "okay"; + }; + ethernet@4 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet4>; + status = "okay"; + }; + ethernet@5 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet5>; + status = "okay"; + }; + }; + + chosen { + stdin = "serial0"; + stdout = "serial0"; + }; +}; Added: head/sys/boot/fdt/dts/p2041si.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/p2041si.dtsi Fri May 25 20:43:38 2012 (r236024) @@ -0,0 +1,1296 @@ +/* + * P2041 Silicon Device Tree Source + * + * Copyright 2011 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* $FreeBSD$ */ + +/dts-v1/; + +/ { + compatible = "fsl,P2041"; + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&mpic>; + + aliases { + ccsr = &soc; + dcsr = &dcsr; + + ethernet0 = &enet0; + ethernet1 = &enet1; + ethernet2 = &enet2; + ethernet3 = &enet3; + ethernet4 = &enet4; + ethernet5 = &enet5; + serial0 = &serial0; + serial1 = &serial1; + serial2 = &serial2; + serial3 = &serial3; + pci0 = &pci0; + pci1 = &pci1; + pci2 = &pci2; + usb0 = &usb0; + usb1 = &usb1; + dma0 = &dma0; + dma1 = &dma1; + bman = &bman; + qman = &qman; + pme = &pme; + rman = &rman; + sdhc = &sdhc; + msi0 = &msi0; + msi1 = &msi1; + msi2 = &msi2; + + crypto = &crypto; + sec_jr0 = &sec_jr0; + sec_jr1 = &sec_jr1; + sec_jr2 = &sec_jr2; + sec_jr3 = &sec_jr3; + rtic_a = &rtic_a; + rtic_b = &rtic_b; + rtic_c = &rtic_c; + rtic_d = &rtic_d; + sec_mon = &sec_mon; + + fman0 = &fman0; + fman0_oh0 = &fman0_oh0; + fman0_oh1 = &fman0_oh1; + fman0_oh2 = &fman0_oh2; + fman0_oh3 = &fman0_oh3; + fman0_oh4 = &fman0_oh4; + fman0_oh5 = &fman0_oh5; + fman0_oh6 = &fman0_oh6; + fman0_rx0 = &fman0_rx0; + fman0_rx1 = &fman0_rx1; + fman0_rx2 = &fman0_rx2; + fman0_rx3 = &fman0_rx3; + fman0_rx4 = &fman0_rx4; + fman0_rx5 = &fman0_rx5; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu0: PowerPC,e500mc@0 { + device_type = "cpu"; + reg = <0>; + bus-frequency = <749999996>; + next-level-cache = <&L2_0>; + L2_0: l2-cache { + next-level-cache = <&cpc>; + }; + }; + cpu1: PowerPC,e500mc@1 { + device_type = "cpu"; + reg = <1>; + next-level-cache = <&L2_1>; + L2_1: l2-cache { + next-level-cache = <&cpc>; + }; + }; + cpu2: PowerPC,e500mc@2 { + device_type = "cpu"; + reg = <2>; + next-level-cache = <&L2_2>; + L2_2: l2-cache { + next-level-cache = <&cpc>; + }; + }; + cpu3: PowerPC,e500mc@3 { + device_type = "cpu"; + reg = <3>; + next-level-cache = <&L2_3>; + L2_3: l2-cache { + next-level-cache = <&cpc>; + }; + }; + }; + + dcsr: dcsr@f00000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,dcsr", "simple-bus"; + + dcsr-epu@0 { + compatible = "fsl,dcsr-epu"; + interrupts = <52 2 0 0 + 84 2 0 0 + 85 2 0 0>; + interrupt-parent = <&mpic>; + reg = <0x0 0x1000>; + }; + dcsr-npc { + compatible = "fsl,dcsr-npc"; + reg = <0x1000 0x1000 0x1000000 0x8000>; + }; + dcsr-nxc@2000 { + compatible = "fsl,dcsr-nxc"; + reg = <0x2000 0x1000>; + }; + dcsr-corenet { + compatible = "fsl,dcsr-corenet"; + reg = <0x8000 0x1000 0xB0000 0x1000>; + }; + dcsr-dpaa@9000 { + compatible = "fsl,p2041-dcsr-dpaa", "fsl,dcsr-dpaa"; + reg = <0x9000 0x1000>; + }; + dcsr-ocn@11000 { + compatible = "fsl,p2041-dcsr-ocn", "fsl,dcsr-ocn"; + reg = <0x11000 0x1000>; + }; + dcsr-ddr@12000 { + compatible = "fsl,dcsr-ddr"; + dev-handle = <&ddr>; + reg = <0x12000 0x1000>; + }; + dcsr-nal@18000 { + compatible = "fsl,p2041-dcsr-nal", "fsl,dcsr-nal"; + reg = <0x18000 0x1000>; + }; + dcsr-rcpm@22000 { + compatible = "fsl,p2041-dcsr-rcpm", "fsl,dcsr-rcpm"; + reg = <0x22000 0x1000>; + }; + dcsr-cpu-sb-proxy@40000 { + compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; + cpu-handle = <&cpu0>; + reg = <0x40000 0x1000>; + }; + dcsr-cpu-sb-proxy@41000 { + compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; + cpu-handle = <&cpu1>; + reg = <0x41000 0x1000>; + }; + dcsr-cpu-sb-proxy@42000 { + compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; + cpu-handle = <&cpu2>; + reg = <0x42000 0x1000>; + }; + dcsr-cpu-sb-proxy@43000 { + compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; + cpu-handle = <&cpu3>; + reg = <0x43000 0x1000>; + }; + }; + + bman-portals@ff4000000 { + #address-cells = <0x1>; + #size-cells = <0x1>; + compatible = "bman-portals"; + ranges = <0x0 0xf 0xfde00000 0x200000>; + bman-portal@0 { + cell-index = <0x0>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x0 0x4000 0x100000 0x1000>; + interrupts = <105 2 0 0>; + }; + bman-portal@4000 { + cell-index = <0x1>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x4000 0x4000 0x101000 0x1000>; + interrupts = <107 2 0 0>; + }; + bman-portal@8000 { + cell-index = <2>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x8000 0x4000 0x102000 0x1000>; + interrupts = <109 2 0 0>; + }; + bman-portal@c000 { + cell-index = <0x3>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0xc000 0x4000 0x103000 0x1000>; + interrupts = <111 2 0 0>; + }; + bman-portal@10000 { + cell-index = <0x4>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x10000 0x4000 0x104000 0x1000>; + interrupts = <113 2 0 0>; + }; + bman-portal@14000 { + cell-index = <0x5>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x14000 0x4000 0x105000 0x1000>; + interrupts = <115 2 0 0>; + }; + bman-portal@18000 { + cell-index = <0x6>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x18000 0x4000 0x106000 0x1000>; + interrupts = <117 2 0 0>; + }; + bman-portal@1c000 { + cell-index = <0x7>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x1c000 0x4000 0x107000 0x1000>; + interrupts = <119 2 0 0>; + }; + bman-portal@20000 { + cell-index = <0x8>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x20000 0x4000 0x108000 0x1000>; + interrupts = <121 2 0 0>; + }; + bman-portal@24000 { + cell-index = <0x9>; + compatible = "fsl,p2041-bman-portal", "fsl,bman-portal"; + reg = <0x24000 0x4000 0x109000 0x1000>; + interrupts = <123 2 0 0>; + }; + + buffer-pool@0 { + compatible = "fsl,p2041-bpool", "fsl,bpool"; + fsl,bpid = <0>; + fsl,bpool-cfg = <0 0x100 0 1 0 0x100>; + }; + }; + + qman-portals@ff4200000 { + #address-cells = <0x1>; + #size-cells = <0x1>; + compatible = "qman-portals"; + ranges = <0x0 0xf 0xfdc00000 0x200000>; + qportal0: qman-portal@0 { + cell-index = <0x0>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x0 0x4000 0x100000 0x1000>; + interrupts = <104 0x2 0 0>; + fsl,qman-channel-id = <0x0>; + }; + + qportal1: qman-portal@4000 { + cell-index = <0x1>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x4000 0x4000 0x101000 0x1000>; + interrupts = <106 0x2 0 0>; + fsl,qman-channel-id = <0x1>; + }; + + qportal2: qman-portal@8000 { + cell-index = <0x2>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x8000 0x4000 0x102000 0x1000>; + interrupts = <108 0x2 0 0>; + fsl,qman-channel-id = <0x2>; + }; + + qportal3: qman-portal@c000 { + cell-index = <0x3>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0xc000 0x4000 0x103000 0x1000>; + interrupts = <110 0x2 0 0>; + fsl,qman-channel-id = <0x3>; + }; + + qportal4: qman-portal@10000 { + cell-index = <0x4>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x10000 0x4000 0x104000 0x1000>; + interrupts = <112 0x2 0 0>; + fsl,qman-channel-id = <0x4>; + }; + + qportal5: qman-portal@14000 { + cell-index = <0x5>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x14000 0x4000 0x105000 0x1000>; + interrupts = <114 0x2 0 0>; + fsl,qman-channel-id = <0x5>; + }; + + qportal6: qman-portal@18000 { + cell-index = <0x6>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x18000 0x4000 0x106000 0x1000>; + interrupts = <116 0x2 0 0>; + fsl,qman-channel-id = <0x6>; + }; + + qportal7: qman-portal@1c000 { + cell-index = <0x7>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x1c000 0x4000 0x107000 0x1000>; + interrupts = <118 0x2 0 0>; + fsl,qman-channel-id = <0x7>; + }; + + qportal8: qman-portal@20000 { + cell-index = <0x8>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x20000 0x4000 0x108000 0x1000>; + interrupts = <120 0x2 0 0>; + fsl,qman-channel-id = <0x8>; + }; + + qportal9: qman-portal@24000 { + cell-index = <0x9>; + compatible = "fsl,p2041-qman-portal", "fsl,qman-portal"; + reg = <0x24000 0x4000 0x109000 0x1000>; + interrupts = <122 0x2 0 0>; + fsl,qman-channel-id = <0x9>; + }; + + qpool1: qman-pool@1 { + cell-index = <1>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x21>; + }; + + qpool2: qman-pool@2 { + cell-index = <2>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x22>; + }; + + qpool3: qman-pool@3 { + cell-index = <3>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x23>; + }; + + qpool4: qman-pool@4 { + cell-index = <4>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x24>; + }; + + qpool5: qman-pool@5 { + cell-index = <5>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x25>; + }; + + qpool6: qman-pool@6 { + cell-index = <6>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x26>; + }; + + qpool7: qman-pool@7 { + cell-index = <7>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x27>; + }; + + qpool8: qman-pool@8 { + cell-index = <8>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x28>; + }; + + qpool9: qman-pool@9 { + cell-index = <9>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x29>; + }; + + qpool10: qman-pool@10 { + cell-index = <10>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x2a>; + }; + + qpool11: qman-pool@11 { + cell-index = <11>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x2b>; + }; + + qpool12: qman-pool@12 { + cell-index = <12>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x2c>; + }; + + qpool13: qman-pool@13 { + cell-index = <13>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x2d>; + }; + + qpool14: qman-pool@14 { + cell-index = <14>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x2e>; + }; + + qpool15: qman-pool@15 { + cell-index = <15>; + compatible = "fsl,p2041-qman-pool-channel", "fsl,qman-pool-channel"; + fsl,qman-channel-id = <0x2f>; + }; + }; + + soc: soc@ffe000000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + compatible = "simple-bus"; + + bus-frequency = <0>; // Filled out by kernel. + + ranges = <0x00000000 0xf 0xfe000000 0x1000000>; + reg = <0xf 0xfe000000 0 0x00001000>; + + soc-sram-error { + compatible = "fsl,soc-sram-error"; + interrupts = <16 2 1 29>; + }; + + corenet-law@0 { + compatible = "fsl,corenet-law"; + reg = <0x0 0x1000>; + fsl,num-laws = <32>; + }; + + ddr: memory-controller@8000 { + compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller"; + reg = <0x8000 0x1000>; + interrupts = <16 2 1 23>; + }; + + cpc: l3-cache-controller@10000 { + compatible = "fsl,p2041-l3-cache-controller", "fsl,p4080-l3-cache-controller", "cache"; + reg = <0x10000 0x1000>; + interrupts = <16 2 1 27>; + }; + + corenet-cf@18000 { + compatible = "fsl,corenet-cf"; + reg = <0x18000 0x1000>; + interrupts = <16 2 1 31>; + fsl,ccf-num-csdids = <32>; + fsl,ccf-num-snoopids = <32>; + }; + + iommu@20000 { + compatible = "fsl,pamu-v1.0", "fsl,pamu"; + reg = <0x20000 0x4000>; + interrupts = < + 24 2 0 0 + 16 2 1 30>; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 25 21:12:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8456F106566C; Fri, 25 May 2012 21:12:25 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55C3B8FC17; Fri, 25 May 2012 21:12:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PLCPr6033435; Fri, 25 May 2012 21:12:25 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PLCPV5033433; Fri, 25 May 2012 21:12:25 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205252112.q4PLCPV5033433@svn.freebsd.org> From: Rafal Jaworowski Date: Fri, 25 May 2012 21:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236025 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 21:12:25 -0000 Author: raj Date: Fri May 25 21:12:24 2012 New Revision: 236025 URL: http://svn.freebsd.org/changeset/base/236025 Log: Update HID defines for E500mc and E5500 CPU cores. Obtained from: Freescale, Semihalf Modified: head/sys/powerpc/include/hid.h Modified: head/sys/powerpc/include/hid.h ============================================================================== --- head/sys/powerpc/include/hid.h Fri May 25 20:43:38 2012 (r236024) +++ head/sys/powerpc/include/hid.h Fri May 25 21:12:24 2012 (r236025) @@ -78,6 +78,8 @@ #define HID0_E500_SEL_TBCLK 0x00002000 /* Select Time Base clock */ #define HID0_E500_MAS7UPDEN 0x00000080 /* Enable MAS7 update (e500v2) */ +#define HID0_E500MC_L2MMU_MHD 0x40000000 /* L2MMU Multiple Hit Detection */ + #define HID0_BITMASK \ "\20" \ "\040EMCP\037DBP\036EBA\035EBD\034BCLK\033EICE\032ECLK\031PAR" \ @@ -105,6 +107,20 @@ "\027NAP\025DPM\023TG\022HANGDETECT\021NHR\020INORDER" \ "\016TBCTRL\015TBEN\012CIABREN\011HDICEEN\001ENATTN" +#define HID0_E500MC_BITMASK \ + "\20" \ + "\040EMCP\037EN_L2MMU_MHD\036b2\035b3\034b4\033b5\032b6\031b7" \ + "\030b8\027b9\026b10\025b11\024b12\023b13\022b14\021b15" \ + "\020b16\017b17\016b18\015b19\014b20\013b21\012b22\011b23" \ + "\010EN_MAS7_UPDATE\007DCFA\006b26\005CIGLSO\004b28\003b29\002b30\001NOPTI" + +#define HID0_E5500_BITMASK \ + "\20" \ + "\040EMCP\037EN_L2MMU_MHD\036b2\035b3\034b4\033b5\032b6\031b7" \ + "\030b8\027b9\026b10\025b11\024b12\023b13\022b14\021b15" \ + "\020b16\017b17\016b18\015b19\014b20\013b21\012b22\011b23" \ + "\010b24\007DCFA\006b26\005CIGLSO\004b28\003b29\002b30\001NOPTI" + /* * HID0 bit definitions per cpu model * @@ -142,6 +158,40 @@ * 30 - - - NOPDST NOPDST NOPDST NOPDST - * 31 NOOPTI - NOOPTI NOPTI NOPTI NOPTI NOPTI NOPTI * + * bit e500mc e5500 + * 0 EMCP EMCP + * 1 EN_L2MMU_MHD EN_L2MMU_MHD + * 2 - - + * 3 - - + * 4 - - + * 5 - - + * 6 - - + * 7 - - + * 8 - - + * 9 - - + * 10 - - + * 11 - - + * 12 - - + * 13 - - + * 14 - - + * 15 - - + * 16 - - + * 17 - - + * 18 - - + * 19 - - + * 20 - - + * 21 - - + * 22 - - + * 23 - - + * 24 EN_MAS7_UPDATE - + * 25 DCFA DCFA + * 26 - - + * 27 CIGLSO CIGLSO + * 28 - - + * 29 - - + * 30 - - + * 31 NOPTI NOPTI + * * 604: ECP = Enable cache parity checking * 604: SIE = Serial instruction execution disable * 7450: TBEN = Time Base Enable @@ -160,6 +210,9 @@ #define HID0_E500_DEFAULT_SET (HID0_EMCP | HID0_E500_TBEN) #define HID1_E500_DEFAULT_SET (HID1_E500_ABE | HID1_E500_ASTME) +#define HID0_E500MC_DEFAULT_SET (HID0_EMCP | HID0_E500MC_L2MMU_MHD | \ + HID0_E500_MAS7UPDEN) +#define HID0_E5500_DEFAULT_SET (HID0_EMCP | HID0_E500MC_L2MMU_MHD) #define HID5_970_DCBZ_SIZE_HI 0x00000080UL /* dcbz does a 32-byte store */ #define HID4_970_DISABLE_LG_PG 0x00000004ULL /* disables large pages */ From owner-svn-src-head@FreeBSD.ORG Fri May 25 21:50:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4EAC8106566B; Fri, 25 May 2012 21:50:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37E9C8FC08; Fri, 25 May 2012 21:50:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PLon0o035068; Fri, 25 May 2012 21:50:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PLomFk035064; Fri, 25 May 2012 21:50:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201205252150.q4PLomFk035064@svn.freebsd.org> From: Ed Schouten Date: Fri, 25 May 2012 21:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 21:50:49 -0000 Author: ed Date: Fri May 25 21:50:48 2012 New Revision: 236026 URL: http://svn.freebsd.org/changeset/base/236026 Log: Remove use of non-ISO-C integer types from system call tables. These files already use ISO-C-style integer types, so make them less inconsistent by preferring the standard types. Modified: head/sys/amd64/linux32/syscalls.master head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Fri May 25 21:12:24 2012 (r236025) +++ head/sys/amd64/linux32/syscalls.master Fri May 25 21:50:48 2012 (r236026) @@ -54,8 +54,8 @@ l_int mode); } 9 AUE_LINK STD { int linux_link(char *path, char *to); } 10 AUE_UNLINK STD { int linux_unlink(char *path); } -11 AUE_EXECVE STD { int linux_execve(char *path, u_int32_t *argp, \ - u_int32_t *envp); } +11 AUE_EXECVE STD { int linux_execve(char *path, uint32_t *argp, \ + uint32_t *envp); } 12 AUE_CHDIR STD { int linux_chdir(char *path); } 13 AUE_NULL STD { int linux_time(l_time_t *tm); } 14 AUE_MKNOD STD { int linux_mknod(char *path, l_int mode, \ Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Fri May 25 21:12:24 2012 (r236025) +++ head/sys/compat/freebsd32/syscalls.master Fri May 25 21:50:48 2012 (r236026) @@ -104,9 +104,9 @@ int flags); } 28 AUE_SENDMSG STD { int freebsd32_sendmsg(int s, struct msghdr32 *msg, \ int flags); } -29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, u_int32_t buf, \ - u_int32_t len, int flags, u_int32_t from, \ - u_int32_t fromlenaddr); } +29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, uint32_t buf, \ + uint32_t len, int flags, uint32_t from, \ + uint32_t fromlenaddr); } 30 AUE_ACCEPT NOPROTO { int accept(int s, caddr_t name, \ int *anamelen); } 31 AUE_GETPEERNAME NOPROTO { int getpeername(int fdes, caddr_t asa, \ @@ -152,7 +152,7 @@ 58 AUE_READLINK NOPROTO { ssize_t readlink(char *path, char *buf, \ size_t count); } 59 AUE_EXECVE STD { int freebsd32_execve(char *fname, \ - u_int32_t *argv, u_int32_t *envv); } + uint32_t *argv, uint32_t *envv); } 60 AUE_UMASK NOPROTO { int umask(int newmask); } umask \ umask_args int 61 AUE_CHROOT NOPROTO { int chroot(char *path); } @@ -325,10 +325,10 @@ 172 AUE_NULL UNIMPL nosys 173 AUE_PREAD COMPAT6 { ssize_t freebsd32_pread(int fd, void *buf, \ size_t nbyte, int pad, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 174 AUE_PWRITE COMPAT6 { ssize_t freebsd32_pwrite(int fd, \ const void *buf, size_t nbyte, int pad, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 175 AUE_NULL UNIMPL nosys 176 AUE_NTP_ADJTIME NOPROTO { int ntp_adjtime(struct timex *tp); } 177 AUE_NULL UNIMPL sfork (BSD/OS 2.x) @@ -363,21 +363,21 @@ char *buf, u_int count, int32_t *basep); } 197 AUE_MMAP COMPAT6 { caddr_t freebsd32_mmap(caddr_t addr, \ size_t len, int prot, int flags, int fd, \ - int pad, u_int32_t pos1, u_int32_t pos2); } + int pad, uint32_t pos1, uint32_t pos2); } 198 AUE_NULL NOPROTO { int nosys(void); } __syscall \ __syscall_args int 199 AUE_LSEEK COMPAT6 { off_t freebsd32_lseek(int fd, int pad, \ - u_int32_t offset1, u_int32_t offset2, \ + uint32_t offset1, uint32_t offset2, \ int whence); } 200 AUE_TRUNCATE COMPAT6 { int freebsd32_truncate(char *path, \ - int pad, u_int32_t length1, \ - u_int32_t length2); } + int pad, uint32_t length1, \ + uint32_t length2); } 201 AUE_FTRUNCATE COMPAT6 { int freebsd32_ftruncate(int fd, int pad, \ - u_int32_t length1, u_int32_t length2); } + uint32_t length1, uint32_t length2); } 202 AUE_SYSCTL STD { int freebsd32_sysctl(int *name, \ u_int namelen, void *old, \ - u_int32_t *oldlenp, void *new, \ - u_int32_t newlen); } + uint32_t *oldlenp, void *new, \ + uint32_t newlen); } 203 AUE_MLOCK NOPROTO { int mlock(const void *addr, \ size_t len); } 204 AUE_MUNLOCK NOPROTO { int munlock(const void *addr, \ @@ -513,11 +513,11 @@ 289 AUE_PREADV STD { ssize_t freebsd32_preadv(int fd, \ struct iovec32 *iovp, \ u_int iovcnt, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 290 AUE_PWRITEV STD { ssize_t freebsd32_pwritev(int fd, \ struct iovec32 *iovp, \ u_int iovcnt, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 291 AUE_NULL UNIMPL nosys 292 AUE_NULL UNIMPL nosys 293 AUE_NULL UNIMPL nosys @@ -591,7 +591,7 @@ struct timespec *interval); } 335 AUE_NULL NOPROTO { int utrace(const void *addr, size_t len); } 336 AUE_SENDFILE COMPAT4 { int freebsd32_sendfile(int fd, int s, \ - u_int32_t offset1, u_int32_t offset2, \ + uint32_t offset1, uint32_t offset2, \ size_t nbytes, struct sf_hdtr32 *hdtr, \ off_t *sbytes, int flags); } 337 AUE_NULL NOPROTO { int kldsym(int fileid, int cmd, \ @@ -694,7 +694,7 @@ 392 AUE_NULL NOPROTO { int uuidgen(struct uuid *store, \ int count); } 393 AUE_SENDFILE STD { int freebsd32_sendfile(int fd, int s, \ - u_int32_t offset1, u_int32_t offset2, \ + uint32_t offset1, uint32_t offset2, \ size_t nbytes, struct sf_hdtr32 *hdtr, \ off_t *sbytes, int flags); } 394 AUE_NULL UNIMPL mac_syscall @@ -847,42 +847,42 @@ 475 AUE_PREAD STD { ssize_t freebsd32_pread(int fd, \ void *buf,size_t nbyte, \ int pad, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 476 AUE_PWRITE STD { ssize_t freebsd32_pwrite(int fd, \ const void *buf, size_t nbyte, \ int pad, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 477 AUE_MMAP STD { caddr_t freebsd32_mmap(caddr_t addr, \ size_t len, int prot, int flags, int fd, \ int pad, \ - u_int32_t pos1, u_int32_t pos2); } + uint32_t pos1, uint32_t pos2); } 478 AUE_LSEEK STD { off_t freebsd32_lseek(int fd, \ int pad, \ - u_int32_t offset1, u_int32_t offset2, \ + uint32_t offset1, uint32_t offset2, \ int whence); } 479 AUE_TRUNCATE STD { int freebsd32_truncate(char *path, \ int pad, \ - u_int32_t length1, u_int32_t length2); } + uint32_t length1, uint32_t length2); } 480 AUE_FTRUNCATE STD { int freebsd32_ftruncate(int fd, \ int pad, \ - u_int32_t length1, u_int32_t length2); } + uint32_t length1, uint32_t length2); } #else 475 AUE_PREAD STD { ssize_t freebsd32_pread(int fd, \ void *buf,size_t nbyte, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 476 AUE_PWRITE STD { ssize_t freebsd32_pwrite(int fd, \ const void *buf, size_t nbyte, \ - u_int32_t offset1, u_int32_t offset2); } + uint32_t offset1, uint32_t offset2); } 477 AUE_MMAP STD { caddr_t freebsd32_mmap(caddr_t addr, \ size_t len, int prot, int flags, int fd, \ - u_int32_t pos1, u_int32_t pos2); } + uint32_t pos1, uint32_t pos2); } 478 AUE_LSEEK STD { off_t freebsd32_lseek(int fd, \ - u_int32_t offset1, u_int32_t offset2, \ + uint32_t offset1, uint32_t offset2, \ int whence); } 479 AUE_TRUNCATE STD { int freebsd32_truncate(char *path, \ - u_int32_t length1, u_int32_t length2); } + uint32_t length1, uint32_t length2); } 480 AUE_FTRUNCATE STD { int freebsd32_ftruncate(int fd, \ - u_int32_t length1, u_int32_t length2); } + uint32_t length1, uint32_t length2); } #endif 481 AUE_KILL NOPROTO { int thr_kill2(pid_t pid, long id, int sig); } 482 AUE_SHMOPEN NOPROTO { int shm_open(const char *path, int flags, \ @@ -892,25 +892,25 @@ #ifdef PAD64_REQUIRED 485 AUE_NULL STD { int freebsd32_cpuset_setid(cpuwhich_t which, \ int pad, \ - u_int32_t id1, u_int32_t id2, \ + uint32_t id1, uint32_t id2, \ cpusetid_t setid); } #else 485 AUE_NULL STD { int freebsd32_cpuset_setid(cpuwhich_t which, \ - u_int32_t id1, u_int32_t id2, \ + uint32_t id1, uint32_t id2, \ cpusetid_t setid); } #endif 486 AUE_NULL STD { int freebsd32_cpuset_getid(cpulevel_t level, \ cpuwhich_t which, \ - u_int32_t id1, u_int32_t id2, \ + uint32_t id1, uint32_t id2, \ cpusetid_t *setid); } 487 AUE_NULL STD { int freebsd32_cpuset_getaffinity( \ cpulevel_t level, cpuwhich_t which, \ - u_int32_t id1, u_int32_t id2, \ + uint32_t id1, uint32_t id2, \ size_t cpusetsize, \ cpuset_t *mask); } 488 AUE_NULL STD { int freebsd32_cpuset_setaffinity( \ cpulevel_t level, cpuwhich_t which, \ - u_int32_t id1, u_int32_t id2, \ + uint32_t id1, uint32_t id2, \ size_t cpusetsize, \ const cpuset_t *mask); } 489 AUE_FACCESSAT NOPROTO { int faccessat(int fd, char *path, int amode, \ @@ -920,7 +920,7 @@ 491 AUE_FCHOWNAT NOPROTO { int fchownat(int fd, char *path, uid_t uid, \ gid_t gid, int flag); } 492 AUE_FEXECVE STD { int freebsd32_fexecve(int fd, \ - u_int32_t *argv, u_int32_t *envv); } + uint32_t *argv, uint32_t *envv); } 493 AUE_FSTATAT STD { int freebsd32_fstatat(int fd, char *path, \ struct stat *buf, int flag); } 494 AUE_FUTIMESAT STD { int freebsd32_futimesat(int fd, char *path, \ @@ -959,9 +959,9 @@ 512 AUE_SHMCTL NOSTD { int freebsd32_shmctl(int shmid, int cmd, \ struct shmid_ds32 *buf); } 513 AUE_LPATHCONF NOPROTO { int lpathconf(char *path, int name); } -514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, u_int64_t rights); } +514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, uint64_t rights); } 515 AUE_CAP_GETRIGHTS NOPROTO { int cap_getrights(int fd, \ - u_int64_t *rightsp); } + uint64_t *rightsp); } 516 AUE_CAP_ENTER NOPROTO { int cap_enter(void); } 517 AUE_CAP_GETMODE NOPROTO { int cap_getmode(u_int *modep); } 518 AUE_PDFORK UNIMPL pdfork Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Fri May 25 21:12:24 2012 (r236025) +++ head/sys/kern/syscalls.master Fri May 25 21:50:48 2012 (r236026) @@ -916,9 +916,9 @@ 512 AUE_SHMCTL NOSTD { int shmctl(int shmid, int cmd, \ struct shmid_ds *buf); } 513 AUE_LPATHCONF STD { int lpathconf(char *path, int name); } -514 AUE_CAP_NEW STD { int cap_new(int fd, u_int64_t rights); } +514 AUE_CAP_NEW STD { int cap_new(int fd, uint64_t rights); } 515 AUE_CAP_GETRIGHTS STD { int cap_getrights(int fd, \ - u_int64_t *rightsp); } + uint64_t *rightsp); } 516 AUE_CAP_ENTER STD { int cap_enter(void); } 517 AUE_CAP_GETMODE STD { int cap_getmode(u_int *modep); } 518 AUE_PDFORK STD { int pdfork(int *fdp, int flags); } From owner-svn-src-head@FreeBSD.ORG Fri May 25 21:52:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAD9E106564A; Fri, 25 May 2012 21:52:57 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B48BC8FC1C; Fri, 25 May 2012 21:52:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PLqv7C035201; Fri, 25 May 2012 21:52:57 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PLqvaW035189; Fri, 25 May 2012 21:52:57 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201205252152.q4PLqvaW035189@svn.freebsd.org> From: Ed Schouten Date: Fri, 25 May 2012 21:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236027 - in head/sys: amd64/linux32 compat/freebsd32 kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 21:52:57 -0000 Author: ed Date: Fri May 25 21:52:57 2012 New Revision: 236027 URL: http://svn.freebsd.org/changeset/base/236027 Log: Regenerate system call tables. Modified: head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_syscalls.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Fri May 25 21:50:48 2012 (r236026) +++ head/sys/amd64/linux32/linux32_proto.h Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 234359 2012-04-16 23:16:18Z jkim + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ #ifndef _LINUX_SYSPROTO_H_ @@ -60,8 +60,8 @@ struct linux_unlink_args { }; struct linux_execve_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char argp_l_[PADL_(u_int32_t *)]; u_int32_t * argp; char argp_r_[PADR_(u_int32_t *)]; - char envp_l_[PADL_(u_int32_t *)]; u_int32_t * envp; char envp_r_[PADR_(u_int32_t *)]; + char argp_l_[PADL_(uint32_t *)]; uint32_t * argp; char argp_r_[PADR_(uint32_t *)]; + char envp_l_[PADL_(uint32_t *)]; uint32_t * envp; char envp_r_[PADR_(uint32_t *)]; }; struct linux_chdir_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Fri May 25 21:50:48 2012 (r236026) +++ head/sys/amd64/linux32/linux32_syscall.h Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 234359 2012-04-16 23:16:18Z jkim + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ #define LINUX_SYS_exit 1 Modified: head/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- head/sys/amd64/linux32/linux32_syscalls.c Fri May 25 21:50:48 2012 (r236026) +++ head/sys/amd64/linux32/linux32_syscalls.c Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 234359 2012-04-16 23:16:18Z jkim + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ const char *linux_syscallnames[] = { Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Fri May 25 21:50:48 2012 (r236026) +++ head/sys/amd64/linux32/linux32_sysent.c Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 234359 2012-04-16 23:16:18Z jkim + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ #include "opt_compat.h" Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Fri May 25 21:50:48 2012 (r236026) +++ head/sys/amd64/linux32/linux32_systrace_args.c Fri May 25 21:52:57 2012 (r236027) @@ -94,8 +94,8 @@ systrace_args(int sysnum, void *params, case 11: { struct linux_execve_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - uarg[1] = (intptr_t) p->argp; /* u_int32_t * */ - uarg[2] = (intptr_t) p->envp; /* u_int32_t * */ + uarg[1] = (intptr_t) p->argp; /* uint32_t * */ + uarg[2] = (intptr_t) p->envp; /* uint32_t * */ *n_args = 3; break; } @@ -2401,10 +2401,10 @@ systrace_entry_setargdesc(int sysnum, in p = "char *"; break; case 1: - p = "u_int32_t *"; + p = "uint32_t *"; break; case 2: - p = "u_int32_t *"; + p = "uint32_t *"; break; default: break; Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Fri May 25 21:50:48 2012 (r236026) +++ head/sys/compat/freebsd32/freebsd32_proto.h Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227776 2011-11-21 01:26:10Z lstewart + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -54,11 +54,11 @@ struct freebsd32_sendmsg_args { }; struct freebsd32_recvfrom_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; - char buf_l_[PADL_(u_int32_t)]; u_int32_t buf; char buf_r_[PADR_(u_int32_t)]; - char len_l_[PADL_(u_int32_t)]; u_int32_t len; char len_r_[PADR_(u_int32_t)]; + char buf_l_[PADL_(uint32_t)]; uint32_t buf; char buf_r_[PADR_(uint32_t)]; + char len_l_[PADL_(uint32_t)]; uint32_t len; char len_r_[PADR_(uint32_t)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; - char from_l_[PADL_(u_int32_t)]; u_int32_t from; char from_r_[PADR_(u_int32_t)]; - char fromlenaddr_l_[PADL_(u_int32_t)]; u_int32_t fromlenaddr; char fromlenaddr_r_[PADR_(u_int32_t)]; + char from_l_[PADL_(uint32_t)]; uint32_t from; char from_r_[PADR_(uint32_t)]; + char fromlenaddr_l_[PADL_(uint32_t)]; uint32_t fromlenaddr; char fromlenaddr_r_[PADR_(uint32_t)]; }; struct ofreebsd32_sigpending_args { register_t dummy; @@ -74,8 +74,8 @@ struct freebsd32_ioctl_args { }; struct freebsd32_execve_args { char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; - char argv_l_[PADL_(u_int32_t *)]; u_int32_t * argv; char argv_r_[PADR_(u_int32_t *)]; - char envv_l_[PADL_(u_int32_t *)]; u_int32_t * envv; char envv_r_[PADR_(u_int32_t *)]; + char argv_l_[PADL_(uint32_t *)]; uint32_t * argv; char argv_r_[PADR_(uint32_t *)]; + char envv_l_[PADL_(uint32_t *)]; uint32_t * envv; char envv_r_[PADR_(uint32_t *)]; }; struct freebsd32_mprotect_args { char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)]; @@ -175,9 +175,9 @@ struct freebsd32_sysctl_args { char name_l_[PADL_(int *)]; int * name; char name_r_[PADR_(int *)]; char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)]; char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)]; - char oldlenp_l_[PADL_(u_int32_t *)]; u_int32_t * oldlenp; char oldlenp_r_[PADR_(u_int32_t *)]; + char oldlenp_l_[PADL_(uint32_t *)]; uint32_t * oldlenp; char oldlenp_r_[PADR_(uint32_t *)]; char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)]; - char newlen_l_[PADL_(u_int32_t)]; u_int32_t newlen; char newlen_r_[PADR_(u_int32_t)]; + char newlen_l_[PADL_(uint32_t)]; uint32_t newlen; char newlen_r_[PADR_(uint32_t)]; }; struct freebsd32_futimes_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; @@ -232,15 +232,15 @@ struct freebsd32_preadv_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char iovp_l_[PADL_(struct iovec32 *)]; struct iovec32 * iovp; char iovp_r_[PADR_(struct iovec32 *)]; char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char iovcnt_r_[PADR_(u_int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd32_pwritev_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char iovp_l_[PADL_(struct iovec32 *)]; struct iovec32 * iovp; char iovp_r_[PADR_(struct iovec32 *)]; char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char iovcnt_r_[PADR_(u_int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd32_modstat_args { char modid_l_[PADL_(int)]; int modid; char modid_r_[PADR_(int)]; @@ -309,8 +309,8 @@ struct freebsd32_nmount_args { struct freebsd32_sendfile_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)]; char hdtr_l_[PADL_(struct sf_hdtr32 *)]; struct sf_hdtr32 * hdtr; char hdtr_r_[PADR_(struct sf_hdtr32 *)]; char sbytes_l_[PADL_(off_t *)]; off_t * sbytes; char sbytes_r_[PADR_(off_t *)]; @@ -404,16 +404,16 @@ struct freebsd32_pread_args { char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd32_pwrite_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd32_mmap_args { char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; @@ -422,42 +422,42 @@ struct freebsd32_mmap_args { char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char pos1_l_[PADL_(u_int32_t)]; u_int32_t pos1; char pos1_r_[PADR_(u_int32_t)]; - char pos2_l_[PADL_(u_int32_t)]; u_int32_t pos2; char pos2_r_[PADR_(u_int32_t)]; + char pos1_l_[PADL_(uint32_t)]; uint32_t pos1; char pos1_r_[PADR_(uint32_t)]; + char pos2_l_[PADL_(uint32_t)]; uint32_t pos2; char pos2_r_[PADR_(uint32_t)]; }; struct freebsd32_lseek_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; }; struct freebsd32_truncate_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)]; - char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; struct freebsd32_ftruncate_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)]; - char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; #else struct freebsd32_pread_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd32_pwrite_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd32_mmap_args { char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; @@ -465,69 +465,69 @@ struct freebsd32_mmap_args { char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char pos1_l_[PADL_(u_int32_t)]; u_int32_t pos1; char pos1_r_[PADR_(u_int32_t)]; - char pos2_l_[PADL_(u_int32_t)]; u_int32_t pos2; char pos2_r_[PADR_(u_int32_t)]; + char pos1_l_[PADL_(uint32_t)]; uint32_t pos1; char pos1_r_[PADR_(uint32_t)]; + char pos2_l_[PADL_(uint32_t)]; uint32_t pos2; char pos2_r_[PADR_(uint32_t)]; }; struct freebsd32_lseek_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; }; struct freebsd32_truncate_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)]; - char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; struct freebsd32_ftruncate_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)]; - char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; #endif #ifdef PAD64_REQUIRED struct freebsd32_cpuset_setid_args { char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)]; - char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; char setid_l_[PADL_(cpusetid_t)]; cpusetid_t setid; char setid_r_[PADR_(cpusetid_t)]; }; #else struct freebsd32_cpuset_setid_args { char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; - char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)]; - char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; char setid_l_[PADL_(cpusetid_t)]; cpusetid_t setid; char setid_r_[PADR_(cpusetid_t)]; }; #endif struct freebsd32_cpuset_getid_args { char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char level_r_[PADR_(cpulevel_t)]; char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; - char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)]; - char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; char setid_l_[PADL_(cpusetid_t *)]; cpusetid_t * setid; char setid_r_[PADR_(cpusetid_t *)]; }; struct freebsd32_cpuset_getaffinity_args { char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char level_r_[PADR_(cpulevel_t)]; char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; - char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)]; - char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; char cpusetsize_l_[PADL_(size_t)]; size_t cpusetsize; char cpusetsize_r_[PADR_(size_t)]; char mask_l_[PADL_(cpuset_t *)]; cpuset_t * mask; char mask_r_[PADR_(cpuset_t *)]; }; struct freebsd32_cpuset_setaffinity_args { char level_l_[PADL_(cpulevel_t)]; cpulevel_t level; char level_r_[PADR_(cpulevel_t)]; char which_l_[PADL_(cpuwhich_t)]; cpuwhich_t which; char which_r_[PADR_(cpuwhich_t)]; - char id1_l_[PADL_(u_int32_t)]; u_int32_t id1; char id1_r_[PADR_(u_int32_t)]; - char id2_l_[PADL_(u_int32_t)]; u_int32_t id2; char id2_r_[PADR_(u_int32_t)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; char cpusetsize_l_[PADL_(size_t)]; size_t cpusetsize; char cpusetsize_r_[PADR_(size_t)]; char mask_l_[PADL_(const cpuset_t *)]; const cpuset_t * mask; char mask_r_[PADR_(const cpuset_t *)]; }; struct freebsd32_fexecve_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char argv_l_[PADL_(u_int32_t *)]; u_int32_t * argv; char argv_r_[PADR_(u_int32_t *)]; - char envv_l_[PADL_(u_int32_t *)]; u_int32_t * envv; char envv_r_[PADR_(u_int32_t *)]; + char argv_l_[PADL_(uint32_t *)]; uint32_t * argv; char argv_r_[PADR_(uint32_t *)]; + char envv_l_[PADL_(uint32_t *)]; uint32_t * envv; char envv_r_[PADR_(uint32_t *)]; }; struct freebsd32_fstatat_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; @@ -812,8 +812,8 @@ struct freebsd4_freebsd32_fhstatfs_args struct freebsd4_freebsd32_sendfile_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)]; char hdtr_l_[PADL_(struct sf_hdtr32 *)]; struct sf_hdtr32 * hdtr; char hdtr_r_[PADR_(struct sf_hdtr32 *)]; char sbytes_l_[PADL_(off_t *)]; off_t * sbytes; char sbytes_r_[PADR_(off_t *)]; @@ -854,16 +854,16 @@ struct freebsd6_freebsd32_pread_args { char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd6_freebsd32_pwrite_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct freebsd6_freebsd32_mmap_args { char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; @@ -872,27 +872,27 @@ struct freebsd6_freebsd32_mmap_args { char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char pos1_l_[PADL_(u_int32_t)]; u_int32_t pos1; char pos1_r_[PADR_(u_int32_t)]; - char pos2_l_[PADL_(u_int32_t)]; u_int32_t pos2; char pos2_r_[PADR_(u_int32_t)]; + char pos1_l_[PADL_(uint32_t)]; uint32_t pos1; char pos1_r_[PADR_(uint32_t)]; + char pos2_l_[PADL_(uint32_t)]; uint32_t pos2; char pos2_r_[PADR_(uint32_t)]; }; struct freebsd6_freebsd32_lseek_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offset1_l_[PADL_(u_int32_t)]; u_int32_t offset1; char offset1_r_[PADR_(u_int32_t)]; - char offset2_l_[PADL_(u_int32_t)]; u_int32_t offset2; char offset2_r_[PADR_(u_int32_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; }; struct freebsd6_freebsd32_truncate_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)]; - char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; struct freebsd6_freebsd32_ftruncate_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char length1_l_[PADL_(u_int32_t)]; u_int32_t length1; char length1_r_[PADR_(u_int32_t)]; - char length2_l_[PADL_(u_int32_t)]; u_int32_t length2; char length2_r_[PADR_(u_int32_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; #ifdef PAD64_REQUIRED #else Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Fri May 25 21:50:48 2012 (r236026) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227776 2011-11-21 01:26:10Z lstewart + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ #define FREEBSD32_SYS_syscall 0 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Fri May 25 21:50:48 2012 (r236026) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227776 2011-11-21 01:26:10Z lstewart + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ const char *freebsd32_syscallnames[] = { Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Fri May 25 21:50:48 2012 (r236026) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Fri May 25 21:52:57 2012 (r236027) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227776 2011-11-21 01:26:10Z lstewart + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 236026 2012-05-25 21:50:48Z ed */ #include "opt_compat.h" Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Fri May 25 21:50:48 2012 (r236026) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Fri May 25 21:52:57 2012 (r236027) @@ -209,11 +209,11 @@ systrace_args(int sysnum, void *params, case 29: { struct freebsd32_recvfrom_args *p = params; iarg[0] = p->s; /* int */ - uarg[1] = p->buf; /* u_int32_t */ - uarg[2] = p->len; /* u_int32_t */ + uarg[1] = p->buf; /* uint32_t */ + uarg[2] = p->len; /* uint32_t */ iarg[3] = p->flags; /* int */ - uarg[4] = p->from; /* u_int32_t */ - uarg[5] = p->fromlenaddr; /* u_int32_t */ + uarg[4] = p->from; /* uint32_t */ + uarg[5] = p->fromlenaddr; /* uint32_t */ *n_args = 6; break; } @@ -402,8 +402,8 @@ systrace_args(int sysnum, void *params, case 59: { struct freebsd32_execve_args *p = params; uarg[0] = (intptr_t) p->fname; /* char * */ - uarg[1] = (intptr_t) p->argv; /* u_int32_t * */ - uarg[2] = (intptr_t) p->envv; /* u_int32_t * */ + uarg[1] = (intptr_t) p->argv; /* uint32_t * */ + uarg[2] = (intptr_t) p->envv; /* uint32_t * */ *n_args = 3; break; } @@ -996,9 +996,9 @@ systrace_args(int sysnum, void *params, uarg[0] = (intptr_t) p->name; /* int * */ uarg[1] = p->namelen; /* u_int */ uarg[2] = (intptr_t) p->old; /* void * */ - uarg[3] = (intptr_t) p->oldlenp; /* u_int32_t * */ + uarg[3] = (intptr_t) p->oldlenp; /* uint32_t * */ uarg[4] = (intptr_t) p->new; /* void * */ - uarg[5] = p->newlen; /* u_int32_t */ + uarg[5] = p->newlen; /* uint32_t */ *n_args = 6; break; } @@ -1360,8 +1360,8 @@ systrace_args(int sysnum, void *params, iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->iovp; /* struct iovec32 * */ uarg[2] = p->iovcnt; /* u_int */ - uarg[3] = p->offset1; /* u_int32_t */ - uarg[4] = p->offset2; /* u_int32_t */ + uarg[3] = p->offset1; /* uint32_t */ + uarg[4] = p->offset2; /* uint32_t */ *n_args = 5; break; } @@ -1371,8 +1371,8 @@ systrace_args(int sysnum, void *params, iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->iovp; /* struct iovec32 * */ uarg[2] = p->iovcnt; /* u_int */ - uarg[3] = p->offset1; /* u_int32_t */ - uarg[4] = p->offset2; /* u_int32_t */ + uarg[3] = p->offset1; /* uint32_t */ + uarg[4] = p->offset2; /* uint32_t */ *n_args = 5; break; } @@ -1933,8 +1933,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_sendfile_args *p = params; iarg[0] = p->fd; /* int */ iarg[1] = p->s; /* int */ - uarg[2] = p->offset1; /* u_int32_t */ - uarg[3] = p->offset2; /* u_int32_t */ + uarg[2] = p->offset1; /* uint32_t */ + uarg[3] = p->offset2; /* uint32_t */ uarg[4] = p->nbytes; /* size_t */ uarg[5] = (intptr_t) p->hdtr; /* struct sf_hdtr32 * */ uarg[6] = (intptr_t) p->sbytes; /* off_t * */ @@ -2500,8 +2500,8 @@ systrace_args(int sysnum, void *params, uarg[1] = (intptr_t) p->buf; /* void * */ uarg[2] = p->nbyte; /* size_t */ iarg[3] = p->pad; /* int */ - uarg[4] = p->offset1; /* u_int32_t */ - uarg[5] = p->offset2; /* u_int32_t */ + uarg[4] = p->offset1; /* uint32_t */ + uarg[5] = p->offset2; /* uint32_t */ *n_args = 6; break; } @@ -2512,8 +2512,8 @@ systrace_args(int sysnum, void *params, uarg[1] = (intptr_t) p->buf; /* const void * */ uarg[2] = p->nbyte; /* size_t */ iarg[3] = p->pad; /* int */ - uarg[4] = p->offset1; /* u_int32_t */ - uarg[5] = p->offset2; /* u_int32_t */ + uarg[4] = p->offset1; /* uint32_t */ + uarg[5] = p->offset2; /* uint32_t */ *n_args = 6; break; } @@ -2526,8 +2526,8 @@ systrace_args(int sysnum, void *params, iarg[3] = p->flags; /* int */ iarg[4] = p->fd; /* int */ iarg[5] = p->pad; /* int */ - uarg[6] = p->pos1; /* u_int32_t */ - uarg[7] = p->pos2; /* u_int32_t */ + uarg[6] = p->pos1; /* uint32_t */ + uarg[7] = p->pos2; /* uint32_t */ *n_args = 8; break; } @@ -2536,8 +2536,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_lseek_args *p = params; iarg[0] = p->fd; /* int */ iarg[1] = p->pad; /* int */ - uarg[2] = p->offset1; /* u_int32_t */ - uarg[3] = p->offset2; /* u_int32_t */ + uarg[2] = p->offset1; /* uint32_t */ + uarg[3] = p->offset2; /* uint32_t */ iarg[4] = p->whence; /* int */ *n_args = 5; break; @@ -2547,8 +2547,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_truncate_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ iarg[1] = p->pad; /* int */ - uarg[2] = p->length1; /* u_int32_t */ - uarg[3] = p->length2; /* u_int32_t */ + uarg[2] = p->length1; /* uint32_t */ + uarg[3] = p->length2; /* uint32_t */ *n_args = 4; break; } @@ -2557,8 +2557,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_ftruncate_args *p = params; iarg[0] = p->fd; /* int */ iarg[1] = p->pad; /* int */ - uarg[2] = p->length1; /* u_int32_t */ - uarg[3] = p->length2; /* u_int32_t */ + uarg[2] = p->length1; /* uint32_t */ + uarg[3] = p->length2; /* uint32_t */ *n_args = 4; break; } @@ -2569,8 +2569,8 @@ systrace_args(int sysnum, void *params, iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->buf; /* void * */ uarg[2] = p->nbyte; /* size_t */ - uarg[3] = p->offset1; /* u_int32_t */ - uarg[4] = p->offset2; /* u_int32_t */ + uarg[3] = p->offset1; /* uint32_t */ + uarg[4] = p->offset2; /* uint32_t */ *n_args = 5; break; } @@ -2580,8 +2580,8 @@ systrace_args(int sysnum, void *params, iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->buf; /* const void * */ uarg[2] = p->nbyte; /* size_t */ - uarg[3] = p->offset1; /* u_int32_t */ - uarg[4] = p->offset2; /* u_int32_t */ + uarg[3] = p->offset1; /* uint32_t */ + uarg[4] = p->offset2; /* uint32_t */ *n_args = 5; break; } @@ -2593,8 +2593,8 @@ systrace_args(int sysnum, void *params, iarg[2] = p->prot; /* int */ iarg[3] = p->flags; /* int */ iarg[4] = p->fd; /* int */ - uarg[5] = p->pos1; /* u_int32_t */ - uarg[6] = p->pos2; /* u_int32_t */ + uarg[5] = p->pos1; /* uint32_t */ + uarg[6] = p->pos2; /* uint32_t */ *n_args = 7; break; } @@ -2602,8 +2602,8 @@ systrace_args(int sysnum, void *params, case 478: { struct freebsd32_lseek_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = p->offset1; /* u_int32_t */ - uarg[2] = p->offset2; /* u_int32_t */ + uarg[1] = p->offset1; /* uint32_t */ + uarg[2] = p->offset2; /* uint32_t */ iarg[3] = p->whence; /* int */ *n_args = 4; break; @@ -2612,8 +2612,8 @@ systrace_args(int sysnum, void *params, case 479: { struct freebsd32_truncate_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - uarg[1] = p->length1; /* u_int32_t */ - uarg[2] = p->length2; /* u_int32_t */ + uarg[1] = p->length1; /* uint32_t */ + uarg[2] = p->length2; /* uint32_t */ *n_args = 3; break; } @@ -2621,8 +2621,8 @@ systrace_args(int sysnum, void *params, case 480: { struct freebsd32_ftruncate_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = p->length1; /* u_int32_t */ - uarg[2] = p->length2; /* u_int32_t */ + uarg[1] = p->length1; /* uint32_t */ + uarg[2] = p->length2; /* uint32_t */ *n_args = 3; break; } @@ -2665,8 +2665,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_cpuset_setid_args *p = params; iarg[0] = p->which; /* cpuwhich_t */ iarg[1] = p->pad; /* int */ - uarg[2] = p->id1; /* u_int32_t */ - uarg[3] = p->id2; /* u_int32_t */ + uarg[2] = p->id1; /* uint32_t */ + uarg[3] = p->id2; /* uint32_t */ iarg[4] = p->setid; /* cpusetid_t */ *n_args = 5; break; @@ -2676,8 +2676,8 @@ systrace_args(int sysnum, void *params, case 485: { struct freebsd32_cpuset_setid_args *p = params; iarg[0] = p->which; /* cpuwhich_t */ - uarg[1] = p->id1; /* u_int32_t */ - uarg[2] = p->id2; /* u_int32_t */ + uarg[1] = p->id1; /* uint32_t */ + uarg[2] = p->id2; /* uint32_t */ iarg[3] = p->setid; /* cpusetid_t */ *n_args = 4; break; @@ -2688,8 +2688,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_cpuset_getid_args *p = params; iarg[0] = p->level; /* cpulevel_t */ iarg[1] = p->which; /* cpuwhich_t */ - uarg[2] = p->id1; /* u_int32_t */ - uarg[3] = p->id2; /* u_int32_t */ + uarg[2] = p->id1; /* uint32_t */ + uarg[3] = p->id2; /* uint32_t */ uarg[4] = (intptr_t) p->setid; /* cpusetid_t * */ *n_args = 5; break; @@ -2699,8 +2699,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_cpuset_getaffinity_args *p = params; iarg[0] = p->level; /* cpulevel_t */ iarg[1] = p->which; /* cpuwhich_t */ - uarg[2] = p->id1; /* u_int32_t */ - uarg[3] = p->id2; /* u_int32_t */ + uarg[2] = p->id1; /* uint32_t */ + uarg[3] = p->id2; /* uint32_t */ uarg[4] = p->cpusetsize; /* size_t */ uarg[5] = (intptr_t) p->mask; /* cpuset_t * */ *n_args = 6; @@ -2711,8 +2711,8 @@ systrace_args(int sysnum, void *params, struct freebsd32_cpuset_setaffinity_args *p = params; iarg[0] = p->level; /* cpulevel_t */ iarg[1] = p->which; /* cpuwhich_t */ - uarg[2] = p->id1; /* u_int32_t */ - uarg[3] = p->id2; /* u_int32_t */ + uarg[2] = p->id1; /* uint32_t */ + uarg[3] = p->id2; /* uint32_t */ uarg[4] = p->cpusetsize; /* size_t */ uarg[5] = (intptr_t) p->mask; /* const cpuset_t * */ *n_args = 6; @@ -2753,8 +2753,8 @@ systrace_args(int sysnum, void *params, case 492: { struct freebsd32_fexecve_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->argv; /* u_int32_t * */ - uarg[2] = (intptr_t) p->envv; /* u_int32_t * */ + uarg[1] = (intptr_t) p->argv; /* uint32_t * */ + uarg[2] = (intptr_t) p->envv; /* uint32_t * */ *n_args = 3; break; } @@ -2943,7 +2943,7 @@ systrace_args(int sysnum, void *params, case 514: { struct cap_new_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = p->rights; /* u_int64_t */ + uarg[1] = p->rights; /* uint64_t */ *n_args = 2; break; } @@ -2951,7 +2951,7 @@ systrace_args(int sysnum, void *params, case 515: { struct cap_getrights_args *p = params; iarg[0] = p->fd; /* int */ - uarg[1] = (intptr_t) p->rightsp; /* u_int64_t * */ + uarg[1] = (intptr_t) p->rightsp; /* uint64_t * */ *n_args = 2; break; } @@ -3380,19 +3380,19 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 1: - p = "u_int32_t"; + p = "uint32_t"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: p = "int"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; case 5: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -3679,10 +3679,10 @@ systrace_entry_setargdesc(int sysnum, in p = "char *"; break; case 1: - p = "u_int32_t *"; + p = "uint32_t *"; break; case 2: - p = "u_int32_t *"; + p = "uint32_t *"; break; default: break; @@ -4664,13 +4664,13 @@ systrace_entry_setargdesc(int sysnum, in p = "void *"; break; case 3: - p = "u_int32_t *"; + p = "uint32_t *"; break; case 4: p = "void *"; break; case 5: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -5217,10 +5217,10 @@ systrace_entry_setargdesc(int sysnum, in p = "u_int"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -5239,10 +5239,10 @@ systrace_entry_setargdesc(int sysnum, in p = "u_int"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -6162,10 +6162,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: p = "size_t"; @@ -7135,10 +7135,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; case 5: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7160,10 +7160,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; case 5: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7191,10 +7191,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 6: - p = "u_int32_t"; + p = "uint32_t"; break; case 7: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7210,10 +7210,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: p = "int"; @@ -7232,10 +7232,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7251,10 +7251,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7274,10 +7274,10 @@ systrace_entry_setargdesc(int sysnum, in p = "size_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7296,10 +7296,10 @@ systrace_entry_setargdesc(int sysnum, in p = "size_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7324,10 +7324,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 5: - p = "u_int32_t"; + p = "uint32_t"; break; case 6: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7340,10 +7340,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 1: - p = "u_int32_t"; + p = "uint32_t"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: p = "int"; @@ -7359,10 +7359,10 @@ systrace_entry_setargdesc(int sysnum, in p = "char *"; break; case 1: - p = "u_int32_t"; + p = "uint32_t"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7375,10 +7375,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 1: - p = "u_int32_t"; + p = "uint32_t"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; default: break; @@ -7448,10 +7448,10 @@ systrace_entry_setargdesc(int sysnum, in p = "int"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: - p = "u_int32_t"; + p = "uint32_t"; break; case 4: p = "cpusetid_t"; @@ -7468,10 +7468,10 @@ systrace_entry_setargdesc(int sysnum, in p = "cpuwhich_t"; break; case 1: - p = "u_int32_t"; + p = "uint32_t"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; case 3: p = "cpusetid_t"; @@ -7491,10 +7491,10 @@ systrace_entry_setargdesc(int sysnum, in p = "cpuwhich_t"; break; case 2: - p = "u_int32_t"; + p = "uint32_t"; break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 25 22:07:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC281106566C; Fri, 25 May 2012 22:07:13 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C838B8FC0A; Fri, 25 May 2012 22:07:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PM7DZH035812; Fri, 25 May 2012 22:07:13 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4PM7DPD035808; Fri, 25 May 2012 22:07:13 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201205252207.q4PM7DPD035808@svn.freebsd.org> From: Gabor Kovesdan Date: Fri, 25 May 2012 22:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236028 - head/lib/libkiconv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 22:07:14 -0000 Author: gabor Date: Fri May 25 22:07:13 2012 New Revision: 236028 URL: http://svn.freebsd.org/changeset/base/236028 Log: - Add support for BSD iconv when it is build into libc PR: bin/162670 Submitted by: Jan Beich MFC after: 2 weeks Modified: head/lib/libkiconv/Makefile head/lib/libkiconv/xlat16_iconv.c Modified: head/lib/libkiconv/Makefile ============================================================================== --- head/lib/libkiconv/Makefile Fri May 25 21:52:57 2012 (r236027) +++ head/lib/libkiconv/Makefile Fri May 25 22:07:13 2012 (r236028) @@ -17,4 +17,8 @@ CFLAGS+= -I${.CURDIR}/../../sys WARNS?= 1 +.if !defined(MK_ICONV) +CFLAGS+= -DICONV_DLOPEN +.endif + .include Modified: head/lib/libkiconv/xlat16_iconv.c ============================================================================== --- head/lib/libkiconv/xlat16_iconv.c Fri May 25 21:52:57 2012 (r236027) +++ head/lib/libkiconv/xlat16_iconv.c Fri May 25 22:07:13 2012 (r236028) @@ -60,10 +60,18 @@ struct xlat16_table { static struct xlat16_table kiconv_xlat16_open(const char *, const char *, int); static int chklocale(int, const char *); +#ifdef ICONV_DLOPEN static int my_iconv_init(void); static iconv_t (*my_iconv_open)(const char *, const char *); static size_t (*my_iconv)(iconv_t, const char **, size_t *, char **, size_t *); static int (*my_iconv_close)(iconv_t); +#else +#include +#define my_iconv_init() 0 +#define my_iconv_open iconv_open +#define my_iconv iconv +#define my_iconv_close iconv_close +#endif static size_t my_iconv_char(iconv_t, const u_char **, size_t *, u_char **, size_t *); int @@ -310,6 +318,7 @@ chklocale(int category, const char *code return (error); } +#ifdef ICONV_DLOPEN static int my_iconv_init(void) { @@ -327,6 +336,7 @@ my_iconv_init(void) return (0); } +#endif static size_t my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf, From owner-svn-src-head@FreeBSD.ORG Sat May 26 01:34:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29C70106564A; Sat, 26 May 2012 01:34:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDCB78FC0C; Sat, 26 May 2012 01:34:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q1YaTd044716; Sat, 26 May 2012 01:34:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q1Yamx044714; Sat, 26 May 2012 01:34:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205260134.q4Q1Yamx044714@svn.freebsd.org> From: Adrian Chadd Date: Sat, 26 May 2012 01:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236036 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 01:34:37 -0000 Author: adrian Date: Sat May 26 01:34:36 2012 New Revision: 236036 URL: http://svn.freebsd.org/changeset/base/236036 Log: Remove an unneeded field from ath_buf. Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat May 26 01:33:07 2012 (r236035) +++ head/sys/dev/ath/if_athvar.h Sat May 26 01:34:36 2012 (r236036) @@ -238,7 +238,6 @@ struct ath_buf { int bfs_txpower; /* tx power */ int bfs_txantenna; /* TX antenna config */ enum ieee80211_protmode bfs_protmode; - HAL_11N_RATE_SERIES bfs_rc11n[ATH_RC_NUM]; /* 11n TX series */ int bfs_ctsrate; /* CTS rate */ int bfs_ctsduration; /* CTS duration (pre-11n NICs) */ struct ath_rc_series bfs_rc[ATH_RC_NUM]; /* non-11n TX series */ From owner-svn-src-head@FreeBSD.ORG Sat May 26 01:35:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A69F106566C; Sat, 26 May 2012 01:35:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 464FA8FC15; Sat, 26 May 2012 01:35:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q1ZCXJ044813; Sat, 26 May 2012 01:35:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q1ZCNh044811; Sat, 26 May 2012 01:35:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205260135.q4Q1ZCNh044811@svn.freebsd.org> From: Adrian Chadd Date: Sat, 26 May 2012 01:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236038 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 01:35:12 -0000 Author: adrian Date: Sat May 26 01:35:11 2012 New Revision: 236038 URL: http://svn.freebsd.org/changeset/base/236038 Log: Avoid using hard-coded numbers here. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sat May 26 01:35:09 2012 (r236037) +++ head/sys/dev/ath/if_ath_tx.c Sat May 26 01:35:11 2012 (r236038) @@ -3580,7 +3580,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * int nframes = 0, nbad = 0, nf; int pktlen; /* XXX there's too much on the stack? */ - struct ath_rc_series rc[4]; + struct ath_rc_series rc[ATH_RC_NUM]; int txseq; DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: called; hwq_depth=%d\n", From owner-svn-src-head@FreeBSD.ORG Sat May 26 01:36:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 408901065670; Sat, 26 May 2012 01:36:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11C688FC15; Sat, 26 May 2012 01:36:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q1aPCu044900; Sat, 26 May 2012 01:36:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q1aPj3044898; Sat, 26 May 2012 01:36:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205260136.q4Q1aPj3044898@svn.freebsd.org> From: Adrian Chadd Date: Sat, 26 May 2012 01:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236039 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 01:36:26 -0000 Author: adrian Date: Sat May 26 01:36:25 2012 New Revision: 236039 URL: http://svn.freebsd.org/changeset/base/236039 Log: Add the AR9280 workarounds for PCIe suspend/resume. These aren't strictly needed at the moment as we're not doing APSM and forcing the NIC in and out of network sleep. But, they don't hurt. Tested: * AR9280 (mini-PCIe) Obtained from: Qualcomm Atheros, Linux ath9k Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat May 26 01:35:11 2012 (r236038) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat May 26 01:36:25 2012 (r236039) @@ -420,18 +420,68 @@ bad: static void ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off) { + uint32_t val; + if (AH_PRIVATE(ah)->ah_ispcie && !restore) { ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); OS_DELAY(1000); + } + + + /* + * Set PCIe workaround bits + * + * NOTE: + * + * In Merlin and Kite, bit 14 in WA register (disable L1) should only + * be set when device enters D3 and be cleared when device comes back + * to D0. + */ + if (power_off) { /* Power-off */ + OS_REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); + + val = OS_REG_READ(ah, AR_WA); + + /* + * Disable bit 6 and 7 before entering D3 to prevent + * system hang. + */ + val &= ~(AR_WA_BIT6 | AR_WA_BIT7); + + /* + * XXX Not sure, is specified in the reference HAL. + */ + val |= AR_WA_BIT22; + + /* + * See above: set AR_WA_D3_L1_DISABLE when entering D3 state. + * + * XXX The reference HAL does it this way - it only sets + * AR_WA_D3_L1_DISABLE if it's set in AR9280_WA_DEFAULT, + * which it (currently) isn't. So the following statement + * is currently a NOP. + */ + if (AR9280_WA_DEFAULT & AR_WA_D3_L1_DISABLE) + val |= AR_WA_D3_L1_DISABLE; + + OS_REG_WRITE(ah, AR_WA, val); + } else { /* Power-on */ + val = AR9280_WA_DEFAULT; + + /* + * See note above: make sure L1_DISABLE is not set. + */ + val &= (~AR_WA_D3_L1_DISABLE); + OS_REG_WRITE(ah, AR_WA, val); + + /* set bit 19 to allow forcing of pcie core into L1 state */ OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); - OS_REG_WRITE(ah, AR_WA, AR9280_WA_DEFAULT); } } static void ar9280DisablePCIE(struct ath_hal *ah) { - /* XXX TODO */ } static void From owner-svn-src-head@FreeBSD.ORG Sat May 26 05:25:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35CA8106566B; Sat, 26 May 2012 05:25:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 207F58FC0A; Sat, 26 May 2012 05:25:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q5Pt55054311; Sat, 26 May 2012 05:25:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q5Pt4V054309; Sat, 26 May 2012 05:25:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205260525.q4Q5Pt4V054309@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 26 May 2012 05:25:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236042 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 05:25:56 -0000 Author: kib Date: Sat May 26 05:25:55 2012 New Revision: 236042 URL: http://svn.freebsd.org/changeset/base/236042 Log: Clarify the SEEK_HOLE description, it repositions the file pointer. MFC after: 3 days Modified: head/lib/libc/sys/lseek.2 Modified: head/lib/libc/sys/lseek.2 ============================================================================== --- head/lib/libc/sys/lseek.2 Sat May 26 01:55:51 2012 (r236041) +++ head/lib/libc/sys/lseek.2 Sat May 26 05:25:55 2012 (r236042) @@ -28,7 +28,7 @@ .\" @(#)lseek.2 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd April 5, 2007 +.Dd May 26, 2012 .Dt LSEEK 2 .Os .Sh NAME @@ -92,9 +92,9 @@ If .Fa whence is .Dv SEEK_HOLE , -the offset of the start of the next hole greater than or equal to the supplied -.Fa offset -is returned. +the offset is set to the start of the next hole greater than or equal +to the supplied +.Fa offset . The definition of a hole is provided below. .It If From owner-svn-src-head@FreeBSD.ORG Sat May 26 05:28:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CF341065672; Sat, 26 May 2012 05:28:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E5A58FC12; Sat, 26 May 2012 05:28:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q5Smif054460; Sat, 26 May 2012 05:28:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q5Smcv054457; Sat, 26 May 2012 05:28:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205260528.q4Q5Smcv054457@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 26 May 2012 05:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236043 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 05:28:48 -0000 Author: kib Date: Sat May 26 05:28:47 2012 New Revision: 236043 URL: http://svn.freebsd.org/changeset/base/236043 Log: Add a vn_bmap_seekhole(9) vnode helper which can be used by any filesystem which supports VOP_BMAP(9) to implement SEEK_HOLE/SEEK_DATA commands for lseek(2). MFC after: 2 weeks Modified: head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sat May 26 05:25:55 2012 (r236042) +++ head/sys/kern/vfs_vnops.c Sat May 26 05:28:47 2012 (r236043) @@ -1466,3 +1466,56 @@ vn_pages_remove(struct vnode *vp, vm_pin vm_object_page_remove(object, start, end, 0); VM_OBJECT_UNLOCK(object); } + +int +vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) +{ + struct vattr va; + daddr_t bn, bnp; + uint64_t bsize; + off_t noff; + int error; + + KASSERT(cmd == FIOSEEKHOLE || cmd == FIOSEEKDATA, + ("Wrong command %lu", cmd)); + + if (vn_lock(vp, LK_SHARED) != 0) + return (EBADF); + if (vp->v_type != VREG) { + error = ENOTTY; + goto unlock; + } + error = VOP_GETATTR(vp, &va, cred); + if (error != 0) + goto unlock; + noff = *off; + if (noff >= va.va_size) { + error = ENXIO; + goto unlock; + } + bsize = vp->v_mount->mnt_stat.f_iosize; + for (bn = noff / bsize; noff < va.va_size; bn++, noff += bsize) { + error = VOP_BMAP(vp, bn, NULL, &bnp, NULL, NULL); + if (error == EOPNOTSUPP) { + error = ENOTTY; + goto unlock; + } + if ((bnp == -1 && cmd == FIOSEEKHOLE) || + (bnp != -1 && cmd == FIOSEEKDATA)) { + noff = bn * bsize; + if (noff < *off) + noff = *off; + goto unlock; + } + } + if (noff > va.va_size) + noff = va.va_size; + /* noff == va.va_size. There is an implicit hole at the end of file. */ + if (cmd == FIOSEEKDATA) + error = ENXIO; +unlock: + VOP_UNLOCK(vp, 0); + if (error == 0) + *off = noff; + return (error); +} Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat May 26 05:25:55 2012 (r236042) +++ head/sys/sys/vnode.h Sat May 26 05:28:47 2012 (r236043) @@ -640,6 +640,8 @@ void vunref(struct vnode *); void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3); #define vprint(label, vp) vn_printf((vp), "%s\n", (label)) int vrecycle(struct vnode *vp); +int vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, + struct ucred *cred); int vn_close(struct vnode *vp, int flags, struct ucred *file_cred, struct thread *td); void vn_finished_write(struct mount *mp); From owner-svn-src-head@FreeBSD.ORG Sat May 26 05:29:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 556E81065673; Sat, 26 May 2012 05:29:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27CDC8FC19; Sat, 26 May 2012 05:29:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q5TsMx054533; Sat, 26 May 2012 05:29:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q5TrAU054531; Sat, 26 May 2012 05:29:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205260529.q4Q5TrAU054531@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 26 May 2012 05:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236044 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 05:29:54 -0000 Author: kib Date: Sat May 26 05:29:53 2012 New Revision: 236044 URL: http://svn.freebsd.org/changeset/base/236044 Log: Implement SEEK_HOLE/SEEK_DATA for UFS. MFC after: 2 weeks Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Sat May 26 05:28:47 2012 (r236043) +++ head/sys/ufs/ufs/ufs_vnops.c Sat May 26 05:29:53 2012 (r236044) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -102,6 +103,7 @@ static int ufs_chown(struct vnode *, uid static vop_close_t ufs_close; static vop_create_t ufs_create; static vop_getattr_t ufs_getattr; +static vop_ioctl_t ufs_ioctl; static vop_link_t ufs_link; static int ufs_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *); static vop_markatime_t ufs_markatime; @@ -2504,6 +2506,9 @@ ufs_pathconf(ap) *ap->a_retval = 0; #endif break; + case _PC_MIN_HOLE_SIZE: + *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; + break; case _PC_ASYNC_IO: /* _PC_ASYNC_IO should have been handled by upper layers. */ KASSERT(0, ("_PC_ASYNC_IO should not get here")); @@ -2737,6 +2742,20 @@ bad: return (error); } +static int +ufs_ioctl(struct vop_ioctl_args *ap) +{ + + switch (ap->a_command) { + case FIOSEEKDATA: + case FIOSEEKHOLE: + return (vn_bmap_seekhole(ap->a_vp, ap->a_command, + (off_t *)ap->a_data, ap->a_cred)); + default: + return (ENOTTY); + } +} + /* Global vfs data structures for ufs. */ struct vop_vector ufs_vnodeops = { .vop_default = &default_vnodeops, @@ -2751,6 +2770,7 @@ struct vop_vector ufs_vnodeops = { .vop_create = ufs_create, .vop_getattr = ufs_getattr, .vop_inactive = ufs_inactive, + .vop_ioctl = ufs_ioctl, .vop_link = ufs_link, .vop_lookup = vfs_cache_lookup, .vop_markatime = ufs_markatime, From owner-svn-src-head@FreeBSD.ORG Sat May 26 06:10:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B53EC106566B; Sat, 26 May 2012 06:10:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F53C8FC08; Sat, 26 May 2012 06:10:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q6APVX056151; Sat, 26 May 2012 06:10:25 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q6APad056148; Sat, 26 May 2012 06:10:25 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205260610.q4Q6APad056148@svn.freebsd.org> From: Alan Cox Date: Sat, 26 May 2012 06:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236045 - in head/sys/i386: i386 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 06:10:25 -0000 Author: alc Date: Sat May 26 06:10:25 2012 New Revision: 236045 URL: http://svn.freebsd.org/changeset/base/236045 Log: Rename pmap_collect() to pmap_pv_reclaim() and rewrite it such that it no longer uses the active and inactive paging queues. Instead, the pmap now maintains an LRU-ordered list of pv entry pages, and pmap_pv_reclaim() uses this list to select pv entries for reclamation. Note: The old pmap_collect() tried to avoid reclaiming mappings for pages that have either a hold_count or a busy field that is non-zero. However, this isn't necessary for correctness, and the locking in pmap_collect() was insufficient to guarantee that such mappings weren't reclaimed. The new pmap_pv_reclaim() doesn't even try. MFC after: 5 weeks Modified: head/sys/i386/i386/pmap.c head/sys/i386/include/pmap.h Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat May 26 05:29:53 2012 (r236044) +++ head/sys/i386/i386/pmap.c Sat May 26 06:10:25 2012 (r236045) @@ -233,6 +233,7 @@ static int pat_index[PAT_INDEX_SIZE]; /* /* * Data for the pv entry allocation mechanism */ +static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0; static struct md_page *pv_table; static int shpgperproc = PMAP_SHPGPERPROC; @@ -2187,69 +2188,144 @@ SYSCTL_LONG(_vm_pmap, OID_AUTO, pv_entry "Current number of pv entry allocs"); SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_spare, CTLFLAG_RD, &pv_entry_spare, 0, "Current number of spare pv entries"); - -static int pmap_collect_inactive, pmap_collect_active; - -SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_collect_inactive, CTLFLAG_RD, &pmap_collect_inactive, 0, - "Current number times pmap_collect called on inactive queue"); -SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_collect_active, CTLFLAG_RD, &pmap_collect_active, 0, - "Current number times pmap_collect called on active queue"); #endif /* * We are in a serious low memory condition. Resort to * drastic measures to free some pages so we can allocate - * another pv entry chunk. This is normally called to - * unmap inactive pages, and if necessary, active pages. + * another pv entry chunk. */ -static void -pmap_collect(pmap_t locked_pmap, struct vpgqueues *vpq) +static vm_page_t +pmap_pv_reclaim(pmap_t locked_pmap) { + struct pch newtail; + struct pv_chunk *pc; + struct md_page *pvh; pd_entry_t *pde; pmap_t pmap; pt_entry_t *pte, tpte; - pv_entry_t next_pv, pv; + pv_entry_t pv; vm_offset_t va; - vm_page_t m, free; - + vm_page_t free, m, m_pc; + uint32_t inuse, freemask; + int bit, field, freed; + + PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); + pmap = NULL; + free = m_pc = NULL; + TAILQ_INIT(&newtail); sched_pin(); - TAILQ_FOREACH(m, &vpq->pl, pageq) { - if ((m->flags & PG_MARKER) != 0 || m->hold_count || m->busy) - continue; - TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) { - va = pv->pv_va; - pmap = PV_PMAP(pv); + while ((pc = TAILQ_FIRST(&pv_chunks)) != NULL && (pv_vafree == 0 || + free == NULL)) { + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + if (pmap != pc->pc_pmap) { + if (pmap != NULL) { + pmap_invalidate_all(pmap); + if (pmap != locked_pmap) + PMAP_UNLOCK(pmap); + } + pmap = pc->pc_pmap; /* Avoid deadlock and lock recursion. */ if (pmap > locked_pmap) PMAP_LOCK(pmap); - else if (pmap != locked_pmap && !PMAP_TRYLOCK(pmap)) + else if (pmap != locked_pmap && !PMAP_TRYLOCK(pmap)) { + pmap = NULL; + TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); continue; - pmap->pm_stats.resident_count--; - pde = pmap_pde(pmap, va); - KASSERT((*pde & PG_PS) == 0, ("pmap_collect: found" - " a 4mpage in page %p's pv list", m)); - pte = pmap_pte_quick(pmap, va); - tpte = pte_load_clear(pte); - KASSERT((tpte & PG_W) == 0, - ("pmap_collect: wired pte %#jx", (uintmax_t)tpte)); - if (tpte & PG_A) - vm_page_aflag_set(m, PGA_REFERENCED); - if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) - vm_page_dirty(m); - free = NULL; - pmap_unuse_pt(pmap, va, &free); - pmap_invalidate_page(pmap, va); - pmap_free_zero_pages(free); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); - free_pv_entry(pmap, pv); - if (pmap != locked_pmap) - PMAP_UNLOCK(pmap); + } + } + + /* + * Destroy every non-wired, 4 KB page mapping in the chunk. + */ + freed = 0; + for (field = 0; field < _NPCM; field++) { + freemask = 0; + for (inuse = ~pc->pc_map[field] & pc_freemask[field]; + inuse != 0; inuse &= ~(1UL << bit)) { + bit = bsfl(inuse); + pv = &pc->pc_pventry[field * 32 + bit]; + va = pv->pv_va; + pde = pmap_pde(pmap, va); + if ((*pde & PG_PS) != 0) + continue; + pte = pmap_pte_quick(pmap, va); + if ((*pte & PG_W) != 0) + continue; + tpte = pte_load_clear(pte); + if ((tpte & PG_G) != 0) + pmap_invalidate_page(pmap, va); + m = PHYS_TO_VM_PAGE(tpte & PG_FRAME); + if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) + vm_page_dirty(m); + if ((tpte & PG_A) != 0) + vm_page_aflag_set(m, PGA_REFERENCED); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + if (TAILQ_EMPTY(&m->md.pv_list) && + (m->flags & PG_FICTITIOUS) == 0) { + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + if (TAILQ_EMPTY(&pvh->pv_list)) { + vm_page_aflag_clear(m, + PGA_WRITEABLE); + } + } + pmap_unuse_pt(pmap, va, &free); + freemask |= 1UL << bit; + freed++; + } + pc->pc_map[field] |= freemask; + } + if (freed == 0) { + TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); + continue; + } + pmap->pm_stats.resident_count -= freed; + PV_STAT(pv_entry_frees += freed); + PV_STAT(pv_entry_spare += freed); + pv_entry_count -= freed; + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + for (field = 0; field < _NPCM; field++) + if (pc->pc_map[field] != pc_freemask[field]) { + TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, + pc_list); + TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); + + /* + * One freed pv entry in locked_pmap is + * sufficient. + */ + if (pmap == locked_pmap) + goto out; + break; + } + if (field == _NPCM) { + PV_STAT(pv_entry_spare -= _NPCPV); + PV_STAT(pc_chunk_count--); + PV_STAT(pc_chunk_frees++); + /* Entire chunk is free; return it. */ + m_pc = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc)); + pmap_qremove((vm_offset_t)pc, 1); + pmap_ptelist_free(&pv_vafree, (vm_offset_t)pc); + break; } - if (TAILQ_EMPTY(&m->md.pv_list) && - TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)) - vm_page_aflag_clear(m, PGA_WRITEABLE); } +out: sched_unpin(); + TAILQ_CONCAT(&pv_chunks, &newtail, pc_lru); + if (pmap != NULL) { + pmap_invalidate_all(pmap); + if (pmap != locked_pmap) + PMAP_UNLOCK(pmap); + } + if (m_pc == NULL && pv_vafree != 0 && free != NULL) { + m_pc = free; + free = m_pc->right; + /* Recycle a freed page table page. */ + m_pc->wire_count = 1; + atomic_add_int(&cnt.v_wire_count, 1); + } + pmap_free_zero_pages(free); + return (m_pc); } @@ -2280,6 +2356,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); return; } + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); PV_STAT(pv_entry_spare -= _NPCPV); PV_STAT(pc_chunk_count--); PV_STAT(pc_chunk_frees++); @@ -2300,7 +2377,6 @@ get_pv_entry(pmap_t pmap, int try) { static const struct timeval printinterval = { 60, 0 }; static struct timeval lastprint; - struct vpgqueues *pq; int bit, field; pv_entry_t pv; struct pv_chunk *pc; @@ -2315,7 +2391,6 @@ get_pv_entry(pmap_t pmap, int try) printf("Approaching the limit on PV entries, consider " "increasing either the vm.pmap.shpgperproc or the " "vm.pmap.pv_entry_max tunable.\n"); - pq = NULL; retry: pc = TAILQ_FIRST(&pmap->pm_pvchunk); if (pc != NULL) { @@ -2336,6 +2411,10 @@ retry: } TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); + if (pc != TAILQ_LAST(&pv_chunks, pch)) { + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + TAILQ_INSERT_TAIL(&pv_chunks, pc, pc_lru); + } PV_STAT(pv_entry_spare--); return (pv); } @@ -2345,29 +2424,16 @@ retry: * queues lock. If "pv_vafree" is currently non-empty, it will * remain non-empty until pmap_ptelist_alloc() completes. */ - if (pv_vafree == 0 || (m = vm_page_alloc(NULL, 0, (pq == - &vm_page_queues[PQ_ACTIVE] ? VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL) | + if (pv_vafree == 0 || (m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { if (try) { pv_entry_count--; PV_STAT(pc_chunk_tryfail++); return (NULL); } - /* - * Reclaim pv entries: At first, destroy mappings to - * inactive pages. After that, if a pv chunk entry - * is still needed, destroy mappings to active pages. - */ - if (pq == NULL) { - PV_STAT(pmap_collect_inactive++); - pq = &vm_page_queues[PQ_INACTIVE]; - } else if (pq == &vm_page_queues[PQ_INACTIVE]) { - PV_STAT(pmap_collect_active++); - pq = &vm_page_queues[PQ_ACTIVE]; - } else - panic("get_pv_entry: increase vm.pmap.shpgperproc"); - pmap_collect(pmap, pq); - goto retry; + m = pmap_pv_reclaim(pmap); + if (m == NULL) + goto retry; } PV_STAT(pc_chunk_count++); PV_STAT(pc_chunk_allocs++); @@ -2377,6 +2443,7 @@ retry: pc->pc_map[0] = pc_freemask[0] & ~1ul; /* preallocated bit 0 */ for (field = 1; field < _NPCM; field++) pc->pc_map[field] = pc_freemask[field]; + TAILQ_INSERT_TAIL(&pv_chunks, pc, pc_lru); pv = &pc->pc_pventry[0]; TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); PV_STAT(pv_entry_spare += _NPCPV - 1); @@ -4374,6 +4441,7 @@ pmap_remove_pages(pmap_t pmap) PV_STAT(pc_chunk_count--); PV_STAT(pc_chunk_frees++); TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc)); pmap_qremove((vm_offset_t)pc, 1); vm_page_unwire(m, 0); Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Sat May 26 05:29:53 2012 (r236044) +++ head/sys/i386/include/pmap.h Sat May 26 06:10:25 2012 (r236045) @@ -481,7 +481,7 @@ struct pv_chunk { pmap_t pc_pmap; TAILQ_ENTRY(pv_chunk) pc_list; uint32_t pc_map[_NPCM]; /* bitmap; 1 = free */ - uint32_t pc_spare[2]; + TAILQ_ENTRY(pv_chunk) pc_lru; struct pv_entry pc_pventry[_NPCPV]; }; From owner-svn-src-head@FreeBSD.ORG Sat May 26 06:31:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1EA4106566B; Sat, 26 May 2012 06:31:54 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD48C8FC08; Sat, 26 May 2012 06:31:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q6VsY7057010; Sat, 26 May 2012 06:31:54 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q6VsCj057008; Sat, 26 May 2012 06:31:54 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205260631.q4Q6VsCj057008@svn.freebsd.org> From: Joel Dahl Date: Sat, 26 May 2012 06:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236046 - head/usr.bin/sort X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 06:31:55 -0000 Author: joel (doc committer) Date: Sat May 26 06:31:54 2012 New Revision: 236046 URL: http://svn.freebsd.org/changeset/base/236046 Log: mdoc: sort sections into conventional order. Modified: head/usr.bin/sort/sort.1.in Modified: head/usr.bin/sort/sort.1.in ============================================================================== --- head/usr.bin/sort/sort.1.in Sat May 26 06:10:25 2012 (r236045) +++ head/usr.bin/sort/sort.1.in Sat May 26 06:31:54 2012 (r236046) @@ -501,27 +501,6 @@ option is still supported, except for which has no .Fl k equivalent. -.Sh EXIT STATUS -The -.Nm -utility shall exit with one of the following values: -.Pp -.Bl -tag -width flag -compact -.It 0 -Successfully sorted the input files or if used with -.Fl c -or -.Fl C , -the input file already met the sorting criteria. -.It 1 -On disorder (or non-uniqueness) with the -.Fl c -or -.Fl C -options. -.It 2 -An error occurred. -.El .Sh ENVIRONMENT .Bl -tag -width Fl .It Ev LC_COLLATE @@ -578,6 +557,27 @@ Temporary files. .It Pa /dev/random Default seed file for the random sort. .El +.Sh EXIT STATUS +The +.Nm +utility shall exit with one of the following values: +.Pp +.Bl -tag -width flag -compact +.It 0 +Successfully sorted the input files or if used with +.Fl c +or +.Fl C , +the input file already met the sorting criteria. +.It 1 +On disorder (or non-uniqueness) with the +.Fl c +or +.Fl C +options. +.It 2 +An error occurred. +.El .Sh SEE ALSO .Xr comm 1 , .Xr join 1 , From owner-svn-src-head@FreeBSD.ORG Sat May 26 08:03:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 741CF106564A; Sat, 26 May 2012 08:03:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F16C8FC12; Sat, 26 May 2012 08:03:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q83hHC061301; Sat, 26 May 2012 08:03:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q83h0G061298; Sat, 26 May 2012 08:03:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260803.q4Q83h0G061298@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236061 - head/sys/dev/sym X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:03:43 -0000 Author: marius Date: Sat May 26 08:03:42 2012 New Revision: 236061 URL: http://svn.freebsd.org/changeset/base/236061 Log: - When creating the DMA tag for user data, don't ask for more segments than required for handling MAXPHYS and report the resulting maximum I/O size to CAM instead of implicitly limiting it to DFLTPHYS. - Move the variables of sym_action2() out of nested scope as required by style(9) and remove extraneous curly braces. - Replace a magic value for PCIR_COMMAND with the appropriate macro. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. Tested with a HBA donated by wilko. MFC after: 3 days Modified: head/sys/dev/sym/sym_conf.h head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_conf.h ============================================================================== --- head/sys/dev/sym/sym_conf.h Sat May 26 08:02:45 2012 (r236060) +++ head/sys/dev/sym/sym_conf.h Sat May 26 08:03:42 2012 (r236061) @@ -83,6 +83,13 @@ #define SYM_CONF_MAX_TAG_ORDER (6) /* + * DMA boundary + * We need to ensure 16 MB boundaries not to be crossed during DMA of + * each segment, due to some chips being flawed. + */ +#define SYM_CONF_DMA_BOUNDARY (1UL << 24) + +/* * Max number of scatter/gather entries for en IO. * Each entry costs 8 bytes in the internal CCB data structure. * For now 65 should suffice given the BSD O/Ses capabilities. Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Sat May 26 08:02:45 2012 (r236060) +++ head/sys/dev/sym/sym_hipd.c Sat May 26 08:03:42 2012 (r236061) @@ -1623,6 +1623,7 @@ struct sym_hcb { u_int features; /* Chip features map */ u_char myaddr; /* SCSI id of the adapter */ u_char maxburst; /* log base 2 of dwords burst */ + u_char maxsegcnt; /* Max DMA S/G segments */ u_char maxwide; /* Maximum transfer width */ u_char minsync; /* Min sync period factor (ST) */ u_char maxsync; /* Max sync period factor (ST) */ @@ -7988,10 +7989,7 @@ sym_fast_scatter_sg_physical(hcb_p np, c /* * Scatter a SG list with physical addresses into bus addressable chunks. - * We need to ensure 16MB boundaries not to be crossed during DMA of - * each segment, due to some chips being flawed. */ -#define BOUND_MASK ((1UL<<24)-1) static int sym_scatter_sg_physical(hcb_p np, ccb_p cp, bus_dma_segment_t *psegs, int nsegs) { @@ -8007,7 +8005,7 @@ sym_scatter_sg_physical(hcb_p np, ccb_p pe = ps + psegs[t].ds_len; while (s >= 0) { - pn = (pe - 1) & ~BOUND_MASK; + pn = (pe - 1) & ~(SYM_CONF_DMA_BOUNDARY - 1); if (pn <= ps) pn = ps; k = pe - pn; @@ -8032,17 +8030,21 @@ sym_scatter_sg_physical(hcb_p np, ccb_p return t >= 0 ? -1 : 0; } -#undef BOUND_MASK /* * SIM action for non performance critical stuff. */ static void sym_action2(struct cam_sim *sim, union ccb *ccb) { + union ccb *abort_ccb; + struct ccb_hdr *ccb_h; + struct ccb_pathinq *cpi; + struct ccb_trans_settings *cts; + struct sym_trans *tip; hcb_p np; tcb_p tp; lcb_p lp; - struct ccb_hdr *ccb_h; + u_char dflags; /* * Retrieve our controller data structure. @@ -8055,9 +8057,6 @@ static void sym_action2(struct cam_sim * switch (ccb_h->func_code) { case XPT_SET_TRAN_SETTINGS: - { - struct ccb_trans_settings *cts; - cts = &ccb->cts; tp = &np->target[ccb_h->target_id]; @@ -8079,13 +8078,7 @@ static void sym_action2(struct cam_sim * sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; - } case XPT_GET_TRAN_SETTINGS: - { - struct ccb_trans_settings *cts; - struct sym_trans *tip; - u_char dflags; - cts = &ccb->cts; tp = &np->target[ccb_h->target_id]; lp = sym_lp(np, tp, ccb_h->target_lun); @@ -8129,16 +8122,12 @@ static void sym_action2(struct cam_sim * #undef cts__scsi sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; - } case XPT_CALC_GEOMETRY: - { cam_calc_geometry(&ccb->ccg, /*extended*/1); sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; - } case XPT_PATH_INQ: - { - struct ccb_pathinq *cpi = &ccb->cpi; + cpi = &ccb->cpi; cpi->version_num = 1; cpi->hba_inquiry = PI_MDP_ABLE|PI_SDTR_ABLE|PI_TAG_ABLE; if ((np->features & FE_WIDE) != 0) @@ -8173,12 +8162,11 @@ static void sym_action2(struct cam_sim * cpi->xport_specific.spi.ppr_options = SID_SPI_CLOCK_DT_ST; } + cpi->maxio = np->maxsegcnt * SYM_CONF_DMA_BOUNDARY; sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; - } case XPT_ABORT: - { - union ccb *abort_ccb = ccb->cab.abort_ccb; + abort_ccb = ccb->cab.abort_ccb; switch(abort_ccb->ccb_h.func_code) { case XPT_SCSI_IO: if (sym_abort_scsiio(np, abort_ccb, 0) == 0) { @@ -8190,14 +8178,10 @@ static void sym_action2(struct cam_sim * break; } break; - } case XPT_RESET_DEV: - { sym_reset_dev(np, ccb); break; - } case XPT_RESET_BUS: - { sym_reset_scsi_bus(np, 0); if (sym_verbose) { xpt_print_path(np->path); @@ -8206,7 +8190,6 @@ static void sym_action2(struct cam_sim * sym_init (np, 1); sym_xpt_done2(np, ccb, CAM_REQ_CMP); break; - } case XPT_ACCEPT_TARGET_IO: case XPT_CONT_TARGET_IO: case XPT_EN_LUN: @@ -8362,7 +8345,7 @@ sym_update_dflags(hcb_p np, u_char *flag static device_method_t sym_pci_methods[] = { DEVMETHOD(device_probe, sym_pci_probe), DEVMETHOD(device_attach, sym_pci_attach), - { 0, 0 } + DEVMETHOD_END }; static driver_t sym_pci_driver = { @@ -8373,7 +8356,7 @@ static driver_t sym_pci_driver = { static devclass_t sym_devclass; -DRIVER_MODULE(sym, pci, sym_pci_driver, sym_devclass, 0, 0); +DRIVER_MODULE(sym, pci, sym_pci_driver, sym_devclass, NULL, NULL); MODULE_DEPEND(sym, cam, 1, 1, 1); MODULE_DEPEND(sym, pci, 1, 1, 1); @@ -8586,15 +8569,16 @@ sym_pci_attach(device_t dev) /* * Allocate a tag for the DMA of user data. */ - if (bus_dma_tag_create(np->bus_dmat, 1, (1<<24), - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, - NULL, NULL, - BUS_SPACE_MAXSIZE, SYM_CONF_MAX_SG, - (1<<24), 0, busdma_lock_mutex, &np->mtx, - &np->data_dmat)) { + np->maxsegcnt = MIN(SYM_CONF_MAX_SG, + (MAXPHYS / SYM_CONF_DMA_BOUNDARY) + 1); + if (bus_dma_tag_create(np->bus_dmat, 1, SYM_CONF_DMA_BOUNDARY, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXSIZE, np->maxsegcnt, SYM_CONF_DMA_BOUNDARY, + BUS_DMA_ALLOCNOW, busdma_lock_mutex, &np->mtx, &np->data_dmat)) { device_printf(dev, "failed to create DMA tag.\n"); goto attach_failed; } + /* * Read and apply some fix-ups to the PCI COMMAND * register. We want the chip to be enabled for: @@ -8603,9 +8587,8 @@ sym_pci_attach(device_t dev) * - Write And Invalidate. */ command = pci_read_config(dev, PCIR_COMMAND, 2); - command |= PCIM_CMD_BUSMASTEREN; - command |= PCIM_CMD_PERRESPEN; - command |= /* PCIM_CMD_MWIEN */ 0x0010; + command |= PCIM_CMD_BUSMASTEREN | PCIM_CMD_PERRESPEN | + PCIM_CMD_MWRICEN; pci_write_config(dev, PCIR_COMMAND, command, 2); /* From owner-svn-src-head@FreeBSD.ORG Sat May 26 08:09:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88463106564A; Sat, 26 May 2012 08:09:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72CDD8FC08; Sat, 26 May 2012 08:09:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q892hj061534; Sat, 26 May 2012 08:09:02 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q892RD061532; Sat, 26 May 2012 08:09:02 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201205260809.q4Q892RD061532@svn.freebsd.org> From: Andrew Thompson Date: Sat, 26 May 2012 08:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236062 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:09:02 -0000 Author: thompsa Date: Sat May 26 08:09:01 2012 New Revision: 236062 URL: http://svn.freebsd.org/changeset/base/236062 Log: Turn LACP debugging from a compile time option to a sysctl, it is very handy to be able to turn it on when negotiation to a switch misbehaves. Submitted by: Andrew Boyer MFC after: 3 days Modified: head/sys/net/ieee8023ad_lacp.c Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Sat May 26 08:03:42 2012 (r236061) +++ head/sys/net/ieee8023ad_lacp.c Sat May 26 08:09:01 2012 (r236062) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include /* hz */ #include /* for net/if.h */ #include +#include #include #include #include @@ -168,7 +169,8 @@ static void lacp_enable_distributing(str static int lacp_xmit_lacpdu(struct lacp_port *); static int lacp_xmit_marker(struct lacp_port *); -#if defined(LACP_DEBUG) +/* Debugging */ + static void lacp_dump_lacpdu(const struct lacpdu *); static const char *lacp_format_partner(const struct lacp_peerinfo *, char *, size_t); @@ -184,10 +186,14 @@ static const char *lacp_format_portid(co size_t); static void lacp_dprintf(const struct lacp_port *, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); -#define LACP_DPRINTF(a) lacp_dprintf a -#else -#define LACP_DPRINTF(a) /* nothing */ -#endif + +static int lacp_debug = 0; +SYSCTL_INT(_net, OID_AUTO, lacp_debug, CTLFLAG_RW | CTLFLAG_TUN, + &lacp_debug, 0, "Enable LACP debug logging (1=debug, 2=trace)"); +TUNABLE_INT("net.lacp_debug", &lacp_debug); + +#define LACP_DPRINTF(a) if (lacp_debug > 0) { lacp_dprintf a ; } +#define LACP_TRACE(a) if (lacp_debug > 1) { lacp_dprintf(a,"%s\n",__func__); } /* * partner administration variables. @@ -290,10 +296,10 @@ lacp_pdu_input(struct lacp_port *lp, str goto bad; } -#if defined(LACP_DEBUG) - LACP_DPRINTF((lp, "lacpdu receive\n")); - lacp_dump_lacpdu(du); -#endif /* defined(LACP_DEBUG) */ + if (lacp_debug > 0) { + lacp_dprintf(lp, "lacpdu receive\n"); + lacp_dump_lacpdu(du); + } LACP_LOCK(lsc); lacp_sm_rx(lp, du); @@ -370,10 +376,10 @@ lacp_xmit_lacpdu(struct lacp_port *lp) sizeof(du->ldu_collector)); du->ldu_collector.lci_maxdelay = 0; -#if defined(LACP_DEBUG) - LACP_DPRINTF((lp, "lacpdu transmit\n")); - lacp_dump_lacpdu(du); -#endif /* defined(LACP_DEBUG) */ + if (lacp_debug > 0) { + lacp_dprintf(lp, "lacpdu transmit\n"); + lacp_dump_lacpdu(du); + } m->m_flags |= M_MCAST; @@ -647,9 +653,7 @@ lacp_disable_distributing(struct lacp_po { struct lacp_aggregator *la = lp->lp_aggregator; struct lacp_softc *lsc = lp->lp_lsc; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif /* defined(LACP_DEBUG) */ LACP_LOCK_ASSERT(lsc); @@ -684,9 +688,7 @@ lacp_enable_distributing(struct lacp_por { struct lacp_aggregator *la = lp->lp_aggregator; struct lacp_softc *lsc = lp->lp_lsc; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif /* defined(LACP_DEBUG) */ LACP_LOCK_ASSERT(lsc); @@ -720,7 +722,8 @@ lacp_transit_expire(void *vp) LACP_LOCK_ASSERT(lsc); - LACP_DPRINTF((NULL, "%s\n", __func__)); + LACP_TRACE(NULL); + lsc->lsc_suppress_distributing = FALSE; } @@ -838,7 +841,8 @@ lacp_suppress_distributing(struct lacp_s return; } - LACP_DPRINTF((NULL, "%s\n", __func__)); + LACP_TRACE(NULL); + lsc->lsc_suppress_distributing = TRUE; /* send a marker frame down each port to verify the queues are empty */ @@ -908,11 +912,9 @@ lacp_select_active_aggregator(struct lac struct lacp_aggregator *la; struct lacp_aggregator *best_la = NULL; uint64_t best_speed = 0; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif /* defined(LACP_DEBUG) */ - LACP_DPRINTF((NULL, "%s:\n", __func__)); + LACP_TRACE(NULL); TAILQ_FOREACH(la, &lsc->lsc_aggregators, la_q) { uint64_t speed; @@ -946,7 +948,6 @@ lacp_select_active_aggregator(struct lac KASSERT(best_la == NULL || !TAILQ_EMPTY(&best_la->la_ports), ("invalid aggregator list")); -#if defined(LACP_DEBUG) if (lsc->lsc_active_aggregator != best_la) { LACP_DPRINTF((NULL, "active aggregator changed\n")); LACP_DPRINTF((NULL, "old %s\n", @@ -957,7 +958,6 @@ lacp_select_active_aggregator(struct lac } LACP_DPRINTF((NULL, "new %s\n", lacp_format_lagid_aggregator(best_la, buf, sizeof(buf)))); -#endif /* defined(LACP_DEBUG) */ if (lsc->lsc_active_aggregator != best_la) { sc->sc_ifp->if_baudrate = best_speed; @@ -1040,9 +1040,7 @@ lacp_compose_key(struct lacp_port *lp) static void lacp_aggregator_addref(struct lacp_softc *lsc, struct lacp_aggregator *la) { -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif LACP_DPRINTF((NULL, "%s: lagid=%s, refcnt %d -> %d\n", __func__, @@ -1058,9 +1056,7 @@ lacp_aggregator_addref(struct lacp_softc static void lacp_aggregator_delref(struct lacp_softc *lsc, struct lacp_aggregator *la) { -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif LACP_DPRINTF((NULL, "%s: lagid=%s, refcnt %d -> %d\n", __func__, @@ -1195,9 +1191,7 @@ lacp_select(struct lacp_port *lp) { struct lacp_softc *lsc = lp->lp_lsc; struct lacp_aggregator *la; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif if (lp->lp_aggregator) { return; @@ -1278,7 +1272,8 @@ lacp_sm_mux(struct lacp_port *lp) enum lacp_selected selected = lp->lp_selected; struct lacp_aggregator *la; - /* LACP_DPRINTF((lp, "%s: state %d\n", __func__, lp->lp_mux_state)); */ + if (lacp_debug > 1) + lacp_dprintf(lp, "%s: state %d\n", __func__, lp->lp_mux_state); re_eval: la = lp->lp_aggregator; @@ -1387,9 +1382,7 @@ static void lacp_sm_mux_timer(struct lacp_port *lp) { struct lacp_aggregator *la = lp->lp_aggregator; -#if defined(LACP_DEBUG) char buf[LACP_LAGIDSTR_MAX+1]; -#endif KASSERT(la->la_pending > 0, ("no pending event")); @@ -1537,11 +1530,9 @@ lacp_sm_rx_record_pdu(struct lacp_port * { boolean_t active; uint8_t oldpstate; -#if defined(LACP_DEBUG) char buf[LACP_STATESTR_MAX+1]; -#endif - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + LACP_TRACE(lp); oldpstate = lp->lp_partner.lip_state; @@ -1576,7 +1567,8 @@ lacp_sm_rx_record_pdu(struct lacp_port * static void lacp_sm_rx_update_ntt(struct lacp_port *lp, const struct lacpdu *du) { - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + + LACP_TRACE(lp); if (lacp_compare_peerinfo(&lp->lp_actor, &du->ldu_partner) || !LACP_STATE_EQ(lp->lp_state, du->ldu_partner.lip_state, @@ -1591,7 +1583,7 @@ lacp_sm_rx_record_default(struct lacp_po { uint8_t oldpstate; - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + LACP_TRACE(lp); oldpstate = lp->lp_partner.lip_state; lp->lp_partner = lacp_partner_admin; @@ -1603,7 +1595,8 @@ static void lacp_sm_rx_update_selected_from_peerinfo(struct lacp_port *lp, const struct lacp_peerinfo *info) { - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + + LACP_TRACE(lp); if (lacp_compare_peerinfo(&lp->lp_partner, info) || !LACP_STATE_EQ(lp->lp_partner.lip_state, info->lip_state, @@ -1616,7 +1609,8 @@ lacp_sm_rx_update_selected_from_peerinfo static void lacp_sm_rx_update_selected(struct lacp_port *lp, const struct lacpdu *du) { - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + + LACP_TRACE(lp); lacp_sm_rx_update_selected_from_peerinfo(lp, &du->ldu_actor); } @@ -1624,7 +1618,8 @@ lacp_sm_rx_update_selected(struct lacp_p static void lacp_sm_rx_update_default_selected(struct lacp_port *lp) { - /* LACP_DPRINTF((lp, "%s\n", __func__)); */ + + LACP_TRACE(lp); lacp_sm_rx_update_selected_from_peerinfo(lp, &lacp_partner_admin); } @@ -1812,7 +1807,7 @@ tlv_check(const void *p, size_t size, co return (0); } -#if defined(LACP_DEBUG) +/* Debugging */ const char * lacp_format_mac(const uint8_t *mac, char *buf, size_t buflen) { @@ -1942,4 +1937,3 @@ lacp_dprintf(const struct lacp_port *lp, vprintf(fmt, va); va_end(va); } -#endif From owner-svn-src-head@FreeBSD.ORG Sat May 26 08:17:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8162F106564A; Sat, 26 May 2012 08:17:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C2C08FC08; Sat, 26 May 2012 08:17:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q8HVgs061912; Sat, 26 May 2012 08:17:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8HVnD061910; Sat, 26 May 2012 08:17:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260817.q4Q8HVnD061910@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236063 - head/sys/dev/sym X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:17:31 -0000 Author: marius Date: Sat May 26 08:17:30 2012 New Revision: 236063 URL: http://svn.freebsd.org/changeset/base/236063 Log: Remove extraneous empty lines. MFC after: 3 day Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Sat May 26 08:09:01 2012 (r236062) +++ head/sys/dev/sym/sym_hipd.c Sat May 26 08:17:30 2012 (r236063) @@ -70,7 +70,6 @@ __FBSDID("$FreeBSD$"); #include "opt_sym.h" #include - #include #include #include @@ -128,7 +127,6 @@ typedef u_int32_t u32; * requires memory barriers (and also IO barriers when they * make sense) to be used. */ - #if defined __i386__ || defined __amd64__ #define MEMORY_BARRIER() do { ; } while(0) #elif defined __powerpc__ @@ -144,7 +142,6 @@ typedef u_int32_t u32; /* * A la VMS/CAM-3 queue management. */ - typedef struct sym_quehead { struct sym_quehead *flink; /* Forward pointer */ struct sym_quehead *blink; /* Backward pointer */ @@ -206,7 +203,6 @@ static __inline void sym_que_splice(stru #define sym_que_entry(ptr, type, member) \ ((type *)((char *)(ptr)-(size_t)(&((type *)0)->member))) - #define sym_insque(new, pos) __sym_que_add(new, pos, (pos)->flink) #define sym_remque(el) __sym_que_del((el)->blink, (el)->flink) @@ -373,7 +369,6 @@ static void MDELAY(int ms) { while (ms-- * pages of memory that will be useful if we ever need to deal * with IO MMUs for PCI. */ - #define MEMO_SHIFT 4 /* 16 bytes minimum memory chunk */ #define MEMO_PAGE_ORDER 0 /* 1 PAGE maximum */ #if 0 @@ -567,7 +562,6 @@ static m_pool_s mp0 = {0, 0, ___mp0_getp static m_pool_s mp0 = {0, 0, ___mp0_getp}; #endif - /* * Actual memory allocation routine for non-DMAed memory. */ @@ -768,7 +762,6 @@ static m_addr_t __vtobus(bus_dma_tag_t d return vp ? vp->baddr + (((m_addr_t) m) - a) : 0; } - /* * Verbs for DMAable memory handling. * The _uvptv_ macro avoids a nasty warning about pointer to volatile @@ -783,7 +776,6 @@ static m_addr_t __vtobus(bus_dma_tag_t d #define _vtobus(np, p) __vtobus(np->bus_dmat, _uvptv_(p)) #define vtobus(p) _vtobus(np, p) - /* * Print a buffer in hexadecimal format. */ @@ -858,14 +850,12 @@ struct sym_nvram { * Symbios chips (never seen, by the way). * For now, this stuff does not deserve any comments. :) */ - #define sym_offb(o) (o) #define sym_offw(o) (o) /* * Some provision for support for BIG ENDIAN CPU. */ - #define cpu_to_scr(dw) htole32(dw) #define scr_to_cpu(dw) le32toh(dw) @@ -874,8 +864,6 @@ struct sym_nvram { * We use the `bus space' interface under FreeBSD-4 and * later kernel versions. */ - - #if defined(SYM_CONF_IOMAPPED) #define INB_OFF(o) bus_read_1(np->io_res, (o)) @@ -901,7 +889,6 @@ struct sym_nvram { #define OUTRAM_OFF(o, a, l) \ bus_write_region_1(np->ram_res, (o), (a), (l)) - /* * Common definitions for both bus space and legacy IO methods. */ @@ -1333,7 +1320,6 @@ struct sym_pmc { * For SYMBIOS chips that support LOAD/STORE this copy is * not needed and thus not performed. */ - struct sym_ccbh { /* * Start and restart SCRIPTS addresses (must be at 0). @@ -1749,7 +1735,6 @@ static __inline const char *sym_name(hcb #define PADDR_A(label) SYM_GEN_PADDR_A(struct SYM_FWA_SCR, label) #define PADDR_B(label) SYM_GEN_PADDR_B(struct SYM_FWB_SCR, label) - #ifdef SYM_CONF_GENERIC_SUPPORT /* * Allocate firmware #1 script area. @@ -2453,7 +2438,6 @@ static __inline void sym_init_burst(hcb_ } } - /* * Print out the list of targets that have some flag disabled by user. */ @@ -2848,7 +2832,6 @@ static int sym_prepare_setting(hcb_p np, * negotiation and the nego_status field of the CCB. * Returns the size of the message in bytes. */ - static int sym_prepare_nego(hcb_p np, ccb_p cp, int nego, u_char *msgptr) { tcb_p tp = &np->target[cp->target]; @@ -2966,7 +2949,6 @@ static void sym_put_start_queue(hcb_p np OUTB (nc_istat, SIGP|np->istat_sem); } - /* * Soft reset the chip. * @@ -3842,7 +3824,6 @@ static void sym_log_hard_error(hcb_p np, * ask me for any guarantee that it will never fail. :-) * Use at your own decision and risk. */ - static void sym_intr1 (hcb_p np) { u_char istat, istatc; @@ -4004,7 +3985,6 @@ static void sym_poll(struct cam_sim *sim sym_intr1(cam_sim_softc(sim)); } - /* * generic recovery from scsi interrupt * @@ -5292,7 +5272,6 @@ static void sym_sir_task_recovery(hcb_p * offset (basically from the MDP message) and returns * the corresponding values of dp_sg and dp_ofs. */ - static int sym_evaluate_dp(hcb_p np, ccb_p cp, u32 scr, int *ofs) { u32 dp_scr; @@ -5410,7 +5389,6 @@ out_err: * Btw, we assume in that situation that such a message * is equivalent to a MODIFY DATA POINTER (offset=-1). */ - static void sym_modify_dp(hcb_p np, tcb_p tp, ccb_p cp, int ofs) { int dp_ofs = ofs; @@ -5494,7 +5472,6 @@ out_reject: OUTL_DSP (SCRIPTB_BA (np, msg_bad)); } - /* * chip calculation of the data residual. * @@ -5509,7 +5486,6 @@ out_reject: * any software that considers this data residual as * a relevant information. :) */ - static int sym_compute_residual(hcb_p np, ccb_p cp) { int dp_sg, dp_sgmin, resid = 0; @@ -5575,7 +5551,6 @@ static int sym_compute_residual(hcb_p np /* * Print out the content of a SCSI message. */ - static int sym_show_msg (u_char * msg) { u_char i; @@ -7771,7 +7746,6 @@ sym_setup_data_pointers(hcb_p np, ccb_p cp->startp = cp->phys.head.savep; } - /* * Call back routine for the DMA map service. * If bounce buffers are used (why ?), we may sleep and then @@ -7986,7 +7960,6 @@ sym_fast_scatter_sg_physical(hcb_p np, c return 0; } - /* * Scatter a SG list with physical addresses into bus addressable chunks. */ @@ -8338,10 +8311,8 @@ sym_update_dflags(hcb_p np, u_char *flag #undef cts__scsi } - /*============= DRIVER INITIALISATION ==================*/ - static device_method_t sym_pci_methods[] = { DEVMETHOD(device_probe, sym_pci_probe), DEVMETHOD(device_attach, sym_pci_attach), @@ -8360,7 +8331,6 @@ DRIVER_MODULE(sym, pci, sym_pci_driver, MODULE_DEPEND(sym, cam, 1, 1, 1); MODULE_DEPEND(sym, pci, 1, 1, 1); - static const struct sym_pci_chip sym_pci_dev_table[] = { {PCI_ID_SYM53C810, 0x0f, "810", 4, 8, 4, 64, FE_ERL} @@ -9260,7 +9230,6 @@ static void sym_display_Tekram_nvram(hcb #endif /* SYM_CONF_DEBUG_NVRAM */ #endif /* SYM_CONF_NVRAM_SUPPORT */ - /* * Try reading Symbios or Tekram NVRAM */ @@ -9298,7 +9267,6 @@ static int sym_read_nvram(hcb_p np, stru return nvp->type; } - #ifdef SYM_CONF_NVRAM_SUPPORT /* * 24C16 EEPROM reading. From owner-svn-src-head@FreeBSD.ORG Sat May 26 08:31:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0312106564A; Sat, 26 May 2012 08:31:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBA6F8FC08; Sat, 26 May 2012 08:31:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q8VCik062664; Sat, 26 May 2012 08:31:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8VCs2062662; Sat, 26 May 2012 08:31:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260831.q4Q8VCs2062662@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236069 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:31:13 -0000 Author: marius Date: Sat May 26 08:31:12 2012 New Revision: 236069 URL: http://svn.freebsd.org/changeset/base/236069 Log: Make the VIA workaround actually do its intended job. MFC after: 3 days Modified: head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Sat May 26 08:25:41 2012 (r236068) +++ head/sys/dev/usb/controller/ehci_pci.c Sat May 26 08:31:12 2012 (r236069) @@ -243,7 +243,7 @@ ehci_pci_via_quirk(device_t self) val = pci_read_config(self, 0x4b, 1); if (val & 0x20) return; - pci_write_config(self, 0x4b, val, 1); + pci_write_config(self, 0x4b, val | 0x20, 1); device_printf(self, "VIA-quirk applied\n"); } } From owner-svn-src-head@FreeBSD.ORG Sat May 26 08:33:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AAF691065670; Sat, 26 May 2012 08:33:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 978548FC14; Sat, 26 May 2012 08:33:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q8XrYk062809; Sat, 26 May 2012 08:33:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8Xr1l062807; Sat, 26 May 2012 08:33:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260833.q4Q8Xr1l062807@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236070 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:33:53 -0000 Author: marius Date: Sat May 26 08:33:53 2012 New Revision: 236070 URL: http://svn.freebsd.org/changeset/base/236070 Log: Consistently use USB_PAGE_SIZE. Currently, this is cosmetic. MFC after: 3 days Modified: head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Sat May 26 08:31:12 2012 (r236069) +++ head/sys/dev/usb/usb_transfer.c Sat May 26 08:33:53 2012 (r236070) @@ -217,12 +217,12 @@ usbd_transfer_setup_sub_malloc(struct us * Try multi-allocation chunks to reduce the number of DMA * allocations, hence DMA allocations are slow. */ - if (size >= PAGE_SIZE) { + if (size >= USB_PAGE_SIZE) { n_dma_pc = count; n_obj = 1; } else { /* compute number of objects per page */ - n_obj = (PAGE_SIZE / size); + n_obj = (USB_PAGE_SIZE / size); /* * Compute number of DMA chunks, rounded up * to nearest one: From owner-svn-src-head@FreeBSD.ORG Sat May 26 08:43:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9336106566B; Sat, 26 May 2012 08:43:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B48B38FC0C; Sat, 26 May 2012 08:43:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q8hpPh063309; Sat, 26 May 2012 08:43:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q8hppm063307; Sat, 26 May 2012 08:43:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205260843.q4Q8hppm063307@svn.freebsd.org> From: Marius Strobl Date: Sat, 26 May 2012 08:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236073 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 08:43:51 -0000 Author: marius Date: Sat May 26 08:43:51 2012 New Revision: 236073 URL: http://svn.freebsd.org/changeset/base/236073 Log: Make the VIA workaround application somewhat more consistent with the ATI one. Modified: head/sys/dev/usb/controller/ehci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Sat May 26 08:41:48 2012 (r236072) +++ head/sys/dev/usb/controller/ehci_pci.c Sat May 26 08:43:51 2012 (r236073) @@ -243,7 +243,8 @@ ehci_pci_via_quirk(device_t self) val = pci_read_config(self, 0x4b, 1); if (val & 0x20) return; - pci_write_config(self, 0x4b, val | 0x20, 1); + val |= 0x20; + pci_write_config(self, 0x4b, val, 1); device_printf(self, "VIA-quirk applied\n"); } } From owner-svn-src-head@FreeBSD.ORG Sat May 26 09:16:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3123106564A; Sat, 26 May 2012 09:16:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C48FE8FC1D; Sat, 26 May 2012 09:16:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4Q9GX80065451; Sat, 26 May 2012 09:16:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4Q9GXdl065446; Sat, 26 May 2012 09:16:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205260916.q4Q9GXdl065446@svn.freebsd.org> From: Michael Tuexen Date: Sat, 26 May 2012 09:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236087 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 09:16:34 -0000 Author: tuexen Date: Sat May 26 09:16:33 2012 New Revision: 236087 URL: http://svn.freebsd.org/changeset/base/236087 Log: Get rid of SCTP specific code to avoid CRC32C computations on loopback. Just just offloading. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat May 26 09:13:38 2012 (r236086) +++ head/sys/netinet/sctp_output.c Sat May 26 09:16:33 2012 (r236087) @@ -4116,14 +4116,8 @@ sctp_lowlevel_chunk_output(struct sctp_i #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) && - (stcb) && - (stcb->asoc.loopback_scope))) { - sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); - } else { - SCTP_STAT_INCR(sctps_sendnocrc); - } + sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip) + sizeof(struct udphdr)); + SCTP_STAT_INCR(sctps_sendswcrc); #endif if (V_udp_cksum) { SCTP_ENABLE_UDP_CSUM(o_pak); @@ -4474,14 +4468,8 @@ sctp_lowlevel_chunk_output(struct sctp_i #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) && - (stcb) && - (stcb->asoc.loopback_scope))) { - sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); - } else { - SCTP_STAT_INCR(sctps_sendnocrc); - } + sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); + SCTP_STAT_INCR(sctps_sendswcrc); #endif if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), packet_length - sizeof(struct ip6_hdr))) == 0) { udp->uh_sum = 0xffff; Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sat May 26 09:13:38 2012 (r236086) +++ head/sys/netinet/sctp_sysctl.c Sat May 26 09:16:33 2012 (r236087) @@ -55,9 +55,6 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_multiple_asconfs) = SCTPCTL_MULTIPLEASCONFS_DEFAULT; SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_strict_sacks) = SCTPCTL_STRICT_SACKS_DEFAULT; -#if !defined(SCTP_WITH_NO_CSUM) - SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) = SCTPCTL_LOOPBACK_NOCSUM_DEFAULT; -#endif SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT; @@ -604,9 +601,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_auto_asconf), SCTPCTL_AUTOASCONF_MIN, SCTPCTL_AUTOASCONF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); -#if !defined(SCTP_WITH_NO_CSUM) - RANGECHK(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), SCTPCTL_LOOPBACK_NOCSUM_MIN, SCTPCTL_LOOPBACK_NOCSUM_MAX); -#endif RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); @@ -870,11 +864,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_SACKS_DESC); -#if !defined(SCTP_WITH_NO_CSUM) -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU", - SCTPCTL_LOOPBACK_NOCSUM_DESC); -#endif SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Sat May 26 09:13:38 2012 (r236086) +++ head/sys/netinet/sctp_sysctl.h Sat May 26 09:16:33 2012 (r236087) @@ -47,9 +47,6 @@ struct sctp_sysctl { uint32_t sctp_ecn_enable; uint32_t sctp_fr_max_burst_default; uint32_t sctp_strict_sacks; -#if !defined(SCTP_WITH_NO_CSUM) - uint32_t sctp_no_csum_on_loopback; -#endif uint32_t sctp_peer_chunk_oh; uint32_t sctp_max_burst_default; uint32_t sctp_max_chunks_on_queue; Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sat May 26 09:13:38 2012 (r236086) +++ head/sys/netinet6/sctp6_usrreq.c Sat May 26 09:16:33 2012 (r236087) @@ -150,11 +150,6 @@ sctp6_input(struct mbuf **i_pak, int *of goto sctp_skip_csum; } check = sh->checksum; /* save incoming checksum */ - if ((check == 0) && (SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback)) && - (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src, &ip6->ip6_dst))) { - SCTP_STAT_INCR(sctps_recvnocrc); - goto sctp_skip_csum; - } sh->checksum = 0; /* prepare for calc */ calc_check = sctp_calculate_cksum(m, iphlen); SCTP_STAT_INCR(sctps_recvswcrc); From owner-svn-src-head@FreeBSD.ORG Sat May 26 10:28:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C00721065674; Sat, 26 May 2012 10:28:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABF548FC18; Sat, 26 May 2012 10:28:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QASBP7072362; Sat, 26 May 2012 10:28:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QASBCj072360; Sat, 26 May 2012 10:28:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205261028.q4QASBCj072360@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 26 May 2012 10:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236093 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 10:28:11 -0000 Author: bz Date: Sat May 26 10:28:11 2012 New Revision: 236093 URL: http://svn.freebsd.org/changeset/base/236093 Log: Trim the extra $FreeBSD$ from the comment below the license. We use the __FBSDID() macro on the file now instead. MFC after: 3 days Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Sat May 26 10:24:35 2012 (r236092) +++ head/sys/netinet/tcp_lro.c Sat May 26 10:28:11 2012 (r236093) @@ -27,8 +27,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #include From owner-svn-src-head@FreeBSD.ORG Sat May 26 12:15:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F305106564A; Sat, 26 May 2012 12:15:14 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 487228FC08; Sat, 26 May 2012 12:15:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QCFEJ1076721; Sat, 26 May 2012 12:15:14 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QCFEBa076719; Sat, 26 May 2012 12:15:14 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205261215.q4QCFEBa076719@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 12:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236094 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 12:15:14 -0000 Author: raj Date: Sat May 26 12:15:13 2012 New Revision: 236094 URL: http://svn.freebsd.org/changeset/base/236094 Log: Unify SPR defines formatting, no funtional changes. Modified: head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sat May 26 10:28:11 2012 (r236093) +++ head/sys/powerpc/include/spr.h Sat May 26 12:15:13 2012 (r236094) @@ -115,9 +115,9 @@ #define SRR1_ISI_NOEXECUTE 0x10000000 /* Memory marked no-execute */ #define SRR1_ISI_PP 0x08000000 /* PP bits forbid access */ #define SPR_DECAR 0x036 /* ..8 Decrementer auto reload */ -#define SPR_EIE 0x050 /* ..8 Exception Interrupt ??? */ -#define SPR_EID 0x051 /* ..8 Exception Interrupt ??? */ -#define SPR_NRI 0x052 /* ..8 Exception Interrupt ??? */ +#define SPR_EIE 0x050 /* ..8 Exception Interrupt ??? */ +#define SPR_EID 0x051 /* ..8 Exception Interrupt ??? */ +#define SPR_NRI 0x052 /* ..8 Exception Interrupt ??? */ #define SPR_USPRG0 0x100 /* 4.. User SPR General 0 */ #define SPR_VRSAVE 0x100 /* .6. AltiVec VRSAVE */ #define SPR_SPRG0 0x110 /* 468 SPR General 0 */ @@ -202,49 +202,49 @@ #define SPR_DBAT2L 0x21d /* .6. Data BAT Reg 2 Lower */ #define SPR_DBAT3U 0x21e /* .6. Data BAT Reg 3 Upper */ #define SPR_DBAT3L 0x21f /* .6. Data BAT Reg 3 Lower */ -#define SPR_IC_CST 0x230 /* ..8 Instruction Cache CSR */ -#define IC_CST_IEN 0x80000000 /* I cache is ENabled (RO) */ -#define IC_CST_CMD_INVALL 0x0c000000 /* I cache invalidate all */ -#define IC_CST_CMD_UNLOCKALL 0x0a000000 /* I cache unlock all */ -#define IC_CST_CMD_UNLOCK 0x08000000 /* I cache unlock block */ -#define IC_CST_CMD_LOADLOCK 0x06000000 /* I cache load & lock block */ -#define IC_CST_CMD_DISABLE 0x04000000 /* I cache disable */ -#define IC_CST_CMD_ENABLE 0x02000000 /* I cache enable */ -#define IC_CST_CCER1 0x00200000 /* I cache error type 1 (RO) */ -#define IC_CST_CCER2 0x00100000 /* I cache error type 2 (RO) */ -#define IC_CST_CCER3 0x00080000 /* I cache error type 3 (RO) */ +#define SPR_IC_CST 0x230 /* ..8 Instruction Cache CSR */ +#define IC_CST_IEN 0x80000000 /* I cache is ENabled (RO) */ +#define IC_CST_CMD_INVALL 0x0c000000 /* I cache invalidate all */ +#define IC_CST_CMD_UNLOCKALL 0x0a000000 /* I cache unlock all */ +#define IC_CST_CMD_UNLOCK 0x08000000 /* I cache unlock block */ +#define IC_CST_CMD_LOADLOCK 0x06000000 /* I cache load & lock block */ +#define IC_CST_CMD_DISABLE 0x04000000 /* I cache disable */ +#define IC_CST_CMD_ENABLE 0x02000000 /* I cache enable */ +#define IC_CST_CCER1 0x00200000 /* I cache error type 1 (RO) */ +#define IC_CST_CCER2 0x00100000 /* I cache error type 2 (RO) */ +#define IC_CST_CCER3 0x00080000 /* I cache error type 3 (RO) */ #define SPR_IBAT4U 0x230 /* .6. Instruction BAT Reg 4 Upper */ -#define SPR_IC_ADR 0x231 /* ..8 Instruction Cache Address */ +#define SPR_IC_ADR 0x231 /* ..8 Instruction Cache Address */ #define SPR_IBAT4L 0x231 /* .6. Instruction BAT Reg 4 Lower */ -#define SPR_IC_DAT 0x232 /* ..8 Instruction Cache Data */ +#define SPR_IC_DAT 0x232 /* ..8 Instruction Cache Data */ #define SPR_IBAT5U 0x232 /* .6. Instruction BAT Reg 5 Upper */ #define SPR_IBAT5L 0x233 /* .6. Instruction BAT Reg 5 Lower */ #define SPR_IBAT6U 0x234 /* .6. Instruction BAT Reg 6 Upper */ #define SPR_IBAT6L 0x235 /* .6. Instruction BAT Reg 6 Lower */ #define SPR_IBAT7U 0x236 /* .6. Instruction BAT Reg 7 Upper */ #define SPR_IBAT7L 0x237 /* .6. Instruction BAT Reg 7 Lower */ -#define SPR_DC_CST 0x230 /* ..8 Data Cache CSR */ -#define DC_CST_DEN 0x80000000 /* D cache ENabled (RO) */ -#define DC_CST_DFWT 0x40000000 /* D cache Force Write-Thru (RO) */ -#define DC_CST_LES 0x20000000 /* D cache Little Endian Swap (RO) */ -#define DC_CST_CMD_FLUSH 0x0e000000 /* D cache invalidate all */ -#define DC_CST_CMD_INVALL 0x0c000000 /* D cache invalidate all */ -#define DC_CST_CMD_UNLOCKALL 0x0a000000 /* D cache unlock all */ -#define DC_CST_CMD_UNLOCK 0x08000000 /* D cache unlock block */ -#define DC_CST_CMD_CLRLESWAP 0x07000000 /* D cache clr little-endian swap */ -#define DC_CST_CMD_LOADLOCK 0x06000000 /* D cache load & lock block */ -#define DC_CST_CMD_SETLESWAP 0x05000000 /* D cache set little-endian swap */ -#define DC_CST_CMD_DISABLE 0x04000000 /* D cache disable */ -#define DC_CST_CMD_CLRFWT 0x03000000 /* D cache clear forced write-thru */ -#define DC_CST_CMD_ENABLE 0x02000000 /* D cache enable */ -#define DC_CST_CMD_SETFWT 0x01000000 /* D cache set forced write-thru */ -#define DC_CST_CCER1 0x00200000 /* D cache error type 1 (RO) */ -#define DC_CST_CCER2 0x00100000 /* D cache error type 2 (RO) */ -#define DC_CST_CCER3 0x00080000 /* D cache error type 3 (RO) */ +#define SPR_DC_CST 0x230 /* ..8 Data Cache CSR */ +#define DC_CST_DEN 0x80000000 /* D cache ENabled (RO) */ +#define DC_CST_DFWT 0x40000000 /* D cache Force Write-Thru (RO) */ +#define DC_CST_LES 0x20000000 /* D cache Little Endian Swap (RO) */ +#define DC_CST_CMD_FLUSH 0x0e000000 /* D cache invalidate all */ +#define DC_CST_CMD_INVALL 0x0c000000 /* D cache invalidate all */ +#define DC_CST_CMD_UNLOCKALL 0x0a000000 /* D cache unlock all */ +#define DC_CST_CMD_UNLOCK 0x08000000 /* D cache unlock block */ +#define DC_CST_CMD_CLRLESWAP 0x07000000 /* D cache clr little-endian swap */ +#define DC_CST_CMD_LOADLOCK 0x06000000 /* D cache load & lock block */ +#define DC_CST_CMD_SETLESWAP 0x05000000 /* D cache set little-endian swap */ +#define DC_CST_CMD_DISABLE 0x04000000 /* D cache disable */ +#define DC_CST_CMD_CLRFWT 0x03000000 /* D cache clear forced write-thru */ +#define DC_CST_CMD_ENABLE 0x02000000 /* D cache enable */ +#define DC_CST_CMD_SETFWT 0x01000000 /* D cache set forced write-thru */ +#define DC_CST_CCER1 0x00200000 /* D cache error type 1 (RO) */ +#define DC_CST_CCER2 0x00100000 /* D cache error type 2 (RO) */ +#define DC_CST_CCER3 0x00080000 /* D cache error type 3 (RO) */ #define SPR_DBAT4U 0x238 /* .6. Data BAT Reg 4 Upper */ -#define SPR_DC_ADR 0x231 /* ..8 Data Cache Address */ +#define SPR_DC_ADR 0x231 /* ..8 Data Cache Address */ #define SPR_DBAT4L 0x239 /* .6. Data BAT Reg 4 Lower */ -#define SPR_DC_DAT 0x232 /* ..8 Data Cache Data */ +#define SPR_DC_DAT 0x232 /* ..8 Data Cache Data */ #define SPR_DBAT5U 0x23a /* .6. Data BAT Reg 5 Upper */ #define SPR_DBAT5L 0x23b /* .6. Data BAT Reg 5 Lower */ #define SPR_DBAT6U 0x23c /* .6. Data BAT Reg 6 Upper */ @@ -252,46 +252,46 @@ #define SPR_DBAT7U 0x23e /* .6. Data BAT Reg 7 Upper */ #define SPR_DBAT7L 0x23f /* .6. Data BAT Reg 7 Lower */ #define SPR_MI_CTR 0x310 /* ..8 IMMU control */ -#define Mx_CTR_GPM 0x80000000 /* Group Protection Mode */ -#define Mx_CTR_PPM 0x40000000 /* Page Protection Mode */ -#define Mx_CTR_CIDEF 0x20000000 /* Cache-Inhibit DEFault */ -#define MD_CTR_WTDEF 0x20000000 /* Write-Through DEFault */ -#define Mx_CTR_RSV4 0x08000000 /* Reserve 4 TLB entries */ -#define MD_CTR_TWAM 0x04000000 /* TableWalk Assist Mode */ -#define Mx_CTR_PPCS 0x02000000 /* Priv/user state compare mode */ -#define Mx_CTR_TLB_INDX 0x000001f0 /* TLB index mask */ -#define Mx_CTR_TLB_INDX_BITPOS 8 /* TLB index shift */ +#define Mx_CTR_GPM 0x80000000 /* Group Protection Mode */ +#define Mx_CTR_PPM 0x40000000 /* Page Protection Mode */ +#define Mx_CTR_CIDEF 0x20000000 /* Cache-Inhibit DEFault */ +#define MD_CTR_WTDEF 0x20000000 /* Write-Through DEFault */ +#define Mx_CTR_RSV4 0x08000000 /* Reserve 4 TLB entries */ +#define MD_CTR_TWAM 0x04000000 /* TableWalk Assist Mode */ +#define Mx_CTR_PPCS 0x02000000 /* Priv/user state compare mode */ +#define Mx_CTR_TLB_INDX 0x000001f0 /* TLB index mask */ +#define Mx_CTR_TLB_INDX_BITPOS 8 /* TLB index shift */ #define SPR_MI_AP 0x312 /* ..8 IMMU access protection */ -#define Mx_GP_SUPER(n) (0 << (2*(15-(n)))) /* access is supervisor */ -#define Mx_GP_PAGE (1 << (2*(15-(n)))) /* access is page protect */ -#define Mx_GP_SWAPPED (2 << (2*(15-(n)))) /* access is swapped */ -#define Mx_GP_USER (3 << (2*(15-(n)))) /* access is user */ +#define Mx_GP_SUPER(n) (0 << (2*(15-(n)))) /* access is supervisor */ +#define Mx_GP_PAGE (1 << (2*(15-(n)))) /* access is page protect */ +#define Mx_GP_SWAPPED (2 << (2*(15-(n)))) /* access is swapped */ +#define Mx_GP_USER (3 << (2*(15-(n)))) /* access is user */ #define SPR_MI_EPN 0x313 /* ..8 IMMU effective number */ -#define Mx_EPN_EPN 0xfffff000 /* Effective Page Number mask */ -#define Mx_EPN_EV 0x00000020 /* Entry Valid */ -#define Mx_EPN_ASID 0x0000000f /* Address Space ID */ +#define Mx_EPN_EPN 0xfffff000 /* Effective Page Number mask */ +#define Mx_EPN_EV 0x00000020 /* Entry Valid */ +#define Mx_EPN_ASID 0x0000000f /* Address Space ID */ #define SPR_MI_TWC 0x315 /* ..8 IMMU tablewalk control */ -#define MD_TWC_L2TB 0xfffff000 /* Level-2 Tablewalk Base */ -#define Mx_TWC_APG 0x000001e0 /* Access Protection Group */ -#define Mx_TWC_G 0x00000010 /* Guarded memory */ -#define Mx_TWC_PS 0x0000000c /* Page Size (L1) */ -#define MD_TWC_WT 0x00000002 /* Write-Through */ -#define Mx_TWC_V 0x00000001 /* Entry Valid */ +#define MD_TWC_L2TB 0xfffff000 /* Level-2 Tablewalk Base */ +#define Mx_TWC_APG 0x000001e0 /* Access Protection Group */ +#define Mx_TWC_G 0x00000010 /* Guarded memory */ +#define Mx_TWC_PS 0x0000000c /* Page Size (L1) */ +#define MD_TWC_WT 0x00000002 /* Write-Through */ +#define Mx_TWC_V 0x00000001 /* Entry Valid */ #define SPR_MI_RPN 0x316 /* ..8 IMMU real (phys) page number */ -#define Mx_RPN_RPN 0xfffff000 /* Real Page Number */ -#define Mx_RPN_PP 0x00000ff0 /* Page Protection */ -#define Mx_RPN_SPS 0x00000008 /* Small Page Size */ -#define Mx_RPN_SH 0x00000004 /* SHared page */ -#define Mx_RPN_CI 0x00000002 /* Cache Inhibit */ -#define Mx_RPN_V 0x00000001 /* Valid */ +#define Mx_RPN_RPN 0xfffff000 /* Real Page Number */ +#define Mx_RPN_PP 0x00000ff0 /* Page Protection */ +#define Mx_RPN_SPS 0x00000008 /* Small Page Size */ +#define Mx_RPN_SH 0x00000004 /* SHared page */ +#define Mx_RPN_CI 0x00000002 /* Cache Inhibit */ +#define Mx_RPN_V 0x00000001 /* Valid */ #define SPR_MD_CTR 0x318 /* ..8 DMMU control */ #define SPR_M_CASID 0x319 /* ..8 CASID */ -#define M_CASID 0x0000000f /* Current AS Id */ +#define M_CASID 0x0000000f /* Current AS Id */ #define SPR_MD_AP 0x31a /* ..8 DMMU access protection */ #define SPR_MD_EPN 0x31b /* ..8 DMMU effective number */ #define SPR_M_TWB 0x31c /* ..8 MMU tablewalk base */ -#define M_TWB_L1TB 0xfffff000 /* level-1 translation base */ -#define M_TWB_L1INDX 0x00000ffc /* level-1 index */ +#define M_TWB_L1TB 0xfffff000 /* level-1 translation base */ +#define M_TWB_L1INDX 0x00000ffc /* level-1 index */ #define SPR_MD_TWC 0x31d /* ..8 DMMU tablewalk control */ #define SPR_MD_RPN 0x31e /* ..8 DMMU real (phys) page number */ #define SPR_MD_TW 0x31f /* ..8 MMU tablewalk scratch */ @@ -307,8 +307,8 @@ #define SPR_UMMCR1 0x3ac /* .6. User Monitor Mode Control Register 1 */ #define SPR_ZPR 0x3b0 /* 4.. Zone Protection Register */ #define SPR_MMCR2 0x3b0 /* .6. Monitor Mode Control Register 2 */ -#define SPR_MMCR2_THRESHMULT_32 0x80000000 /* Multiply MMCR0 threshold by 32 */ -#define SPR_MMCR2_THRESHMULT_2 0x00000000 /* Multiply MMCR0 threshold by 2 */ +#define SPR_MMCR2_THRESHMULT_32 0x80000000 /* Multiply MMCR0 threshold by 32 */ +#define SPR_MMCR2_THRESHMULT_2 0x00000000 /* Multiply MMCR0 threshold by 2 */ #define SPR_PID 0x3b1 /* 4.. Process ID */ #define SPR_PMC5 0x3b1 /* .6. Performance Counter Register 5 */ #define SPR_PMC6 0x3b2 /* .6. Performance Counter Register 6 */ @@ -323,14 +323,14 @@ #define SPR_970MMCR1 0x31e /* ... Monitor Mode Control Register 1 (PPC 970) */ #define SPR_970MMCRA 0x312 /* ... Monitor Mode Control Register 2 (PPC 970) */ #define SPR_970MMCR0 0x31b /* ... Monitor Mode Control Register 0 (PPC 970) */ -#define SPR_970PMC1 0x313 /* ... PMC 1 */ -#define SPR_970PMC2 0x314 /* ... PMC 2 */ -#define SPR_970PMC3 0x315 /* ... PMC 3 */ -#define SPR_970PMC4 0x316 /* ... PMC 4 */ -#define SPR_970PMC5 0x317 /* ... PMC 5 */ -#define SPR_970PMC6 0x318 /* ... PMC 6 */ -#define SPR_970PMC7 0x319 /* ... PMC 7 */ -#define SPR_970PMC8 0x31a /* ... PMC 8 */ +#define SPR_970PMC1 0x313 /* ... PMC 1 */ +#define SPR_970PMC2 0x314 /* ... PMC 2 */ +#define SPR_970PMC3 0x315 /* ... PMC 3 */ +#define SPR_970PMC4 0x316 /* ... PMC 4 */ +#define SPR_970PMC5 0x317 /* ... PMC 5 */ +#define SPR_970PMC6 0x318 /* ... PMC 6 */ +#define SPR_970PMC7 0x319 /* ... PMC 7 */ +#define SPR_970PMC8 0x31a /* ... PMC 8 */ #define SPR_MMCR0_FC 0x80000000 /* Freeze counters */ #define SPR_MMCR0_FCS 0x40000000 /* Freeze counters in supervisor mode */ @@ -554,7 +554,6 @@ #define L2CR_L2DRO 0x00000100 /* 23: L2DLL rollover checkstop enable. */ #define L2CR_L2IP 0x00000001 /* 31: L2 global invalidate in */ /* progress (read only). */ - #define SPR_L3CR 0x3fa /* .6. L3 Control Register */ #define L3CR_L3E 0x80000000 /* 0: L3 enable */ #define L3CR_L3PE 0x40000000 /* 1: L3 data parity enable */ @@ -582,15 +581,15 @@ #define SPR_ICCR 0x3fb /* 4.. Instruction Cache Cachability Register */ #define SPR_THRM1 0x3fc /* .6. Thermal Management Register */ #define SPR_THRM2 0x3fd /* .6. Thermal Management Register */ -#define SPR_THRM_TIN 0x80000000 /* Thermal interrupt bit (RO) */ -#define SPR_THRM_TIV 0x40000000 /* Thermal interrupt valid (RO) */ -#define SPR_THRM_THRESHOLD(x) ((x) << 23) /* Thermal sensor threshold */ -#define SPR_THRM_TID 0x00000004 /* Thermal interrupt direction */ -#define SPR_THRM_TIE 0x00000002 /* Thermal interrupt enable */ -#define SPR_THRM_VALID 0x00000001 /* Valid bit */ +#define SPR_THRM_TIN 0x80000000 /* Thermal interrupt bit (RO) */ +#define SPR_THRM_TIV 0x40000000 /* Thermal interrupt valid (RO) */ +#define SPR_THRM_THRESHOLD(x) ((x) << 23) /* Thermal sensor threshold */ +#define SPR_THRM_TID 0x00000004 /* Thermal interrupt direction */ +#define SPR_THRM_TIE 0x00000002 /* Thermal interrupt enable */ +#define SPR_THRM_VALID 0x00000001 /* Valid bit */ #define SPR_THRM3 0x3fe /* .6. Thermal Management Register */ -#define SPR_THRM_TIMER(x) ((x) << 1) /* Sampling interval timer */ -#define SPR_THRM_ENABLE 0x00000001 /* TAU Enable */ +#define SPR_THRM_TIMER(x) ((x) << 1) /* Sampling interval timer */ +#define SPR_THRM_ENABLE 0x00000001 /* TAU Enable */ #define SPR_FPECR 0x3fe /* .6. Floating-Point Exception Cause Register */ /* Time Base Register declarations */ @@ -600,7 +599,7 @@ #define TBR_TBWU 0x11d /* 468 Time Base Upper - supervisor, write */ /* Performance counter declarations */ -#define PMC_OVERFLOW 0x80000000 /* Counter has overflowed */ +#define PMC_OVERFLOW 0x80000000 /* Counter has overflowed */ /* The first five countable [non-]events are common to many PMC's */ #define PMCN_NONE 0 /* Count nothing */ @@ -616,7 +615,7 @@ #if defined(AIM) -#define SPR_ESR 0x3d4 /* 4.. Exception Syndrome Register */ +#define SPR_ESR 0x3d4 /* 4.. Exception Syndrome Register */ #define ESR_MCI 0x80000000 /* Machine check - instruction */ #define ESR_PIL 0x08000000 /* Program interrupt - illegal */ #define ESR_PPR 0x04000000 /* Program interrupt - privileged */ From owner-svn-src-head@FreeBSD.ORG Sat May 26 12:21:46 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05F041065670; Sat, 26 May 2012 12:21:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx10.syd.optusnet.com.au (fallbackmx10.syd.optusnet.com.au [211.29.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id 204FF8FC16; Sat, 26 May 2012 12:21:44 +0000 (UTC) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by fallbackmx10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4QCLbUw029522; Sat, 26 May 2012 22:21:37 +1000 Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4QCLQ6a013722 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 26 May 2012 22:21:28 +1000 Date: Sat, 26 May 2012 22:21:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten In-Reply-To: <201205252150.q4PLomFk035064@svn.freebsd.org> Message-ID: <20120526173233.A885@besplex.bde.org> References: <201205252150.q4PLomFk035064@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, kib@FreeBSD.org Subject: Re: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 12:21:46 -0000 On Fri, 25 May 2012, Ed Schouten wrote: > Log: > Remove use of non-ISO-C integer types from system call tables. > > These files already use ISO-C-style integer types, so make them less > inconsistent by preferring the standard types. These should actually be Linux types l_foo_t. ISO-C-style integer types seem to have only been used for a couple of uintptr_t's, and these uses are more than just style bugs on amd64 since uintptr_t is for the host (64 bits on amd64) while the target uintptr_t is only 32 bits. There are also a few misuses of the abominable caddr_t instead of l_caddr_t, so syscalls that don't even take a caddr_t. Otherwise, Linux types are used a lot to avoid size mismatches. > Modified: head/sys/amd64/linux32/syscalls.master > ============================================================================== > --- head/sys/amd64/linux32/syscalls.master Fri May 25 21:12:24 2012 (r236025) > +++ head/sys/amd64/linux32/syscalls.master Fri May 25 21:50:48 2012 (r236026) > @@ -54,8 +54,8 @@ > l_int mode); } > 9 AUE_LINK STD { int linux_link(char *path, char *to); } > 10 AUE_UNLINK STD { int linux_unlink(char *path); } > -11 AUE_EXECVE STD { int linux_execve(char *path, u_int32_t *argp, \ > - u_int32_t *envp); } > +11 AUE_EXECVE STD { int linux_execve(char *path, uint32_t *argp, \ > + uint32_t *envp); } argp and envp aren't uintany_t * in either Linux or FreeBSD. They start as "char * const *". There is no Linux type for an indirect "char *", and one was hacked up here by pretending that "char *" is u_int32_t (it is actually just 32 bits). Using l_caddr_t seems to be the best hack available (since by abusing l_caddr_t, we know that it is actually char *). The `const' in the type for argp and envp is further from being handled correctly. Most or all syscall.master's just type-pun it away. Similarly for "const char *path". All the non-indirect "char *"s for pathnames and other things seem to be completely wrong on amd64 too. These pointers start as 32 bits, and it takes more than a bad type pun to turn then into kernel 64-bit pointers. The magic for this seems to be: - all args are converted to 64 bits (by zero-extension?) at a low level - the args struct for a pathname is [left padding]; char *; [right padding]; Since the char * is misdeclared, the explicit padding is null, but the layout of the args struct is correct because the wrong arg type in it supplies equivalent padding (extra 32 bits on the right). - the "char *" in the args struct is not actually a char *, and is unusable directly in the kernel. However, it is only used in copyin() and copyout(), where it becomes a user address and works correctly. (An older bug in this that the user address for copy*() is declared as "void *". "void *" means a kernel pointer. The type of a user address should be more like vm_offset_t, but even that needs logical translation for linux32). The same mechanism presumably avoids problems when raw caddr_t is used instead of l_caddr_t, and when uintptr_t is used instead of l_uintptr_t. > 12 AUE_CHDIR STD { int linux_chdir(char *path); } > 13 AUE_NULL STD { int linux_time(l_time_t *tm); } Example of a correct use of a linux type. Again, the first-level pointer is handled by the above magic, but for the second level we need an l_foo_t to describe its size correctly. > 14 AUE_MKNOD STD { int linux_mknod(char *path, l_int mode, \ Broken except in the K&R case, but amd64 is too new to pretend to support K&R. Bug for bug compatible with mknod() and some other syscalls in kern/syscalls.master. mknod() takes an arg of type mode_t, not one of type int. l_mode_t exists so that the above can be declared correctly, and is already used for linux_chmod() and linux_chmodat(). OTOH, int for the mode arg is correct for open(), since open() is variadic at a level before the syscall, so its mode_t arg gets promoted to int. Similarly, if mknod() is compiled by a K&R compiler, or by a STDC compiler with no prototype in scope, then its mode_t arg gets promoted to int (but for the STDC case, the behaviour is then undefined once mknod() is reached). Normally this doesn't cause any problems, but it is easy to declare things correctly. > Modified: head/sys/compat/freebsd32/syscalls.master > ============================================================================== > --- head/sys/compat/freebsd32/syscalls.master Fri May 25 21:12:24 2012 (r236025) > +++ head/sys/compat/freebsd32/syscalls.master Fri May 25 21:50:48 2012 (r236026) > @@ -104,9 +104,9 @@ > int flags); } > 28 AUE_SENDMSG STD { int freebsd32_sendmsg(int s, struct msghdr32 *msg, \ > int flags); } > -29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, u_int32_t buf, \ > - u_int32_t len, int flags, u_int32_t from, \ > - u_int32_t fromlenaddr); } > +29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, uint32_t buf, \ > + uint32_t len, int flags, uint32_t from, \ > + uint32_t fromlenaddr); } Oops, I didn't looke at this file when I said that "ISO-C-style integer types seem to have only been used for a couple of uintptr_t's". This file is independent of Linux, so it can't use l_foo. It hard-codes 32 instead, starting with the directory name. Still, all of the types in the above are fairly bogus and hard to understand: - "int" for `s' and `flags' depends on ints being 32 bits - "struct msghdr32 *msg" depends on magic to translate first-level target 32-bit pointers to host N-bit pointers - uint32_t for `buf' and `from' is for pointers too. Now the magic for first-level pointers is not depended on - uint32_t for lengths is for size_t's. This is reasonable but would be clearer if spelled as size32_t (corresponding to l_size_t). > 30 AUE_ACCEPT NOPROTO { int accept(int s, caddr_t name, \ > int *anamelen); } As above for "int s". The use of caddr_t is more nonsense than usual. accept()'s second arg is not a caddr_t, but is "struct sockaddr * restrict". We depend first on type punning this to caddr_t, then to caddr_t actually being "char *", then on "char *" being a pointer, then on the usual magic for first-level pointers. kern/syscalls.master has the same caddr_t for the MCPT_NOA case of accept(), but not for the MSTD case. Perhaps userland accept() once actually took a caddr_t arg, but hopefully Linux is too new to have ever done that, and even compat cruft in FreeeBSD is too new to need that. > 31 AUE_GETPEERNAME NOPROTO { int getpeername(int fdes, caddr_t asa, \ Similarly. For getpeername(), the compat cruft in kern/syscalls.master is more clearly typed as MCOMPAT. > @@ -152,7 +152,7 @@ > 58 AUE_READLINK NOPROTO { ssize_t readlink(char *path, char *buf, \ > size_t count); } All uses of basic C types and POSIX types are wronger than uses of fixed-width types. Here the size_t is not translated to uint32_t as above. This presumably works due to essentially the same magic as for first-level pointers, up to the copyout step: the 32-bit size_t gets extended to an N-bit one (where N is 32 or 64 on supported arches). Zero extension of it works right for size_t, and there is no further magic corresponding to the copy*() step. The magic is very convenient. It should probably be explicitly depended on for all first-level pointers. For size_t's it should be depended on in no cases or all cases. > 59 AUE_EXECVE STD { int freebsd32_execve(char *fname, \ > - u_int32_t *argv, u_int32_t *envv); } > + uint32_t *argv, uint32_t *envv); } Usual hack for second-level pointers. > 60 AUE_UMASK NOPROTO { int umask(int newmask); } umask \ > umask_args int Usual bug for mode_t. > 61 AUE_CHROOT NOPROTO { int chroot(char *path); } > @@ -325,10 +325,10 @@ > 172 AUE_NULL UNIMPL nosys > 173 AUE_PREAD COMPAT6 { ssize_t freebsd32_pread(int fd, void *buf, \ > size_t nbyte, int pad, \ > - u_int32_t offset1, u_int32_t offset2); } > + uint32_t offset1, uint32_t offset2); } More confusing than usual. The size_t is translated by magic. Then there is bogus historical padding to be compatible with old mistakes in this area. Then there are 2 64-bit offsets (off_t's in the API) which are split because the translation code only understands 32-bit args. > [... stuff in which the largest obvious bugs are untranslated size_t's] > 481 AUE_KILL NOPROTO { int thr_kill2(pid_t pid, long id, int sig); } Untranslated pid_t depends on pid_t being no larger than int. Untranslated long completely breaks this. > 482 AUE_SHMOPEN NOPROTO { int shm_open(const char *path, int flags, \ > @@ -892,25 +892,25 @@ > #ifdef PAD64_REQUIRED > 485 AUE_NULL STD { int freebsd32_cpuset_setid(cpuwhich_t which, \ > int pad, \ > - u_int32_t id1, u_int32_t id2, \ > + uint32_t id1, uint32_t id2, \ > cpusetid_t setid); } Untranslated cpusetid_t. It works since it is int. > #else > 485 AUE_NULL STD { int freebsd32_cpuset_setid(cpuwhich_t which, \ > - u_int32_t id1, u_int32_t id2, \ > + uint32_t id1, uint32_t id2, \ > cpusetid_t setid); } > #endif > 486 AUE_NULL STD { int freebsd32_cpuset_getid(cpulevel_t level, \ > cpuwhich_t which, \ > - u_int32_t id1, u_int32_t id2, \ > + uint32_t id1, uint32_t id2, \ > cpusetid_t *setid); } This and later have several more cpsetid_t's. Also cpuwhich_t's. id_t's are translated since they are 64 bits. This is painful. All types that are documented to be represented by id_t are only 32 bits, and id_t is wrong for representing 64-bit unsigned types since it is signed. The above has type puns to represent the signed 64-bit int in 2 uint32_t's. A pid of -1 would become pid_t -1, then id_t -1, then 0xffffffff, 0xffffffff. Signed off_t also requires type puns to represent in 2 uint32_t's. > ... > @@ -920,7 +920,7 @@ > 491 AUE_FCHOWNAT NOPROTO { int fchownat(int fd, char *path, uid_t uid, \ > gid_t gid, int flag); } Untranslated foo_t's. > @@ -959,9 +959,9 @@ > 512 AUE_SHMCTL NOSTD { int freebsd32_shmctl(int shmid, int cmd, \ > struct shmid_ds32 *buf); } > 513 AUE_LPATHCONF NOPROTO { int lpathconf(char *path, int name); } > -514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, u_int64_t rights); } > +514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, uint64_t rights); } Broken, assuming that all the other spittings into 2 uint32_t's are needed. > 515 AUE_CAP_GETRIGHTS NOPROTO { int cap_getrights(int fd, \ > - u_int64_t *rightsp); } > + uint64_t *rightsp); } Now the uint64_t is indirect, so it pronbably works. > Modified: head/sys/kern/syscalls.master > ============================================================================== > --- head/sys/kern/syscalls.master Fri May 25 21:12:24 2012 (r236025) > +++ head/sys/kern/syscalls.master Fri May 25 21:50:48 2012 (r236026) I didn't think of uint*N_t in this at first either. > @@ -916,9 +916,9 @@ > 512 AUE_SHMCTL NOSTD { int shmctl(int shmid, int cmd, \ > struct shmid_ds *buf); } > 513 AUE_LPATHCONF STD { int lpathconf(char *path, int name); } > -514 AUE_CAP_NEW STD { int cap_new(int fd, u_int64_t rights); } > +514 AUE_CAP_NEW STD { int cap_new(int fd, uint64_t rights); } > 515 AUE_CAP_GETRIGHTS STD { int cap_getrights(int fd, \ > - u_int64_t *rightsp); } > + uint64_t *rightsp); } > 516 AUE_CAP_ENTER STD { int cap_enter(void); } > 517 AUE_CAP_GETMODE STD { int cap_getmode(u_int *modep); } > 518 AUE_PDFORK STD { int pdfork(int *fdp, int flags); } In fact, this file has only 3 uint*N_t's. This shows that these 3 are all API design bugs no matter how they are spelled. All the very old syscalls use basic C types. All the not so old ones use a STDC or POSIX typedefed type, with the typedef specific to the context. The 3 exceptions new ones that hard-code a fixed width are the above 2 CAP ones and sctp_peeloff(), which uses "uint32_t name". These bugs are easiest to fix in the Linux syscall.master's since the bugs are mostly already avoided using l_foo_t. In amd64/linux32/ syscalls.master, I only noticed the following ones: % 1 AUE_EXIT NOPROTO { void sys_exit(int rval); } exit \ % sys_exit_args void "int" for the return and args is not quite right, and it bogotifies the use of l_int for some args. It works though (assuming 32-bit host ints). Assumptions that the return type is 32-bit int and that the host int is 32-bits are implicit in all over, so we should assume them here for simplicity. (Hmm, td_retval is actually 2 register_t's. 64 bits each on amd64. amd64/linux32 has remarkably little code to convert these 2 64-bit ints into 4 32-bit ints.) % 2 AUE_FORK STD { int linux_fork(void); } % 3 AUE_NULL NOPROTO { int read(int fd, char *buf, \ % u_int nbyte); } This u_int should strictly be l_size_t. l_size_t is used a lot elswhere in this file. In syscalls where the type is actually u_int, l_uint should be used. l_uint is used a lot elsewhere in this file. But not many syscsalls use u_int, so many of these l_uints are probably just different misspellings of l_size_t. So the density of logical type bugs is high even in this file. % 4 AUE_NULL NOPROTO { int write(int fd, char *buf, \ % u_int nbyte); } u_int seems to be more common in older syscalls. % 5 AUE_OPEN_RWTC STD { int linux_open(char *path, l_int flags, \ % l_int mode); } Finally, an example of perfectly correct use of l_int. It even correctly handles the subtlety that l_mode_t promotes to l_int since open() is variadic. (BTW, I don't like hard-coding this promotion and have wished for the __promoteof() operator for giving it for more than 20 years. The promotion of a typedefed type even harder to determine than the correct PRI* mistake to use for printing a typedefed type.) This declaration is still far from correct altogether, since it depends on the usual hacks: - int return type is actual l_int - char *path is actually "const char *path" at the target level - magic to convert target "char *" to and from host "char *" % 11 AUE_EXECVE STD { int linux_execve(char *path, uint32_t *argp, \ % uint32_t *envp); } See above. % 41 AUE_DUP NOPROTO { int dup(u_int fd); } Another untranslated type. dup() doesn't even take a u_int to begin with (it takes a normal int descriptor). Untranslated int args aren't actually very common. % 54 AUE_IOCTL STD { int linux_ioctl(l_uint fd, l_uint cmd, \ % uintptr_t arg); } Now l_foo is used for the descriptor, but u_int is wrong -- Linux uses a normal int for the descriptor for ioctl() too. l_uint for cmd is wrong too. The type starts as u_long (same as in FreeBSD), at least in the 1997 Linux userland that I used to check this. This type mismatch is harmless because ints and longs are both 32 bits on Linux-i386. uintptr_t for arg is wronger. For ioctl(), this arg is the first variadic one and might not be present. I think declaring it in the above gives (via the Linux ABI) the garbage contents of a register for it when it isn't present. Native FreeBSD ioctl() has evem more magic. It misdeclares the arg as caddr_t instead, and gives stack garbage for it when it isn't present, and depends on the stack being large enough to avoid a memory fault when copying the stack garbage (the FreeBSD ABO gives at least a return address there). The type of the arg, when it is present, is specified to be caddr_t (:-() in FreeBSD. Linux (1997 userland) is better and says it is "char *". It should have been "void *". syscall.master's should probably declare it as "void *". Here it starts as a 32-bit pointer and the usual magic will convert it to a 64-bit non-pointer represented as a host uintptr_t by the above or by a host "void *" with "void *" in the above. copy*() will eventually turn it into "void *uaddr" either way. Then it will still not really be a kernel pointer, but is used as one in the implementation of copy*() on amd64 (this depends on a flat address space). % 55 AUE_FCNTL STD { int linux_fcntl(l_uint fd, l_uint cmd, \ % uintptr_t arg); } Same errors for the types of fd and arg. Different error for the type of cmd. Unlike for ioctl(), it starts as neither long or unsigned, but just int (POSIX spec). % 56 AUE_NULL UNIMPL mpx % 57 AUE_SETPGRP NOPROTO { int setpgid(int pid, int pgid); } l_pid_t exists and should be used. % 60 AUE_UMASK NOPROTO { int umask(int newmask); } l_mode_t exists and should be used. % 63 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); } Bogus fd types, as usual. % 65 AUE_GETPGRP NOPROTO { int getpgrp(void); } Should really be more careful with return types that are typedefed in the API (and are not just int statuses or fds). kern/syscalls.master is sloppy with this too. % 74 AUE_SYSCTL STD { int linux_sethostname(char *hostname, \ % u_int len); } get/sethostname() is horribly inconsistent. In FreeBSD, gethostname() is documented as taking a size_t and sethostname() is documented as taking an int. kern/syscalls.master uses u_int for both. Apparently there is enough magic with arg packing for this to work even on supported 64-bit big-endian systems. Linux userland was better even in 1997 -- it uses size_t for both. POSIX has specified gethostname() since at least 2001. It uses size_t of course. It says that these are 4.3BSD functions but it only specifies gethostname(), and it applies an OpenGroup resolution to change the type from socklen_t to size_t for gethostname(). This made it incompatible with BSD. Old BSD uses int for both, and FreeBSD apparently changed the documentation but not the code for gethostname() only, to be bug for compatible with POSIX. So the above should use l_size_t, and strictly, the code probably needs to be more careful than it is with unrepresentable sizes (native sethostname() wants a signed int and might not have the right checking for a 32-bit unsigned size_t). % 75 AUE_SETRLIMIT STD { int linux_setrlimit(l_uint resource, \ % struct l_rlimit *rlim); } % 76 AUE_GETRLIMIT STD { int linux_old_getrlimit(l_uint resource, \ % struct l_rlimit *rlim); } Resource numbers should be plain ints too. They are documented to be as such in old Linux userland man pages. But in old Linux (glibc) headers, they are obfuscated as __rlimit_resource_t, which an enum with gnu extensions, else plain int. % 78 AUE_NULL STD { int linux_gettimeofday( \ % struct l_timeval *tp, \ % struct timezone *tzp); } % 79 AUE_SETTIMEOFDAY STD { int linux_settimeofday( \ % struct l_timeval *tp, \ % struct timezone *tzp); } The timezone struct only has a couple of ints in it, so this abuse of the native timezone works, but is fragile. I forget if the timezone arg is deprecated to the point of ignoring it for native get/settimeofday(). If so, then this won't work for emulated get/settimeofday() % 85 AUE_READLINK STD { int linux_readlink(char *name, char *buf, \ % l_int count); } Native readlink was churned by POSIX from an int count to a size_t count. Linux readlink has takes a size_t count even in 1997 and probably still does. % 88 AUE_REBOOT STD { int linux_reboot(l_int magic1, \ % l_int magic2, l_uint cmd, void *arg); } In old Linux userland it is documented to take only 3 int args, with the 3rd one named `flag'. % ; 89: old_readdir % 89 AUE_GETDIRENTRIES STD { int linux_readdir(l_uint fd, \ % struct l_dirent *dent, l_uint count); } Matches old Linux userland man page right down to the u_int for fd. % 91 AUE_MUNMAP NOPROTO { int munmap(caddr_t addr, int len); } Takes a void * and a size_t in modern munmap() and Linux had that in 1997. FreeBSD-3 had this too. The above matches FreeBSD-1. % 92 AUE_TRUNCATE STD { int linux_truncate(char *path, \ % l_ulong length); } Should use l_off_t, not l_ulong (except possibly if their is an unsigned hack to support file sizes of 2G-4G). % 93 AUE_FTRUNCATE STD { int linux_ftruncate(int fd, long length); } Using long is very broken. l_off_t is correct here too. % 94 AUE_FCHMOD NOPROTO { int fchmod(int fd, int mode); } mode_t is used for all other *chmod*()'s in this file % 95 AUE_FCHOWN NOPROTO { int fchown(int fd, int uid, int gid); } l_uid16_t and l_gid16_t are used for all other old *chown*() in this file. (Newer ones are spelled *lchown*() and take l_uid_t and l_gid_t's.) % 96 AUE_GETPRIORITY STD { int linux_getpriority(int which, int who); } % 97 AUE_SETPRIORITY NOPROTO { int setpriority(int which, int who, \ % int prio); } `who' should have type pid_t, but is still int in FreeBSD native. In old Linux, it is int in the man page but is obfuscated as id_t in the glibc header. Even `which' is obfuscated as __priority_which_t in the glibc header. (I consider even using size_t for read() to be a regression. Typedefed types are hard to use correctly, as shown by this mail which points out that hundreds of incorrect uses, where the bugs are only harmless because the use of typedefed types makes no significant difference.) Got bored here, and looked at the rest less carefully. The newer syscalls seem to be handled more carefully, probably because plenty of Linux types existed when they were written. There just seemed to be too many l_[u]longs in them. % 168 AUE_POLL NOPROTO { int poll(struct pollfd *fds, \ % unsigned int nfds, int timeout); } Hrmph, this is the only one that misspells "unsigned" more verbosely as "unsigned int" instead of as the usual KNF abbreviation "u_int". Of course, poll() doesn't even take a u_int type. Modern poll takes an nfds_t type. Linux had that in 1997, and it was u_long, not u_int. Use of the native struct pollfd is dangerous. It works because it consists of an int followed by 2 shorts, and this matches the Linux type and neither has neither unnamed padding on at least amd64 and i386. % 180 AUE_PREAD STD { int linux_pread(l_uint fd, char *buf, \ % l_size_t nbyte, l_loff_t offset); } % [... several more bogus l_uints for fds] % 183 AUE_GETCWD STD { int linux_getcwd(char *buf, \ % l_ulong bufsize); } A different misspelling of l_size_t. % 191 AUE_GETRLIMIT STD { int linux_getrlimit(l_uint resource, \ % struct l_rlimit *rlim); } Bogus resource number times for new rlimit syscalls too. % 193 AUE_TRUNCATE STD { int linux_truncate64(char *path, \ % l_loff_t length); } % 194 AUE_FTRUNCATE STD { int linux_ftruncate64(l_uint fd, \ % l_loff_t length); } How can this work? I was going to say that the splitting up of the 64-bit args in compat/freebsd32/syscalls.master was unnecessary because it is apparently not needed here. Then I misread this as doing the splitting. But it doesn't. Similarly later in this file. % 218 AUE_MINCORE STD { int linux_mincore(l_ulong start, \ % l_size_t len, u_char *vec); } % 219 AUE_MADVISE NOPROTO { int madvise(void *addr, size_t len, \ % int behav); } SIlly to have l_size_t in one and raw size_t in the next. I just noticed that NOPROTO calls never use l_foo. They go direct to the native calls, and spelling things without an l_ may be necessary for hiding the type mismatches from this. But this is especially fragile, and maybe the l_'s here would be harmless since they have no effect, since type checking for the direct calls is destroyed better using (sy_call_t *) casts. % 220 AUE_GETDIRENTRIES STD { int linux_getdents64(l_uint fd, \ % void *dirent, l_uint count); } % 221 AUE_FCNTL STD { int linux_fcntl64(l_uint fd, l_uint cmd, \ % uintptr_t arg); } Type errors for 32-bit syscalls are often duplicated for the corresponding 64-bit ones. My old userland doesn't have these new syscalls to check, but I doubt that Linux changed the API for the non-64 bit parts, and u_int fds are bogus as usual. % 240 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op, uint32_t val, \ % struct l_timespec *timeout, uint32_t *uaddr2, uint32_t val3); } % 241 AUE_NULL STD { int linux_sched_setaffinity(l_pid_t pid, l_uint len, \ % l_ulong *user_mask_ptr); } % 242 AUE_NULL STD { int linux_sched_getaffinity(l_pid_t pid, l_uint len, \ % l_ulong *user_mask_ptr); } % 243 AUE_NULL STD { int linux_set_thread_area(struct l_user_desc *desc); } Lots of style bugs which are not present in old code: - lines are not wrapped at 80 columns - wrapped lines are misindented. % 250 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t offset, \ % l_size_t len, int advice); } More style bugs. % 264 AUE_CLOCK_SETTIME STD { int linux_clock_settime(clockid_t which, struct l_timespec *tp); } % 265 AUE_NULL STD { int linux_clock_gettime(clockid_t which, struct l_timespec *tp); } % 266 AUE_NULL STD { int linux_clock_getres(clockid_t which, struct l_timespec *tp); } % 267 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \ % struct l_timespec *rqtp, struct l_timespec *rmtp); } % 268 AUE_STATFS STD { int linux_statfs64(char *path, size_t bufsize, struct l_statfs64_buf *buf); } Another raw size_t. Another long line. % 269 AUE_FSTATFS STD { int linux_fstatfs64(void); } % 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } Raw ints for pids. % 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ % struct l_timeval *tptr); } % 272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ % l_loff_t offset, l_loff_t len, \ % int advice); } Just about all syscalls added since #239 are misformatted :-(. % 295 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, const char *filename, \ % l_int flags, l_int mode); } % 296 AUE_MKDIRAT STD { int linux_mkdirat(l_int dfd, const char *pathname, \ % l_int mode); } % 297 AUE_MKNODAT STD { int linux_mknodat(l_int dfd, const char *filename, \ % l_int mode, l_uint dev); } % 298 AUE_FCHOWNAT STD { int linux_fchownat(l_int dfd, const char *filename, \ % l_uid16_t uid, l_gid16_t gid, l_int flag); } % 299 AUE_FUTIMESAT STD { int linux_futimesat(l_int dfd, char *filename, \ % struct l_timeval *utimes); } % 300 AUE_FSTATAT STD { int linux_fstatat64(l_int dfd, char *pathname, \ % struct l_stat64 *statbuf, l_int flag); } % 301 AUE_UNLINKAT STD { int linux_unlinkat(l_int dfd, const char *pathname, \ % l_int flag); } % 302 AUE_RENAMEAT STD { int linux_renameat(l_int olddfd, const char *oldname, \ % l_int newdfd, const char *newname); } % 303 AUE_LINKAT STD { int linux_linkat(l_int olddfd, const char *oldname, \ % l_int newdfd, const char *newname, l_int flag); } % 304 AUE_SYMLINKAT STD { int linux_symlinkat(const char *oldname, l_int newdfd, \ % const char *newname); } % 305 AUE_READLINKAT STD { int linux_readlinkat(l_int dfd, const char *path, \ % char *buf, l_int bufsiz); } % 306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \ % l_mode_t mode); } % 307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode, int flag); } Mounds more misformatting. [... A small pile of misformatting] Bruce From owner-svn-src-head@FreeBSD.ORG Sat May 26 12:39:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D02E8106566C; Sat, 26 May 2012 12:39:23 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B03BC8FC08; Sat, 26 May 2012 12:39:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QCdNFw077778; Sat, 26 May 2012 12:39:23 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QCdNu1077776; Sat, 26 May 2012 12:39:23 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205261239.q4QCdNu1077776@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 12:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236095 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 12:39:23 -0000 Author: raj Date: Sat May 26 12:39:23 2012 New Revision: 236095 URL: http://svn.freebsd.org/changeset/base/236095 Log: Provide SPR definitions for newer Book-E (E500mc, E5500, PPC465). Obtained from: Freescale, Semihalf. Modified: head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sat May 26 12:15:13 2012 (r236094) +++ head/sys/powerpc/include/spr.h Sat May 26 12:39:23 2012 (r236095) @@ -184,6 +184,8 @@ #define MPC8245 0x8081 #define FSL_E500v1 0x8020 #define FSL_E500v2 0x8021 +#define FSL_E500mc 0x8023 +#define FSL_E5500 0x8024 #define SPR_IBAT0U 0x210 /* .68 Instruction BAT Reg 0 Upper */ #define SPR_IBAT0U 0x210 /* .6. Instruction BAT Reg 0 Upper */ @@ -421,6 +423,7 @@ #define SPR_SRR3 0x3df /* 4.. Save/Restore Register 3 */ #define SPR_HID0 0x3f0 /* ..8 Hardware Implementation Register 0 */ #define SPR_HID1 0x3f1 /* ..8 Hardware Implementation Register 1 */ +#define SPR_HID2 0x3f3 /* ..8 Hardware Implementation Register 2 */ #define SPR_HID4 0x3f4 /* ..8 Hardware Implementation Register 4 */ #define SPR_HID5 0x3f6 /* ..8 Hardware Implementation Register 5 */ #define SPR_HID6 0x3f9 /* ..8 Hardware Implementation Register 6 */ @@ -627,6 +630,8 @@ #elif defined(E500) +#define SPR_MCSR 0x23c /* ..8 Machine Check Syndrome register */ + #define SPR_ESR 0x003e /* ..8 Exception Syndrome Register */ #define ESR_PIL 0x08000000 /* Program interrupt - illegal */ #define ESR_PPR 0x04000000 /* Program interrupt - privileged */ @@ -637,11 +642,16 @@ #define ESR_BO 0x00020000 /* Data/instruction storage, byte ordering */ #define ESR_SPE 0x00000080 /* SPE exception bit */ + #define SPR_CSRR0 0x03a /* ..8 58 Critical SRR0 */ #define SPR_CSRR1 0x03b /* ..8 59 Critical SRR1 */ #define SPR_MCSRR0 0x23a /* ..8 570 Machine check SRR0 */ #define SPR_MCSRR1 0x23b /* ..8 571 Machine check SRR1 */ +#define SPR_MMUCSR0 0x3f4 /* ..8 1012 MMU Control and Status Register 0 */ +#define MMUCSR0_L2TLB0_FI 0x04 /* TLB0 flash invalidate */ +#define MMUCSR0_L2TLB1_FI 0x02 /* TLB1 flash invalidate */ + #define SPR_SVR 0x3ff /* ..8 1023 System Version Register */ #define SVR_MPC8533 0x8034 #define SVR_MPC8533E 0x803c @@ -661,10 +671,16 @@ #define SVR_P2010E 0x80eb #define SVR_P2020 0x80e2 #define SVR_P2020E 0x80ea +#define SVR_P2041 0x8210 +#define SVR_P2041E 0x8218 +#define SVR_P3041 0x8211 +#define SVR_P3041E 0x8219 #define SVR_P4040 0x8200 #define SVR_P4040E 0x8208 #define SVR_P4080 0x8201 #define SVR_P4080E 0x8209 +#define SVR_P5020 0x8220 +#define SVR_P5020E 0x8228 #define SVR_VER(svr) (((svr) >> 16) & 0xffff) #define SPR_PID0 0x030 /* ..8 Process ID Register 0 */ @@ -707,6 +723,18 @@ #define SPR_MAS5 0x275 /* ..8 MMU Assist Register 5 Book-E */ #define SPR_MAS6 0x276 /* ..8 MMU Assist Register 6 Book-E/e500 */ #define SPR_MAS7 0x3B0 /* ..8 MMU Assist Register 7 Book-E/e500 */ +#define SPR_MAS8 0x155 /* ..8 MMU Assist Register 8 Book-E/e500 */ + +#define SPR_L1CFG0 0x203 /* ..8 L1 cache configuration register 0 */ +#define SPR_L1CFG1 0x204 /* ..8 L1 cache configuration register 1 */ + +#define SPR_CCR1 0x378 +#define CCR1_L2COBE 0x00000040 + +#define DCR_L2DCDCRAI 0x0000 /* L2 D-Cache DCR Address Pointer */ +#define DCR_L2DCDCRDI 0x0001 /* L2 D-Cache DCR Data Indirect */ +#define DCR_L2CR0 0x00 /* L2 Cache Configuration Register 0 */ +#define L2CR0_AS 0x30000000 #define SPR_L1CSR0 0x3F2 /* ..8 L1 Cache Control and Status Register 0 */ #define L1CSR0_DCPE 0x00010000 /* Data Cache Parity Enable */ @@ -715,12 +743,20 @@ #define L1CSR0_DCE 0x00000001 /* Data Cache Enable */ #define SPR_L1CSR1 0x3F3 /* ..8 L1 Cache Control and Status Register 1 */ #define L1CSR1_ICPE 0x00010000 /* Instruction Cache Parity Enable */ +#define L1CSR1_ICUL 0x00000400 /* Instr Cache Unable to Lock */ #define L1CSR1_ICLFR 0x00000100 /* Instruction Cache Lock Bits Flash Reset */ #define L1CSR1_ICFI 0x00000002 /* Instruction Cache Flash Invalidate */ #define L1CSR1_ICE 0x00000001 /* Instruction Cache Enable */ +#define SPR_L2CSR0 0x3F9 /* ..8 L2 Cache Control and Status Register 0 */ +#define L2CSR0_L2E 0x80000000 /* L2 Cache Enable */ +#define L2CSR0_L2PE 0x40000000 /* L2 Cache Parity Enable */ +#define L2CSR0_L2FI 0x00200000 /* L2 Cache Flash Invalidate */ +#define L2CSR0_L2LFC 0x00000400 /* L2 Cache Lock Flags Clear */ + #define SPR_BUCSR 0x3F5 /* ..8 Branch Unit Control and Status Register */ #define BUCSR_BPEN 0x00000001 /* Branch Prediction Enable */ +#define BUCSR_BBFI 0x00000200 /* Branch Buffer Flash Invalidate */ #endif /* #elif defined(E500) */ From owner-svn-src-head@FreeBSD.ORG Sat May 26 13:36:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 08B45106566C; Sat, 26 May 2012 13:36:19 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDA558FC12; Sat, 26 May 2012 13:36:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QDaIoX080109; Sat, 26 May 2012 13:36:18 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QDaIia080105; Sat, 26 May 2012 13:36:18 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205261336.q4QDaIia080105@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 13:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236097 - in head/sys/powerpc: booke powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 13:36:19 -0000 Author: raj Date: Sat May 26 13:36:18 2012 New Revision: 236097 URL: http://svn.freebsd.org/changeset/base/236097 Log: Rename e500 prefix to match other Book-E CPU variations. CPU id tidbits for the new cores. Obtained from: Freescale, Semihalf. Modified: head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/platform_bare.c head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Sat May 26 13:12:14 2012 (r236096) +++ head/sys/powerpc/booke/machdep.c Sat May 26 13:36:18 2012 (r236097) @@ -185,8 +185,8 @@ SYSCTL_INT(_machdep, CPU_CACHELINE, cach int hw_direct_map = 0; -static void cpu_e500_startup(void *); -SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_e500_startup, NULL); +static void cpu_booke_startup(void *); +SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_booke_startup, NULL); void print_kernel_section_addr(void); void print_kenv(void); @@ -195,7 +195,7 @@ u_int booke_init(uint32_t, uint32_t); extern int elf32_nxstack; static void -cpu_e500_startup(void *dummy) +cpu_booke_startup(void *dummy) { int indx, size; @@ -538,7 +538,8 @@ cpu_halt(void) { mtmsr(mfmsr() & ~(PSL_CE | PSL_EE | PSL_ME | PSL_DE)); - while (1); + while (1) + ; } int Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Sat May 26 13:12:14 2012 (r236096) +++ head/sys/powerpc/booke/platform_bare.c Sat May 26 13:36:18 2012 (r236097) @@ -73,7 +73,7 @@ static int bare_smp_next_cpu(platform_t, static int bare_smp_get_bsp(platform_t, struct cpuref *cpuref); static int bare_smp_start_cpu(platform_t, struct pcpu *cpu); -static void e500_reset(platform_t); +static void booke_reset(platform_t); static platform_method_t bare_methods[] = { PLATFORMMETHOD(platform_probe, bare_probe), @@ -85,7 +85,7 @@ static platform_method_t bare_methods[] PLATFORMMETHOD(platform_smp_get_bsp, bare_smp_get_bsp), PLATFORMMETHOD(platform_smp_start_cpu, bare_smp_start_cpu), - PLATFORMMETHOD(platform_reset, e500_reset), + PLATFORMMETHOD(platform_reset, booke_reset), { 0, 0 } }; @@ -307,7 +307,7 @@ bare_smp_start_cpu(platform_t plat, stru } static void -e500_reset(platform_t plat) +booke_reset(platform_t plat) { /* @@ -328,6 +328,7 @@ e500_reset(platform_t plat) mtspr(SPR_DBCR0, mfspr(SPR_DBCR0) | DBCR0_IDM | DBCR0_RST_SYSTEM); printf("Reset failed...\n"); - while (1); + while (1) + ; } Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Sat May 26 13:12:14 2012 (r236096) +++ head/sys/powerpc/powerpc/cpu.c Sat May 26 13:36:18 2012 (r236097) @@ -75,13 +75,13 @@ #include static void cpu_6xx_setup(int cpuid, uint16_t vers); -static void cpu_e500_setup(int cpuid, uint16_t vers); static void cpu_970_setup(int cpuid, uint16_t vers); +static void cpu_booke_setup(int cpuid, uint16_t vers); int powerpc_pow_enabled; void (*cpu_idle_hook)(void) = NULL; static void cpu_idle_60x(void); -static void cpu_idle_e500(void); +static void cpu_idle_booke(void); struct cputab { const char *name; @@ -146,9 +146,13 @@ static const struct cputab models[] = { { "Motorola PowerPC 8245", MPC8245, REVFMT_MAJMIN, PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, { "Freescale e500v1 core", FSL_E500v1, REVFMT_MAJMIN, - 0, cpu_e500_setup }, + 0, cpu_booke_setup }, { "Freescale e500v2 core", FSL_E500v2, REVFMT_MAJMIN, - 0, cpu_e500_setup }, + 0, cpu_booke_setup }, + { "Freescale e500mc core", FSL_E500mc, REVFMT_MAJMIN, + 0, cpu_booke_setup }, + { "Freescale e5500 core", FSL_E5500, REVFMT_MAJMIN, + 0, cpu_booke_setup }, { "IBM Cell Broadband Engine", IBMCELLBE, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, NULL}, @@ -191,6 +195,8 @@ cpu_setup(u_int cpuid) break; case FSL_E500v1: case FSL_E500v2: + case FSL_E500mc: + case FSL_E5500: maj = (pvr >> 4) & 0xf; min = (pvr >> 0) & 0xf; break; @@ -438,7 +444,7 @@ cpu_6xx_print_cacheinfo(u_int cpuid, uin } static void -cpu_e500_setup(int cpuid, uint16_t vers) +cpu_booke_setup(int cpuid, uint16_t vers) { register_t hid0; @@ -453,7 +459,7 @@ cpu_e500_setup(int cpuid, uint16_t vers) printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, HID0_E500_BITMASK); if (cpu_idle_hook == NULL) - cpu_idle_hook = cpu_idle_e500; + cpu_idle_hook = cpu_idle_booke; } static void @@ -519,6 +525,7 @@ cpu_idle(int busy) CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); + if (cpu_idle_hook != NULL) { if (!busy) { critical_enter(); @@ -530,6 +537,7 @@ cpu_idle(int busy) critical_exit(); } } + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", busy, curcpu); } @@ -576,7 +584,7 @@ cpu_idle_60x(void) } static void -cpu_idle_e500(void) +cpu_idle_booke(void) { register_t msr; From owner-svn-src-head@FreeBSD.ORG Sat May 26 13:42:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 916211065670; Sat, 26 May 2012 13:42:56 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C1AA8FC17; Sat, 26 May 2012 13:42:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QDguvp080438; Sat, 26 May 2012 13:42:56 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QDguqn080436; Sat, 26 May 2012 13:42:56 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205261342.q4QDguqn080436@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 13:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236098 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 13:42:56 -0000 Author: raj Date: Sat May 26 13:42:55 2012 New Revision: 236098 URL: http://svn.freebsd.org/changeset/base/236098 Log: Retrieve CPU number info from the device tree. Obtained from: Freescale, Semihalf. Modified: head/sys/powerpc/booke/platform_bare.c Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Sat May 26 13:36:18 2012 (r236097) +++ head/sys/powerpc/booke/platform_bare.c Sat May 26 13:42:55 2012 (r236098) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2008-2009 Semihalf, Rafal Jaworowski + * Copyright (c) 2008-2012 Semihalf. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -101,26 +101,16 @@ PLATFORM_DEF(bare_platform); static int bare_probe(platform_t plat) { - uint32_t ver, sr; + phandle_t cpus, child; + uint32_t sr; int i, law_max, tgt; - ver = SVR_VER(mfspr(SPR_SVR)); - switch (ver & ~0x0008) { /* Mask Security Enabled bit */ - case SVR_P4080: - maxcpu = 8; - break; - case SVR_P4040: - maxcpu = 4; - break; - case SVR_MPC8572: - case SVR_P1020: - case SVR_P2020: - maxcpu = 2; - break; - default: + if ((cpus = OF_finddevice("/cpus")) != 0) { + for (maxcpu = 0, child = OF_child(cpus); child != 0; + child = OF_peer(child), maxcpu++) + ; + } else maxcpu = 1; - break; - } /* * Clear local access windows. Skip DRAM entries, so we don't shoot From owner-svn-src-head@FreeBSD.ORG Sat May 26 14:44:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8144E106566B; Sat, 26 May 2012 14:44:19 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BDB18FC08; Sat, 26 May 2012 14:44:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QEiJYB083221; Sat, 26 May 2012 14:44:19 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QEiJoi083219; Sat, 26 May 2012 14:44:19 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201205261444.q4QEiJoi083219@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 26 May 2012 14:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236101 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 14:44:19 -0000 Author: gavin Date: Sat May 26 14:44:18 2012 New Revision: 236101 URL: http://svn.freebsd.org/changeset/base/236101 Log: Updates to reflect recent commit bits handed back, etc. MFC after: 1 week Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sat May 26 14:24:14 2012 (r236100) +++ head/share/misc/committers-src.dot Sat May 26 14:44:18 2012 (r236101) @@ -39,6 +39,7 @@ billf [label="Bill Fumerola\nbillf@FreeB bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2002/01/29\n2009/09/13"] bmilekic [label="Bosko Milekic\nbmilekic@FreeBSD.org\n2000/09/21\n2008/11/10"] bushman [label="Michael Bushkov\nbushman@FreeBSD.org\n2007/03/10\n2010/04/29"] +ceri [label="Ceri Davies\nceri@FreeBSD.org\n2006/11/07\n2012/03/07"] cjc [label="Crist J. Clark\ncjc@FreeBSD.org\n2001/06/01\n2006/12/29"] dds [label="Diomidis Spinellis\ndds@FreeBSD.org\n2003/06/20\n2010/09/22"] dhartmei [label="Daniel Hartmeier\ndhartmei@FreeBSD.org\n2004/04/06\n2008/12/08"] @@ -58,20 +59,21 @@ jtc [label="J.T. Conklin\njtc@FreeBSD.or kbyanc [label="Kelly Yancey\nkbyanc@FreeBSD.org\n2000/07/11\n2006/07/25"] keichii [label="Michael Wu\nkeichii@FreeBSD.org\n2001/03/07\n2006/04/28"] linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2006/09/30\n2008/05/04"] +lulf [label="Ulf Lilleengen\nlulf@FreeBSD.org\n2007/10/24\n2012/01/19"] mb [label="Maxim Bolotin\nmb@FreeBSD.org\n2000/04/06\n2003/03/08"] marks [label="Mark Santcroos\nmarks@FreeBSD.org\n2004/03/18\n2008/09/29"] mike [label="Mike Barcroft\nmike@FreeBSD.org\n2001/07/17\n2006/04/28"] msmith [label="Mike Smith\nmsmith@FreeBSD.org\n????/??/??\n2003/12/15"] murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05\n2010/07/25"] +mux [label="Maxime Henrion\nmux@FreeBSD.org\n2002/03/03\n2011/06/22"] nate [label="Nate Willams\nnate@FreeBSD.org\n1993/06/12\n2003/12/15"] njl [label="Nate Lawson\nnjl@FreeBSD.org\n2002/08/07\n2008/02/16"] non [label="Noriaki Mitsnaga\nnon@FreeBSD.org\n2000/06/19\n2007/03/06"] onoe [label="Atsushi Onoe\nonoe@FreeBSD.org\n2000/07/21\n2008/11/10"] +randi [label="Randi Harper\nrandi@FreeBSD.org\n2010/04/20\n2012/05/10"] rgrimes [label="Rod Grimes\nrgrimes@FreeBSD.org\n1993/06/12\n2003/03/08"] rink [label="Rink Springer\nrink@FreeBSD.org\n2006/01/16\n2010/11/04"] robert [label="Robert Drehmel\nrobert@FreeBSD.org\n2001/08/23\n2006/05/13"] -rmh [label="Robert Millan\nrmh@FreeBSD.org\n2011/09/18"] -rpaulo [label="Rui Paulo\nrpaulo@FreeBSD.org\n2007/09/25\n2010/12/03"] sah [label="Sam Hopkins\nsah@FreeBSD.org\n2004/12/15\n2008/11/10"] shafeeq [label="Shafeeq Sinnamohideen\nshafeeq@FreeBSD.org\n2000/06/19\n2006/04/06"] sheldonh [label="Sheldon Hearn\nsheldonh@FreeBSD.org\n1999/06/14\n2006/05/13"] @@ -82,6 +84,7 @@ tmm [label="Thomas Moestl\ntmm@FreeBSD.o toshi [label="Toshihiko Arai\ntoshi@FreeBSD.org\n2000/07/06\n2003/03/08"] tshiozak [label="Takuya SHIOZAKI\ntshiozak@FreeBSD.org\n2001/04/25\n2003/03/08"] uch [label="UCHIYAMA Yasushi\nuch@FreeBSD.org\n2000/06/21\n2002/04/24"] +yar [label="Yar Tikhiy\nyar@FreeBSD.org\n2001/03/25\n2012/05/23"] node [color=lightblue2, style=filled, bgcolor=black]; @@ -112,7 +115,6 @@ brueffer [label="Christian Brueffer\nbru bruno [label="Bruno Ducrot\nbruno@FreeBSD.org\n2005/07/18"] bschmidt [label="Bernhard Schmidt\nbschmidt@FreeBSD.org\n2010/02/06"] bz [label="Bjoern A. Zeeb\nbz@FreeBSD.org\n2004/07/27"] -ceri [label="Ceri Davies\nceri@FreeBSD.org\n2006/11/07"] cognet [label="Olivier Houchard\ncognet@FreeBSD.org\n2002/10/09"] cokane [label="Coleman Kane\ncokane@FreeBSD.org\n2000/06/19"] cperciva [label="Colin Percival\ncperciva@FreeBSD.org\n2004/01/20"] @@ -187,7 +189,6 @@ kib [label="Konstantin Belousov\nkib@Fre kmacy [label="Kip Macy\nkmacy@FreeBSD.org\n2005/06/01"] le [label="Lukas Ertl\nle@FreeBSD.org\n2004/02/02"] lstewart [label="Lawrence Stewart\nlstewart@FreeBSD.org\n2008/10/06"] -lulf [label="Ulf Lilleengen\nlulf@FreeBSD.org\n2007/10/24"] marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03"] marius [label="Marius Strobl\nmarius@FreeBSD.org\n2004/04/17"] markm [label="Mark Murray\nmarkm@FreeBSD.org\n199?/??/??"] @@ -202,7 +203,6 @@ mjacob [label="Matt Jacob\nmjacob@FreeBS mlaier [label="Max Laier\nmlaier@FreeBSD.org\n2004/02/10"] monthadar [label="Monthadar Al Jaberi\nmonthadar@FreeBSD.org\n2012/04/02"] mr [label="Michael Reifenberger\nmr@FreeBSD.org\n2001/09/30"] -mux [label="Maxime Henrion\nmux@FreeBSD.org\n2002/03/03"] neel [label="Neel Natu\nneel@FreeBSD.org\n2009/09/20"] netchild [label="Alexander Leidinger\nnetchild@FreeBSD.org\n2005/03/31"] nork [label="Norikatsu Shigemura\nnork@FreeBSD.org\n2009/06/09"] @@ -213,7 +213,7 @@ olli [label="Oliver Fromme\nolli@FreeBSD peadar [label="Peter Edwards\npeadar@FreeBSD.org\n2004/03/08"] peter [label="Peter Wemm\npeter@FreeBSD.org\n????/??/??"] pfg [label="Pedro Giffuni\npfg@FreeBSD.org\n2011/12/01"] -philip [label="Philip Paeps\nphilip@FreBSD.org\n2004/01/21"] +philip [label="Philip Paeps\nphilip@FreeBSD.org\n2004/01/21"] phk [label="Poul-Henning Kamp\nphk@FreeBSD.org\n1994/02/21"] pho [label="Peter Holm\npho@FreeBSD.org\n2008/11/16"] pjd [label="Pawel Jakub Dawidek\npjd@FreeBSD.org\n2004/02/02"] @@ -221,14 +221,15 @@ pluknet [label="Sergey Kandaurov\nplukne ps [label="Paul Saab\nps@FreeBSD.org\n2000/02/23"] qingli [label="Qing Li\nqingli@FreeBSD.org\n2005/04/13"] rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2007/01/31"] -randi [label="Randi Harper\nrandi@FreeBSD.org\n2010/04/20"] ray [label="Aleksandr Rybalko\nray@FreeBSD.org\n2011/05/25"] rdivacky [label="Roman Divacky\nrdivacky@FreeBSD.org\n2008/03/13"] remko [label="Remko Lodder\nremko@FreeBSD.org\n2007/02/23"] rik [label="Roman Kurakin\nrik@FreeBSD.org\n2003/12/18"] rmacklem [label="Rick Macklem\nrmacklem@FreeBSD.org\n2009/03/27"] +rmh [label="Robert Millan\nrmh@FreeBSD.org\n2011/09/18"] rnoland [label="Robert Noland\nrnoland@FreeBSD.org\n2008/09/15"] roberto [label="Ollivier Robert\nroberto@FreeBSD.org\n1995/02/22"] +rpaulo [label="Rui Paulo\nrpaulo@FreeBSD.org\n2007/09/25"] rrs [label="Randall R Stewart\nrrs@FreeBSD.org\n2007/02/08"] rse [label="Ralf S. Engelschall\nrse@FreeBSD.org\n1997/07/31"] rstone [label="Ryan Stone\nrstone@FreeBSD.org\n2010/04/19"] @@ -266,7 +267,6 @@ wes [label="Wes Peters\nwes@FreeBSD.org\ wilko [label="Wilko Bulte\nwilko@FreeBSD.org\n2000/01/13"] wollman [label="Garrett Wollman\nwollman@FreeBSD.org\n????/??/??"] wsalamon [label="Wayne Salamon\nwsalamon@FreeBSD.org\n2005/06/25"] -yar [label="Yar Tikhiy\nyar@FreeBSD.org\n2001/03/25"] yongari [label="Pyun YongHyeon\nyongari@FreeBSD.org\n2004/08/01"] zack [label="Zack Kirsch\nzack@FreeBSD.org\n2010/11/05"] zec [label="Marko Zec\nzec@FreeBSD.org\n2008/06/22"] From owner-svn-src-head@FreeBSD.ORG Sat May 26 16:26:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9D26106566B; Sat, 26 May 2012 16:26:23 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B1EC8FC0C; Sat, 26 May 2012 16:26:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QGQN3F088173; Sat, 26 May 2012 16:26:23 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QGQN7N088171; Sat, 26 May 2012 16:26:23 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201205261626.q4QGQN7N088171@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 26 May 2012 16:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236102 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 16:26:23 -0000 Author: gavin Date: Sat May 26 16:26:23 2012 New Revision: 236102 URL: http://svn.freebsd.org/changeset/base/236102 Log: Update to reflect various doc commit bits taken into safekeeping. MFC after: 1 week Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Sat May 26 14:44:18 2012 (r236101) +++ head/share/misc/committers-doc.dot Sat May 26 16:26:23 2012 (r236102) @@ -32,15 +32,19 @@ node [color=grey62, style=filled, bgcolo ache [label="Andrey Chernov\nache@FreeBSD.org\n1997/06/13\n2010/12/11"] bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2000/08/22\n2009/09/13"] bvs [label="Vitaly Bogdanov\nbvs@FreeBSD.org\n2005/10/03\n2010/12/11"] +ceri [label="Ceri Davies\nceri@FreeBSD.org\n2002/03/17\n2012/02/29"] den [label="Denis Peplin\nden@FreeBSD.org\n2003/09/13\n2009/07/09"] garys [label="Gary W. Swearingen\ngarys@FreeBSD.org\n2005/08/21\n2008/03/02"] jcamou [label="Jesus R. Camou\njcamou@FreeBSD.org\n2005/03/02\n2008/12/20"] jesusr [label="Jesus Rodriguez Cuesta\njesusr@FreeBSD.org\n1998/12/10\n2010/12/11"] jim [label="Jim Mock\njim@FreeBSD.org\n1999/08/11\n2003/12/15"] josef [label="Josef El-Rayes\njosef@FreeBSD.org\n2004/01/15\n2008/03/29"] +marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03\n2012/04/25"] mheinen [label="Martin Heinen\nmheinen@FreeBSD.org\n2002/10/04\n2006/04/26"] +murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05\n2012/04/25"] nik [label="Nik Clayton\nnik@FreeBSD.org\n1998/02/26\n2008/12/20"] pgj [label="Gabor Pali\npgj@FreeBSD.org\n2008/04/21\n2010/12/01"] +roam [label="Peter Pentchev\nroam@FreeBSD.org\n2003/02/14\n2012/02/29"] node [color=lightblue2, style=filled, bgcolor=black]; @@ -51,7 +55,6 @@ bcr [label="Benedict Reuschling\nbcr@Fre blackend [label="Marc Fonvieille\nblackend@FreeBSD.org\n2002/06/16"] brd [label="Brad Davis\nbrd@FreeBSD.org\n2005/06/01"] brueffer [label="Christian Brueffer\nbrueffer@FreeBSD.org\n2003/01/13"] -ceri [label="Ceri Davies\nceri@FreeBSD.org\n2002/03/17"] chinsan [label="Chinsan Huang\nchinsan@FreeBSD.org\n2006/09/20"] danger [label="Daniel Gerzo\ndanger@FreeBSD.org\n2006/08/20"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2004/09/14"] @@ -67,16 +70,13 @@ keramida [label="Giorgos Keramidas\nkera linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2004/03/31"] loader [label="Fukang Chen\nloader@FreeBSD.org\n2007/07/30"] manolis [label="Manolis Kiagias\nmanolis@FreeBSD.org\n2008/05/24"] -marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03"] marck [label="Dmitry Morozovsky\nmarck@FreeBSD.org\n2004/08/10"] maxim [label="Maxim Konovalov\nmaxim@FreeBSD.org\n2002/02/07"] miwi [label="Martin Wilke\nmiwi@FreeBSD.org\n2007/10/26"] -murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05"] pav [label="Pav Lucistnik\npav@FreeBSD.org\n2005/08/12"] pluknet [label="Sergey Kandaurov\npluknet@FreeBSD.org\n2012/02/14"] remko [label="Remko Lodder\nremko@FreeBSD.org\n2004/10/16"] rene [label="Rene Ladan\nrene@FreeBSD.org\n2008/11/03"] -roam [label="Peter Pentchev\nroam@FreeBSD.org\n2003/02/14"] ryusuke [label="Ryusuke Suzuki\nryusuke@FreeBSD.org\n2009/12/21"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2003/07/20"] taras [label="Taras Korenko\ntaras@FreeBSD.org\n2010/06/25"] From owner-svn-src-head@FreeBSD.ORG Sat May 26 17:03:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEB33106566B; Sat, 26 May 2012 17:03:45 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9F538FC16; Sat, 26 May 2012 17:03:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QH3jwS092417; Sat, 26 May 2012 17:03:45 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QH3j6J092415; Sat, 26 May 2012 17:03:45 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261703.q4QH3j6J092415@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 17:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236106 - head/lib/libpam/modules/pam_ssh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:03:46 -0000 Author: des Date: Sat May 26 17:03:45 2012 New Revision: 236106 URL: http://svn.freebsd.org/changeset/base/236106 Log: Passing NULL as a key casues a segfault when loading SSH 1 keys. Use an empty string instead. Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c ============================================================================== --- head/lib/libpam/modules/pam_ssh/pam_ssh.c Sat May 26 16:42:47 2012 (r236105) +++ head/lib/libpam/modules/pam_ssh/pam_ssh.c Sat May 26 17:03:45 2012 (r236106) @@ -112,7 +112,7 @@ pam_ssh_load_key(const char *dir, const * with an empty passphrase, and if the key is not encrypted, * accept only an empty passphrase. */ - key = key_load_private(fn, NULL, &comment); + key = key_load_private(fn, "", &comment); if (key != NULL && !(*passphrase == '\0' && nullok)) { key_free(key); return (NULL); From owner-svn-src-head@FreeBSD.ORG Sat May 26 17:10:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9BBA71065676; Sat, 26 May 2012 17:10:17 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 837A18FC08; Sat, 26 May 2012 17:10:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QHAHaK094565; Sat, 26 May 2012 17:10:17 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QHAHVj094549; Sat, 26 May 2012 17:10:17 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261710.q4QHAHVj094549@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 17:10:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236109 - in head: contrib/openpam contrib/openpam/bin contrib/openpam/bin/openpam_dump_policy contrib/openpam/bin/pamtest contrib/openpam/bin/su contrib/openpam/doc/man contrib/openpam... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:10:17 -0000 Author: des Date: Sat May 26 17:10:16 2012 New Revision: 236109 URL: http://svn.freebsd.org/changeset/base/236109 Log: Update to OpenPAM Micrampelis. Added: head/contrib/openpam/TODO - copied unchanged from r236101, vendor/openpam/dist/TODO head/contrib/openpam/bin/openpam_dump_policy/ - copied from r236101, vendor/openpam/dist/bin/openpam_dump_policy/ head/contrib/openpam/doc/man/openpam_get_feature.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_get_feature.3 head/contrib/openpam/doc/man/openpam_readlinev.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_readlinev.3 head/contrib/openpam/doc/man/openpam_readword.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_readword.3 head/contrib/openpam/doc/man/openpam_set_feature.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_set_feature.3 head/contrib/openpam/doc/man/openpam_straddch.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_straddch.3 head/contrib/openpam/lib/openpam_ctype.h - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_ctype.h head/contrib/openpam/lib/openpam_features.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_features.c head/contrib/openpam/lib/openpam_features.h - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_features.h head/contrib/openpam/lib/openpam_get_feature.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_get_feature.c head/contrib/openpam/lib/openpam_readlinev.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_readlinev.c head/contrib/openpam/lib/openpam_readword.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_readword.c head/contrib/openpam/lib/openpam_set_feature.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_set_feature.c head/contrib/openpam/lib/openpam_straddch.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_straddch.c head/contrib/openpam/lib/openpam_strlcat.h - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_strlcat.h head/contrib/openpam/pamgdb.in - copied unchanged from r236101, vendor/openpam/dist/pamgdb.in head/contrib/openpam/t/ - copied from r236101, vendor/openpam/dist/t/ head/usr.bin/pamtest/ head/usr.bin/pamtest/Makefile (contents, props changed) Modified: head/contrib/openpam/CREDITS head/contrib/openpam/HISTORY head/contrib/openpam/LICENSE head/contrib/openpam/Makefile.am head/contrib/openpam/Makefile.in head/contrib/openpam/RELNOTES head/contrib/openpam/aclocal.m4 head/contrib/openpam/bin/Makefile.am head/contrib/openpam/bin/Makefile.in head/contrib/openpam/bin/pamtest/pamtest.1 head/contrib/openpam/bin/pamtest/pamtest.c head/contrib/openpam/bin/su/su.1 head/contrib/openpam/config.h.in head/contrib/openpam/configure head/contrib/openpam/configure.ac head/contrib/openpam/doc/man/Makefile.am head/contrib/openpam/doc/man/Makefile.in head/contrib/openpam/doc/man/openpam.3 head/contrib/openpam/doc/man/openpam_borrow_cred.3 head/contrib/openpam/doc/man/openpam_free_data.3 head/contrib/openpam/doc/man/openpam_free_envlist.3 head/contrib/openpam/doc/man/openpam_get_option.3 head/contrib/openpam/doc/man/openpam_log.3 head/contrib/openpam/doc/man/openpam_nullconv.3 head/contrib/openpam/doc/man/openpam_readline.3 head/contrib/openpam/doc/man/openpam_restore_cred.3 head/contrib/openpam/doc/man/openpam_set_option.3 head/contrib/openpam/doc/man/openpam_subst.3 head/contrib/openpam/doc/man/openpam_ttyconv.3 head/contrib/openpam/doc/man/pam.3 head/contrib/openpam/doc/man/pam.conf.5 head/contrib/openpam/doc/man/pam_acct_mgmt.3 head/contrib/openpam/doc/man/pam_authenticate.3 head/contrib/openpam/doc/man/pam_chauthtok.3 head/contrib/openpam/doc/man/pam_close_session.3 head/contrib/openpam/doc/man/pam_conv.3 head/contrib/openpam/doc/man/pam_end.3 head/contrib/openpam/doc/man/pam_error.3 head/contrib/openpam/doc/man/pam_get_authtok.3 head/contrib/openpam/doc/man/pam_get_data.3 head/contrib/openpam/doc/man/pam_get_item.3 head/contrib/openpam/doc/man/pam_get_user.3 head/contrib/openpam/doc/man/pam_getenv.3 head/contrib/openpam/doc/man/pam_getenvlist.3 head/contrib/openpam/doc/man/pam_info.3 head/contrib/openpam/doc/man/pam_open_session.3 head/contrib/openpam/doc/man/pam_prompt.3 head/contrib/openpam/doc/man/pam_putenv.3 head/contrib/openpam/doc/man/pam_set_data.3 head/contrib/openpam/doc/man/pam_set_item.3 head/contrib/openpam/doc/man/pam_setcred.3 head/contrib/openpam/doc/man/pam_setenv.3 head/contrib/openpam/doc/man/pam_sm_acct_mgmt.3 head/contrib/openpam/doc/man/pam_sm_authenticate.3 head/contrib/openpam/doc/man/pam_sm_chauthtok.3 head/contrib/openpam/doc/man/pam_sm_close_session.3 head/contrib/openpam/doc/man/pam_sm_open_session.3 head/contrib/openpam/doc/man/pam_sm_setcred.3 head/contrib/openpam/doc/man/pam_start.3 head/contrib/openpam/doc/man/pam_strerror.3 head/contrib/openpam/doc/man/pam_verror.3 head/contrib/openpam/doc/man/pam_vinfo.3 head/contrib/openpam/doc/man/pam_vprompt.3 head/contrib/openpam/include/security/openpam.h head/contrib/openpam/include/security/openpam_version.h head/contrib/openpam/lib/Makefile.am head/contrib/openpam/lib/Makefile.in head/contrib/openpam/lib/openpam_check_owner_perms.c head/contrib/openpam/lib/openpam_configure.c head/contrib/openpam/lib/openpam_constants.h head/contrib/openpam/lib/openpam_debug.h head/contrib/openpam/lib/openpam_dynamic.c head/contrib/openpam/lib/openpam_get_option.c head/contrib/openpam/lib/openpam_impl.h head/contrib/openpam/lib/openpam_load.c head/contrib/openpam/lib/openpam_log.c head/contrib/openpam/lib/openpam_readline.c head/contrib/openpam/lib/openpam_set_option.c head/contrib/openpam/lib/openpam_strlcmp.h head/contrib/openpam/lib/openpam_strlcpy.h head/contrib/openpam/lib/openpam_subst.c head/contrib/openpam/lib/openpam_ttyconv.c head/contrib/openpam/lib/pam_get_authtok.c head/contrib/openpam/lib/pam_putenv.c head/contrib/openpam/lib/pam_setenv.c head/contrib/openpam/ltmain.sh head/contrib/openpam/misc/gendoc.pl head/lib/libpam/libpam/Makefile Directory Properties: head/contrib/openpam/ (props changed) Modified: head/contrib/openpam/CREDITS ============================================================================== --- head/contrib/openpam/CREDITS Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/CREDITS Sat May 26 17:10:16 2012 (r236109) @@ -16,16 +16,21 @@ ideas: Brian Fundakowski Feldman Christos Zoulas Daniel Richard G. - Darren J. Moffat + Darren J. Moffat Dmitry V. Levin + Don Lewis Emmanuel Dreyfus Eric Melville - Gary Winiger + Gary Winiger + Gleb Smirnoff Hubert Feyrer + Jason Evans Joe Marcus Clarke Juli Mallett Jörg Sonnenberger + Maëlle Lesage Mark Murray + Matthias Drochner Mike Petullo Mikhail Teterin Mikko Työläjärvi @@ -38,4 +43,4 @@ ideas: Wojciech A. Koszek Yar Tikhiy -$Id: CREDITS 498 2011-11-21 16:27:04Z des $ +$Id: CREDITS 587 2012-04-08 11:12:10Z des $ Modified: head/contrib/openpam/HISTORY ============================================================================== --- head/contrib/openpam/HISTORY Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/HISTORY Sat May 26 17:10:16 2012 (r236109) @@ -1,3 +1,51 @@ +OpenPAM Micrampelis 2012-05-26 + + - FEATURE: Add an openpam_readword(3) function which reads the next + word from an input stream, applying shell quoting and escaping + rules. Add numerous unit tests for openpam_readword(3). + + - FEATURE: Add an openpam_readlinev(3) function which uses the + openpam_readword(3) function to read words from an input stream one + at a time until it reaches an unquoted, unescaped newline, and + returns an array of those words. Add several unit tests for + openpam_readlinev(3). + + - FEATURE: Add a PAM_HOST item which pam_start(3) initializes to the + machine's hostname. This was implemented in Lycopsida but + inadvertantly left out of the release notes. + + - FEATURE: In pam_get_authtok(3), if neither the application nor the + module have specified a prompt and PAM_HOST and PAM_RHOST are both + defined but not equal, use a different default prompt that includes + PAM_USER and PAM_HOST. + + - ENHANCE: Rewrite the policy parser to used openpam_readlinev(), + which greatly simplifies the code. + + - ENHANCE: The previous implementation of the policy parser relied on + the openpam_readline(3) function, which (by design) munges + whitespace and understands neither quotes nor backslash escapes. + As a result of the aforementioned rewrite, whitespace, quotes and + backslash escapes in policy files are now handled in a consistent + and predictable manner. + + - ENHANCE: On platforms that have it, use fdlopen(3) to load modules. + This closes the race between the ownership / permission check and + the dlopen(3) call. + + - ENHANCE: Reduce the amount of pointless error messages generated + while searching for a module. + + - ENHANCE: Numerous documentation improvements, both in content and + formatting. + + - BUGFIX: A patch incorporated in Lycopsida inadvertantly changed + OpenPAM's behavior when several policies exist for the same + service, from ignoring all but the first to concatenating them all. + Revert to the original behavior. + + - BUGFIX: Plug a memory leak in the policy parser. +============================================================================ OpenPAM Lycopsida 2011-12-18 - ENHANCE: removed static build autodetection, which didn't work @@ -269,7 +317,7 @@ OpenPAM Cinchona 2002-04-08 - ENHANCE: Add openpam_free_data(), a generic cleanup function for pam_set_data() consumers. ============================================================================ -OpenPAM Centaury 2002-03-14 +OpenPAM Centaury 2002-03-14 - BUGFIX: Add missing #include to openpam_log.c. @@ -308,7 +356,7 @@ OpenPAM Celandine 2002-03-05 module with the same version number as the library itself to one with no version number at all. ============================================================================ -OpenPAM Cantaloupe 2002-02-22 +OpenPAM Cantaloupe 2002-02-22 - BUGFIX: The proper use of PAM_SYMBOL_ERR is to indicate an invalid argument to pam_[gs]et_item(3), not to indicate dlsym(3) failures. @@ -338,7 +386,7 @@ OpenPAM Cantaloupe 2002-02-22 - ENHANCE: openpam_get_authtok() now respects the echo_pass, try_first_pass, and use_first_pass options. ============================================================================ -OpenPAM Caliopsis 2002-02-13 +OpenPAM Caliopsis 2002-02-13 Fixed a number of bugs in the previous release, including: - a number of bugs in and related to pam_[gs]et_item(3) @@ -349,8 +397,8 @@ Fixed a number of bugs in the previous r - missing 'continue' in openpam_dispatch.c caused successes to be counted as failures ============================================================================ -OpenPAM Calamite 2002-02-09 +OpenPAM Calamite 2002-02-09 First (beta) release. ============================================================================ -$Id: HISTORY 504 2011-12-18 14:11:12Z des $ +$Id: HISTORY 609 2012-05-26 13:57:45Z des $ Modified: head/contrib/openpam/LICENSE ============================================================================== --- head/contrib/openpam/LICENSE Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/LICENSE Sat May 26 17:10:16 2012 (r236109) @@ -1,6 +1,6 @@ Copyright (c) 2002-2003 Networks Associates Technology, Inc. -Copyright (c) 2004-2011 Dag-Erling Smørgrav +Copyright (c) 2004-2012 Dag-Erling Smørgrav All rights reserved. This software was developed for the FreeBSD Project by ThinkSec AS and @@ -32,4 +32,4 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -$Id: LICENSE 437 2011-09-13 12:00:13Z des $ +$Id: LICENSE 546 2012-03-31 23:13:20Z des $ Modified: head/contrib/openpam/Makefile.am ============================================================================== --- head/contrib/openpam/Makefile.am Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/Makefile.am Sat May 26 17:10:16 2012 (r236109) @@ -1,4 +1,4 @@ -# $Id: Makefile.am 428 2010-03-09 17:32:17Z des $ +# $Id: Makefile.am 549 2012-04-01 20:38:30Z des $ ACLOCAL_AMFLAGS = -I m4 @@ -8,6 +8,8 @@ if WITH_DOC SUBDIRS += doc endif +SUBDIRS += t + EXTRA_DIST = \ CREDITS \ HISTORY \ Modified: head/contrib/openpam/Makefile.in ============================================================================== --- head/contrib/openpam/Makefile.in Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/Makefile.in Sat May 26 17:10:16 2012 (r236109) @@ -15,7 +15,7 @@ @SET_MAKE@ -# $Id: Makefile.am 428 2010-03-09 17:32:17Z des $ +# $Id: Makefile.am 549 2012-04-01 20:38:30Z des $ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -39,8 +39,8 @@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure INSTALL config.guess config.sub \ - depcomp install-sh ltmain.sh missing + $(srcdir)/pamgdb.in $(top_srcdir)/configure INSTALL TODO \ + config.guess config.sub depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -49,7 +49,7 @@ am__CONFIG_DISTCLEAN_FILES = config.stat configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = pamgdb CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = @@ -67,7 +67,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGE distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = lib bin modules include doc +DIST_SUBDIRS = lib bin modules include doc t DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -222,7 +222,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = lib bin modules include $(am__append_1) +SUBDIRS = lib bin modules include $(am__append_1) t EXTRA_DIST = \ CREDITS \ HISTORY \ @@ -288,6 +288,8 @@ $(srcdir)/config.h.in: $(am__configure_ distclean-hdr: -rm -f config.h stamp-h1 +pamgdb: $(top_builddir)/config.status $(srcdir)/pamgdb.in + cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo Modified: head/contrib/openpam/RELNOTES ============================================================================== --- head/contrib/openpam/RELNOTES Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/RELNOTES Sat May 26 17:10:16 2012 (r236109) @@ -1,6 +1,6 @@ - Release notes for OpenPAM Lycopsida - =================================== + Release notes for OpenPAM Micrampelis + ===================================== This release corresponds to the code used in FreeBSD HEAD as of the release date, and is also expected to work on almost any POSIX-like @@ -19,6 +19,9 @@ intended for actual use, but rather to s application developers. It also includes a command-line application (pamtest) which can be used to test policies and modules. +Unit tests for limited portions of the library can be found in the t +subdirectory. + Please direct bug reports and inquiries to . -$Id: RELNOTES 506 2011-12-18 14:25:12Z des $ +$Id: RELNOTES 609 2012-05-26 13:57:45Z des $ Copied: head/contrib/openpam/TODO (from r236101, vendor/openpam/dist/TODO) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openpam/TODO Sat May 26 17:10:16 2012 (r236109, copy of r236101, vendor/openpam/dist/TODO) @@ -0,0 +1,13 @@ +Before the next release: + + - Complete the transition from PAM_LOG_DEBUG to PAM_LOG_LIBDEBUG. + +Whenever: + + - Implement mechanism to enable / disable optional features. Use it + to disable strict error checking so pamtest and unit tests can do + things that we don't allow in production. + + - Rewrite the module-loading code. + +$Id: TODO 592 2012-04-08 13:19:51Z des $ Modified: head/contrib/openpam/aclocal.m4 ============================================================================== --- head/contrib/openpam/aclocal.m4 Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/aclocal.m4 Sat May 26 17:10:16 2012 (r236109) @@ -22,8 +22,8 @@ To do so, use the procedure documented b # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -32,8 +32,8 @@ To do so, use the procedure documented b m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -167,6 +167,8 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -652,7 +654,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -816,6 +818,7 @@ AC_DEFUN([LT_LANG], m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], @@ -837,6 +840,29 @@ m4_defun([_LT_LANG], ])# _LT_LANG +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], @@ -867,6 +893,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ], m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) @@ -969,7 +999,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECK $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -977,6 +1013,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECK rm -rf libconftest.dylib* rm -f conftest.* fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -988,6 +1025,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECK [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF @@ -1005,7 +1043,9 @@ _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1050,8 +1090,8 @@ _LT_EOF ]) -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ @@ -1062,6 +1102,8 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi @@ -1345,14 +1387,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -1429,13 +1484,13 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -1615,6 +1670,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [d lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -1654,7 +1714,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [d # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do @@ -2200,7 +2260,7 @@ need_version=unknown case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -2209,7 +2269,7 @@ aix3*) ;; aix[[4-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -2274,7 +2334,7 @@ beos*) ;; bsdi[[45]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -2413,7 +2473,7 @@ m4_if([$1], [],[ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -2466,17 +2526,18 @@ freebsd* | dragonfly*) ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" @@ -2537,7 +2598,7 @@ hpux9* | hpux10* | hpux11*) ;; interix[[3-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -2553,7 +2614,7 @@ irix5* | irix6* | nonstopux*) nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -2590,9 +2651,9 @@ linux*oldld* | linux*aout* | linux*coff* dynamic_linker=no ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2655,7 +2716,7 @@ netbsd*) ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -2724,7 +2785,7 @@ rdos*) ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2749,7 +2810,7 @@ sunos4*) ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2773,7 +2834,7 @@ sysv4 | sysv4.3*) sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -2804,7 +2865,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2814,7 +2875,7 @@ tpf*) ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -3236,7 +3297,7 @@ irix5* | irix6* | nonstopux*) lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. +# This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3656,6 +3717,7 @@ for ac_symprfx in "" "_"; do # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -4240,7 +4302,9 @@ m4_if([$1], [CXX], [ case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi ;; esac else @@ -4332,18 +4396,33 @@ m4_if([$1], [CXX], [ ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; esac ;; esac @@ -4503,7 +4582,9 @@ m4_if([$1], [CXX], [ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) ;; + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] @@ -4528,7 +4609,6 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -4779,8 +4859,7 @@ _LT_EOF xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ @@ -5075,6 +5154,7 @@ _LT_EOF # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' @@ -5172,7 +5252,6 @@ _LT_EOF fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes @@ -5614,9 +5693,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1] _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], @@ -5770,7 +5846,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -6901,12 +6976,18 @@ public class foo { } }; _LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary @@ -7103,7 +7184,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7236,7 +7316,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7419,6 +7498,73 @@ CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler @@ -7488,6 +7634,13 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], @@ -8152,9 +8305,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) @@ -8326,15 +8494,15 @@ m4_define([lt_dict_filter], # @configure_input@ -# serial 3293 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4]) -m4_define([LT_PACKAGE_REVISION], [1.3293]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4' -macro_revision='1.3293' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) Modified: head/contrib/openpam/bin/Makefile.am ============================================================================== --- head/contrib/openpam/bin/Makefile.am Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/bin/Makefile.am Sat May 26 17:10:16 2012 (r236109) @@ -1,6 +1,6 @@ -# $Id: Makefile.am 467 2011-11-02 23:42:21Z des $ +# $Id: Makefile.am 538 2012-03-31 17:04:29Z des $ -SUBDIRS = +SUBDIRS = openpam_dump_policy if WITH_PAMTEST SUBDIRS += pamtest Modified: head/contrib/openpam/bin/Makefile.in ============================================================================== --- head/contrib/openpam/bin/Makefile.in Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/bin/Makefile.in Sat May 26 17:10:16 2012 (r236109) @@ -15,7 +15,7 @@ @SET_MAKE@ -# $Id: Makefile.am 467 2011-11-02 23:42:21Z des $ +# $Id: Makefile.am 538 2012-03-31 17:04:29Z des $ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -63,7 +63,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGE distdir ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = pamtest su +DIST_SUBDIRS = openpam_dump_policy pamtest su DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -207,7 +207,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = $(am__append_1) $(am__append_2) +SUBDIRS = openpam_dump_policy $(am__append_1) $(am__append_2) all: all-recursive .SUFFIXES: Modified: head/contrib/openpam/bin/pamtest/pamtest.1 ============================================================================== --- head/contrib/openpam/bin/pamtest/pamtest.1 Sat May 26 17:08:01 2012 (r236108) +++ head/contrib/openpam/bin/pamtest/pamtest.1 Sat May 26 17:10:16 2012 (r236109) @@ -10,6 +10,9 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote +.\" products derived from this software without specific prior written +.\" permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -23,9 +26,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: pamtest.1 471 2011-11-03 09:44:40Z des $ +.\" $Id: pamtest.1 610 2012-05-26 14:03:45Z des $ .\" -.Dd November 2, 2011 +.Dd May 26, 2012 .Dt PAMTEST 1 .Os .Sh NAME @@ -33,7 +36,7 @@ .Nd PAM policy tester .Sh SYNOPSYS .Nm -.Op Fl dksv +.Op Fl dkMPsv .Op Fl H Ar rhost .Op Fl h Ar host .Op Fl t Ar tty @@ -116,6 +119,11 @@ The default is to use the result of call .Xr gethostname 3 . .It Fl k Keep going even if one of the commands fails. +.It Fl M +Disable path, ownership and permission checks on module files. +.It Fl P +Disable service name validation and path, ownership and permission +checks on policy files. .It Fl s Set the .Dv PAM_SILENT @@ -149,14 +157,14 @@ policy: pamtest -v system auth account change setcred open close unsetcred .Ed *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat May 26 17:13:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA7CA10656D0; Sat, 26 May 2012 17:13:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 31FA18FC19; Sat, 26 May 2012 17:13:50 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4QGnS3X007346; Sat, 26 May 2012 19:49:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4QGnSOO031534; Sat, 26 May 2012 19:49:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4QGnRxs031533; Sat, 26 May 2012 19:49:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 26 May 2012 19:49:27 +0300 From: Konstantin Belousov To: Bruce Evans Message-ID: <20120526164927.GU2358@deviant.kiev.zoral.com.ua> References: <201205252150.q4PLomFk035064@svn.freebsd.org> <20120526173233.A885@besplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Yp4ECpV6dHcLchHG" Content-Disposition: inline In-Reply-To: <20120526173233.A885@besplex.bde.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Ed Schouten , rwatson@freebsd.org, svn-src-head@freebsd.org, jonathan@freebsd.org Subject: Re: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:13:52 -0000 --Yp4ECpV6dHcLchHG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 26, 2012 at 10:21:25PM +1000, Bruce Evans wrote: > On Fri, 25 May 2012, Ed Schouten wrote: >=20 > >Log: > > Remove use of non-ISO-C integer types from system call tables. > > > > These files already use ISO-C-style integer types, so make them less > > inconsistent by preferring the standard types. >=20 > These should actually be Linux types l_foo_t. ISO-C-style integer types > seem to have only been used for a couple of uintptr_t's, and these uses > are more than just style bugs on amd64 since uintptr_t is for the host > (64 bits on amd64) while the target uintptr_t is only 32 bits. There > are also a few misuses of the abominable caddr_t instead of l_caddr_t, > so syscalls that don't even take a caddr_t. Otherwise, Linux types > are used a lot to avoid size mismatches. >=20 > >Modified: head/sys/amd64/linux32/syscalls.master > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- head/sys/amd64/linux32/syscalls.master Fri May 25 21:12:24 2012=20 > >(r236025) > >+++ head/sys/amd64/linux32/syscalls.master Fri May 25 21:50:48 2012=20 > >(r236026) > >@@ -54,8 +54,8 @@ > > l_int mode); } > >9 AUE_LINK STD { int linux_link(char *path, char *to); } > >10 AUE_UNLINK STD { int linux_unlink(char *path); } > >-11 AUE_EXECVE STD { int linux_execve(char *path, u_int32_t=20 > >*argp, \ > >- u_int32_t *envp); } > >+11 AUE_EXECVE STD { int linux_execve(char *path, uint32_t=20 > >*argp, \ > >+ uint32_t *envp); } >=20 > argp and envp aren't uintany_t * in either Linux or FreeBSD. They start = as > "char * const *". There is no Linux type for an indirect "char *", and o= ne > was hacked up here by pretending that "char *" is u_int32_t (it is actual= ly > just 32 bits). Using l_caddr_t seems to be the best hack available (since > by abusing l_caddr_t, we know that it is actually char *). >=20 > The `const' in the type for argp and envp is further from being handled > correctly. Most or all syscall.master's just type-pun it away. Similarly > for "const char *path". >=20 > All the non-indirect "char *"s for pathnames and other things seem to be > completely wrong on amd64 too. These pointers start as 32 bits, and it > takes more than a bad type pun to turn then into kernel 64-bit pointers. > The magic for this seems to be: > - all args are converted to 64 bits (by zero-extension?) at a low level The 'low level' AKA magic happens in several *_fetch_syscall_args() functions. For both linux32 and freebsd32, the magic code automatically zero-extends the arguments into 64bit entities. Linux passes args in registers, while FreeBSD uses words on stack. The types in the syscalls.master prototype should be in fact selected to fit the in-kernel prototypes for the functions implementing the syscalls, esp. for NOPROTO cases, and not to the low-level layout of the syscall entry data. > - the args struct for a pathname is > [left padding]; char *; [right padding]; > Since the char * is misdeclared, the explicit padding is null, but the > layout of the args struct is correct because the wrong arg type in it > supplies equivalent padding (extra 32 bits on the right). The arg struct layout is irrelevant, since fetch_syscall_args() functions perform the needed translation from process ABI to kernel ABI. I think that the padding could be completely eliminated for translated ABI, but since it is easier to reuse makesyscalls.sh instead of creating ABI-specific script, and since there is quite non-trivial count of NOPROTO declarations that just match the native-ABI syscall handlers, it is better not to start that. > - the "char *" in the args struct is not actually a char *, and is unusab= le > directly in the kernel. However, it is only used in copyin() and > copyout(), where it becomes a user address and works correctly. (An > older bug in this that the user address for copy*() is declared as > "void *". "void *" means a kernel pointer. The type of a user > address should be more like vm_offset_t, but even that needs logical > translation for linux32). It is char *, but in different address space. Linux-style type qualifiers like __usermode would be appropriate there (remember far/near ?), but we do not have static checkers that do understand the difference. >=20 > The same mechanism presumably avoids problems when raw caddr_t is used > instead of l_caddr_t, and when uintptr_t is used instead of l_uintptr_t. >=20 > >12 AUE_CHDIR STD { int linux_chdir(char *path); } > >13 AUE_NULL STD { int linux_time(l_time_t *tm); } >=20 > Example of a correct use of a linux type. Again, the first-level pointer > is handled by the above magic, but for the second level we need an l_foo_t > to describe its size correctly. >=20 > >14 AUE_MKNOD STD { int linux_mknod(char *path, l_int mode, \ >=20 > Broken except in the K&R case, but amd64 is too new to pretend to support > K&R. Bug for bug compatible with mknod() and some other syscalls in C std version is irrelevant there. Args fetch code promotes all arguments to (u)int(32). > kern/syscalls.master. mknod() takes an arg of type mode_t, not one of > type int. l_mode_t exists so that the above can be declared correctly, > and is already used for linux_chmod() and linux_chmodat(). OTOH, int for > the mode arg is correct for open(), since open() is variadic at a level > before the syscall, so its mode_t arg gets promoted to int. Similarly, > if mknod() is compiled by a K&R compiler, or by a STDC compiler with no > prototype in scope, then its mode_t arg gets promoted to int (but for > the STDC case, the behaviour is then undefined once mknod() is reached). > Normally this doesn't cause any problems, but it is easy to declare > things correctly. >=20 > >Modified: head/sys/compat/freebsd32/syscalls.master > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- head/sys/compat/freebsd32/syscalls.master Fri May 25 21:12:24 2012= =20 > >(r236025) > >+++ head/sys/compat/freebsd32/syscalls.master Fri May 25 21:50:48 2012= =20 > >(r236026) > >@@ -104,9 +104,9 @@ > > int flags); } > >28 AUE_SENDMSG STD { int freebsd32_sendmsg(int s, struct=20 > >msghdr32 *msg, \ > > int flags); } > >-29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, u_int32_t=20 > >buf, \ > >- u_int32_t len, int flags, u_int32_t=20 > >from, \ > >- u_int32_t fromlenaddr); } > >+29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, uint32_t=20 > >buf, \ > >+ uint32_t len, int flags, uint32_t from, \ > >+ uint32_t fromlenaddr); } >=20 > Oops, I didn't looke at this file when I said that "ISO-C-style integer > types seem to have only been used for a couple of uintptr_t's". This > file is independent of Linux, so it can't use l_foo. It hard-codes 32 > instead, starting with the directory name. Still, all of the types in > the above are fairly bogus and hard to understand: > - "int" for `s' and `flags' depends on ints being 32 bits I agree that this is the biggest type-pun in the whole compat32/linux32 components. It would be nice to use int32_t/uint32_t instead of int there, since we in fact operate on ABI-defined type. But I do not think it is much worry to expect an arch to appear which have sizeof(int) !=3D 4. It is already engraved in stone. > - "struct msghdr32 *msg" depends on magic to translate first-level target > 32-bit pointers to host N-bit pointers > - uint32_t for `buf' and `from' is for pointers too. Now the magic for > first-level pointers is not depended on > - uint32_t for lengths is for size_t's. This is reasonable but would be > clearer if spelled as size32_t (corresponding to l_size_t). >=20 > >30 AUE_ACCEPT NOPROTO { int accept(int s, caddr_t name, \ > > int *anamelen); } >=20 > As above for "int s". The use of caddr_t is more nonsense than usual. > accept()'s second arg is not a caddr_t, but is "struct sockaddr * > restrict". We depend first on type punning this to caddr_t, then to > caddr_t actually being "char *", then on "char *" being a pointer, > then on the usual magic for first-level pointers. kern/syscalls.master > has the same caddr_t for the MCPT_NOA case of accept(), but not for > the MSTD case. Perhaps userland accept() once actually took a caddr_t > arg, but hopefully Linux is too new to have ever done that, and even > compat cruft in FreeeBSD is too new to need that. >=20 > >31 AUE_GETPEERNAME NOPROTO { int getpeername(int fdes, caddr_t asa, \ >=20 > Similarly. For getpeername(), the compat cruft in kern/syscalls.master > is more clearly typed as MCOMPAT. >=20 > >@@ -152,7 +152,7 @@ > >58 AUE_READLINK NOPROTO { ssize_t readlink(char *path, char *buf, \ > > size_t count); } >=20 > All uses of basic C types and POSIX types are wronger than uses of > fixed-width types. Here the size_t is not translated to uint32_t as > above. This presumably works due to essentially the same magic as for > first-level pointers, up to the copyout step: the 32-bit size_t gets > extended to an N-bit one (where N is 32 or 64 on supported arches). > Zero extension of it works right for size_t, and there is no further > magic corresponding to the copy*() step. >=20 > The magic is very convenient. It should probably be explicitly depended > on for all first-level pointers. For size_t's it should be depended on > in no cases or all cases. >=20 > >59 AUE_EXECVE STD { int freebsd32_execve(char *fname, \ > >- u_int32_t *argv, u_int32_t *envv); } > >+ uint32_t *argv, uint32_t *envv); } >=20 > Usual hack for second-level pointers. >=20 > >60 AUE_UMASK NOPROTO { int umask(int newmask); } umask \ > > umask_args int >=20 > Usual bug for mode_t. >=20 > >61 AUE_CHROOT NOPROTO { int chroot(char *path); } > >@@ -325,10 +325,10 @@ > >172 AUE_NULL UNIMPL nosys > >173 AUE_PREAD COMPAT6 { ssize_t freebsd32_pread(int fd, void *buf,=20 > >\ > > size_t nbyte, int pad, \ > >- u_int32_t offset1, u_int32_t offset2); } > >+ uint32_t offset1, uint32_t offset2); } >=20 > More confusing than usual. The size_t is translated by magic. Then there > is bogus historical padding to be compatible with old mistakes in this > area. Then there are 2 64-bit offsets (off_t's in the API) which are > split because the translation code only understands 32-bit args. >=20 > >[... stuff in which the largest obvious bugs are untranslated size_t's] >=20 > >481 AUE_KILL NOPROTO { int thr_kill2(pid_t pid, long id, int=20 > >sig); } >=20 > Untranslated pid_t depends on pid_t being no larger than int. >=20 > Untranslated long completely breaks this. >=20 > >482 AUE_SHMOPEN NOPROTO { int shm_open(const char *path, int flags, \ > >@@ -892,25 +892,25 @@ > >#ifdef PAD64_REQUIRED > >485 AUE_NULL STD { int freebsd32_cpuset_setid(cpuwhich_t=20 > >which, \ > > int pad, \ > >- u_int32_t id1, u_int32_t id2, \ > >+ uint32_t id1, uint32_t id2, \ > > cpusetid_t setid); } >=20 > Untranslated cpusetid_t. It works since it is int. >=20 > >#else > >485 AUE_NULL STD { int freebsd32_cpuset_setid(cpuwhich_t=20 > >which, \ > >- u_int32_t id1, u_int32_t id2, \ > >+ uint32_t id1, uint32_t id2, \ > > cpusetid_t setid); } > >#endif > >486 AUE_NULL STD { int freebsd32_cpuset_getid(cpulevel_t=20 > >level, \ > > cpuwhich_t which, \ > >- u_int32_t id1, u_int32_t id2, \ > >+ uint32_t id1, uint32_t id2, \ > > cpusetid_t *setid); } >=20 > This and later have several more cpsetid_t's. Also cpuwhich_t's. id_t's > are translated since they are 64 bits. This is painful. All types that > are documented to be represented by id_t are only 32 bits, and id_t is > wrong for representing 64-bit unsigned types since it is signed. The > above has type puns to represent the signed 64-bit int in 2 uint32_t's. > A pid of -1 would become pid_t -1, then id_t -1, then 0xffffffff, > 0xffffffff. Signed off_t also requires type puns to represent in 2 > uint32_t's. >=20 > >... > >@@ -920,7 +920,7 @@ > >491 AUE_FCHOWNAT NOPROTO { int fchownat(int fd, char *path, uid_t=20 > >uid, \ > > gid_t gid, int flag); } >=20 > Untranslated foo_t's. >=20 > >@@ -959,9 +959,9 @@ > >512 AUE_SHMCTL NOSTD { int freebsd32_shmctl(int shmid, int cmd, \ > > struct shmid_ds32 *buf); } > >513 AUE_LPATHCONF NOPROTO { int lpathconf(char *path, int name); } > >-514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, u_int64_t rights); } > >+514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, uint64_t rights); } >=20 > Broken, assuming that all the other spittings into 2 uint32_t's are neede= d. Yes, this is broken. I added Robert and Jonathan to Cc:. >=20 > >515 AUE_CAP_GETRIGHTS NOPROTO { int cap_getrights(int fd, \ > >- u_int64_t *rightsp); } > >+ uint64_t *rightsp); } >=20 > Now the uint64_t is indirect, so it pronbably works. I looked at the sys_cap_getrights(), it seems to do the right thing. >=20 > >Modified: head/sys/kern/syscalls.master > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- head/sys/kern/syscalls.master Fri May 25 21:12:24 2012 (r236025) > >+++ head/sys/kern/syscalls.master Fri May 25 21:50:48 2012 (r236026) >=20 > I didn't think of uint*N_t in this at first either. >=20 > >@@ -916,9 +916,9 @@ > >512 AUE_SHMCTL NOSTD { int shmctl(int shmid, int cmd, \ > > struct shmid_ds *buf); } > >513 AUE_LPATHCONF STD { int lpathconf(char *path, int name); } > >-514 AUE_CAP_NEW STD { int cap_new(int fd, u_int64_t rights); } > >+514 AUE_CAP_NEW STD { int cap_new(int fd, uint64_t rights); } > >515 AUE_CAP_GETRIGHTS STD { int cap_getrights(int fd, \ > >- u_int64_t *rightsp); } > >+ uint64_t *rightsp); } > >516 AUE_CAP_ENTER STD { int cap_enter(void); } > >517 AUE_CAP_GETMODE STD { int cap_getmode(u_int *modep); } > >518 AUE_PDFORK STD { int pdfork(int *fdp, int flags); } >=20 > In fact, this file has only 3 uint*N_t's. This shows that these 3 are > all API design bugs no matter how they are spelled. All the very old > syscalls use basic C types. All the not so old ones use a STDC or > POSIX typedefed type, with the typedef specific to the context. The > 3 exceptions new ones that hard-code a fixed width are the above 2 CAP > ones and sctp_peeloff(), which uses "uint32_t name". >=20 > These bugs are easiest to fix in the Linux syscall.master's since the > bugs are mostly already avoided using l_foo_t. In amd64/linux32/ > syscalls.master, I only noticed the following ones: >=20 > % 1 AUE_EXIT NOPROTO { void sys_exit(int rval); } exit \ > % sys_exit_args void >=20 > "int" for the return and args is not quite right, and it bogotifies the > use of l_int for some args. It works though (assuming 32-bit host ints). > Assumptions that the return type is 32-bit int and that the host int is > 32-bits are implicit in all over, so we should assume them here for > simplicity. (Hmm, td_retval is actually 2 register_t's. 64 bits each > on amd64. amd64/linux32 has remarkably little code to convert these > 2 64-bit ints into 4 32-bit ints.) >=20 > % 2 AUE_FORK STD { int linux_fork(void); } > % 3 AUE_NULL NOPROTO { int read(int fd, char *buf, \ > % u_int nbyte); } >=20 > This u_int should strictly be l_size_t. l_size_t is used a lot elswhere > in this file. In syscalls where the type is actually u_int, l_uint should > be used. l_uint is used a lot elsewhere in this file. But not many > syscsalls use u_int, so many of these l_uints are probably just different > misspellings of l_size_t. So the density of logical type bugs is high > even in this file. >=20 > % 4 AUE_NULL NOPROTO { int write(int fd, char *buf, \ > % u_int nbyte); } >=20 > u_int seems to be more common in older syscalls. >=20 > % 5 AUE_OPEN_RWTC STD { int linux_open(char *path, l_int flags, \ > % l_int mode); } >=20 > Finally, an example of perfectly correct use of l_int. It even correctly > handles the subtlety that l_mode_t promotes to l_int since open() is > variadic. (BTW, I don't like hard-coding this promotion and have > wished for the __promoteof() operator for giving it for more than 20 > years. The promotion of a typedefed type even harder to determine than > the correct PRI* mistake to use for printing a typedefed type.) >=20 > This declaration is still far from correct altogether, since it depends > on the usual hacks: > - int return type is actual l_int > - char *path is actually "const char *path" at the target level > - magic to convert target "char *" to and from host "char *" >=20 > % 11 AUE_EXECVE STD { int linux_execve(char *path, uint32_t=20 > *argp, \ > % uint32_t *envp); } >=20 > See above. >=20 > % 41 AUE_DUP NOPROTO { int dup(u_int fd); } >=20 > Another untranslated type. dup() doesn't even take a u_int to begin with > (it takes a normal int descriptor). Untranslated int args aren't actually > very common. >=20 > % 54 AUE_IOCTL STD { int linux_ioctl(l_uint fd, l_uint cmd, \ > % uintptr_t arg); } >=20 > Now l_foo is used for the descriptor, but u_int is wrong -- Linux uses > a normal int for the descriptor for ioctl() too. >=20 > l_uint for cmd is wrong too. The type starts as u_long (same as in > FreeBSD), at least in the 1997 Linux userland that I used to check > this. This type mismatch is harmless because ints and longs are both > 32 bits on Linux-i386. >=20 > uintptr_t for arg is wronger. For ioctl(), this arg is the first variadic > one and might not be present. I think declaring it in the above gives (v= ia > the Linux ABI) the garbage contents of a register for it when it isn't > present. Native FreeBSD ioctl() has evem more magic. It misdeclares the > arg as caddr_t instead, and gives stack garbage for it when it isn't > present, and depends on the stack being large enough to avoid a memory > fault when copying the stack garbage (the FreeBSD ABO gives at least a > return address there). >=20 > The type of the arg, when it is present, is specified to be caddr_t (:-() > in FreeBSD. Linux (1997 userland) is better and says it is "char *". It > should have been "void *". syscall.master's should probably declare it > as "void *". Here it starts as a 32-bit pointer and the usual magic will > convert it to a 64-bit non-pointer represented as a host uintptr_t by the > above or by a host "void *" with "void *" in the above. copy*() will > eventually turn it into "void *uaddr" either way. Then it will still > not really be a kernel pointer, but is used as one in the implementation > of copy*() on amd64 (this depends on a flat address space). >=20 >=20 > % 55 AUE_FCNTL STD { int linux_fcntl(l_uint fd, l_uint cmd, \ > % uintptr_t arg); } >=20 > Same errors for the types of fd and arg. Different error for the type of > cmd. Unlike for ioctl(), it starts as neither long or unsigned, but just > int (POSIX spec). >=20 > % 56 AUE_NULL UNIMPL mpx > % 57 AUE_SETPGRP NOPROTO { int setpgid(int pid, int pgid); } >=20 > l_pid_t exists and should be used. >=20 > % 60 AUE_UMASK NOPROTO { int umask(int newmask); } >=20 > l_mode_t exists and should be used. >=20 > % 63 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); } >=20 > Bogus fd types, as usual. >=20 > % 65 AUE_GETPGRP NOPROTO { int getpgrp(void); } >=20 > Should really be more careful with return types that are typedefed in the > API (and are not just int statuses or fds). kern/syscalls.master is > sloppy with this too. >=20 > % 74 AUE_SYSCTL STD { int linux_sethostname(char *hostname, \ > % u_int len); } >=20 > get/sethostname() is horribly inconsistent. In FreeBSD, gethostname() is > documented as taking a size_t and sethostname() is documented as taking > an int. kern/syscalls.master uses u_int for both. Apparently there is > enough magic with arg packing for this to work even on supported > 64-bit big-endian systems. Linux userland was better even in 1997 -- > it uses size_t for both. POSIX has specified gethostname() since at > least 2001. It uses size_t of course. It says that these are 4.3BSD > functions but it only specifies gethostname(), and it applies an > OpenGroup resolution to change the type from socklen_t to size_t for > gethostname(). This made it incompatible with BSD. Old BSD uses int > for both, and FreeBSD apparently changed the documentation but not the > code for gethostname() only, to be bug for compatible with POSIX. >=20 > So the above should use l_size_t, and strictly, the code probably needs > to be more careful than it is with unrepresentable sizes (native > sethostname() wants a signed int and might not have the right checking > for a 32-bit unsigned size_t). >=20 > % 75 AUE_SETRLIMIT STD { int linux_setrlimit(l_uint resource, \ > % struct l_rlimit *rlim); } > % 76 AUE_GETRLIMIT STD { int linux_old_getrlimit(l_uint resource, \ > % struct l_rlimit *rlim); } >=20 > Resource numbers should be plain ints too. They are documented to be > as such in old Linux userland man pages. But in old Linux (glibc) > headers, they are obfuscated as __rlimit_resource_t, which an enum > with gnu extensions, else plain int. >=20 > % 78 AUE_NULL STD { int linux_gettimeofday( \ > % struct l_timeval *tp, \ > % struct timezone *tzp); } > % 79 AUE_SETTIMEOFDAY STD { int linux_settimeofday( \ > % struct l_timeval *tp, \ > % struct timezone *tzp); } >=20 > The timezone struct only has a couple of ints in it, so this abuse of > the native timezone works, but is fragile. I forget if the timezone > arg is deprecated to the point of ignoring it for native > get/settimeofday(). If so, then this won't work for emulated > get/settimeofday() >=20 > % 85 AUE_READLINK STD { int linux_readlink(char *name, char *buf, \ > % l_int count); } >=20 > Native readlink was churned by POSIX from an int count to a size_t count. > Linux readlink has takes a size_t count even in 1997 and probably still > does. >=20 > % 88 AUE_REBOOT STD { int linux_reboot(l_int magic1, \ > % l_int magic2, l_uint cmd, void *arg); } >=20 > In old Linux userland it is documented to take only 3 int args, with the > 3rd one named `flag'. >=20 > % ; 89: old_readdir > % 89 AUE_GETDIRENTRIES STD { int linux_readdir(l_uint fd, \ > % struct l_dirent *dent, l_uint count); } >=20 > Matches old Linux userland man page right down to the u_int for fd. >=20 >=20 > % 91 AUE_MUNMAP NOPROTO { int munmap(caddr_t addr, int len); } >=20 > Takes a void * and a size_t in modern munmap() and Linux had that in 1997. > FreeBSD-3 had this too. The above matches FreeBSD-1. >=20 > % 92 AUE_TRUNCATE STD { int linux_truncate(char *path, \ > % l_ulong length); } >=20 > Should use l_off_t, not l_ulong (except possibly if their is an unsigned > hack to support file sizes of 2G-4G). >=20 > % 93 AUE_FTRUNCATE STD { int linux_ftruncate(int fd, long length); } >=20 > Using long is very broken. l_off_t is correct here too. >=20 > % 94 AUE_FCHMOD NOPROTO { int fchmod(int fd, int mode); } >=20 > mode_t is used for all other *chmod*()'s in this file >=20 > % 95 AUE_FCHOWN NOPROTO { int fchown(int fd, int uid, int gid); } >=20 > l_uid16_t and l_gid16_t are used for all other old *chown*() in this file. > (Newer ones are spelled *lchown*() and take l_uid_t and l_gid_t's.) >=20 > % 96 AUE_GETPRIORITY STD { int linux_getpriority(int which, int who);=20 > } > % 97 AUE_SETPRIORITY NOPROTO { int setpriority(int which, int who, \ > % int prio); } >=20 > `who' should have type pid_t, but is still int in FreeBSD native. In > old Linux, it is int in the man page but is obfuscated as id_t in the > glibc header. Even `which' is obfuscated as __priority_which_t in the > glibc header. (I consider even using size_t for read() to be a > regression. Typedefed types are hard to use correctly, as shown by > this mail which points out that hundreds of incorrect uses, where the > bugs are only harmless because the use of typedefed types makes no > significant difference.) >=20 > Got bored here, and looked at the rest less carefully. The newer > syscalls seem to be handled more carefully, probably because plenty > of Linux types existed when they were written. There just seemed to > be too many l_[u]longs in them. >=20 > % 168 AUE_POLL NOPROTO { int poll(struct pollfd *fds, \ > % unsigned int nfds, int timeout); } >=20 > Hrmph, this is the only one that misspells "unsigned" more verbosely as > "unsigned int" instead of as the usual KNF abbreviation "u_int". >=20 > Of course, poll() doesn't even take a u_int type. Modern poll takes > an nfds_t type. Linux had that in 1997, and it was u_long, not u_int. >=20 > Use of the native struct pollfd is dangerous. It works because it > consists of an int followed by 2 shorts, and this matches the Linux > type and neither has neither unnamed padding on at least amd64 and i386. >=20 > % 180 AUE_PREAD STD { int linux_pread(l_uint fd, char *buf, \ > % l_size_t nbyte, l_loff_t offset); } > % [... several more bogus l_uints for fds] >=20 > % 183 AUE_GETCWD STD { int linux_getcwd(char *buf, \ > % l_ulong bufsize); } >=20 > A different misspelling of l_size_t. >=20 > % 191 AUE_GETRLIMIT STD { int linux_getrlimit(l_uint resource, \ > % struct l_rlimit *rlim); } >=20 > Bogus resource number times for new rlimit syscalls too. >=20 > % 193 AUE_TRUNCATE STD { int linux_truncate64(char *path, \ > % l_loff_t length); } > % 194 AUE_FTRUNCATE STD { int linux_ftruncate64(l_uint fd, \ > % l_loff_t length); } >=20 > How can this work? I was going to say that the splitting up of the 64-bit > args in compat/freebsd32/syscalls.master was unnecessary because it is > apparently not needed here. Then I misread this as doing the splitting. > But it doesn't. Similarly later in this file. >=20 > % 218 AUE_MINCORE STD { int linux_mincore(l_ulong start, \ > % l_size_t len, u_char *vec); } > % 219 AUE_MADVISE NOPROTO { int madvise(void *addr, size_t len, \ > % int behav); } >=20 > SIlly to have l_size_t in one and raw size_t in the next. >=20 > I just noticed that NOPROTO calls never use l_foo. They go direct to > the native calls, and spelling things without an l_ may be necessary > for hiding the type mismatches from this. But this is especially > fragile, and maybe the l_'s here would be harmless since they have no > effect, since type checking for the direct calls is destroyed better > using (sy_call_t *) casts. >=20 > % 220 AUE_GETDIRENTRIES STD { int linux_getdents64(l_uint fd, \ > % void *dirent, l_uint count); } > % 221 AUE_FCNTL STD { int linux_fcntl64(l_uint fd, l_uint cmd, \ > % uintptr_t arg); } >=20 > Type errors for 32-bit syscalls are often duplicated for the corresponding > 64-bit ones. My old userland doesn't have these new syscalls to check, > but I doubt that Linux changed the API for the non-64 bit parts, and > u_int fds are bogus as usual. >=20 > % 240 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op,=20 > uint32_t val, \ > % struct l_timespec *timeout, uint32_t=20 > *uaddr2, uint32_t val3); } > % 241 AUE_NULL STD { int linux_sched_setaffinity(l_pid_t pid,=20 > l_uint len, \ > % l_ulong *user_mask_ptr); } > % 242 AUE_NULL STD { int linux_sched_getaffinity(l_pid_t pid,=20 > l_uint len, \ > % l_ulong *user_mask_ptr); } > % 243 AUE_NULL STD { int linux_set_thread_area(struct=20 > l_user_desc *desc); } >=20 > Lots of style bugs which are not present in old code: > - lines are not wrapped at 80 columns > - wrapped lines are misindented. >=20 >=20 > % 250 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t=20 > offset, \ > % l_size_t len, int advice); } >=20 > More style bugs. >=20 > % 264 AUE_CLOCK_SETTIME STD { int linux_clock_settime(clockid_t=20 > which, struct l_timespec *tp); } > % 265 AUE_NULL STD { int linux_clock_gettime(clockid_t which,=20 > struct l_timespec *tp); } > % 266 AUE_NULL STD { int linux_clock_getres(clockid_t which,=20 > struct l_timespec *tp); } > % 267 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which,=20 > int flags, \ > % struct l_timespec *rqtp, struct=20 > l_timespec *rmtp); } > % 268 AUE_STATFS STD { int linux_statfs64(char *path, size_t=20 > bufsize, struct l_statfs64_buf *buf); } >=20 > Another raw size_t. >=20 > Another long line. >=20 > % 269 AUE_FSTATFS STD { int linux_fstatfs64(void); } > % 270 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int=20 > sig); } >=20 > Raw ints for pids. >=20 > % 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ > % struct l_timeval *tptr); } > % 272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ > % l_loff_t offset, l_loff_t len, \ > % int advice); } >=20 > Just about all syscalls added since #239 are misformatted :-(. >=20 > % 295 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, const char=20 > *filename, \ > % l_int flags, l_int mode); } > % 296 AUE_MKDIRAT STD { int linux_mkdirat(l_int dfd, const char=20 > *pathname, \ > % l_int mode); } > % 297 AUE_MKNODAT STD { int linux_mknodat(l_int dfd, const char=20 > *filename, \ > % l_int mode, l_uint dev); } > % 298 AUE_FCHOWNAT STD { int linux_fchownat(l_int dfd, const char=20 > *filename, \ > % l_uid16_t uid, l_gid16_t gid, l_int=20 > flag); } > % 299 AUE_FUTIMESAT STD { int linux_futimesat(l_int dfd, char=20 > *filename, \ > % struct l_timeval *utimes); } > % 300 AUE_FSTATAT STD { int linux_fstatat64(l_int dfd, char=20 > *pathname, \ > % struct l_stat64 *statbuf, l_int=20 > flag); } > % 301 AUE_UNLINKAT STD { int linux_unlinkat(l_int dfd, const char=20 > *pathname, \ > % l_int flag); } > % 302 AUE_RENAMEAT STD { int linux_renameat(l_int olddfd, const=20 > char *oldname, \ > % l_int newdfd, const char *newname); } > % 303 AUE_LINKAT STD { int linux_linkat(l_int olddfd, const char=20 > *oldname, \ > % l_int newdfd, const char *newname,=20 > l_int flag); } > % 304 AUE_SYMLINKAT STD { int linux_symlinkat(const char *oldname,=20 > l_int newdfd, \ > % const char *newname); } > % 305 AUE_READLINKAT STD { int linux_readlinkat(l_int dfd, const char=20 > *path, \ > % char *buf, l_int bufsiz); } > % 306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char=20 > *filename, \ > % l_mode_t mode); } > % 307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char=20 > *filename, l_int amode, int flag); } >=20 > Mounds more misformatting. >=20 > [... A small pile of misformatting] >=20 > Bruce --Yp4ECpV6dHcLchHG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/BCZcACgkQC3+MBN1Mb4ht6wCgkQF5Tjavfop7pSe84lruIo96 /tsAoLiE4owTVEC0kJZZS1hVW+3X/EiJ =c2ZS -----END PGP SIGNATURE----- --Yp4ECpV6dHcLchHG-- From owner-svn-src-head@FreeBSD.ORG Sat May 26 17:19:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E7B31065670; Sat, 26 May 2012 17:19:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69FD88FC12; Sat, 26 May 2012 17:19:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QHJgrb096474; Sat, 26 May 2012 17:19:42 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QHJgWQ096472; Sat, 26 May 2012 17:19:42 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205261719.q4QHJgWQ096472@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 17:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236110 - head/usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 17:19:42 -0000 Author: des Date: Sat May 26 17:19:41 2012 New Revision: 236110 URL: http://svn.freebsd.org/changeset/base/236110 Log: Revert r232274 - unauthorized, unnecessary and incorrect. Modified: head/usr.bin/fetch/fetch.1 Modified: head/usr.bin/fetch/fetch.1 ============================================================================== --- head/usr.bin/fetch/fetch.1 Sat May 26 17:10:16 2012 (r236109) +++ head/usr.bin/fetch/fetch.1 Sat May 26 17:19:41 2012 (r236110) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000-2012 Dag-Erling Smørgrav +.\" Copyright (c) 2000-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 28, 2012 +.Dd September 27, 2011 .Dt FETCH 1 .Os .Sh NAME @@ -214,11 +214,6 @@ When the flag is specified, wait this many seconds between successive retries. .El .Pp -.Ar URL -.Bd -literal - :(//((:)?@)?(:)?)?/()? -.Ed -.Pp If .Nm receives a From owner-svn-src-head@FreeBSD.ORG Sat May 26 20:03:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0B7A1065687; Sat, 26 May 2012 20:03:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBEF38FC12; Sat, 26 May 2012 20:03:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QK3mNK003655; Sat, 26 May 2012 20:03:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QK3mQj003650; Sat, 26 May 2012 20:03:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205262003.q4QK3mQj003650@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 26 May 2012 20:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236117 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 20:03:49 -0000 Author: kib Date: Sat May 26 20:03:47 2012 New Revision: 236117 URL: http://svn.freebsd.org/changeset/base/236117 Log: Stop treating td_sigmask specially for the purposes of new thread creation. Move it into the copied region of the struct thread. Update some comments. Requested by: bde X-MFC after: never Modified: head/sys/kern/kern_fork.c head/sys/kern/kern_kthread.c head/sys/kern/kern_thr.c head/sys/sys/proc.h Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sat May 26 18:20:30 2012 (r236116) +++ head/sys/kern/kern_fork.c Sat May 26 20:03:47 2012 (r236117) @@ -475,7 +475,6 @@ do_fork(struct thread *td, int flags, st bcopy(&p2->p_comm, &td2->td_name, sizeof(td2->td_name)); td2->td_sigstk = td->td_sigstk; - td2->td_sigmask = td->td_sigmask; td2->td_flags = TDF_INMEM; td2->td_lend_user_pri = PRI_MAX; Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Sat May 26 18:20:30 2012 (r236116) +++ head/sys/kern/kern_kthread.c Sat May 26 20:03:47 2012 (r236117) @@ -271,7 +271,6 @@ kthread_add(void (*func)(void *), void * bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); -/* XXX check if we should zero. */ bcopy(&oldtd->td_startcopy, &newtd->td_startcopy, __rangeof(struct thread, td_startcopy, td_endcopy)); @@ -295,7 +294,6 @@ kthread_add(void (*func)(void *), void * /* this code almost the same as create_thread() in kern_thr.c */ PROC_LOCK(p); p->p_flag |= P_HADTHREADS; - newtd->td_sigmask = oldtd->td_sigmask; /* XXX dubious */ thread_link(newtd, p); thread_lock(oldtd); /* let the scheduler know about these things. */ Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Sat May 26 18:20:30 2012 (r236116) +++ head/sys/kern/kern_thr.c Sat May 26 20:03:47 2012 (r236117) @@ -252,7 +252,6 @@ create_thread(struct thread *td, mcontex PROC_LOCK(td->td_proc); td->td_proc->p_flag |= P_HADTHREADS; - newtd->td_sigmask = td->td_sigmask; thread_link(newtd, p); bcopy(p->p_comm, newtd->td_name, sizeof(newtd->td_name)); thread_lock(td); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat May 26 18:20:30 2012 (r236116) +++ head/sys/sys/proc.h Sat May 26 20:03:47 2012 (r236117) @@ -258,7 +258,6 @@ struct thread { u_int td_uticks; /* (t) Statclock hits in user mode. */ int td_intrval; /* (t) Return value for sleepq. */ sigset_t td_oldsigmask; /* (k) Saved mask from pre sigpause. */ - sigset_t td_sigmask; /* (c) Current signal mask. */ volatile u_int td_generation; /* (k) For detection of preemption */ stack_t td_sigstk; /* (k) Stack ptr and on-stack flag. */ int td_xsig; /* (c) Signal for ptrace */ @@ -272,10 +271,11 @@ struct thread { struct osd td_osd; /* (k) Object specific data. */ struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. */ pid_t td_dbg_forked; /* (c) Child pid for debugger. */ -#define td_endzero td_rqindex +#define td_endzero td_sigmask -/* Copied during fork1() or thread_sched_upcall(). */ +/* Copied during fork1() or create_thread(). */ #define td_startcopy td_endzero + sigset_t td_sigmask; /* (c) Current signal mask. */ u_char td_rqindex; /* (t) Run queue index. */ u_char td_base_pri; /* (t) Thread base kernel priority. */ u_char td_priority; /* (t) Thread active priority. */ @@ -285,7 +285,7 @@ struct thread { #define td_endcopy td_pcb /* - * Fields that must be manually set in fork1() or thread_sched_upcall() + * Fields that must be manually set in fork1() or create_thread() * or already have been set in the allocator, constructor, etc. */ struct pcb *td_pcb; /* (k) Kernel VA of pcb and kstack. */ From owner-svn-src-head@FreeBSD.ORG Sat May 26 21:02:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F36221065670; Sat, 26 May 2012 21:02:49 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D50F58FC15; Sat, 26 May 2012 21:02:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QL2nZL006114; Sat, 26 May 2012 21:02:49 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QL2nhE006111; Sat, 26 May 2012 21:02:49 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205262102.q4QL2nhE006111@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 21:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236119 - in head/sys: conf powerpc/mpc85xx powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 21:02:50 -0000 Author: raj Date: Sat May 26 21:02:49 2012 New Revision: 236119 URL: http://svn.freebsd.org/changeset/base/236119 Log: Move OpenPIC FDT bus glue to a shared location, so that other PowerPC platforms can use it, not only MPC85XX. This is just reorg, no functional changes. Added: head/sys/powerpc/powerpc/openpic_fdt.c - copied unchanged from r236094, head/sys/powerpc/mpc85xx/openpic_fdt.c Deleted: head/sys/powerpc/mpc85xx/openpic_fdt.c Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat May 26 20:13:24 2012 (r236118) +++ head/sys/conf/files.powerpc Sat May 26 21:02:49 2012 (r236119) @@ -132,7 +132,6 @@ powerpc/mpc85xx/isa.c optional mpc85xx powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx powerpc/mpc85xx/nexus.c optional mpc85xx -powerpc/mpc85xx/openpic_fdt.c optional fdt powerpc/mpc85xx/pci_fdt.c optional pci mpc85xx powerpc/ofw/ofw_cpu.c optional aim powerpc/ofw/ofw_machdep.c optional aim @@ -194,6 +193,7 @@ powerpc/powerpc/mem.c optional mem powerpc/powerpc/mmu_if.m standard powerpc/powerpc/mp_machdep.c optional smp powerpc/powerpc/openpic.c standard +powerpc/powerpc/openpic_fdt.c optional fdt powerpc/powerpc/pic_if.m standard powerpc/powerpc/pmap_dispatch.c standard powerpc/powerpc/platform.c standard Copied: head/sys/powerpc/powerpc/openpic_fdt.c (from r236094, head/sys/powerpc/mpc85xx/openpic_fdt.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powerpc/openpic_fdt.c Sat May 26 21:02:49 2012 (r236119, copy of r236094, head/sys/powerpc/mpc85xx/openpic_fdt.c) @@ -0,0 +1,93 @@ +/*- + * Copyright (c) 2009-2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include "pic_if.h" + +static int openpic_fdt_probe(device_t); +static int openpic_fdt_attach(device_t); + +static device_method_t openpic_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, openpic_fdt_probe), + DEVMETHOD(device_attach, openpic_fdt_attach), + + /* PIC interface */ + DEVMETHOD(pic_bind, openpic_bind), + DEVMETHOD(pic_config, openpic_config), + DEVMETHOD(pic_dispatch, openpic_dispatch), + DEVMETHOD(pic_enable, openpic_enable), + DEVMETHOD(pic_eoi, openpic_eoi), + DEVMETHOD(pic_ipi, openpic_ipi), + DEVMETHOD(pic_mask, openpic_mask), + DEVMETHOD(pic_unmask, openpic_unmask), + + { 0, 0 }, +}; + +static driver_t openpic_fdt_driver = { + "openpic", + openpic_fdt_methods, + sizeof(struct openpic_softc) +}; + +DRIVER_MODULE(openpic, simplebus, openpic_fdt_driver, openpic_devclass, 0, 0); + +static int +openpic_fdt_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "chrp,open-pic")) + return (ENXIO); + + device_set_desc(dev, OPENPIC_DEVSTR); + return (BUS_PROBE_DEFAULT); +} + +static int +openpic_fdt_attach(device_t dev) +{ + + return (openpic_common_attach(dev, ofw_bus_get_node(dev))); +} From owner-svn-src-head@FreeBSD.ORG Sat May 26 21:05:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6AB0106566C; Sat, 26 May 2012 21:05:11 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C09038FC0A; Sat, 26 May 2012 21:05:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QL5BS4006246; Sat, 26 May 2012 21:05:11 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QL5BU5006245; Sat, 26 May 2012 21:05:11 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205262105.q4QL5BU5006245@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 21:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236120 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 21:05:11 -0000 Author: raj Date: Sat May 26 21:05:11 2012 New Revision: 236120 URL: http://svn.freebsd.org/changeset/base/236120 Log: Import EHCI attachment driver for Freescale integrated controller. Obtained from: Freescale, Semihalf. Written by: Michal Dubiel Added: head/sys/dev/usb/controller/ehci_fsl.c (contents, props changed) Added: head/sys/dev/usb/controller/ehci_fsl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/ehci_fsl.c Sat May 26 21:05:11 2012 (r236120) @@ -0,0 +1,423 @@ +/*- + * Copyright (c) 2010-2012 Semihalf + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "opt_platform.h" + +/* + * Register the driver + */ +/* Forward declarations */ +static int fsl_ehci_attach(device_t self); +static int fsl_ehci_detach(device_t self); +static int fsl_ehci_probe(device_t self); + +static device_method_t ehci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, fsl_ehci_probe), + DEVMETHOD(device_attach, fsl_ehci_attach), + DEVMETHOD(device_detach, fsl_ehci_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + + { 0, 0 } +}; + +/* kobj_class definition */ +static driver_t ehci_driver = { + "ehci", + ehci_methods, + sizeof(struct ehci_softc) +}; + +static devclass_t ehci_devclass; + +DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ehci, usb, 1, 1, 1); + +/* + * Private defines + */ +#define FSL_EHCI_REG_OFF 0x100 +#define FSL_EHCI_REG_SIZE 0x300 + +/* + * Internal interface registers' offsets. + * Offsets from 0x000 ehci dev space, big-endian access. + */ +enum internal_reg { + SNOOP1 = 0x400, + SNOOP2 = 0x404, + AGE_CNT_THRESH = 0x408, + SI_CTRL = 0x410, + CONTROL = 0x500 +}; + +/* CONTROL register bit flags */ +enum control_flags { + USB_EN = 0x00000004, + UTMI_PHY_EN = 0x00000200, + ULPI_INT_EN = 0x00000001 +}; + +/* SI_CTRL register bit flags */ +enum si_ctrl_flags { + FETCH_32 = 1, + FETCH_64 = 0 +}; + +#define SNOOP_RANGE_2GB 0x1E + +/* + * Operational registers' offsets. + * Offsets from USBCMD register, little-endian access. + */ +enum special_op_reg { + USBMODE = 0x0A8, + PORTSC = 0x084, + ULPI_VIEWPORT = 0x70 +}; + +/* USBMODE register bit flags */ +enum usbmode_flags { + HOST_MODE = 0x3, + DEVICE_MODE = 0x2 +}; + +#define PORT_POWER_MASK 0x00001000 + +/* + * Private methods + */ + +static void +set_to_host_mode(ehci_softc_t *sc) +{ + int tmp; + + tmp = bus_space_read_4(sc->sc_io_tag, sc->sc_io_hdl, USBMODE); + bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl, USBMODE, tmp | HOST_MODE); +} + +static void +enable_usb(device_t dev, bus_space_tag_t iot, bus_space_handle_t ioh) +{ + int tmp; + phandle_t node; + char *phy_type; + + phy_type = NULL; + tmp = bus_space_read_4(iot, ioh, CONTROL) | USB_EN; + + node = ofw_bus_get_node(dev); + if ((node != 0) && + (OF_getprop_alloc(node, "phy_type", 1, (void **)&phy_type) > 0)) { + if (strncasecmp(phy_type, "utmi", strlen("utmi")) == 0) + tmp |= UTMI_PHY_EN; + free(phy_type, M_OFWPROP); + } + bus_space_write_4(iot, ioh, CONTROL, tmp); +} + +static void +set_32b_prefetch(bus_space_tag_t iot, bus_space_handle_t ioh) +{ + + bus_space_write_4(iot, ioh, SI_CTRL, FETCH_32); +} + +static void +set_snooping(bus_space_tag_t iot, bus_space_handle_t ioh) +{ + + bus_space_write_4(iot, ioh, SNOOP1, SNOOP_RANGE_2GB); + bus_space_write_4(iot, ioh, SNOOP2, 0x80000000 | SNOOP_RANGE_2GB); +} + +static void +clear_port_power(ehci_softc_t *sc) +{ + int tmp; + + tmp = bus_space_read_4(sc->sc_io_tag, sc->sc_io_hdl, PORTSC); + bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl, PORTSC, tmp & ~PORT_POWER_MASK); +} + +/* + * Public methods + */ +static int +fsl_ehci_probe(device_t dev) +{ + + if (((ofw_bus_is_compatible(dev, "fsl-usb2-dr")) == 0) && + ((ofw_bus_is_compatible(dev, "fsl-usb2-mph")) == 0)) + return (ENXIO); + + device_set_desc(dev, "Freescale integrated EHCI controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +fsl_ehci_attach(device_t self) +{ + ehci_softc_t *sc; + int rid; + int err; + bus_space_handle_t ioh; + bus_space_tag_t iot; + + sc = device_get_softc(self); + rid = 0; + + sc->sc_bus.parent = self; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = EHCI_MAX_DEVICES; + + if (usb_bus_mem_alloc_all(&sc->sc_bus, + USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) + return (ENOMEM); + + /* Allocate io resource for EHCI */ + sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->sc_io_res == NULL) { + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (ENXIO); + } + iot = rman_get_bustag(sc->sc_io_res); + + /* + * Set handle to USB related registers subregion used by generic + * EHCI driver + */ + ioh = rman_get_bushandle(sc->sc_io_res); + + err = bus_space_subregion(iot, ioh, FSL_EHCI_REG_OFF, FSL_EHCI_REG_SIZE, + &sc->sc_io_hdl); + if (err != 0) { + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (ENXIO); + } + + /* Set little-endian tag for use by the generic EHCI driver */ + sc->sc_io_tag = &bs_le_tag; + + /* Allocate irq */ + sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (ENXIO); + } + + /* Setup interrupt handler */ + err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO, + NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); + if (err) { + device_printf(self, "Could not setup irq, %d\n", err); + sc->sc_intr_hdl = NULL; + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (ENXIO); + } + + /* Add USB device */ + sc->sc_bus.bdev = device_add_child(self, "usbus", -1); + if (!sc->sc_bus.bdev) { + device_printf(self, "Could not add USB device\n"); + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (ENOMEM); + } + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + + sc->sc_id_vendor = 0x1234; + strlcpy(sc->sc_vendor, "Freescale", sizeof(sc->sc_vendor)); + + /* Enable USB */ + err = ehci_reset(sc); + if (err) { + device_printf(self, "Could not reset the controller\n"); + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (ENXIO); + } + + enable_usb(self, iot, ioh); + set_snooping(iot, ioh); + set_to_host_mode(sc); + set_32b_prefetch(iot, ioh); + + /* + * If usb subsystem is enabled in U-Boot, port power has to be turned + * off to allow proper discovery of devices during boot up. + */ + clear_port_power(sc); + + /* Set flags */ + sc->sc_flags |= EHCI_SCFLG_DONTRESET | EHCI_SCFLG_NORESTERM; + + err = ehci_init(sc); + if (!err) { + sc->sc_flags |= EHCI_SCFLG_DONEINIT; + err = device_probe_and_attach(sc->sc_bus.bdev); + } + + if (err) { + device_printf(self, "USB init failed err=%d\n", err); + err = fsl_ehci_detach(self); + if (err) { + device_printf(self, + "Detach of the driver failed with error %d\n", + err); + } + return (EIO); + } + + return (0); +} + +static int +fsl_ehci_detach(device_t self) +{ + + int err; + ehci_softc_t *sc; + + sc = device_get_softc(self); + /* + * only call ehci_detach() after ehci_init() + */ + if (sc->sc_flags & EHCI_SCFLG_DONEINIT) { + ehci_detach(sc); + sc->sc_flags &= ~EHCI_SCFLG_DONEINIT; + } + + /* Disable interrupts that might have been switched on in ehci_init */ + if (sc->sc_io_tag && sc->sc_io_hdl) + bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl, EHCI_USBINTR, 0); + + if (sc->sc_irq_res && sc->sc_intr_hdl) { + err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); + if (err) { + device_printf(self, "Could not tear down irq, %d\n", + err); + return (err); + } + sc->sc_intr_hdl = NULL; + } + + if (sc->sc_bus.bdev) { + device_delete_child(self, sc->sc_bus.bdev); + sc->sc_bus.bdev = NULL; + } + + /* During module unload there are lots of children leftover */ + device_delete_children(self); + + if (sc->sc_irq_res) { + bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res); + sc->sc_irq_res = NULL; + } + + if (sc->sc_io_res) { + bus_release_resource(self, SYS_RES_MEMORY, 0, sc->sc_io_res); + sc->sc_io_res = NULL; + sc->sc_io_tag = 0; + sc->sc_io_hdl = 0; + } + + return (0); +} + From owner-svn-src-head@FreeBSD.ORG Sat May 26 21:07:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 704AE106566B; Sat, 26 May 2012 21:07:16 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A86E8FC12; Sat, 26 May 2012 21:07:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QL7GeU006361; Sat, 26 May 2012 21:07:16 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QL7Gt0006359; Sat, 26 May 2012 21:07:16 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201205262107.q4QL7Gt0006359@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 26 May 2012 21:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236121 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 21:07:16 -0000 Author: raj Date: Sat May 26 21:07:15 2012 New Revision: 236121 URL: http://svn.freebsd.org/changeset/base/236121 Log: Import eSDHC driver for Freescale integrated controller. Obtained from: Freescale, Semihalf Written by: Michal Dubiel Added: head/sys/powerpc/mpc85xx/fsl_sdhc.c (contents, props changed) head/sys/powerpc/mpc85xx/fsl_sdhc.h (contents, props changed) Added: head/sys/powerpc/mpc85xx/fsl_sdhc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/mpc85xx/fsl_sdhc.c Sat May 26 21:07:15 2012 (r236121) @@ -0,0 +1,1306 @@ +/*- + * Copyright (c) 2011-2012 Semihalf + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Driver for Freescale integrated eSDHC controller. + * Limitations: + * - No support for multi-block transfers. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "opt_platform.h" + +#include "mmcbr_if.h" + +#include "fsl_sdhc.h" + +#define DEBUG +#undef DEBUG +#ifdef DEBUG +#define DPRINTF(fmt, arg...) printf("DEBUG %s(): " fmt, __FUNCTION__, ##arg) +#else +#define DPRINTF(fmt, arg...) +#endif + + +/***************************************************************************** + * Register the driver + *****************************************************************************/ +/* Forward declarations */ +static int fsl_sdhc_probe(device_t); +static int fsl_sdhc_attach(device_t); +static int fsl_sdhc_detach(device_t); + +static int fsl_sdhc_read_ivar(device_t, device_t, int, uintptr_t *); +static int fsl_sdhc_write_ivar(device_t, device_t, int, uintptr_t); + +static int fsl_sdhc_update_ios(device_t, device_t); +static int fsl_sdhc_request(device_t, device_t, struct mmc_request *); +static int fsl_sdhc_get_ro(device_t, device_t); +static int fsl_sdhc_acquire_host(device_t, device_t); +static int fsl_sdhc_release_host(device_t, device_t); + +static device_method_t fsl_sdhc_methods[] = { + /* device_if */ + DEVMETHOD(device_probe, fsl_sdhc_probe), + DEVMETHOD(device_attach, fsl_sdhc_attach), + DEVMETHOD(device_detach, fsl_sdhc_detach), + + /* Bus interface */ + DEVMETHOD(bus_read_ivar, fsl_sdhc_read_ivar), + DEVMETHOD(bus_write_ivar, fsl_sdhc_write_ivar), + + /* OFW bus interface */ + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + /* mmcbr_if */ + DEVMETHOD(mmcbr_update_ios, fsl_sdhc_update_ios), + DEVMETHOD(mmcbr_request, fsl_sdhc_request), + DEVMETHOD(mmcbr_get_ro, fsl_sdhc_get_ro), + DEVMETHOD(mmcbr_acquire_host, fsl_sdhc_acquire_host), + DEVMETHOD(mmcbr_release_host, fsl_sdhc_release_host), + + {0, 0}, +}; + +/* kobj_class definition */ +static driver_t fsl_sdhc_driver = { + "sdhci", + fsl_sdhc_methods, + sizeof(struct fsl_sdhc_softc) +}; + +static devclass_t fsl_sdhc_devclass; + +DRIVER_MODULE(sdhci, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, 0, 0); + + +/***************************************************************************** + * Private methods + *****************************************************************************/ +static inline int +read4(struct fsl_sdhc_softc *sc, unsigned int offset) +{ + + return bus_space_read_4(sc->bst, sc->bsh, offset); +} + +static inline void +write4(struct fsl_sdhc_softc *sc, unsigned int offset, int value) +{ + + bus_space_write_4(sc->bst, sc->bsh, offset, value); +} + +static inline void +set_bit(struct fsl_sdhc_softc *sc, uint32_t offset, uint32_t mask) +{ + uint32_t x = read4(sc, offset); + + write4(sc, offset, x | mask); +} + +static inline void +clear_bit(struct fsl_sdhc_softc *sc, uint32_t offset, uint32_t mask) +{ + uint32_t x = read4(sc, offset); + + write4(sc, offset, x & ~mask); +} + +static int +wait_for_bit_clear(struct fsl_sdhc_softc *sc, enum sdhc_reg_off reg, + uint32_t bit) +{ + uint32_t timeout = 10; + uint32_t stat; + + stat = read4(sc, reg); + while (stat & bit) { + if (timeout == 0) { + return (-1); + } + --timeout; + DELAY(1000); + stat = read4(sc, reg); + } + + return (0); +} + +static int +wait_for_free_line(struct fsl_sdhc_softc *sc, enum sdhc_line line) +{ + uint32_t timeout = 100; + uint32_t stat; + + stat = read4(sc, SDHC_PRSSTAT); + while (stat & line) { + if (timeout == 0) { + return (-1); + } + --timeout; + DELAY(1000); + stat = read4(sc, SDHC_PRSSTAT); + } + + return (0); +} + +static uint32_t +get_platform_clock(struct fsl_sdhc_softc *sc) +{ + device_t self, parent; + phandle_t node; + uint32_t clock; + + self = sc->self; + node = ofw_bus_get_node(self); + + /* Get sdhci node properties */ + if((OF_getprop(node, "clock-frequency", (void *)&clock, + sizeof(clock)) <= 0) || (clock == 0)) { + + /* + * Trying to get clock from parent device (soc) if correct + * clock cannot be acquired from sdhci node. + */ + parent = device_get_parent(self); + node = ofw_bus_get_node(parent); + + /* Get soc properties */ + if ((OF_getprop(node, "bus-frequency", (void *)&clock, + sizeof(clock)) <= 0) || (clock == 0)) { + device_printf(self,"Cannot acquire correct sdhci " + "frequency from DTS.\n"); + + return (0); + } + } + + DPRINTF("Acquired clock: %d from DTS\n", clock); + + return (clock); +} + +/** + * Set clock driving card. + * @param sc + * @param clock Desired clock frequency in Hz + */ +static void +set_clock(struct fsl_sdhc_softc *sc, uint32_t clock) +{ + uint32_t base_clock; + uint32_t divisor, prescaler = 1; + uint32_t round = 0; + + if (clock == sc->slot.clock) + return; + + if (clock == 0) { + clear_bit(sc, SDHC_SYSCTL, MASK_CLOCK_CONTROL | SYSCTL_PEREN | + SYSCTL_HCKEN | SYSCTL_IPGEN); + return; + } + + base_clock = sc->platform_clock; + round = base_clock & 0x2; + base_clock >>= 2; + base_clock += round; + round = 0; + + /* SD specification 1.1 doesn't allow frequences above 50 MHz */ + if (clock > FSL_SDHC_MAX_CLOCK) + clock = FSL_SDHC_MAX_CLOCK; + + /* + * divisor = ceil(base_clock / clock) + * TODO: Reconsider symmetric rounding here instead of ceiling. + */ + divisor = (base_clock + clock - 1) / clock; + + while (divisor > 16) { + round = divisor & 0x1; + divisor >>= 1; + + prescaler <<= 1; + } + divisor += round - 1; + + /* Turn off the clock. */ + clear_bit(sc, SDHC_SYSCTL, MASK_CLOCK_CONTROL); + + /* Write clock settings. */ + set_bit(sc, SDHC_SYSCTL, (prescaler << SHIFT_SDCLKFS) | + (divisor << SHIFT_DVS)); + + /* + * Turn on clocks. + * TODO: This actually disables clock automatic gating off feature of + * the controller which eventually should be enabled but as for now + * it prevents controller from generating card insertion/removal + * interrupts correctly. + */ + set_bit(sc, SDHC_SYSCTL, SYSCTL_PEREN | SYSCTL_HCKEN | SYSCTL_IPGEN); + + sc->slot.clock = clock; + + DPRINTF("given clock = %d, computed clock = %d\n", clock, + (base_clock / prescaler) / (divisor + 1)); +} + +static inline void +send_80_clock_ticks(struct fsl_sdhc_softc *sc) +{ + int err; + + err = wait_for_free_line(sc, SDHC_CMD_LINE | SDHC_DAT_LINE); + if (err != 0) { + device_printf(sc->self, "Can't acquire data/cmd lines\n"); + return; + } + + set_bit(sc, SDHC_SYSCTL, SYSCTL_INITA); + err = wait_for_bit_clear(sc, SDHC_SYSCTL, SYSCTL_INITA); + if (err != 0) { + device_printf(sc->self, "Can't send 80 clocks to the card.\n"); + } +} + +static void +set_bus_width(struct fsl_sdhc_softc *sc, enum mmc_bus_width width) +{ + + DPRINTF("setting bus width to %d\n", width); + switch (width) { + case bus_width_1: + set_bit(sc, SDHC_PROCTL, DTW_1); + break; + case bus_width_4: + set_bit(sc, SDHC_PROCTL, DTW_4); + break; + case bus_width_8: + set_bit(sc, SDHC_PROCTL, DTW_8); + break; + default: + device_printf(sc->self, "Unsupported bus width\n"); + } +} + +static void +reset_controller_all(struct fsl_sdhc_softc *sc) +{ + uint32_t count = 5; + + set_bit(sc, SDHC_SYSCTL, SYSCTL_RSTA); + while (read4(sc, SDHC_SYSCTL) & SYSCTL_RSTA) { + DELAY(FSL_SDHC_RESET_DELAY); + --count; + if (count == 0) { + device_printf(sc->self, + "Can't reset the controller\n"); + return; + } + } +} + +static void +reset_controller_dat_cmd(struct fsl_sdhc_softc *sc) +{ + int err; + + set_bit(sc, SDHC_SYSCTL, SYSCTL_RSTD | SYSCTL_RSTC); + err = wait_for_bit_clear(sc, SDHC_SYSCTL, SYSCTL_RSTD | SYSCTL_RSTC); + if (err != 0) { + device_printf(sc->self, "Can't reset data & command part!\n"); + return; + } +} + +static void +init_controller(struct fsl_sdhc_softc *sc) +{ + + /* Enable interrupts. */ +#ifdef FSL_SDHC_NO_DMA + write4(sc, SDHC_IRQSTATEN, MASK_IRQ_ALL & ~IRQ_DINT & ~IRQ_DMAE); + write4(sc, SDHC_IRQSIGEN, MASK_IRQ_ALL & ~IRQ_DINT & ~IRQ_DMAE); +#else + write4(sc, SDHC_IRQSTATEN, MASK_IRQ_ALL & ~IRQ_BRR & ~IRQ_BWR); + write4(sc, SDHC_IRQSIGEN, MASK_IRQ_ALL & ~IRQ_BRR & ~IRQ_BWR); + + /* Write DMA address */ + write4(sc, SDHC_DSADDR, sc->dma_phys); + + /* Enable snooping and fix for AHB2MAG bypass. */ + write4(sc, SDHC_DCR, DCR_SNOOP | DCR_AHB2MAG_BYPASS); +#endif + /* Set data timeout. */ + set_bit(sc, SDHC_SYSCTL, 0xe << SHIFT_DTOCV); + + /* Set water-mark levels (FIFO buffer size). */ + write4(sc, SDHC_WML, (FSL_SDHC_FIFO_BUF_WORDS << 16) | + FSL_SDHC_FIFO_BUF_WORDS); +} + +static void +init_mmc_host_struct(struct fsl_sdhc_softc *sc) +{ + struct mmc_host *host = &sc->mmc_host; + + /* Clear host structure. */ + bzero(host, sizeof(struct mmc_host)); + + /* Calculate minimum and maximum operating frequencies. */ + host->f_min = sc->platform_clock / FSL_SDHC_MAX_DIV; + host->f_max = FSL_SDHC_MAX_CLOCK; + + /* Set operation conditions (voltage). */ + host->host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; + + /* Set additional host controller capabilities. */ + host->caps = MMC_CAP_4_BIT_DATA; + + /* Set mode. */ + host->mode = mode_sd; +} + +static void +card_detect_task(void *arg, int pending) +{ + struct fsl_sdhc_softc *sc = (struct fsl_sdhc_softc *)arg; + int err; + int insert; + + insert = read4(sc, SDHC_PRSSTAT) & PRSSTAT_CINS; + + mtx_lock(&sc->mtx); + + if (insert) { + if (sc->child != NULL) { + mtx_unlock(&sc->mtx); + return; + } + + sc->child = device_add_child(sc->self, "mmc", -1); + if (sc->child == NULL) { + device_printf(sc->self, "Couldn't add MMC bus!\n"); + mtx_unlock(&sc->mtx); + return; + } + + /* Initialize MMC bus host structure. */ + init_mmc_host_struct(sc); + device_set_ivars(sc->child, &sc->mmc_host); + + } else { + if (sc->child == NULL) { + mtx_unlock(&sc->mtx); + return; + } + } + + mtx_unlock(&sc->mtx); + + if (insert) { + if ((err = device_probe_and_attach(sc->child)) != 0) { + device_printf(sc->self, "MMC bus failed on probe " + "and attach! error %d\n", err); + device_delete_child(sc->self, sc->child); + sc->child = NULL; + } + } else { + if (device_delete_child(sc->self, sc->child) != 0) + device_printf(sc->self, "Could not delete MMC bus!\n"); + sc->child = NULL; + } +} + +static void +card_detect_delay(void *arg) +{ + struct fsl_sdhc_softc *sc = arg; + + taskqueue_enqueue(taskqueue_swi_giant, &sc->card_detect_task); +} + +static void +finalize_request(struct fsl_sdhc_softc *sc) +{ + + DPRINTF("finishing request %x\n", sc->request); + + sc->request->done(sc->request); + sc->request = NULL; +} + +/** + * Read response from card. + * @todo Implement Auto-CMD responses being held in R3 for multi-block xfers. + * @param sc + */ +static void +get_response(struct fsl_sdhc_softc *sc) +{ + struct mmc_command *cmd = sc->request->cmd; + int i; + uint32_t val; + uint8_t ext = 0; + + if (cmd->flags & MMC_RSP_136) { + /* CRC is stripped, need to shift one byte left. */ + for (i = 0; i < 4; i++) { + val = read4(sc, SDHC_CMDRSP0 + i * 4); + cmd->resp[3 - i] = (val << 8) + ext; + ext = val >> 24; + } + } else { + cmd->resp[0] = read4(sc, SDHC_CMDRSP0); + } +} + +#ifdef FSL_SDHC_NO_DMA +/** + * Read all content of a fifo buffer. + * @warning Assumes data buffer is 32-bit aligned. + * @param sc + */ +static void +read_block_pio(struct fsl_sdhc_softc *sc) +{ + struct mmc_data *data = sc->request->cmd->data; + size_t left = min(FSL_SDHC_FIFO_BUF_SIZE, data->len); + uint8_t *buf = data->data; + uint32_t word; + + buf += sc->data_offset; + bus_space_read_multi_4(sc->bst, sc->bsh, SDHC_DATPORT, (uint32_t *)buf, + left >> 2); + + sc->data_offset += left; + + /* Handle 32-bit unaligned size case. */ + left &= 0x3; + if (left > 0) { + buf = (uint8_t *)data->data + (sc->data_offset & ~0x3); + word = read4(sc, SDHC_DATPORT); + while (left > 0) { + *(buf++) = word; + word >>= 8; + --left; + } + } +} + +/** + * Write a fifo buffer. + * @warning Assumes data buffer size is 32-bit aligned. + * @param sc + */ +static void +write_block_pio(struct fsl_sdhc_softc *sc) +{ + struct mmc_data *data = sc->request->cmd->data; + size_t left = min(FSL_SDHC_FIFO_BUF_SIZE, data->len); + uint8_t *buf = data->data; + uint32_t word = 0; + + DPRINTF("sc->data_offset %d\n", sc->data_offset); + + buf += sc->data_offset; + bus_space_write_multi_4(sc->bst, sc->bsh, SDHC_DATPORT, (uint32_t *)buf, + left >> 2); + + sc->data_offset += left; + + /* Handle 32-bit unaligned size case. */ + left &= 0x3; + if (left > 0) { + buf = (uint8_t *)data->data + (sc->data_offset & ~0x3); + while (left > 0) { + word += *(buf++); + word <<= 8; + --left; + } + write4(sc, SDHC_DATPORT, word); + } +} + +static void +pio_read_transfer(struct fsl_sdhc_softc *sc) +{ + + while (read4(sc, SDHC_PRSSTAT) & PRSSTAT_BREN) { + read_block_pio(sc); + + /* + * TODO: should we check here whether data_offset >= data->len? + */ + } +} + +static void +pio_write_transfer(struct fsl_sdhc_softc *sc) +{ + + while (read4(sc, SDHC_PRSSTAT) & PRSSTAT_BWEN) { + write_block_pio(sc); + + /* + * TODO: should we check here whether data_offset >= data->len? + */ + } +} +#endif /* FSL_SDHC_USE_DMA */ + +static inline void +handle_command_intr(struct fsl_sdhc_softc *sc, uint32_t irq_stat) +{ + struct mmc_command *cmd = sc->request->cmd; + + /* Handle errors. */ + if (irq_stat & IRQ_CTOE) { + cmd->error = MMC_ERR_TIMEOUT; + } else if (irq_stat & IRQ_CCE) { + cmd->error = MMC_ERR_BADCRC; + } else if (irq_stat & (IRQ_CEBE | IRQ_CIE)) { + cmd->error = MMC_ERR_FIFO; + } + + if (cmd->error) { + device_printf(sc->self, "Error interrupt occured\n"); + reset_controller_dat_cmd(sc); + return; + } + + if (sc->command_done) + return; + + if (irq_stat & IRQ_CC) { + sc->command_done = 1; + + if (cmd->flags & MMC_RSP_PRESENT) + get_response(sc); + } +} + +static inline void +handle_data_intr(struct fsl_sdhc_softc *sc, uint32_t irq_stat) +{ + struct mmc_command *cmd = sc->request->cmd; + + /* Handle errors. */ + if (irq_stat & IRQ_DTOE) { + cmd->error = MMC_ERR_TIMEOUT; + } else if (irq_stat & (IRQ_DCE | IRQ_DEBE)) { + cmd->error = MMC_ERR_BADCRC; + } else if (irq_stat & IRQ_ERROR_DATA_MASK) { + cmd->error = MMC_ERR_FAILED; + } + + if (cmd->error) { + device_printf(sc->self, "Error interrupt occured\n"); + sc->data_done = 1; + reset_controller_dat_cmd(sc); + return; + } + + if (sc->data_done) + return; + +#ifdef FSL_SDHC_NO_DMA + if (irq_stat & IRQ_BRR) { + pio_read_transfer(sc); + } + + if (irq_stat & IRQ_BWR) { + pio_write_transfer(sc); + } +#else + if (irq_stat & IRQ_DINT) { + struct mmc_data *data = sc->request->cmd->data; + + /* Synchronize DMA. */ + if (data->flags & MMC_DATA_READ) { + bus_dmamap_sync(sc->dma_tag, sc->dma_map, + BUS_DMASYNC_POSTREAD); + memcpy(data->data, sc->dma_mem, data->len); + } else { + bus_dmamap_sync(sc->dma_tag, sc->dma_map, + BUS_DMASYNC_POSTWRITE); + } + + /* + * TODO: For multiple block transfers, address of dma memory + * in DSADDR register should be set to the beginning of the + * segment here. Also offset to data pointer should be handled. + */ + } +#endif + + if (irq_stat & IRQ_TC) + sc->data_done = 1; +} + +static void +interrupt_handler(void *arg) +{ + struct fsl_sdhc_softc *sc = (struct fsl_sdhc_softc *)arg; + uint32_t irq_stat; + + mtx_lock(&sc->mtx); + + irq_stat = read4(sc, SDHC_IRQSTAT); + + /* Card interrupt. */ + if (irq_stat & IRQ_CINT) { + DPRINTF("Card interrupt recievied\n"); + + } + + /* Card insertion interrupt. */ + if (irq_stat & IRQ_CINS) { + clear_bit(sc, SDHC_IRQSIGEN, IRQ_CINS); + clear_bit(sc, SDHC_IRQSTATEN, IRQ_CINS); + set_bit(sc, SDHC_IRQSIGEN, IRQ_CRM); + set_bit(sc, SDHC_IRQSTATEN, IRQ_CRM); + + callout_reset(&sc->card_detect_callout, hz / 2, + card_detect_delay, sc); + } + + /* Card removal interrupt. */ + if (irq_stat & IRQ_CRM) { + clear_bit(sc, SDHC_IRQSIGEN, IRQ_CRM); + clear_bit(sc, SDHC_IRQSTATEN, IRQ_CRM); + set_bit(sc, SDHC_IRQSIGEN, IRQ_CINS); + set_bit(sc, SDHC_IRQSTATEN, IRQ_CINS); + + callout_stop(&sc->card_detect_callout); + taskqueue_enqueue(taskqueue_swi_giant, &sc->card_detect_task); + } + + /* Handle request interrupts. */ + if (sc->request) { + handle_command_intr(sc, irq_stat); + handle_data_intr(sc, irq_stat); + + /* + * Finalize request when transfer is done successfully + * or was interrupted due to error. + */ + if ((sc->data_done && sc->command_done) || + (sc->request->cmd->error)) + finalize_request(sc); + } + + /* Clear status register. */ + write4(sc, SDHC_IRQSTAT, irq_stat); + + mtx_unlock(&sc->mtx); +} + +#ifndef FSL_SDHC_NO_DMA +static void +dma_get_phys_addr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + + if (error != 0) + return; + + /* Get first segment's physical address. */ + *(bus_addr_t *)arg = segs->ds_addr; +} + +static int +init_dma(struct fsl_sdhc_softc *sc) +{ + device_t self = sc->self; + int err; + + err = bus_dma_tag_create(bus_get_dma_tag(self), + FSL_SDHC_DMA_BLOCK_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR, NULL, NULL, FSL_SDHC_DMA_BLOCK_SIZE, 1, + FSL_SDHC_DMA_BLOCK_SIZE, BUS_DMA_ALLOCNOW, NULL, NULL, + &sc->dma_tag); + + if (err) { + device_printf(self, "Could not create DMA tag!\n"); + return (-1); + } + + err = bus_dmamem_alloc(sc->dma_tag, (void **)&(sc->dma_mem), + BUS_DMA_NOWAIT | BUS_DMA_NOCACHE, &sc->dma_map); + if (err) { + device_printf(self, "Could not allocate DMA memory!\n"); + goto fail1; + } + + err = bus_dmamap_load(sc->dma_tag, sc->dma_map, (void *)sc->dma_mem, + FSL_SDHC_DMA_BLOCK_SIZE, dma_get_phys_addr, &sc->dma_phys, 0); + if (err) { + device_printf(self, "Could not load DMA map!\n"); + goto fail2; + } + + return (0); + +fail2: + bus_dmamem_free(sc->dma_tag, sc->dma_mem, sc->dma_map); +fail1: + bus_dma_tag_destroy(sc->dma_tag); + + return (-1); +} +#endif /* FSL_SDHC_NO_DMA */ + +static uint32_t +set_xfertyp_register(const struct mmc_command *cmd) +{ + uint32_t xfertyp = 0; + + /* Set command index. */ + xfertyp |= cmd->opcode << CMDINX_SHIFT; + + /* Set command type. */ + if (cmd->opcode == MMC_STOP_TRANSMISSION) + xfertyp |= CMDTYP_ABORT; + + /* Set data preset select. */ + if (cmd->data) { + xfertyp |= XFERTYP_DPSEL; + + /* Set transfer direction. */ + if (cmd->data->flags & MMC_DATA_READ) + xfertyp |= XFERTYP_DTDSEL; + } + + /* Set command index check. */ + if (cmd->flags & MMC_RSP_OPCODE) + xfertyp |= XFERTYP_CICEN; + + /* Set command CRC check. */ + if (cmd->flags & MMC_RSP_CRC) + xfertyp |= XFERTYP_CCCEN; + + /* Set response type */ + if (!(cmd->flags & MMC_RSP_PRESENT)) + xfertyp |= RSPTYP_NONE; + else if (cmd->flags & MMC_RSP_136) + xfertyp |= RSPTYP_136; + else if (cmd->flags & MMC_RSP_BUSY) + xfertyp |= RSPTYP_48_BUSY; + else + xfertyp |= RSPTYP_48; + +#ifndef FSL_SDHC_NO_DMA + /* Enable DMA */ + xfertyp |= XFERTYP_DMAEN; +#endif + + return (xfertyp); +} + +static uint32_t +set_blkattr_register(const struct mmc_data *data) +{ + + if (data->len <= FSL_SDHC_MAX_BLOCK_SIZE) { + /* One block transfer. */ + return (BLKATTR_BLOCK_COUNT(1) | ((data->len) & + BLKATTR_BLKSZE)); + } + + /* TODO: Write code here for multi-block transfers. */ + return (0); +} + +/** + * Initiate data transfer. Interrupt handler will finalize it. + * @todo Implement multi-block transfers. + * @param sc + * @param cmd + */ +static int +start_data(struct fsl_sdhc_softc *sc, struct mmc_data *data) +{ + uint32_t reg; + + if ((uint32_t)data->data & 0x3) { + device_printf(sc->self, "32-bit unaligned data pointer in " + "request\n"); + return (-1); + } + + sc->data_done = 0; + +#ifdef FSL_SDHC_NO_DMA + sc->data_ptr = data->data; + sc->data_offset = 0; +#else + /* Write DMA address register. */ + write4(sc, SDHC_DSADDR, sc->dma_phys); + + /* Synchronize DMA. */ + if (data->flags & MMC_DATA_READ) { + bus_dmamap_sync(sc->dma_tag, sc->dma_map, + BUS_DMASYNC_PREREAD); + } else { + memcpy(sc->dma_mem, data->data, data->len); + bus_dmamap_sync(sc->dma_tag, sc->dma_map, + BUS_DMASYNC_PREWRITE); + } +#endif + /* Set block size and count. */ + reg = set_blkattr_register(data); + if (reg == 0) { + device_printf(sc->self, "Requested unsupported multi-block " + "transfer.\n"); + return (-1); + } + write4(sc, SDHC_BLKATTR, reg); + + return (0); +} + +static int +start_command(struct fsl_sdhc_softc *sc, struct mmc_command *cmd) +{ + struct mmc_request *req = sc->request; + uint32_t mask; + uint32_t xfertyp; + int err; + + DPRINTF("opcode %d, flags 0x%08x\n", cmd->opcode, cmd->flags); + DPRINTF("PRSSTAT = 0x%08x\n", read4(sc, SDHC_PRSSTAT)); + + sc->command_done = 0; + + cmd->error = MMC_ERR_NONE; + + /* TODO: should we check here for card presence and clock settings? */ + + /* Always wait for free CMD line. */ + mask = SDHC_CMD_LINE; + /* Wait for free DAT if we have data or busy signal. */ + if (cmd->data || (cmd->flags & MMC_RSP_BUSY)) + mask |= SDHC_DAT_LINE; + /* We shouldn't wait for DAT for stop commands. */ + if (cmd == req->stop) + mask &= ~SDHC_DAT_LINE; + err = wait_for_free_line(sc, mask); + if (err != 0) { + device_printf(sc->self, "Controller never released inhibit " + "bit(s).\n"); + reset_controller_dat_cmd(sc); + cmd->error = MMC_ERR_FAILED; + sc->request = NULL; + req->done(req); + return (-1); + } + + xfertyp = set_xfertyp_register(cmd); + + if (cmd->data != NULL) { + err = start_data(sc, cmd->data); + if (err != 0) { + device_printf(sc->self, + "Data transfer request failed\n"); + reset_controller_dat_cmd(sc); + cmd->error = MMC_ERR_FAILED; + sc->request = NULL; + req->done(req); + return (-1); + } + } + + write4(sc, SDHC_CMDARG, cmd->arg); + write4(sc, SDHC_XFERTYP, xfertyp); + + DPRINTF("XFERTYP = 0x%08x\n", xfertyp); + DPRINTF("CMDARG = 0x%08x\n", cmd->arg); + + return (0); +} + +#ifdef DEBUG +static void +dump_registers(struct fsl_sdhc_softc *sc) +{ + printf("PRSSTAT = 0x%08x\n", read4(sc, SDHC_PRSSTAT)); + printf("PROCTL = 0x%08x\n", read4(sc, SDHC_PROCTL)); + printf("PMUXCR = 0x%08x\n", ccsr_read4(OCP85XX_PMUXCR)); + printf("HOSTCAPBLT = 0x%08x\n", read4(sc, SDHC_HOSTCAPBLT)); + printf("IRQSTAT = 0x%08x\n", read4(sc, SDHC_IRQSTAT)); + printf("IRQSTATEN = 0x%08x\n", read4(sc, SDHC_IRQSTATEN)); + printf("IRQSIGEN = 0x%08x\n", read4(sc, SDHC_IRQSIGEN)); + printf("WML = 0x%08x\n", read4(sc, SDHC_WML)); + printf("DSADDR = 0x%08x\n", read4(sc, SDHC_DSADDR)); + printf("XFERTYP = 0x%08x\n", read4(sc, SDHC_XFERTYP)); + printf("ECMCR = 0x%08x\n", ccsr_read4(OCP85XX_ECMCR)); + printf("DCR = 0x%08x\n", read4(sc, SDHC_DCR)); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat May 26 21:30:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D7241065740; Sat, 26 May 2012 21:30:19 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2368FC17; Sat, 26 May 2012 21:30:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QLUJkW007300; Sat, 26 May 2012 21:30:19 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QLUJCF007298; Sat, 26 May 2012 21:30:19 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201205262130.q4QLUJCF007298@svn.freebsd.org> From: Warren Block Date: Sat, 26 May 2012 21:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236122 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 21:30:19 -0000 Author: wblock (doc committer) Date: Sat May 26 21:30:18 2012 New Revision: 236122 URL: http://svn.freebsd.org/changeset/base/236122 Log: Wording corrections and simplifications. Approved by: gjb (mentor) MFC after: 3 days Modified: head/share/man/man4/vlan.4 Modified: head/share/man/man4/vlan.4 ============================================================================== --- head/share/man/man4/vlan.4 Sat May 26 21:07:15 2012 (r236121) +++ head/share/man/man4/vlan.4 Sat May 26 21:30:18 2012 (r236122) @@ -79,16 +79,16 @@ to a properly configured switch port. The VLAN tag should match one of those set up in the switched network. .Pp -Initially .Nm -assumes the same minimum length for tagged and untagged frames. -This mode is selected by the +initially assumes the same minimum length for tagged and untagged frames. +This mode is selected by setting the .Xr sysctl 8 variable .Va net.link.vlan.soft_pad -set to 0 (default). -However, there are network devices that fail to adjust frame length, -should it fall below the allowed minimum due to untagging. +to 0 +.Pq default . +However, there are network devices that fail to adjust frame length +when it falls below the allowed minimum due to untagging. Such devices should be able to interoperate with .Nm after changing the value of @@ -97,7 +97,7 @@ to 1. In the latter mode, .Nm will pad short frames before tagging them -so that their length stays not less than the minimum value +so that their length is not less than the minimum value after untagging by the non-compliant devices. .Sh HARDWARE The @@ -111,7 +111,7 @@ receive and transmit long frames (up to header and FCS). The capabilities may be user-controlled by the respective parameters to .Xr ifconfig 8 , -.Cm vlanhwtag +.Cm vlanhwtag , and .Cm vlanmtu . However, a physical interface is not obliged to react to them: @@ -119,8 +119,8 @@ It may have either capability enabled pe a way to turn it off. The whole issue is very specific to a particular device and its driver. .Pp -By now, the list of physical interfaces able of full VLAN processing -in the hardware is limited to the following devices: +At present, physical interfaces capable of full VLAN processing +in the hardware is limited to these devices: .Xr ae 4 , .Xr age 4 , .Xr alc 4 , @@ -146,11 +146,10 @@ in the hardware is limited to the follow and .Xr vge 4 . .Pp -The rest of the Ethernet interfaces can run -VLANs using software emulation in the +Other Ethernet interfaces can run VLANs using software emulation in the .Nm driver. -However, some of them lack the capability +However, some lack the capability of transmitting and receiving long frames. Assigning such an interface as the parent to .Nm @@ -163,9 +162,8 @@ connectivity problems due to massive, in .Xr icmp 4 filtering that breaks the Path MTU Discovery mechanism. .Pp -The following interfaces support long frames for -.Nm -natively: +These interfaces natively support long frames for +.Nm : .Xr axe 4 , .Xr bfe 4 , .Xr cas 4 , From owner-svn-src-head@FreeBSD.ORG Sat May 26 21:49:48 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 74A93106566B; Sat, 26 May 2012 21:49:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id B801C8FC0C; Sat, 26 May 2012 21:49:47 +0000 (UTC) Received: from mail14.syd.optusnet.com.au (mail14.syd.optusnet.com.au [211.29.132.195]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4QLnjlM017904; Sun, 27 May 2012 07:49:45 +1000 Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail14.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4QLnaMD028997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 27 May 2012 07:49:36 +1000 Date: Sun, 27 May 2012 07:49:36 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <20120526164927.GU2358@deviant.kiev.zoral.com.ua> Message-ID: <20120527043827.W3357@besplex.bde.org> References: <201205252150.q4PLomFk035064@svn.freebsd.org> <20120526173233.A885@besplex.bde.org> <20120526164927.GU2358@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Ed Schouten , rwatson@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org, jonathan@FreeBSD.org Subject: Re: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 21:49:48 -0000 On Sat, 26 May 2012, Konstantin Belousov wrote: > On Sat, May 26, 2012 at 10:21:25PM +1000, Bruce Evans wrote: Please don't quote the whole thing. >> On Fri, 25 May 2012, Ed Schouten wrote: >> >>> Log: >>> Remove use of non-ISO-C integer types from system call tables. >>> >>> These files already use ISO-C-style integer types, so make them less >>> inconsistent by preferring the standard types. >> >> These should actually be Linux types l_foo_t. ISO-C-style integer types >> [... but only in the low-level linux headers where this is possible] >>> Modified: head/sys/amd64/linux32/syscalls.master >>> ============================================================================== >>> --- head/sys/amd64/linux32/syscalls.master Fri May 25 21:12:24 2012 >>> (r236025) >>> +++ head/sys/amd64/linux32/syscalls.master Fri May 25 21:50:48 2012 >>> (r236026) >>> @@ -54,8 +54,8 @@ >>> l_int mode); } >>> 9 AUE_LINK STD { int linux_link(char *path, char *to); } >>> 10 AUE_UNLINK STD { int linux_unlink(char *path); } >>> -11 AUE_EXECVE STD { int linux_execve(char *path, u_int32_t >>> *argp, \ >>> - u_int32_t *envp); } >>> +11 AUE_EXECVE STD { int linux_execve(char *path, uint32_t >>> *argp, \ >>> + uint32_t *envp); } >> >> argp and envp aren't uintany_t * in either Linux or FreeBSD. They start as >> "char * const *". There is no Linux type for an indirect "char *", and one >> was hacked up here by pretending that "char *" is u_int32_t (it is actually >> just 32 bits). Using l_caddr_t seems to be the best hack available (since >> by abusing l_caddr_t, we know that it is actually char *). >> >> The `const' in the type for argp and envp is further from being handled >> correctly. Most or all syscall.master's just type-pun it away. Similarly >> for "const char *path". >> >> All the non-indirect "char *"s for pathnames and other things seem to be >> completely wrong on amd64 too. These pointers start as 32 bits, and it >> takes more than a bad type pun to turn then into kernel 64-bit pointers. >> The magic for this seems to be: >> - all args are converted to 64 bits (by zero-extension?) at a low level >>... > The 'low level' AKA magic happens in several *_fetch_syscall_args() > functions. For both linux32 and freebsd32, the magic code automatically > zero-extends the arguments into 64bit entities. Linux passes args in > registers, while FreeBSD uses words on stack. Actually, the amd64 linux_fetch32_fetch_syscall_args() just copies from 64-bit registers frame->tf_r* to 64-bit sa->args[*]. I can't see how this gives anything except garbage in the top bits. Is there magic in the switch to 64-bit mode that sets the top bits? Anyway, sign extension would give garbage for unsigned args, and zero-extension would give garbage for negative signed args. The amd64 ia32_fetch_syscall_args() is quite different. Now the args stack as 32 bits on the stack, so normal C accesses naturally extend them when assigning them to 64-bit memory sa->args[*]. The stack is in user space, so normal C accesses are unavailable at first. sa->code is read using fuword32(), which gives zero-extension. Then the stack is copied in and normal C accesses become available. Finally, all args are copied from 32-bit args[i] to 64-bit sa->args[i]. args[i] is u_int32_t, so this indeed gives zero-extension. But args[i] is signed (int64_t), since it is register_t which is bogusly signed. So for negative args, overflow occurs when int32_t accessed as u_int32_t via the type pun in the declaration of args[]. There is no further overflow when the result is assigned to sa->args[i], but the result is wrong (no longer negative). It takes further magic to undo this. BTW, struct syscall_args has bad names and formatting. It is missing indentation and sa_prefixes for all its members. These bugs are missing for the 64-bit register side of the copy (struct trapframe). > The types in the syscalls.master prototype should be in fact selected > to fit the in-kernel prototypes for the functions implementing the syscalls, No, they have to match the types actually passed so as to ignore any garbage bits created by previous magic steps. The lower levels cannot do a correct conversion since they don't have access to the type info generated from syscalls.master, and they shouldn't do a correct conversion since this is easier to do later -- only the functions implementing the syscalls can do it easily. The type info is mostly encoded in syscall args structs for the individual functions, in a way that the conversions only need to access fields in the structs to do the conversions (this only works for simple conversions but handles ignoring any leading and trailing bits up to reasonably boundaries, since this is needed for endianness handling). > esp. for NOPROTO cases, and not to the low-level layout of the syscall > entry data. Of course the layout must match the one actually used by the function implementing the syscall. For NOPROTO cases, this is given by sys/sysproto.h, not the syscall's C source code. This cannot use l_foo of course. But this is fragile, and there are only 41 NOPROTO cases, mostly for the simplest syscalls. It would be easy to wrap all of these so as never to use NOPROTO. It is also easy to check 41 cases. I checked them all and only found a few harmless errors, where only differences with kern/syscalls.master are counted as errors. These are mainly u_ints for ffs and perhaps a couple of ints for pid_t and vice versa. Anyway, it is correct to not use l_foo in the NOPROTO cases. compat/freebsd32/syscalls.master has 253 NOPROTO cases. Now too many to wrap or check easily. There are lots of pointer args which depend on magic. mknod() has a dev arg that is only int, but there has been discussion recently of bloating dev_t to 64 bits. One of the new CAP syscalls is more surely broken than the other, since it is NOPROTO but has a uint64_t arg. fcntl()'s 3rd arg is bogusly declared as long to match kern/sysalls.master. According to fcntl(3), the 3rd arg is actually int. Zero-extension of the int followed by not convering the 64-bit sa->argsp[i] back to int32_t via the fcntl_args struct might cause problems, but apparently this arg is rarely negative. Lots of NOPROTO entries are bug for bug compatible with kern/syscalls.master. It's weird that setreuid() is declared as taking int ids in the native and ia32 versions but as taking uid_t ids in the linux32 version. linux32 had to be more careful about uids because it also has 16-bit ones. >> - the args struct for a pathname is >> [left padding]; char *; [right padding]; >> Since the char * is misdeclared, the explicit padding is null, but the >> layout of the args struct is correct because the wrong arg type in it >> supplies equivalent padding (extra 32 bits on the right). >> > The arg struct layout is irrelevant, since fetch_syscall_args() functions > perform the needed translation from process ABI to kernel ABI. No, these functions cannot and do not do more than a simple translation, since they don't know the arg's actual size or signedness. They do basically the endianness part of the args struct (add right padding for little-endian). They messes up extra bits mainly for the top 32. The arg should have been promoted to 32 bits in userland earlier, but it is unclear of 32-bit ABIs require the extra bits to be non-garbage. When an arg is say int16_t, gcc does sign-extension in callers, but then doesn't trust this to have occured in callees, and does extra work to demote to the original type and then often to promote back to the 32-bit type. The args struct arranges for the corresponding demotion and repromotion when the callee is the kernel, provided the arg types are actually declared correctly. Now the demotion is almost free, by the type pun of ignoring unwanted bits in the args struct. > I think that the padding could be completely eliminated for translated > ABI, but since it is easier to reuse makesyscalls.sh instead of creating > ABI-specific script, and since there is quite non-trivial count of NOPROTO > declarations that just match the native-ABI syscall handlers, it is better > not to start that. It would just be slower without reorganizing all syscall layers. You would need a large switch statement with all syscalls that need special translation, or an extra layer of syscall functions. There are already too many layers of syscall functions. FreeBSD started with 1 or 2 more layers than Linux. Now it has 4 or 5 more layers for many important syscalls :-(. The second lowest layer was syscall(), and it much slower than Linux, since it has to fetch the args from the stack where Linux has most args in registers. With Linux-style layering, you can go straight from the lowest level to the individual syscall level (and shouldn't have sys_foo(), and a couple of kern_foo() layers between that and the actual work). Args are passed in registers and for the i386 ABI only to be pushed onto the stack to convert say lseek(2) into lseek(9). But given that FreeBSD lseek(9) wants to use an args struct, you shouldn't do extra work to pack the args struct. Leaving it sparse doesn't save cost much time unpacking it in read(9). >> - the "char *" in the args struct is not actually a char *, and is unusable >> directly in the kernel. However, it is only used in copyin() and >> copyout(), where it becomes a user address and works correctly. (An >> older bug in this that the user address for copy*() is declared as >> "void *". "void *" means a kernel pointer. The type of a user >> address should be more like vm_offset_t, but even that needs logical >> translation for linux32). >> > It is char *, but in different address space. Linux-style type qualifiers > like __usermode would be appropriate there (remember far/near ?), but > we do not have static checkers that do understand the difference. Of course it works for linux32, but this depends on the static checkers being stupid and on the user address space not being larger than the kernel address space (or at least on kernel pointers being large enough). Native mode depends on a flat virtual address space with ordinary pointers working, except in vm where it doesn't depend on the pointers part doesn't depend on the pointers part. The type puns from this are just more obvious in emulators. >>> 14 AUE_MKNOD STD { int linux_mknod(char *path, l_int mode, \ >> >> Broken except in the K&R case, but amd64 is too new to pretend to support >> K&R. Bug for bug compatible with mknod() and some other syscalls in > > C std version is irrelevant there. Args fetch code promotes all arguments > to (u)int(32). No, the args fetch code starts with all args already 32 bits (32-bit register_t for FreeBSD native i386). Promotion from mode_t to int occurs in the userland ABI. I just checked that neither gcc -O3 nor clang -O3 depends on this promotion being a strict C one. They both load an arg that is declared as int32_t using "movswl" from the stack, but if the ABI guaranteed strict C promotion, then optimal code would depend on this and use "movl" from the stack. -march=i386 makes no difference to this (movswl is almost as fast as movl on modern x86, but on original i386 it was much slower). I try to avoid using args shorter than int because of this pessimization. It was supposed to be an optimization in C90 to allow functions to pass short args without promotion, but ABI and FUD makes it mostly a pessimization on i386. First, the ABI requires passing 32 bits on the stack. Before C90, and still if no prototype in scope, the caller is required to promote an int16_t arg to int according to C promotion rules. Callees could assume this. Now, callees can't assume this, since they can't know if the caller did more than pass garbage padding bits, since the callee might have a prototype in scope and the ABI may allow passing garbage. This pessimization can now cost a whole nanosecond per arg per call :-). Anyway, the kernel should fear the ABI just as much as C compilers, since it easier to give correct declarations that do the demotions automatically via the args struct than it is to give incorrect ones that work (just copy arg types from userland prototypes, except for variadic functions, and don't allow variadic functions like open() and fcntl() for syscalls). >>> Modified: head/sys/compat/freebsd32/syscalls.master >>> ============================================================================== >>> --- head/sys/compat/freebsd32/syscalls.master Fri May 25 21:12:24 2012 >>> (r236025) >>> +++ head/sys/compat/freebsd32/syscalls.master Fri May 25 21:50:48 2012 >>> (r236026) >>> @@ -104,9 +104,9 @@ >>> int flags); } >>> 28 AUE_SENDMSG STD { int freebsd32_sendmsg(int s, struct >>> msghdr32 *msg, \ >>> int flags); } >>> -29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, u_int32_t >>> buf, \ >>> - u_int32_t len, int flags, u_int32_t >>> from, \ >>> - u_int32_t fromlenaddr); } >>> +29 AUE_RECVFROM STD { int freebsd32_recvfrom(int s, uint32_t >>> buf, \ >>> + uint32_t len, int flags, uint32_t from, \ >>> + uint32_t fromlenaddr); } >> >> Oops, I didn't looke at this file when I said that "ISO-C-style integer >> types seem to have only been used for a couple of uintptr_t's". This >> file is independent of Linux, so it can't use l_foo. It hard-codes 32 >> instead, starting with the directory name. Still, all of the types in >> the above are fairly bogus and hard to understand: >> - "int" for `s' and `flags' depends on ints being 32 bits >> > I agree that this is the biggest type-pun in the whole compat32/linux32 > components. It would be nice to use int32_t/uint32_t instead of int there, > since we in fact operate on ABI-defined type. Something like l_int (e_int? for emulated int?) would be better because it is shorter and more specific. Similarly for l_size_t. You can almost translate back and forth automatically by adding and removing the prefix, while there is no way to decode from a generic int32_t back to a foo_t. > But I do not think it is much worry to expect an arch to appear which have > sizeof(int) != 4. It is already engraved in stone. Like long was in 1982. And the result of fixing that was the long long, LFS, Linux loff_t and lots of foo64() syscalls in Linux just to support 64-bit off_t. FreeBSD missed most of this since BSD had a clean "break" and converted early to 64-bit off_t and made long 64 bits on alpha. >>> 481 AUE_KILL NOPROTO { int thr_kill2(pid_t pid, long id, int >>> sig); } >> >> Untranslated pid_t depends on pid_t being no larger than int. >> >> Untranslated long completely breaks this. Actually no breakage, especially with NOPROTO, and without NOPROTO there is only a minor problem with zero-extension. It takes a 64-bit type to break things. >>> -514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, u_int64_t rights); } >>> +514 AUE_CAP_NEW NOPROTO { int cap_new(int fd, uint64_t rights); } >> >> Broken, assuming that all the other spittings into 2 uint32_t's are needed. >> .. > Yes, this is broken. > I added Robert and Jonathan to Cc:. We only found this 64-bit type for freebsd32. >> These bugs are easiest to fix in the Linux syscall.master's since the >> bugs are mostly already avoided using l_foo_t. In amd64/linux32/ >> syscalls.master, I only noticed the following ones: >> ... >> % 193 AUE_TRUNCATE STD { int linux_truncate64(char *path, \ >> % l_loff_t length); } >> % 194 AUE_FTRUNCATE STD { int linux_ftruncate64(l_uint fd, \ >> % l_loff_t length); } >> >> How can this work? I was going to say that the splitting up of the 64-bit >> args in compat/freebsd32/syscalls.master was unnecessary because it is >> apparently not needed here. Then I misread this as doing the splitting. >> But it doesn't. Similarly later in this file. I'm now surer that loff_t cannot work. It gets passed as 2 32-bit registers. These get interpreted as 64-bit registers and copied to 2 64-bit args. But the above only describes 1 64-bit args. However, x86 is little-endian, so many values will work by ignoring the second register. All values below 2G will work provided the top bits are either sign-extended or zero-extended. All values between 2G and 4G will work provided the top bits are zero-extended. Negative loff_t's are common for linux_llseek() but not for linux_ltruncate(). And linux_llseek() doesn't have this bug since it is inmplemented almost correctly bt splitting the arg into "l_ulong ohigh, l_ulong olow" (is this big-endian order really correct?!). linux_llseek() claims to retun int instead of the 64-bit offset, and that is correct since the offset is returned indirectly. But linux_lseek() also claims to return int instead of l_off_t. That is bogus but works. Here is the complete list of syscalls with buggy loff_t's from linux32: % 180 AUE_PREAD STD { int linux_pread(l_uint fd, char *buf, \ % l_size_t nbyte, l_loff_t offset); } % 181 AUE_PWRITE STD { int linux_pwrite(l_uint fd, char *buf, \ % l_size_t nbyte, l_loff_t offset); } % 193 AUE_TRUNCATE STD { int linux_truncate64(char *path, \ % l_loff_t length); } % 194 AUE_FTRUNCATE STD { int linux_ftruncate64(l_uint fd, \ % l_loff_t length); } WHen there is only 1 loff_t arg and it is the last one, it won't mess up the other args. But what about loff_t apparently being in big-endian order for linux_llseek(). I guess the order is actually little-endian, but the order is reversed by allocation of the 2 halves in registers. % 250 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t offset, \ % l_size_t len, int advice); } % 272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ % l_loff_t offset, l_loff_t len, \ % int advice); } Now the loff_t's are in the middle of the args, and/or there are 2 of them, so later args are messed up. I didn't quote the whole thing, but its still a 17K reply, sorry. Bruce From owner-svn-src-head@FreeBSD.ORG Sat May 26 23:10:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 095E41065673; Sat, 26 May 2012 23:10:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8BB58FC12; Sat, 26 May 2012 23:10:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QNALkX012285; Sat, 26 May 2012 23:10:21 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QNALLl012283; Sat, 26 May 2012 23:10:21 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201205262310.q4QNALLl012283@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 26 May 2012 23:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236126 - head/contrib/openpam/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 23:10:22 -0000 Author: des Date: Sat May 26 23:10:21 2012 New Revision: 236126 URL: http://svn.freebsd.org/changeset/base/236126 Log: OpenPAM Micrampelis was re-rolled due to a showstopper bug. Modified: head/contrib/openpam/lib/openpam_configure.c Directory Properties: head/contrib/openpam/ (props changed) Modified: head/contrib/openpam/lib/openpam_configure.c ============================================================================== --- head/contrib/openpam/lib/openpam_configure.c Sat May 26 23:08:53 2012 (r236125) +++ head/contrib/openpam/lib/openpam_configure.c Sat May 26 23:10:21 2012 (r236126) @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: openpam_configure.c 601 2012-04-14 20:37:45Z des $ + * $Id: openpam_configure.c 612 2012-05-26 23:02:55Z des $ */ #ifdef HAVE_CONFIG_H @@ -261,6 +261,8 @@ openpam_parse_chain(pam_handle_t *pamh, this->optc = wordc - i; for (i = 0; i < wordc - this->optc; ++i) { FREE(wordv[i]); + } + for (i = 0; i < this->optc; ++i) { wordv[i] = wordv[wordc - this->optc + i]; wordv[wordc - this->optc + i] = NULL; } From owner-svn-src-head@FreeBSD.ORG Sat May 26 23:58:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C471106566C; Sat, 26 May 2012 23:58:52 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77BF58FC0A; Sat, 26 May 2012 23:58:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QNwq9t014376; Sat, 26 May 2012 23:58:52 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QNwqbL014374; Sat, 26 May 2012 23:58:52 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205262358.q4QNwqbL014374@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 26 May 2012 23:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236130 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 23:58:52 -0000 Author: bz Date: Sat May 26 23:58:51 2012 New Revision: 236130 URL: http://svn.freebsd.org/changeset/base/236130 Log: Correctly get the payload length in host byte order. While we already plan to support >64k payload here, the IPv6 header payload length obviously is only 16 bit and the calculations need to be right. Reported by: dim Tested by: dim MFC after: 1 day X-MFC: with r235958 Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sat May 26 23:48:56 2012 (r236129) +++ head/sys/netinet6/ip6_output.c Sat May 26 23:58:51 2012 (r236130) @@ -189,13 +189,13 @@ in6_delayed_cksum(struct mbuf *m, uint32 { u_short csum; - csum = in_cksum_skip(m, ntohl(plen), offset); + csum = in_cksum_skip(m, offset + plen, offset); if (m->m_pkthdr.csum_flags & CSUM_UDP && csum == 0) csum = 0xffff; offset += m->m_pkthdr.csum_data; /* checksum offset */ if (offset + sizeof(u_short) > m->m_len) { - printf("%s: delayed m_pullup, m->len: %d off: %d\n", + printf("%s: delayed m_pullup, m->len: %d off: %d\n", __func__, m->m_len, offset); /* * XXX this should not happen, but if it does, the correct @@ -962,7 +962,7 @@ passout: */ if (sw_csum & CSUM_DELAY_DATA) { sw_csum &= ~CSUM_DELAY_DATA; - in6_delayed_cksum(m, ip6->ip6_plen, sizeof(struct ip6_hdr)); + in6_delayed_cksum(m, plen, sizeof(struct ip6_hdr)); } #ifdef SCTP if (sw_csum & CSUM_SCTP) { @@ -1077,7 +1077,7 @@ passout: * XXX-BZ handle the hw offloading case. Need flags. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { - in6_delayed_cksum(m, ip6->ip6_plen, sizeof(*ip6)); + in6_delayed_cksum(m, plen, hlen); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } #ifdef SCTP