From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 02:16: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 63BDF1065705; Sun, 19 Aug 2012 02:16: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 4E88C8FC12; Sun, 19 Aug 2012 02:16: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 q7J2GNVq012943; Sun, 19 Aug 2012 02:16:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J2GNq8012941; Sun, 19 Aug 2012 02:16:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208190216.q7J2GNq8012941@svn.freebsd.org> From: Adrian Chadd Date: Sun, 19 Aug 2012 02:16: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: r239380 - 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, 19 Aug 2012 02:16:23 -0000 Author: adrian Date: Sun Aug 19 02:16:22 2012 New Revision: 239380 URL: http://svn.freebsd.org/changeset/base/239380 Log: When assembling the descriptor list, make sure that the "first" descriptor is marked correctly. The existing logic assumed that the first descriptor is i == 0, which doesn't hold for EDMA TX. In this instance, the first time filltxdesc() is called can be up to i == 3. So for a two-buffer descriptor: * firstSeg is set to 0; * lastSeg is set to 1; * the ath_hal_filltxdesc() code will treat it as the last segment in a descriptor chain and blank some of the descriptor fields, causing the TX to stop. When firstSeg is set to 1 (regardless of lastSeg), it overrides the lastSeg setting. Thus, ath_hal_filltxdesc() won't blank out these fields. Tested: AR9380, STA mode. With this, association is successful. 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 Aug 18 23:28:34 2012 (r239379) +++ head/sys/dev/ath/if_ath_tx.c Sun Aug 19 02:16:22 2012 (r239380) @@ -306,6 +306,7 @@ ath_tx_chaindesclist(struct ath_softc *s HAL_DMA_ADDR bufAddrList[4]; uint32_t segLenList[4]; int numTxMaps = 1; + int isFirstDesc = 1; /* * XXX There's txdma and txdma_mgmt; the descriptor @@ -369,10 +370,11 @@ ath_tx_chaindesclist(struct ath_softc *s , segLenList , bf->bf_descid /* XXX desc id */ , bf->bf_state.bfs_txq->axq_qnum /* XXX multicast? */ - , i == 0 /* first segment */ + , isFirstDesc /* first segment */ , i == bf->bf_nseg - 1 /* last segment */ , ds0 /* first descriptor */ ); + isFirstDesc = 0; DPRINTF(sc, ATH_DEBUG_XMIT, "%s: %d: %08x %08x %08x %08x %08x %08x\n", __func__, i, ds->ds_link, ds->ds_data, From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 02:22: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 1F08C106564A; Sun, 19 Aug 2012 02:22:17 +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 F414B8FC0A; Sun, 19 Aug 2012 02:22: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 q7J2MG30013627; Sun, 19 Aug 2012 02:22:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J2MGJU013624; Sun, 19 Aug 2012 02:22:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208190222.q7J2MGJU013624@svn.freebsd.org> From: Adrian Chadd Date: Sun, 19 Aug 2012 02:22: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: r239381 - in head/sys/dev/ath: . ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Aug 2012 02:22:17 -0000 Author: adrian Date: Sun Aug 19 02:22:16 2012 New Revision: 239381 URL: http://svn.freebsd.org/changeset/base/239381 Log: Extend the TX descriptor debug printing to be properly aware of EDMA code. * create a new TX EDMA descriptor struct to represent TX EDMA descriptors when doing debugging; * implement an EDMA printing function which: + hardcodes the TX map size to 4 for now; + correctly prints out the number of segments - there's one descriptor for up to 4 buffers (segments), not one for each segment; + print out 4 DS buffer and len pointers; + print out the correct number of DWORDs in the TX descriptor. TODO: * Remove all of the hard-coded stuff. Ew. Modified: head/sys/dev/ath/ath_hal/ah_desc.h head/sys/dev/ath/if_ath_debug.c Modified: head/sys/dev/ath/ath_hal/ah_desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_desc.h Sun Aug 19 02:16:22 2012 (r239380) +++ head/sys/dev/ath/ath_hal/ah_desc.h Sun Aug 19 02:22:16 2012 (r239381) @@ -223,6 +223,12 @@ struct ath_desc { uint32_t ds_hw[HAL_DESC_HW_SIZE]; /* opaque h/w region */ }; +struct ath_desc_txedma { + uint32_t ds_info; + uint32_t ds_link; + uint32_t ds_hw[21]; /* includes buf/len */ +}; + struct ath_desc_status { union { struct ath_tx_status tx;/* xmit status */ Modified: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- head/sys/dev/ath/if_ath_debug.c Sun Aug 19 02:16:22 2012 (r239380) +++ head/sys/dev/ath/if_ath_debug.c Sun Aug 19 02:22:16 2012 (r239381) @@ -132,8 +132,72 @@ ath_printrxbuf(struct ath_softc *sc, con } } -void -ath_printtxbuf(struct ath_softc *sc, const struct ath_buf *first_bf, +static void +ath_printtxbuf_edma(struct ath_softc *sc, const struct ath_buf *first_bf, + u_int qnum, u_int ix, int done) +{ + const struct ath_tx_status *ts = + &first_bf->bf_last->bf_status.ds_txstat; + const struct ath_buf *bf = first_bf; + const char *ds; + const struct ath_desc_txedma *eds; + int i, n; + + /* + * Assume the TX map size is 4 for now and only walk + * the appropriate number of segments. + */ + n = bf->bf_nseg / 4; + if (n == 0) + n = 1; + + printf("Q%u[%3u]", qnum, ix); + while (bf != NULL) { + /* + * XXX For now, assume the txmap size is 4. + */ + for (i = 0, ds = (const char *) bf->bf_desc; + i < n; + i ++, ds += sc->sc_tx_desclen) { + eds = (const struct ath_desc_txedma *) ds; + printf(" (DS.V:%p DS.P:%p) I: %08x L:%08x F:%04x%s\n", + eds, (const struct ath_desc *)bf->bf_daddr + i, + eds->ds_info, eds->ds_link, + bf->bf_state.bfs_txflags, + !done ? "" : (ts->ts_status == 0) ? " *" : " !"); + printf(" (D[0] = %08x(%08x), D[1] = %08x(%08x)\n", + eds->ds_hw[0], eds->ds_hw[1], + eds->ds_hw[2], eds->ds_hw[3]); + printf(" (D[2] = %08x(%08x), D[3] = %08x(%08x)\n", + eds->ds_hw[4], eds->ds_hw[5], + eds->ds_hw[6], eds->ds_hw[7]); + printf(" Seq: %d swtry: %d ADDBAW?: %d DOBAW?: %d\n", + bf->bf_state.bfs_seqno, + bf->bf_state.bfs_retries, + bf->bf_state.bfs_addedbaw, + bf->bf_state.bfs_dobaw); + printf(" %08x %08x %08x %08x %08x %08x\n", + eds->ds_hw[8], eds->ds_hw[9], + eds->ds_hw[10], eds->ds_hw[11], + eds->ds_hw[12], eds->ds_hw[13]); + printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", + eds->ds_hw[14], eds->ds_hw[15], eds->ds_hw[16], + eds->ds_hw[17], eds->ds_hw[18], eds->ds_hw[19], + eds->ds_hw[20], eds->ds_hw[21]); +#if 0 + printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", + ds->ds_hw[22],ds->ds_hw[23],ds->ds_hw[24], + ds->ds_hw[25],ds->ds_hw[26],ds->ds_hw[27], + ds->ds_hw[28], ds->ds_hw[29]); +#endif + } + printf(" [end]\n"); + bf = bf->bf_next; + } +} + +static void +ath_printtxbuf_legacy(struct ath_softc *sc, const struct ath_buf *first_bf, u_int qnum, u_int ix, int done) { const struct ath_tx_status *ts = &first_bf->bf_last->bf_status.ds_txstat; @@ -158,8 +222,7 @@ ath_printtxbuf(struct ath_softc *sc, con ds->ds_ctl0, ds->ds_ctl1, ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3]); - if (ah->ah_magic == 0x20065416 || - ah->ah_magic == 0x19741014) { + if (ah->ah_magic == 0x20065416) { printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", ds->ds_hw[4], ds->ds_hw[5], ds->ds_hw[6], ds->ds_hw[7], ds->ds_hw[8], ds->ds_hw[9], @@ -175,4 +238,14 @@ ath_printtxbuf(struct ath_softc *sc, con } } +void +ath_printtxbuf(struct ath_softc *sc, const struct ath_buf *first_bf, + u_int qnum, u_int ix, int done) +{ + if (sc->sc_ah->ah_magic == 0x19741014) + ath_printtxbuf_edma(sc, first_bf, qnum, ix, done); + else + ath_printtxbuf_legacy(sc, first_bf, qnum, ix, done); +} + #endif /* ATH_DEBUG */ From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 03:00: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 62FAD1065678; Sun, 19 Aug 2012 03:00:53 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64]) by mx1.freebsd.org (Postfix) with ESMTP id 29A4B8FC15; Sun, 19 Aug 2012 03:00:52 +0000 (UTC) Received: from mxin1-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp3.clear.net.nz (CLEAR Net Mail) with ESMTP id <0M8Z0084RF18NH10@smtp3.clear.net.nz>; Sun, 19 Aug 2012 15:00:46 +1200 (NZST) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin1.paradise.net.nz with ESMTP; Sun, 19 Aug 2012 15:00:45 +1200 Date: Sun, 19 Aug 2012 15:00:22 +1200 From: Andrew Turner In-reply-to: <201208121753.q7CHr7VU017178@svn.freebsd.org> To: Hans Petter Selasky Message-id: <20120819150022.3c583fef@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Pirate: Arrrr References: <201208121753.q7CHr7VU017178@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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: Sun, 19 Aug 2012 03:00:53 -0000 Hello, This commit causes issues for me on my AT91 board. I get messages similar to the following: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 0 0 5f d1 a0 0 0 1d 0 (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error (da0:umass-sim0:0:0:0): Retrying command (da0:umass-sim0:0:0:0): WRITE(10). CDB: 2a 0 0 0 7 e0 0 0 8 0 (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error (da0:umass-sim0:0:0:0): Retrying command Other people are getting similar messages on different ARM cpus. Andrew From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 07:39: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 BA189106566B; Sun, 19 Aug 2012 07:39:21 +0000 (UTC) (envelope-from hans.petter.selasky@bitfrost.no) Received: from smtp01-out.isp.tdc.no (smtp01-out.isp.tdc.no [85.19.210.243]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1348FC19; Sun, 19 Aug 2012 07:39:20 +0000 (UTC) Received: from mail.bitfrost.no (mail.bitfrost.no [85.19.79.136]) by smtp01-out.isp.tdc.no (Postfix) with ESMTP id 3X094k5LZsz395; Sun, 19 Aug 2012 09:38:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bitfrost.no From: =?windows-1252?Q?Hans_Petter_Selasky?= To: =?windows-1252?Q?Hans_Petter_Selasky?= , =?windows-1252?Q?Andrew_Turner?= Date: Sun, 19 Aug 2012 09:39:11 +0200 Mime-Version: 1.0 In-Reply-To: <20120819150022.3c583fef@fubar.geek.nz> References: <20120819150022.3c583fef@fubar.geek.nz> X-Priority: 3 (Normal) Message-Id: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "=?windows-1252?Q?svn-src-head=40freebsd.org?=" , "=?windows-1252?Q?svn-src-all=40freebsd.org?=" , "=?windows-1252?Q?src-committers=40freebsd.org?=" Subject: RE: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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: Sun, 19 Aug 2012 07:39:21 -0000 Hi,=0D=0A=0D=0A=A0=0D=0A=0D=0AHave you stepped the versions=3F=0D=0A=0D=0A= =A0=0D=0A=0D=0AAre you sure it is exactly this commit=3F=0D=0A=0D=0A=A0=0D= =0A=0D=0A--HPS=0D=0A-----Original message-----=0D=0AFrom:Andrew Turner =0D=0ASent:Sun 19-08-2012 05:01=0D=0ASubject:Re: svn = commit: r239214 - in head/sys: dev/usb dev/usb/controller sys=0D=0ATo:Han= s Petter Selasky ;=20=0D=0ACC:src-committers@freebs= d.org; svn-src-all@freebsd.org; svn-src-head@freebsd.org;=20=0D=0AHello,=0D= =0A=0D=0AThis commit causes issues for me on my AT91 board. I get message= s=0D=0Asimilar to the following:=0D=0A=0D=0A(da0:umass-sim0:0:0:0): READ(= 10). CDB: 28 0 0 5f d1 a0 0 0 1d 0=20=0D=0A(da0:umass-sim0:0:0:0): CAM st= atus: CCB request completed with an error=0D=0A(da0:umass-sim0:0:0:0): Re= trying command=0D=0A(da0:umass-sim0:0:0:0): WRITE(10). CDB: 2a 0 0 0 7 e0= 0 0 8 0=20=0D=0A(da0:umass-sim0:0:0:0): CAM status: CCB request complete= d with an error=0D=0A(da0:umass-sim0:0:0:0): Retrying command=0D=0A=0D=0A= Other people are getting similar messages on different ARM cpus.=0D=0A=0D= =0AAndrew=0D=0A From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 08:15: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 34708106564A; Sun, 19 Aug 2012 08:15:33 +0000 (UTC) (envelope-from kuriyama@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 143238FC08; Sun, 19 Aug 2012 08:15: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 q7J8FWRt049958; Sun, 19 Aug 2012 08:15:32 GMT (envelope-from kuriyama@svn.freebsd.org) Received: (from kuriyama@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J8FWLi049955; Sun, 19 Aug 2012 08:15:32 GMT (envelope-from kuriyama@svn.freebsd.org) Message-Id: <201208190815.q7J8FWLi049955@svn.freebsd.org> From: Jun Kuriyama Date: Sun, 19 Aug 2012 08:15: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: r239382 - in head/etc: defaults rc.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: Sun, 19 Aug 2012 08:15:33 -0000 Author: kuriyama Date: Sun Aug 19 08:15:32 2012 New Revision: 239382 URL: http://svn.freebsd.org/changeset/base/239382 Log: - Allow to pass extra parameters for each jails. - To achieve above, convert jail(8) invocation to use new style command line "-c" flag. Reviewed at: freebsd-jail@ Modified: head/etc/defaults/rc.conf head/etc/rc.d/jail Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sun Aug 19 02:22:16 2012 (r239381) +++ head/etc/defaults/rc.conf Sun Aug 19 08:15:32 2012 (r239382) @@ -705,6 +705,7 @@ jail_sysvipc_allow="NO" # Allow SystemV #jail_example_mount_enable="NO" # mount/umount jail's fs #jail_example_fstab="" # fstab(5) for mount/umount #jail_example_flags="-l -U root" # flags for jail(8) +#jail_example_parameters="allow.raw_sockets=1" # extra parameters for this jail ############################################################## ### Define source_rc_confs, the mechanism used by /etc/rc.* ## Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Sun Aug 19 02:22:16 2012 (r239381) +++ head/etc/rc.d/jail Sun Aug 19 08:15:32 2012 (r239382) @@ -115,6 +115,8 @@ init_variables() [ -z "${_flags}" ] && _flags="-l -U root" eval _consolelog=\"\${jail_${_j}_consolelog:-${jail_consolelog}}\" [ -z "${_consolelog}" ] && _consolelog="/var/log/jail_${_j}_console.log" + eval _parameters=\"\${jail_${_j}_parameters:-${jail_parameters}}\" + [ -z "${_parameters}" ] && _parameters="" eval _fib=\"\${jail_${_j}_fib:-${jail_fib}}\" # Debugging aid @@ -193,6 +195,7 @@ init_variables() debug "$_j flags: $_flags" debug "$_j consolelog: $_consolelog" + debug "$_j parameters: $_parameters" if [ -z "${_hostname}" ]; then err 3 "$name: No hostname has been defined for ${_j}" @@ -484,9 +487,19 @@ jail_handle_ips_option() esac # Append address to list of addresses for the jail command. - case "${_addrl}" in - "") _addrl="${_addr}" ;; - *) _addrl="${_addrl},${_addr}" ;; + case "${_type}" in + inet) + case "${_addrl}" in + "") _addrl="${_addr}" ;; + *) _addrl="${_addrl},${_addr}" ;; + esac + ;; + inet6) + case "${_addr6l}" in + "") _addr6l="${_addr}" ;; + *) _addr6l="${_addr6l},${_addr}" ;; + esac + ;; esac # Configure interface alias if requested by a given interface @@ -576,6 +589,7 @@ jail_start() continue; fi _addrl="" + _addr6l="" jail_ips "add" if [ -n "${_fib}" ]; then _setfib="setfib -F '${_fib}'" @@ -641,8 +655,8 @@ jail_start() i=$((i + 1)) done - eval ${_setfib} jail -n ${_jail} ${_flags} -i ${_rootdir} ${_hostname} \ - \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \ + eval ${_setfib} jail -n ${_jail} ${_flags} -i -c path=${_rootdir} host.hostname=${_hostname} \ + ip4.addr=\"${_addrl}\" ip6.addr=\"${_addr6l}\" ${_parameters} command=${_exec_start} > ${_tmp_jail} 2>&1 \ 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 433FA106566C; Sun, 19 Aug 2012 08:16:14 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3D78FC0A; Sun, 19 Aug 2012 08:16: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 q7J8GEk7050058; Sun, 19 Aug 2012 08:16:14 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J8GD1M050056; Sun, 19 Aug 2012 08:16:13 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201208190816.q7J8GD1M050056@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 19 Aug 2012 08:16: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: r239383 - 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, 19 Aug 2012 08:16:14 -0000 Author: trociny Date: Sun Aug 19 08:16:13 2012 New Revision: 239383 URL: http://svn.freebsd.org/changeset/base/239383 Log: In ip6_ctloutput() guard inp_flags modifications with INP_WLOCK. MFC after: 2 weeks Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sun Aug 19 08:15:32 2012 (r239382) +++ head/sys/netinet6/ip6_output.c Sun Aug 19 08:16:13 2012 (r239383) @@ -1615,18 +1615,22 @@ ip6_ctloutput(struct socket *so, struct break; #define OPTSET(bit) \ do { \ + INP_WLOCK(in6p); \ if (optval) \ in6p->inp_flags |= (bit); \ else \ in6p->inp_flags &= ~(bit); \ + INP_WUNLOCK(in6p); \ } while (/*CONSTCOND*/ 0) #define OPTSET2292(bit) \ do { \ + INP_WLOCK(in6p); \ in6p->inp_flags |= IN6P_RFC2292; \ if (optval) \ in6p->inp_flags |= (bit); \ else \ in6p->inp_flags &= ~(bit); \ + INP_WUNLOCK(in6p); \ } while (/*CONSTCOND*/ 0) #define OPTBIT(bit) (in6p->inp_flags & (bit) ? 1 : 0) @@ -1880,6 +1884,7 @@ do { \ if (error) break; + INP_WLOCK(in6p); switch (optval) { case IPV6_PORTRANGE_DEFAULT: in6p->inp_flags &= ~(INP_LOWPORT); @@ -1900,6 +1905,7 @@ do { \ error = EINVAL; break; } + INP_WUNLOCK(in6p); break; #ifdef IPSEC From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 08:26: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 092F41065672; Sun, 19 Aug 2012 08:26:56 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp5.clear.net.nz (smtp5.clear.net.nz [203.97.33.68]) by mx1.freebsd.org (Postfix) with ESMTP id C05BD8FC0A; Sun, 19 Aug 2012 08:26:55 +0000 (UTC) Received: from mxin2-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp5.clear.net.nz (CLEAR Net Mail) with ESMTP id <0M8Z00DKXU4O2L10@smtp5.clear.net.nz>; Sun, 19 Aug 2012 20:26:48 +1200 (NZST) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin2.paradise.net.nz with ESMTP; Sun, 19 Aug 2012 20:26:45 +1200 Date: Sun, 19 Aug 2012 20:26:22 +1200 From: Andrew Turner In-reply-to: To: Hans Petter Selasky Message-id: <20120819202622.6db6a8dd@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable X-Pirate: Arrrr References: <20120819150022.3c583fef@fubar.geek.nz> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Hans Petter Selasky Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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: Sun, 19 Aug 2012 08:26:56 -0000 On Sun, 19 Aug 2012 09:39:11 +0200 Hans Petter Selasky wrote: > Hi, >=20 > =C2=A0 >=20 > Have you stepped the versions? I did a binary search of the commits to find the revision that caused the issue. > Are you sure it is exactly this commit? I built with r239213 and the problem went away, when I built with r239214 it appeared again. Andrew From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 08:35: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 56923106566B; Sun, 19 Aug 2012 08:35:31 +0000 (UTC) (envelope-from to.my.trociny@gmail.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 777358FC0A; Sun, 19 Aug 2012 08:35:30 +0000 (UTC) Received: by bkcje9 with SMTP id je9so1973362bkc.13 for ; Sun, 19 Aug 2012 01:35:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=a1LbZjEwmmHYmr9xg0GGs8Bhxqrwn/QohZtvtNfeDpU=; b=Q19sRlGEu5ghH4z47zBVASP0mB0agktuwqDPBPjYUCz4b2J5ccSIZro5FnDPju0rKZ 80Z4BeRhU8h+Q1/qzzXjhgZ946bGpKmU0niBT2UvGSTJWwmglU7dQ8wOT3ozNf6l6gVO A0Yxm7rfDcPS8opLymzkY9SsDm/4yfsZrwOhSsTW9IW+0Tx9/2aurSJgd6O2KaQ0ZREN bXOhHsfxDZMQc/dsy2lumFjk61wQej0JYPl3Yb08Ci/TCZAOrqtdNePYQrNWAYPBVCeO eEjHjPZEmuX14YfovLQZzNj5FFTGpWWOxLykC+Tn6x6Hm1gN+UKJGJC7BoABVhaussKi 6LEg== Received: by 10.205.117.141 with SMTP id fm13mr3494877bkc.125.1345365329067; Sun, 19 Aug 2012 01:35:29 -0700 (PDT) Received: from localhost ([95.69.175.25]) by mx.google.com with ESMTPS id g6sm4901390bkg.2.2012.08.19.01.35.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Aug 2012 01:35:28 -0700 (PDT) Sender: Mikolaj Golub Date: Sun, 19 Aug 2012 11:35:25 +0300 From: Mikolaj Golub To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120819083346.GA3758@gmail.com> References: <201208190816.q7J8GD1M050056@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201208190816.q7J8GD1M050056@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r239383 - 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, 19 Aug 2012 08:35:31 -0000 On Sun, Aug 19, 2012 at 08:16:13AM +0000, Mikolaj Golub wrote: > Author: trociny > Date: Sun Aug 19 08:16:13 2012 > New Revision: 239383 > URL: http://svn.freebsd.org/changeset/base/239383 > > Log: > In ip6_ctloutput() guard inp_flags modifications with INP_WLOCK. > The issue this commit fixes was reproduced using this simple program: http://people.freebsd.org/~trociny/test_IPPROTO_IPV6.c When two threads modified IPPROTO_IPV6 options simultaneously (each thread a different option but both options are in inp_flags, like IPV6_V6ONLY and IPV6_PORTRANGE) the result could be wrong due to the interference. I think that modification of ip6_pktopts should be guarded with the lock too. I have a patch for this: http://people.freebsd.org/~trociny/ip6_output.c.ip6_pktopts.1.patch Unfortunately, I don't know how to test this. -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 09:59: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 5C86E106566C; Sun, 19 Aug 2012 09:59:42 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4732F8FC14; Sun, 19 Aug 2012 09:59: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 q7J9xgEL060993; Sun, 19 Aug 2012 09:59:42 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J9xg4H060991; Sun, 19 Aug 2012 09:59:42 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208190959.q7J9xg4H060991@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 09:59: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: r239389 - 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: Sun, 19 Aug 2012 09:59:42 -0000 Author: mm Date: Sun Aug 19 09:59:41 2012 New Revision: 239389 URL: http://svn.freebsd.org/changeset/base/239389 Log: Backport fix for vendor issue #3085 3085 zfs diff panics, then panics in a loop on booting References: https://www.illumos.org/issues/3085 PR: kern/170763 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate (r13772) MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Aug 19 09:34:04 2012 (r239388) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Aug 19 09:59:41 2012 (r239389) @@ -3969,6 +3969,11 @@ dsl_dataset_user_release_sync(void *arg1 VERIFY(error == 0 || error == ENOENT); zapobj = ds->ds_phys->ds_userrefs_obj; VERIFY(0 == zap_remove(mos, zapobj, ra->htag, tx)); + + spa_history_log_internal(LOG_DS_USER_RELEASE, + dp->dp_spa, tx, "<%s> %lld dataset = %llu", + ra->htag, (longlong_t)refs, dsobj); + if (ds->ds_userrefs == 0 && ds->ds_phys->ds_num_children == 1 && DS_IS_DEFER_DESTROY(ds)) { struct dsl_ds_destroyarg dsda = {0}; @@ -3979,10 +3984,6 @@ dsl_dataset_user_release_sync(void *arg1 /* We already did the destroy_check */ dsl_dataset_destroy_sync(&dsda, tag, tx); } - - spa_history_log_internal(LOG_DS_USER_RELEASE, - dp->dp_spa, tx, "<%s> %lld dataset = %llu", - ra->htag, (longlong_t)refs, dsobj); } static int From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 10:34: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 6703D106566B; Sun, 19 Aug 2012 10:34:41 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FC5F8FC2C; Sun, 19 Aug 2012 10:34: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 q7JAYfl2070632; Sun, 19 Aug 2012 10:34:41 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JAYfUK070629; Sun, 19 Aug 2012 10:34:41 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208191034.q7JAYfUK070629@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 10:34: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: r239394 - 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: Sun, 19 Aug 2012 10:34:41 -0000 Author: mm Date: Sun Aug 19 10:34:40 2012 New Revision: 239394 URL: http://svn.freebsd.org/changeset/base/239394 Log: Update zfs(8) manpage with illumos version of "zfs diff" Illumos issue: 2399 zfs manual page does not document use of "zfs diff" References: https://www.illumos.org/issues/2399 PR: docs/170764 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Aug 19 10:33:31 2012 (r239393) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Aug 19 10:34:40 2012 (r239394) @@ -2480,6 +2480,8 @@ also have the 'create' ability and 'moun .Xc .It create Ta subcommand Ta Must also have the 'mount' ability .It destroy Ta subcommand Ta Must also have the 'mount' ability +.It diff Ta subcommand Ta Allows lookup of paths within a dataset given an +object number, and the ability to create snapshots necessary to 'zfs diff' .It hold Ta subcommand Ta Allows adding a user hold to a snapshot .It mount Ta subcommand Ta Allows mount/umount of Tn ZFS No datasets .It Xo promote Ta subcommand Ta Must @@ -2683,43 +2685,43 @@ descendent file systems. .Op Ar snapshot Ns | Ns Ar filesystem .Xc .Pp -Describes differences between a snapshot and a successor dataset. The -successor dataset can be a later snapshot or the current filesystem. -.Pp -The changed files are displayed including the change type. The change type -is displayed useing a single character. If a file or directory was renamed, -the old and the new names are displayed. -.Pp -The following change types can be displayed: -.Pp -.Bl -column -offset indent "CHARACTER" "CHANGE TYPE" -.It CHARACTER Ta CHANGE TYPE -.It \&+ Ta file was added -.It \&- Ta file was removed -.It \&M Ta file was modified -.It \&R Ta file was renamed +Display the difference between a snapshot of a given filesystem and another +snapshot of that filesystem from a later time or the current contents of the +filesystem. The first column is a character indicating the type of change, +the other columns indicate pathname, new pathname +.Pq in case of rename , +change in link count, and optionally file type and/or change time. +.Pp +The types of change are: +.Bl -column -offset 2n indent +.It \&- Ta path was removed +.It \&+ Ta path was added +.It \&M Ta path was modified +.It \&R Ta path was renamed .El .Bl -tag -width indent .It Fl F -Display a single letter for the file type in second to last column. -.Pp -The following file types can be displayed: +Display an indication of the type of file, in a manner similar to the +.Fl F +option of +.Xr ls 1 . .Pp -.Bl -column -offset indent "CHARACTER" "FILE TYPE" -.It CHARACTER Ta FILE TYPE -.It \&F Ta file -.It \&/ Ta directory +.Bl -column -offset 2n indent .It \&B Ta block device +.It \&C Ta character device +.It \&F Ta regular file +.It \&/ Ta directory .It \&@ Ta symbolic link .It \&= Ta socket .It \&> Ta door (not supported on Fx ) -.It \&| Ta FIFO (not supported on Fx ) -.It \&P Ta event portal (not supported on Fx ) +.It \&| Ta named pipe (not supported on Fx ) +.It \&P Ta event port (not supported on Fx ) .El .It Fl H -Machine-parseable output, fields separated a tab character. +Give more parseable tab-separated output, without header lines and without +arrows. .It Fl t -Display a change timestamp in the first column. +Display the path's inode change time as the first column of output. .El .It Xo .Nm @@ -3171,6 +3173,22 @@ Local+Descendent permissions on (tank/us group staff @pset,create,mount ------------------------------------------------------------- .Ed +.It Sy Example 22 Showing the differences between a snapshot and a ZFS Dataset +.Pp +The following example shows how to see what has changed between a prior +snapshot of a ZFS Dataset and its current state. The +.Fl F +option is used to indicate type information for the files affected. +.Pp +.Bd -literal -offset 2n +.Li # Ic zfs diff tank/test@before tank/test +M / /tank/test/ +M F /tank/test/linked (+1) +R F /tank/test/oldname -> /tank/test/newname +- F /tank/test/deleted ++ F /tank/test/created +M F /tank/test/modified +.Ed .El .Sh EXIT STATUS The following exit values are returned: From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 11:54: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 10FFC106564A; Sun, 19 Aug 2012 11:54:03 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFC008FC08; Sun, 19 Aug 2012 11:54: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 q7JBs2dA078817; Sun, 19 Aug 2012 11:54:02 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JBs2hc078815; Sun, 19 Aug 2012 11:54:02 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201208191154.q7JBs2hc078815@svn.freebsd.org> From: Randall Stewart Date: Sun, 19 Aug 2012 11:54: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: r239395 - 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: Sun, 19 Aug 2012 11:54:03 -0000 Author: rrs Date: Sun Aug 19 11:54:02 2012 New Revision: 239395 URL: http://svn.freebsd.org/changeset/base/239395 Log: Though I disagree, I conceed to jhb & Rui. Note that we still have a problem with this whole structure of locks and in_input.c [it does not lock which it should not, but this *can* lead to crashes]. (I have seen it in our SQA testbed.. besides the one with a refcnt issue that I will have SQA work on next week ;-) Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sun Aug 19 10:34:40 2012 (r239394) +++ head/sys/netinet/in.c Sun Aug 19 11:54:02 2012 (r239395) @@ -573,6 +573,7 @@ in_control(struct socket *so, u_long cmd } TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link); IF_ADDR_WUNLOCK(ifp); + ifa_free(&ia->ia_ifa); /* if_addrhead */ IN_IFADDR_WLOCK(); TAILQ_REMOVE(&V_in_ifaddrhead, ia, ia_link); @@ -596,7 +597,6 @@ in_control(struct socket *so, u_long cmd } else ifa_free(&iap->ia_ifa); - ifa_free(&ia->ia_ifa); /* if_addrhead */ ifa_free(&ia->ia_ifa); /* in_ifaddrhead */ out: if (ia != NULL) From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 11:58: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 7D9C6106566C; Sun, 19 Aug 2012 11:58:08 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4D91D8FC18; Sun, 19 Aug 2012 11:58:08 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 773F446B0A; Sun, 19 Aug 2012 07:58:02 -0400 (EDT) Date: Sun, 19 Aug 2012 12:58:02 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Randall Stewart In-Reply-To: <201208191154.q7JBs2hc078815@svn.freebsd.org> Message-ID: References: <201208191154.q7JBs2hc078815@svn.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, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239395 - 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: Sun, 19 Aug 2012 11:58:08 -0000 On Sun, 19 Aug 2012, Randall Stewart wrote: > Though I disagree, I conceed to jhb & Rui. Note > that we still have a problem with this whole structure of > locks and in_input.c [it does not lock which it should not, but > this *can* lead to crashes]. (I have seen it in our SQA > testbed.. besides the one with a refcnt issue that I will > have SQA work on next week ;-) I agree with John here -- these are seperate issues, and we need to get each part correct in isolation, not just in composition. Bjoern and I have been plotting a lock reduction exercise in the network stack for some time, based on a model Jeff Roberson and the Nokia guys used -- a global "config" lock, which would use our rmlock primitive. This would make address list synchronisation sufficiently affordable to use in ip_input(). However, it comes with a number of other issues that we need to consider, such as potential latency impacts of reconfiguration events, which have to be characterised before we commit to it, as well as potential issues with lock order. Recent rmlock improvements (e.g., with respect to WITNESS) make doing this work much more plausible. Hopefully this is something we'll get to in September. Robert From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 12:15: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 C713C106564A; Sun, 19 Aug 2012 12:15:58 +0000 (UTC) (envelope-from hans.petter.selasky@bitfrost.no) Received: from smtp01-out.isp.tdc.no (smtp01-out.isp.tdc.no [85.19.210.243]) by mx1.freebsd.org (Postfix) with ESMTP id 6074F8FC12; Sun, 19 Aug 2012 12:15:58 +0000 (UTC) Received: from mail.bitfrost.no (mail.bitfrost.no [85.19.79.136]) by smtp01-out.isp.tdc.no (Postfix) with ESMTP id 3X0HD20wDFz39F; Sun, 19 Aug 2012 14:15:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bitfrost.no From: =?windows-1252?Q?Hans_Petter_Selasky?= To: =?windows-1252?Q?Andrew_Turner?= Date: Sun, 19 Aug 2012 14:15:53 +0200 Mime-Version: 1.0 In-Reply-To: <20120819202622.6db6a8dd@fubar.geek.nz> References: <20120819202622.6db6a8dd@fubar.geek.nz> X-Priority: 3 (Normal) Message-Id: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "=?windows-1252?Q?svn-src-head=40freebsd.org?=" , "=?windows-1252?Q?svn-src-all=40freebsd.org?=" , "=?windows-1252?Q?src-committers=40freebsd.org?=" , =?windows-1252?Q?Hans_Petter_Selasky?= Subject: RE: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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: Sun, 19 Aug 2012 12:15:58 -0000 Hi,=0D=0A=0D=0A=A0=0D=0A=0D=0AWhat exactly is the driver the USB mass sto= rage device is attached to=3F=0D=0A=0D=0A=A0=0D=0A=0D=0AAnd the problem i= s the same using the latest FreeBSD version from -current=3F=0D=0A=0D=0A=A0= =0D=0A=0D=0AYou are certain that all parts of the kernel were rebuilt=3F=0D= =0A=0D=0A=A0=0D=0A=0D=0AAnd you are certain that it has nothing to do wit= h the FreeBSD version bump which is also part of this change=3F=0D=0A=0D=0A= =A0=0D=0A=0D=0AProbably we should move this thread to -current @=0D=0A=0D= =0A=A0=0D=0A=0D=0A--HPS=0D=0A=A0=0D=0A-----Original message-----=0D=0AFro= m:Andrew Turner =0D=0ASent:Sun 19-08-2012 10:27=0D=0A= Subject:Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller= sys=0D=0ATo:Hans Petter Selasky ;=20=0D= =0ACC:Hans Petter Selasky ; svn-src-head@freebsd.or= g; svn-src-all@freebsd.org; src-committers@freebsd.org;=20=0D=0AOn Sun, 1= 9 Aug 2012 09:39:11 +0200=0D=0AHans Petter Selasky =A0 wrote:=0D=0A=0D=0A> Hi,=0D=0A>=20=0D=0A> =A0=0D=0A>=20=0D=0A= > Have you stepped the versions=3F=0D=0AI did a binary search of the comm= its to find the revision that caused=0D=0Athe issue.=0D=0A=0D=0A> Are you= sure it is exactly this commit=3F=0D=0AI built with r239213 and the prob= lem went away, when I built with=0D=0Ar239214 it appeared again.=0D=0A=0D= =0AAndrew=0D=0A From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 17:39: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 5A487106566B; Sun, 19 Aug 2012 17:39:00 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from emx.nitro.dk (leto.nitro.dk [178.63.52.6]) by mx1.freebsd.org (Postfix) with ESMTP id D1D2B8FC22; Sun, 19 Aug 2012 17:38:59 +0000 (UTC) Received: from mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) by emx.nitro.dk (Postfix) with ESMTP id B8F342B43EA; Sun, 19 Aug 2012 17:38:58 +0000 (UTC) Received: from emx.nitro.dk ([127.0.1.2]) by mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) (amavisd-new, port 10024) with LMTP id 08izfVxnYxyq; Sun, 19 Aug 2012 17:38:56 +0000 (UTC) Received: from [192.168.4.24] (unknown [89.100.2.68]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by emx.nitro.dk (Postfix) with ESMTPSA id 3E9DC2B43E5; Sun, 19 Aug 2012 17:38:56 +0000 (UTC) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) From: "Simon L. B. Nielsen" In-Reply-To: Date: Sun, 19 Aug 2012 18:38:55 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <38287857-28FA-4042-911D-EE0DDC54D62F@FreeBSD.org> References: <201208180926.q7I9Qptp001696@svn.freebsd.org> To: Chris Rees X-Mailer: Apple Mail (2.1485) Cc: svn-src-head@freebsd.org, cvsadm@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Niclas Zeising Subject: Re: svn commit: r239364 - head/libexec/revnetgroup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Aug 2012 17:39:00 -0000 On 18 Aug 2012, at 13:01, Chris Rees wrote: > On 18 August 2012 12:58, Chris Rees wrote: >> On 18 August 2012 10:26, Niclas Zeising wrote: >>> Author: zeising (ports committer) >>=20 >> There's something wrong here-- shouldn't it say (ports, doc >> committer)? Looks like it's not checking doc/svnadmin/conf/access... >=20 > (replying to own message) >=20 > For example, Glen Barber appears correctly (and demonstrates that it > should be doc,ports committer): >=20 > = http://lists.freebsd.org/pipermail/svn-src-head/2012-August/039471.html The problem is that the access file exporter which the commit scripts = use for out of repo commits looks at /home/mail/*-access which are based = on CVS versions, and and doc isn't updated in CVS anymore newer = committers status isn't shown correctly. It's a TODO, but nobody has gotten around to fixing it yet. --=20 Simon L. B. Nielsen From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 19:17: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 B9D85106566B; Sun, 19 Aug 2012 19:17:55 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A43BC8FC08; Sun, 19 Aug 2012 19:17: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 q7JJHtFX024652; Sun, 19 Aug 2012 19:17:55 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJHtWO024650; Sun, 19 Aug 2012 19:17:55 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191917.q7JJHtWO024650@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:17: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: r239396 - head/gnu/usr.bin/gdb/arch/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: Sun, 19 Aug 2012 19:17:55 -0000 Author: andreast Date: Sun Aug 19 19:17:54 2012 New Revision: 239396 URL: http://svn.freebsd.org/changeset/base/239396 Log: Fix typo. Not a win in terms of functionality but in terms of completeness. Modified: head/gnu/usr.bin/gdb/arch/powerpc/config.h Modified: head/gnu/usr.bin/gdb/arch/powerpc/config.h ============================================================================== --- head/gnu/usr.bin/gdb/arch/powerpc/config.h Sun Aug 19 11:54:02 2012 (r239395) +++ head/gnu/usr.bin/gdb/arch/powerpc/config.h Sun Aug 19 19:17:54 2012 (r239396) @@ -175,7 +175,7 @@ /* nativefile */ #ifndef CROSS_DEBUGGER -#define GDB_NM_FILE config/ia64/nm-fbsd.h +#define GDB_NM_FILE config/powerpc/nm-fbsd.h #endif /* Define to 1 so gets a definition of anon_hdl. Works From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 19:31: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 AB2221065670; Sun, 19 Aug 2012 19:31:37 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95F5B8FC0C; Sun, 19 Aug 2012 19:31: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 q7JJVb10026037; Sun, 19 Aug 2012 19:31:37 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJVbAe026035; Sun, 19 Aug 2012 19:31:37 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191931.q7JJVbAe026035@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:31: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: r239397 - head/sys/dev/iicbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Aug 2012 19:31:37 -0000 Author: andreast Date: Sun Aug 19 19:31:36 2012 New Revision: 239397 URL: http://svn.freebsd.org/changeset/base/239397 Log: Do the ADC init only at startup and not during every sensor read call. This reduces the number of interrupts. Modified: head/sys/dev/iicbus/ad7417.c Modified: head/sys/dev/iicbus/ad7417.c ============================================================================== --- head/sys/dev/iicbus/ad7417.c Sun Aug 19 19:17:54 2012 (r239396) +++ head/sys/dev/iicbus/ad7417.c Sun Aug 19 19:31:36 2012 (r239397) @@ -104,6 +104,7 @@ struct ad7417_softc { uint32_t sc_addr; struct ad7417_sensor *sc_sensors; int sc_nsensors; + int init_done; }; static device_method_t ad7417_methods[] = { /* Device interface */ @@ -247,6 +248,9 @@ ad7417_init_adc(device_t dev, uint32_t a { uint8_t buf; int err; + struct ad7417_softc *sc; + + sc = device_get_softc(dev); adc741x_config = 0; /* Clear Config2 */ @@ -267,6 +271,8 @@ ad7417_init_adc(device_t dev, uint32_t a if (err < 0) return (-1); + sc->init_done = 1; + return (0); } @@ -430,10 +436,10 @@ ad7417_attach(device_t dev) if (sc->sc_sensors[i].type == ADC7417_TEMP_SENSOR) { unit = "temp"; - desc = "Sensor temp in C"; + desc = "sensor unit (C)"; } else { unit = "volt"; - desc = "Sensor Volt in V"; + desc = "sensor unit (mV)"; } /* I use i to pass the sensor id. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, @@ -584,9 +590,10 @@ ad7417_sensor_read(struct ad7417_sensor sc = device_get_softc(sens->dev); - /* Init the ADC. */ - if (ad7417_init_adc(sc->sc_dev, sc->sc_addr) < 0) - return (-1); + /* Init the ADC if not already done.*/ + if (!sc->init_done) + if (ad7417_init_adc(sc->sc_dev, sc->sc_addr) < 0) + return (-1); if (sens->type == ADC7417_TEMP_SENSOR) { if (ad7417_get_temp(sc->sc_dev, sc->sc_addr, &temp) < 0) From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 19:32: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 121F51065670; Sun, 19 Aug 2012 19:32:39 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F07628FC0C; Sun, 19 Aug 2012 19:32: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 q7JJWc1N026172; Sun, 19 Aug 2012 19:32:38 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJWcUn026170; Sun, 19 Aug 2012 19:32:38 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191932.q7JJWcUn026170@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:32: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: r239398 - head/sys/dev/iicbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Aug 2012 19:32:39 -0000 Author: andreast Date: Sun Aug 19 19:32:38 2012 New Revision: 239398 URL: http://svn.freebsd.org/changeset/base/239398 Log: Avoid using the degree symbol. Looks ugly on the console. Modified: head/sys/dev/iicbus/max6690.c Modified: head/sys/dev/iicbus/max6690.c ============================================================================== --- head/sys/dev/iicbus/max6690.c Sun Aug 19 19:31:36 2012 (r239397) +++ head/sys/dev/iicbus/max6690.c Sun Aug 19 19:32:38 2012 (r239398) @@ -251,7 +251,7 @@ max6690_start(void *xdev) struct max6690_softc *sc; struct sysctl_oid *oid, *sensroot_oid; struct sysctl_ctx_list *ctx; - char sysctl_name[32]; + char sysctl_desc[40], sysctl_name[32]; int i, j; device_t dev = (device_t)xdev; @@ -293,6 +293,8 @@ max6690_start(void *xdev) } sysctl_name[j] = 0; + sprintf(sysctl_desc,"%s %s", sc->sc_sensors[i].therm.name, + "(C)"); oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), OID_AUTO, sysctl_name, CTLFLAG_RD, 0, @@ -300,8 +302,7 @@ max6690_start(void *xdev) /* I use i to pass the sensor id. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "temp", CTLTYPE_INT | CTLFLAG_RD, dev, i % 2, - max6690_sensor_sysctl, "IK", - "Sensor Temp in °C"); + max6690_sensor_sysctl, "IK", sysctl_desc); } /* Dump sensor location & ID. */ From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 19:34: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 63F8E106566C; Sun, 19 Aug 2012 19:34:11 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3441E8FC08; Sun, 19 Aug 2012 19:34: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 q7JJYBrD026374; Sun, 19 Aug 2012 19:34:11 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJYBvJ026372; Sun, 19 Aug 2012 19:34:11 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191934.q7JJYBvJ026372@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:34: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: r239399 - head/sys/dev/iicbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Aug 2012 19:34:11 -0000 Author: andreast Date: Sun Aug 19 19:34:10 2012 New Revision: 239399 URL: http://svn.freebsd.org/changeset/base/239399 Log: Unify the sysctl description with the other PowerMac temperature drivers. Modified: head/sys/dev/iicbus/ds1775.c Modified: head/sys/dev/iicbus/ds1775.c ============================================================================== --- head/sys/dev/iicbus/ds1775.c Sun Aug 19 19:32:38 2012 (r239398) +++ head/sys/dev/iicbus/ds1775.c Sun Aug 19 19:34:10 2012 (r239399) @@ -172,12 +172,11 @@ ds1775_start(void *xdev) { phandle_t child; struct ds1775_softc *sc; - struct sysctl_oid *sensroot_oid; + struct sysctl_oid *oid, *sensroot_oid; struct sysctl_ctx_list *ctx; ssize_t plen; int i; char sysctl_name[40], sysctl_desc[40]; - const char *units; device_t dev = (device_t)xdev; @@ -186,7 +185,9 @@ ds1775_start(void *xdev) child = ofw_bus_get_node(dev); ctx = device_get_sysctl_ctx(dev); - sensroot_oid = device_get_sysctl_tree(dev); + sensroot_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensor", + CTLFLAG_RD, 0, "DS1775 Sensor Information"); if (OF_getprop(child, "hwsensor-zone", &sc->sc_sensor.zone, sizeof(int)) < 0) @@ -194,7 +195,6 @@ ds1775_start(void *xdev) plen = OF_getprop(child, "hwsensor-location", sc->sc_sensor.name, sizeof(sc->sc_sensor.name)); - units = "C"; if (plen == -1) { strcpy(sysctl_name, "sensor"); @@ -221,9 +221,11 @@ ds1775_start(void *xdev) (int (*)(struct pmac_therm *sc))(ds1775_sensor_read); pmac_thermal_sensor_register(&sc->sc_sensor); - sprintf(sysctl_desc,"%s (%s)", sc->sc_sensor.name, units); - SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(sensroot_oid), OID_AUTO, - sysctl_name, + sprintf(sysctl_desc,"%s %s", sc->sc_sensor.name, "(C)"); + oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), + OID_AUTO, sysctl_name, CTLFLAG_RD, 0, + "Sensor Information"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "temp", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, 0, ds1775_sensor_sysctl, "IK", sysctl_desc); From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 19:37: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 1C067106564A; Sun, 19 Aug 2012 19:37:15 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F01598FC12; Sun, 19 Aug 2012 19:37: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 q7JJbE37026708; Sun, 19 Aug 2012 19:37:14 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJbEqC026705; Sun, 19 Aug 2012 19:37:14 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191937.q7JJbEqC026705@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:37: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: r239400 - in head/sys: conf dev/iicbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Aug 2012 19:37:15 -0000 Author: andreast Date: Sun Aug 19 19:37:14 2012 New Revision: 239400 URL: http://svn.freebsd.org/changeset/base/239400 Log: Add a new temperature driver for certain PowerMacs. Found here on my Quad G5. Added: head/sys/dev/iicbus/ds1631.c (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Aug 19 19:34:10 2012 (r239399) +++ head/sys/conf/files.powerpc Sun Aug 19 19:37:14 2012 (r239400) @@ -32,6 +32,7 @@ dev/fb/fb.c optional sc dev/fdt/fdt_powerpc.c optional fdt dev/hwpmc/hwpmc_powerpc.c optional hwpmc dev/iicbus/ad7417.c optional ad7417 powermac +dev/iicbus/ds1631.c optional ds1631 powermac dev/iicbus/ds1775.c optional ds1775 powermac dev/iicbus/max6690.c optional max6690 powermac dev/kbd/kbd.c optional sc Added: head/sys/dev/iicbus/ds1631.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/ds1631.c Sun Aug 19 19:37:14 2012 (r239400) @@ -0,0 +1,413 @@ +/*- + * Copyright (c) 2012 Andreas Tobler + * 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 ``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 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 + +/* Sensor: Maxim DS1631 */ + +#define DS1631_STOP 0x22 +#define DS1631_START 0x51 +#define DS1631_RESET 0x54 +#define DS1631_TEMP 0xAA +#define DS1631_CONTROL 0xAC +#define DS1631_CONTROL_1SHOT 0x01 +#define DS1631_CONTROL_9BIT 0x00 +#define DS1631_CONTROL_10BIT 0x04 +#define DS1631_CONTROL_11BIT 0x08 +#define DS1631_CONTROL_12BIT 0x0C + + + +/* Regular bus attachment functions */ +static int ds1631_probe(device_t); +static int ds1631_attach(device_t); + +struct ds1631_softc { + struct pmac_therm sc_sensor; + device_t sc_dev; + struct intr_config_hook enum_hook; + uint32_t sc_addr; + uint32_t init_done; +}; + +struct write_data { + uint8_t reg; + uint8_t val; +}; + +struct read_data { + uint8_t reg; + uint16_t val; +}; + +/* Utility functions */ +static int ds1631_sensor_read(struct ds1631_softc *sc); +static int ds1631_sensor_sysctl(SYSCTL_HANDLER_ARGS); +static void ds1631_start(void *xdev); +static int ds1631_read_1(device_t dev, uint32_t addr, uint8_t reg, + uint8_t *data); +static int ds1631_read_2(device_t dev, uint32_t addr, uint8_t reg, + uint16_t *data); +static int ds1631_write(device_t dev, uint32_t addr, uint8_t reg, + uint8_t *buff, int len); + +static device_method_t ds1631_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ds1631_probe), + DEVMETHOD(device_attach, ds1631_attach), + { 0, 0 }, +}; + +static driver_t ds1631_driver = { + "ds1631", + ds1631_methods, + sizeof(struct ds1631_softc) +}; + +static devclass_t ds1631_devclass; + +DRIVER_MODULE(ds1631, iicbus, ds1631_driver, ds1631_devclass, 0, 0); + +static int +ds1631_write(device_t dev, uint32_t addr, uint8_t reg, uint8_t *buff, int len) +{ + uint8_t buf[4]; + int try = 0; + + struct iic_msg msg[] = { + { addr, IIC_M_WR, 0, buf } + }; + + /* Prepare the write msg. */ + msg[0].len = len + 1; + buf[0] = reg; + memcpy(buf + 1, buff, len); + + for (;;) + { + if (iicbus_transfer(dev, msg, 1) == 0) + return (0); + if (++try > 5) { + device_printf(dev, "iicbus write failed\n"); + return (-1); + } + pause("ds1631_write", hz); + } +} + +static int +ds1631_read_1(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data) +{ + uint8_t buf[4]; + int err, try = 0; + + struct iic_msg msg[2] = { + { addr, IIC_M_WR, 1, ® }, + { addr, IIC_M_RD, 1, buf }, + }; + + for (;;) + { + err = iicbus_transfer(dev, msg, 2); + if (err != 0) + goto retry; + + *data = *((uint8_t*)buf); + return (0); + retry: + if (++try > 5) { + device_printf(dev, "iicbus read failed\n"); + return (-1); + } + pause("ds1631_read_1", hz); + } +} + +static int +ds1631_read_2(device_t dev, uint32_t addr, uint8_t reg, uint16_t *data) +{ + uint8_t buf[4]; + int err, try = 0; + + struct iic_msg msg[2] = { + { addr, IIC_M_WR, 1, ® }, + { addr, IIC_M_RD, 2, buf }, + }; + + for (;;) + { + err = iicbus_transfer(dev, msg, 2); + if (err != 0) + goto retry; + + *data = *((uint16_t*)buf); + return (0); + retry: + if (++try > 5) { + device_printf(dev, "iicbus read failed\n"); + return (-1); + } + pause("ds1631_read_2", hz); + } +} + +static int +ds1631_probe(device_t dev) +{ + const char *name, *compatible; + struct ds1631_softc *sc; + + name = ofw_bus_get_name(dev); + compatible = ofw_bus_get_compat(dev); + + if (!name) + return (ENXIO); + + if (strcmp(name, "temp-monitor") != 0 || + strcmp(compatible, "ds1631") != 0 ) + return (ENXIO); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + device_set_desc(dev, "Temp-Monitor DS1631"); + + return (0); +} + +static int +ds1631_attach(device_t dev) +{ + struct ds1631_softc *sc; + + sc = device_get_softc(dev); + + sc->enum_hook.ich_func = ds1631_start; + sc->enum_hook.ich_arg = dev; + + /* + * We have to wait until interrupts are enabled. I2C read and write + * only works if the interrupts are available. + * The unin/i2c is controlled by the htpic on unin. But this is not + * the master. The openpic on mac-io is controlling the htpic. + * This one gets attached after the mac-io probing and then the + * interrupts will be available. + */ + + if (config_intrhook_establish(&sc->enum_hook) != 0) + return (ENOMEM); + + return (0); +} +static int +ds1631_init(device_t dev, uint32_t addr) +{ + uint8_t conf; + int err; + struct ds1631_softc *sc; + + sc = device_get_softc(dev); + + err = ds1631_read_1(dev, addr, DS1631_CONTROL, &conf); + if (err < 0) { + device_printf(dev, "ds1631 read config failed: %x\n", err); + return (-1); + } + + /* Stop the conversion if not in 1SHOT mode. */ + if (conf & ~DS1631_CONTROL_1SHOT) + err = ds1631_write(dev, addr, DS1631_STOP, &conf, 0); + + /* + * Setup the resolution, 10-bit is enough. Each bit increase in + * resolution doubles the conversion time. + */ + conf = DS1631_CONTROL_10BIT; + + err = ds1631_write(dev, addr, DS1631_CONTROL, &conf, 1); + if (err < 0) { + device_printf(dev, "ds1631 write config failed: %x\n", err); + return (-1); + } + + /* And now start....*/ + err = ds1631_write(dev, addr, DS1631_START, &conf, 0); + + if (err < 0) { + device_printf(dev, "ds1631 write start failed: %x\n", err); + return (-1); + } + + sc->init_done = 1; + + return (0); + +} +static void +ds1631_start(void *xdev) +{ + phandle_t child, node; + struct ds1631_softc *sc; + struct sysctl_oid *oid, *sensroot_oid; + struct sysctl_ctx_list *ctx; + ssize_t plen; + int i; + char sysctl_desc[40], sysctl_name[40]; + + device_t dev = (device_t)xdev; + + sc = device_get_softc(dev); + + child = ofw_bus_get_node(dev); + + ctx = device_get_sysctl_ctx(dev); + sensroot_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensor", + CTLFLAG_RD, 0, "DS1631 Sensor Information"); + + if (OF_getprop(child, "hwsensor-zone", &sc->sc_sensor.zone, + sizeof(int)) < 0) + sc->sc_sensor.zone = 0; + + plen = OF_getprop(child, "hwsensor-location", sc->sc_sensor.name, + sizeof(sc->sc_sensor.name)); + if (plen == -1) { + /* + * Ok, no hwsensor-location property, so let's look for a + * location property on a sub node. + */ + for (node = OF_child(child); node; node = OF_peer(node)) + plen = OF_getprop(node, "location", sc->sc_sensor.name, + sizeof(sc->sc_sensor.name)); + } + + if (plen == -1) { + strcpy(sysctl_name, "sensor"); + } else { + for (i = 0; i < strlen(sc->sc_sensor.name); i++) { + sysctl_name[i] = tolower(sc->sc_sensor.name[i]); + if (isspace(sysctl_name[i])) + sysctl_name[i] = '_'; + } + sysctl_name[i] = 0; + } + + /* Make up target temperatures. These are low, for the drive bay. */ + if (sc->sc_sensor.zone == 0) { + sc->sc_sensor.target_temp = 400 + ZERO_C_TO_K; + sc->sc_sensor.max_temp = 500 + ZERO_C_TO_K; + } else { + sc->sc_sensor.target_temp = 300 + ZERO_C_TO_K; + sc->sc_sensor.max_temp = 500 + ZERO_C_TO_K; + } + + sc->sc_sensor.read = + (int (*)(struct pmac_therm *sc))(ds1631_sensor_read); + pmac_thermal_sensor_register(&sc->sc_sensor); + + sprintf(sysctl_desc,"%s %s", sc->sc_sensor.name, "(C)"); + oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), + OID_AUTO, sysctl_name, CTLFLAG_RD, 0, + "Sensor Information"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "temp", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, + 0, ds1631_sensor_sysctl, "IK", sysctl_desc); + + config_intrhook_disestablish(&sc->enum_hook); +} + +static int +ds1631_sensor_read(struct ds1631_softc *sc) +{ + uint16_t buf[2]; + uint16_t read; + int err; + + if (!sc->init_done) + ds1631_init(sc->sc_dev, sc->sc_addr); + + err = ds1631_read_2(sc->sc_dev, sc->sc_addr, DS1631_TEMP, buf); + if (err < 0) { + device_printf(sc->sc_dev, "ds1631 read TEMP failed: %x\n", err); + return (-1); + } + + read = *((int16_t *)buf); + + /* + * The default mode of the ADC is 12-bit, the resolution is 0.0625 C + * per bit. The temperature is in tenth kelvin. + * We use 10-bit resolution which seems enough, resolution is 0.25 C. + */ + + return (((int16_t)(read) >> 6) * 25 / 10 + ZERO_C_TO_K); +} + +static int +ds1631_sensor_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev; + struct ds1631_softc *sc; + int error; + unsigned int temp; + + dev = arg1; + sc = device_get_softc(dev); + + temp = ds1631_sensor_read(sc); + if (temp < 0) + return (EIO); + + error = sysctl_handle_int(oidp, &temp, 0, req); + + return (error); +} From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 19:40: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 46DAD106566C; Sun, 19 Aug 2012 19:40:34 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FF2E8FC08; Sun, 19 Aug 2012 19:40: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 q7JJeYcv027111; Sun, 19 Aug 2012 19:40:34 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJeXi3027107; Sun, 19 Aug 2012 19:40:33 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191940.q7JJeXi3027107@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:40: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: r239401 - in head/sys: conf dev/sound/macio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Aug 2012 19:40:34 -0000 Author: andreast Date: Sun Aug 19 19:40:33 2012 New Revision: 239401 URL: http://svn.freebsd.org/changeset/base/239401 Log: Add a new sound driver for PowerMacs, found here on my Quad G5. It allows simple playback and volume control like the other Mac drivers, not more. Added: head/sys/dev/sound/macio/onyx.c (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Aug 19 19:37:14 2012 (r239400) +++ head/sys/conf/files.powerpc Sun Aug 19 19:40:33 2012 (r239401) @@ -54,6 +54,7 @@ dev/sec/sec.c optional sec mpc85xx dev/sound/macio/aoa.c optional snd_davbus | snd_ai2s powermac dev/sound/macio/davbus.c optional snd_davbus powermac dev/sound/macio/i2s.c optional snd_ai2s powermac +dev/sound/macio/onyx.c optional snd_ai2s iicbus powermac dev/sound/macio/snapper.c optional snd_ai2s iicbus powermac dev/sound/macio/tumbler.c optional snd_ai2s iicbus powermac dev/syscons/scgfbrndr.c optional sc Added: head/sys/dev/sound/macio/onyx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sound/macio/onyx.c Sun Aug 19 19:40:33 2012 (r239401) @@ -0,0 +1,315 @@ +/*- + * Copyright 2012 by Andreas Tobler. 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 ``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 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$ + */ + +/* + * Apple PCM3052 aka Onyx audio codec. + * + * Datasheet: http://www.ti.com/product/pcm3052a + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + +#include + +#include "mixer_if.h" + +extern kobj_class_t i2s_mixer_class; +extern device_t i2s_mixer; + +struct onyx_softc +{ + device_t sc_dev; + uint32_t sc_addr; +}; + +static int onyx_probe(device_t); +static int onyx_attach(device_t); +static int onyx_init(struct snd_mixer *m); +static int onyx_uninit(struct snd_mixer *m); +static int onyx_reinit(struct snd_mixer *m); +static int onyx_set(struct snd_mixer *m, unsigned dev, unsigned left, + unsigned right); +static u_int32_t onyx_setrecsrc(struct snd_mixer *m, u_int32_t src); + +static device_method_t onyx_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, onyx_probe), + DEVMETHOD(device_attach, onyx_attach), + { 0, 0 } +}; + +static driver_t onyx_driver = { + "onyx", + onyx_methods, + sizeof(struct onyx_softc) +}; +static devclass_t onyx_devclass; + +DRIVER_MODULE(onyx, iicbus, onyx_driver, onyx_devclass, 0, 0); +MODULE_VERSION(onyx, 1); +MODULE_DEPEND(onyx, iicbus, 1, 1, 1); + +static kobj_method_t onyx_mixer_methods[] = { + KOBJMETHOD(mixer_init, onyx_init), + KOBJMETHOD(mixer_uninit, onyx_uninit), + KOBJMETHOD(mixer_reinit, onyx_reinit), + KOBJMETHOD(mixer_set, onyx_set), + KOBJMETHOD(mixer_setrecsrc, onyx_setrecsrc), + KOBJMETHOD_END +}; + +MIXER_DECLARE(onyx_mixer); + +#define PCM3052_IICADDR 0x8C /* Hard-coded I2C slave addr */ + +/* + * PCM3052 registers. + * Numbering in decimal as used in the data sheet. + */ +#define PCM3052_REG_LEFT_ATTN 65 +#define PCM3052_REG_RIGHT_ATTN 66 +#define PCM3052_REG_CONTROL 67 +#define PCM3052_MRST (1 << 7) +#define PCM3052_SRST (1 << 6) +#define PCM3052_REG_DAC_CONTROL 68 +#define PCM3052_OVR1 (1 << 6) +#define PCM3052_MUTE_L (1 << 1) +#define PCM3052_MUTE_R (1 << 0) +#define PCM3052_REG_DAC_DEEMPH 69 +#define PCM3052_REG_DAC_FILTER 70 +#define PCM3052_DAC_FILTER_ALWAYS (1 << 2) +#define PCM3052_REG_OUT_PHASE 71 +#define PCM3052_REG_ADC_CONTROL 72 +#define PCM3052_REG_ADC_HPF_BP 75 +#define PCM3052_HPF_ALWAYS (1 << 2) +#define PCM3052_REG_INFO_1 77 +#define PCM3052_REG_INFO_2 78 +#define PCM3052_REG_INFO_3 79 +#define PCM3052_REG_INFO_4 80 + +struct onyx_reg { + u_char LEFT_ATTN; + u_char RIGHT_ATTN; + u_char CONTROL; + u_char DAC_CONTROL; + u_char DAC_DEEMPH; + u_char DAC_FILTER; + u_char OUT_PHASE; + u_char ADC_CONTROL; + u_char ADC_HPF_BP; + u_char INFO_1; + u_char INFO_2; + u_char INFO_3; + u_char INFO_4; +}; + +static const struct onyx_reg onyx_initdata = { + 0x80, /* LEFT_ATTN, Mute default */ + 0x80, /* RIGHT_ATTN, Mute default */ + PCM3052_MRST | PCM3052_SRST, /* CONTROL */ + 0, /* DAC_CONTROL */ + 0, /* DAC_DEEMPH */ + PCM3052_DAC_FILTER_ALWAYS, /* DAC_FILTER */ + 0, /* OUT_PHASE */ + (-1 /* dB */ + 8) & 0xf, /* ADC_CONTROL */ + PCM3052_HPF_ALWAYS, /* ADC_HPF_BP */ + (1 << 2), /* INFO_1 */ + 2, /* INFO_2, */ + 0, /* INFO_3, CLK 0 (level II), + SF 0 (44.1 kHz) */ + 1 /* INFO_4, VALIDL/R 0, + WL 24-bit depth */ +}; + +static int +onyx_write(struct onyx_softc *sc, uint8_t reg, const uint8_t value) +{ + u_int size; + uint8_t buf[16]; + + struct iic_msg msg[] = { + { sc->sc_addr, IIC_M_WR, 0, buf } + }; + + size = 1; + msg[0].len = size + 1; + buf[0] = reg; + buf[1] = value; + + iicbus_transfer(sc->sc_dev, msg, 1); + + return (0); +} + +static int +onyx_probe(device_t dev) +{ + const char *name, *compat; + + name = ofw_bus_get_name(dev); + if (name == NULL) + return (ENXIO); + + if (strcmp(name, "codec") == 0) { + if (iicbus_get_addr(dev) != PCM3052_IICADDR) + return (ENXIO); + } else if (strcmp(name, "codec") == 0) { + compat = ofw_bus_get_compat(dev); + if (compat == NULL || strcmp(compat, "pcm3052") != 0) + return (ENXIO); + } else + return (ENXIO); + + device_set_desc(dev, "Texas Instruments PCM3052 Audio Codec"); + return (0); +} + +static int +onyx_attach(device_t dev) +{ + struct onyx_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + i2s_mixer_class = &onyx_mixer_class; + i2s_mixer = dev; + + return (0); +} + +static int +onyx_init(struct snd_mixer *m) +{ + struct onyx_softc *sc; + u_int x = 0; + + sc = device_get_softc(mix_getdevinfo(m)); + + onyx_write(sc, PCM3052_REG_LEFT_ATTN, onyx_initdata.LEFT_ATTN); + onyx_write(sc, PCM3052_REG_RIGHT_ATTN, onyx_initdata.RIGHT_ATTN); + onyx_write(sc, PCM3052_REG_CONTROL, onyx_initdata.CONTROL); + onyx_write(sc, PCM3052_REG_DAC_CONTROL, + onyx_initdata.DAC_CONTROL); + onyx_write(sc, PCM3052_REG_DAC_DEEMPH, onyx_initdata.DAC_DEEMPH); + onyx_write(sc, PCM3052_REG_DAC_FILTER, onyx_initdata.DAC_FILTER); + onyx_write(sc, PCM3052_REG_OUT_PHASE, onyx_initdata.OUT_PHASE); + onyx_write(sc, PCM3052_REG_ADC_CONTROL, + onyx_initdata.ADC_CONTROL); + onyx_write(sc, PCM3052_REG_ADC_HPF_BP, onyx_initdata.ADC_HPF_BP); + onyx_write(sc, PCM3052_REG_INFO_1, onyx_initdata.INFO_1); + onyx_write(sc, PCM3052_REG_INFO_2, onyx_initdata.INFO_2); + onyx_write(sc, PCM3052_REG_INFO_3, onyx_initdata.INFO_3); + onyx_write(sc, PCM3052_REG_INFO_4, onyx_initdata.INFO_4); + + x |= SOUND_MASK_VOLUME; + mix_setdevs(m, x); + + return (0); +} + +static int +onyx_uninit(struct snd_mixer *m) +{ + return (0); +} + +static int +onyx_reinit(struct snd_mixer *m) +{ + return (0); +} + +static int +onyx_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) +{ + struct onyx_softc *sc; + struct mtx *mixer_lock; + int locked; + uint8_t l, r; + + sc = device_get_softc(mix_getdevinfo(m)); + mixer_lock = mixer_get_lock(m); + locked = mtx_owned(mixer_lock); + + switch (dev) { + case SOUND_MIXER_VOLUME: + + /* + * We need to unlock the mixer lock because iicbus_transfer() + * may sleep. The mixer lock itself is unnecessary here + * because it is meant to serialize hardware access, which + * is taken care of by the I2C layer, so this is safe. + */ + if (left > 100 || right > 100) + return (0); + + l = left + 128; + r = right + 128; + + if (locked) + mtx_unlock(mixer_lock); + + onyx_write(sc, PCM3052_REG_LEFT_ATTN, l); + onyx_write(sc, PCM3052_REG_RIGHT_ATTN, r); + + if (locked) + mtx_lock(mixer_lock); + + return (left | (right << 8)); + } + + return (0); +} + +static u_int32_t +onyx_setrecsrc(struct snd_mixer *m, u_int32_t src) +{ + return (0); +} From owner-svn-src-head@FreeBSD.ORG Sun Aug 19 19:44: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 32F49106564A; Sun, 19 Aug 2012 19:44:14 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 054368FC15; Sun, 19 Aug 2012 19:44: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 q7JJiDlp027516; Sun, 19 Aug 2012 19:44:13 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJiDCl027512; Sun, 19 Aug 2012 19:44:13 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191944.q7JJiDCl027512@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:44: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: r239402 - head/sys/powerpc/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: Sun, 19 Aug 2012 19:44:14 -0000 Author: andreast Date: Sun Aug 19 19:44:13 2012 New Revision: 239402 URL: http://svn.freebsd.org/changeset/base/239402 Log: Add the ds1631 temperature driver. Modified: head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/NOTES Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun Aug 19 19:40:33 2012 (r239401) +++ head/sys/powerpc/conf/GENERIC Sun Aug 19 19:44:13 2012 (r239402) @@ -190,6 +190,7 @@ device fwe # Ethernet over FireWire (n device iicbus # I2C bus code device kiic # Keywest I2C device ad7417 # PowerMac7,2 temperature sensor +device ds1631 # PowerMac11,2 temperature sensor device ds1775 # PowerMac7,2 temperature sensor device fcu # Apple Fan Control Unit device max6690 # PowerMac7,2 temperature sensor Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Sun Aug 19 19:40:33 2012 (r239401) +++ head/sys/powerpc/conf/GENERIC64 Sun Aug 19 19:44:13 2012 (r239402) @@ -188,6 +188,7 @@ device fwe # Ethernet over FireWire (n device iicbus # I2C bus code device kiic # Keywest I2C device ad7417 # PowerMac7,2 temperature sensor +device ds1631 # PowerMac11,2 temperature sensor device ds1775 # PowerMac7,2 temperature sensor device fcu # Apple Fan Control Unit device max6690 # PowerMac7,2 temperature sensor Modified: head/sys/powerpc/conf/NOTES ============================================================================== --- head/sys/powerpc/conf/NOTES Sun Aug 19 19:40:33 2012 (r239401) +++ head/sys/powerpc/conf/NOTES Sun Aug 19 19:44:13 2012 (r239402) @@ -41,6 +41,7 @@ device ofwd # Open Firmware disks device adb # Apple Desktop Bus device cuda # VIA-CUDA ADB interface device ad7417 # PowerMac7,2 temperature sensor +device ds1631 # PowerMac11,2 temperature sensor device ds1775 # PowerMac7,2 temperature sensor device fcu # Apple Fan Control Unit device max6690 # PowerMac7,2 temperature sensor From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 05:47:08 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 68654106564A; Mon, 20 Aug 2012 05:47:08 +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 52CF28FC14; Mon, 20 Aug 2012 05:47:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7K5l8bM090327; Mon, 20 Aug 2012 05:47:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7K5l8K4090325; Mon, 20 Aug 2012 05:47:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208200547.q7K5l8K4090325@svn.freebsd.org> From: Adrian Chadd Date: Mon, 20 Aug 2012 05:47: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: r239408 - 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, 20 Aug 2012 05:47:08 -0000 Author: adrian Date: Mon Aug 20 05:47:07 2012 New Revision: 239408 URL: http://svn.freebsd.org/changeset/base/239408 Log: Make sure all of the buffers are printed, rather than (n-1). Modified: head/sys/dev/ath/if_ath_debug.c Modified: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- head/sys/dev/ath/if_ath_debug.c Sun Aug 19 21:31:47 2012 (r239407) +++ head/sys/dev/ath/if_ath_debug.c Mon Aug 20 05:47:07 2012 (r239408) @@ -147,11 +147,9 @@ ath_printtxbuf_edma(struct ath_softc *sc * Assume the TX map size is 4 for now and only walk * the appropriate number of segments. */ - n = bf->bf_nseg / 4; - if (n == 0) - n = 1; + n = (bf->bf_nseg / 4) + 1; - printf("Q%u[%3u]", qnum, ix); + printf("Q%u[%3u] (nseg=%d)", qnum, ix, bf->bf_nseg); while (bf != NULL) { /* * XXX For now, assume the txmap size is 4. From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 06:02: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 3E1F2106566C; Mon, 20 Aug 2012 06:02:10 +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 109568FC0C; Mon, 20 Aug 2012 06:02: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 q7K629up091879; Mon, 20 Aug 2012 06:02:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7K62942091877; Mon, 20 Aug 2012 06:02:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208200602.q7K62942091877@svn.freebsd.org> From: Adrian Chadd Date: Mon, 20 Aug 2012 06:02: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: r239409 - 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, 20 Aug 2012 06:02:10 -0000 Author: adrian Date: Mon Aug 20 06:02:09 2012 New Revision: 239409 URL: http://svn.freebsd.org/changeset/base/239409 Log: Advance the descriptor pointer by sc->sc_tx_desclen bytes, rather than sizeof(struct ath_desc). This isn't correct for EDMA TX descriptors. This popped up during iperf tests. Ping tests never created frames that had enough segments to overflow into a second descriptor. However, an iperf TCP test would do that after a few seconds; the second descriptor would almost always certainly have garbage. Tested: * AR9380, STA mode * AR9280, STA mode (802.11n TX, legacy TX) 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 Aug 20 05:47:07 2012 (r239408) +++ head/sys/dev/ath/if_ath_tx.c Mon Aug 20 06:02:09 2012 (r239409) @@ -301,12 +301,13 @@ static void ath_tx_chaindesclist(struct ath_softc *sc, struct ath_buf *bf) { struct ath_hal *ah = sc->sc_ah; - struct ath_desc *ds, *ds0; + char *ds, *ds0; int i, bp, dsp; HAL_DMA_ADDR bufAddrList[4]; uint32_t segLenList[4]; int numTxMaps = 1; int isFirstDesc = 1; + int qnum = 0; /* XXX update */ /* * XXX There's txdma and txdma_mgmt; the descriptor @@ -332,7 +333,7 @@ ath_tx_chaindesclist(struct ath_softc *s * For EDMA and later chips ensure the TX map is fully populated * before advancing to the next descriptor. */ - ds0 = ds = bf->bf_desc; + ds0 = ds = (char *) bf->bf_desc; bp = dsp = 0; bzero(bufAddrList, sizeof(bufAddrList)); bzero(segLenList, sizeof(segLenList)); @@ -354,9 +355,9 @@ ath_tx_chaindesclist(struct ath_softc *s bp = 0; if (i == bf->bf_nseg - 1) - ath_hal_settxdesclink(ah, ds, 0); + ath_hal_settxdesclink(ah, (struct ath_desc *) ds, 0); else - ath_hal_settxdesclink(ah, ds, + ath_hal_settxdesclink(ah, (struct ath_desc *) ds, bf->bf_daddr + dd->dd_descsize * (dsp + 1)); /* @@ -365,26 +366,24 @@ ath_tx_chaindesclist(struct ath_softc *s * it may actually be pointing to the multicast software * TXQ id. These must be fixed! */ - ath_hal_filltxdesc(ah, ds + ath_hal_filltxdesc(ah, (struct ath_desc *) ds , bufAddrList , segLenList , bf->bf_descid /* XXX desc id */ , bf->bf_state.bfs_txq->axq_qnum /* XXX multicast? */ , isFirstDesc /* first segment */ , i == bf->bf_nseg - 1 /* last segment */ - , ds0 /* first descriptor */ + , (struct ath_desc *) ds0 /* first descriptor */ ); isFirstDesc = 0; - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: %d: %08x %08x %08x %08x %08x %08x\n", - __func__, i, ds->ds_link, ds->ds_data, - ds->ds_ctl0, ds->ds_ctl1, ds->ds_hw[0], ds->ds_hw[1]); - bf->bf_lastds = ds; + if (sc->sc_debug & ATH_DEBUG_XMIT) + ath_printtxbuf(sc, bf, qnum, 0, 0); + bf->bf_lastds = (struct ath_desc *) ds; /* * Don't forget to skip to the next descriptor. */ - ds++; + ds += sc->sc_tx_desclen; dsp++; /* From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 06:11: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 D5F0D1065673; Mon, 20 Aug 2012 06:11: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 A13118FC12; Mon, 20 Aug 2012 06:11: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 q7K6B4m4092846; Mon, 20 Aug 2012 06:11:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7K6B4jC092844; Mon, 20 Aug 2012 06:11:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208200611.q7K6B4jC092844@svn.freebsd.org> From: Adrian Chadd Date: Mon, 20 Aug 2012 06:11: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: r239410 - 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, 20 Aug 2012 06:11:05 -0000 Author: adrian Date: Mon Aug 20 06:11:04 2012 New Revision: 239410 URL: http://svn.freebsd.org/changeset/base/239410 Log: Flesh out some initial EDMA TX FIFO fill, complete and refill routines. Note: This is totally sub-optimal and a work in progress. * Support filling an empty FIFO TXQ with frames from the ath_buf queue in the ath_txq list. However, since there's (currently) no clean, easy way to separate the frames that are in the FIFO versus just waiting, the code waits for the FIFO to be totally empty before it attempts to queue more. This is highly sub-optimal but is enough to get the ball rolling. * A _lot_ of the code assumes that the TX status is filled out in the struct ath_buf bf_status field. So for now, memcpy() the completion over. * None of the TX drain / reset routines will attempt to complete completed frames before draining, so it can't be used for 802.11n TX aggregation. (This won't work anyway, as the aggregation TX descriptor API hasn't yet been converted; and that'll happen in some future commits.) * Fix an issue where the FIFO counter wasn't being incremented, leading to the queue logic just plain not working. * HAL_EIO means "descriptor wasn't valid", versus "not finished, don't continue." So don't stop processing descriptors when HAL_EIO is hit. * Don't service frame completion from the beacon queue. It isn't currently fully setup like a real queue and the first attempt at accessing the queue lock will panic the kernel. Tested: * AR9380, STA mode This commit is brought to you by said AR9380 in STA mode. Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Mon Aug 20 06:02:09 2012 (r239409) +++ head/sys/dev/ath/if_ath_tx_edma.c Mon Aug 20 06:11:04 2012 (r239410) @@ -130,6 +130,24 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_ATHDEV); +static void +ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq) +{ + struct ath_buf *bf; + + ATH_TXQ_LOCK_ASSERT(txq); + + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called\n", __func__); + + TAILQ_FOREACH(bf, &txq->axq_q, bf_list) { + if (txq->axq_fifo_depth >= HAL_TXFIFO_DEPTH) + break; + ath_hal_puttxbuf(sc->sc_ah, txq->axq_qnum, bf->bf_daddr); + txq->axq_fifo_depth++; + } + ath_hal_txstart(sc->sc_ah, txq->axq_qnum); +} + /* * Re-initialise the DMA FIFO with the current contents of * said TXQ. @@ -149,6 +167,10 @@ ath_edma_dma_restart(struct ath_softc *s __func__, txq, txq->axq_qnum); + + ATH_TXQ_LOCK_ASSERT(txq); + ath_edma_tx_fifo_fill(sc, txq); + } /* @@ -186,9 +208,15 @@ ath_edma_xmit_handoff_hw(struct ath_soft /* Push and update frame stats */ ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); +#ifdef ATH_DEBUG + if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) + ath_printtxbuf(sc, bf, txq->axq_qnum, 0, 0); +#endif /* ATH_DEBUG */ + /* Only schedule to the FIFO if there's space */ if (txq->axq_fifo_depth < HAL_TXFIFO_DEPTH) { ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); + txq->axq_fifo_depth++; ath_hal_txstart(ah, txq->axq_qnum); } } @@ -259,7 +287,8 @@ ath_edma_xmit_handoff(struct ath_softc * ATH_TXQ_LOCK_ASSERT(txq); - device_printf(sc->sc_dev, "%s: called; bf=%p, txq=%p, qnum=%d\n", + DPRINTF(sc, ATH_DEBUG_XMIT_DESC, + "%s: called; bf=%p, txq=%p, qnum=%d\n", __func__, bf, txq, @@ -355,8 +384,34 @@ ath_edma_dma_txteardown(struct ath_softc static void ath_edma_tx_drain(struct ath_softc *sc, ATH_RESET_TYPE reset_type) { + struct ifnet *ifp = sc->sc_ifp; + int i; device_printf(sc->sc_dev, "%s: called\n", __func__); + + (void) ath_stoptxdma(sc); + + /* + * If reset type is noloss, the TX FIFO needs to be serviced + * and those frames need to be handled. + * + * Otherwise, just toss everything in each TX queue. + */ + + /* XXX dump out the TX completion FIFO contents */ + + /* XXX dump out the frames */ + + /* XXX for now, just drain */ + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + if (ATH_TXQ_SETUP(sc, i)) + ath_tx_draintxq(sc, &sc->sc_txq[i]); + } + + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); + sc->sc_wd_timer = 0; } /* @@ -370,19 +425,36 @@ ath_edma_tx_proc(void *arg, int npending HAL_STATUS status; struct ath_tx_status ts; struct ath_txq *txq; + struct ath_buf *bf; + struct ieee80211_node *ni; + int nacked; - device_printf(sc->sc_dev, "%s: called, npending=%d\n", + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called, npending=%d\n", __func__, npending); for (;;) { + bzero(&ts, sizeof(ts)); + ATH_TXSTATUS_LOCK(sc); status = ath_hal_txprocdesc(ah, NULL, (void *) &ts); ATH_TXSTATUS_UNLOCK(sc); - if (status != HAL_OK) + if (status == HAL_EINPROGRESS) break; /* + * If there is an error with this descriptor, continue + * processing. + * + * XXX TBD: log some statistics? + */ + if (status == HAL_EIO) { + device_printf(sc->sc_dev, "%s: invalid TX status?\n", + __func__); + continue; + } + + /* * At this point we have a valid status descriptor. * The QID and descriptor ID (which currently isn't set) * is part of the status. @@ -391,12 +463,129 @@ ath_edma_tx_proc(void *arg, int npending * -head- of the given QID. Eventually we should verify * this by using the descriptor ID. */ - device_printf(sc->sc_dev, "%s: qcuid=%d\n", - __func__, - ts.ts_queue_id); + + /* + * The beacon queue is not currently a "real" queue. + * Frames aren't pushed onto it and the lock isn't setup. + * So skip it for now; the beacon handling code will + * free and alloc more beacon buffers as appropriate. + */ + if (ts.ts_queue_id == sc->sc_bhalq) + continue; txq = &sc->sc_txq[ts.ts_queue_id]; + + ATH_TXQ_LOCK(txq); + bf = TAILQ_FIRST(&txq->axq_q); + + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: qcuid=%d, bf=%p\n", + __func__, + ts.ts_queue_id, bf); + +#if 0 + /* XXX assert the buffer/descriptor matches the status descid */ + if (ts.ts_desc_id != bf->bf_descid) { + device_printf(sc->sc_dev, + "%s: mismatched descid (qid=%d, tsdescid=%d, " + "bfdescid=%d\n", + __func__, + ts.ts_queue_id, + ts.ts_desc_id, + bf->bf_descid); + } +#endif + + /* This removes the buffer and decrements the queue depth */ + ATH_TXQ_REMOVE(txq, bf, bf_list); + if (bf->bf_state.bfs_aggr) + txq->axq_aggr_depth--; + txq->axq_fifo_depth --; + /* XXX assert FIFO depth >= 0 */ + ATH_TXQ_UNLOCK(txq); + + /* + * First we need to make sure ts_rate is valid. + * + * Pre-EDMA chips pass the whole TX descriptor to + * the proctxdesc function which will then fill out + * ts_rate based on the ts_finaltsi (final TX index) + * in the TX descriptor. However the TX completion + * FIFO doesn't have this information. So here we + * do a separate HAL call to populate that information. + */ + + /* XXX TODO */ + /* XXX faked for now. Ew. */ + if (ts.ts_finaltsi < 4) { + ts.ts_rate = + bf->bf_state.bfs_rc[ts.ts_finaltsi].ratecode; + } else { + device_printf(sc->sc_dev, "%s: finaltsi=%d\n", + __func__, + ts.ts_finaltsi); + ts.ts_rate = bf->bf_state.bfs_rc[0].ratecode; + } + + /* + * XXX This is terrible. + * + * Right now, some code uses the TX status that is + * passed in here, but the completion handlers in the + * software TX path also use bf_status.ds_txstat. + * Ew. That should all go away. + * + * XXX It's also possible the rate control completion + * routine is called twice. + */ + memcpy(&bf->bf_status, &ts, sizeof(ts)); + + ni = bf->bf_node; + + /* Update RSSI */ + /* XXX duplicate from ath_tx_processq */ + if (ni != NULL && ts.ts_status == 0 && + ((bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0)) { + nacked++; + sc->sc_stats.ast_tx_rssi = ts.ts_rssi; + ATH_RSSI_LPF(sc->sc_halstats.ns_avgtxrssi, + ts.ts_rssi); + } + + /* Handle frame completion and rate control update */ + ath_tx_process_buf_completion(sc, txq, &ts, bf); + + /* bf is invalid at this point */ + + /* + * Now that there's space in the FIFO, let's push some + * more frames into it. + * + * Unfortunately for now, the txq has FIFO and non-FIFO + * frames in the same linked list, so there's no way + * to quickly/easily populate frames without walking + * the queue and skipping 'axq_fifo_depth' frames. + * + * So for now, let's only repopulate the FIFO once it + * is empty. It's sucky for performance but it's enough + * to begin validating that things are somewhat + * working. + */ + ATH_TXQ_LOCK(txq); + if (txq->axq_fifo_depth == 0) { + ath_edma_tx_fifo_fill(sc, txq); + } + ATH_TXQ_UNLOCK(txq); } + + sc->sc_wd_timer = 0; + + /* Kick software scheduler */ + /* + * XXX It's inefficient to do this if the FIFO queue is full, + * but there's no easy way right now to only populate + * the txq task for _one_ TXQ. This should be fixed. + */ + taskqueue_enqueue(sc->sc_tq, &sc->sc_txqtask); } static void From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 11:51: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 D44BE106564A; Mon, 20 Aug 2012 11:51:49 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B42A18FC08; Mon, 20 Aug 2012 11:51: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 q7KBpncL029814; Mon, 20 Aug 2012 11:51:49 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KBpnlg029812; Mon, 20 Aug 2012 11:51:49 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201208201151.q7KBpnlg029812@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 20 Aug 2012 11: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: r239413 - head/sys/mips/nlm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Aug 2012 11:51:49 -0000 Author: jchandra Date: Mon Aug 20 11:51:49 2012 New Revision: 239413 URL: http://svn.freebsd.org/changeset/base/239413 Log: Define and exclude DRAM regions used by hardware/bootloder on XLP Fix xlp_mem_init() - remove the ad-hoc code for excluding memory regions and use an array of regions. Modified: head/sys/mips/nlm/xlp_machdep.c Modified: head/sys/mips/nlm/xlp_machdep.c ============================================================================== --- head/sys/mips/nlm/xlp_machdep.c Mon Aug 20 11:34:49 2012 (r239412) +++ head/sys/mips/nlm/xlp_machdep.c Mon Aug 20 11:51:49 2012 (r239413) @@ -419,83 +419,91 @@ xlp_pic_init(void) #else #define XLP_MEM_LIM 0xfffff000UL #endif +static vm_paddr_t xlp_mem_excl[] = { + 0, 0, /* entry for kernel image, set by xlp_mem_init*/ + 0x0c000000, 0x0d000000, /* uboot mess */ + 0x10000000, 0x14000000, /* cms queue and other stuff */ + 0x1fc00000, 0x1fd00000, /* reset vec */ + 0x1e000000, 0x1e200000, /* poe buffers */ +}; + +static int +mem_exclude_add(vm_paddr_t *avail, vm_paddr_t mstart, vm_paddr_t mend) +{ + int nreg = sizeof(xlp_mem_excl)/sizeof(xlp_mem_excl[0]); + int i, pos; + + pos = 0; + for (i = 0; i < nreg; i += 2) { + if (mstart > xlp_mem_excl[i + 1]) + continue; + if (mstart < xlp_mem_excl[i]) { + avail[pos++] = mstart; + if (mend < xlp_mem_excl[i]) + avail[pos++] = mend; + else + avail[pos++] = xlp_mem_excl[i]; + } + mstart = xlp_mem_excl[i + 1]; + if (mend <= mstart) + break; + } + if (mstart < mend) { + avail[pos++] = mstart; + avail[pos++] = mend; + } + return (pos); +} + static void xlp_mem_init(void) { - uint64_t bridgebase = nlm_get_bridge_regbase(0); /* TOOD: Add other nodes */ - vm_size_t physsz = 0; - uint64_t base, lim, val; - int i, j; - + vm_paddr_t physsz, tmp; + uint64_t bridgebase, base, lim, val; + int i, j, k, n; + + /* update kernel image area in exclude regions */ + tmp = (vm_paddr_t)MIPS_KSEG0_TO_PHYS(&_end); + tmp = round_page(tmp) + 0x20000; /* round up */ + xlp_mem_excl[1] = tmp; + + printf("Memory (from DRAM BARs):\n"); + bridgebase = nlm_get_bridge_regbase(0); /* TODO: Add other nodes */ + physsz = 0; for (i = 0, j = 0; i < 8; i++) { val = nlm_read_bridge_reg(bridgebase, BRIDGE_DRAM_BAR(i)); - base = ((val >> 12) & 0xfffff) << 20; + val = (val >> 12) & 0xfffff; + base = val << 20; val = nlm_read_bridge_reg(bridgebase, BRIDGE_DRAM_LIMIT(i)); - lim = ((val >> 12) & 0xfffff) << 20; - - /* BAR not enabled */ - if (lim == 0) + val = (val >> 12) & 0xfffff; + if (val == 0) /* BAR not enabled */ continue; + lim = (val + 1) << 20; + printf(" BAR %d: %#jx - %#jx : ", i, (intmax_t)base, + (intmax_t)lim); - /* first bar, start a bit after end */ - if (base == 0) { - base = (vm_paddr_t)MIPS_KSEG0_TO_PHYS(&_end); - base = round_page(base) + 0x20000; /* round up */ - /* TODO : hack to avoid uboot packet mem, network - * interface will write here if not reset correctly - * by u-boot */ - lim = 0x0c000000; - } - if (base >= XLP_MEM_LIM) { - printf("Mem [%d]: Ignore %#jx - %#jx\n", i, - (intmax_t)base, (intmax_t)lim); - continue; - } - if (lim > XLP_MEM_LIM) { - printf("Mem [%d]: Restrict %#jx -> %#jx\n", i, - (intmax_t)lim, (intmax_t)XLP_MEM_LIM); - lim = XLP_MEM_LIM; - } if (lim <= base) { - printf("Mem[%d]: Malformed %#jx -> %#jx\n", i, + printf("\tskipped - malformed %#jx -> %#jx\n", (intmax_t)base, (intmax_t)lim); continue; + } else if (base >= XLP_MEM_LIM) { + printf(" skipped - outside usable limit %#jx.\n", + (intmax_t)XLP_MEM_LIM); + continue; + } else if (lim >= XLP_MEM_LIM) { + lim = XLP_MEM_LIM; + printf(" truncated to %#jx.\n", (intmax_t)XLP_MEM_LIM); + } else + printf(" usable\n"); + + /* exclude unusable regions from BAR and add rest */ + n = mem_exclude_add(&phys_avail[j], base, lim); + for (k = j; k < j + n; k += 2) { + physsz += phys_avail[k + 1] - phys_avail[k]; + printf("\tMem[%d]: %#jx - %#jx\n", k/2, + (intmax_t)phys_avail[k], (intmax_t)phys_avail[k+1]); } - - /* - * Exclude reset entry memory range 0x1fc00000 - 0x20000000 - * from free memory - */ - if (base < 0x20000000 && lim > 0x1fc00000) { - uint64_t base0, lim0, base1, lim1; - - base0 = base; - lim0 = 0x1fc00000; - base1 = 0x20000000; - lim1 = lim; - - if (lim0 > base0) { - phys_avail[j++] = (vm_paddr_t)base0; - phys_avail[j++] = (vm_paddr_t)lim0; - physsz += lim0 - base0; - printf("Mem[%d]: %#jx - %#jx (excl reset)\n", i, - (intmax_t)base0, (intmax_t)lim0); - } - if (lim1 > base1) { - phys_avail[j++] = (vm_paddr_t)base1; - phys_avail[j++] = (vm_paddr_t)lim1; - physsz += lim1 - base1; - printf("Mem[%d]: %#jx - %#jx (excl reset)\n", i, - (intmax_t)base1, (intmax_t)lim1); - } - } else { - phys_avail[j++] = (vm_paddr_t)base; - phys_avail[j++] = (vm_paddr_t)lim; - physsz += lim - base; - printf("Mem[%d]: %#jx - %#jx\n", i, - (intmax_t)base, (intmax_t)lim); - } - + j = k; } /* setup final entry with 0 */ From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 12:31: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 CBFCF1065670; Mon, 20 Aug 2012 12:31:35 +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 9F34F8FC12; Mon, 20 Aug 2012 12:31:35 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BA7E7B941; Mon, 20 Aug 2012 08:31:34 -0400 (EDT) From: John Baldwin To: Randall Stewart Date: Mon, 20 Aug 2012 07:43:55 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208170551.q7H5pkd1025308@svn.freebsd.org> <201208170826.25123.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Message-Id: <201208200743.55498.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 20 Aug 2012 08:31:34 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239353 - 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: Mon, 20 Aug 2012 12:31:35 -0000 On Saturday, August 18, 2012 5:31:24 am Randall Stewart wrote: > Note that in the main FreeBSD sources however, the fact that ip_input.c d= oes *not* lock > when it looks at the hash table these lines are removing from here means = there is still a potential > for a crash. I have a fix for this that does not require the lock, when I= get a moment > I will send it your way=85 you have seen part of it ;-) Heh, that is probably true, I just think that moving the ifa_free() around here doesn't help to solve those crashes. You are just as vulnerable no matter where they are performed. =2D-=20 John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 15:30: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 6B4C31065673; Mon, 20 Aug 2012 15:30: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 57CD98FC19; Mon, 20 Aug 2012 15:30: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 q7KFURV6053958; Mon, 20 Aug 2012 15:30:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KFURwj053956; Mon, 20 Aug 2012 15:30:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208201530.q7KFURwj053956@svn.freebsd.org> From: Adrian Chadd Date: Mon, 20 Aug 2012 15:30: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: r239438 - 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, 20 Aug 2012 15:30:27 -0000 Author: adrian Date: Mon Aug 20 15:30:26 2012 New Revision: 239438 URL: http://svn.freebsd.org/changeset/base/239438 Log: Wrap debugging in #ifdef ATH_DEBUG 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 Aug 20 15:19:34 2012 (r239437) +++ head/sys/dev/ath/if_ath_tx.c Mon Aug 20 15:30:26 2012 (r239438) @@ -376,8 +376,10 @@ ath_tx_chaindesclist(struct ath_softc *s , (struct ath_desc *) ds0 /* first descriptor */ ); isFirstDesc = 0; +#ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_XMIT) ath_printtxbuf(sc, bf, qnum, 0, 0); +#endif bf->bf_lastds = (struct ath_desc *) ds; /* From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 16:00: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 571CD106566C; Mon, 20 Aug 2012 16:00:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41C3B8FC08; Mon, 20 Aug 2012 16: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 q7KG0Y2G058035; Mon, 20 Aug 2012 16:00:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KG0YfC058033; Mon, 20 Aug 2012 16:00:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208201600.q7KG0YfC058033@svn.freebsd.org> From: John Baldwin Date: Mon, 20 Aug 2012 16: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: r239440 - 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, 20 Aug 2012 16:00:34 -0000 Author: jhb Date: Mon Aug 20 16:00:33 2012 New Revision: 239440 URL: http://svn.freebsd.org/changeset/base/239440 Log: Refine the changes made in r208212 to avoid bogus failures from if_delmulti() when clearing the configuration for a subinterface when the parent interface is being detached. The current code was still triggering an assertion in if_delmulti() due to the parent interface being partially detached. Fix this by not calling if_delmulti() at all if the parent interface is being detached. Warn if if_delmulti() fails when the parent is not being detached (but similar to 208212, still proceed with tearing down the vlan state). Tested by: ae@ MFC after: 1 month Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Mon Aug 20 15:34:06 2012 (r239439) +++ head/sys/net/if_vlan.c Mon Aug 20 16:00:33 2012 (r239440) @@ -192,7 +192,7 @@ static int vlan_setflags(struct ifnet *i static int vlan_setmulti(struct ifnet *ifp); static int vlan_transmit(struct ifnet *ifp, struct mbuf *m); static void vlan_unconfig(struct ifnet *ifp); -static void vlan_unconfig_locked(struct ifnet *ifp); +static void vlan_unconfig_locked(struct ifnet *ifp, int departing); static int vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag); static void vlan_link_state(struct ifnet *ifp); static void vlan_capabilities(struct ifvlan *ifv); @@ -577,7 +577,7 @@ vlan_ifdetach(void *arg __unused, struct #ifdef VLAN_ARRAY for (i = 0; i < VLAN_ARRAY_SIZE; i++) if ((ifv = ifp->if_vlantrunk->vlans[i])) { - vlan_unconfig_locked(ifv->ifv_ifp); + vlan_unconfig_locked(ifv->ifv_ifp, 1); if (ifp->if_vlantrunk == NULL) break; } @@ -585,7 +585,7 @@ vlan_ifdetach(void *arg __unused, struct restart: for (i = 0; i < (1 << ifp->if_vlantrunk->hwidth); i++) if ((ifv = LIST_FIRST(&ifp->if_vlantrunk->hash[i]))) { - vlan_unconfig_locked(ifv->ifv_ifp); + vlan_unconfig_locked(ifv->ifv_ifp, 1); if (ifp->if_vlantrunk) goto restart; /* trunk->hwidth can change */ else @@ -968,7 +968,7 @@ vlan_clone_create(struct if_clone *ifc, error = vlan_config(ifv, p, vid); if (error != 0) { /* - * Since we've partialy failed, we need to back + * Since we've partially failed, we need to back * out all the way, otherwise userland could get * confused. Thus, we destroy the interface. */ @@ -1307,17 +1307,18 @@ vlan_unconfig(struct ifnet *ifp) { VLAN_LOCK(); - vlan_unconfig_locked(ifp); + vlan_unconfig_locked(ifp, 0); VLAN_UNLOCK(); } static void -vlan_unconfig_locked(struct ifnet *ifp) +vlan_unconfig_locked(struct ifnet *ifp, int departing) { struct ifvlantrunk *trunk; struct vlan_mc_entry *mc; struct ifvlan *ifv; struct ifnet *parent; + int error; VLAN_LOCK_ASSERT(); @@ -1337,14 +1338,21 @@ vlan_unconfig_locked(struct ifnet *ifp) */ while ((mc = SLIST_FIRST(&ifv->vlan_mc_listhead)) != NULL) { /* - * This may fail if the parent interface is - * being detached. Regardless, we should do a - * best effort to free this interface as much - * as possible as all callers expect vlan - * destruction to succeed. + * If the parent interface is being detached, + * all it's multicast addresses have already + * been removed. Warn about errors if + * if_delmulti() does fail, but don't abort as + * all callers expect vlan destruction to + * succeed. */ - (void)if_delmulti(parent, - (struct sockaddr *)&mc->mc_addr); + if (!departing) { + error = if_delmulti(parent, + (struct sockaddr *)&mc->mc_addr); + if (error) + if_printf(ifp, + "Failed to delete multicast address from parent: %d\n", + error); + } SLIST_REMOVE_HEAD(&ifv->vlan_mc_listhead, mc_entries); free(mc, M_VLAN); } From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 18:21:35 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 0814E106564A; Mon, 20 Aug 2012 18:21:35 +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 C9AA38FC17; Mon, 20 Aug 2012 18:21:34 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 27AB5B978; Mon, 20 Aug 2012 14:21:34 -0400 (EDT) From: John Baldwin To: Andrey Chernov Date: Mon, 20 Aug 2012 14:09:55 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> In-Reply-To: <20120818195724.GA74684@vniz.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201208201409.55544.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 20 Aug 2012 14:21:34 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239356 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Aug 2012 18:21:35 -0000 On Saturday, August 18, 2012 3:57:24 pm Andrey Chernov wrote: > On Fri, Aug 17, 2012 at 03:07:07PM -0400, John Baldwin wrote: > > On Friday, August 17, 2012 2:25:12 pm Andrey Chernov wrote: > > > On Fri, Aug 17, 2012 at 03:53:43PM +0000, John Baldwin wrote: > > > > Author: jhb > > > > Date: Fri Aug 17 15:53:43 2012 > > > > New Revision: 239356 > > > > URL: http://svn.freebsd.org/changeset/base/239356 > > > > > > > > Log: > > > > Fix dhclient to properly exit and teardown the configured lease when > > > > link is lost. devd will start a new dhclient instance when link is > > > > restored. > > > > > > Is it any chance to teach dhclient IPv6 addresses in very basic parser > > > level, f.e. to replace nameserver it sniffs from router? Currently > > > dhcp-options(5) understands IPv4 addresses only and produce error on > > > 'supersede' IPv6 address. > > > > I think the RFC defines those to be IPv4, yes? Presumably DHCPv6 adds > > new option types that support IPv6 addresses? > > RFC 2131 (if you mean it) describes DHCP process itself, it does not > define contents of 'supersede' or other override options for dhclient. The supersede handling bits are all based on what the protocol can actually send, which the RFC defines as IPv4. > Moreover, current dhclient somewhow able to fetch my IPv6 tunnel DNS > address from the roiter (I don't look deeper, maybe it is router bug), but > I don't want IPv6 tunnel DNS, I want router fe80:... DNS instead. Eh? DHCP can't return an IPv6 address in the protocol. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 18:33: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 29D4C1065795; Mon, 20 Aug 2012 18:33:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0846B8FC1A; Mon, 20 Aug 2012 18:33: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 q7KIX5Xk075899; Mon, 20 Aug 2012 18:33:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIX58p075876; Mon, 20 Aug 2012 18:33:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208201833.q7KIX58p075876@svn.freebsd.org> From: Dimitry Andric Date: Mon, 20 Aug 2012 18:33: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: r239462 - in head: . contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm/ADT contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm/Bitcode contrib/llv... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Aug 2012 18:33:06 -0000 Author: dim Date: Mon Aug 20 18:33:03 2012 New Revision: 239462 URL: http://svn.freebsd.org/changeset/base/239462 Log: Upgrade our copy of llvm/clang to trunk r162107. With thanks to Benjamin Kramer and Joerg Sonnenberger for their input and fixes. Added: head/contrib/llvm/include/llvm-c/Linker.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm-c/Linker.h head/contrib/llvm/include/llvm/Analysis/LoopInfoImpl.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/Analysis/LoopInfoImpl.h head/contrib/llvm/include/llvm/CodeGen/RegisterClassInfo.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/CodeGen/RegisterClassInfo.h head/contrib/llvm/include/llvm/CodeGen/RegisterPressure.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/CodeGen/RegisterPressure.h head/contrib/llvm/include/llvm/DIBuilder.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/DIBuilder.h head/contrib/llvm/include/llvm/DebugInfo.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/DebugInfo.h head/contrib/llvm/include/llvm/IRBuilder.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/IRBuilder.h head/contrib/llvm/include/llvm/IntrinsicsMips.td - copied unchanged from r239314, vendor/llvm/dist/include/llvm/IntrinsicsMips.td head/contrib/llvm/include/llvm/IntrinsicsNVVM.td - copied unchanged from r239314, vendor/llvm/dist/include/llvm/IntrinsicsNVVM.td head/contrib/llvm/include/llvm/MC/MCFixedLenDisassembler.h - copied unchanged from r239394, vendor/llvm/dist/include/llvm/MC/MCFixedLenDisassembler.h head/contrib/llvm/include/llvm/MC/MCSchedule.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/MC/MCSchedule.h head/contrib/llvm/include/llvm/MDBuilder.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/MDBuilder.h head/contrib/llvm/include/llvm/Support/FileOutputBuffer.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/Support/FileOutputBuffer.h head/contrib/llvm/include/llvm/Support/IntegersSubset.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/Support/IntegersSubset.h head/contrib/llvm/include/llvm/Support/IntegersSubsetMapping.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/Support/IntegersSubsetMapping.h head/contrib/llvm/include/llvm/Support/LEB128.h - copied, changed from r239314, vendor/llvm/dist/include/llvm/Support/LEB128.h head/contrib/llvm/include/llvm/TableGen/StringMatcher.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/TableGen/StringMatcher.h head/contrib/llvm/include/llvm/Target/TargetItinerary.td - copied unchanged from r239314, vendor/llvm/dist/include/llvm/Target/TargetItinerary.td head/contrib/llvm/include/llvm/Transforms/Utils/CodeExtractor.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/Transforms/Utils/CodeExtractor.h head/contrib/llvm/include/llvm/TypeBuilder.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/TypeBuilder.h head/contrib/llvm/include/llvm/TypeFinder.h - copied unchanged from r239314, vendor/llvm/dist/include/llvm/TypeFinder.h head/contrib/llvm/lib/CodeGen/EarlyIfConversion.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/CodeGen/EarlyIfConversion.cpp head/contrib/llvm/lib/CodeGen/LiveRegMatrix.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/CodeGen/LiveRegMatrix.cpp head/contrib/llvm/lib/CodeGen/LiveRegMatrix.h - copied unchanged from r239314, vendor/llvm/dist/lib/CodeGen/LiveRegMatrix.h head/contrib/llvm/lib/CodeGen/MachineTraceMetrics.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/CodeGen/MachineTraceMetrics.cpp head/contrib/llvm/lib/CodeGen/MachineTraceMetrics.h - copied unchanged from r239314, vendor/llvm/dist/lib/CodeGen/MachineTraceMetrics.h head/contrib/llvm/lib/CodeGen/RegisterPressure.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/CodeGen/RegisterPressure.cpp head/contrib/llvm/lib/MC/MCRegisterInfo.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/MC/MCRegisterInfo.cpp head/contrib/llvm/lib/Support/FileOutputBuffer.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Support/FileOutputBuffer.cpp head/contrib/llvm/lib/TableGen/StringMatcher.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/TableGen/StringMatcher.cpp head/contrib/llvm/lib/Target/AMDGPU/ - copied from r239314, vendor/llvm/dist/lib/Target/AMDGPU/ head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV5.td - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrInfoV5.td head/contrib/llvm/lib/Target/Hexagon/HexagonIntrinsicsV5.td - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Hexagon/HexagonIntrinsicsV5.td head/contrib/llvm/lib/Target/Hexagon/HexagonMCInst.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Hexagon/HexagonMCInst.h head/contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Hexagon/HexagonNewValueJump.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp head/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16FrameLowering.cpp head/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16FrameLowering.h head/contrib/llvm/lib/Target/Mips/Mips16InstrFormats.td - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16InstrFormats.td head/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16InstrInfo.cpp head/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16InstrInfo.h head/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.td - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16InstrInfo.td head/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16RegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/Mips16RegisterInfo.h head/contrib/llvm/lib/Target/Mips/MipsLongBranch.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsLongBranch.cpp head/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsSEFrameLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsSEFrameLowering.h head/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsSEInstrInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsSEInstrInfo.h head/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsSERegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.h - copied unchanged from r239314, vendor/llvm/dist/lib/Target/Mips/MipsSERegisterInfo.h head/contrib/llvm/lib/Target/NVPTX/ - copied from r239314, vendor/llvm/dist/lib/Target/NVPTX/ head/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Target/PowerPC/PPCCTRLoops.cpp head/contrib/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/Transforms/Instrumentation/BoundsChecking.cpp head/contrib/llvm/lib/VMCore/DIBuilder.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/VMCore/DIBuilder.cpp head/contrib/llvm/lib/VMCore/DebugInfo.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/VMCore/DebugInfo.cpp head/contrib/llvm/lib/VMCore/TypeFinder.cpp - copied unchanged from r239314, vendor/llvm/dist/lib/VMCore/TypeFinder.cpp head/contrib/llvm/tools/clang/include/clang-c/CXCompilationDatabase.h - copied unchanged from r239314, vendor/clang/dist/include/clang-c/CXCompilationDatabase.h head/contrib/llvm/tools/clang/include/clang-c/CXString.h - copied unchanged from r239314, vendor/clang/dist/include/clang-c/CXString.h head/contrib/llvm/tools/clang/include/clang-c/Platform.h - copied unchanged from r239314, vendor/clang/dist/include/clang-c/Platform.h head/contrib/llvm/tools/clang/include/clang/AST/Comment.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/Comment.h head/contrib/llvm/tools/clang/include/clang/AST/CommentBriefParser.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/CommentBriefParser.h head/contrib/llvm/tools/clang/include/clang/AST/CommentCommandTraits.h - copied, changed from r239314, vendor/clang/dist/include/clang/AST/CommentCommandTraits.h head/contrib/llvm/tools/clang/include/clang/AST/CommentDiagnostic.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/CommentDiagnostic.h head/contrib/llvm/tools/clang/include/clang/AST/CommentLexer.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/CommentLexer.h head/contrib/llvm/tools/clang/include/clang/AST/CommentParser.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/CommentParser.h head/contrib/llvm/tools/clang/include/clang/AST/CommentSema.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/CommentSema.h head/contrib/llvm/tools/clang/include/clang/AST/CommentVisitor.h - copied unchanged from r239314, vendor/clang/dist/include/clang/AST/CommentVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/RawCommentList.h - copied, changed from r239314, vendor/clang/dist/include/clang/AST/RawCommentList.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/ - copied from r239314, vendor/clang/dist/include/clang/ASTMatchers/ head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsMips.def - copied unchanged from r239314, vendor/clang/dist/include/clang/Basic/BuiltinsMips.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsNVPTX.def - copied unchanged from r239314, vendor/clang/dist/include/clang/Basic/BuiltinsNVPTX.def head/contrib/llvm/tools/clang/include/clang/Basic/CommentNodes.td - copied unchanged from r239314, vendor/clang/dist/include/clang/Basic/CommentNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommentKinds.td - copied unchanged from r239314, vendor/clang/dist/include/clang/Basic/DiagnosticCommentKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/ObjCRuntime.h - copied unchanged from r239314, vendor/clang/dist/include/clang/Basic/ObjCRuntime.h head/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteOptions.h - copied unchanged from r239314, vendor/clang/dist/include/clang/Sema/CodeCompleteOptions.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h - copied unchanged from r239314, vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h - copied, changed from r239314, vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h head/contrib/llvm/tools/clang/include/clang/Tooling/ArgumentsAdjusters.h - copied unchanged from r239314, vendor/clang/dist/include/clang/Tooling/ArgumentsAdjusters.h head/contrib/llvm/tools/clang/include/clang/Tooling/CommandLineClangTool.h - copied unchanged from r239314, vendor/clang/dist/include/clang/Tooling/CommandLineClangTool.h head/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring.h - copied unchanged from r239314, vendor/clang/dist/include/clang/Tooling/Refactoring.h head/contrib/llvm/tools/clang/include/clang/Tooling/RefactoringCallbacks.h - copied unchanged from r239314, vendor/clang/dist/include/clang/Tooling/RefactoringCallbacks.h head/contrib/llvm/tools/clang/lib/AST/Comment.cpp - copied unchanged from r239314, vendor/clang/dist/lib/AST/Comment.cpp head/contrib/llvm/tools/clang/lib/AST/CommentBriefParser.cpp - copied unchanged from r239314, vendor/clang/dist/lib/AST/CommentBriefParser.cpp head/contrib/llvm/tools/clang/lib/AST/CommentCommandTraits.cpp - copied, changed from r239314, vendor/clang/dist/lib/AST/CommentCommandTraits.cpp head/contrib/llvm/tools/clang/lib/AST/CommentDumper.cpp - copied unchanged from r239314, vendor/clang/dist/lib/AST/CommentDumper.cpp head/contrib/llvm/tools/clang/lib/AST/CommentLexer.cpp - copied unchanged from r239314, vendor/clang/dist/lib/AST/CommentLexer.cpp head/contrib/llvm/tools/clang/lib/AST/CommentParser.cpp - copied unchanged from r239314, vendor/clang/dist/lib/AST/CommentParser.cpp head/contrib/llvm/tools/clang/lib/AST/CommentSema.cpp - copied unchanged from r239314, vendor/clang/dist/lib/AST/CommentSema.cpp head/contrib/llvm/tools/clang/lib/AST/RawCommentList.cpp - copied, changed from r239314, vendor/clang/dist/lib/AST/RawCommentList.cpp head/contrib/llvm/tools/clang/lib/ASTMatchers/ - copied from r239314, vendor/clang/dist/lib/ASTMatchers/ head/contrib/llvm/tools/clang/lib/Basic/ConvertUTFWrapper.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Basic/ConvertUTFWrapper.cpp head/contrib/llvm/tools/clang/lib/Basic/ObjCRuntime.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Basic/ObjCRuntime.cpp head/contrib/llvm/tools/clang/lib/Headers/ammintrin.h - copied unchanged from r239314, vendor/clang/dist/lib/Headers/ammintrin.h head/contrib/llvm/tools/clang/lib/Headers/fmaintrin.h - copied unchanged from r239314, vendor/clang/dist/lib/Headers/fmaintrin.h head/contrib/llvm/tools/clang/lib/Headers/xopintrin.h - copied unchanged from r239314, vendor/clang/dist/lib/Headers/xopintrin.h head/contrib/llvm/tools/clang/lib/Rewrite/InclusionRewriter.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Rewrite/InclusionRewriter.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp - copied, changed from r239314, vendor/clang/dist/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp - copied unchanged from r239314, vendor/clang/dist/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp - copied unchanged from r239314, vendor/clang/dist/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/APSIntType.cpp - copied unchanged from r239314, vendor/clang/dist/lib/StaticAnalyzer/Core/APSIntType.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp - copied, changed from r239314, vendor/clang/dist/lib/StaticAnalyzer/Core/CallEvent.cpp head/contrib/llvm/tools/clang/lib/Tooling/ArgumentsAdjusters.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Tooling/ArgumentsAdjusters.cpp head/contrib/llvm/tools/clang/lib/Tooling/CommandLineClangTool.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Tooling/CommandLineClangTool.cpp head/contrib/llvm/tools/clang/lib/Tooling/CustomCompilationDatabase.h - copied unchanged from r239314, vendor/clang/dist/lib/Tooling/CustomCompilationDatabase.h head/contrib/llvm/tools/clang/lib/Tooling/Refactoring.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Tooling/Refactoring.cpp head/contrib/llvm/tools/clang/lib/Tooling/RefactoringCallbacks.cpp - copied unchanged from r239314, vendor/clang/dist/lib/Tooling/RefactoringCallbacks.cpp head/contrib/llvm/tools/clang/utils/TableGen/TableGenBackends.h - copied unchanged from r239314, vendor/clang/dist/utils/TableGen/TableGenBackends.h head/contrib/llvm/utils/TableGen/CodeGenSchedule.cpp - copied unchanged from r239314, vendor/llvm/dist/utils/TableGen/CodeGenSchedule.cpp head/contrib/llvm/utils/TableGen/CodeGenSchedule.h - copied unchanged from r239314, vendor/llvm/dist/utils/TableGen/CodeGenSchedule.h head/contrib/llvm/utils/TableGen/TableGenBackends.h - copied unchanged from r239314, vendor/llvm/dist/utils/TableGen/TableGenBackends.h head/lib/clang/include/MipsGenDisassemblerTables.inc (contents, props changed) head/lib/clang/include/MipsGenEDInfo.inc (contents, props changed) head/lib/clang/include/clang/AST/CommentNodes.inc (contents, props changed) head/lib/clang/include/clang/Basic/DiagnosticCommentKinds.inc (contents, props changed) head/lib/clang/libllvmmipsdisassembler/ head/lib/clang/libllvmmipsdisassembler/Makefile (contents, props changed) Deleted: head/contrib/llvm/include/llvm/Analysis/DIBuilder.h head/contrib/llvm/include/llvm/Analysis/DebugInfo.h head/contrib/llvm/include/llvm/CodeGen/ProcessImplicitDefs.h head/contrib/llvm/include/llvm/IntrinsicsPTX.td head/contrib/llvm/include/llvm/Support/IRBuilder.h head/contrib/llvm/include/llvm/Support/MDBuilder.h head/contrib/llvm/include/llvm/Support/TypeBuilder.h head/contrib/llvm/include/llvm/Transforms/Utils/FunctionUtils.h head/contrib/llvm/lib/Analysis/DIBuilder.cpp head/contrib/llvm/lib/Analysis/DebugInfo.cpp head/contrib/llvm/lib/CodeGen/RegisterClassInfo.h head/contrib/llvm/lib/CodeGen/RenderMachineFunction.cpp head/contrib/llvm/lib/CodeGen/RenderMachineFunction.h head/contrib/llvm/lib/Target/Mips/MipsEmitGPRestore.cpp head/contrib/llvm/lib/Target/Mips/MipsExpandPseudo.cpp head/contrib/llvm/lib/Target/NVPTX/CMakeLists.txt head/contrib/llvm/lib/Target/NVPTX/InstPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/NVPTX/InstPrinter/LLVMBuild.txt head/contrib/llvm/lib/Target/NVPTX/LLVMBuild.txt head/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt head/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/LLVMBuild.txt head/contrib/llvm/lib/Target/NVPTX/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/NVPTX/TargetInfo/LLVMBuild.txt head/contrib/llvm/lib/Target/PTX/InstPrinter/PTXInstPrinter.cpp head/contrib/llvm/lib/Target/PTX/InstPrinter/PTXInstPrinter.h head/contrib/llvm/lib/Target/PTX/MCTargetDesc/PTXBaseInfo.h head/contrib/llvm/lib/Target/PTX/MCTargetDesc/PTXMCAsmInfo.cpp head/contrib/llvm/lib/Target/PTX/MCTargetDesc/PTXMCAsmInfo.h head/contrib/llvm/lib/Target/PTX/MCTargetDesc/PTXMCTargetDesc.cpp head/contrib/llvm/lib/Target/PTX/MCTargetDesc/PTXMCTargetDesc.h head/contrib/llvm/lib/Target/PTX/PTX.h head/contrib/llvm/lib/Target/PTX/PTX.td head/contrib/llvm/lib/Target/PTX/PTXAsmPrinter.cpp head/contrib/llvm/lib/Target/PTX/PTXAsmPrinter.h head/contrib/llvm/lib/Target/PTX/PTXFPRoundingModePass.cpp head/contrib/llvm/lib/Target/PTX/PTXFrameLowering.cpp head/contrib/llvm/lib/Target/PTX/PTXFrameLowering.h head/contrib/llvm/lib/Target/PTX/PTXISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PTX/PTXISelLowering.cpp head/contrib/llvm/lib/Target/PTX/PTXISelLowering.h head/contrib/llvm/lib/Target/PTX/PTXInstrFormats.td head/contrib/llvm/lib/Target/PTX/PTXInstrInfo.cpp head/contrib/llvm/lib/Target/PTX/PTXInstrInfo.h head/contrib/llvm/lib/Target/PTX/PTXInstrInfo.td head/contrib/llvm/lib/Target/PTX/PTXInstrLoadStore.td head/contrib/llvm/lib/Target/PTX/PTXIntrinsicInstrInfo.td head/contrib/llvm/lib/Target/PTX/PTXMCAsmStreamer.cpp head/contrib/llvm/lib/Target/PTX/PTXMCInstLower.cpp head/contrib/llvm/lib/Target/PTX/PTXMFInfoExtract.cpp head/contrib/llvm/lib/Target/PTX/PTXMachineFunctionInfo.cpp head/contrib/llvm/lib/Target/PTX/PTXMachineFunctionInfo.h head/contrib/llvm/lib/Target/PTX/PTXParamManager.cpp head/contrib/llvm/lib/Target/PTX/PTXParamManager.h head/contrib/llvm/lib/Target/PTX/PTXRegAlloc.cpp head/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.cpp head/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.h head/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.td head/contrib/llvm/lib/Target/PTX/PTXSelectionDAGInfo.cpp head/contrib/llvm/lib/Target/PTX/PTXSelectionDAGInfo.h head/contrib/llvm/lib/Target/PTX/PTXSubtarget.cpp head/contrib/llvm/lib/Target/PTX/PTXSubtarget.h head/contrib/llvm/lib/Target/PTX/PTXTargetMachine.cpp head/contrib/llvm/lib/Target/PTX/PTXTargetMachine.h head/contrib/llvm/lib/Target/PTX/TargetInfo/PTXTargetInfo.cpp head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsPTX.def head/contrib/llvm/tools/clang/include/clang/Driver/ObjCRuntime.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h head/contrib/llvm/tools/clang/lib/ASTMatchers/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Driver/CC1Options.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ObjCMessage.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangASTNodesEmitter.h head/contrib/llvm/tools/clang/utils/TableGen/ClangAttrEmitter.h head/contrib/llvm/tools/clang/utils/TableGen/ClangDiagnosticsEmitter.h head/contrib/llvm/tools/clang/utils/TableGen/ClangSACheckersEmitter.h head/contrib/llvm/tools/clang/utils/TableGen/NeonEmitter.h head/contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.h head/contrib/llvm/tools/llvm-ld/ head/contrib/llvm/tools/llvm-stub/llvm-stub.c head/contrib/llvm/utils/TableGen/AsmMatcherEmitter.h head/contrib/llvm/utils/TableGen/AsmWriterEmitter.h head/contrib/llvm/utils/TableGen/CallingConvEmitter.h head/contrib/llvm/utils/TableGen/CodeEmitterGen.h head/contrib/llvm/utils/TableGen/DAGISelEmitter.h head/contrib/llvm/utils/TableGen/DFAPacketizerEmitter.h head/contrib/llvm/utils/TableGen/DisassemblerEmitter.h head/contrib/llvm/utils/TableGen/EDEmitter.h head/contrib/llvm/utils/TableGen/FastISelEmitter.h head/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.h head/contrib/llvm/utils/TableGen/InstrInfoEmitter.h head/contrib/llvm/utils/TableGen/IntrinsicEmitter.h head/contrib/llvm/utils/TableGen/PseudoLoweringEmitter.h head/contrib/llvm/utils/TableGen/RegisterInfoEmitter.h head/contrib/llvm/utils/TableGen/StringMatcher.cpp head/contrib/llvm/utils/TableGen/StringMatcher.h head/contrib/llvm/utils/TableGen/SubtargetEmitter.h head/lib/clang/include/clang/Driver/CC1Options.inc head/usr.bin/clang/llvm-ld/ head/usr.bin/clang/llvm-stub/ Modified: head/ObsoleteFiles.inc head/contrib/llvm/include/llvm-c/Core.h head/contrib/llvm/include/llvm-c/Disassembler.h head/contrib/llvm/include/llvm-c/Target.h head/contrib/llvm/include/llvm/ADT/APFloat.h head/contrib/llvm/include/llvm/ADT/APInt.h head/contrib/llvm/include/llvm/ADT/APSInt.h head/contrib/llvm/include/llvm/ADT/ArrayRef.h head/contrib/llvm/include/llvm/ADT/BitVector.h head/contrib/llvm/include/llvm/ADT/DenseMap.h head/contrib/llvm/include/llvm/ADT/DepthFirstIterator.h head/contrib/llvm/include/llvm/ADT/FoldingSet.h head/contrib/llvm/include/llvm/ADT/Hashing.h head/contrib/llvm/include/llvm/ADT/ImmutableSet.h head/contrib/llvm/include/llvm/ADT/IndexedMap.h head/contrib/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h head/contrib/llvm/include/llvm/ADT/PointerIntPair.h head/contrib/llvm/include/llvm/ADT/PointerUnion.h head/contrib/llvm/include/llvm/ADT/PostOrderIterator.h head/contrib/llvm/include/llvm/ADT/STLExtras.h head/contrib/llvm/include/llvm/ADT/SmallBitVector.h head/contrib/llvm/include/llvm/ADT/SmallString.h head/contrib/llvm/include/llvm/ADT/SmallVector.h head/contrib/llvm/include/llvm/ADT/SparseSet.h head/contrib/llvm/include/llvm/ADT/StringRef.h head/contrib/llvm/include/llvm/ADT/StringSwitch.h head/contrib/llvm/include/llvm/ADT/TinyPtrVector.h head/contrib/llvm/include/llvm/ADT/Triple.h head/contrib/llvm/include/llvm/ADT/ValueMap.h head/contrib/llvm/include/llvm/ADT/VariadicFunction.h head/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h head/contrib/llvm/include/llvm/Analysis/BlockFrequencyImpl.h head/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h head/contrib/llvm/include/llvm/Analysis/CodeMetrics.h head/contrib/llvm/include/llvm/Analysis/Dominators.h head/contrib/llvm/include/llvm/Analysis/InlineCost.h head/contrib/llvm/include/llvm/Analysis/LoopInfo.h head/contrib/llvm/include/llvm/Analysis/LoopIterator.h head/contrib/llvm/include/llvm/Analysis/MemoryBuiltins.h head/contrib/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h head/contrib/llvm/include/llvm/Analysis/ProfileInfoLoader.h head/contrib/llvm/include/llvm/Analysis/RegionInfo.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h head/contrib/llvm/include/llvm/Analysis/ValueTracking.h head/contrib/llvm/include/llvm/Attributes.h head/contrib/llvm/include/llvm/Bitcode/Archive.h head/contrib/llvm/include/llvm/Bitcode/ReaderWriter.h head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h head/contrib/llvm/include/llvm/CodeGen/DFAPacketizer.h head/contrib/llvm/include/llvm/CodeGen/EdgeBundles.h head/contrib/llvm/include/llvm/CodeGen/FastISel.h head/contrib/llvm/include/llvm/CodeGen/GCMetadata.h head/contrib/llvm/include/llvm/CodeGen/GCStrategy.h head/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h head/contrib/llvm/include/llvm/CodeGen/LexicalScopes.h head/contrib/llvm/include/llvm/CodeGen/LiveInterval.h head/contrib/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h head/contrib/llvm/include/llvm/CodeGen/LiveRangeEdit.h head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h head/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h head/contrib/llvm/include/llvm/CodeGen/MachineInstr.h head/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h head/contrib/llvm/include/llvm/CodeGen/MachineInstrBundle.h head/contrib/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineLoopInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineOperand.h head/contrib/llvm/include/llvm/CodeGen/MachinePassRegistry.h head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineScheduler.h head/contrib/llvm/include/llvm/CodeGen/Passes.h head/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h head/contrib/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h head/contrib/llvm/include/llvm/CodeGen/ScheduleHazardRecognizer.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAGISel.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAGNodes.h head/contrib/llvm/include/llvm/CodeGen/SlotIndexes.h head/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h head/contrib/llvm/include/llvm/CodeGen/ValueTypes.h head/contrib/llvm/include/llvm/CodeGen/ValueTypes.td head/contrib/llvm/include/llvm/Constant.h head/contrib/llvm/include/llvm/Constants.h head/contrib/llvm/include/llvm/DebugInfo/DIContext.h head/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h head/contrib/llvm/include/llvm/ExecutionEngine/Interpreter.h head/contrib/llvm/include/llvm/ExecutionEngine/JIT.h head/contrib/llvm/include/llvm/ExecutionEngine/MCJIT.h head/contrib/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h head/contrib/llvm/include/llvm/Function.h head/contrib/llvm/include/llvm/GlobalValue.h head/contrib/llvm/include/llvm/GlobalVariable.h head/contrib/llvm/include/llvm/InitializePasses.h head/contrib/llvm/include/llvm/Instruction.h head/contrib/llvm/include/llvm/Instructions.h head/contrib/llvm/include/llvm/Intrinsics.h head/contrib/llvm/include/llvm/Intrinsics.td head/contrib/llvm/include/llvm/IntrinsicsHexagon.td head/contrib/llvm/include/llvm/IntrinsicsX86.td head/contrib/llvm/include/llvm/LinkAllPasses.h head/contrib/llvm/include/llvm/MC/EDInstInfo.h head/contrib/llvm/include/llvm/MC/MCAsmInfo.h head/contrib/llvm/include/llvm/MC/MCAssembler.h head/contrib/llvm/include/llvm/MC/MCContext.h head/contrib/llvm/include/llvm/MC/MCDirectives.h head/contrib/llvm/include/llvm/MC/MCDisassembler.h head/contrib/llvm/include/llvm/MC/MCELFObjectWriter.h head/contrib/llvm/include/llvm/MC/MCExpr.h head/contrib/llvm/include/llvm/MC/MCFixupKindInfo.h head/contrib/llvm/include/llvm/MC/MCInstrDesc.h head/contrib/llvm/include/llvm/MC/MCInstrItineraries.h head/contrib/llvm/include/llvm/MC/MCMachObjectWriter.h head/contrib/llvm/include/llvm/MC/MCObjectFileInfo.h head/contrib/llvm/include/llvm/MC/MCObjectWriter.h head/contrib/llvm/include/llvm/MC/MCRegisterInfo.h head/contrib/llvm/include/llvm/MC/MCStreamer.h head/contrib/llvm/include/llvm/MC/MCSubtargetInfo.h head/contrib/llvm/include/llvm/MC/MCTargetAsmLexer.h head/contrib/llvm/include/llvm/MC/MCTargetAsmParser.h head/contrib/llvm/include/llvm/MC/MachineLocation.h head/contrib/llvm/include/llvm/MC/SubtargetFeature.h head/contrib/llvm/include/llvm/Metadata.h head/contrib/llvm/include/llvm/Module.h head/contrib/llvm/include/llvm/Object/Binary.h head/contrib/llvm/include/llvm/Object/COFF.h head/contrib/llvm/include/llvm/Object/ELF.h head/contrib/llvm/include/llvm/Object/MachOFormat.h head/contrib/llvm/include/llvm/Object/MachOObject.h head/contrib/llvm/include/llvm/Object/ObjectFile.h head/contrib/llvm/include/llvm/PassManagers.h head/contrib/llvm/include/llvm/Support/AlignOf.h head/contrib/llvm/include/llvm/Support/COFF.h head/contrib/llvm/include/llvm/Support/CallSite.h head/contrib/llvm/include/llvm/Support/CommandLine.h head/contrib/llvm/include/llvm/Support/Compiler.h head/contrib/llvm/include/llvm/Support/ConstantRange.h head/contrib/llvm/include/llvm/Support/DataTypes.h.in head/contrib/llvm/include/llvm/Support/Debug.h head/contrib/llvm/include/llvm/Support/DebugLoc.h head/contrib/llvm/include/llvm/Support/ELF.h head/contrib/llvm/include/llvm/Support/Endian.h head/contrib/llvm/include/llvm/Support/FileSystem.h head/contrib/llvm/include/llvm/Support/GCOV.h head/contrib/llvm/include/llvm/Support/GraphWriter.h head/contrib/llvm/include/llvm/Support/InstVisitor.h head/contrib/llvm/include/llvm/Support/MachO.h head/contrib/llvm/include/llvm/Support/MathExtras.h head/contrib/llvm/include/llvm/Support/NoFolder.h head/contrib/llvm/include/llvm/Support/PathV2.h head/contrib/llvm/include/llvm/Support/Process.h head/contrib/llvm/include/llvm/Support/SMLoc.h head/contrib/llvm/include/llvm/Support/SourceMgr.h head/contrib/llvm/include/llvm/Support/TargetRegistry.h head/contrib/llvm/include/llvm/Support/ThreadLocal.h head/contrib/llvm/include/llvm/Support/ValueHandle.h head/contrib/llvm/include/llvm/Support/YAMLParser.h head/contrib/llvm/include/llvm/Support/raw_ostream.h head/contrib/llvm/include/llvm/Support/type_traits.h head/contrib/llvm/include/llvm/TableGen/Record.h head/contrib/llvm/include/llvm/TableGen/TableGenBackend.h head/contrib/llvm/include/llvm/Target/Target.td head/contrib/llvm/include/llvm/Target/TargetCallingConv.h head/contrib/llvm/include/llvm/Target/TargetData.h head/contrib/llvm/include/llvm/Target/TargetELFWriterInfo.h head/contrib/llvm/include/llvm/Target/TargetInstrInfo.h head/contrib/llvm/include/llvm/Target/TargetLibraryInfo.h head/contrib/llvm/include/llvm/Target/TargetLowering.h head/contrib/llvm/include/llvm/Target/TargetMachine.h head/contrib/llvm/include/llvm/Target/TargetOptions.h head/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h head/contrib/llvm/include/llvm/Target/TargetSchedule.td head/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td head/contrib/llvm/include/llvm/Transforms/Instrumentation.h head/contrib/llvm/include/llvm/Transforms/Scalar.h head/contrib/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h head/contrib/llvm/include/llvm/Transforms/Utils/BuildLibCalls.h head/contrib/llvm/include/llvm/Transforms/Utils/Local.h head/contrib/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h head/contrib/llvm/include/llvm/Transforms/Vectorize.h head/contrib/llvm/include/llvm/User.h head/contrib/llvm/lib/Analysis/AliasAnalysis.cpp head/contrib/llvm/lib/Analysis/AliasSetTracker.cpp head/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp head/contrib/llvm/lib/Analysis/CaptureTracking.cpp head/contrib/llvm/lib/Analysis/CodeMetrics.cpp head/contrib/llvm/lib/Analysis/ConstantFolding.cpp head/contrib/llvm/lib/Analysis/DbgInfoPrinter.cpp head/contrib/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp head/contrib/llvm/lib/Analysis/IPA/GlobalsModRef.cpp head/contrib/llvm/lib/Analysis/IVUsers.cpp head/contrib/llvm/lib/Analysis/InlineCost.cpp head/contrib/llvm/lib/Analysis/InstructionSimplify.cpp head/contrib/llvm/lib/Analysis/LazyValueInfo.cpp head/contrib/llvm/lib/Analysis/LoopInfo.cpp head/contrib/llvm/lib/Analysis/LoopPass.cpp head/contrib/llvm/lib/Analysis/MemDepPrinter.cpp head/contrib/llvm/lib/Analysis/MemoryBuiltins.cpp head/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp head/contrib/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp head/contrib/llvm/lib/Analysis/PathNumbering.cpp head/contrib/llvm/lib/Analysis/ProfileInfoLoader.cpp head/contrib/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp head/contrib/llvm/lib/Analysis/RegionInfo.cpp head/contrib/llvm/lib/Analysis/RegionPass.cpp head/contrib/llvm/lib/Analysis/RegionPrinter.cpp head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp head/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp head/contrib/llvm/lib/Analysis/ValueTracking.cpp head/contrib/llvm/lib/Archive/ArchiveReader.cpp head/contrib/llvm/lib/Archive/ArchiveWriter.cpp head/contrib/llvm/lib/AsmParser/LLLexer.cpp head/contrib/llvm/lib/AsmParser/LLParser.cpp head/contrib/llvm/lib/AsmParser/LLParser.h head/contrib/llvm/lib/AsmParser/LLToken.h head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp head/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp head/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/AllocationOrder.cpp head/contrib/llvm/lib/CodeGen/Analysis.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.h head/contrib/llvm/lib/CodeGen/BranchFolding.cpp head/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp head/contrib/llvm/lib/CodeGen/CallingConvLower.cpp head/contrib/llvm/lib/CodeGen/CodeGen.cpp head/contrib/llvm/lib/CodeGen/CodePlacementOpt.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h head/contrib/llvm/lib/CodeGen/DFAPacketizer.cpp head/contrib/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp head/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp head/contrib/llvm/lib/CodeGen/ExecutionDepsFix.cpp head/contrib/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp head/contrib/llvm/lib/CodeGen/IfConversion.cpp head/contrib/llvm/lib/CodeGen/InlineSpiller.cpp head/contrib/llvm/lib/CodeGen/InterferenceCache.cpp head/contrib/llvm/lib/CodeGen/InterferenceCache.h head/contrib/llvm/lib/CodeGen/IntrinsicLowering.cpp head/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp head/contrib/llvm/lib/CodeGen/LexicalScopes.cpp head/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp head/contrib/llvm/lib/CodeGen/LiveInterval.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalUnion.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalUnion.h head/contrib/llvm/lib/CodeGen/LiveRangeCalc.cpp head/contrib/llvm/lib/CodeGen/LiveRangeCalc.h head/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp head/contrib/llvm/lib/CodeGen/LiveVariables.cpp head/contrib/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp head/contrib/llvm/lib/CodeGen/MachineBlockPlacement.cpp head/contrib/llvm/lib/CodeGen/MachineCSE.cpp head/contrib/llvm/lib/CodeGen/MachineCopyPropagation.cpp head/contrib/llvm/lib/CodeGen/MachineFunction.cpp head/contrib/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp head/contrib/llvm/lib/CodeGen/MachineInstr.cpp head/contrib/llvm/lib/CodeGen/MachineInstrBundle.cpp head/contrib/llvm/lib/CodeGen/MachineLICM.cpp head/contrib/llvm/lib/CodeGen/MachineLoopInfo.cpp head/contrib/llvm/lib/CodeGen/MachinePassRegistry.cpp head/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp head/contrib/llvm/lib/CodeGen/MachineSSAUpdater.cpp head/contrib/llvm/lib/CodeGen/MachineScheduler.cpp head/contrib/llvm/lib/CodeGen/MachineSink.cpp head/contrib/llvm/lib/CodeGen/MachineVerifier.cpp head/contrib/llvm/lib/CodeGen/PHIElimination.cpp head/contrib/llvm/lib/CodeGen/Passes.cpp head/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp head/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp head/contrib/llvm/lib/CodeGen/ProcessImplicitDefs.cpp head/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp head/contrib/llvm/lib/CodeGen/RegAllocBase.cpp head/contrib/llvm/lib/CodeGen/RegAllocBase.h head/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp head/contrib/llvm/lib/CodeGen/RegAllocFast.cpp head/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp head/contrib/llvm/lib/CodeGen/RegAllocPBQP.cpp head/contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp head/contrib/llvm/lib/CodeGen/RegisterCoalescer.cpp head/contrib/llvm/lib/CodeGen/RegisterCoalescer.h head/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAG.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp head/contrib/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.h head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp head/contrib/llvm/lib/CodeGen/ShadowStackGC.cpp head/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp head/contrib/llvm/lib/CodeGen/SlotIndexes.cpp head/contrib/llvm/lib/CodeGen/SpillPlacement.cpp head/contrib/llvm/lib/CodeGen/SplitKit.cpp head/contrib/llvm/lib/CodeGen/StackProtector.cpp head/contrib/llvm/lib/CodeGen/StackSlotColoring.cpp head/contrib/llvm/lib/CodeGen/StrongPHIElimination.cpp head/contrib/llvm/lib/CodeGen/TailDuplication.cpp head/contrib/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp head/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp head/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp head/contrib/llvm/lib/CodeGen/VirtRegMap.cpp head/contrib/llvm/lib/CodeGen/VirtRegMap.h head/contrib/llvm/lib/DebugInfo/DWARFCompileUnit.cpp head/contrib/llvm/lib/DebugInfo/DWARFCompileUnit.h head/contrib/llvm/lib/DebugInfo/DWARFContext.cpp head/contrib/llvm/lib/DebugInfo/DWARFContext.h head/contrib/llvm/lib/DebugInfo/DWARFDebugAranges.cpp head/contrib/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp head/contrib/llvm/lib/DebugInfo/DWARFDebugInfoEntry.h head/contrib/llvm/lib/DebugInfo/DWARFDebugLine.cpp head/contrib/llvm/lib/DebugInfo/DWARFDebugLine.h head/contrib/llvm/lib/ExecutionEngine/EventListenerCommon.h head/contrib/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp head/contrib/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp head/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp head/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h head/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h head/contrib/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/ObjectImage.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h head/contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp head/contrib/llvm/lib/Linker/LinkModules.cpp head/contrib/llvm/lib/MC/ELFObjectWriter.cpp head/contrib/llvm/lib/MC/MCAsmBackend.cpp head/contrib/llvm/lib/MC/MCAsmInfo.cpp head/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp head/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp head/contrib/llvm/lib/MC/MCAsmStreamer.cpp head/contrib/llvm/lib/MC/MCAssembler.cpp head/contrib/llvm/lib/MC/MCContext.cpp head/contrib/llvm/lib/MC/MCDisassembler/Disassembler.h head/contrib/llvm/lib/MC/MCDisassembler/EDDisassembler.cpp head/contrib/llvm/lib/MC/MCDisassembler/EDMain.cpp head/contrib/llvm/lib/MC/MCDwarf.cpp head/contrib/llvm/lib/MC/MCELFObjectTargetWriter.cpp head/contrib/llvm/lib/MC/MCELFStreamer.cpp head/contrib/llvm/lib/MC/MCExpr.cpp head/contrib/llvm/lib/MC/MCMachOStreamer.cpp head/contrib/llvm/lib/MC/MCNullStreamer.cpp head/contrib/llvm/lib/MC/MCObjectFileInfo.cpp head/contrib/llvm/lib/MC/MCObjectWriter.cpp head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp head/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp head/contrib/llvm/lib/MC/MCPureStreamer.cpp head/contrib/llvm/lib/MC/MCSectionCOFF.cpp head/contrib/llvm/lib/MC/MCSectionELF.cpp head/contrib/llvm/lib/MC/MCStreamer.cpp head/contrib/llvm/lib/MC/MCSubtargetInfo.cpp head/contrib/llvm/lib/MC/MCSymbol.cpp head/contrib/llvm/lib/MC/MCWin64EH.cpp head/contrib/llvm/lib/MC/MachObjectWriter.cpp head/contrib/llvm/lib/MC/SubtargetFeature.cpp head/contrib/llvm/lib/MC/WinCOFFStreamer.cpp head/contrib/llvm/lib/Object/Archive.cpp head/contrib/llvm/lib/Object/COFFObjectFile.cpp head/contrib/llvm/lib/Object/MachOObject.cpp head/contrib/llvm/lib/Object/MachOObjectFile.cpp head/contrib/llvm/lib/Support/APFloat.cpp head/contrib/llvm/lib/Support/APInt.cpp head/contrib/llvm/lib/Support/CommandLine.cpp head/contrib/llvm/lib/Support/ConstantRange.cpp head/contrib/llvm/lib/Support/CrashRecoveryContext.cpp head/contrib/llvm/lib/Support/Debug.cpp head/contrib/llvm/lib/Support/Errno.cpp head/contrib/llvm/lib/Support/GraphWriter.cpp head/contrib/llvm/lib/Support/Host.cpp head/contrib/llvm/lib/Support/Memory.cpp head/contrib/llvm/lib/Support/MemoryBuffer.cpp head/contrib/llvm/lib/Support/Mutex.cpp head/contrib/llvm/lib/Support/Path.cpp head/contrib/llvm/lib/Support/PathV2.cpp head/contrib/llvm/lib/Support/SourceMgr.cpp head/contrib/llvm/lib/Support/StreamableMemoryObject.cpp head/contrib/llvm/lib/Support/StringMap.cpp head/contrib/llvm/lib/Support/StringRef.cpp head/contrib/llvm/lib/Support/TargetRegistry.cpp head/contrib/llvm/lib/Support/ThreadLocal.cpp head/contrib/llvm/lib/Support/Triple.cpp head/contrib/llvm/lib/Support/Unix/Path.inc head/contrib/llvm/lib/Support/Unix/PathV2.inc head/contrib/llvm/lib/Support/Unix/Process.inc head/contrib/llvm/lib/Support/Unix/Signals.inc head/contrib/llvm/lib/Support/Unix/Unix.h head/contrib/llvm/lib/Support/Windows/Path.inc head/contrib/llvm/lib/Support/Windows/PathV2.inc head/contrib/llvm/lib/Support/Windows/Process.inc head/contrib/llvm/lib/Support/Windows/RWMutex.inc head/contrib/llvm/lib/Support/Windows/ThreadLocal.inc head/contrib/llvm/lib/Support/YAMLParser.cpp head/contrib/llvm/lib/Support/raw_ostream.cpp head/contrib/llvm/lib/TableGen/Main.cpp head/contrib/llvm/lib/TableGen/Record.cpp head/contrib/llvm/lib/TableGen/TGParser.cpp head/contrib/llvm/lib/TableGen/TGParser.h head/contrib/llvm/lib/TableGen/TableGenBackend.cpp head/contrib/llvm/lib/Target/ARM/ARM.td head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.h head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h head/contrib/llvm/lib/Target/ARM/ARMCallingConv.td head/contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp head/contrib/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp head/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.h head/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td head/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td head/contrib/llvm/lib/Target/ARM/ARMInstrVFP.td head/contrib/llvm/lib/Target/ARM/ARMJITInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp head/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td head/contrib/llvm/lib/Target/ARM/ARMSchedule.td head/contrib/llvm/lib/Target/ARM/ARMScheduleA8.td head/contrib/llvm/lib/Target/ARM/ARMScheduleA9.td head/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMSubtarget.cpp head/contrib/llvm/lib/Target/ARM/ARMSubtarget.h head/contrib/llvm/lib/Target/ARM/ARMTargetMachine.cpp head/contrib/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp head/contrib/llvm/lib/Target/ARM/ARMTargetObjectFile.h head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp head/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp head/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp head/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp head/contrib/llvm/lib/Target/ARM/MLxExpansionPass.cpp head/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.h head/contrib/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp head/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.h head/contrib/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp head/contrib/llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp head/contrib/llvm/lib/Target/CellSPU/SPUHazardRecognizers.cpp head/contrib/llvm/lib/Target/CellSPU/SPUHazardRecognizers.h head/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.cpp head/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.h head/contrib/llvm/lib/Target/CellSPU/SPUInstrInfo.cpp head/contrib/llvm/lib/Target/CellSPU/SPUInstrInfo.td head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.h head/contrib/llvm/lib/Target/CellSPU/SPUTargetMachine.cpp head/contrib/llvm/lib/Target/CppBackend/CPPBackend.cpp head/contrib/llvm/lib/Target/CppBackend/CPPTargetMachine.h head/contrib/llvm/lib/Target/Hexagon/Hexagon.h head/contrib/llvm/lib/Target/Hexagon/Hexagon.td head/contrib/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonCallingConv.td head/contrib/llvm/lib/Target/Hexagon/HexagonCallingConvLower.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonExpandPredSpillCode.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.h head/contrib/llvm/lib/Target/Hexagon/HexagonImmediates.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormats.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormatsV4.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.h head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV3.td head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV4.td head/contrib/llvm/lib/Target/Hexagon/HexagonIntrinsics.td head/contrib/llvm/lib/Target/Hexagon/HexagonIntrinsicsDerived.td head/contrib/llvm/lib/Target/Hexagon/HexagonMCInstLower.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.h head/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.td head/contrib/llvm/lib/Target/Hexagon/HexagonRemoveSZExtArgs.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonSchedule.td head/contrib/llvm/lib/Target/Hexagon/HexagonScheduleV4.td head/contrib/llvm/lib/Target/Hexagon/HexagonSplitTFRCondSets.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp head/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h head/contrib/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp head/contrib/llvm/lib/Target/Hexagon/InstPrinter/HexagonInstPrinter.cpp head/contrib/llvm/lib/Target/Hexagon/InstPrinter/HexagonInstPrinter.h head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonBaseInfo.h head/contrib/llvm/lib/Target/MBlaze/MBlaze.td head/contrib/llvm/lib/Target/MBlaze/MBlazeAsmPrinter.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.h head/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.td head/contrib/llvm/lib/Target/MBlaze/MBlazeMCInstLower.h head/contrib/llvm/lib/Target/MBlaze/MBlazeSchedule.td head/contrib/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeTargetMachine.cpp head/contrib/llvm/lib/Target/MBlaze/MCTargetDesc/MBlazeMCCodeEmitter.cpp head/contrib/llvm/lib/Target/MBlaze/MCTargetDesc/MBlazeMCTargetDesc.h head/contrib/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp head/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp head/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.td head/contrib/llvm/lib/Target/MSP430/MSP430MCInstLower.h head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.td head/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp head/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp head/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp head/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsBaseInfo.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsFixupKinds.h head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.h head/contrib/llvm/lib/Target/Mips/Mips.h head/contrib/llvm/lib/Target/Mips/Mips.td head/contrib/llvm/lib/Target/Mips/Mips64InstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp head/contrib/llvm/lib/Target/Mips/MipsCallingConv.td head/contrib/llvm/lib/Target/Mips/MipsCodeEmitter.cpp head/contrib/llvm/lib/Target/Mips/MipsCondMov.td head/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp head/contrib/llvm/lib/Target/Mips/MipsFrameLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsFrameLowering.h head/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.h head/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td head/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsJITInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsJITInfo.h head/contrib/llvm/lib/Target/Mips/MipsMCInstLower.cpp head/contrib/llvm/lib/Target/Mips/MipsMCInstLower.h head/contrib/llvm/lib/Target/Mips/MipsMachineFunction.cpp head/contrib/llvm/lib/Target/Mips/MipsMachineFunction.h head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td head/contrib/llvm/lib/Target/Mips/MipsSubtarget.cpp head/contrib/llvm/lib/Target/Mips/MipsSubtarget.h head/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp head/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h head/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h head/contrib/llvm/lib/Target/PowerPC/PPC.h head/contrib/llvm/lib/Target/PowerPC/PPC.td head/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp head/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h head/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrAltivec.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrFormats.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCJITInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCSchedule.td head/contrib/llvm/lib/Target/PowerPC/PPCSchedule440.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleA2.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleG3.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleG4.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleG4Plus.td head/contrib/llvm/lib/Target/PowerPC/PPCScheduleG5.td head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h head/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp head/contrib/llvm/lib/Target/Sparc/DelaySlotFiller.cpp head/contrib/llvm/lib/Target/Sparc/SparcAsmPrinter.cpp head/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.h head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.cpp head/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.h head/contrib/llvm/lib/Target/TargetData.cpp head/contrib/llvm/lib/Target/TargetInstrInfo.cpp head/contrib/llvm/lib/Target/TargetLibraryInfo.cpp head/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp head/contrib/llvm/lib/Target/TargetMachine.cpp head/contrib/llvm/lib/Target/TargetRegisterInfo.cpp head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.h head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoderCommon.h head/contrib/llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h head/contrib/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp head/contrib/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h head/contrib/llvm/lib/Target/X86/X86.h head/contrib/llvm/lib/Target/X86/X86.td head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp head/contrib/llvm/lib/Target/X86/X86AsmPrinter.h head/contrib/llvm/lib/Target/X86/X86COFFMachineModuleInfo.cpp head/contrib/llvm/lib/Target/X86/X86COFFMachineModuleInfo.h head/contrib/llvm/lib/Target/X86/X86CallingConv.td head/contrib/llvm/lib/Target/X86/X86CodeEmitter.cpp head/contrib/llvm/lib/Target/X86/X86FastISel.cpp head/contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp head/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp head/contrib/llvm/lib/Target/X86/X86FrameLowering.h head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.h head/contrib/llvm/lib/Target/X86/X86InstrArithmetic.td head/contrib/llvm/lib/Target/X86/X86InstrBuilder.h head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td head/contrib/llvm/lib/Target/X86/X86InstrControl.td head/contrib/llvm/lib/Target/X86/X86InstrExtension.td head/contrib/llvm/lib/Target/X86/X86InstrFMA.td head/contrib/llvm/lib/Target/X86/X86InstrFPStack.td head/contrib/llvm/lib/Target/X86/X86InstrFormats.td head/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp head/contrib/llvm/lib/Target/X86/X86InstrInfo.h head/contrib/llvm/lib/Target/X86/X86InstrInfo.td head/contrib/llvm/lib/Target/X86/X86InstrMMX.td head/contrib/llvm/lib/Target/X86/X86InstrSSE.td head/contrib/llvm/lib/Target/X86/X86InstrSystem.td head/contrib/llvm/lib/Target/X86/X86InstrVMX.td head/contrib/llvm/lib/Target/X86/X86InstrXOP.td head/contrib/llvm/lib/Target/X86/X86JITInfo.h head/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp head/contrib/llvm/lib/Target/X86/X86MCInstLower.h head/contrib/llvm/lib/Target/X86/X86MachineFunctionInfo.h head/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.h head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td head/contrib/llvm/lib/Target/X86/X86Relocations.h head/contrib/llvm/lib/Target/X86/X86Schedule.td head/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td head/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp head/contrib/llvm/lib/Target/X86/X86Subtarget.h head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp head/contrib/llvm/lib/Target/X86/X86TargetObjectFile.cpp head/contrib/llvm/lib/Target/X86/X86TargetObjectFile.h head/contrib/llvm/lib/Target/X86/X86VZeroUpper.cpp head/contrib/llvm/lib/Target/XCore/XCoreAsmPrinter.cpp head/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.cpp head/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.h head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h head/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.cpp head/contrib/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp head/contrib/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp head/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalDCE.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp head/contrib/llvm/lib/Transforms/IPO/Inliner.cpp head/contrib/llvm/lib/Transforms/IPO/LoopExtractor.cpp head/contrib/llvm/lib/Transforms/IPO/MergeFunctions.cpp head/contrib/llvm/lib/Transforms/IPO/PartialInlining.cpp head/contrib/llvm/lib/Transforms/IPO/StripSymbols.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombine.h head/contrib/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp head/contrib/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp head/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp head/contrib/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp head/contrib/llvm/lib/Transforms/Scalar/ADCE.cpp head/contrib/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp head/contrib/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp head/contrib/llvm/lib/Transforms/Scalar/EarlyCSE.cpp head/contrib/llvm/lib/Transforms/Scalar/GVN.cpp head/contrib/llvm/lib/Transforms/Scalar/GlobalMerge.cpp head/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp head/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp head/contrib/llvm/lib/Transforms/Scalar/LICM.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopDeletion.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp head/contrib/llvm/lib/Transforms/Scalar/LowerAtomic.cpp head/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp head/contrib/llvm/lib/Transforms/Scalar/ObjCARC.cpp head/contrib/llvm/lib/Transforms/Scalar/Reassociate.cpp head/contrib/llvm/lib/Transforms/Scalar/Reg2Mem.cpp head/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp head/contrib/llvm/lib/Transforms/Scalar/Scalar.cpp head/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp head/contrib/llvm/lib/Transforms/Scalar/Sink.cpp head/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp head/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp head/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp head/contrib/llvm/lib/Transforms/Utils/BuildLibCalls.cpp head/contrib/llvm/lib/Transforms/Utils/CloneFunction.cpp head/contrib/llvm/lib/Transforms/Utils/CloneModule.cpp head/contrib/llvm/lib/Transforms/Utils/CodeExtractor.cpp head/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp head/contrib/llvm/lib/Transforms/Utils/Local.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUnroll.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp head/contrib/llvm/lib/Transforms/Utils/LowerExpectIntrinsic.cpp head/contrib/llvm/lib/Transforms/Utils/LowerSwitch.cpp head/contrib/llvm/lib/Transforms/Utils/ModuleUtils.cpp head/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp head/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp head/contrib/llvm/lib/Transforms/Vectorize/BBVectorize.cpp head/contrib/llvm/lib/VMCore/AsmWriter.cpp head/contrib/llvm/lib/VMCore/Attributes.cpp head/contrib/llvm/lib/VMCore/AutoUpgrade.cpp head/contrib/llvm/lib/VMCore/ConstantFold.cpp head/contrib/llvm/lib/VMCore/Constants.cpp head/contrib/llvm/lib/VMCore/Core.cpp head/contrib/llvm/lib/VMCore/DebugLoc.cpp head/contrib/llvm/lib/VMCore/Dominators.cpp head/contrib/llvm/lib/VMCore/Function.cpp head/contrib/llvm/lib/VMCore/GCOV.cpp head/contrib/llvm/lib/VMCore/Globals.cpp head/contrib/llvm/lib/VMCore/IRBuilder.cpp head/contrib/llvm/lib/VMCore/Instruction.cpp head/contrib/llvm/lib/VMCore/Instructions.cpp head/contrib/llvm/lib/VMCore/Metadata.cpp head/contrib/llvm/lib/VMCore/Module.cpp head/contrib/llvm/lib/VMCore/PassManager.cpp head/contrib/llvm/lib/VMCore/Type.cpp head/contrib/llvm/lib/VMCore/Value.cpp head/contrib/llvm/lib/VMCore/ValueTypes.cpp head/contrib/llvm/lib/VMCore/Verifier.cpp head/contrib/llvm/tools/bugpoint/BugDriver.cpp head/contrib/llvm/tools/bugpoint/ExtractFunction.cpp head/contrib/llvm/tools/clang/include/clang-c/Index.h head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h head/contrib/llvm/tools/clang/include/clang/AST/ASTImporter.h head/contrib/llvm/tools/clang/include/clang/AST/ASTVector.h head/contrib/llvm/tools/clang/include/clang/AST/Attr.h head/contrib/llvm/tools/clang/include/clang/AST/BaseSubobject.h head/contrib/llvm/tools/clang/include/clang/AST/CXXInheritance.h head/contrib/llvm/tools/clang/include/clang/AST/Decl.h head/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h head/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h head/contrib/llvm/tools/clang/include/clang/AST/DeclContextInternals.h head/contrib/llvm/tools/clang/include/clang/AST/DeclFriend.h head/contrib/llvm/tools/clang/include/clang/AST/DeclGroup.h head/contrib/llvm/tools/clang/include/clang/AST/DeclLookups.h head/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h head/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h head/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h head/contrib/llvm/tools/clang/include/clang/AST/EvaluatedExprVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/Expr.h head/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h head/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h head/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h head/contrib/llvm/tools/clang/include/clang/AST/Mangle.h head/contrib/llvm/tools/clang/include/clang/AST/NSAPI.h head/contrib/llvm/tools/clang/include/clang/AST/NestedNameSpecifier.h head/contrib/llvm/tools/clang/include/clang/AST/OperationKinds.h head/contrib/llvm/tools/clang/include/clang/AST/PrettyPrinter.h head/contrib/llvm/tools/clang/include/clang/AST/RecordLayout.h head/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/Redeclarable.h head/contrib/llvm/tools/clang/include/clang/AST/Stmt.h head/contrib/llvm/tools/clang/include/clang/AST/StmtObjC.h head/contrib/llvm/tools/clang/include/clang/AST/TemplateBase.h head/contrib/llvm/tools/clang/include/clang/AST/Type.h head/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h head/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchers.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/FormatString.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/ThreadSafety.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/UninitializedValues.h head/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h head/contrib/llvm/tools/clang/include/clang/Analysis/CFG.h head/contrib/llvm/tools/clang/include/clang/Analysis/CallGraph.h head/contrib/llvm/tools/clang/include/clang/Analysis/ProgramPoint.h head/contrib/llvm/tools/clang/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h head/contrib/llvm/tools/clang/include/clang/Basic/ABI.h head/contrib/llvm/tools/clang/include/clang/Basic/AddressSpaces.h head/contrib/llvm/tools/clang/include/clang/Basic/AllDiagnostics.h head/contrib/llvm/tools/clang/include/clang/Basic/Attr.td head/contrib/llvm/tools/clang/include/clang/Basic/AttrKinds.h head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsHexagon.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def head/contrib/llvm/tools/clang/include/clang/Basic/ConvertUTF.h head/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSerializationKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/ExceptionSpecificationType.h head/contrib/llvm/tools/clang/include/clang/Basic/ExpressionTraits.h head/contrib/llvm/tools/clang/include/clang/Basic/FileManager.h head/contrib/llvm/tools/clang/include/clang/Basic/FileSystemOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/FileSystemStatCache.h head/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h head/contrib/llvm/tools/clang/include/clang/Basic/LLVM.h head/contrib/llvm/tools/clang/include/clang/Basic/Lambda.h head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.def head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/Linkage.h head/contrib/llvm/tools/clang/include/clang/Basic/MacroBuilder.h head/contrib/llvm/tools/clang/include/clang/Basic/Module.h head/contrib/llvm/tools/clang/include/clang/Basic/OnDiskHashTable.h head/contrib/llvm/tools/clang/include/clang/Basic/OpenCL.h head/contrib/llvm/tools/clang/include/clang/Basic/OperatorKinds.h head/contrib/llvm/tools/clang/include/clang/Basic/PartialDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/PrettyStackTrace.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceManagerInternals.h head/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h head/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/TargetBuiltins.h head/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h head/contrib/llvm/tools/clang/include/clang/Basic/TargetOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/TemplateKinds.h head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.h head/contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h head/contrib/llvm/tools/clang/include/clang/Basic/Version.h head/contrib/llvm/tools/clang/include/clang/Basic/VersionTuple.h head/contrib/llvm/tools/clang/include/clang/Basic/Visibility.h head/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td head/contrib/llvm/tools/clang/include/clang/Driver/Arg.h head/contrib/llvm/tools/clang/include/clang/Driver/ArgList.h head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.h head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td head/contrib/llvm/tools/clang/include/clang/Driver/Compilation.h head/contrib/llvm/tools/clang/include/clang/Driver/Driver.h head/contrib/llvm/tools/clang/include/clang/Driver/OptParser.td head/contrib/llvm/tools/clang/include/clang/Driver/OptTable.h head/contrib/llvm/tools/clang/include/clang/Driver/Option.h head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h head/contrib/llvm/tools/clang/include/clang/Driver/Types.def head/contrib/llvm/tools/clang/include/clang/Driver/Types.h head/contrib/llvm/tools/clang/include/clang/Frontend/ASTConsumers.h head/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h head/contrib/llvm/tools/clang/include/clang/Frontend/Analyses.def head/contrib/llvm/tools/clang/include/clang/Frontend/AnalyzerOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInstance.h head/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInvocation.h head/contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticRenderer.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendAction.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendActions.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/HeaderSearchOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/LangStandards.def head/contrib/llvm/tools/clang/include/clang/Frontend/PreprocessorOutputOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnosticPrinter.h head/contrib/llvm/tools/clang/include/clang/Frontend/VerifyDiagnosticConsumer.h head/contrib/llvm/tools/clang/include/clang/Lex/CodeCompletionHandler.h head/contrib/llvm/tools/clang/include/clang/Lex/DirectoryLookup.h head/contrib/llvm/tools/clang/include/clang/Lex/HeaderMap.h head/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h head/contrib/llvm/tools/clang/include/clang/Lex/Lexer.h head/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h head/contrib/llvm/tools/clang/include/clang/Lex/MacroInfo.h head/contrib/llvm/tools/clang/include/clang/Lex/ModuleMap.h head/contrib/llvm/tools/clang/include/clang/Lex/MultipleIncludeOpt.h head/contrib/llvm/tools/clang/include/clang/Lex/PPCallbacks.h head/contrib/llvm/tools/clang/include/clang/Lex/PTHManager.h head/contrib/llvm/tools/clang/include/clang/Lex/Pragma.h head/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h head/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h head/contrib/llvm/tools/clang/include/clang/Lex/PreprocessorLexer.h head/contrib/llvm/tools/clang/include/clang/Lex/Token.h head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h head/contrib/llvm/tools/clang/include/clang/Rewrite/FrontendActions.h head/contrib/llvm/tools/clang/include/clang/Rewrite/Rewriter.h head/contrib/llvm/tools/clang/include/clang/Rewrite/Rewriters.h head/contrib/llvm/tools/clang/include/clang/Rewrite/TokenRewriter.h head/contrib/llvm/tools/clang/include/clang/Sema/AttributeList.h head/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h head/contrib/llvm/tools/clang/include/clang/Sema/DelayedDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Sema/Designator.h head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h head/contrib/llvm/tools/clang/include/clang/Sema/Overload.h head/contrib/llvm/tools/clang/include/clang/Sema/ParsedTemplate.h head/contrib/llvm/tools/clang/include/clang/Sema/Scope.h head/contrib/llvm/tools/clang/include/clang/Sema/ScopeInfo.h head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h head/contrib/llvm/tools/clang/include/clang/Sema/Template.h head/contrib/llvm/tools/clang/include/clang/Sema/TemplateDeduction.h head/contrib/llvm/tools/clang/include/clang/Sema/Weak.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h head/contrib/llvm/tools/clang/include/clang/Tooling/CompilationDatabase.h head/contrib/llvm/tools/clang/include/clang/Tooling/Tooling.h head/contrib/llvm/tools/clang/lib/ARCMigrate/ARCMT.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/FileRemapper.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/Internals.h head/contrib/llvm/tools/clang/lib/ARCMigrate/ObjCMT.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransAPIUses.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransARCAssign.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransAutoreleasePool.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransBlockObjCVariable.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransGCAttrs.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransGCCalls.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransProperties.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransUnbridgedCasts.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransUnusedInitDelegate.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/TransformActions.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/Transforms.cpp head/contrib/llvm/tools/clang/lib/ARCMigrate/Transforms.h head/contrib/llvm/tools/clang/lib/AST/APValue.cpp head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp head/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp head/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp head/contrib/llvm/tools/clang/lib/AST/CXXABI.h head/contrib/llvm/tools/clang/lib/AST/CXXInheritance.cpp head/contrib/llvm/tools/clang/lib/AST/Decl.cpp head/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp head/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp head/contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp head/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp head/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp head/contrib/llvm/tools/clang/lib/AST/DeclarationName.cpp head/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp head/contrib/llvm/tools/clang/lib/AST/Expr.cpp head/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp head/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp head/contrib/llvm/tools/clang/lib/AST/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp head/contrib/llvm/tools/clang/lib/AST/LambdaMangleContext.cpp head/contrib/llvm/tools/clang/lib/AST/Mangle.cpp head/contrib/llvm/tools/clang/lib/AST/MicrosoftCXXABI.cpp head/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp head/contrib/llvm/tools/clang/lib/AST/NSAPI.cpp head/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp head/contrib/llvm/tools/clang/lib/AST/ParentMap.cpp head/contrib/llvm/tools/clang/lib/AST/RecordLayout.cpp head/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/AST/Stmt.cpp head/contrib/llvm/tools/clang/lib/AST/StmtDumper.cpp head/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp head/contrib/llvm/tools/clang/lib/AST/TemplateBase.cpp head/contrib/llvm/tools/clang/lib/AST/Type.cpp head/contrib/llvm/tools/clang/lib/AST/TypeLoc.cpp head/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp head/contrib/llvm/tools/clang/lib/AST/VTTBuilder.cpp head/contrib/llvm/tools/clang/lib/AST/VTableBuilder.cpp head/contrib/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp head/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp head/contrib/llvm/tools/clang/lib/Analysis/CallGraph.cpp head/contrib/llvm/tools/clang/lib/Analysis/CocoaConventions.cpp head/contrib/llvm/tools/clang/lib/Analysis/FormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/ProgramPoint.cpp head/contrib/llvm/tools/clang/lib/Analysis/PseudoConstantAnalysis.cpp head/contrib/llvm/tools/clang/lib/Analysis/ScanfFormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/ThreadSafety.cpp head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp head/contrib/llvm/tools/clang/lib/Basic/ConvertUTF.c head/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp head/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp head/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp head/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp head/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp head/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/contrib/llvm/tools/clang/lib/Basic/VersionTuple.cpp head/contrib/llvm/tools/clang/lib/CodeGen/ABIInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBuilder.h head/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.h head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.h head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.h head/contrib/llvm/tools/clang/lib/CodeGen/CGRTTI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayout.h head/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGValue.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h head/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Driver/ArgList.cpp head/contrib/llvm/tools/clang/lib/Driver/Compilation.cpp head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp head/contrib/llvm/tools/clang/lib/Driver/OptTable.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp head/contrib/llvm/tools/clang/lib/Driver/Tools.h head/contrib/llvm/tools/clang/lib/Driver/Types.cpp head/contrib/llvm/tools/clang/lib/Edit/Commit.cpp head/contrib/llvm/tools/clang/lib/Edit/EditedSource.cpp head/contrib/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp head/contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp head/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp head/contrib/llvm/tools/clang/lib/Frontend/CacheTokens.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp head/contrib/llvm/tools/clang/lib/Frontend/DiagnosticRenderer.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendActions.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp head/contrib/llvm/tools/clang/lib/Frontend/LayoutOverrideSource.cpp head/contrib/llvm/tools/clang/lib/Frontend/PrintPreprocessedOutput.cpp head/contrib/llvm/tools/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp head/contrib/llvm/tools/clang/lib/Frontend/TextDiagnostic.cpp head/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp head/contrib/llvm/tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp head/contrib/llvm/tools/clang/lib/Frontend/Warnings.cpp head/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Headers/avx2intrin.h head/contrib/llvm/tools/clang/lib/Headers/bmiintrin.h head/contrib/llvm/tools/clang/lib/Headers/emmintrin.h head/contrib/llvm/tools/clang/lib/Headers/float.h head/contrib/llvm/tools/clang/lib/Headers/immintrin.h head/contrib/llvm/tools/clang/lib/Headers/stddef.h head/contrib/llvm/tools/clang/lib/Headers/wmmintrin.h head/contrib/llvm/tools/clang/lib/Headers/x86intrin.h head/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp head/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp head/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp head/contrib/llvm/tools/clang/lib/Lex/PPLexerChange.cpp head/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp head/contrib/llvm/tools/clang/lib/Lex/PTHLexer.cpp head/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp head/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp head/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp head/contrib/llvm/tools/clang/lib/Lex/PreprocessorLexer.cpp head/contrib/llvm/tools/clang/lib/Lex/TokenConcatenation.cpp head/contrib/llvm/tools/clang/lib/Lex/TokenLexer.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseAST.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/Parse/ParseObjc.cpp head/contrib/llvm/tools/clang/lib/Parse/ParsePragma.h head/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp head/contrib/llvm/tools/clang/lib/Parse/Parser.cpp head/contrib/llvm/tools/clang/lib/Parse/RAIIObjectsForParser.h head/contrib/llvm/tools/clang/lib/Rewrite/FrontendActions.cpp head/contrib/llvm/tools/clang/lib/Rewrite/HTMLRewrite.cpp head/contrib/llvm/tools/clang/lib/Rewrite/RewriteModernObjC.cpp head/contrib/llvm/tools/clang/lib/Rewrite/RewriteObjC.cpp head/contrib/llvm/tools/clang/lib/Rewrite/Rewriter.cpp head/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp head/contrib/llvm/tools/clang/lib/Sema/AttributeList.cpp head/contrib/llvm/tools/clang/lib/Sema/CodeCompleteConsumer.cpp head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/Sema.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprMember.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaFixItUtils.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLambda.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaObjCProperty.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaPseudoObject.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaStmtAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp head/contrib/llvm/tools/clang/lib/Sema/TargetAttributesSema.cpp head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h head/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.h head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/Checkers.td head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporter.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Environment.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/MemRegion.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ProgramState.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SVals.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Store.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp head/contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp head/contrib/llvm/tools/clang/lib/Tooling/Tooling.cpp head/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp head/contrib/llvm/tools/clang/tools/driver/driver.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangASTNodesEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangAttrEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/ClangSACheckersEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/NeonEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.cpp head/contrib/llvm/tools/clang/utils/TableGen/TableGen.cpp head/contrib/llvm/tools/llc/llc.cpp head/contrib/llvm/tools/lli/lli.cpp head/contrib/llvm/tools/llvm-ar/llvm-ar.cpp head/contrib/llvm/tools/llvm-diff/DiffConsumer.cpp head/contrib/llvm/tools/llvm-diff/DiffConsumer.h head/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp head/contrib/llvm/tools/llvm-diff/DifferenceEngine.h head/contrib/llvm/tools/llvm-diff/llvm-diff.cpp head/contrib/llvm/tools/llvm-dis/llvm-dis.cpp head/contrib/llvm/tools/llvm-mc/llvm-mc.cpp head/contrib/llvm/tools/llvm-nm/llvm-nm.cpp head/contrib/llvm/tools/llvm-objdump/MachODump.cpp head/contrib/llvm/tools/llvm-objdump/llvm-objdump.cpp head/contrib/llvm/tools/llvm-prof/llvm-prof.cpp head/contrib/llvm/tools/llvm-ranlib/llvm-ranlib.cpp head/contrib/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp head/contrib/llvm/tools/llvm-stress/llvm-stress.cpp head/contrib/llvm/tools/macho-dump/macho-dump.cpp head/contrib/llvm/tools/opt/opt.cpp head/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp head/contrib/llvm/utils/TableGen/CallingConvEmitter.cpp head/contrib/llvm/utils/TableGen/CodeEmitterGen.cpp head/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.cpp head/contrib/llvm/utils/TableGen/CodeGenInstruction.cpp head/contrib/llvm/utils/TableGen/CodeGenInstruction.h head/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h head/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp head/contrib/llvm/utils/TableGen/CodeGenRegisters.h head/contrib/llvm/utils/TableGen/CodeGenTarget.cpp head/contrib/llvm/utils/TableGen/CodeGenTarget.h head/contrib/llvm/utils/TableGen/DAGISelEmitter.cpp head/contrib/llvm/utils/TableGen/DAGISelMatcher.h head/contrib/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp head/contrib/llvm/utils/TableGen/DFAPacketizerEmitter.cpp head/contrib/llvm/utils/TableGen/DisassemblerEmitter.cpp head/contrib/llvm/utils/TableGen/EDEmitter.cpp head/contrib/llvm/utils/TableGen/FastISelEmitter.cpp head/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp head/contrib/llvm/utils/TableGen/InstrInfoEmitter.cpp head/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp head/contrib/llvm/utils/TableGen/PseudoLoweringEmitter.cpp head/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp head/contrib/llvm/utils/TableGen/SequenceToOffsetTable.h head/contrib/llvm/utils/TableGen/SetTheory.cpp head/contrib/llvm/utils/TableGen/StringToOffsetTable.h head/contrib/llvm/utils/TableGen/SubtargetEmitter.cpp head/contrib/llvm/utils/TableGen/TableGen.cpp head/contrib/llvm/utils/TableGen/X86DisassemblerShared.h head/contrib/llvm/utils/TableGen/X86DisassemblerTables.cpp head/contrib/llvm/utils/TableGen/X86DisassemblerTables.h head/contrib/llvm/utils/TableGen/X86RecognizableInstr.cpp head/contrib/llvm/utils/TableGen/X86RecognizableInstr.h head/etc/mtree/BSD.include.dist head/lib/clang/Makefile head/lib/clang/clang.build.mk head/lib/clang/include/Makefile head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/llvm/Config/AsmParsers.def head/lib/clang/include/llvm/Config/Disassemblers.def head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h head/lib/clang/libclanganalysis/Makefile head/lib/clang/libclangarcmigrate/Makefile head/lib/clang/libclangast/Makefile head/lib/clang/libclangbasic/Makefile head/lib/clang/libclangcodegen/Makefile head/lib/clang/libclangdriver/Makefile head/lib/clang/libclangedit/Makefile head/lib/clang/libclangfrontend/Makefile head/lib/clang/libclangfrontendtool/Makefile head/lib/clang/libclangparse/Makefile head/lib/clang/libclangrewrite/Makefile head/lib/clang/libclangsema/Makefile head/lib/clang/libclangserialization/Makefile head/lib/clang/libclangstaticanalyzercheckers/Makefile head/lib/clang/libclangstaticanalyzercore/Makefile head/lib/clang/libclangstaticanalyzerfrontend/Makefile head/lib/clang/libllvmanalysis/Makefile head/lib/clang/libllvmcodegen/Makefile head/lib/clang/libllvmcore/Makefile head/lib/clang/libllvminstrumentation/Makefile head/lib/clang/libllvmmc/Makefile head/lib/clang/libllvmmipscodegen/Makefile head/lib/clang/libllvmmipsinstprinter/Makefile head/lib/clang/libllvmpowerpccodegen/Makefile head/lib/clang/libllvmtablegen/Makefile head/sys/conf/files head/sys/conf/kern.mk head/sys/modules/ath/Makefile head/sys/modules/bwn/Makefile head/sys/modules/ips/Makefile head/sys/modules/mps/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/clang/Makefile head/usr.bin/clang/bugpoint/bugpoint.1 head/usr.bin/clang/clang-tblgen/Makefile head/usr.bin/clang/clang/Makefile head/usr.bin/clang/clang/clang.1 head/usr.bin/clang/llc/Makefile head/usr.bin/clang/llc/llc.1 head/usr.bin/clang/lli/lli.1 head/usr.bin/clang/llvm-ar/llvm-ar.1 head/usr.bin/clang/llvm-as/llvm-as.1 head/usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1 head/usr.bin/clang/llvm-diff/llvm-diff.1 head/usr.bin/clang/llvm-dis/Makefile head/usr.bin/clang/llvm-dis/llvm-dis.1 head/usr.bin/clang/llvm-extract/Makefile head/usr.bin/clang/llvm-extract/llvm-extract.1 head/usr.bin/clang/llvm-link/Makefile head/usr.bin/clang/llvm-link/llvm-link.1 head/usr.bin/clang/llvm-mc/Makefile head/usr.bin/clang/llvm-nm/llvm-nm.1 head/usr.bin/clang/llvm-objdump/Makefile head/usr.bin/clang/llvm-prof/Makefile head/usr.bin/clang/llvm-prof/llvm-prof.1 head/usr.bin/clang/llvm-ranlib/llvm-ranlib.1 head/usr.bin/clang/llvm-rtdyld/Makefile head/usr.bin/clang/opt/opt.1 head/usr.bin/clang/tblgen/Makefile head/usr.bin/clang/tblgen/tblgen.1 head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Aug 20 18:32:46 2012 (r239461) +++ head/ObsoleteFiles.inc Mon Aug 20 18:33:03 2012 (r239462) @@ -38,6 +38,31 @@ # xargs -n1 | sort | uniq -d; # done +# 20120816: new clang import which bumps version from 3.1 to 3.2 +OLD_FILES+=usr/include/clang/3.1/altivec.h +OLD_FILES+=usr/include/clang/3.1/avx2intrin.h +OLD_FILES+=usr/include/clang/3.1/avxintrin.h +OLD_FILES+=usr/include/clang/3.1/bmi2intrin.h +OLD_FILES+=usr/include/clang/3.1/bmiintrin.h +OLD_FILES+=usr/include/clang/3.1/cpuid.h +OLD_FILES+=usr/include/clang/3.1/emmintrin.h +OLD_FILES+=usr/include/clang/3.1/fma4intrin.h +OLD_FILES+=usr/include/clang/3.1/immintrin.h +OLD_FILES+=usr/include/clang/3.1/lzcntintrin.h +OLD_FILES+=usr/include/clang/3.1/mm3dnow.h +OLD_FILES+=usr/include/clang/3.1/mm_malloc.h +OLD_FILES+=usr/include/clang/3.1/mmintrin.h +OLD_FILES+=usr/include/clang/3.1/module.map +OLD_FILES+=usr/include/clang/3.1/nmmintrin.h +OLD_FILES+=usr/include/clang/3.1/pmmintrin.h +OLD_FILES+=usr/include/clang/3.1/popcntintrin.h +OLD_FILES+=usr/include/clang/3.1/smmintrin.h +OLD_FILES+=usr/include/clang/3.1/tmmintrin.h +OLD_FILES+=usr/include/clang/3.1/unwind.h +OLD_FILES+=usr/include/clang/3.1/wmmintrin.h +OLD_FILES+=usr/include/clang/3.1/x86intrin.h +OLD_FILES+=usr/include/clang/3.1/xmmintrin.h +OLD_DIRS+=usr/include/clang/3.1 # 20120712: OpenSSL 1.0.1c import OLD_LIBS+=lib/libcrypto.so.6 OLD_LIBS+=usr/lib/libssl.so.6 Modified: head/contrib/llvm/include/llvm-c/Core.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Core.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm-c/Core.h Mon Aug 20 18:33:03 2012 (r239462) @@ -21,9 +21,9 @@ /* Need these includes to support the LLVM 'cast' template for the C++ 'wrap' and 'unwrap' conversion functions. */ +#include "llvm/IRBuilder.h" #include "llvm/Module.h" #include "llvm/PassRegistry.h" -#include "llvm/Support/IRBuilder.h" extern "C" { #endif @@ -53,7 +53,7 @@ extern "C" { * The declared parameter names are descriptive and specify which type is * required. Additionally, each type hierarchy is documented along with the * functions that operate upon it. For more detail, refer to LLVM's C++ code. - * If in doubt, refer to Core.cpp, which performs paramter downcasts in the + * If in doubt, refer to Core.cpp, which performs parameter downcasts in the * form unwrap(Param). * * Many exotic languages can interoperate with C code but have a harder time @@ -106,7 +106,7 @@ typedef struct LLVMOpaqueType *LLVMTypeR typedef struct LLVMOpaqueValue *LLVMValueRef; /** - * Represents a basic block of instruction in LLVM IR. + * Represents a basic block of instructions in LLVM IR. * * This models llvm::BasicBlock. */ @@ -478,6 +478,15 @@ void LLVMSetTarget(LLVMModuleRef M, cons void LLVMDumpModule(LLVMModuleRef M); /** + * Print a representation of a module to a file. The ErrorMessage needs to be + * disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise. + * + * @see Module::print() + */ +LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, + char **ErrorMessage); + +/** * Set inline assembly for a module. * * @see Module::setModuleInlineAsm() @@ -977,7 +986,7 @@ LLVMTypeRef LLVMX86MMXType(void); * * LLVMValueRef essentially represents llvm::Value. There is a rich * hierarchy of classes within this type. Depending on the instance - * obtain, not all APIs are available. + * obtained, not all APIs are available. * * Callers can determine the type of a LLVMValueRef by calling the * LLVMIsA* family of functions (e.g. LLVMIsAArgument()). These @@ -1153,7 +1162,7 @@ LLVM_FOR_EACH_VALUE_SUBCLASS(LLVM_DECLAR * * Uses are obtained in an iterator fashion. First, call this function * to obtain a reference to the first use. Then, call LLVMGetNextUse() - * on that instance and all subsequently obtained instances untl + * on that instance and all subsequently obtained instances until * LLVMGetNextUse() returns NULL. * * @see llvm::Value::use_begin() @@ -2106,7 +2115,7 @@ LLVMBasicBlockRef LLVMGetInstructionPare LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst); /** - * Obtain the instruction that occured before this one. + * Obtain the instruction that occurred before this one. * * If the instruction is the first instruction in a basic block, NULL * will be returned. Modified: head/contrib/llvm/include/llvm-c/Disassembler.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Disassembler.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm-c/Disassembler.h Mon Aug 20 18:33:03 2012 (r239462) @@ -109,9 +109,9 @@ struct LLVMOpInfo1 { */ typedef const char *(*LLVMSymbolLookupCallback)(void *DisInfo, uint64_t ReferenceValue, - uint64_t *ReferenceType, - uint64_t ReferencePC, - const char **ReferenceName); + uint64_t *ReferenceType, + uint64_t ReferencePC, + const char **ReferenceName); /** * The reference types on input and output. */ Copied: head/contrib/llvm/include/llvm-c/Linker.h (from r239314, vendor/llvm/dist/include/llvm-c/Linker.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/include/llvm-c/Linker.h Mon Aug 20 18:33:03 2012 (r239462, copy of r239314, vendor/llvm/dist/include/llvm-c/Linker.h) @@ -0,0 +1,42 @@ +/*===-- llvm-c/Linker.h - Module Linker C Interface -------------*- C++ -*-===*\ +|* *| +|* The LLVM Compiler Infrastructure *| +|* *| +|* This file is distributed under the University of Illinois Open Source *| +|* License. See LICENSE.TXT for details. *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This file defines the C interface to the module/file/archive linker. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_C_LINKER_H +#define LLVM_C_LINKER_H + +#include "llvm-c/Core.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +typedef enum { + LLVMLinkerDestroySource = 0, /* Allow source module to be destroyed. */ + LLVMLinkerPreserveSource = 1 /* Preserve the source module. */ +} LLVMLinkerMode; + + +/* Links the source module into the destination module, taking ownership + * of the source module away from the caller. Optionally returns a + * human-readable description of any errors that occurred in linking. + * OutMessage must be disposed with LLVMDisposeMessage. The return value + * is true if an error occurred, false otherwise. */ +LLVMBool LLVMLinkModules(LLVMModuleRef Dest, LLVMModuleRef Src, + LLVMLinkerMode Mode, char **OutMessage); + +#ifdef __cplusplus +} +#endif + +#endif Modified: head/contrib/llvm/include/llvm-c/Target.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Target.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm-c/Target.h Mon Aug 20 18:33:03 2012 (r239462) @@ -56,19 +56,19 @@ typedef struct LLVMStructLayout *LLVMStr /* Declare all of the available assembly printer initialization functions. */ #define LLVM_ASM_PRINTER(TargetName) \ - void LLVMInitialize##TargetName##AsmPrinter(); + void LLVMInitialize##TargetName##AsmPrinter(void); #include "llvm/Config/AsmPrinters.def" #undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */ /* Declare all of the available assembly parser initialization functions. */ #define LLVM_ASM_PARSER(TargetName) \ - void LLVMInitialize##TargetName##AsmParser(); + void LLVMInitialize##TargetName##AsmParser(void); #include "llvm/Config/AsmParsers.def" #undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */ /* Declare all of the available disassembler initialization functions. */ #define LLVM_DISASSEMBLER(TargetName) \ - void LLVMInitialize##TargetName##Disassembler(); + void LLVMInitialize##TargetName##Disassembler(void); #include "llvm/Config/Disassemblers.def" #undef LLVM_DISASSEMBLER /* Explicit undef to make SWIG happier */ @@ -102,7 +102,7 @@ static inline void LLVMInitializeAllTarg /** LLVMInitializeAllAsmPrinters - The main program should call this function if it wants all asm printers that LLVM is configured to support, to make them available via the TargetRegistry. */ -static inline void LLVMInitializeAllAsmPrinters() { +static inline void LLVMInitializeAllAsmPrinters(void) { #define LLVM_ASM_PRINTER(TargetName) LLVMInitialize##TargetName##AsmPrinter(); #include "llvm/Config/AsmPrinters.def" #undef LLVM_ASM_PRINTER /* Explicit undef to make SWIG happier */ @@ -111,7 +111,7 @@ static inline void LLVMInitializeAllAsmP /** LLVMInitializeAllAsmParsers - The main program should call this function if it wants all asm parsers that LLVM is configured to support, to make them available via the TargetRegistry. */ -static inline void LLVMInitializeAllAsmParsers() { +static inline void LLVMInitializeAllAsmParsers(void) { #define LLVM_ASM_PARSER(TargetName) LLVMInitialize##TargetName##AsmParser(); #include "llvm/Config/AsmParsers.def" #undef LLVM_ASM_PARSER /* Explicit undef to make SWIG happier */ @@ -120,7 +120,7 @@ static inline void LLVMInitializeAllAsmP /** LLVMInitializeAllDisassemblers - The main program should call this function if it wants all disassemblers that LLVM is configured to support, to make them available via the TargetRegistry. */ -static inline void LLVMInitializeAllDisassemblers() { +static inline void LLVMInitializeAllDisassemblers(void) { #define LLVM_DISASSEMBLER(TargetName) \ LLVMInitialize##TargetName##Disassembler(); #include "llvm/Config/Disassemblers.def" Modified: head/contrib/llvm/include/llvm/ADT/APFloat.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/APFloat.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm/ADT/APFloat.h Mon Aug 20 18:33:03 2012 (r239462) @@ -274,6 +274,7 @@ namespace llvm { /* C fmod, or llvm frem. */ opStatus mod(const APFloat &, roundingMode); opStatus fusedMultiplyAdd(const APFloat &, const APFloat &, roundingMode); + opStatus roundToIntegral(roundingMode); /* Sign operations. */ void changeSign(); Modified: head/contrib/llvm/include/llvm/ADT/APInt.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/APInt.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm/ADT/APInt.h Mon Aug 20 18:33:03 2012 (r239462) @@ -16,6 +16,7 @@ #define LLVM_APINT_H #include "llvm/ADT/ArrayRef.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/MathExtras.h" #include #include @@ -273,6 +274,13 @@ public: initSlowCase(that); } +#if LLVM_USE_RVALUE_REFERENCES + /// @brief Move Constructor. + APInt(APInt&& that) : BitWidth(that.BitWidth), VAL(that.VAL) { + that.BitWidth = 0; + } +#endif + /// @brief Destructor. ~APInt() { if (!isSingleWord()) @@ -349,13 +357,7 @@ public: /// @brief Check if this APInt has an N-bits unsigned integer value. bool isIntN(unsigned N) const { assert(N && "N == 0 ???"); - if (N >= getBitWidth()) - return true; - - if (isSingleWord()) - return isUIntN(N, VAL); - return APInt(N, makeArrayRef(pVal, getNumWords())).zext(getBitWidth()) - == (*this); + return getActiveBits() <= N; } /// @brief Check if this APInt has an N-bits signed integer value. @@ -503,6 +505,18 @@ public: return getAllOnesValue(numBits).lshr(numBits - loBitsSet); } + /// \brief Determine if two APInts have the same value, after zero-extending + /// one of them (if needed!) to ensure that the bit-widths match. + static bool isSameValue(const APInt &I1, const APInt &I2) { + if (I1.getBitWidth() == I2.getBitWidth()) + return I1 == I2; + + if (I1.getBitWidth() > I2.getBitWidth()) + return I1 == I2.zext(I1.getBitWidth()); + + return I1.zext(I2.getBitWidth()) == I2; + } + /// \brief Overload to compute a hash_code for an APInt value. friend hash_code hash_value(const APInt &Arg); @@ -587,6 +601,21 @@ public: return AssignSlowCase(RHS); } +#if LLVM_USE_RVALUE_REFERENCES + /// @brief Move assignment operator. + APInt& operator=(APInt&& that) { + if (!isSingleWord()) + delete [] pVal; + + BitWidth = that.BitWidth; + VAL = that.VAL; + + that.BitWidth = 0; + + return *this; + } +#endif + /// The RHS value is assigned to *this. If the significant bits in RHS exceed /// the bit width, the excess bits are truncated. If the bit width is larger /// than 64, the value is zero filled in the unspecified high order bits. @@ -817,9 +846,10 @@ public: if (LHS.isNegative()) { if (RHS.isNegative()) APInt::udivrem(-LHS, -RHS, Quotient, Remainder); - else + else { APInt::udivrem(-LHS, RHS, Quotient, Remainder); - Quotient = -Quotient; + Quotient = -Quotient; + } Remainder = -Remainder; } else if (RHS.isNegative()) { APInt::udivrem(LHS, -RHS, Quotient, Remainder); @@ -1087,7 +1117,7 @@ public: else { // Set all the bits in all the words. for (unsigned i = 0; i < getNumWords(); ++i) - pVal[i] = -1ULL; + pVal[i] = -1ULL; } // Clear the unused ones clearUnusedBits(); Modified: head/contrib/llvm/include/llvm/ADT/APSInt.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/APSInt.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm/ADT/APSInt.h Mon Aug 20 18:33:03 2012 (r239462) @@ -135,6 +135,19 @@ public: assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!"); return IsUnsigned ? uge(RHS) : sge(RHS); } + inline bool operator==(const APSInt& RHS) const { + assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!"); + return eq(RHS); + } + inline bool operator==(int64_t RHS) const { + return isSameValue(*this, APSInt(APInt(64, RHS), true)); + } + inline bool operator!=(const APSInt& RHS) const { + return !((*this) == RHS); + } + inline bool operator!=(int64_t RHS) const { + return !((*this) == RHS); + } // The remaining operators just wrap the logic of APInt, but retain the // signedness information. @@ -250,17 +263,50 @@ public: : APInt::getSignedMinValue(numBits), Unsigned); } + /// \brief Determine if two APSInts have the same value, zero- or + /// sign-extending as needed. + static bool isSameValue(const APSInt &I1, const APSInt &I2) { + if (I1.getBitWidth() == I2.getBitWidth() && I1.isSigned() == I2.isSigned()) + return I1 == I2; + + // Check for a bit-width mismatch. + if (I1.getBitWidth() > I2.getBitWidth()) + return isSameValue(I1, I2.extend(I1.getBitWidth())); + else if (I2.getBitWidth() > I1.getBitWidth()) + return isSameValue(I1.extend(I2.getBitWidth()), I2); + + // We have a signedness mismatch. Turn the signed value into an unsigned + // value. + if (I1.isSigned()) { + if (I1.isNegative()) + return false; + + return APSInt(I1, true) == I2; + } + + if (I2.isNegative()) + return false; + + return I1 == APSInt(I2, true); + } + /// Profile - Used to insert APSInt objects, or objects that contain APSInt /// objects, into FoldingSets. void Profile(FoldingSetNodeID& ID) const; }; +inline bool operator==(int64_t V1, const APSInt& V2) { + return V2 == V1; +} +inline bool operator!=(int64_t V1, const APSInt& V2) { + return V2 != V1; +} + inline raw_ostream &operator<<(raw_ostream &OS, const APSInt &I) { I.print(OS, I.isSigned()); return OS; } - } // end namespace llvm #endif Modified: head/contrib/llvm/include/llvm/ADT/ArrayRef.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/ArrayRef.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm/ADT/ArrayRef.h Mon Aug 20 18:33:03 2012 (r239462) @@ -60,7 +60,7 @@ namespace llvm { : Data(begin), Length(end - begin) {} /// Construct an ArrayRef from a SmallVector. - /*implicit*/ ArrayRef(const SmallVectorImpl &Vec) + /*implicit*/ ArrayRef(const SmallVectorTemplateCommon &Vec) : Data(Vec.data()), Length(Vec.size()) {} /// Construct an ArrayRef from a std::vector. Modified: head/contrib/llvm/include/llvm/ADT/BitVector.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/BitVector.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm/ADT/BitVector.h Mon Aug 20 18:33:03 2012 (r239462) @@ -14,6 +14,7 @@ #ifndef LLVM_ADT_BITVECTOR_H #define LLVM_ADT_BITVECTOR_H +#include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MathExtras.h" #include @@ -97,6 +98,13 @@ public: std::memcpy(Bits, RHS.Bits, Capacity * sizeof(BitWord)); } +#if LLVM_USE_RVALUE_REFERENCES + BitVector(BitVector &&RHS) + : Bits(RHS.Bits), Size(RHS.Size), Capacity(RHS.Capacity) { + RHS.Bits = 0; + } +#endif + ~BitVector() { std::free(Bits); } @@ -251,11 +259,6 @@ public: return *this; } - // No argument flip. - BitVector operator~() const { - return BitVector(*this).flip(); - } - // Indexing. reference operator[](unsigned Idx) { assert (Idx < Size && "Out-of-bounds Bit access."); @@ -272,6 +275,16 @@ public: return (*this)[Idx]; } + /// Test if any common bits are set. + bool anyCommon(const BitVector &RHS) const { + unsigned ThisWords = NumBitWords(size()); + unsigned RHSWords = NumBitWords(RHS.size()); + for (unsigned i = 0, e = std::min(ThisWords, RHSWords); i != e; ++i) + if (Bits[i] & RHS.Bits[i]) + return true; + return false; + } + // Comparison operators. bool operator==(const BitVector &RHS) const { unsigned ThisWords = NumBitWords(size()); @@ -366,6 +379,21 @@ public: return *this; } +#if LLVM_USE_RVALUE_REFERENCES + const BitVector &operator=(BitVector &&RHS) { + if (this == &RHS) return *this; + + std::free(Bits); + Bits = RHS.Bits; + Size = RHS.Size; + Capacity = RHS.Capacity; + + RHS.Bits = 0; + + return *this; + } +#endif + void swap(BitVector &RHS) { std::swap(Bits, RHS.Bits); std::swap(Size, RHS.Size); @@ -472,24 +500,6 @@ private: } }; -inline BitVector operator&(const BitVector &LHS, const BitVector &RHS) { - BitVector Result(LHS); - Result &= RHS; - return Result; -} - -inline BitVector operator|(const BitVector &LHS, const BitVector &RHS) { - BitVector Result(LHS); - Result |= RHS; - return Result; -} - -inline BitVector operator^(const BitVector &LHS, const BitVector &RHS) { - BitVector Result(LHS); - Result ^= RHS; - return Result; -} - } // End llvm namespace namespace std { Modified: head/contrib/llvm/include/llvm/ADT/DenseMap.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/DenseMap.h Mon Aug 20 18:32:46 2012 (r239461) +++ head/contrib/llvm/include/llvm/ADT/DenseMap.h Mon Aug 20 18:33:03 2012 (r239462) @@ -14,6 +14,8 @@ #ifndef LLVM_ADT_DENSEMAP_H #define LLVM_ADT_DENSEMAP_H +#include "llvm/Support/Compiler.h" +#include "llvm/Support/AlignOf.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/PointerLikeTypeTraits.h" #include "llvm/Support/type_traits.h" @@ -23,6 +25,7 @@ #include #include #include +#include #include #include @@ -33,116 +36,83 @@ template class DenseMapIterator; -template > -class DenseMap { +template +class DenseMapBase { +protected: typedef std::pair BucketT; - unsigned NumBuckets; - BucketT *Buckets; - unsigned NumEntries; - unsigned NumTombstones; public: typedef KeyT key_type; typedef ValueT mapped_type; typedef BucketT value_type; - DenseMap(const DenseMap &other) { - NumBuckets = 0; - CopyFrom(other); - } - - explicit DenseMap(unsigned NumInitBuckets = 0) { - init(NumInitBuckets); - } - - template - DenseMap(const InputIt &I, const InputIt &E) { - init(NextPowerOf2(std::distance(I, E))); - insert(I, E); - } - - ~DenseMap() { - const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey(); - for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) { - if (!KeyInfoT::isEqual(P->first, EmptyKey) && - !KeyInfoT::isEqual(P->first, TombstoneKey)) - P->second.~ValueT(); - P->first.~KeyT(); - } -#ifndef NDEBUG - if (NumBuckets) - memset((void*)Buckets, 0x5a, sizeof(BucketT)*NumBuckets); -#endif - operator delete(Buckets); - } - typedef DenseMapIterator iterator; typedef DenseMapIterator const_iterator; inline iterator begin() { // When the map is empty, avoid the overhead of AdvancePastEmptyBuckets(). - return empty() ? end() : iterator(Buckets, Buckets+NumBuckets); + return empty() ? end() : iterator(getBuckets(), getBucketsEnd()); } inline iterator end() { - return iterator(Buckets+NumBuckets, Buckets+NumBuckets, true); + return iterator(getBucketsEnd(), getBucketsEnd(), true); } inline const_iterator begin() const { - return empty() ? end() : const_iterator(Buckets, Buckets+NumBuckets); + return empty() ? end() : const_iterator(getBuckets(), getBucketsEnd()); } inline const_iterator end() const { - return const_iterator(Buckets+NumBuckets, Buckets+NumBuckets, true); + return const_iterator(getBucketsEnd(), getBucketsEnd(), true); } - bool empty() const { return NumEntries == 0; } - unsigned size() const { return NumEntries; } + bool empty() const { return getNumEntries() == 0; } + unsigned size() const { return getNumEntries(); } /// Grow the densemap so that it has at least Size buckets. Does not shrink void resize(size_t Size) { - if (Size > NumBuckets) + if (Size > getNumBuckets()) grow(Size); } void clear() { - if (NumEntries == 0 && NumTombstones == 0) return; + if (getNumEntries() == 0 && getNumTombstones() == 0) return; // If the capacity of the array is huge, and the # elements used is small, // shrink the array. - if (NumEntries * 4 < NumBuckets && NumBuckets > 64) { + if (getNumEntries() * 4 < getNumBuckets() && getNumBuckets() > 64) { shrink_and_clear(); return; } const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey(); - for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) { + for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) { if (!KeyInfoT::isEqual(P->first, EmptyKey)) { if (!KeyInfoT::isEqual(P->first, TombstoneKey)) { P->second.~ValueT(); - --NumEntries; + decrementNumEntries(); } P->first = EmptyKey; } } - assert(NumEntries == 0 && "Node count imbalance!"); - NumTombstones = 0; + assert(getNumEntries() == 0 && "Node count imbalance!"); + setNumTombstones(0); } /// count - Return true if the specified key is in the map. bool count(const KeyT &Val) const { - BucketT *TheBucket; + const BucketT *TheBucket; return LookupBucketFor(Val, TheBucket); } iterator find(const KeyT &Val) { BucketT *TheBucket; if (LookupBucketFor(Val, TheBucket)) - return iterator(TheBucket, Buckets+NumBuckets, true); + return iterator(TheBucket, getBucketsEnd(), true); return end(); } const_iterator find(const KeyT &Val) const { - BucketT *TheBucket; + const BucketT *TheBucket; if (LookupBucketFor(Val, TheBucket)) - return const_iterator(TheBucket, Buckets+NumBuckets, true); + return const_iterator(TheBucket, getBucketsEnd(), true); return end(); } @@ -155,21 +125,21 @@ public: iterator find_as(const LookupKeyT &Val) { BucketT *TheBucket; if (LookupBucketFor(Val, TheBucket)) - return iterator(TheBucket, Buckets+NumBuckets, true); + return iterator(TheBucket, getBucketsEnd(), true); return end(); } template const_iterator find_as(const LookupKeyT &Val) const { - BucketT *TheBucket; + const BucketT *TheBucket; if (LookupBucketFor(Val, TheBucket)) - return const_iterator(TheBucket, Buckets+NumBuckets, true); + return const_iterator(TheBucket, getBucketsEnd(), true); return end(); } /// lookup - Return the entry for the specified key, or a default /// constructed value if no such entry exists. ValueT lookup(const KeyT &Val) const { - BucketT *TheBucket; + const BucketT *TheBucket; if (LookupBucketFor(Val, TheBucket)) return TheBucket->second; return ValueT(); @@ -181,12 +151,12 @@ public: std::pair insert(const std::pair &KV) { BucketT *TheBucket; if (LookupBucketFor(KV.first, TheBucket)) - return std::make_pair(iterator(TheBucket, Buckets+NumBuckets, true), + return std::make_pair(iterator(TheBucket, getBucketsEnd(), true), false); // Already in map. // Otherwise, insert the new element. TheBucket = InsertIntoBucket(KV.first, KV.second, TheBucket); - return std::make_pair(iterator(TheBucket, Buckets+NumBuckets, true), true); + return std::make_pair(iterator(TheBucket, getBucketsEnd(), true), true); } /// insert - Range insertion of pairs. @@ -204,23 +174,16 @@ public: TheBucket->second.~ValueT(); TheBucket->first = getTombstoneKey(); - --NumEntries; - ++NumTombstones; + decrementNumEntries(); + incrementNumTombstones(); return true; } void erase(iterator I) { BucketT *TheBucket = &*I; TheBucket->second.~ValueT(); TheBucket->first = getTombstoneKey(); - --NumEntries; - ++NumTombstones; - } - - void swap(DenseMap& RHS) { - std::swap(NumBuckets, RHS.NumBuckets); - std::swap(Buckets, RHS.Buckets); - std::swap(NumEntries, RHS.NumEntries); - std::swap(NumTombstones, RHS.NumTombstones); + decrementNumEntries(); + incrementNumTombstones(); } value_type& FindAndConstruct(const KeyT &Key) { @@ -235,68 +198,211 @@ public: return FindAndConstruct(Key).second; } - DenseMap& operator=(const DenseMap& other) { - CopyFrom(other); - return *this; +#if LLVM_USE_RVALUE_REFERENCES + value_type& FindAndConstruct(KeyT &&Key) { + BucketT *TheBucket; + if (LookupBucketFor(Key, TheBucket)) + return *TheBucket; + + return *InsertIntoBucket(Key, ValueT(), TheBucket); } + ValueT &operator[](KeyT &&Key) { + return FindAndConstruct(Key).second; + } +#endif + /// isPointerIntoBucketsArray - Return true if the specified pointer points /// somewhere into the DenseMap's array of buckets (i.e. either to a key or /// value in the DenseMap). bool isPointerIntoBucketsArray(const void *Ptr) const { - return Ptr >= Buckets && Ptr < Buckets+NumBuckets; + return Ptr >= getBuckets() && Ptr < getBucketsEnd(); } /// getPointerIntoBucketsArray() - Return an opaque pointer into the buckets /// array. In conjunction with the previous method, this can be used to /// determine whether an insertion caused the DenseMap to reallocate. - const void *getPointerIntoBucketsArray() const { return Buckets; } + const void *getPointerIntoBucketsArray() const { return getBuckets(); } -private: - void CopyFrom(const DenseMap& other) { - if (NumBuckets != 0 && - (!isPodLike::value || !isPodLike::value)) { - const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey(); - for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) { - if (!KeyInfoT::isEqual(P->first, EmptyKey) && - !KeyInfoT::isEqual(P->first, TombstoneKey)) - P->second.~ValueT(); - P->first.~KeyT(); - } - } +protected: + DenseMapBase() {} - NumEntries = other.NumEntries; - NumTombstones = other.NumTombstones; + void destroyAll() { + if (getNumBuckets() == 0) // Nothing to do. + return; + + const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey(); + for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) { + if (!KeyInfoT::isEqual(P->first, EmptyKey) && + !KeyInfoT::isEqual(P->first, TombstoneKey)) + P->second.~ValueT(); + P->first.~KeyT(); + } - if (NumBuckets) { #ifndef NDEBUG - memset((void*)Buckets, 0x5a, sizeof(BucketT)*NumBuckets); + memset((void*)getBuckets(), 0x5a, sizeof(BucketT)*getNumBuckets()); #endif - operator delete(Buckets); - } + } - NumBuckets = other.NumBuckets; + void initEmpty() { + setNumEntries(0); + setNumTombstones(0); - if (NumBuckets == 0) { - Buckets = 0; - return; + assert((getNumBuckets() & (getNumBuckets()-1)) == 0 && + "# initial buckets must be a power of two!"); + const KeyT EmptyKey = getEmptyKey(); + for (BucketT *B = getBuckets(), *E = getBucketsEnd(); B != E; ++B) + new (&B->first) KeyT(EmptyKey); + } + + void moveFromOldBuckets(BucketT *OldBucketsBegin, BucketT *OldBucketsEnd) { + initEmpty(); + + // Insert all the old elements. + const KeyT EmptyKey = getEmptyKey(); + const KeyT TombstoneKey = getTombstoneKey(); + for (BucketT *B = OldBucketsBegin, *E = OldBucketsEnd; B != E; ++B) { + if (!KeyInfoT::isEqual(B->first, EmptyKey) && + !KeyInfoT::isEqual(B->first, TombstoneKey)) { + // Insert the key/value into the new table. + BucketT *DestBucket; + bool FoundVal = LookupBucketFor(B->first, DestBucket); + (void)FoundVal; // silence warning. + assert(!FoundVal && "Key already in new map?"); + DestBucket->first = llvm_move(B->first); + new (&DestBucket->second) ValueT(llvm_move(B->second)); + incrementNumEntries(); + + // Free the value. + B->second.~ValueT(); + } + B->first.~KeyT(); } - Buckets = static_cast(operator new(sizeof(BucketT) * NumBuckets)); +#ifndef NDEBUG + if (OldBucketsBegin != OldBucketsEnd) + memset((void*)OldBucketsBegin, 0x5a, + sizeof(BucketT) * (OldBucketsEnd - OldBucketsBegin)); +#endif + } + + template + void copyFrom(const DenseMapBase& other) { + assert(getNumBuckets() == other.getNumBuckets()); + + setNumEntries(other.getNumEntries()); + setNumTombstones(other.getNumTombstones()); if (isPodLike::value && isPodLike::value) - memcpy(Buckets, other.Buckets, NumBuckets * sizeof(BucketT)); + memcpy(getBuckets(), other.getBuckets(), + getNumBuckets() * sizeof(BucketT)); else - for (size_t i = 0; i < NumBuckets; ++i) { - new (&Buckets[i].first) KeyT(other.Buckets[i].first); - if (!KeyInfoT::isEqual(Buckets[i].first, getEmptyKey()) && - !KeyInfoT::isEqual(Buckets[i].first, getTombstoneKey())) - new (&Buckets[i].second) ValueT(other.Buckets[i].second); + for (size_t i = 0; i < getNumBuckets(); ++i) { + new (&getBuckets()[i].first) KeyT(other.getBuckets()[i].first); + if (!KeyInfoT::isEqual(getBuckets()[i].first, getEmptyKey()) && + !KeyInfoT::isEqual(getBuckets()[i].first, getTombstoneKey())) + new (&getBuckets()[i].second) ValueT(other.getBuckets()[i].second); } } + void swap(DenseMapBase& RHS) { + std::swap(getNumEntries(), RHS.getNumEntries()); + std::swap(getNumTombstones(), RHS.getNumTombstones()); + } + + static unsigned getHashValue(const KeyT &Val) { + return KeyInfoT::getHashValue(Val); + } + template + static unsigned getHashValue(const LookupKeyT &Val) { + return KeyInfoT::getHashValue(Val); + } + static const KeyT getEmptyKey() { + return KeyInfoT::getEmptyKey(); + } + static const KeyT getTombstoneKey() { + return KeyInfoT::getTombstoneKey(); + } + +private: + unsigned getNumEntries() const { + return static_cast(this)->getNumEntries(); + } + void setNumEntries(unsigned Num) { + static_cast(this)->setNumEntries(Num); + } + void incrementNumEntries() { + setNumEntries(getNumEntries() + 1); + } + void decrementNumEntries() { + setNumEntries(getNumEntries() - 1); + } + unsigned getNumTombstones() const { + return static_cast(this)->getNumTombstones(); + } + void setNumTombstones(unsigned Num) { + static_cast(this)->setNumTombstones(Num); + } + void incrementNumTombstones() { + setNumTombstones(getNumTombstones() + 1); + } + void decrementNumTombstones() { + setNumTombstones(getNumTombstones() - 1); + } + const BucketT *getBuckets() const { + return static_cast(this)->getBuckets(); + } + BucketT *getBuckets() { + return static_cast(this)->getBuckets(); + } + unsigned getNumBuckets() const { + return static_cast(this)->getNumBuckets(); + } + BucketT *getBucketsEnd() { + return getBuckets() + getNumBuckets(); + } + const BucketT *getBucketsEnd() const { + return getBuckets() + getNumBuckets(); + } + + void grow(unsigned AtLeast) { + static_cast(this)->grow(AtLeast); + } + + void shrink_and_clear() { + static_cast(this)->shrink_and_clear(); + } + + BucketT *InsertIntoBucket(const KeyT &Key, const ValueT &Value, BucketT *TheBucket) { + TheBucket = InsertIntoBucketImpl(Key, TheBucket); + + TheBucket->first = Key; + new (&TheBucket->second) ValueT(Value); + return TheBucket; + } + +#if LLVM_USE_RVALUE_REFERENCES + BucketT *InsertIntoBucket(const KeyT &Key, ValueT &&Value, + BucketT *TheBucket) { + TheBucket = InsertIntoBucketImpl(Key, TheBucket); + + TheBucket->first = Key; + new (&TheBucket->second) ValueT(std::move(Value)); + return TheBucket; + } + + BucketT *InsertIntoBucket(KeyT &&Key, ValueT &&Value, BucketT *TheBucket) { + TheBucket = InsertIntoBucketImpl(Key, TheBucket); + + TheBucket->first = std::move(Key); + new (&TheBucket->second) ValueT(std::move(Value)); + return TheBucket; + } +#endif + + BucketT *InsertIntoBucketImpl(const KeyT &Key, BucketT *TheBucket) { // If the load of the hash table is more than 3/4, or if fewer than 1/8 of // the buckets are empty (meaning that many are filled with tombstones), // grow the table. @@ -306,48 +412,38 @@ private: // probe almost the entire table until it found the empty bucket. If the // table completely filled with tombstones, no lookup would ever succeed, // causing infinite loops in lookup. - ++NumEntries; - if (NumEntries*4 >= NumBuckets*3) { + unsigned NewNumEntries = getNumEntries() + 1; + unsigned NumBuckets = getNumBuckets(); + if (NewNumEntries*4 >= NumBuckets*3) { this->grow(NumBuckets * 2); LookupBucketFor(Key, TheBucket); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 18:45: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 642131065673; Mon, 20 Aug 2012 18:45:17 +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 145D68FC08; Mon, 20 Aug 2012 18:45: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 q7KIjGff077241; Mon, 20 Aug 2012 18:45:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIjGOx077239; Mon, 20 Aug 2012 18:45:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208201845.q7KIjGOx077239@svn.freebsd.org> From: Xin LI Date: Mon, 20 Aug 2012 18:45: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: r239464 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Aug 2012 18:45:17 -0000 Author: delphij Date: Mon Aug 20 18:45:16 2012 New Revision: 239464 URL: http://svn.freebsd.org/changeset/base/239464 Log: As of r232844 we no longer need the maxpoll 9 workaround. MFC after: 3 days Modified: head/etc/ntp.conf Modified: head/etc/ntp.conf ============================================================================== --- head/etc/ntp.conf Mon Aug 20 18:33:23 2012 (r239463) +++ head/etc/ntp.conf Mon Aug 20 18:45:16 2012 (r239464) @@ -18,12 +18,11 @@ # to the pool. See http://www.pool.ntp.org/join.html if you are interested. # # The option `iburst' is used for faster initial synchronisation. -# The option `maxpoll 9' is used to prevent PLL/FLL flipping on FreeBSD. # -server 0.freebsd.pool.ntp.org iburst maxpoll 9 -server 1.freebsd.pool.ntp.org iburst maxpoll 9 -server 2.freebsd.pool.ntp.org iburst maxpoll 9 -#server 3.freebsd.pool.ntp.org iburst maxpoll 9 +server 0.freebsd.pool.ntp.org iburst +server 1.freebsd.pool.ntp.org iburst +server 2.freebsd.pool.ntp.org iburst +#server 3.freebsd.pool.ntp.org iburst # # If you want to pick yourself which country's public NTP server @@ -31,9 +30,9 @@ server 2.freebsd.pool.ntp.org iburst max # the next ones and replace CC with the country's abbreviation. # Make sure that the hostnames resolve to a proper IP address! # -# server 0.CC.pool.ntp.org iburst maxpoll 9 -# server 1.CC.pool.ntp.org iburst maxpoll 9 -# server 2.CC.pool.ntp.org iburst maxpoll 9 +# server 0.CC.pool.ntp.org iburst +# server 1.CC.pool.ntp.org iburst +# server 2.CC.pool.ntp.org iburst # # Security: Only accept NTP traffic from the following hosts. From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 18:57: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 A07CF106566B; Mon, 20 Aug 2012 18:57:41 +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 8C84B8FC12; Mon, 20 Aug 2012 18:57: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 q7KIvfDK078546; Mon, 20 Aug 2012 18:57:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KIvfRP078544; Mon, 20 Aug 2012 18:57:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208201857.q7KIvfRP078544@svn.freebsd.org> From: Adrian Chadd Date: Mon, 20 Aug 2012 18:57: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: r239465 - 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, 20 Aug 2012 18:57:41 -0000 Author: adrian Date: Mon Aug 20 18:57:41 2012 New Revision: 239465 URL: http://svn.freebsd.org/changeset/base/239465 Log: Fix a build issue when ATH_DEBUG isn't defined - just initialise and use qnum. 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 Aug 20 18:45:16 2012 (r239464) +++ head/sys/dev/ath/if_ath_tx.c Mon Aug 20 18:57:41 2012 (r239465) @@ -307,7 +307,7 @@ ath_tx_chaindesclist(struct ath_softc *s uint32_t segLenList[4]; int numTxMaps = 1; int isFirstDesc = 1; - int qnum = 0; /* XXX update */ + int qnum; /* * XXX There's txdma and txdma_mgmt; the descriptor @@ -366,11 +366,13 @@ ath_tx_chaindesclist(struct ath_softc *s * it may actually be pointing to the multicast software * TXQ id. These must be fixed! */ + qnum = bf->bf_state.bfs_txq->axq_qnum; + ath_hal_filltxdesc(ah, (struct ath_desc *) ds , bufAddrList , segLenList , bf->bf_descid /* XXX desc id */ - , bf->bf_state.bfs_txq->axq_qnum /* XXX multicast? */ + , qnum , isFirstDesc /* first segment */ , i == bf->bf_nseg - 1 /* last segment */ , (struct ath_desc *) ds0 /* first descriptor */ From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 20:40: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 232AB1065676; Mon, 20 Aug 2012 20:40:15 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E3BE8FC18; Mon, 20 Aug 2012 20:40: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 q7KKeEaO089793; Mon, 20 Aug 2012 20:40:14 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KKeEP0089791; Mon, 20 Aug 2012 20:40:14 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201208202040.q7KKeEP0089791@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 20 Aug 2012 20:40: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: r239468 - head/sbin/camcontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Aug 2012 20:40:15 -0000 Author: pluknet Date: Mon Aug 20 20:40:14 2012 New Revision: 239468 URL: http://svn.freebsd.org/changeset/base/239468 Log: Avoid segfault in the 'smpphylist' subcommand. Initialize devlist.dev_queue tail queue early enough before its any potential traversal in freebusdevlist() when in smpphylist error path. Reported by: Pavel Polyakov (on irc) Reviewed by: ken MFC after: 5 days Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Aug 20 19:26:43 2012 (r239467) +++ head/sbin/camcontrol/camcontrol.c Mon Aug 20 20:40:14 2012 (r239468) @@ -5459,6 +5459,7 @@ smpphylist(struct cam_device *device, in bzero(&(&ccb->ccb_h)[1], sizeof(union ccb) - sizeof(struct ccb_hdr)); + STAILQ_INIT(&devlist.dev_queue); rgrequest = malloc(sizeof(*rgrequest)); if (rgrequest == NULL) { @@ -5527,7 +5528,6 @@ smpphylist(struct cam_device *device, in goto bailout; } - STAILQ_INIT(&devlist.dev_queue); devlist.path_id = device->path_id; retval = buildbusdevlist(&devlist); From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 20:55: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 28778106566C; Mon, 20 Aug 2012 20:55:25 +0000 (UTC) (envelope-from adrian.chadd@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 D8B598FC08; Mon, 20 Aug 2012 20:55:24 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so7927124pbb.13 for ; Mon, 20 Aug 2012 13:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=AZfIWqkwRfkYZ0+1guxz0j6mh6qoGI4eW9ZJQZ+69Q4=; b=eBA6Q5yr83gXnguaTuCqo+XXwvaRkhgtiT5/tsPZi0pDdHio8hNO6ZCQKVK7/se5kV xCAVMtDvm2SV3w3DQZ7ff4BtmnftXOOCkq7Nb6cAprjAeT3e2VtAg3tfm5xPHrFZVtWx hog5am2fjihpGYbrvrtajQAs8vtwJZotddtlDrCDGNECy0XXVZ9lGjVIugKkcCxrSdDn Ly7jzVJQhILL1KIbqN6AG42ljh7tjgZxfIpOk6jnd21l58NHlUiD+BpLwMzZrXb2X2YV 0dzBjAphAI6zQz5AyIwHnkpFx5WRQ4hTDESrbEAjjE0jy63CT+qowPXPF91+cvGcyBkU rA1Q== MIME-Version: 1.0 Received: by 10.66.75.195 with SMTP id e3mr32523613paw.32.1345496124222; Mon, 20 Aug 2012 13:55:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.43.169 with HTTP; Mon, 20 Aug 2012 13:55:24 -0700 (PDT) In-Reply-To: References: <20120819202622.6db6a8dd@fubar.geek.nz> Date: Mon, 20 Aug 2012 13:55:24 -0700 X-Google-Sender-Auth: BiDobMTOjmOaVNoCU7Ft1LGQ0zk Message-ID: From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Andrew Turner , Hans Petter Selasky Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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, 20 Aug 2012 20:55:25 -0000 I have a report that AR71XX (MIPS) USB broke with this change. Hans, would you mind reverting it until we figure out what's going on in the non-intel USB world? Thanks, Adrian On 19 August 2012 05:15, Hans Petter Selasky wrote: > Hi, > > > > What exactly is the driver the USB mass storage device is attached to? > > > > And the problem is the same using the latest FreeBSD version from -current? > > > > You are certain that all parts of the kernel were rebuilt? > > > > And you are certain that it has nothing to do with the FreeBSD version bump > which is also part of this change? > > > > Probably we should move this thread to -current @ > > > > --HPS > > > -----Original message----- > From: Andrew Turner > Sent: Sun 19-08-2012 10:27 > Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller > sys > To: Hans Petter Selasky ; > CC: Hans Petter Selasky ; svn-src-head@freebsd.org; > svn-src-all@freebsd.org; src-committers@freebsd.org; > On Sun, 19 Aug 2012 09:39:11 +0200 > Hans Petter Selasky wrote: > >> Hi, >> >> >> >> Have you stepped the versions? > I did a binary search of the commits to find the revision that caused > the issue. > >> Are you sure it is exactly this commit? > I built with r239213 and the problem went away, when I built with > r239214 it appeared again. > > Andrew From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 20:56: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 70896106566B; Mon, 20 Aug 2012 20:56:41 +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 432798FC18; Mon, 20 Aug 2012 20:56: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 q7KKuf4T091674; Mon, 20 Aug 2012 20:56:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KKufOt091671; Mon, 20 Aug 2012 20:56:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208202056.q7KKufOt091671@svn.freebsd.org> From: Dimitry Andric Date: Mon, 20 Aug 2012 20:56: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: r239469 - in head: lib/clang/include tools/build/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: Mon, 20 Aug 2012 20:56:41 -0000 Author: dim Date: Mon Aug 20 20:56:40 2012 New Revision: 239469 URL: http://svn.freebsd.org/changeset/base/239469 Log: Add three additional clang intrinsics headers, which I missed in the previous import. Modified: head/lib/clang/include/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/lib/clang/include/Makefile ============================================================================== --- head/lib/clang/include/Makefile Mon Aug 20 20:40:14 2012 (r239468) +++ head/lib/clang/include/Makefile Mon Aug 20 20:56:40 2012 (r239469) @@ -5,6 +5,7 @@ INCSDIR=${INCLUDEDIR}/clang/3.2 INCS= altivec.h \ + ammintrin.h \ avx2intrin.h \ avxintrin.h \ bmi2intrin.h \ @@ -12,6 +13,7 @@ INCS= altivec.h \ cpuid.h \ emmintrin.h \ fma4intrin.h \ + fmaintrin.h \ immintrin.h \ lzcntintrin.h \ mm3dnow.h \ @@ -26,7 +28,8 @@ INCS= altivec.h \ unwind.h \ wmmintrin.h \ x86intrin.h \ - xmmintrin.h + xmmintrin.h \ + xopintrin.h .include .include Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Aug 20 20:40:14 2012 (r239468) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Aug 20 20:56:40 2012 (r239469) @@ -684,6 +684,7 @@ OLD_FILES+=usr/include/clang/3.1/x86intr OLD_FILES+=usr/include/clang/3.1/xmmintrin.h OLD_DIRS+=usr/include/clang/3.1 OLD_FILES+=usr/include/clang/3.2/altivec.h +OLD_FILES+=usr/include/clang/3.2/ammintrin.h OLD_FILES+=usr/include/clang/3.2/avx2intrin.h OLD_FILES+=usr/include/clang/3.2/avxintrin.h OLD_FILES+=usr/include/clang/3.2/bmi2intrin.h @@ -691,6 +692,7 @@ OLD_FILES+=usr/include/clang/3.2/bmiintr OLD_FILES+=usr/include/clang/3.2/cpuid.h OLD_FILES+=usr/include/clang/3.2/emmintrin.h OLD_FILES+=usr/include/clang/3.2/fma4intrin.h +OLD_FILES+=usr/include/clang/3.2/fmaintrin.h OLD_FILES+=usr/include/clang/3.2/immintrin.h OLD_FILES+=usr/include/clang/3.2/lzcntintrin.h OLD_FILES+=usr/include/clang/3.2/mm3dnow.h @@ -706,6 +708,7 @@ OLD_FILES+=usr/include/clang/3.2/unwind. OLD_FILES+=usr/include/clang/3.2/wmmintrin.h OLD_FILES+=usr/include/clang/3.2/x86intrin.h OLD_FILES+=usr/include/clang/3.2/xmmintrin.h +OLD_FILES+=usr/include/clang/3.2/xopintrin.h OLD_DIRS+=usr/include/clang/3.2 OLD_DIRS+=usr/include/clang OLD_FILES+=usr/share/doc/llvm/clang/LICENSE.TXT From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 21: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 D096A106564A for ; Mon, 20 Aug 2012 21:09:41 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from qmta03.emeryville.ca.mail.comcast.net (qmta03.emeryville.ca.mail.comcast.net [76.96.30.32]) by mx1.freebsd.org (Postfix) with ESMTP id A9E2A8FC1D for ; Mon, 20 Aug 2012 21:09:41 +0000 (UTC) Received: from omta24.emeryville.ca.mail.comcast.net ([76.96.30.92]) by qmta03.emeryville.ca.mail.comcast.net with comcast id p8G51j0081zF43QA399hkr; Mon, 20 Aug 2012 21:09:41 +0000 Received: from damnhippie.dyndns.org ([24.8.232.202]) by omta24.emeryville.ca.mail.comcast.net with comcast id p99f1j00a4NgCEG8k99g0l; Mon, 20 Aug 2012 21:09:41 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q7KL9bF3021433; Mon, 20 Aug 2012 15:09:37 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: Adrian Chadd In-Reply-To: References: <20120819202622.6db6a8dd@fubar.geek.nz> Content-Type: text/plain; charset="us-ascii" Date: Mon, 20 Aug 2012 15:09:37 -0600 Message-ID: <1345496977.27688.332.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: "src-committers@freebsd.org" , Hans Petter Selasky , "svn-src-all@freebsd.org" , Andrew Turner , Hans Petter Selasky , "svn-src-head@freebsd.org" Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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, 20 Aug 2012 21:09:41 -0000 On Mon, 2012-08-20 at 13:55 -0700, Adrian Chadd wrote: > I have a report that AR71XX (MIPS) USB broke with this change. > > Hans, would you mind reverting it until we figure out what's going on > in the non-intel USB world? > > Thanks, > > > Adrian It appears that the change in structure sizes has resulted in things shuffling around in memory in a way that triggers a partial cacheline flush bug in the busdma routines for ARM (and I guess for MIPS too). I'm chasing the actual bug in the ARM code, since it's now 100% reproducible. I'm hoping it's the concrete proof for a bug I've long thought was possible in theory. In the meantime, a quick and easy way to work around the problem is to add to your kernel config: option USB_HOST_ALIGN=32 # data cache line size on your platform Since it appears (at least until some evidence points elsewhere) that the problem is in the busdma code for architectures with VIVT caches, I'm not sure reverting the usb changes would be the right move. Avoiding an MFC until we know more might be a good idea, though. -- Ian From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 21:27: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 30EBF106567E; Mon, 20 Aug 2012 21:27:11 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by mx1.freebsd.org (Postfix) with ESMTP id DD3468FC1B; Mon, 20 Aug 2012 21:27:10 +0000 (UTC) Received: from [192.168.1.18] (unknown [217.157.7.221]) by csmtp3.one.com (Postfix) with ESMTPA id C60E124063B0; Mon, 20 Aug 2012 21:21:44 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Erik Cederstrand In-Reply-To: <201208201833.q7KIX58p075876@svn.freebsd.org> Date: Mon, 20 Aug 2012 23:21:44 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <201208201833.q7KIX58p075876@svn.freebsd.org> To: Dimitry Andric 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: r239462 - in head: . contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm/ADT contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm/Bitcode contrib/llv... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Aug 2012 21:27:11 -0000 Den 20/08/2012 kl. 20.33 skrev Dimitry Andric: > Author: dim > Date: Mon Aug 20 18:33:03 2012 > New Revision: 239462 > URL: http://svn.freebsd.org/changeset/base/239462 > > Log: > Upgrade our copy of llvm/clang to trunk r162107. With thanks to > Benjamin Kramer and Joerg Sonnenberger for their input and fixes. Thanks! Erik From owner-svn-src-head@FreeBSD.ORG Mon Aug 20 23:43: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 CE0361065670; Mon, 20 Aug 2012 23:43:04 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E18B8FC15; Mon, 20 Aug 2012 23:43: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 q7KNh4Ni015638; Mon, 20 Aug 2012 23:43:04 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7KNh4QG015636; Mon, 20 Aug 2012 23:43:04 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201208202343.q7KNh4QG015636@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 20 Aug 2012 23:43: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: r239470 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Aug 2012 23:43:04 -0000 Author: kan Date: Mon Aug 20 23:43:03 2012 New Revision: 239470 URL: http://svn.freebsd.org/changeset/base/239470 Log: Do not call process_nodelete with NULL object pointer. The place where the function is called can be reached if object loading and relocation fails too, in which case obj pointer will be NULL. Do not call process_nodelete then, or crash will follow. Pointy hat to: kan Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Aug 20 20:56:40 2012 (r239469) +++ head/libexec/rtld-elf/rtld.c Mon Aug 20 23:43:03 2012 (r239470) @@ -2853,7 +2853,8 @@ dlopen_object(const char *name, int fd, * This has to be done after we have loaded all of the * dependencies, so that we do not miss any. */ - process_nodelete(obj); + if (obj != NULL) + process_nodelete(obj); } else { /* * Bump the reference counts for objects on this DAG. If From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 01:03: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 9876A106566B; Tue, 21 Aug 2012 01:03:21 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 1586E8FC15; Tue, 21 Aug 2012 01:03:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q7L13D3E008482; Tue, 21 Aug 2012 05:03:13 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q7L13CMr008481; Tue, 21 Aug 2012 05:03:13 +0400 (MSK) (envelope-from ache) Date: Tue, 21 Aug 2012 05:03:11 +0400 From: Andrey Chernov To: John Baldwin Message-ID: <20120821010311.GA8250@vniz.net> Mail-Followup-To: Andrey Chernov , John Baldwin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201208201409.55544.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r239356 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 01:03:21 -0000 On Mon, Aug 20, 2012 at 02:09:55PM -0400, John Baldwin wrote: > > RFC 2131 (if you mean it) describes DHCP process itself, it does not > > define contents of 'supersede' or other override options for dhclient. > > The supersede handling bits are all based on what the protocol can actually > send, which the RFC defines as IPv4. 'supercede' itself not based on DHCPv4, it simple override anything protocol can actually send and in general case overriding contents can be any IP. But... I agree with you that it looks like quick hack. Having dual-stack machine it seems proper way for me to run both DHCP and DHCPv6 clients (net-mgmt/wide-dhcp? net/dhcp6?). But I fear they both will interact with single /etc/resolv.conf overriding each other there. > > Moreover, current dhclient somewhow able to fetch my IPv6 tunnel DNS > > address from the roiter (I don't look deeper, maybe it is router bug), but > > I don't want IPv6 tunnel DNS, I want router fe80:... DNS instead. > > Eh? DHCP can't return an IPv6 address in the protocol. As I already mention, perhaps it is router bug combined with the lack of validity checking in dhclient itself. As result I currently have /etc/resolv.conf: nameserver 192.168.1.1 nameserver -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 02:58: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 22A5A106566B; Tue, 21 Aug 2012 02:58:08 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 15A9F8FC16; Tue, 21 Aug 2012 02:58:06 +0000 (UTC) Received: from ameno.mahoroba.org (IDENT:9A1Q49MNuh/8KVK0fLrXYAmNXrObFGoMN/znYMGJ7Tdr8dTnDB1UWeSkgPzJ+IGU@ameno.mahoroba.org [IPv6:2001:2f0:104:8010:20a:79ff:fe69:ee6b]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.5/8.14.5) with ESMTP/inet6 id q7L2vuZ3023950 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 21 Aug 2012 11:58:01 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Tue, 21 Aug 2012 11:57:56 +0900 Message-ID: From: Hajimu UMEMOTO To: Andrey Chernov In-Reply-To: <20120821010311.GA8250@vniz.net> References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/24.1 (i386-portbld-freebsd9.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 9.1-PRERELEASE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Tue, 21 Aug 2012 11:58:01 +0900 (JST) X-Virus-Scanned: clamav-milter 0.97.5 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, John Baldwin Subject: Re: svn commit: r239356 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 02:58:08 -0000 Hi, >>>>> On Tue, 21 Aug 2012 05:03:11 +0400 >>>>> Andrey Chernov said: ache> Having dual-stack machine it seems proper way for me to run both DHCP and ache> DHCPv6 clients (net-mgmt/wide-dhcp? net/dhcp6?). But I fear they both will ache> interact with single /etc/resolv.conf overriding each other there. FreeBSD 9 and above already have a feature to handle multiple source of DNS address,; resolvconf(8). Our dhclient(8) and rtsol(8) uses it to write /etc/resolv.conf. ache> As I already mention, perhaps it is router bug combined with the lack of ache> validity checking in dhclient itself. As result I currently have ache> /etc/resolv.conf: ache> nameserver 192.168.1.1 ache> nameserver Don't you see `# Generated by resolvconf' line in your generated /etc/resolv.conf? DHCP cannot carry an IPv6 address. I suspect your router advertises an IPv6 address of your DNS server. You can confirm where the DNS server addresss come from by executing `resolvconf -l'. The following is the output on my box for example: ume@yuga:~% resolvconf -l # resolv.conf from em0:dhcpv6 search mahoroba.org nameserver 2001:2f0:104:8010::1 nameserver 2001:2f0:104:8010:221:5aff:feeb:183 # resolv.conf from em0:slaac:[fe80::218:71ff:feec:5271] nameserver 2001:2f0:104:8010::1 search mahoroba.org # resolv.conf from em0 search mahoroba.org nameserver 192.168.100.59 nameserver 192.168.100.55 My network announces DHCPv6 and my box is configured to use DHCPv6. So, there are three sources for a DNS address, here. Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 04:45: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 8BF48106566B; Tue, 21 Aug 2012 04:45:59 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 05BB48FC0C; Tue, 21 Aug 2012 04:45:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q7L4jst0012360; Tue, 21 Aug 2012 08:45:54 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q7L4jra2012359; Tue, 21 Aug 2012 08:45:53 +0400 (MSK) (envelope-from ache) Date: Tue, 21 Aug 2012 08:45:53 +0400 From: Andrey Chernov To: Hajimu UMEMOTO Message-ID: <20120821044553.GA11375@vniz.net> Mail-Followup-To: Andrey Chernov , Hajimu UMEMOTO , John Baldwin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, John Baldwin Subject: Re: svn commit: r239356 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 04:45:59 -0000 On Tue, Aug 21, 2012 at 11:57:56AM +0900, Hajimu UMEMOTO wrote: > FreeBSD 9 and above already have a feature to handle multiple source > of DNS address,; resolvconf(8). Our dhclient(8) and rtsol(8) uses it > to write /etc/resolv.conf. Thanks pointing to resolvconf(8) and rtsol(8), I'll try to look there to setup this stuff properly. > Don't you see `# Generated by resolvconf' line in your generated > /etc/resolv.conf? > DHCP cannot carry an IPv6 address. > I suspect your router advertises an IPv6 address of your DNS server. Yes. Whole resolv.conf: # Generated by resolvconf search nameserver 192.168.1.1 nameserver > You can confirm where the DNS server addresss come from by executing > `resolvconf -l'. resolvconf -l output: # resolv.conf from msk0 search nameserver 192.168.1.1 # resolv.conf from msk0:slaac nameserver (btw, what is slaac?) And I want to override with simple link-local IPv6 address of my router, i.e. fe80:... Is it possible with resolvconf(8)? -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 05:39: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 D9747106564A; Tue, 21 Aug 2012 05:39:48 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og105.obsmtp.com (exprod7og105.obsmtp.com [64.18.2.163]) by mx1.freebsd.org (Postfix) with ESMTP id 4173B8FC08; Tue, 21 Aug 2012 05:39:46 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob105.postini.com ([64.18.6.12]) with SMTP ID DSNKUDMfIVaMn9lfTwDUVXYGhzqr/yn0H0Tf@postini.com; Mon, 20 Aug 2012 22:39:47 PDT Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Mon, 20 Aug 2012 22:35:20 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q7L5ZKh69766; Mon, 20 Aug 2012 22:35:20 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id BD5A158085; Mon, 20 Aug 2012 22:35:19 -0700 (PDT) To: Ruslan Ermilov In-Reply-To: <20120726084903.GA48240@lo0.su> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> Comments: In-reply-to: Ruslan Ermilov message dated "Thu, 26 Jul 2012 12:49:03 +0400." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Mon, 20 Aug 2012 22:35:19 -0700 Message-ID: <20120821053519.BD5A158085@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "David E. O'Brien" , sjg@juniper.net Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 05:39:48 -0000 Hi, sorry about the slow response. On Thu, 26 Jul 2012 12:49:03 +0400, Ruslan Ermilov writes: >On Wed, Jul 18, 2012 at 05:57:43AM +0000, David E. O'Brien wrote: >> Author: obrien >> Date: Wed Jul 18 05:57:42 2012 >> New Revision: 238563 >> URL: http://svn.freebsd.org/changeset/base/238563 >> >> Log: >> a ";" tells make we want the shell to be used >> >> Submitted by: Simon Gerraty >> >> Modified: >> head/gnu/usr.bin/groff/tmac/Makefile > >I don't quite understand what this change does, could you elaborate? Sure. This is a consequence of bmake trying to be clever. >Without -jN (in backwards compatibility mode), the "cd" is a no-op >(whether it's terminated by `;' or not) because make will execute a >single shell per command, with cwd set to ${.OBJDIR}. Except on very weird systems, bmake is built in what NetBSD call "native" mode, and even in compat mode will attempt to avoid the overhead of all those shells. Thus, unless it spots a shell meta char, it will try and skip the shell. Shell builtins like 'cd' or 'chdir' cannot be directly invoked, but make doesn't know that. Simply adding the ';' convinces it to use a shell. It is still a no-op. >With -jN, "cd" becomes necessary because all commands are executed as >a script by one shell (the reason it was added in the first place), >but adding `;' is a no-op because commands are on separate lines. A better way to construct targets like this is to put any excursion out of .OBJDIR inside (): (cd ${.CURDIR} && \ ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR}) then the cd ${.OBJDIR} isn't needed at all. note use of && rather than ; which can be very dangerous --sjg From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 05:46: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 7DECB1065670; Tue, 21 Aug 2012 05:46:19 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og103.obsmtp.com (exprod7og103.obsmtp.com [64.18.2.159]) by mx1.freebsd.org (Postfix) with ESMTP id 917488FC08; Tue, 21 Aug 2012 05:46:18 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob103.postini.com ([64.18.6.12]) with SMTP ID DSNKUDMgpHbMqLallxOpNXEijuwq14MGlv3h@postini.com; Mon, 20 Aug 2012 22:46:19 PDT Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Mon, 20 Aug 2012 22:44:27 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q7L5iRh75647; Mon, 20 Aug 2012 22:44:27 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 4486F58085; Mon, 20 Aug 2012 22:44:27 -0700 (PDT) To: John Baldwin In-Reply-To: <201207301119.49002.jhb@freebsd.org> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <201207301119.49002.jhb@freebsd.org> Comments: In-reply-to: John Baldwin message dated "Mon, 30 Jul 2012 11:19:48 -0400." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Mon, 20 Aug 2012 22:44:27 -0700 Message-ID: <20120821054427.4486F58085@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 05:46:19 -0000 On Mon, 30 Jul 2012 11:19:48 -0400, John Baldwin writes: >> @@ -68,7 +68,7 @@ beforeinstall: >> cd ${.CURDIR}; \ >> ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ >> koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR} >> - cd ${.OBJDIR} >> + cd ${.OBJDIR}; > >Isn't this a nop now? That is, it changes the working directory in a temporar >y >shell that immediately exits? If a shell is used, yes. Even in compat mode, bmake attempts to avoid the shell, so absent a clue (like ';') it attempts - and fails direct exection. A cd like that by itself generally makes no sense (as everyone has noted ;-) The ';' was a minimal change to ensure consistent behavior b/w the two makes, but re-working the target to avoid the need for that cd would be better - as noted just now in response to Ruslan. Thanks --sjg From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 05:46: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 8A94510657F4; Tue, 21 Aug 2012 05:46:34 +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 1800A8FC0A; Tue, 21 Aug 2012 05:46:33 +0000 (UTC) Received: by obbun3 with SMTP id un3so14434713obb.13 for ; Mon, 20 Aug 2012 22:46:33 -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; bh=JbkCBkvCgRPSaeziztmxAbY3ututXa4VyMdq82JJ7yM=; b=cdWG36u8ng9+3kn1Bur/e1g2wou8lMx/AL57hRkaDMd23aWaOe8LkfpocQpYMgdgk6 P6/SfWaFWG49cZ14tpltWeXyznLQCwS1AavURKaa6DqA7iO24CQOqGVkAA/MStsu64si WcW+ECK83IkGTY9VdOGXsH4TDSBZhdzjsGpSUTWKu6YInGfCx+lzozBIXZHxPA9N6YqJ IlSb5W5O38JRH6fyI8+kpxtT+DsLD+YZp3sGXAAFV+9zNuzsvsotfsdcRyk482F9qPg5 Kwfo3/tiU2ySVcOVKIgyDAQzi/3CBMvEr/5bs/xlTjj8Vj6KLsKqKSZW6qfbZLRozY0j B/FA== MIME-Version: 1.0 Received: by 10.60.20.69 with SMTP id l5mr11825506oee.114.1345527993655; Mon, 20 Aug 2012 22:46:33 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Mon, 20 Aug 2012 22:46:33 -0700 (PDT) In-Reply-To: <20120821053519.BD5A158085@chaos.jnpr.net> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> Date: Mon, 20 Aug 2012 22:46:33 -0700 Message-ID: From: Garrett Cooper To: "Simon J. Gerraty" Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ruslan Ermilov , "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 05:46:34 -0000 On Mon, Aug 20, 2012 at 10:35 PM, Simon J. Gerraty wrote: > Hi, sorry about the slow response. > > On Thu, 26 Jul 2012 12:49:03 +0400, Ruslan Ermilov writes: >>On Wed, Jul 18, 2012 at 05:57:43AM +0000, David E. O'Brien wrote: >>> Author: obrien >>> Date: Wed Jul 18 05:57:42 2012 >>> New Revision: 238563 >>> URL: http://svn.freebsd.org/changeset/base/238563 >>> >>> Log: >>> a ";" tells make we want the shell to be used >>> >>> Submitted by: Simon Gerraty >>> >>> Modified: >>> head/gnu/usr.bin/groff/tmac/Makefile >> >>I don't quite understand what this change does, could you elaborate? > > Sure. This is a consequence of bmake trying to be clever. > >>Without -jN (in backwards compatibility mode), the "cd" is a no-op >>(whether it's terminated by `;' or not) because make will execute a >>single shell per command, with cwd set to ${.OBJDIR}. > > Except on very weird systems, bmake is built in what NetBSD call > "native" mode, and even in compat mode will attempt to avoid the > overhead of all those shells. > Thus, unless it spots a shell meta char, it will try and skip the shell. > > Shell builtins like 'cd' or 'chdir' cannot be directly invoked, but make > doesn't know that. Simply adding the ';' convinces it to use a shell. > It is still a no-op. > >>With -jN, "cd" becomes necessary because all commands are executed as >>a script by one shell (the reason it was added in the first place), >>but adding `;' is a no-op because commands are on separate lines. > > A better way to construct targets like this is to put any excursion out > of .OBJDIR inside (): > > (cd ${.CURDIR} && \ > ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ > koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR}) > > then the cd ${.OBJDIR} isn't needed at all. > note use of && rather than ; which can be very dangerous In standard scripts I would agree. In FreeBSD pmake, I would disagree, but it seems that it's the odd man out: $ bmake -f ~/Makefile.bad false; echo hmmm hmmm $ gmake -f ~/Makefile.bad false; echo hmmm hmmm $ make -f ~/Makefile.bad false; echo hmmm *** [all] Error code 1 Stop in /scratch/p4/user/gcooper/atf-head. Cheers, -Garrett From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 06:14: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 4BC94106564A; Tue, 21 Aug 2012 06:14:09 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 364658FC14; Tue, 21 Aug 2012 06:14: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 q7L6E9QY075823; Tue, 21 Aug 2012 06:14:09 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L6E9NL075820; Tue, 21 Aug 2012 06:14:09 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201208210614.q7L6E9NL075820@svn.freebsd.org> From: "Andrey A. Chernov" Date: Tue, 21 Aug 2012 06:14: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: r239477 - head/contrib/openresolv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 06:14:09 -0000 Author: ache Date: Tue Aug 21 06:14:08 2012 New Revision: 239477 URL: http://svn.freebsd.org/changeset/base/239477 Log: According to resolvconf.conf(5) manpage and sources, there is no 'nameservers' option which used in examples in resolvconf.conf(5), it spelled 'name_servers', so fix examples. Modified: head/contrib/openresolv/resolvconf.conf.5.in Modified: head/contrib/openresolv/resolvconf.conf.5.in ============================================================================== --- head/contrib/openresolv/resolvconf.conf.5.in Tue Aug 21 06:09:43 2012 (r239476) +++ head/contrib/openresolv/resolvconf.conf.5.in Tue Aug 21 06:14:08 2012 (r239477) @@ -113,7 +113,7 @@ This file tells dnsmasq which nameserver This file tells dnsmasq which nameservers to use for global lookups. .Pp Example resolvconf.conf for dnsmasq: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 dnsmasq_conf=/etc/dnsmasq-conf.conf .D1 dnsmasq_resolv=/etc/dnsmasq-resolv.conf .Pp @@ -129,7 +129,7 @@ Include this file in the named global sc This file tells named which nameservers to use for specific domains. .Pp Example resolvconf.conf for named: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 named_options=/etc/named-options.conf .D1 named_zones=/etc/named-zones.conf .Pp @@ -152,7 +152,7 @@ If this variable is not set then it's wr .Pa pdnsd_conf . .Pp Example resolvconf.conf for pdnsd: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 pdnsd_conf=/etc/pdnsd.conf .D1 # pdnsd_resolv=/etc/pdnsd-resolv.conf .Pp @@ -171,7 +171,7 @@ Example pdnsd.conf: This file tells unbound about specific and global nameservers. .Pp Example resolvconf.conf for unbound: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 unbound_conf=/etc/unbound-resolvconf.conf .Pp Example unbound.conf: From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 06:14: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 9C7DC10657E9; Tue, 21 Aug 2012 06:14:48 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og111.obsmtp.com (exprod7og111.obsmtp.com [64.18.2.175]) by mx1.freebsd.org (Postfix) with ESMTP id 75E9F8FC0A; Tue, 21 Aug 2012 06:14:46 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob111.postini.com ([64.18.6.12]) with SMTP ID DSNKUDMnVZkqXHwL33mdA3e/uAg9xE4pF3pJ@postini.com; Mon, 20 Aug 2012 23:14:47 PDT Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Mon, 20 Aug 2012 23:14:43 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q7L6Ehh91556; Mon, 20 Aug 2012 23:14:43 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 0B2D158085; Mon, 20 Aug 2012 23:14:43 -0700 (PDT) To: Garrett Cooper In-Reply-To: References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> Comments: In-reply-to: Garrett Cooper message dated "Mon, 20 Aug 2012 22:46:33 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Mon, 20 Aug 2012 23:14:43 -0700 Message-ID: <20120821061443.0B2D158085@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ruslan Ermilov , "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 06:14:50 -0000 >> note use of && rather than ; which can be very dangerous > >In standard scripts I would agree. In FreeBSD pmake, I would disagree, >but it seems that it's the odd man out: Yes, this is because FreeBSD make still uses the shell's -e for error detection. NetBSD (hence bmake) abandoned that quite a while ago, as it does more harm that good. I had a vague recollection that the posix man page covered this, but the text is somewhat ambiguous. Its descripton of using system() though is probably why most makefile authors expect the command line to be the unit of exection and thus success/failure. false || echo ok works ok even with -e, but while most makes will print ok for this one too: false; test $$? != 0 && echo ok it will fail if -e is used. That's a contrived example, but I know David had a fun real life example a couple of years ago that was quite painful to workaround. --sjg From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 06:16:32 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 C93D7106564A; Tue, 21 Aug 2012 06:16:32 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6C2768FC17; Tue, 21 Aug 2012 06:16:32 +0000 (UTC) Received: from ameno.mahoroba.org (IDENT:fCwaspgSk70G1R0qWxIaItCihBOJeC9ywQKAXIKgXJMCQ1cTcZL4ldwEXt2C8UgX@ameno.mahoroba.org [IPv6:2001:2f0:104:8010:20a:79ff:fe69:ee6b]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.5/8.14.5) with ESMTP/inet6 id q7L6GQ3u099826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 21 Aug 2012 15:16:26 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Tue, 21 Aug 2012 15:16:26 +0900 Message-ID: From: Hajimu UMEMOTO To: Andrey Chernov In-Reply-To: <20120821044553.GA11375@vniz.net> References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/24.1 (i386-portbld-freebsd9.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 9.1-PRERELEASE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Tue, 21 Aug 2012 15:16:26 +0900 (JST) X-Virus-Scanned: clamav-milter 0.97.5 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, John Baldwin Subject: Re: svn commit: r239356 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 06:16:32 -0000 Hi, >>>>> On Tue, 21 Aug 2012 08:45:53 +0400 >>>>> Andrey Chernov said: ache> resolvconf -l output: ache> # resolv.conf from msk0 ache> search ache> nameserver 192.168.1.1 ache> # resolv.conf from msk0:slaac ache> nameserver ache> (btw, what is slaac?) It is abbreviation for StateLess Address AutoConfiguration described in rfc 4862. This RA option is described in rfc 5006 (IPv6 Router Advertisement Option for DNS Configuration). ache> And I want to override ache> with simple link-local IPv6 address of my router, i.e. fe80:... I think your network admin setup to advertise the address. Why do you want to use link-local address, instead? ache> Is it possible with resolvconf(8)? resolvconf(8) doesn't have such rewrite feature. However, rtsol(8) has -R option to specify your own script to update /etc/resolv.conf. You may want to write your own script to rewrite nameserver address then pass it to resolvconf(8). Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 06:30: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 B4BC3106564A; Tue, 21 Aug 2012 06:30:30 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1E08FC12; Tue, 21 Aug 2012 06:30:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q7L6USps041551; Tue, 21 Aug 2012 10:30:28 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q7L6URsw041550; Tue, 21 Aug 2012 10:30:28 +0400 (MSK) (envelope-from ache) Date: Tue, 21 Aug 2012 10:30:27 +0400 From: Andrey Chernov To: Hajimu UMEMOTO Message-ID: <20120821063027.GA41459@vniz.net> Mail-Followup-To: Andrey Chernov , Hajimu UMEMOTO , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r239356 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 06:30:30 -0000 On Tue, Aug 21, 2012 at 03:16:26PM +0900, Hajimu UMEMOTO wrote: > ache> And I want to override > ache> with simple link-local IPv6 address of my router, i.e. fe80:... > > I think your network admin setup to advertise the address. Why do you > want to use link-local address, instead? I am network admin, but what router advertise is out my easy control (fixing configs in the Linux router's FS or even rebuilding router components is needed, I don't want to touch this hardware). I want override because router runs dnsmasq with caching (on both its IPv4 and IPv6 adresses), and NS it advertise goes through tunnel each time without caching in the router. > ache> Is it possible with resolvconf(8)? > > resolvconf(8) doesn't have such rewrite feature. However, rtsol(8) > has -R option to specify your own script to update /etc/resolv.conf. > You may want to write your own script to rewrite nameserver address > then pass it to resolvconf(8). So far I found the way to specify router link-local address using name_servers=fe80::... in the /etc/resolvconf.conf It prepends this name server above all others router advertise. But I still not find the way to _exclude_ what router advertise, perhaps looking into rtsol(8) possibilities you point will help here. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 06:31: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 6AA381065676; Tue, 21 Aug 2012 06:31: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 5150C8FC1C; Tue, 21 Aug 2012 06: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 q7L6VRUi078662; Tue, 21 Aug 2012 06:31:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L6VRQb078654; Tue, 21 Aug 2012 06:31:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208210631.q7L6VRQb078654@svn.freebsd.org> From: Adrian Chadd Date: Tue, 21 Aug 2012 06: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: r239478 - in head/sys: conf powerpc/wii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 06:31:27 -0000 Author: adrian Date: Tue Aug 21 06:31:26 2012 New Revision: 239478 URL: http://svn.freebsd.org/changeset/base/239478 Log: Initial support for running FreeBSD on the Nintendo Wii. We're able to reach single user mode using a memory disk device as the file system. This port includes the framebuffer driver, the PIC driver, a platform driver and the GPIO driver. The IPC driver (to talk to IOS kernels) is not yet written but there's a placeholder for it. There are still some MMU problems and to get a working system you need to patch locore32.S. Since we haven't found the best way yet to address that problem, we're not committing those changes yet. The problem is related to the different BAT layout on the Wii and to the fact that the Homebrew loader doesn't clean up the special registers (including the 8 BATs) before passing control to us. You'll need a Wii with Homebrew loader and a TV that can do NTSC (for now). Submitted by: Margarida Gouveia Added: head/sys/powerpc/wii/ head/sys/powerpc/wii/platform_wii.c (contents, props changed) head/sys/powerpc/wii/wii_bus.c (contents, props changed) head/sys/powerpc/wii/wii_exireg.h (contents, props changed) head/sys/powerpc/wii/wii_fb.c (contents, props changed) head/sys/powerpc/wii/wii_fbreg.h (contents, props changed) head/sys/powerpc/wii/wii_fbvar.h (contents, props changed) head/sys/powerpc/wii/wii_gpio.c (contents, props changed) head/sys/powerpc/wii/wii_gpioreg.h (contents, props changed) head/sys/powerpc/wii/wii_ipc.c (contents, props changed) head/sys/powerpc/wii/wii_ipcreg.h (contents, props changed) head/sys/powerpc/wii/wii_pic.c (contents, props changed) head/sys/powerpc/wii/wii_picreg.h (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/conf/options.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue Aug 21 06:14:08 2012 (r239477) +++ head/sys/conf/files.powerpc Tue Aug 21 06:31:26 2012 (r239478) @@ -228,6 +228,12 @@ powerpc/psim/iobus.c optional psim powerpc/psim/ata_iobus.c optional ata psim powerpc/psim/openpic_iobus.c optional psim powerpc/psim/uart_iobus.c optional uart psim +powerpc/wii/platform_wii.c optional wii +powerpc/wii/wii_bus.c optional wii +powerpc/wii/wii_pic.c optional wii +powerpc/wii/wii_fb.c optional wii +powerpc/wii/wii_gpio.c optional wii +powerpc/wii/wii_ipc.c optional wii compat/freebsd32/freebsd32_ioctl.c optional compat_freebsd32 compat/freebsd32/freebsd32_misc.c optional compat_freebsd32 Modified: head/sys/conf/options.powerpc ============================================================================== --- head/sys/conf/options.powerpc Tue Aug 21 06:14:08 2012 (r239477) +++ head/sys/conf/options.powerpc Tue Aug 21 06:31:26 2012 (r239478) @@ -23,6 +23,7 @@ POWERMAC opt_platform.h PS3 opt_platform.h MAMBO PSIM +WII opt_platform.h SC_OFWFB opt_ofwfb.h Added: head/sys/powerpc/wii/platform_wii.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/wii/platform_wii.c Tue Aug 21 06:31:26 2012 (r239478) @@ -0,0 +1,152 @@ +/*- + * Copyright (C) 2012 Margarida Gouveia + * 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. 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 ``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 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 "platform_if.h" + +static int wii_probe(platform_t); +static int wii_attach(platform_t); +static void wii_mem_regions(platform_t, struct mem_region **, + int *, struct mem_region **, int *); +static unsigned long wii_timebase_freq(platform_t, struct cpuref *cpuref); +static void wii_reset(platform_t); +static void wii_cpu_idle(void); + +static platform_method_t wii_methods[] = { + PLATFORMMETHOD(platform_probe, wii_probe), + PLATFORMMETHOD(platform_attach, wii_attach), + PLATFORMMETHOD(platform_mem_regions, wii_mem_regions), + PLATFORMMETHOD(platform_timebase_freq, wii_timebase_freq), + PLATFORMMETHOD(platform_reset, wii_reset), + + { 0, 0 } +}; + +static platform_def_t wii_platform = { + "wii", + wii_methods, + 0 +}; + +PLATFORM_DEF(wii_platform); + +static int +wii_probe(platform_t plat) +{ + register_t vers = mfpvr(); + + /* + * The Wii includes a PowerPC 750CL with custom modifications + * ("Broadway"). + * For now, we just assume that if we are running on a + * PowerPC 750CL, then this platform is a Nintendo Wii. + */ + if ((vers & 0xfffff0e0) == (MPC750 << 16 | MPC750CL)) + return (BUS_PROBE_SPECIFIC); + + return (ENXIO); +} + +static int +wii_attach(platform_t plat) +{ + cpu_idle_hook = wii_cpu_idle; + + return (0); +} + +#define MEM_REGIONS 2 +static struct mem_region avail_regions[MEM_REGIONS]; + +static void +wii_mem_regions(platform_t plat, struct mem_region **phys, int *physsz, + struct mem_region **avail, int *availsz) +{ + /* 24MB 1T-SRAM */ + avail_regions[0].mr_start = 0x00000000; + avail_regions[0].mr_size = 0x01800000 - 0x0004000; + + /* + * Reserve space for the framebuffer which is located + * at the end of this 24MB memory region. See wii_fbreg.h. + */ + avail_regions[0].mr_size -= WIIFB_FB_LEN; + + /* 64MB GDDR3 SDRAM */ + avail_regions[1].mr_start = 0x10000000 + 0x0004000; + avail_regions[1].mr_size = 0x04000000 - 0x0004000; + + /* XXX for now only use the first memory region */ +#undef MEM_REGIONS +#define MEM_REGIONS 1 + + *phys = *avail = avail_regions; + *physsz = *availsz = MEM_REGIONS; +} + +static u_long +wii_timebase_freq(platform_t plat, struct cpuref *cpuref) +{ + + /* Bus Frequency (243MHz) / 4 */ + return (60750000); +} + +static void +wii_reset(platform_t plat) +{ +} + +static void +wii_cpu_idle(void) +{ +} Added: head/sys/powerpc/wii/wii_bus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/wii/wii_bus.c Tue Aug 21 06:31:26 2012 (r239478) @@ -0,0 +1,293 @@ +/*- + * Copyright (C) 2012 Margarida Gouveia + * 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. 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 ``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 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 + +static void wiibus_identify(driver_t *, device_t); +static int wiibus_probe(device_t); +static int wiibus_attach(device_t); +static int wiibus_print_child(device_t, device_t); +static struct resource * + wiibus_alloc_resource(device_t, device_t, int, int *, + unsigned long, unsigned long, unsigned long, + unsigned int); +static int wiibus_activate_resource(device_t, device_t, int, int, + struct resource *); + +static device_method_t wiibus_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, wiibus_identify), + DEVMETHOD(device_probe, wiibus_probe), + DEVMETHOD(device_attach, wiibus_attach), + + /* Bus interface */ + DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_print_child, wiibus_print_child), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, wiibus_alloc_resource), + DEVMETHOD(bus_activate_resource,wiibus_activate_resource), + + DEVMETHOD_END +}; + +struct wiibus_softc { + device_t sc_dev; + struct rman sc_rman; +}; + +static MALLOC_DEFINE(M_WIIBUS, "wiibus", "Nintendo Wii system bus"); + +struct wiibus_devinfo { + struct resource_list di_resources; + uint8_t di_init; +}; + +static driver_t wiibus_driver = { + "wiibus", + wiibus_methods, + sizeof(struct wiibus_softc) +}; + +static devclass_t wiibus_devclass; + +DRIVER_MODULE(wiibus, nexus, wiibus_driver, wiibus_devclass, 0, 0); + +static void +wiibus_identify(driver_t *driver, device_t parent) +{ + if (strcmp(installed_platform(), "wii") != 0) + return; + + if (device_find_child(parent, "wiibus", -1) == NULL) + BUS_ADD_CHILD(parent, 0, "wiibus", 0); +} + + +static int +wiibus_probe(device_t dev) +{ + /* Do not attach to any OF nodes that may be present */ + + device_set_desc(dev, "Nintendo Wii System Bus"); + + return (BUS_PROBE_NOWILDCARD); +} + +static void +wiibus_init_device_resources(struct rman *rm, struct wiibus_devinfo *dinfo, + unsigned int rid, uintptr_t addr, size_t len, unsigned int irq) + +{ + if (!dinfo->di_init) { + resource_list_init(&dinfo->di_resources); + dinfo->di_init++; + } + if (addr) { + rman_manage_region(rm, addr, addr + len - 1); + resource_list_add(&dinfo->di_resources, SYS_RES_MEMORY, rid, + addr, addr + len, len); + } + if (irq) + resource_list_add(&dinfo->di_resources, SYS_RES_IRQ, rid, + irq, irq, 1); +} + +static int +wiibus_attach(device_t self) +{ + struct wiibus_softc *sc; + struct wiibus_devinfo *dinfo; + device_t cdev; + + sc = device_get_softc(self); + sc->sc_rman.rm_type = RMAN_ARRAY; + sc->sc_rman.rm_descr = "Wii Bus Memory Mapped I/O"; + rman_init(&sc->sc_rman); + + /* Nintendo PIC */ + dinfo = malloc(sizeof(*dinfo), M_WIIBUS, M_WAITOK | M_ZERO); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 0, WIIPIC_REG_ADDR, + WIIPIC_REG_LEN, 0); + cdev = BUS_ADD_CHILD(self, 0, "wiipic", 0); + device_set_ivars(cdev, dinfo); + + /* Framebuffer */ + dinfo = malloc(sizeof(*dinfo), M_WIIBUS, M_WAITOK | M_ZERO); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 0, WIIFB_REG_ADDR, + WIIFB_REG_LEN, 8); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 1, WIIFB_FB_ADDR, + WIIFB_FB_LEN, 0); + cdev = BUS_ADD_CHILD(self, 0, "wiifb", 0); + device_set_ivars(cdev, dinfo); + + /* External Interface Bus */ + dinfo = malloc(sizeof(*dinfo), M_WIIBUS, M_WAITOK | M_ZERO); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 0, WIIEXI_REG_ADDR, + WIIEXI_REG_LEN, 4); + cdev = BUS_ADD_CHILD(self, 0, "wiiexi", 0); + device_set_ivars(cdev, dinfo); + + /* Nintendo IOS IPC */ + dinfo = malloc(sizeof(*dinfo), M_WIIBUS, M_WAITOK | M_ZERO); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 0, WIIIPC_REG_ADDR, + WIIIPC_REG_LEN, 14); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 1, WIIIPC_IOH_ADDR, + WIIIPC_IOH_LEN, 0); + cdev = BUS_ADD_CHILD(self, 0, "wiiipc", 0); + device_set_ivars(cdev, dinfo); + + /* GPIO */ + dinfo = malloc(sizeof(*dinfo), M_WIIBUS, M_WAITOK | M_ZERO); + wiibus_init_device_resources(&sc->sc_rman, dinfo, 0, WIIGPIO_REG_ADDR, + WIIGPIO_REG_LEN, 0); + cdev = BUS_ADD_CHILD(self, 0, "wiigpio", 0); + device_set_ivars(cdev, dinfo); + + return (bus_generic_attach(self)); +} + +static int +wiibus_print_child(device_t dev, device_t child) +{ + struct wiibus_devinfo *dinfo = device_get_ivars(child); + int retval = 0; + + retval += bus_print_child_header(dev, child); + retval += resource_list_print_type(&dinfo->di_resources, "mem", + SYS_RES_MEMORY, "%#lx"); + retval += resource_list_print_type(&dinfo->di_resources, "irq", + SYS_RES_IRQ, "%ld"); + retval += bus_print_child_footer(dev, child); + + return (retval); +} + +static struct resource * +wiibus_alloc_resource(device_t bus, device_t child, int type, + int *rid, unsigned long start, unsigned long end, + unsigned long count, unsigned int flags) +{ + struct wiibus_softc *sc; + struct wiibus_devinfo *dinfo; + struct resource_list_entry *rle; + struct resource *rv; + int needactivate; + + sc = device_get_softc(bus); + dinfo = device_get_ivars(child); + needactivate = flags & RF_ACTIVE; + flags &= ~RF_ACTIVE; + + switch (type) { + case SYS_RES_MEMORY: + rle = resource_list_find(&dinfo->di_resources, SYS_RES_MEMORY, + *rid); + if (rle == NULL) { + device_printf(bus, "no res entry for %s memory 0x%x\n", + device_get_nameunit(child), *rid); + return (NULL); + } + rv = rman_reserve_resource(&sc->sc_rman, rle->start, rle->end, + rle->count, flags, child); + if (rv == NULL) { + device_printf(bus, + "failed to reserve resource for %s\n", + device_get_nameunit(child)); + return (NULL); + } + rman_set_rid(rv, *rid); + break; + /* XXX IRQ */ + default: + device_printf(bus, "unknown resource request from %s\n", + device_get_nameunit(child)); + return (NULL); + } + + if (needactivate) { + if (bus_activate_resource(child, type, *rid, rv) != 0) { + device_printf(bus, + "failed to activate resource for %s\n", + device_get_nameunit(child)); + return (NULL); + } + } + + return (rv); +} + +static int +wiibus_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + void *p; + + switch (type) { + case SYS_RES_MEMORY: + p = pmap_mapdev(rman_get_start(res), rman_get_size(res)); + if (p == NULL) + return (ENOMEM); + rman_set_virtual(res, p); + rman_set_bustag(res, &bs_be_tag); + rman_set_bushandle(res, (unsigned long)p); + break; + /* XXX IRQ */ + default: + device_printf(bus, + "unknown activate resource request from %s\n", + device_get_nameunit(child)); + return (ENXIO); + } + + return (rman_activate_resource(res)); +} + Added: head/sys/powerpc/wii/wii_exireg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/wii/wii_exireg.h Tue Aug 21 06:31:26 2012 (r239478) @@ -0,0 +1,35 @@ +/*- + * Copyright (C) 2012 Margarida Gouveia + * 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 ``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 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 _POWERPC_WII_WII_EXIREG_H +#define _POWERPC_WII_WII_EXIREG_H + +#define WIIEXI_REG_ADDR 0x0d006800 +#define WIIEXI_REG_LEN 0x40 + +#endif /* _POWERPC_WII_WII_IPCREG_H */ Added: head/sys/powerpc/wii/wii_fb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/wii/wii_fb.c Tue Aug 21 06:31:26 2012 (r239478) @@ -0,0 +1,881 @@ +/*- + * Copyright (C) 2012 Margarida Gouveia + * Copyright (c) 2003 Peter Grehan + * 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. 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 ``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 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 + +/* + * Driver for the Nintendo Wii's framebuffer. Based on Linux's gcnfb.c. + */ + +/* + * Syscons glue. + */ +static int wiifb_scprobe(device_t); +static int wiifb_scattach(device_t); + +static device_method_t wiifb_sc_methods[] = { + DEVMETHOD(device_probe, wiifb_scprobe), + DEVMETHOD(device_attach, wiifb_scattach), + + DEVMETHOD_END +}; + +static driver_t wiifb_sc_driver = { + "wiifb", + wiifb_sc_methods, + sizeof(sc_softc_t), +}; + +static devclass_t sc_devclass; + +DRIVER_MODULE(sc, wiibus, wiifb_sc_driver, sc_devclass, 0, 0); + +static int +wiifb_scprobe(device_t dev) +{ + int error; + + device_set_desc(dev, "Nintendo Wii frambuffer"); + + error = sc_probe_unit(device_get_unit(dev), + device_get_flags(dev) | SC_AUTODETECT_KBD); + if (error != 0) + return (error); + + /* This is a fake device, so make sure we added it ourselves */ + return (BUS_PROBE_NOWILDCARD); +} + +static int +wiifb_scattach(device_t dev) +{ + + return (sc_attach_unit(device_get_unit(dev), + device_get_flags(dev) | SC_AUTODETECT_KBD)); +} + +/* + * Video driver routines and glue. + */ +static void wiifb_reset_video(struct wiifb_softc *); +static void wiifb_enable_interrupts(struct wiifb_softc *); +static void wiifb_configure_tv_mode(struct wiifb_softc *); +static void wiifb_setup_framebuffer(struct wiifb_softc *); +static int wiifb_configure(int); +static vi_probe_t wiifb_probe; +static vi_init_t wiifb_init; +static vi_get_info_t wiifb_get_info; +static vi_query_mode_t wiifb_query_mode; +static vi_set_mode_t wiifb_set_mode; +static vi_save_font_t wiifb_save_font; +static vi_load_font_t wiifb_load_font; +static vi_show_font_t wiifb_show_font; +static vi_save_palette_t wiifb_save_palette; +static vi_load_palette_t wiifb_load_palette; +static vi_set_border_t wiifb_set_border; +static vi_save_state_t wiifb_save_state; +static vi_load_state_t wiifb_load_state; +static vi_set_win_org_t wiifb_set_win_org; +static vi_read_hw_cursor_t wiifb_read_hw_cursor; +static vi_set_hw_cursor_t wiifb_set_hw_cursor; +static vi_set_hw_cursor_shape_t wiifb_set_hw_cursor_shape; +static vi_blank_display_t wiifb_blank_display; +static vi_mmap_t wiifb_mmap; +static vi_ioctl_t wiifb_ioctl; +static vi_clear_t wiifb_clear; +static vi_fill_rect_t wiifb_fill_rect; +static vi_bitblt_t wiifb_bitblt; +static vi_diag_t wiifb_diag; +static vi_save_cursor_palette_t wiifb_save_cursor_palette; +static vi_load_cursor_palette_t wiifb_load_cursor_palette; +static vi_copy_t wiifb_copy; +static vi_putp_t wiifb_putp; +static vi_putc_t wiifb_putc; +static vi_puts_t wiifb_puts; +static vi_putm_t wiifb_putm; + +static video_switch_t wiifbvidsw = { + .probe = wiifb_probe, + .init = wiifb_init, + .get_info = wiifb_get_info, + .query_mode = wiifb_query_mode, + .set_mode = wiifb_set_mode, + .save_font = wiifb_save_font, + .load_font = wiifb_load_font, + .show_font = wiifb_show_font, + .save_palette = wiifb_save_palette, + .load_palette = wiifb_load_palette, + .set_border = wiifb_set_border, + .save_state = wiifb_save_state, + .load_state = wiifb_load_state, + .set_win_org = wiifb_set_win_org, + .read_hw_cursor = wiifb_read_hw_cursor, + .set_hw_cursor = wiifb_set_hw_cursor, + .set_hw_cursor_shape = wiifb_set_hw_cursor_shape, + .blank_display = wiifb_blank_display, + .mmap = wiifb_mmap, + .ioctl = wiifb_ioctl, + .clear = wiifb_clear, + .fill_rect = wiifb_fill_rect, + .bitblt = wiifb_bitblt, + .diag = wiifb_diag, + .save_cursor_palette = wiifb_save_cursor_palette, + .load_cursor_palette = wiifb_load_cursor_palette, + .copy = wiifb_copy, + .putp = wiifb_putp, + .putc = wiifb_putc, + .puts = wiifb_puts, + .putm = wiifb_putm, +}; + +VIDEO_DRIVER(wiifb, wiifbvidsw, wiifb_configure); + +extern sc_rndr_sw_t txtrndrsw; +RENDERER(wiifb, 0, txtrndrsw, gfb_set); +RENDERER_MODULE(wiifb, gfb_set); + +static struct wiifb_softc wiifb_softc; +static uint16_t wiifb_static_window[ROW*COL]; +extern u_char dflt_font_8[]; + +/* + * Map the syscons colors to YUY2 (Y'UV422). + * Some colours are an approximation. + * + * The Wii has a 16 bit pixel, so each 32 bit DWORD encodes + * two pixels. The upper 16 bits is for pixel 0 (left hand pixel + * in a pair), the lower 16 bits is for pixel 1. + * + * For now, we're going to ignore that entirely and just use the + * lower 16 bits for each pixel. We'll take the upper value into + * account later. + */ +static uint32_t wiifb_cmap[16] = { + 0x00800080, /* Black */ + 0x1dff1d6b, /* Blue */ + 0x4b554b4a, /* Green */ + 0x80808080, /* Cyan */ + 0x4c544cff, /* Red */ + 0x3aaa34b5, /* Magenta */ + 0x7140718a, /* Brown */ + 0xff80ff80, /* White */ + 0x80808080, /* Gray */ + 0xc399c36a, /* Bright Blue */ + 0xd076d074, /* Bright Green */ + 0x80808080, /* Bright Cyan */ + 0x4c544cff, /* Bright Red */ + 0x3aaa34b5, /* Bright Magenta */ + 0xe100e194, /* Bright Yellow */ + 0xff80ff80 /* Bright White */ +}; + +static struct wiifb_mode_desc wiifb_modes[] = { + [WIIFB_MODE_NTSC_480i] = { + "NTSC 480i", + 640, 480, + 525, + WIIFB_MODE_FLAG_INTERLACED, + }, + [WIIFB_MODE_NTSC_480p] = { + "NTSC 480p", + 640, 480, + 525, + WIIFB_MODE_FLAG_PROGRESSIVE, + }, + [WIIFB_MODE_PAL_576i] = { + "PAL 576i (50Hz)", + 640, 574, + 625, + WIIFB_MODE_FLAG_INTERLACED, + }, + [WIIFB_MODE_PAL_480i] = { + "PAL 480i (60Hz)", + 640, 480, + 525, + WIIFB_MODE_FLAG_INTERLACED, + }, + [WIIFB_MODE_PAL_480p] = { + "PAL 480p", + 640, 480, + 525, + WIIFB_MODE_FLAG_PROGRESSIVE, + }, +}; + +static const uint32_t wiifb_filter_coeft[] = { + 0x1ae771f0, 0x0db4a574, 0x00c1188e, 0xc4c0cbe2, 0xfcecdecf, + 0x13130f08, 0x00080c0f +}; + +static __inline int +wiifb_background(uint8_t attr) +{ + + return (attr >> 4); +} + +static __inline int +wiifb_foreground(uint8_t attr) +{ + + return (attr & 0x0f); +} + +static void +wiifb_reset_video(struct wiifb_softc *sc) +{ + struct wiifb_dispcfg dc; + + wiifb_dispcfg_read(sc, &dc); + dc.dc_reset = 1; + wiifb_dispcfg_write(sc, &dc); + dc.dc_reset = 0; + wiifb_dispcfg_write(sc, &dc); +} + +static void +wiifb_enable_interrupts(struct wiifb_softc *sc) +{ + struct wiifb_dispint di; + +#ifdef notyet + /* + * Display Interrupt 0 + */ + di.di_htiming = 1; + di.di_vtiming = 1; + di.di_enable = 1; + di.di_irq = 1; + wiifb_dispint_write(sc, 0, &di); + + /* + * Display Interrupt 1 + */ + di.di_htiming = sc->sc_format == WIIFB_FORMAT_PAL ? 433 : 430; + di.di_vtiming = sc->sc_mode->fd_lines; + di.di_enable = 1; + di.di_irq = 1; + if (sc->sc_mode->fd_flags & WIIFB_MODE_FLAG_INTERLACED) + di.di_vtiming /= 2; + wiifb_dispint_write(sc, 1, &di); + + /* + * Display Interrupts 2 and 3 are not used. + */ + memset(&di, 0, sizeof(di)); + wiifb_dispint_write(sc, 2, &di); + wiifb_dispint_write(sc, 3, &di); +#else + memset(&di, 0, sizeof(di)); + wiifb_dispint_write(sc, 0, &di); + wiifb_dispint_write(sc, 1, &di); + wiifb_dispint_write(sc, 2, &di); + wiifb_dispint_write(sc, 3, &di); +#endif +} + +/* + * Reference gcnfb.c for an in depth explanation. + * XXX only works with NTSC. + */ +static void +wiifb_configure_tv_mode(struct wiifb_softc *sc) +{ + struct wiifb_vtiming vt; + struct wiifb_hscaling hs; + struct wiifb_htiming0 ht0; + struct wiifb_htiming1 ht1; + struct wiifb_vtimingodd vto; + struct wiifb_vtimingeven vte; + struct wiifb_burstblankodd bbo; + struct wiifb_burstblankeven bbe; + struct wiifb_picconf pc; + struct wiifb_mode_desc *mode = sc->sc_mode; + unsigned int height = mode->fd_height; + unsigned int width = mode->fd_width; + unsigned int eqpulse, interlacebias, shift; + const unsigned int maxwidth = 714; + unsigned int hblanking = maxwidth - width; + unsigned int hmargin = hblanking / 2; + unsigned int A = 20 + hmargin, C = 60 + hblanking - hmargin; + unsigned int maxheight = 484; + unsigned int P = 2 * (20 - 10 + 1); + unsigned int Q = 1; + unsigned int vblanking = maxheight - height; + unsigned int vmargin = vblanking / 2; + unsigned int prb = vmargin; + unsigned int psb = vblanking - vmargin; + int i; + + /* + * Vertical timing. + */ + if (mode->fd_flags & WIIFB_MODE_FLAG_INTERLACED) { + vt.vt_actvideo = height / 2; + interlacebias = 1; + shift = 0; + } else { + vt.vt_actvideo = height; + interlacebias = 0; + shift = 1; + } + /* Lines of equalization */ + if (mode->fd_lines == 625) + eqpulse = 2 * 2.5; + else + eqpulse = 2 * 3; + vt.vt_eqpulse = eqpulse << shift; + wiifb_vtiming_write(sc, &vt); + + /* + * Horizontal timings. + */ + ht0.ht0_hlinew = 858 / 2; + ht1.ht1_hsyncw = 64; + ht0.ht0_hcolourstart = 71; + ht0.ht0_hcolourend = 71 + 34; + ht1.ht1_hblankstart = (858 / 2) - A; + ht1.ht1_hblankend = 64 + C; + wiifb_htiming0_write(sc, &ht0); + wiifb_htiming1_write(sc, &ht1); + + /* + * Vertical timing odd/even. + */ + if (vmargin & 1) { + vto.vto_preb = (P + interlacebias + prb) << shift; + vto.vto_postb = (Q - interlacebias + psb) << shift; + vte.vte_preb = (P + prb) << shift; + vte.vte_postb = (Q - psb) << shift; + } else { + /* XXX if this isn't 0, it doesn't work? */ + prb = 0; + psb = 0; + vte.vte_preb = (P + interlacebias + prb) << shift; + vte.vte_postb = (Q - interlacebias + psb) << shift; + vto.vto_preb = (P + prb) << shift; + vto.vto_postb = (Q - psb) << shift; + } + wiifb_vtimingodd_write(sc, &vto); + wiifb_vtimingeven_write(sc, &vte); + + /* + * Burst blanking odd/even interval. + */ + bbo.bbo_bs1 = 2 * (18 - 7 + 1); + bbe.bbe_bs2 = bbo.bbo_bs3 = bbe.bbe_bs4 = bbo.bbo_bs1; + bbo.bbo_be1 = 2 * (525 - 7 + 1); + bbe.bbe_be2 = bbo.bbo_be3 = bbe.bbe_be4 = bbo.bbo_be1; + wiifb_burstblankodd_write(sc, &bbo); + wiifb_burstblankeven_write(sc, &bbe); + + /* + * Picture configuration. + */ + pc.pc_strides = (mode->fd_width * 2) / 32; + if (mode->fd_flags & WIIFB_MODE_FLAG_INTERLACED) + pc.pc_strides *= 2; + pc.pc_reads = (mode->fd_width * 2) / 32; + wiifb_picconf_write(sc, &pc); + + /* + * Horizontal scaling disabled. + */ + hs.hs_enable = 0; + hs.hs_step = 256; + wiifb_hscaling_write(sc, &hs); + + /* + * Filter coeficient table. + */ + for (i = 0; i < 7; i++) + wiifb_filtcoeft_write(sc, i, wiifb_filter_coeft[i]); + + /* + * Anti alias. + */ + wiifb_antialias_write(sc, 0x00ff0000); + + /* + * Video clock. + */ + wiifb_videoclk_write(sc, + mode->fd_flags & WIIFB_MODE_FLAG_INTERLACED ? 0 : 1); + + /* + * Disable horizontal scaling width. + */ + wiifb_hscalingw_write(sc, mode->fd_width); + + /* + * DEBUG mode borders. Not used. + */ + wiifb_hborderend_write(sc, 0); + wiifb_hborderstart_write(sc, 0); + + /* + * XXX unknown registers. + */ + wiifb_unknown1_write(sc, 0x00ff); + wiifb_unknown2_write(sc, 0x00ff00ff); + wiifb_unknown3_write(sc, 0x00ff00ff); +} + +static void +wiifb_setup_framebuffer(struct wiifb_softc *sc) +{ + intptr_t addr = sc->sc_fb_addr; + struct wiifb_topfieldbasel tfbl; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 06:33: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 B8D801065694; Tue, 21 Aug 2012 06:33:10 +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 A40768FC1E; Tue, 21 Aug 2012 06:33:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7L6XAu4078964; Tue, 21 Aug 2012 06:33:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L6XAcu078961; Tue, 21 Aug 2012 06:33:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208210633.q7L6XAcu078961@svn.freebsd.org> From: Adrian Chadd Date: Tue, 21 Aug 2012 06:33: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: r239479 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 06:33:10 -0000 Author: adrian Date: Tue Aug 21 06:33:10 2012 New Revision: 239479 URL: http://svn.freebsd.org/changeset/base/239479 Log: Don't probe the openfirmware framebuffer if the system is a Wii or it will crash. Submitted by: Margarida Gouveia Modified: head/sys/powerpc/ofw/ofw_syscons.c Modified: head/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- head/sys/powerpc/ofw/ofw_syscons.c Tue Aug 21 06:31:26 2012 (r239478) +++ head/sys/powerpc/ofw/ofw_syscons.c Tue Aug 21 06:33:10 2012 (r239479) @@ -940,6 +940,12 @@ ofwfb_scidentify(driver_t *driver, devic device_t child; /* + * The Nintendo Wii doesn't have open firmware, so don't probe ofwfb + * because otherwise we will crash. + */ + if (strcmp(installed_platform(), "wii") == 0) + return; + /* * Add with a priority guaranteed to make it last on * the device list */ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 06:34: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 D54EE106564A; Tue, 21 Aug 2012 06:34:21 +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 BFF078FC15; Tue, 21 Aug 2012 06:34: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 q7L6YLoL079171; Tue, 21 Aug 2012 06:34:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L6YL5C079168; Tue, 21 Aug 2012 06:34:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208210634.q7L6YL5C079168@svn.freebsd.org> From: Adrian Chadd Date: Tue, 21 Aug 2012 06:34: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: r239480 - in head/sys/powerpc: aim 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, 21 Aug 2012 06:34:21 -0000 Author: adrian Date: Tue Aug 21 06:34:21 2012 New Revision: 239480 URL: http://svn.freebsd.org/changeset/base/239480 Log: On Nintendo Wii CPUs, the mdp value will be garbage. Set it to NULL so as to not confuse things. Submitted by: Margarida Gouveia Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Tue Aug 21 06:33:10 2012 (r239479) +++ head/sys/powerpc/aim/machdep.c Tue Aug 21 06:34:21 2012 (r239480) @@ -257,7 +257,7 @@ powerpc_init(vm_offset_t startkernel, vm size_t trap_offset; void *kmdp; char *env; - register_t msr, scratch; + register_t msr, scratch, vers; uint8_t *cache_check; int cacheline_warn; #ifndef __powerpc64__ @@ -269,6 +269,14 @@ powerpc_init(vm_offset_t startkernel, vm cacheline_warn = 0; /* + * The Wii loader doesn't pass us any environment so, mdp + * points to garbage at this point. The Wii CPU is a 750CL. + */ + vers = mfpvr(); + if ((vers & 0xfffff0e0) == (MPC750 << 16 | MPC750CL)) + mdp = NULL; + + /* * Parse metadata if present and fetch parameters. Must be done * before console is inited so cninit gets the right value of * boothowto. Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Tue Aug 21 06:33:10 2012 (r239479) +++ head/sys/powerpc/include/spr.h Tue Aug 21 06:34:21 2012 (r239480) @@ -140,6 +140,7 @@ #define MPC603e 0x0006 #define MPC603ev 0x0007 #define MPC750 0x0008 +#define MPC750CL 0x7000 /* Nintendo Wii's Broadway */ #define MPC604ev 0x0009 #define MPC7400 0x000c #define MPC620 0x0014 From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 06:58: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 98E57106564A; Tue, 21 Aug 2012 06:58:18 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id EA4ED8FC14; Tue, 21 Aug 2012 06:58:17 +0000 (UTC) Received: from ameno.mahoroba.org (IDENT:1XMCF5a3HN+N+MEXE5zlVDSdOQ4J9DioeyLxsozB2OOMfXsKN5bU2Feff37ywiHQ@ameno.mahoroba.org [IPv6:2001:2f0:104:8010:20a:79ff:fe69:ee6b]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.5/8.14.5) with ESMTP/inet6 id q7L6wC9V030446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 21 Aug 2012 15:58:13 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Tue, 21 Aug 2012 15:58:12 +0900 Message-ID: From: Hajimu UMEMOTO To: Andrey Chernov BIn-Reply-To: <20120821063027.GA41459@vniz.net> References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> <20120821063027.GA41459@vniz.net> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/24.1 (i386-portbld-freebsd9.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 9.1-PRERELEASE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Tue, 21 Aug 2012 15:58:13 +0900 (JST) X-Virus-Scanned: clamav-milter 0.97.5 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r239356 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 06:58:18 -0000 Hi, >>>>> On Tue, 21 Aug 2012 10:30:27 +0400 >>>>> Andrey Chernov said: ache> I am network admin, but what router advertise is out my easy control ache> (fixing configs in the Linux router's FS or even rebuilding router ache> components is needed, I don't want to touch this hardware). You may want to try -u option of rtsol(8) to determine which router advertises it. It saves link-local address of the advertising router in interface name. You can see it by `resolvconf -l'. ache> I want override because router runs dnsmasq with caching (on both its IPv4 ache> and IPv6 adresses), and NS it advertise goes through tunnel each time ache> without caching in the router. Okay, thanks. Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 07:14: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 87A8C106564A; Tue, 21 Aug 2012 07:14:22 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 006C98FC12; Tue, 21 Aug 2012 07:14:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q7L7EK1Y042243; Tue, 21 Aug 2012 11:14:20 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q7L7EK74042242; Tue, 21 Aug 2012 11:14:20 +0400 (MSK) (envelope-from ache) Date: Tue, 21 Aug 2012 11:14:20 +0400 From: Andrey Chernov To: Hajimu UMEMOTO Message-ID: <20120821071420.GA42109@vniz.net> Mail-Followup-To: Andrey Chernov , Hajimu UMEMOTO , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> <20120821063027.GA41459@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r239356 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 07:14:22 -0000 On Tue, Aug 21, 2012 at 03:58:12PM +0900, Hajimu UMEMOTO wrote: > ache> I am network admin, but what router advertise is out my easy control > ache> (fixing configs in the Linux router's FS or even rebuilding router > ache> components is needed, I don't want to touch this hardware). > > You may want to try -u option of rtsol(8) to determine which router > advertises it. It saves link-local address of the advertising router > in interface name. You can see it by `resolvconf -l'. I have only one router, so I know who does it :) But router runs Linix and what it advertise to client is not configurable via its web interface, so require Linux configs or/and demons patching I don't want to. > ache> I want override because router runs dnsmasq with caching (on both its IPv4 > ache> and IPv6 adresses), and NS it advertise goes through tunnel each time > ache> without caching in the router. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 08:40: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 25096106564A; Tue, 21 Aug 2012 08:40:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id CE0258FC0A; Tue, 21 Aug 2012 08:40:00 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:dd99:997b:50d0:d751] (unknown [IPv6:2001:7b8:3a7:0:dd99:997b:50d0:d751]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id BCB885C59; Tue, 21 Aug 2012 10:39:51 +0200 (CEST) Message-ID: <50334957.6020201@FreeBSD.org> Date: Tue, 21 Aug 2012 10:39:51 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120815 Thunderbird/15.0 MIME-Version: 1.0 To: Jan Beich References: <201208201833.q7KIX58p075876@svn.freebsd.org> <1T3c9K-000Jlb-7g@internal.tormail.org> In-Reply-To: <1T3c9K-000Jlb-7g@internal.tormail.org> Content-Type: multipart/mixed; boundary="------------010001080807070805040402" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jason Evans Subject: jemalloc and clang (was: Re: svn commit: r239462 - in head) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 08:40:01 -0000 This is a multi-part message in MIME format. --------------010001080807070805040402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2012-08-21 02:17, Jan Beich wrote: ... > Time to revert r228540? > > Index: contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h > =================================================================== > --- contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (revision 239467) > +++ contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (working copy) > @@ -56,10 +56,6 @@ > #ifndef JEMALLOC_TLS_MODEL > # define JEMALLOC_TLS_MODEL /* Default. */ > #endif > -#ifdef __clang__ > -# undef JEMALLOC_TLS_MODEL > -# define JEMALLOC_TLS_MODEL /* clang does not support tls_model yet. */ > -#endif > > #define STATIC_PAGE_SHIFT PAGE_SHIFT > #define LG_SIZEOF_INT 2 Well, if Jason would like to support upstream jemalloc for different versions of clang, it is probably better to to use __has_feature() instead. Jason, what do you think of the attached patch? Or could we just remove the whole #ifdef __clang__ part? --------------010001080807070805040402 Content-Type: text/x-diff; name="jemalloc-clang-tlsmodel-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="jemalloc-clang-tlsmodel-1.diff" Index: contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h =================================================================== --- contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (revision 239463) +++ contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (working copy) @@ -56,9 +56,9 @@ #ifndef JEMALLOC_TLS_MODEL # define JEMALLOC_TLS_MODEL /* Default. */ #endif -#ifdef __clang__ +#if defined(__clang__) && !__has_feature(tls_model) # undef JEMALLOC_TLS_MODEL -# define JEMALLOC_TLS_MODEL /* clang does not support tls_model yet. */ +# define JEMALLOC_TLS_MODEL /* This clang does not support tls_model. */ #endif #define STATIC_PAGE_SHIFT PAGE_SHIFT --------------010001080807070805040402-- From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 09:17: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 08124106564A; Tue, 21 Aug 2012 09:17:14 +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 E76AE8FC08; Tue, 21 Aug 2012 09:17: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 q7L9HDOF003533; Tue, 21 Aug 2012 09:17:13 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L9HDmM003531; Tue, 21 Aug 2012 09:17:13 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201208210917.q7L9HDmM003531@svn.freebsd.org> From: David Xu Date: Tue, 21 Aug 2012 09:17: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: r239485 - 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, 21 Aug 2012 09:17:14 -0000 Author: davidxu Date: Tue Aug 21 09:17:13 2012 New Revision: 239485 URL: http://svn.freebsd.org/changeset/base/239485 Log: Fix prototype. Also the function should return error code instead of -1 on error. Modified: head/lib/libc/gen/clock_getcpuclockid.c Modified: head/lib/libc/gen/clock_getcpuclockid.c ============================================================================== --- head/lib/libc/gen/clock_getcpuclockid.c Tue Aug 21 09:14:34 2012 (r239484) +++ head/lib/libc/gen/clock_getcpuclockid.c Tue Aug 21 09:17:13 2012 (r239485) @@ -32,8 +32,10 @@ __FBSDID("$FreeBSD$"); #include #include -clockid_t +int clock_getcpuclockid(pid_t pid, clockid_t *clock_id) { - return clock_getcpuclockid2(pid, CPUCLOCK_WHICH_PID, clock_id); + if (clock_getcpuclockid2(pid, CPUCLOCK_WHICH_PID, clock_id)) + return (errno); + return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 09:18: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 986FD1065670; Tue, 21 Aug 2012 09:18:29 +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 817DE8FC22; Tue, 21 Aug 2012 09:18: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 q7L9ITsj003841; Tue, 21 Aug 2012 09:18:29 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L9IT4K003836; Tue, 21 Aug 2012 09:18:29 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201208210918.q7L9IT4K003836@svn.freebsd.org> From: David Xu Date: Tue, 21 Aug 2012 09:18: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: r239486 - in head: lib/libc/gen share/man/man3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 09:18:29 -0000 Author: davidxu Date: Tue Aug 21 09:18:28 2012 New Revision: 239486 URL: http://svn.freebsd.org/changeset/base/239486 Log: Add manual pages for clock_getcpuclockid and pthread_getcpuclockid. Added: head/lib/libc/gen/clock_getcpuclockid.3 (contents, props changed) head/share/man/man3/pthread_getcpuclockid.3 (contents, props changed) Modified: head/lib/libc/gen/Makefile.inc head/share/man/man3/Makefile Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Tue Aug 21 09:17:13 2012 (r239485) +++ head/lib/libc/gen/Makefile.inc Tue Aug 21 09:18:28 2012 (r239486) @@ -52,7 +52,7 @@ SYM_MAPS+=${.CURDIR}/gen/Symbol.map .sinclude "${.CURDIR}/${LIBC_ARCH}/gen/Makefile.inc" MAN+= alarm.3 arc4random.3 \ - basename.3 check_utility_compat.3 clock.3 \ + basename.3 check_utility_compat.3 clock.3 clock_getcpuclockid.3 \ confstr.3 ctermid.3 daemon.3 devname.3 directory.3 dirname.3 \ dl_iterate_phdr.3 dladdr.3 dlinfo.3 dllockinit.3 dlopen.3 \ err.3 exec.3 \ Added: head/lib/libc/gen/clock_getcpuclockid.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/clock_getcpuclockid.3 Tue Aug 21 09:18:28 2012 (r239486) @@ -0,0 +1,95 @@ +.\" Copyright (c) 2012 David Xu +.\" 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. +.\" +.\" Portions of this text are reprinted and reproduced in electronic form +.\" from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- +.\" Portable Operating System Interface (POSIX), The Open Group Base +.\" Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of +.\" Electrical and Electronics Engineers, Inc and The Open Group. In the +.\" event of any discrepancy between this version and the original IEEE and +.\" The Open Group Standard, the original IEEE and The Open Group Standard is +.\" the referee document. The original Standard can be obtained online at +.\" http://www.opengroup.org/unix/online.html. +.\" +.\" $FreeBSD$ +.\" +.Dd August 21, 2012 +.Dt CLOCK_GETCPUCLOCKID 3 +.Os +.Sh NAME +.Nm clock_getcpuclockid +.Nd access a process CPU-time clock +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Ft int +.Fn clock_getcpuclockid "pid_t pid" "clockid_t *clock_id" +.Sh DESCRIPTION +The +.Fn clock_getcpuclockid +returns the clock ID of the CPU-time clock of the process specified by +.Fa pid . +If the process described by +.Fa pid +exists and the calling process has permission, the clock ID of this +clock will be returned in +.Fa clock_id . +.Pp +If +.Fa pid +is zero, the +.Fn clock_getcpuclockid +function returns the clock ID of the CPU-time clock of the process +making the call, in +.Fa clock_id . +.Sh RETURN VALUES +Upon successful completion, +.Fn clock_getcpuclockid +returns zero; otherwise, an error number is returned to indicate the +error. +.Sh ERRORS +The clock_getcpuclockid() function will fail if: +.Bl -tag -width Er +.It Bq Er EPERM +The requesting process does not have permission to access the CPU-time +clock for the process. +.It Bq Er ESRCH +No process can be found corresponding to the process specified by +.Fa pid . +.El +.Sh SEE ALSO +.Xr clock_gettime 2 +.Sh STANDARDS +The +.Fn clock_getcpuclockid +function conform to +.St -p1003.1-2001 . +.Sh HISTORY +The +.Fn clock_getcpuclockid +function first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An David Xu Aq davidxu@FreeBSD.org Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Tue Aug 21 09:17:13 2012 (r239485) +++ head/share/man/man3/Makefile Tue Aug 21 09:18:28 2012 (r239486) @@ -206,6 +206,7 @@ PTHREAD_MAN= pthread.3 \ pthread_equal.3 \ pthread_exit.3 \ pthread_getconcurrency.3 \ + pthread_getcpuclockid.3 \ pthread_getspecific.3 \ pthread_getthreadid_np.3 \ pthread_join.3 \ Added: head/share/man/man3/pthread_getcpuclockid.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/pthread_getcpuclockid.3 Tue Aug 21 09:18:28 2012 (r239486) @@ -0,0 +1,84 @@ +.\" Copyright (c) 2012 David Xu +.\" 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. +.\" +.\" Portions of this text are reprinted and reproduced in electronic form +.\" from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- +.\" Portable Operating System Interface (POSIX), The Open Group Base +.\" Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of +.\" Electrical and Electronics Engineers, Inc and The Open Group. In the +.\" event of any discrepancy between this version and the original IEEE and +.\" The Open Group Standard, the original IEEE and The Open Group Standard is +.\" the referee document. The original Standard can be obtained online at +.\" http://www.opengroup.org/unix/online.html. +.\" +.\" $FreeBSD$ +.\" +.Dd August 21, 2012 +.Dt PTHREAD_GETCPUCLOCKID 3 +.Os +.Sh NAME +.Nm pthread_getcpuclockid +.Nd access a thread CPU-time clock +.Sh LIBRARY +.Lb libpthread +.Sh SYNOPSIS +.In pthread.h +.In time.h +.Ft int +.Fn pthread_getcpuclockid "pthread_t thread_id" "clockid_t *clock_id" +.Sh DESCRIPTION +The +.Fn pthread_getcpuclockid +returns the clock ID of the CPU-time clock of the thread specified by +.Fa thread_id . +If the thread described by +.Fa thread_id +exists. +.Sh RETURN VALUES +Upon successful completion, +.Fn pthread_getcpuclockid +returns zero; otherwise, an error number is returned to indicate the +error. +.Sh ERRORS +The pthread_getcpuclockid() function will fail if: +.Bl -tag -width Er +.It Bq Er ESRCH +The value specified by +.Fa thread_id +does not refer to an existing thread. +.El +.Sh SEE ALSO +.Xr clock_gettime 2 +.Sh STANDARDS +The +.Fn pthread_getcpuclockid +function conforms to +.St -p1003.1-2004 . +.Sh HISTORY +The +.Fn pthread_getcpuclockid +function first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An David Xu Aq davidxu@FreeBSD.org From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 09:37: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 5E5EB1065670; Tue, 21 Aug 2012 09:37:24 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4B688FC0C; Tue, 21 Aug 2012 09:37: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 q7L9bNaq007185; Tue, 21 Aug 2012 09:37:23 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7L9bNOB007182; Tue, 21 Aug 2012 09:37:23 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201208210937.q7L9bNOB007182@svn.freebsd.org> From: "Jayachandran C." Date: Tue, 21 Aug 2012 09:37: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: r239487 - in head/sys: boot/fdt/dts mips/nlm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 09:37:24 -0000 Author: jchandra Date: Tue Aug 21 09:37:23 2012 New Revision: 239487 URL: http://svn.freebsd.org/changeset/base/239487 Log: Add correct range parameter in XLP DTS r239274 added support for ranges. Update XLP DTS to provide the correct range parameter for the XLP SoC bus. Also fix bus_space_map method for XLP bus space. Submitted by: Sreekanth M. Modified: head/sys/boot/fdt/dts/xlp-basic.dts head/sys/mips/nlm/bus_space_rmi.c Modified: head/sys/boot/fdt/dts/xlp-basic.dts ============================================================================== --- head/sys/boot/fdt/dts/xlp-basic.dts Tue Aug 21 09:18:28 2012 (r239486) +++ head/sys/boot/fdt/dts/xlp-basic.dts Tue Aug 21 09:37:23 2012 (r239487) @@ -44,7 +44,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "simple-bus"; - ranges = <0x0>; + ranges = <0x0 0x18000000 0x04000000>; bus-frequency = <0>; serial0: serial@30100 { Modified: head/sys/mips/nlm/bus_space_rmi.c ============================================================================== --- head/sys/mips/nlm/bus_space_rmi.c Tue Aug 21 09:18:28 2012 (r239486) +++ head/sys/mips/nlm/bus_space_rmi.c Tue Aug 21 09:37:23 2012 (r239487) @@ -366,7 +366,7 @@ rmi_bus_space_map(void *t __unused, bus_ bus_space_handle_t *bshp) { - *bshp = addr; + *bshp = MIPS_PHYS_TO_DIRECT_UNCACHED(addr); return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 12:39: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 4431C1065672; Tue, 21 Aug 2012 12:39:39 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EC998FC0A; Tue, 21 Aug 2012 12:39:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LCddeD035531; Tue, 21 Aug 2012 12:39:39 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LCdcJE035529; Tue, 21 Aug 2012 12:39:38 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208211239.q7LCdcJE035529@svn.freebsd.org> From: Andrey Zonov Date: Tue, 21 Aug 2012 12:39: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: r239497 - 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: Tue, 21 Aug 2012 12:39:39 -0000 Author: zont Date: Tue Aug 21 12:39:38 2012 New Revision: 239497 URL: http://svn.freebsd.org/changeset/base/239497 Log: - Add myself as a new src committer. Approved by: kib (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue Aug 21 12:37:37 2012 (r239496) +++ head/share/misc/committers-src.dot Tue Aug 21 12:39:38 2012 (r239497) @@ -272,6 +272,7 @@ yongari [label="Pyun YongHyeon\nyongari@ zack [label="Zack Kirsch\nzack@FreeBSD.org\n2010/11/05"] zec [label="Marko Zec\nzec@FreeBSD.org\n2008/06/22"] zml [label="Zachary Loafman\nzml@FreeBSD.org\n2009/05/27"] +zont [label="Andrey Zonov\nzont@FreeBSD.org\n2012/08/21"] # Pseudo target representing rev 1.1 of commit.allow day1 [label="Birth of FreeBSD"] @@ -480,6 +481,7 @@ kib -> rmh kib -> stas kib -> tijl kib -> trociny +kib -> zont kmacy -> lstewart From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 12:47:35 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 6C711106564A; Tue, 21 Aug 2012 12:47:35 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 575E88FC0C; Tue, 21 Aug 2012 12:47:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LClZCj036547; Tue, 21 Aug 2012 12:47:35 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LClZhS036545; Tue, 21 Aug 2012 12:47:35 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208211247.q7LClZhS036545@svn.freebsd.org> From: Andrey Zonov Date: Tue, 21 Aug 2012 12:47: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: r239498 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 12:47:35 -0000 Author: zont Date: Tue Aug 21 12:47:34 2012 New Revision: 239498 URL: http://svn.freebsd.org/changeset/base/239498 Log: - Add myself to the calendar. Approved by: kib (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 21 12:39:38 2012 (r239497) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 21 12:47:34 2012 (r239498) @@ -230,6 +230,7 @@ 07/22 Jens Schweikhardt born in Waiblingen, Baden-Wuerttemberg, Germany, 1967 07/22 Lukas Ertl born in Weissenbach/Enns, Steiermark, Austria, 1976 07/23 Sergey A. Osokin born in Krasnogorsky, Stepnogorsk, Akmolinskaya region, Kazakhstan, 1972 +07/23 Andrey Zonov born in Kirov, Russian Federation, 1985 07/24 Alexander Nedotsukov born in Ulyanovsk, Russian Federation, 1974 07/24 Alberto Villa born in Vercelli, Italy, 1987 07/27 Andriy Gapon born in Kyrykivka, Sumy region, Ukraine, 1976 From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 13:33: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 EEC94106566B; Tue, 21 Aug 2012 13:33:48 +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 C13DB8FC08; Tue, 21 Aug 2012 13:33: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 q7LDXmsC043054; Tue, 21 Aug 2012 13:33:48 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LDXmCb043052; Tue, 21 Aug 2012 13:33:48 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201208211333.q7LDXmCb043052@svn.freebsd.org> From: Joel Dahl Date: Tue, 21 Aug 2012 13:33: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: r239499 - 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, 21 Aug 2012 13:33:49 -0000 Author: joel (doc committer) Date: Tue Aug 21 13:33:48 2012 New Revision: 239499 URL: http://svn.freebsd.org/changeset/base/239499 Log: Remove trailing whitespace. Modified: head/lib/libc/gen/clock_getcpuclockid.3 Modified: head/lib/libc/gen/clock_getcpuclockid.3 ============================================================================== --- head/lib/libc/gen/clock_getcpuclockid.3 Tue Aug 21 12:47:34 2012 (r239498) +++ head/lib/libc/gen/clock_getcpuclockid.3 Tue Aug 21 13:33:48 2012 (r239499) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2012 +.Dd August 21, 2012 .Dt CLOCK_GETCPUCLOCKID 3 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 13:46: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 404B81065781; Tue, 21 Aug 2012 13:46:47 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B01F8FC12; Tue, 21 Aug 2012 13:46: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 q7LDkld2044715; Tue, 21 Aug 2012 13:46:47 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LDkkBV044713; Tue, 21 Aug 2012 13:46:46 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201208211346.q7LDkkBV044713@svn.freebsd.org> From: Devin Teske Date: Tue, 21 Aug 2012 13:46: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: r239500 - head/usr.sbin/bsdinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 13:46:47 -0000 Author: dteske Date: Tue Aug 21 13:46:46 2012 New Revision: 239500 URL: http://svn.freebsd.org/changeset/base/239500 Log: Fix "unexpected operator" error when passed multi-word first-argument containing whitespace. Also make other changes to support multi-word arguments. PR: bin/170759 Submitted by: dteske Reviewed by: emaste (mentor) Approved by: emaste (mentor) MFC after: 3 days Modified: head/usr.sbin/bsdinstall/bsdinstall Modified: head/usr.sbin/bsdinstall/bsdinstall ============================================================================== --- head/usr.sbin/bsdinstall/bsdinstall Tue Aug 21 13:33:48 2012 (r239499) +++ head/usr.sbin/bsdinstall/bsdinstall Tue Aug 21 13:46:46 2012 (r239500) @@ -34,11 +34,10 @@ VERB=$1; shift -if [ -z $VERB ]; then +if [ -z "$VERB" ]; then VERB=auto fi test -d "$BSDINSTALL_TMPETC" || mkdir "$BSDINSTALL_TMPETC" -echo Running installation step: $VERB $@ >> "$BSDINSTALL_LOG" -exec /usr/libexec/bsdinstall/$VERB $@ 2>>"$BSDINSTALL_LOG" - +echo "Running installation step: $VERB $@" >> "$BSDINSTALL_LOG" +exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>>"$BSDINSTALL_LOG" From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 14:58: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 AA8C5106564A; Tue, 21 Aug 2012 14:58:52 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C5CE8FC08; Tue, 21 Aug 2012 14: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 q7LEwqHH054154; Tue, 21 Aug 2012 14:58:52 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LEwqOU054149; Tue, 21 Aug 2012 14:58:52 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208211458.q7LEwqOU054149@svn.freebsd.org> From: Andrey Zonov Date: Tue, 21 Aug 2012 14: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: r239501 - head/usr.bin/truss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 14:58:52 -0000 Author: zont Date: Tue Aug 21 14:58:51 2012 New Revision: 239501 URL: http://svn.freebsd.org/changeset/base/239501 Log: - Use pid_t type instead of just int. Approved by: kib (mentor) Modified: head/usr.bin/truss/extern.h head/usr.bin/truss/setup.c head/usr.bin/truss/syscalls.c head/usr.bin/truss/truss.h Modified: head/usr.bin/truss/extern.h ============================================================================== --- head/usr.bin/truss/extern.h Tue Aug 21 13:46:46 2012 (r239500) +++ head/usr.bin/truss/extern.h Tue Aug 21 14:58:51 2012 (r239501) @@ -32,7 +32,7 @@ */ extern int setup_and_wait(char **); -extern int start_tracing(int); +extern int start_tracing(pid_t); extern void restore_proc(int); extern void waitevent(struct trussinfo *); extern const char *ioctlname(unsigned long val); Modified: head/usr.bin/truss/setup.c ============================================================================== --- head/usr.bin/truss/setup.c Tue Aug 21 13:46:46 2012 (r239500) +++ head/usr.bin/truss/setup.c Tue Aug 21 14:58:51 2012 (r239501) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); #include "truss.h" #include "extern.h" -static int child_pid; +static pid_t child_pid; /* * setup_and_wait() is called to start a process. All it really does @@ -69,7 +69,7 @@ static int child_pid; int setup_and_wait(char *command[]) { - int pid; + pid_t pid; int waitval; pid = vfork(); @@ -100,7 +100,7 @@ setup_and_wait(char *command[]) */ int -start_tracing(int pid) +start_tracing(pid_t pid) { int waitval; int ret; Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Aug 21 13:46:46 2012 (r239500) +++ head/usr.bin/truss/syscalls.c Tue Aug 21 14:58:51 2012 (r239501) @@ -464,7 +464,7 @@ get_syscall(const char *name) */ static int -get_struct(int pid, void *offset, void *buf, int len) +get_struct(pid_t pid, void *offset, void *buf, int len) { struct ptrace_io_desc iorequest; @@ -539,7 +539,7 @@ char * print_arg(struct syscall_args *sc, unsigned long *args, long retval, struct trussinfo *trussinfo) { char *tmp = NULL; - int pid = trussinfo->pid; + pid_t pid = trussinfo->pid; switch (sc->type & ARG_MASK) { case Hex: Modified: head/usr.bin/truss/truss.h ============================================================================== --- head/usr.bin/truss/truss.h Tue Aug 21 13:46:46 2012 (r239500) +++ head/usr.bin/truss/truss.h Tue Aug 21 14:58:51 2012 (r239501) @@ -45,7 +45,7 @@ struct threadinfo struct trussinfo { - int pid; + pid_t pid; int flags; int pr_why; int pr_data; From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 16:18: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 3C5161065755; Tue, 21 Aug 2012 16:18:12 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D4508FC17; Tue, 21 Aug 2012 16:18: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 q7LGIBSY065017; Tue, 21 Aug 2012 16:18:11 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LGIB2l065012; Tue, 21 Aug 2012 16:18:11 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201208211618.q7LGIB2l065012@svn.freebsd.org> From: Matt Jacob Date: Tue, 21 Aug 2012 16:18: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: r239502 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 16:18:12 -0000 Author: mjacob Date: Tue Aug 21 16:18:11 2012 New Revision: 239502 URL: http://svn.freebsd.org/changeset/base/239502 Log: Remove dependence on MAXPHYS. MFC after: 1 month Modified: head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/isp_pci.c head/sys/dev/isp/isp_sbus.c Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Tue Aug 21 14:58:51 2012 (r239501) +++ head/sys/dev/isp/isp_freebsd.h Tue Aug 21 16:18:11 2012 (r239502) @@ -726,9 +726,6 @@ int isp_fcp_next_crn(ispsoftc_t *, uint8 #define isp_sim_alloc(a, b, c, d, e, f, g, h) \ cam_sim_alloc(a, b, c, d, e, &(d)->isp_osinfo.lock, f, g, h) -/* Should be BUS_SPACE_MAXSIZE, but MAXPHYS is larger than BUS_SPACE_MAXSIZE */ -#define ISP_NSEGS ((MAXPHYS / PAGE_SIZE) + 1) - #define ISP_PATH_PRT(i, l, p, ...) \ if ((l) == ISP_LOGALL || ((l)& (i)->isp_dblev) != 0) { \ xpt_print(p, __VA_ARGS__); \ Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Tue Aug 21 14:58:51 2012 (r239501) +++ head/sys/dev/isp/isp_pci.c Tue Aug 21 16:18:11 2012 (r239502) @@ -1525,7 +1525,7 @@ static int isp_pci_mbxdma(ispsoftc_t *isp) { caddr_t base; - uint32_t len; + uint32_t len, nsegs; int i, error, ns, cmap = 0; bus_size_t slim; /* segment size */ bus_addr_t llim; /* low limit of unavailable dma */ @@ -1567,6 +1567,11 @@ isp_pci_mbxdma(ispsoftc_t *isp) return (1); } + if (isp->isp_osinfo.sixtyfourbit) { + nsegs = ISP_NSEG64_MAX; + } else { + nsegs = ISP_NSEG_MAX; + } #ifdef ISP_TARGET_MODE /* * XXX: We don't really support 64 bit target mode for parallel scsi yet @@ -1579,7 +1584,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) } #endif - if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_PCD(isp)), 1, slim, llim, hlim, NULL, NULL, BUS_SPACE_MAXSIZE, ISP_NSEGS, slim, 0, &isp->isp_osinfo.dmat)) { + if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_PCD(isp)), 1, slim, llim, hlim, NULL, NULL, BUS_SPACE_MAXSIZE, nsegs, slim, 0, &isp->isp_osinfo.dmat)) { free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); ISP_LOCK(isp); isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); Modified: head/sys/dev/isp/isp_sbus.c ============================================================================== --- head/sys/dev/isp/isp_sbus.c Tue Aug 21 14:58:51 2012 (r239501) +++ head/sys/dev/isp/isp_sbus.c Tue Aug 21 16:18:11 2012 (r239502) @@ -497,7 +497,7 @@ isp_sbus_mbxdma(ispsoftc_t *isp) if (isp_dma_tag_create(BUS_DMA_ROOTARG(ISP_SBD(isp)), 1, BUS_SPACE_MAXADDR_24BIT+1, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR_32BIT, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, - ISP_NSEGS, BUS_SPACE_MAXADDR_24BIT, 0, &isp->isp_osinfo.dmat)) { + ISP_NSEG_MAX, BUS_SPACE_MAXADDR_24BIT, 0, &isp->isp_osinfo.dmat)) { isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); free(isp->isp_xflist, M_DEVBUF); From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 16:35: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 9C8A31065800; Tue, 21 Aug 2012 16:35:15 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8702B8FC15; Tue, 21 Aug 2012 16:35: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 q7LGZFgS067295; Tue, 21 Aug 2012 16:35:15 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LGZFvh067293; Tue, 21 Aug 2012 16:35:15 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201208211635.q7LGZFvh067293@svn.freebsd.org> From: Niclas Zeising Date: Tue, 21 Aug 2012 16:35: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: r239503 - 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: Tue, 21 Aug 2012 16:35:15 -0000 Author: zeising (ports committer) Date: Tue Aug 21 16:35:14 2012 New Revision: 239503 URL: http://svn.freebsd.org/changeset/base/239503 Log: Add missing .Pp macro. PR: docs/170380 Submitted by: Garrett Cooper Approved by: joel (mentor) Modified: head/lib/libc/sys/dup.2 Modified: head/lib/libc/sys/dup.2 ============================================================================== --- head/lib/libc/sys/dup.2 Tue Aug 21 16:18:11 2012 (r239502) +++ head/lib/libc/sys/dup.2 Tue Aug 21 16:35:14 2012 (r239503) @@ -138,6 +138,7 @@ is not a valid active descriptor .It Bq Er EMFILE Too many descriptors are active. .El +.Pp The .Fn dup2 system call fails if: From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 16:44: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 55E61106566C; Tue, 21 Aug 2012 16:44: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 40BB28FC21; Tue, 21 Aug 2012 16:44:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LGiQtS068568; Tue, 21 Aug 2012 16:44:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LGiQBa068565; Tue, 21 Aug 2012 16:44:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208211644.q7LGiQBa068565@svn.freebsd.org> From: Adrian Chadd Date: Tue, 21 Aug 2012 16:44: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: r239504 - 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, 21 Aug 2012 16:44:26 -0000 Author: adrian Date: Tue Aug 21 16:44:25 2012 New Revision: 239504 URL: http://svn.freebsd.org/changeset/base/239504 Log: Initialise an uninitialised variable. GCC on -9 didn't pick this up; clang did. Submitted by: David Wolfskill Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Tue Aug 21 16:35:14 2012 (r239503) +++ head/sys/dev/ath/if_ath_tx_edma.c Tue Aug 21 16:44:25 2012 (r239504) @@ -427,7 +427,7 @@ ath_edma_tx_proc(void *arg, int npending struct ath_txq *txq; struct ath_buf *bf; struct ieee80211_node *ni; - int nacked; + int nacked = 0; DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called, npending=%d\n", __func__, npending); From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 17:05: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 E5010106566B; Tue, 21 Aug 2012 17:05:10 +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 CFE218FC0A; Tue, 21 Aug 2012 17:05: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 q7LH5AIk071340; Tue, 21 Aug 2012 17:05:10 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LH5A3L071338; Tue, 21 Aug 2012 17:05:10 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208211705.q7LH5A3L071338@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 21 Aug 2012 17:05: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: r239505 - 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, 21 Aug 2012 17:05:11 -0000 Author: obrien Date: Tue Aug 21 17:05:10 2012 New Revision: 239505 URL: http://svn.freebsd.org/changeset/base/239505 Log: Restore the style of r195843 to that of pre-r194498 to reduce gratuitous diffs to older sources. Modified: head/sys/sys/user.h Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Tue Aug 21 16:44:25 2012 (r239504) +++ head/sys/sys/user.h Tue Aug 21 17:05:10 2012 (r239505) @@ -98,7 +98,7 @@ #define TDNAMLEN 16 /* size of returned thread name */ #define COMMLEN 19 /* size of returned ki_comm name */ #define KI_EMULNAMELEN 16 /* size of returned ki_emul */ -#define KI_NGROUPS 16 /* number of groups in ki_groups */ +#define KI_NGROUPS 16 /* number of groups in ki_groups */ #define LOGNAMELEN 17 /* size of returned ki_login */ #define LOGINCLASSLEN 17 /* size of returned ki_loginclass */ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 17:06: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 DC6EC106566B; Tue, 21 Aug 2012 17:06:36 +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 C779D8FC14; Tue, 21 Aug 2012 17:06: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 q7LH6amZ071593; Tue, 21 Aug 2012 17:06:36 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LH6avA071590; Tue, 21 Aug 2012 17:06:36 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208211706.q7LH6avA071590@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 21 Aug 2012 17:06: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: r239506 - 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, 21 Aug 2012 17:06:37 -0000 Author: obrien Date: Tue Aug 21 17:06:36 2012 New Revision: 239506 URL: http://svn.freebsd.org/changeset/base/239506 Log: Missing one in r239505. Modified: head/sys/sys/user.h Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Tue Aug 21 17:05:10 2012 (r239505) +++ head/sys/sys/user.h Tue Aug 21 17:06:36 2012 (r239506) @@ -146,7 +146,7 @@ struct kinfo_proc { gid_t ki_svgid; /* Saved effective group id */ short ki_ngroups; /* number of groups */ short ki_spare_short2; /* unused (just here for alignment) */ - gid_t ki_groups[KI_NGROUPS]; /* groups */ + gid_t ki_groups[KI_NGROUPS]; /* groups */ vm_size_t ki_size; /* virtual size */ segsz_t ki_rssize; /* current resident set size in pages */ segsz_t ki_swrss; /* resident set size before last swap */ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 17: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 1E76710656AA; Tue, 21 Aug 2012 17:31:11 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0747B8FC1C; Tue, 21 Aug 2012 17: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 q7LHVAIF075119; Tue, 21 Aug 2012 17:31:10 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LHVABd075115; Tue, 21 Aug 2012 17:31:10 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201208211731.q7LHVABd075115@svn.freebsd.org> From: Hiroki Sato Date: Tue, 21 Aug 2012 17:31: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: r239507 - in head/sys: conf dev/iicbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 17:31:11 -0000 Author: hrs Date: Tue Aug 21 17:31:10 2012 New Revision: 239507 URL: http://svn.freebsd.org/changeset/base/239507 Log: Add s35390a_rtc(4) driver for Seiko Instruments S-35390A RTC. Submitted by: Yusuke Tanaka Added: head/sys/dev/iicbus/s35390a.c (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/files Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Aug 21 17:06:36 2012 (r239506) +++ head/sys/conf/NOTES Tue Aug 21 17:31:10 2012 (r239507) @@ -2555,10 +2555,12 @@ device iicoc # OpenCores I2C controlle # ds133x Dallas Semiconductor DS1337, DS1338 and DS1339 RTC # ds1374 Dallas Semiconductor DS1374 RTC # ds1672 Dallas Semiconductor DS1672 RTC +# s35390a Seiko Instruments S-35390A RTC # device ds133x device ds1374 device ds1672 +device s35390a # Parallel-Port Bus # Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Aug 21 17:06:36 2012 (r239506) +++ head/sys/conf/files Tue Aug 21 17:31:10 2012 (r239507) @@ -1315,6 +1315,7 @@ dev/iicbus/iicsmb.c optional iicsmb dependency "iicbus_if.h" dev/iicbus/iicoc.c optional iicoc dev/iicbus/pcf8563.c optional pcf8563 +dev/iicbus/s35390a.c optional s35390a dev/iir/iir.c optional iir dev/iir/iir_ctrl.c optional iir dev/iir/iir_pci.c optional iir pci Added: head/sys/dev/iicbus/s35390a.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/s35390a.c Tue Aug 21 17:31:10 2012 (r239507) @@ -0,0 +1,333 @@ +/*- + * Copyright (c) 2012 Yusuke Tanaka + * 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 ``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 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. + */ + +/*- + * Copyright (c) 2011 Frank Wille. + * All rights reserved. + * + * Written by Frank Wille for The NetBSD Project. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for Seiko Instruments S-35390A Real-time Clock + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "clock_if.h" +#include "iicbus_if.h" + +#define S390_DEVNAME "s35390a_rtc" +#define S390_DEVCODE 0x6 /* 0110 */ +/* + * S-35390A uses 4-bit device code + 3-bit command in the slave address + * field. The possible combination is 0x60-0x6f including the R/W bit. + * 0x60 means an write access to status register 1. + */ +#define S390_ADDR (S390_DEVCODE << 4) + +/* Registers are encoded into the slave address */ +#define S390_STATUS1 (0 << 1) +#define S390_STATUS2 (1 << 1) +#define S390_REALTIME1 (2 << 1) +#define S390_REALTIME2 (3 << 1) +#define S390_INT1_1 (4 << 1) +#define S390_INT1_2 (5 << 1) +#define S390_CLOCKADJ (6 << 1) +#define S390_FREE (7 << 1) + +/* Status1 bits */ +#define S390_ST1_POC (1 << 7) +#define S390_ST1_BLD (1 << 6) +#define S390_ST1_24H (1 << 1) +#define S390_ST1_RESET (1 << 0) + +/* Status2 bits */ +#define S390_ST2_TEST (1 << 7) + +/* Realtime1 data bytes */ +#define S390_RT1_NBYTES 7 +#define S390_RT1_YEAR 0 +#define S390_RT1_MONTH 1 +#define S390_RT1_DAY 2 +#define S390_RT1_WDAY 3 +#define S390_RT1_HOUR 4 +#define S390_RT1_MINUTE 5 +#define S390_RT1_SECOND 6 + +struct s390rtc_softc { + device_t sc_dev; + uint16_t sc_addr; +}; + +/* + * S-35390A interprets bits in each byte on SDA in reverse order. + * bitreverse() reverses the bits in uint8_t. + */ +static const uint8_t nibbletab[] = { + /* 0x0 0000 -> 0000 */ 0x0, + /* 0x1 0001 -> 1000 */ 0x8, + /* 0x2 0010 -> 0100 */ 0x4, + /* 0x3 0011 -> 1100 */ 0xc, + /* 0x4 0100 -> 0010 */ 0x2, + /* 0x5 0101 -> 1010 */ 0xa, + /* 0x6 0110 -> 0110 */ 0x6, + /* 0x7 0111 -> 1110 */ 0xe, + /* 0x8 1000 -> 0001 */ 0x1, + /* 0x9 1001 -> 1001 */ 0x9, + /* 0xa 1010 -> 0101 */ 0x5, + /* 0xb 1011 -> 1101 */ 0xd, + /* 0xc 1100 -> 0011 */ 0x3, + /* 0xd 1101 -> 1011 */ 0xb, + /* 0xe 1110 -> 0111 */ 0x7, + /* 0xf 1111 -> 1111 */ 0xf, }; + +static uint8_t +bitreverse(uint8_t x) +{ + + return (nibbletab[x & 0xf] << 4) | nibbletab[x >> 4]; +} + +static int +s390rtc_read(device_t dev, uint8_t reg, uint8_t *buf, size_t len) +{ + struct s390rtc_softc *sc = device_get_softc(dev); + struct iic_msg msg[] = { + { + .slave = sc->sc_addr | reg, + .flags = IIC_M_RD, + .len = len, + .buf = buf, + }, + }; + int i; + int error; + + error = iicbus_transfer(dev, msg, 1); + if (error) + return (error); + + /* this chip returns each byte in reverse order */ + for (i = 0; i < len; ++i) + buf[i] = bitreverse(buf[i]); + + return (0); +} + +static int +s390rtc_write(device_t dev, uint8_t reg, uint8_t *buf, size_t len) +{ + struct s390rtc_softc *sc = device_get_softc(dev); + struct iic_msg msg[] = { + { + .slave = sc->sc_addr | reg, + .flags = IIC_M_WR, + .len = len, + .buf = buf, + }, + }; + int i; + + /* this chip expects each byte in reverse order */ + for (i = 0; i < len; ++i) + buf[i] = bitreverse(buf[i]); + + return (iicbus_transfer(dev, msg, 1)); +} + +static int +s390rtc_probe(device_t dev) +{ + + if (iicbus_get_addr(dev) != S390_ADDR) { + if (bootverbose) + device_printf(dev, "slave address mismatch. " + "(%02x != %02x)\n", iicbus_get_addr(dev), + S390_ADDR); + return (ENXIO); + } + device_set_desc(dev, "Seiko Instruments S-35390A Real-time Clock"); + + return (BUS_PROBE_SPECIFIC); +} + +static int +s390rtc_attach(device_t dev) +{ + struct s390rtc_softc *sc; + uint8_t reg; + int error; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + /* Reset the chip and turn on 24h mode, after power-off or battery. */ + error = s390rtc_read(dev, S390_STATUS1, ®, 1); + if (error) { + device_printf(dev, "%s: cannot read status1 register\n", + __func__); + return (error); + } + if (reg & (S390_ST1_POC | S390_ST1_BLD)) { + reg |= S390_ST1_24H | S390_ST1_RESET; + error = s390rtc_write(dev, S390_STATUS1, ®, 1); + if (error) { + device_printf(dev, "%s: cannot initialize\n", __func__); + return (error); + } + } + + /* Disable the test mode, when enabled. */ + error = s390rtc_read(dev, S390_STATUS2, ®, 1); + if (error) { + device_printf(dev, "%s: cannot read status2 register\n", + __func__); + return (error); + } + if (reg & S390_ST2_TEST) { + reg &= ~S390_ST2_TEST; + error = s390rtc_write(dev, S390_STATUS2, ®, 1); + if (error) { + device_printf(dev, + "%s: cannot disable the test mode\n", __func__); + return (error); + } + } + + clock_register(dev, 1000000); /* 1 second resolution */ + return (0); +} + +static int +s390rtc_gettime(device_t dev, struct timespec *ts) +{ + uint8_t bcd[S390_RT1_NBYTES]; + struct clocktime ct; + struct s390rtc_softc *sc; + int error; + + sc = device_get_softc(dev); + error = s390rtc_read(dev, S390_REALTIME1, bcd, S390_RT1_NBYTES); + if (error) { + device_printf(dev, "%s: cannot read realtime1 register\n", + __func__); + return (error); + } + + /* + * Convert the register values into something useable. + */ + ct.nsec = 0; + ct.sec = FROMBCD(bcd[S390_RT1_SECOND]); + ct.min = FROMBCD(bcd[S390_RT1_MINUTE]); + ct.hour = FROMBCD(bcd[S390_RT1_HOUR] & 0x3f); + ct.day = FROMBCD(bcd[S390_RT1_DAY]); + ct.dow = bcd[S390_RT1_WDAY] & 0x07; + ct.mon = FROMBCD(bcd[S390_RT1_MONTH]); + ct.year = FROMBCD(bcd[S390_RT1_YEAR]) + 2000; + + return (clock_ct_to_ts(&ct, ts)); +} + +static int +s390rtc_settime(device_t dev, struct timespec *ts) +{ + uint8_t bcd[S390_RT1_NBYTES]; + struct clocktime ct; + struct s390rtc_softc *sc; + + sc = device_get_softc(dev); + clock_ts_to_ct(ts, &ct); + + /* + * Convert our time representation into something the S-xx390 + * can understand. + */ + bcd[S390_RT1_SECOND] = TOBCD(ct.sec); + bcd[S390_RT1_MINUTE] = TOBCD(ct.min); + bcd[S390_RT1_HOUR] = TOBCD(ct.hour); + bcd[S390_RT1_DAY] = TOBCD(ct.day); + bcd[S390_RT1_WDAY] = ct.dow; + bcd[S390_RT1_MONTH] = TOBCD(ct.mon); + bcd[S390_RT1_YEAR] = TOBCD(ct.year % 100); + + return (s390rtc_write(dev, S390_REALTIME1, bcd, S390_RT1_NBYTES)); +} + +static device_method_t s390rtc_methods[] = { + DEVMETHOD(device_probe, s390rtc_probe), + DEVMETHOD(device_attach, s390rtc_attach), + + DEVMETHOD(clock_gettime, s390rtc_gettime), + DEVMETHOD(clock_settime, s390rtc_settime), + + DEVMETHOD_END +}; + +static driver_t s390rtc_driver = { + S390_DEVNAME, + s390rtc_methods, + sizeof(struct s390rtc_softc), +}; +static devclass_t s390rtc_devclass; + +DRIVER_MODULE(s35390a, iicbus, s390rtc_driver, s390rtc_devclass, NULL, NULL); +MODULE_VERSION(s35390a, 1); +MODULE_DEPEND(s35390a, iicbus, 1, 1, 1); From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 17:49: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 95EDD106566C; Tue, 21 Aug 2012 17:49:21 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 800538FC1B; Tue, 21 Aug 2012 17:49: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 q7LHnLfh077548; Tue, 21 Aug 2012 17:49:21 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LHnLDC077546; Tue, 21 Aug 2012 17:49:21 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201208211749.q7LHnLDC077546@svn.freebsd.org> From: Hiroki Sato Date: Tue, 21 Aug 2012 17:49: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: r239508 - head/sys/arm/mv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 17:49:21 -0000 Author: hrs Date: Tue Aug 21 17:49:20 2012 New Revision: 239508 URL: http://svn.freebsd.org/changeset/base/239508 Log: - Calculate the I2C baud rate to keep them <100 kHz under different TCLK frequencies. The maximum freqency is 100 kHz according to the datasheet. - Add child device probing support based on the device tree. It now tries to find i2c-address property in the tree and attach the device with given slave address to iicbus. Modified: head/sys/arm/mv/twsi.c Modified: head/sys/arm/mv/twsi.c ============================================================================== --- head/sys/arm/mv/twsi.c Tue Aug 21 17:31:10 2012 (r239507) +++ head/sys/arm/mv/twsi.c Tue Aug 21 17:49:20 2012 (r239508) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -57,12 +58,17 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include +#include + #include "iicbus_if.h" #define MV_TWSI_NAME "twsi" +#define IICBUS_DEVNAME "iicbus" #define TWSI_SLAVE_ADDR 0x00 #define TWSI_EXT_SLAVE_ADDR 0x10 @@ -86,10 +92,10 @@ __FBSDID("$FreeBSD$"); #define TWSI_STATUS_DATA_RD_NOACK 0x58 #define TWSI_BAUD_RATE 0x0c -#define TWSI_BAUD_RATE_94DOT3 0x53 /* N=3, M=10 */ -#define TWSI_BAUD_RATE_74DOT1 0x6b /* N=3, M=13 */ -#define TWSI_BAUD_RATE_51DOT8 0x4c /* N=4, M=9 */ -#define TWSI_BAUD_RATE_99DOT7 0x66 /* N=6, M=12 */ +#define TWSI_BAUD_RATE_PARAM(M,N) ((((M) << 3) | ((N) & 0x7)) & 0x7f) +#define TWSI_BAUD_RATE_RAW(C,M,N) ((C)/((10*(M+1))<<(N+1))) +#define TWSI_BAUD_RATE_SLOW 50000 /* 50kHz */ +#define TWSI_BAUD_RATE_FAST 100000 /* 100kHz */ #define TWSI_SOFT_RESET 0x1c @@ -109,6 +115,13 @@ struct mv_twsi_softc { device_t iicbus; }; +static struct mv_twsi_baud_rate { + uint32_t raw; + int param; + int m; + int n; +} baud_rate[IIC_FASTEST + 1]; + static int mv_twsi_probe(device_t); static int mv_twsi_attach(device_t); static int mv_twsi_detach(device_t); @@ -299,13 +312,49 @@ mv_twsi_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +#define ABSSUB(a,b) (((a) > (b)) ? (a) - (b) : (b) - (a)) +static void +mv_twsi_cal_baud_rate(const uint32_t target, struct mv_twsi_baud_rate *rate) +{ + uint32_t clk, cur, diff, diff0; + int m, n, m0, n0; + + /* Calculate baud rate. */ + m0 = n0 = 4; /* Default values on reset */ + diff0 = 0xffffffff; + clk = get_tclk(); + + for (n = 0; n < 8; n++) { + for (m = 0; m < 16; m++) { + cur = TWSI_BAUD_RATE_RAW(clk,m,n); + diff = ABSSUB(target, cur); + if (diff < diff0) { + m0 = m; + n0 = n; + diff0 = diff; + } + } + } + rate->raw = TWSI_BAUD_RATE_RAW(clk, m0, n0); + rate->param = TWSI_BAUD_RATE_PARAM(m0, n0); + rate->m = m0; + rate->n = n0; +} + static int mv_twsi_attach(device_t dev) { struct mv_twsi_softc *sc; + phandle_t child, iicbusnode; + device_t childdev; + struct iicbus_ivar *devi; + char dname[32]; /* 32 is taken from struct u_device */ + uint32_t paddr; + int len, error; sc = device_get_softc(dev); sc->dev = dev; + bzero(baud_rate, sizeof(baud_rate)); mtx_init(&sc->mutex, device_get_nameunit(dev), MV_TWSI_NAME, MTX_DEF); @@ -316,14 +365,76 @@ mv_twsi_attach(device_t dev) return (ENXIO); } - sc->iicbus = device_add_child(dev, "iicbus", -1); + mv_twsi_cal_baud_rate(TWSI_BAUD_RATE_SLOW, &baud_rate[IIC_SLOW]); + mv_twsi_cal_baud_rate(TWSI_BAUD_RATE_FAST, &baud_rate[IIC_FAST]); + if (bootverbose) + device_printf(dev, "calculated baud rates are:\n" + " %" PRIu32 " kHz (M=%d, N=%d) for slow,\n" + " %" PRIu32 " kHz (M=%d, N=%d) for fast.\n", + baud_rate[IIC_SLOW].raw / 1000, + baud_rate[IIC_SLOW].m, + baud_rate[IIC_SLOW].n, + baud_rate[IIC_FAST].raw / 1000, + baud_rate[IIC_FAST].m, + baud_rate[IIC_FAST].n); + + sc->iicbus = device_add_child(dev, IICBUS_DEVNAME, -1); if (sc->iicbus == NULL) { device_printf(dev, "could not add iicbus child\n"); mv_twsi_detach(dev); return (ENXIO); } - + /* Attach iicbus. */ bus_generic_attach(dev); + + iicbusnode = 0; + /* Find iicbus as the child devices in the device tree. */ + for (child = OF_child(ofw_bus_get_node(dev)); child != 0; + child = OF_peer(child)) { + len = OF_getproplen(child, "model"); + if (len <= 0 || len > sizeof(dname) - 1) + continue; + error = OF_getprop(child, "model", &dname, len); + dname[len + 1] = '\0'; + if (error == -1) + continue; + len = strlen(dname); + if (len == strlen(IICBUS_DEVNAME) && + strncasecmp(dname, IICBUS_DEVNAME, len) == 0) { + iicbusnode = child; + break; + } + } + if (iicbusnode == 0) + goto attach_end; + + /* Attach child devices onto iicbus. */ + for (child = OF_child(iicbusnode); child != 0; child = OF_peer(child)) { + /* Get slave address. */ + error = OF_getprop(child, "i2c-address", &paddr, sizeof(paddr)); + if (error == -1) + error = OF_getprop(child, "reg", &paddr, sizeof(paddr)); + if (error == -1) + continue; + + /* Get device driver name. */ + len = OF_getproplen(child, "model"); + if (len <= 0 || len > sizeof(dname) - 1) + continue; + OF_getprop(child, "model", &dname, len); + dname[len + 1] = '\0'; + + if (bootverbose) + device_printf(dev, "adding a device %s at %d.\n", + dname, fdt32_to_cpu(paddr)); + childdev = BUS_ADD_CHILD(sc->iicbus, 0, dname, -1); + devi = IICBUS_IVAR(childdev); + devi->addr = fdt32_to_cpu(paddr); + } + +attach_end: + bus_generic_attach(sc->iicbus); + return (0); } @@ -355,28 +466,26 @@ static int mv_twsi_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr) { struct mv_twsi_softc *sc; - uint32_t baud_rate; + uint32_t param; sc = device_get_softc(dev); switch (speed) { case IIC_SLOW: - baud_rate = TWSI_BAUD_RATE_51DOT8; - break; case IIC_FAST: - baud_rate = TWSI_BAUD_RATE_51DOT8; + param = baud_rate[speed].param; break; - case IIC_UNKNOWN: case IIC_FASTEST: + case IIC_UNKNOWN: default: - baud_rate = TWSI_BAUD_RATE_99DOT7; + param = baud_rate[IIC_FAST].param; break; } mtx_lock(&sc->mutex); TWSI_WRITE(sc, TWSI_SOFT_RESET, 0x0); DELAY(2000); - TWSI_WRITE(sc, TWSI_BAUD_RATE, baud_rate); + TWSI_WRITE(sc, TWSI_BAUD_RATE, param); TWSI_WRITE(sc, TWSI_CONTROL, TWSI_CONTROL_TWSIEN | TWSI_CONTROL_ACK); DELAY(1000); mtx_unlock(&sc->mutex); From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 17:58: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 2F6681065673; Tue, 21 Aug 2012 17:58:31 +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 1761B8FC18; Tue, 21 Aug 2012 17:58: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 q7LHwUX5078746; Tue, 21 Aug 2012 17:58:30 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LHwUvR078743; Tue, 21 Aug 2012 17:58:30 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211758.q7LHwUvR078743@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 17:58: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: r239509 - head/usr.bin/clang/clang X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 17:58:31 -0000 Author: dim Date: Tue Aug 21 17:58:30 2012 New Revision: 239509 URL: http://svn.freebsd.org/changeset/base/239509 Log: Support the WITH_SHARED_TOOLCHAIN setting that was introduced in r234782 for the clang executable. Build it statically by default, like the gcc executables, which should improve performance a little bit. MFC after: 1 week Modified: head/usr.bin/clang/clang/Makefile Modified: head/usr.bin/clang/clang/Makefile ============================================================================== --- head/usr.bin/clang/clang/Makefile Tue Aug 21 17:49:20 2012 (r239508) +++ head/usr.bin/clang/clang/Makefile Tue Aug 21 17:58:30 2012 (r239509) @@ -9,6 +9,10 @@ SRCS= cc1_main.cpp \ cc1as_main.cpp \ driver.cpp +.if ${MK_SHARED_TOOLCHAIN} == "no" +NO_SHARED?= yes +.endif + LINKS= ${BINDIR}/clang ${BINDIR}/clang++ \ ${BINDIR}/clang ${BINDIR}/clang-cpp MLINKS= clang.1 clang++.1 \ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 17:58:40 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 1E5B91065784; Tue, 21 Aug 2012 17:58:40 +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 E90B58FC0C; Tue, 21 Aug 2012 17:58: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 q7LHwdLD078801; Tue, 21 Aug 2012 17:58:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LHwdnY078798; Tue, 21 Aug 2012 17:58:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208211758.q7LHwdnY078798@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Aug 2012 17:58: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: r239510 - 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: Tue, 21 Aug 2012 17:58:40 -0000 Author: jhb Date: Tue Aug 21 17:58:39 2012 New Revision: 239510 URL: http://svn.freebsd.org/changeset/base/239510 Log: Document DRIVER_MODULE_ORDERED, EARLY_DRIVER_MODULE, and EARLY_DRIVER_MODULE_ORDERED. Modified: head/share/man/man9/DRIVER_MODULE.9 head/share/man/man9/Makefile Modified: head/share/man/man9/DRIVER_MODULE.9 ============================================================================== --- head/share/man/man9/DRIVER_MODULE.9 Tue Aug 21 17:58:30 2012 (r239509) +++ head/share/man/man9/DRIVER_MODULE.9 Tue Aug 21 17:58:39 2012 (r239510) @@ -28,11 +28,14 @@ .\" .\" $FreeBSD$ .\" -.Dd August 27, 2011 +.Dd August 21, 2012 .Dt DRIVER_MODULE 9 .Os .Sh NAME -.Nm DRIVER_MODULE +.Nm DRIVER_MODULE , +.Nm DRIVER_MODULE_ORDERED , +.Nm EARLY_DRIVER_MODULE , +.Nm EARLY_DRIVER_MODULE_ORDERED .Nd kernel driver declaration macro .Sh SYNOPSIS .In sys/param.h @@ -40,6 +43,9 @@ .In sys/bus.h .In sys/module.h .Fn DRIVER_MODULE name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" +.Fn DRIVER_MODULE_ORDERED name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "int order" +.Fn EARLY_DRIVER_MODULE name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "enum sysinit_elem_order order" "int pass" +.Fn EARLY_DRIVER_MODULE_ORDERED name busname "driver_t driver" "devclass_t devclass" "modeventhand_t evh" "void *arg" "enum sysinit_elem_order order" "int pass" .Sh DESCRIPTION The .Fn DRIVER_MODULE @@ -95,10 +101,50 @@ The is unused at this time and should be a .Dv NULL pointer. +.Pp +The +.Fn DRIVER_MODULE_ORDERED +macro allows a driver to be registered in a specific order. +This can be useful if a single kernel module contains multiple drivers +that are inter-dependent. +The +.Fa order +argument should be one of the +.Xr SYSINIT 9 +initialization ordering constants +.Pq Dv SI_ORDER_* . +The default order for a driver module is +.Dv SI_ORDER_MIDDLE . +Typically a module will specify an order of +.Dv SI_ORDER_ANY +for a single driver to ensure it is registered last. +.Pp +The +.Fn EARLY_DRIVER_MODULE +macro allows a driver to be registered for a specific pass level. +The boot time probe and attach process makes multiple passes over the +device tree. +Certain critical drivers that provide basic services needed by other +devices are attach during earlier passes. +Most drivers are attached in a final general pass. +A driver that attaches during an early pass must register for a specific +pass level +.Pq BUS_PASS_* +via the +.Fa pass +argument. +Once a driver is registered it is available to attach to devices for +all subsequent passes. +.Pp +The +.Fn EARLY_DRIVER_MODULE_ORDERED +macro allows a driver to be registered both in a specific order and +for a specific pass level. .Sh SEE ALSO .Xr device 9 , .Xr driver 9 , -.Xr module 9 +.Xr module 9 , +.Xr SYSINIT 9 .Sh AUTHORS This manual page was written by .An Alexander Langer Aq alex@FreeBSD.org . Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Aug 21 17:58:30 2012 (r239509) +++ head/share/man/man9/Makefile Tue Aug 21 17:58:39 2012 (r239510) @@ -628,6 +628,9 @@ MLINKS+=drbr.9 drbr_free.9 \ drbr.9 drbr_empty.9 \ drbr.9 drbr_inuse.9 \ drbr.9 drbr_stats_update.9 +MLINKS+=DRIVER_MODULE.9 DRIVER_MODULE_ORDERED.9 \ + DRIVER_MODULE.9 EARLY_DRIVER_MODULE.9 \ + DRIVER_MODULE.9 EARLY_DRIVER_MODULE_ORDERED.9 MLINKS+=EVENTHANDLER.9 EVENTHANDLER_DECLARE.9 \ EVENTHANDLER.9 EVENTHANDLER_DEREGISTER.9 \ EVENTHANDLER.9 eventhandler_deregister.9 \ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 18:09: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 D215E106566C; Tue, 21 Aug 2012 18:09:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B28918FC1C; Tue, 21 Aug 2012 18:09: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 q7LI9XAd080339; Tue, 21 Aug 2012 18:09:33 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LI9XTl080333; Tue, 21 Aug 2012 18:09:33 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201208211809.q7LI9XTl080333@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 21 Aug 2012 18:09: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: r239511 - in head/sys: dev/cxgb/ulp/tom dev/cxgbe/tom 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: Tue, 21 Aug 2012 18:09:33 -0000 Author: np Date: Tue Aug 21 18:09:33 2012 New Revision: 239511 URL: http://svn.freebsd.org/changeset/base/239511 Log: Correctly handle the case where an inp has already been dropped by the time the TOE driver reports that an active open failed. toe_connect_failed is supposed to handle this but it should be provided the inpcb instead of the tcpcb which may no longer be around. Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/netinet/toecore.c head/sys/netinet/toecore.h Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Tue Aug 21 17:58:39 2012 (r239510) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Tue Aug 21 18:09:33 2012 (r239511) @@ -880,10 +880,10 @@ act_open_rpl_status_to_errno(int status) case CPL_ERR_CONN_TIMEDOUT: return (ETIMEDOUT); case CPL_ERR_TCAM_FULL: - return (ENOMEM); + return (EAGAIN); case CPL_ERR_CONN_EXIST: log(LOG_ERR, "ACTIVE_OPEN_RPL: 4-tuple in use\n"); - return (EADDRINUSE); + return (EAGAIN); default: return (EIO); } @@ -912,8 +912,7 @@ do_act_open_rpl(struct sge_qset *qs, str unsigned int atid = G_TID(ntohl(rpl->atid)); struct toepcb *toep = lookup_atid(&td->tid_maps, atid); struct inpcb *inp = toep->tp_inp; - struct tcpcb *tp = intotcpcb(inp); - int s = rpl->status; + int s = rpl->status, rc; CTR3(KTR_CXGB, "%s: atid %u, status %u ", __func__, atid, s); @@ -923,17 +922,14 @@ do_act_open_rpl(struct sge_qset *qs, str if (act_open_has_tid(s)) queue_tid_release(tod, GET_TID(rpl)); - if (s == CPL_ERR_TCAM_FULL || s == CPL_ERR_CONN_EXIST) { - INP_WLOCK(inp); - toe_connect_failed(tod, tp, EAGAIN); - toepcb_release(toep); /* unlocks inp */ - } else { + rc = act_open_rpl_status_to_errno(s); + if (rc != EAGAIN) INP_INFO_WLOCK(&V_tcbinfo); - INP_WLOCK(inp); - toe_connect_failed(tod, tp, act_open_rpl_status_to_errno(s)); - toepcb_release(toep); /* unlocks inp */ + INP_WLOCK(inp); + toe_connect_failed(tod, inp, rc); + toepcb_release(toep); /* unlocks inp */ + if (rc != EAGAIN) INP_INFO_WUNLOCK(&V_tcbinfo); - } m_freem(m); return (0); Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Tue Aug 21 17:58:39 2012 (r239510) +++ head/sys/dev/cxgbe/tom/t4_connect.c Tue Aug 21 18:09:33 2012 (r239511) @@ -167,10 +167,10 @@ act_open_rpl_status_to_errno(int status) case CPL_ERR_CONN_TIMEDOUT: return (ETIMEDOUT); case CPL_ERR_TCAM_FULL: - return (ENOMEM); + return (EAGAIN); case CPL_ERR_CONN_EXIST: log(LOG_ERR, "ACTIVE_OPEN_RPL: 4-tuple in use\n"); - return (EADDRINUSE); + return (EAGAIN); default: return (EIO); } @@ -186,8 +186,8 @@ do_act_open_rpl(struct sge_iq *iq, const unsigned int status = G_AOPEN_STATUS(be32toh(cpl->atid_status)); struct toepcb *toep = lookup_atid(sc, atid); struct inpcb *inp = toep->inp; - struct tcpcb *tp = intotcpcb(inp); struct toedev *tod = &toep->td->tod; + int rc; KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == atid, ("%s: toep tid/atid mismatch", __func__)); @@ -204,17 +204,14 @@ do_act_open_rpl(struct sge_iq *iq, const if (status && act_open_has_tid(status)) release_tid(sc, GET_TID(cpl), toep->ctrlq); - if (status == CPL_ERR_TCAM_FULL) { - INP_WLOCK(inp); - toe_connect_failed(tod, tp, EAGAIN); - final_cpl_received(toep); /* unlocks inp */ - } else { + rc = act_open_rpl_status_to_errno(status); + if (rc != EAGAIN) INP_INFO_WLOCK(&V_tcbinfo); - INP_WLOCK(inp); - toe_connect_failed(tod, tp, act_open_rpl_status_to_errno(status)); - final_cpl_received(toep); /* unlocks inp */ + INP_WLOCK(inp); + toe_connect_failed(tod, inp, rc); + final_cpl_received(toep); /* unlocks inp */ + if (rc != EAGAIN) INP_INFO_WUNLOCK(&V_tcbinfo); - } return (0); } Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Tue Aug 21 17:58:39 2012 (r239510) +++ head/sys/netinet/toecore.c Tue Aug 21 18:09:33 2012 (r239511) @@ -478,15 +478,17 @@ toe_l2_resolve(struct toedev *tod, struc } void -toe_connect_failed(struct toedev *tod, struct tcpcb *tp, int err) +toe_connect_failed(struct toedev *tod, struct inpcb *inp, int err) { - struct inpcb *inp = tp->t_inpcb; INP_WLOCK_ASSERT(inp); - KASSERT(tp->t_flags & TF_TOE, - ("%s: tp %p not offloaded.", __func__, tp)); if (!(inp->inp_flags & INP_DROPPED)) { + struct tcpcb *tp = intotcpcb(inp); + + KASSERT(tp->t_flags & TF_TOE, + ("%s: tp %p not offloaded.", __func__, tp)); + if (err == EAGAIN) { /* Modified: head/sys/netinet/toecore.h ============================================================================== --- head/sys/netinet/toecore.h Tue Aug 21 17:58:39 2012 (r239510) +++ head/sys/netinet/toecore.h Tue Aug 21 18:09:33 2012 (r239511) @@ -119,7 +119,7 @@ int unregister_toedev(struct toedev *); int toe_l2_resolve(struct toedev *, struct ifnet *, struct sockaddr *, uint8_t *, uint16_t *); -void toe_connect_failed(struct toedev *, struct tcpcb *, int); +void toe_connect_failed(struct toedev *, struct inpcb *, int); void toe_syncache_add(struct in_conninfo *, struct tcpopt *, struct tcphdr *, struct inpcb *, void *, void *); From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 18:13: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 2E7AD1065670; Tue, 21 Aug 2012 18:13:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 183BC8FC0A; Tue, 21 Aug 2012 18:13: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 q7LID9cV080855; Tue, 21 Aug 2012 18:13:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LID9UC080851; Tue, 21 Aug 2012 18:13:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208211813.q7LID9UC080851@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Aug 2012 18:13: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: r239512 - in head: share/man/man9 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, 21 Aug 2012 18:13:10 -0000 Author: jhb Date: Tue Aug 21 18:13:09 2012 New Revision: 239512 URL: http://svn.freebsd.org/changeset/base/239512 Log: Add a BUS_CHILD_DELETED() method that a bus can hook to allow it to cleanup any bus-specific state (such as ivars) when a child device is deleted. Requested by: kan MFC after: 1 month Added: head/share/man/man9/BUS_CHILD_DELETED.9 (contents, props changed) Modified: head/share/man/man9/Makefile head/sys/kern/bus_if.m head/sys/kern/subr_bus.c Added: head/share/man/man9/BUS_CHILD_DELETED.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/BUS_CHILD_DELETED.9 Tue Aug 21 18:13:09 2012 (r239512) @@ -0,0 +1,55 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2012 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin +.\" 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 August 21, 2012 +.Dt BUS_CHILD_DELETED 9 +.Os +.Sh NAME +.Nm BUS_CHILD_DELETED +.Nd "notify a bus device that a child is being deleted" +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Ft void +.Fn BUS_CHILD_DELETED "device_t dev" "device_t child" +.Sh DESCRIPTION +The +.Fn BUS_CHILD_DELETED +method is invoked by the new-bus framework when a device is deleted. +A bus driver can provide an implementation of this method to +release bus-specific resources associated with a device such as +instance variables. +.Sh SEE ALSO +.Xr BUS_ADD_CHILD 9 , +.Xr device 9 +.Sh HISTORY +The +.Fn BUS_CHILD_DELETED +method first appeared in +.Fx 10.0 . Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Aug 21 18:09:33 2012 (r239511) +++ head/share/man/man9/Makefile Tue Aug 21 18:13:09 2012 (r239512) @@ -26,6 +26,7 @@ MAN= accept_filter.9 \ bus_alloc_resource.9 \ BUS_BIND_INTR.9 \ bus_child_present.9 \ + BUS_CHILD_DELETED.9 \ BUS_CONFIG_INTR.9 \ BUS_DESCRIBE_INTR.9 \ bus_dma.9 \ Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Tue Aug 21 18:09:33 2012 (r239511) +++ head/sys/kern/bus_if.m Tue Aug 21 18:13:09 2012 (r239512) @@ -160,6 +160,20 @@ METHOD int write_ivar { }; /** + * @brief Notify a bus that a child was deleted + * + * Called at the beginning of device_delete_child() to allow the parent + * to teardown any bus-specific state for the child. + * + * @param _dev the device whose child is being deleted + * @param _child the child device which is being deleted + */ +METHOD void child_deleted { + device_t _dev; + device_t _child; +}; + +/** * @brief Notify a bus that a child was detached * * Called after the child's DEVICE_DETACH() method to allow the parent Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Aug 21 18:09:33 2012 (r239511) +++ head/sys/kern/subr_bus.c Tue Aug 21 18:13:09 2012 (r239512) @@ -1873,6 +1873,8 @@ device_delete_child(device_t dev, device return (error); if (child->devclass) devclass_delete_device(child->devclass, child); + if (child->parent) + BUS_CHILD_DELETED(dev, child); TAILQ_REMOVE(&dev->children, child, link); TAILQ_REMOVE(&bus_data_devices, child, devlink); kobj_delete((kobj_t) child, M_BUS); From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 18:24: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 824B1106564A; Tue, 21 Aug 2012 18:24:12 +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 6D16E8FC12; Tue, 21 Aug 2012 18:24: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 q7LIOCjo082443; Tue, 21 Aug 2012 18:24:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LIOClR082441; Tue, 21 Aug 2012 18:24:12 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208211824.q7LIOClR082441@svn.freebsd.org> From: Dimitry Andric Date: Tue, 21 Aug 2012 18:24: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: r239513 - head/usr.bin/clang X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 18:24:12 -0000 Author: dim Date: Tue Aug 21 18:24:11 2012 New Revision: 239513 URL: http://svn.freebsd.org/changeset/base/239513 Log: When WITH_CLANG_EXTRAS is enabled, avoid needlessly building the llvm and clang extras in the cross-tools stage. MFC after: 1 week Modified: head/usr.bin/clang/Makefile Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Tue Aug 21 18:13:09 2012 (r239512) +++ head/usr.bin/clang/Makefile Tue Aug 21 18:24:11 2012 (r239513) @@ -4,7 +4,7 @@ SUBDIR= clang clang-tblgen tblgen -.if ${MK_CLANG_EXTRAS} != "no" +.if ${MK_CLANG_EXTRAS} != "no" && !defined(TOOLS_PREFIX) SUBDIR+=bugpoint \ llc \ lli \ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 18:30: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 73DE3106566C; Tue, 21 Aug 2012 18:30:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CF9D8FC17; Tue, 21 Aug 2012 18: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 q7LIUH3A083306; Tue, 21 Aug 2012 18:30:17 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LIUH4S083299; Tue, 21 Aug 2012 18:30:17 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201208211830.q7LIUH4S083299@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 21 Aug 2012 18: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: r239514 - head/sys/dev/cxgbe/tom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 18:30:17 -0000 Author: np Date: Tue Aug 21 18:30:16 2012 New Revision: 239514 URL: http://svn.freebsd.org/changeset/base/239514 Log: Minor cleanup: use bitwise ops instead of pointless wrappers around setbit/clrbit. Modified: head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Tue Aug 21 18:24:11 2012 (r239513) +++ head/sys/dev/cxgbe/tom/t4_connect.c Tue Aug 21 18:30:16 2012 (r239514) @@ -358,7 +358,7 @@ t4_connect(struct toedev *tod, struct so rc = t4_l2t_send(sc, wr, e); if (rc == 0) { - toepcb_set_flag(toep, TPF_CPL_PENDING); + toep->flags |= TPF_CPL_PENDING; return (0); } Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Aug 21 18:24:11 2012 (r239513) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Aug 21 18:30:16 2012 (r239514) @@ -81,7 +81,7 @@ send_flowc_wr(struct toepcb *toep, struc unsigned int pfvf = G_FW_VIID_PFN(pi->viid) << S_FW_VIID_PFN; struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; - KASSERT(!toepcb_flag(toep, TPF_FLOWC_WR_SENT), + KASSERT(!(toep->flags & TPF_FLOWC_WR_SENT), ("%s: flowc for tid %u sent already", __func__, toep->tid)); CTR2(KTR_CXGBE, "%s: tid %u", __func__, toep->tid); @@ -131,7 +131,7 @@ send_flowc_wr(struct toepcb *toep, struc toep->txsd_pidx = 0; toep->txsd_avail--; - toepcb_set_flag(toep, TPF_FLOWC_WR_SENT); + toep->flags |= TPF_FLOWC_WR_SENT; t4_wrq_tx(sc, wr); } @@ -151,15 +151,15 @@ send_reset(struct adapter *sc, struct to inp->inp_flags & INP_DROPPED ? "inp dropped" : tcpstates[tp->t_state], toep->flags, inp->inp_flags, - toepcb_flag(toep, TPF_ABORT_SHUTDOWN) ? + toep->flags & TPF_ABORT_SHUTDOWN ? " (abort already in progress)" : ""); - if (toepcb_flag(toep, TPF_ABORT_SHUTDOWN)) + if (toep->flags & TPF_ABORT_SHUTDOWN) return; /* abort already in progress */ - toepcb_set_flag(toep, TPF_ABORT_SHUTDOWN); + toep->flags |= TPF_ABORT_SHUTDOWN; - KASSERT(toepcb_flag(toep, TPF_FLOWC_WR_SENT), + KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %d.", __func__, tid)); wr = alloc_wrqe(sizeof(*req), toep->ofld_txq); @@ -174,7 +174,7 @@ send_reset(struct adapter *sc, struct to req->rsvd0 = htobe32(snd_nxt); else req->rsvd0 = htobe32(tp->snd_nxt); - req->rsvd1 = !toepcb_flag(toep, TPF_TX_DATA_SENT); + req->rsvd1 = !(toep->flags & TPF_TX_DATA_SENT); req->cmd = CPL_ABORT_SEND_RST; /* @@ -364,12 +364,12 @@ close_conn(struct adapter *sc, struct to unsigned int tid = toep->tid; CTR3(KTR_CXGBE, "%s: tid %u%s", __func__, toep->tid, - toepcb_flag(toep, TPF_FIN_SENT) ? ", IGNORED" : ""); + toep->flags & TPF_FIN_SENT ? ", IGNORED" : ""); - if (toepcb_flag(toep, TPF_FIN_SENT)) + if (toep->flags & TPF_FIN_SENT) return (0); - KASSERT(toepcb_flag(toep, TPF_FLOWC_WR_SENT), + KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %u.", __func__, tid)); wr = alloc_wrqe(sizeof(*req), toep->ofld_txq); @@ -387,8 +387,8 @@ close_conn(struct adapter *sc, struct to OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_CON_REQ, tid)); req->rsvd = 0; - toepcb_set_flag(toep, TPF_FIN_SENT); - toepcb_clr_flag(toep, TPF_SEND_FIN); + toep->flags |= TPF_FIN_SENT; + toep->flags &= ~TPF_SEND_FIN; t4_l2t_send(sc, wr, toep->l2te); return (0); @@ -540,7 +540,7 @@ t4_push_frames(struct adapter *sc, struc struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; INP_WLOCK_ASSERT(inp); - KASSERT(toepcb_flag(toep, TPF_FLOWC_WR_SENT), + KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %u.", __func__, toep->tid)); if (__predict_false(toep->ulp_mode != ULP_MODE_NONE && @@ -551,7 +551,7 @@ t4_push_frames(struct adapter *sc, struc * This function doesn't resume by itself. Someone else must clear the * flag and call this function. */ - if (__predict_false(toepcb_flag(toep, TPF_TX_SUSPENDED))) + if (__predict_false(toep->flags & TPF_TX_SUSPENDED)) return; do { @@ -577,7 +577,7 @@ t4_push_frames(struct adapter *sc, struc plen -= m->m_len; if (plen == 0) { /* Too few credits */ - toepcb_set_flag(toep, TPF_TX_SUSPENDED); + toep->flags |= TPF_TX_SUSPENDED; SOCKBUF_UNLOCK(sb); return; } @@ -620,7 +620,7 @@ unlocked: break; } - if (__predict_false(toepcb_flag(toep, TPF_FIN_SENT))) + if (__predict_false(toep->flags & TPF_FIN_SENT)) panic("%s: excess tx.", __func__); if (plen <= max_imm) { @@ -631,7 +631,7 @@ unlocked: toep->ofld_txq); if (wr == NULL) { /* XXX: how will we recover from this? */ - toepcb_set_flag(toep, TPF_TX_SUSPENDED); + toep->flags |= TPF_TX_SUSPENDED; return; } txwr = wrtod(wr); @@ -649,7 +649,7 @@ unlocked: wr = alloc_wrqe(roundup(wr_len, 16), toep->ofld_txq); if (wr == NULL) { /* XXX: how will we recover from this? */ - toepcb_set_flag(toep, TPF_TX_SUSPENDED); + toep->flags |= TPF_TX_SUSPENDED; return; } txwr = wrtod(wr); @@ -678,7 +678,7 @@ unlocked: sb->sb_sndptr = sb_sndptr; SOCKBUF_UNLOCK(sb); - toepcb_set_flag(toep, TPF_TX_DATA_SENT); + toep->flags |= TPF_TX_DATA_SENT; KASSERT(toep->txsd_avail > 0, ("%s: no txsd", __func__)); txsd->plen = plen; @@ -694,7 +694,7 @@ unlocked: } while (m != NULL); /* Send a FIN if requested, but only if there's no more data to send */ - if (m == NULL && toepcb_flag(toep, TPF_SEND_FIN)) + if (m == NULL && toep->flags & TPF_SEND_FIN) close_conn(sc, toep); } @@ -731,7 +731,7 @@ t4_send_fin(struct toedev *tod, struct t ("%s: inp %p dropped.", __func__, inp)); KASSERT(toep != NULL, ("%s: toep is NULL", __func__)); - toepcb_set_flag(toep, TPF_SEND_FIN); + toep->flags |= TPF_SEND_FIN; t4_push_frames(sc, toep); return (0); @@ -752,7 +752,7 @@ t4_send_rst(struct toedev *tod, struct t KASSERT(toep != NULL, ("%s: toep is NULL", __func__)); /* hmmmm */ - KASSERT(toepcb_flag(toep, TPF_FLOWC_WR_SENT), + KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc for tid %u [%s] not sent already", __func__, toep->tid, tcpstates[tp->t_state])); @@ -790,7 +790,7 @@ do_peer_close(struct sge_iq *iq, const s CTR5(KTR_CXGBE, "%s: tid %u (%s), toep_flags 0x%x, inp %p", __func__, tid, tp ? tcpstates[tp->t_state] : "no tp", toep->flags, inp); - if (toepcb_flag(toep, TPF_ABORT_SHUTDOWN)) + if (toep->flags & TPF_ABORT_SHUTDOWN) goto done; tp->rcv_nxt++; /* FIN */ @@ -888,7 +888,7 @@ do_close_con_rpl(struct sge_iq *iq, cons CTR4(KTR_CXGBE, "%s: tid %u (%s), toep_flags 0x%x", __func__, tid, tp ? tcpstates[tp->t_state] : "no tp", toep->flags); - if (toepcb_flag(toep, TPF_ABORT_SHUTDOWN)) + if (toep->flags & TPF_ABORT_SHUTDOWN) goto done; so = inp->inp_socket; @@ -986,7 +986,7 @@ do_abort_req(struct sge_iq *iq, const st ("%s: unexpected opcode 0x%x", __func__, opcode)); KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); - if (toepcb_flag(toep, TPF_SYNQE)) + if (toep->flags & TPF_SYNQE) return (do_abort_req_synqe(iq, rss, m)); KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); @@ -1015,11 +1015,11 @@ do_abort_req(struct sge_iq *iq, const st * cleaning up resources. Otherwise we tear everything down right here * right now. We owe the T4 a CPL_ABORT_RPL no matter what. */ - if (toepcb_flag(toep, TPF_ABORT_SHUTDOWN)) { + if (toep->flags & TPF_ABORT_SHUTDOWN) { INP_WUNLOCK(inp); goto done; } - toepcb_set_flag(toep, TPF_ABORT_SHUTDOWN); + toep->flags |= TPF_ABORT_SHUTDOWN; so_error_set(so, abort_status_to_errno(tp, cpl->status)); tp = tcp_close(tp); @@ -1052,7 +1052,7 @@ do_abort_rpl(struct sge_iq *iq, const st ("%s: unexpected opcode 0x%x", __func__, opcode)); KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); - if (toepcb_flag(toep, TPF_SYNQE)) + if (toep->flags & TPF_SYNQE) return (do_abort_rpl_synqe(iq, rss, m)); KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); @@ -1060,7 +1060,7 @@ do_abort_rpl(struct sge_iq *iq, const st CTR5(KTR_CXGBE, "%s: tid %u, toep %p, inp %p, status %d", __func__, tid, toep, inp, cpl->status); - KASSERT(toepcb_flag(toep, TPF_ABORT_SHUTDOWN), + KASSERT(toep->flags & TPF_ABORT_SHUTDOWN, ("%s: wasn't expecting abort reply", __func__)); INP_WLOCK(inp); @@ -1082,13 +1082,13 @@ do_rx_data(struct sge_iq *iq, const stru struct sockbuf *sb; int len; - if (__predict_false(toepcb_flag(toep, TPF_SYNQE))) { + if (__predict_false(toep->flags & TPF_SYNQE)) { /* * do_pass_establish failed and must be attempting to abort the * synqe's tid. Meanwhile, the T4 has sent us data for such a * connection. */ - KASSERT(toepcb_flag(toep, TPF_ABORT_SHUTDOWN), + KASSERT(toep->flags & TPF_ABORT_SHUTDOWN, ("%s: synqe and tid isn't being aborted.", __func__)); m_freem(m); return (0); @@ -1266,8 +1266,8 @@ do_fw4_ack(struct sge_iq *iq, const stru * Very unusual case: we'd sent a flowc + abort_req for a synq entry and * now this comes back carrying the credits for the flowc. */ - if (__predict_false(toepcb_flag(toep, TPF_SYNQE))) { - KASSERT(toepcb_flag(toep, TPF_ABORT_SHUTDOWN), + if (__predict_false(toep->flags & TPF_SYNQE)) { + KASSERT(toep->flags & TPF_ABORT_SHUTDOWN, ("%s: credits for a synq entry %p", __func__, toep)); return (0); } @@ -1281,7 +1281,7 @@ do_fw4_ack(struct sge_iq *iq, const stru INP_WLOCK(inp); - if (__predict_false(toepcb_flag(toep, TPF_ABORT_SHUTDOWN))) { + if (__predict_false(toep->flags & TPF_ABORT_SHUTDOWN)) { INP_WUNLOCK(inp); return (0); } @@ -1337,11 +1337,11 @@ do_fw4_ack(struct sge_iq *iq, const stru } /* XXX */ - if ((toepcb_flag(toep, TPF_TX_SUSPENDED) && + if ((toep->flags & TPF_TX_SUSPENDED && toep->tx_credits >= MIN_OFLD_TX_CREDITS) || toep->tx_credits == toep->txsd_total * howmany((sizeof(struct fw_ofld_tx_data_wr) + 1), 16)) { - toepcb_clr_flag(toep, TPF_TX_SUSPENDED); + toep->flags &= ~TPF_TX_SUSPENDED; t4_push_frames(sc, toep); } INP_WUNLOCK(inp); Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Tue Aug 21 18:24:11 2012 (r239513) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Tue Aug 21 18:30:16 2012 (r239514) @@ -472,7 +472,7 @@ do_rx_data_ddp(struct sge_iq *iq, const KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == tid, ("%s: toep tid/atid mismatch", __func__)); - KASSERT(!toepcb_flag(toep, TPF_SYNQE), + KASSERT(!(toep->flags & TPF_SYNQE), ("%s: toep %p claims to be a synq entry", __func__, toep)); vld = be32toh(cpl->ddpvld); @@ -497,7 +497,7 @@ do_rx_ddp_complete(struct sge_iq *iq, co KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == tid, ("%s: toep tid/atid mismatch", __func__)); - KASSERT(!toepcb_flag(toep, TPF_SYNQE), + KASSERT(!(toep->flags & TPF_SYNQE), ("%s: toep %p claims to be a synq entry", __func__, toep)); handle_ddp_data(toep, cpl->ddp_report, cpl->rcv_nxt, 0); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Tue Aug 21 18:24:11 2012 (r239513) +++ head/sys/dev/cxgbe/tom/t4_listen.c Tue Aug 21 18:30:16 2012 (r239514) @@ -283,11 +283,11 @@ send_reset_synqe(struct toedev *tod, str CTR4(KTR_CXGBE, "%s: synqe %p, tid %d%s", __func__, synqe, synqe->tid, - synqe_flag(synqe, TPF_ABORT_SHUTDOWN) ? + synqe->flags & TPF_ABORT_SHUTDOWN ? " (abort already in progress)" : ""); - if (synqe_flag(synqe, TPF_ABORT_SHUTDOWN)) + if (synqe->flags & TPF_ABORT_SHUTDOWN) return; /* abort already in progress */ - synqe_set_flag(synqe, TPF_ABORT_SHUTDOWN); + synqe->flags |= TPF_ABORT_SHUTDOWN; get_qids_from_mbuf(m, &txqid, &rxqid); ofld_txq = &sc->sge.ofld_txq[txqid]; @@ -318,7 +318,7 @@ send_reset_synqe(struct toedev *tod, str flowc->mnemval[2].val = htobe32(pi->tx_chan); flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; flowc->mnemval[3].val = htobe32(ofld_rxq->iq.abs_id); - synqe_set_flag(synqe, TPF_FLOWC_WR_SENT); + synqe->flags |= TPF_FLOWC_WR_SENT; /* ... then ABORT request */ INIT_TP_WR_MIT_CPL(req, CPL_ABORT_REQ, synqe->tid); @@ -515,7 +515,7 @@ release_synqe(struct synq_entry *synqe) { if (refcount_release(&synqe->refcnt)) { - int needfree = synqe_flag(synqe, TPF_SYNQE_NEEDFREE); + int needfree = synqe->flags & TPF_SYNQE_NEEDFREE; m_freem(synqe->syn); if (needfree) @@ -740,7 +740,7 @@ do_abort_req_synqe(struct sge_iq *iq, co * cleaning up resources. Otherwise we tear everything down right here * right now. We owe the T4 a CPL_ABORT_RPL no matter what. */ - if (synqe_flag(synqe, TPF_ABORT_SHUTDOWN)) { + if (synqe->flags & TPF_ABORT_SHUTDOWN) { INP_WUNLOCK(inp); goto done; } @@ -775,7 +775,7 @@ do_abort_rpl_synqe(struct sge_iq *iq, co __func__, tid, synqe, synqe->flags, synqe->lctx, cpl->status); INP_WLOCK(inp); - KASSERT(synqe_flag(synqe, TPF_ABORT_SHUTDOWN), + KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, ("%s: wasn't expecting abort reply for synqe %p (0x%x)", __func__, synqe, synqe->flags)); @@ -798,12 +798,12 @@ t4_offload_socket(struct toedev *tod, vo INP_INFO_LOCK_ASSERT(&V_tcbinfo); /* prevents bad race with accept() */ INP_WLOCK_ASSERT(inp); - KASSERT(synqe_flag(synqe, TPF_SYNQE), + KASSERT(synqe->flags & TPF_SYNQE, ("%s: %p not a synq_entry?", __func__, arg)); offload_socket(so, toep); make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); - toepcb_set_flag(toep, TPF_CPL_PENDING); + toep->flags |= TPF_CPL_PENDING; update_tid(sc, synqe->tid, toep); } @@ -843,13 +843,11 @@ mbuf_to_synqe(struct mbuf *m) synqe = malloc(sizeof(*synqe), M_CXGBE, M_NOWAIT); if (synqe == NULL) return (NULL); - } else + synqe->flags = TPF_SYNQE | TPF_SYNQE_NEEDFREE; + } else { synqe = (void *)(m->m_data + m->m_len + tspace - sizeof(*synqe)); - - synqe->flags = 0; - synqe_set_flag(synqe, TPF_SYNQE); - if (tspace < len) - synqe_set_flag(synqe, TPF_SYNQE_NEEDFREE); + synqe->flags = TPF_SYNQE; + } return (synqe); } @@ -1115,7 +1113,7 @@ do_pass_accept_req(struct sge_iq *iq, co INIT_TP_WR_MIT_CPL(rpl, CPL_PASS_ACCEPT_RPL, tid); if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0) { ulp_mode = ULP_MODE_TCPDDP; - synqe_set_flag(synqe, TPF_SYNQE_TCPDDP); + synqe->flags |= TPF_SYNQE_TCPDDP; } else ulp_mode = ULP_MODE_NONE; rpl->opt0 = calc_opt0(so, pi, e, mtu_idx, rscale, rx_credits, ulp_mode); @@ -1160,7 +1158,7 @@ do_pass_accept_req(struct sge_iq *iq, co INP_WLOCK(inp); if (__predict_false(inp->inp_flags & INP_DROPPED)) { /* listener closed. synqe must have been aborted. */ - KASSERT(synqe_flag(synqe, TPF_ABORT_SHUTDOWN), + KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, ("%s: listener %p closed but synqe %p not aborted", __func__, inp, synqe)); @@ -1178,7 +1176,7 @@ do_pass_accept_req(struct sge_iq *iq, co * that can only happen if the listener was closed and we just * checked for that. */ - KASSERT(!synqe_flag(synqe, TPF_ABORT_SHUTDOWN), + KASSERT(!(synqe->flags & TPF_ABORT_SHUTDOWN), ("%s: synqe %p aborted, but listener %p not dropped.", __func__, synqe, inp)); @@ -1275,7 +1273,7 @@ do_pass_establish(struct sge_iq *iq, con ("%s: unexpected opcode 0x%x", __func__, opcode)); KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(lctx->stid == stid, ("%s: lctx stid mismatch", __func__)); - KASSERT(synqe_flag(synqe, TPF_SYNQE), + KASSERT(synqe->flags & TPF_SYNQE, ("%s: tid %u (ctx %p) not a synqe", __func__, tid, synqe)); INP_INFO_WLOCK(&V_tcbinfo); /* for syncache_expand */ @@ -1292,7 +1290,7 @@ do_pass_establish(struct sge_iq *iq, con * on the lctx's synq. do_abort_rpl for the tid is responsible * for cleaning up. */ - KASSERT(synqe_flag(synqe, TPF_ABORT_SHUTDOWN), + KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, ("%s: listen socket dropped but tid %u not aborted.", __func__, tid)); @@ -1322,7 +1320,7 @@ reset: } toep->tid = tid; toep->l2te = &sc->l2t->l2tab[synqe->l2e_idx]; - if (synqe_flag(synqe, TPF_SYNQE_TCPDDP)) + if (synqe->flags & TPF_SYNQE_TCPDDP) set_tcpddp_ulp_mode(toep); else toep->ulp_mode = ULP_MODE_NONE; Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Tue Aug 21 18:24:11 2012 (r239513) +++ head/sys/dev/cxgbe/tom/t4_tom.c Tue Aug 21 18:30:16 2012 (r239514) @@ -141,9 +141,9 @@ void free_toepcb(struct toepcb *toep) { - KASSERT(toepcb_flag(toep, TPF_ATTACHED) == 0, + KASSERT(!(toep->flags & TPF_ATTACHED), ("%s: attached to an inpcb", __func__)); - KASSERT(toepcb_flag(toep, TPF_CPL_PENDING) == 0, + KASSERT(!(toep->flags & TPF_CPL_PENDING), ("%s: CPL pending", __func__)); free(toep, M_CXGBE); @@ -181,7 +181,7 @@ offload_socket(struct socket *so, struct /* Install an extra hold on inp */ toep->inp = inp; - toepcb_set_flag(toep, TPF_ATTACHED); + toep->flags |= TPF_ATTACHED; in_pcbref(inp); /* Add the TOE PCB to the active list */ @@ -216,7 +216,7 @@ undo_offload_socket(struct socket *so) tp->t_flags &= ~TF_TOE; toep->inp = NULL; - toepcb_clr_flag(toep, TPF_ATTACHED); + toep->flags &= ~TPF_ATTACHED; if (in_pcbrele_wlocked(inp)) panic("%s: inp freed.", __func__); @@ -232,9 +232,9 @@ release_offload_resources(struct toepcb struct adapter *sc = td_adapter(td); int tid = toep->tid; - KASSERT(toepcb_flag(toep, TPF_CPL_PENDING) == 0, + KASSERT(!(toep->flags & TPF_CPL_PENDING), ("%s: %p has CPL pending.", __func__, toep)); - KASSERT(toepcb_flag(toep, TPF_ATTACHED) == 0, + KASSERT(!(toep->flags & TPF_ATTACHED), ("%s: %p is still attached.", __func__, toep)); CTR4(KTR_CXGBE, "%s: toep %p (tid %d, l2te %p)", @@ -277,7 +277,7 @@ t4_pcb_detach(struct toedev *tod __unuse INP_WLOCK_ASSERT(inp); KASSERT(toep != NULL, ("%s: toep is NULL", __func__)); - KASSERT(toepcb_flag(toep, TPF_ATTACHED), + KASSERT(toep->flags & TPF_ATTACHED, ("%s: not attached", __func__)); #ifdef KTR @@ -295,9 +295,9 @@ t4_pcb_detach(struct toedev *tod __unuse tp->t_toe = NULL; tp->t_flags &= ~TF_TOE; - toepcb_clr_flag(toep, TPF_ATTACHED); + toep->flags &= ~TPF_ATTACHED; - if (toepcb_flag(toep, TPF_CPL_PENDING) == 0) + if (!(toep->flags & TPF_CPL_PENDING)) release_offload_resources(toep); } @@ -312,16 +312,16 @@ final_cpl_received(struct toepcb *toep) KASSERT(inp != NULL, ("%s: inp is NULL", __func__)); INP_WLOCK_ASSERT(inp); - KASSERT(toepcb_flag(toep, TPF_CPL_PENDING), + KASSERT(toep->flags & TPF_CPL_PENDING, ("%s: CPL not pending already?", __func__)); CTR6(KTR_CXGBE, "%s: tid %d, toep %p (0x%x), inp %p (0x%x)", __func__, toep->tid, toep, toep->flags, inp, inp->inp_flags); toep->inp = NULL; - toepcb_clr_flag(toep, TPF_CPL_PENDING); + toep->flags &= ~TPF_CPL_PENDING; - if (toepcb_flag(toep, TPF_ATTACHED) == 0) + if (!(toep->flags & TPF_ATTACHED)) release_offload_resources(toep); if (!in_pcbrele_wlocked(inp)) Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Tue Aug 21 18:24:11 2012 (r239513) +++ head/sys/dev/cxgbe/tom/t4_tom.h Tue Aug 21 18:30:16 2012 (r239514) @@ -55,17 +55,17 @@ /* TOE PCB flags */ enum { - TPF_ATTACHED, /* a tcpcb refers to this toepcb */ - TPF_FLOWC_WR_SENT, /* firmware flow context WR sent */ - TPF_TX_DATA_SENT, /* some data sent */ - TPF_TX_SUSPENDED, /* tx suspended for lack of resources */ - TPF_SEND_FIN, /* send FIN after sending all pending data */ - TPF_FIN_SENT, /* FIN has been sent */ - TPF_ABORT_SHUTDOWN, /* connection abort is in progress */ - TPF_CPL_PENDING, /* haven't received the last CPL */ - TPF_SYNQE, /* synq_entry, not really a toepcb */ - TPF_SYNQE_NEEDFREE, /* synq_entry was allocated externally */ - TPF_SYNQE_TCPDDP, /* ulp_mode TCPDDP when toepcb is allocated */ + TPF_ATTACHED = (1 << 0), /* a tcpcb refers to this toepcb */ + TPF_FLOWC_WR_SENT = (1 << 1), /* firmware flow context WR sent */ + TPF_TX_DATA_SENT = (1 << 2), /* some data sent */ + TPF_TX_SUSPENDED = (1 << 3), /* tx suspended for lack of resources */ + TPF_SEND_FIN = (1 << 4), /* send FIN after all pending data */ + TPF_FIN_SENT = (1 << 5), /* FIN has been sent */ + TPF_ABORT_SHUTDOWN = (1 << 6), /* connection abort is in progress */ + TPF_CPL_PENDING = (1 << 7), /* haven't received the last CPL */ + TPF_SYNQE = (1 << 8), /* synq_entry, not really a toepcb */ + TPF_SYNQE_NEEDFREE = (1 << 9), /* synq_entry was malloc'd separately */ + TPF_SYNQE_TCPDDP = (1 << 10), /* ulp_mode TCPDDP in toepcb */ }; enum { @@ -134,27 +134,6 @@ struct flowc_tx_params { unsigned int mss; }; -static inline int -toepcb_flag(struct toepcb *toep, int flag) -{ - - return isset(&toep->flags, flag); -} - -static inline void -toepcb_set_flag(struct toepcb *toep, int flag) -{ - - setbit(&toep->flags, flag); -} - -static inline void -toepcb_clr_flag(struct toepcb *toep, int flag) -{ - - clrbit(&toep->flags, flag); -} - #define DDP_RETRY_WAIT 5 /* seconds to wait before re-enabling DDP */ #define DDP_LOW_SCORE 1 #define DDP_HIGH_SCORE 3 @@ -186,27 +165,6 @@ struct synq_entry { uint16_t rcv_bufsize; }; -static inline int -synqe_flag(struct synq_entry *synqe, int flag) -{ - - return isset(&synqe->flags, flag); -} - -static inline void -synqe_set_flag(struct synq_entry *synqe, int flag) -{ - - setbit(&synqe->flags, flag); -} - -static inline void -synqe_clr_flag(struct synq_entry *synqe, int flag) -{ - - clrbit(&synqe->flags, flag); -} - /* listen_ctx flags */ #define LCTX_RPL_PENDING 1 /* waiting for a CPL_PASS_OPEN_RPL */ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 18:41: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 630E6106566C; Tue, 21 Aug 2012 18:41:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 447C78FC16; Tue, 21 Aug 2012 18:41: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 q7LIfddI084833; Tue, 21 Aug 2012 18:41:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LIfdtO084831; Tue, 21 Aug 2012 18:41:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208211841.q7LIfdtO084831@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Aug 2012 18:41: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: r239515 - 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: Tue, 21 Aug 2012 18:41:39 -0000 Author: jhb Date: Tue Aug 21 18:41:38 2012 New Revision: 239515 URL: http://svn.freebsd.org/changeset/base/239515 Log: Add a manpage for BUS_CHILD_DETACHED(). Added: head/share/man/man9/BUS_CHILD_DETACHED.9 (contents, props changed) Modified: head/share/man/man9/Makefile Added: head/share/man/man9/BUS_CHILD_DETACHED.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/BUS_CHILD_DETACHED.9 Tue Aug 21 18:41:38 2012 (r239515) @@ -0,0 +1,52 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2012 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin +.\" 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 August 21, 2012 +.Dt BUS_CHILD_DETACHED 9 +.Os +.Sh NAME +.Nm BUS_CHILD_DETACHED +.Nd "notify a bus device that a child was detached" +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Ft void +.Fn BUS_CHILD_DETACHED "device_t dev" "device_t child" +.Sh DESCRIPTION +The +.Fn BUS_CHILD_DETACHED +method is invoked by the new-bus framework after a device is detached. +A bus driver can provide an implementation of this method to +reclaim any resources allocated on behalf of the child or +to cleanup state not properly released by a +.Xr DEVICE_DETACH 9 +method. +.Sh SEE ALSO +.Xr device 9 , +.Xr DEVICE_DETACH 9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Aug 21 18:30:16 2012 (r239514) +++ head/share/man/man9/Makefile Tue Aug 21 18:41:38 2012 (r239515) @@ -27,6 +27,7 @@ MAN= accept_filter.9 \ BUS_BIND_INTR.9 \ bus_child_present.9 \ BUS_CHILD_DELETED.9 \ + BUS_CHILD_DETACHED.9 \ BUS_CONFIG_INTR.9 \ BUS_DESCRIBE_INTR.9 \ bus_dma.9 \ From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 18:50: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 2B54A106566C; Tue, 21 Aug 2012 18:50:16 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id D90798FC17; Tue, 21 Aug 2012 18:50:15 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q7LIoE9j030854; Tue, 21 Aug 2012 12:50:14 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q7LIoEE4030850; Tue, 21 Aug 2012 12:50:14 -0600 (MDT) (envelope-from ken) Date: Tue, 21 Aug 2012 12:50:14 -0600 From: "Kenneth D. Merry" To: Gleb Smirnoff Message-ID: <20120821185014.GA28272@nargothrond.kdm.org> References: <201208021357.q72DvoFJ088426@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201208021357.q72DvoFJ088426@svn.freebsd.org> User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238990 - in head/sys: net 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: Tue, 21 Aug 2012 18:50:16 -0000 On Thu, Aug 02, 2012 at 13:57:50 +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Aug 2 13:57:49 2012 > New Revision: 238990 > URL: http://svn.freebsd.org/changeset/base/238990 > > Log: > Fix races between in_lltable_prefix_free(), lla_lookup(), > llentry_free() and arptimer(): > > o Use callout_init_rw() for lle timeout, this allows us safely > disestablish them. > - This allows us to simplify the arptimer() and make it > race safe. > o Consistently use ifp->if_afdata_lock to lock access to > linked lists in the lle hashes. > o Introduce new lle flag LLE_LINKED, which marks an entry that > is attached to the hash. > - Use LLE_LINKED to avoid double unlinking via consequent > calls to llentry_free(). > - Mark lle with LLE_DELETED via |= operation istead of =, > so that other flags won't be lost. > o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more > consistent and provide more informative KASSERTs. > > The patch is a collaborative work of all submitters and myself. > > PR: kern/165863 > Submitted by: Andrey Zonov > Submitted by: Ryan Stone > Submitted by: Eric van Gyzen I'm running into this on stable/9, any plan on when this will get MFCed? Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x360 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff808c74c2 stack pointer = 0x28:0xffffff83e3f5d140 frame pointer = 0x28:0xffffff83e3f5d1a0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 12 (irq265: igb0:que 0) [ thread pid 12 tid 100047 ] Stopped at 0xffffffff808c74c2 = _rw_rlock+0xf2: movl 0x360(%rcx),%edi db> bt Tracing pid 12 tid 100047 td 0xfffffe000d57c8e0 _rw_rlock() at 0xffffffff808c74c2 = _rw_rlock+0xf2 in_lltable_lookup() at 0xffffffff809e716c = in_lltable_lookup+0x4ac arpresolve() at 0xffffffff809dfe66 = arpresolve+0x116 ether_output() at 0xffffffff8098905f = ether_output+0x25f ip_output() at 0xffffffff809f73a9 = ip_output+0xc79 tcp_output() at 0xffffffff80a651dd = tcp_output+0xb0d tcp_do_segment() at 0xffffffff80a60213 = tcp_do_segment+0xb63 tcp_input() at 0xffffffff80a63148 = tcp_input+0xaf8 ip_input() at 0xffffffff809f447c = ip_input+0xac netisr_dispatch_src() at 0xffffffff8099346b = netisr_dispatch_src+0x20b ether_demux() at 0xffffffff8098890d = ether_demux+0x14d ether_nh_input() at 0xffffffff80988be4 = ether_nh_input+0x1f4 netisr_dispatch_src() at 0xffffffff8099346b = netisr_dispatch_src+0x20b igb_rxeof() at 0xffffffff8179d034 = igb_rxeof+0x394 igb_msix_que() at 0xffffffff8179d3ca = igb_msix_que+0xaa intr_event_execute_handlers() at 0xffffffff8089bdd4 = intr_event_execute_handlers+0x104 ithread_loop() at 0xffffffff8089d594 = ithread_loop+0xa4 fork_exit() at 0xffffffff8089847f = fork_exit+0x11f fork_trampoline() at 0xffffffff80bb970e = fork_trampoline+0xe --- trap 0, rip = 0, rsp = 0xffffff83e3f5dbb0, rbp = 0 --- Thanks, Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 19:07: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 AB1F0106566B; Tue, 21 Aug 2012 19:07:28 +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 974188FC1F; Tue, 21 Aug 2012 19:07: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 q7LJ7SUG088604; Tue, 21 Aug 2012 19:07:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJ7Smo088602; Tue, 21 Aug 2012 19:07:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208211907.q7LJ7Smo088602@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Aug 2012 19:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239519 - 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: Tue, 21 Aug 2012 19:07:28 -0000 Author: jhb Date: Tue Aug 21 19:07:28 2012 New Revision: 239519 URL: http://svn.freebsd.org/changeset/base/239519 Log: Fix a silly grammar bogon. Submitted by: Stephen McKay Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Tue Aug 21 19:03:04 2012 (r239518) +++ head/sys/net/if_vlan.c Tue Aug 21 19:07:28 2012 (r239519) @@ -1339,7 +1339,7 @@ vlan_unconfig_locked(struct ifnet *ifp, while ((mc = SLIST_FIRST(&ifv->vlan_mc_listhead)) != NULL) { /* * If the parent interface is being detached, - * all it's multicast addresses have already + * all its multicast addresses have already * been removed. Warn about errors if * if_delmulti() does fail, but don't abort as * all callers expect vlan destruction to From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 19:39: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 1354D106564A; Tue, 21 Aug 2012 19:39:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8AB48FC12; Tue, 21 Aug 2012 19:39: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 q7LJd9Nc093496; Tue, 21 Aug 2012 19:39:09 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJd96B093494; Tue, 21 Aug 2012 19:39:09 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201208211939.q7LJd96B093494@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 21 Aug 2012 19:39: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: r239527 - head/sys/dev/cxgbe/tom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 19:39:10 -0000 Author: np Date: Tue Aug 21 19:39:09 2012 New Revision: 239527 URL: http://svn.freebsd.org/changeset/base/239527 Log: Cannot hold a mutex around vm_fault_quick_hold_pages, so don't. Tweak some comments while here. Modified: head/sys/dev/cxgbe/tom/t4_ddp.c Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Tue Aug 21 19:32:55 2012 (r239526) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Tue Aug 21 19:39:09 2012 (r239527) @@ -769,7 +769,9 @@ write_page_pods(struct adapter *sc, stru } /* - * Reuse, or allocate (and program the page pods for) a new DDP buffer. + * Reuse, or allocate (and program the page pods for) a new DDP buffer. The + * "pages" array is handed over to this function and should not be used in any + * way by the caller after that. */ static int select_ddp_buffer(struct adapter *sc, struct toepcb *toep, vm_page_t *pages, @@ -843,13 +845,6 @@ unwire_ddp_buffer(struct ddp_buffer *db) } } -static inline void -unhold_ddp_buffer(struct ddp_buffer *db) -{ - - vm_page_unhold_pages(db->pages, db->npages); -} - static int handle_ddp(struct socket *so, struct uio *uio, int flags, int error) { @@ -883,15 +878,24 @@ handle_ddp(struct socket *so, struct uio * Fault in and then hold the pages of the uio buffers. We'll wire them * a bit later if everything else works out. */ - if (hold_uio(uio, &pages, &npages) != 0) + SOCKBUF_UNLOCK(sb); + if (hold_uio(uio, &pages, &npages) != 0) { + SOCKBUF_LOCK(sb); goto no_ddp; + } + SOCKBUF_LOCK(sb); + if (__predict_false(so->so_error || sb->sb_state & SBS_CANTRCVMORE)) { + vm_page_unhold_pages(pages, npages); + free(pages, M_CXGBE); + goto no_ddp; + } /* * Figure out which one of the two DDP buffers to use this time. */ db_idx = select_ddp_buffer(sc, toep, pages, npages, (uintptr_t)uio->uio_iov->iov_base & PAGE_MASK, uio->uio_resid); - pages = NULL; /* pages either in use elsewhere or unheld + freed */ + pages = NULL; /* handed off to select_ddp_buffer */ if (db_idx < 0) goto no_ddp; db = toep->db[db_idx]; @@ -904,11 +908,17 @@ handle_ddp(struct socket *so, struct uio ddp_flags = select_ddp_flags(so, flags, db_idx); wr = mk_update_tcb_for_ddp(sc, toep, db_idx, sb->sb_cc, ddp_flags); if (wr == NULL) { - unhold_ddp_buffer(db); + /* + * Just unhold the pages. The DDP buffer's software state is + * left as-is in the toep. The page pods were written + * successfully and we may have an opportunity to use it in the + * future. + */ + vm_page_unhold_pages(db->pages, db->npages); goto no_ddp; } - /* Wire the pages and give the chip the go-ahead. */ + /* Wire (and then unhold) the pages, and give the chip the go-ahead. */ wire_ddp_buffer(db); t4_wrq_tx(sc, wr); sb->sb_flags &= ~SB_DDP_INDICATE; From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 19:45: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 48D071065679; Tue, 21 Aug 2012 19:45:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33D4D8FC08; Tue, 21 Aug 2012 19:45: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 q7LJjKl7094326; Tue, 21 Aug 2012 19:45:20 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJjKLm094324; Tue, 21 Aug 2012 19:45:20 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201208211945.q7LJjKLm094324@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 21 Aug 2012 19:45: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: r239528 - head/sys/dev/cxgbe/tom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 19:45:20 -0000 Author: np Date: Tue Aug 21 19:45:19 2012 New Revision: 239528 URL: http://svn.freebsd.org/changeset/base/239528 Log: Avoid a NULL pointer dereference. Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Aug 21 19:39:09 2012 (r239527) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Aug 21 19:45:19 2012 (r239528) @@ -1007,8 +1007,8 @@ do_abort_req(struct sge_iq *iq, const st CTR6(KTR_CXGBE, "%s: tid %d (%s), toep_flags 0x%x, inp_flags 0x%x, status %d", - __func__, tid, tcpstates[tp->t_state], toep->flags, inp->inp_flags, - cpl->status); + __func__, tid, tp ? tcpstates[tp->t_state] : "no tp", toep->flags, + inp->inp_flags, cpl->status); /* * If we'd initiated an abort earlier the reply to it is responsible for From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 19:55: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 2BADF1065676; Tue, 21 Aug 2012 19:55:25 +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 172C28FC16; Tue, 21 Aug 2012 19:55: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 q7LJtOVt095791; Tue, 21 Aug 2012 19:55:24 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LJtOO3095789; Tue, 21 Aug 2012 19:55:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201208211955.q7LJtOO3095789@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 21 Aug 2012 19:55: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: r239530 - 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: Tue, 21 Aug 2012 19:55:25 -0000 Author: hselasky Date: Tue Aug 21 19:55:24 2012 New Revision: 239530 URL: http://svn.freebsd.org/changeset/base/239530 Log: Make some at91_pcm_xxx() functions NULL safe. Modified: head/sys/arm/at91/at91_pmc.c Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Tue Aug 21 19:45:48 2012 (r239529) +++ head/sys/arm/at91/at91_pmc.c Tue Aug 21 19:55:24 2012 (r239530) @@ -369,12 +369,15 @@ at91_pmc_clock_ref(const char *name) void at91_pmc_clock_deref(struct at91_pmc_clock *clk) { - + if (clk == NULL) + return; } void at91_pmc_clock_enable(struct at91_pmc_clock *clk) { + if (clk == NULL) + return; /* XXX LOCKING? XXX */ if (clk->parent) @@ -386,6 +389,8 @@ at91_pmc_clock_enable(struct at91_pmc_cl void at91_pmc_clock_disable(struct at91_pmc_clock *clk) { + if (clk == NULL) + return; /* XXX LOCKING? XXX */ if (--clk->refcnt == 0 && clk->set_mode) From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 20:11: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 916481065673; Tue, 21 Aug 2012 20:11:00 +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 7C7A68FC0A; Tue, 21 Aug 2012 20:11: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 q7LKB0oe098007; Tue, 21 Aug 2012 20:11:00 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LKB0Hs098002; Tue, 21 Aug 2012 20:11:00 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201208212011.q7LKB0Hs098002@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 21 Aug 2012 20:11: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: r239531 - 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: Tue, 21 Aug 2012 20:11:00 -0000 Author: hselasky Date: Tue Aug 21 20:10:59 2012 New Revision: 239531 URL: http://svn.freebsd.org/changeset/base/239531 Log: Fix USB drivers for KB920X target. Add missing clock settings. VBUS GPIO IRQ is still missing (TODO). Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c head/sys/dev/usb/controller/ohci_atmelarm.c Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/at91dci_atmelarm.c Tue Aug 21 19:55:24 2012 (r239530) +++ head/sys/dev/usb/controller/at91dci_atmelarm.c Tue Aug 21 20:10:59 2012 (r239531) @@ -80,6 +80,7 @@ static device_detach_t at91_udp_detach; struct at91_udp_softc { struct at91dci_softc sc_dci; /* must be first */ + struct at91_pmc_clock *sc_mclk; struct at91_pmc_clock *sc_iclk; struct at91_pmc_clock *sc_fclk; struct resource *sc_vbus_irq_res; @@ -107,6 +108,7 @@ at91_udp_clocks_on(void *arg) { struct at91_udp_softc *sc = arg; + at91_pmc_clock_enable(sc->sc_mclk); at91_pmc_clock_enable(sc->sc_iclk); at91_pmc_clock_enable(sc->sc_fclk); } @@ -118,6 +120,7 @@ at91_udp_clocks_off(void *arg) at91_pmc_clock_disable(sc->sc_fclk); at91_pmc_clock_disable(sc->sc_iclk); + at91_pmc_clock_disable(sc->sc_mclk); } static void @@ -185,6 +188,7 @@ at91_udp_attach(device_t dev) /* wait 10ms for pulldown to stabilise */ usb_pause_mtx(NULL, hz / 100); + sc->sc_mclk = at91_pmc_clock_ref("mck"); sc->sc_iclk = at91_pmc_clock_ref("udc_clk"); sc->sc_fclk = at91_pmc_clock_ref("udpck"); @@ -209,8 +213,9 @@ at91_udp_attach(device_t dev) rid = 1; sc->sc_vbus_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); - if (!(sc->sc_vbus_irq_res)) { - goto error; + if (sc->sc_vbus_irq_res == NULL) { + at91_pio_gpio_set_interrupt(VBUS_BASE, VBUS_MASK, 0); + device_printf(dev, "No VBUS IRQ!"); } sc->sc_dci.sc_bus.bdev = device_add_child(dev, "usbus", -1); if (!(sc->sc_dci.sc_bus.bdev)) { @@ -230,11 +235,19 @@ at91_udp_attach(device_t dev) goto error; } #if (__FreeBSD_version >= 700031) - err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl); + if (sc->sc_vbus_irq_res != NULL) { + err = bus_setup_intr(dev, sc->sc_vbus_irq_res, + INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)at91_vbus_poll, sc, + &sc->sc_vbus_intr_hdl); + } #else - err = bus_setup_intr(dev, sc->sc_vbus_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)at91_vbus_poll, sc, &sc->sc_vbus_intr_hdl); + if (sc->sc_vbus_irq_res != NULL) { + err = bus_setup_intr(dev, sc->sc_vbus_irq_res, + INTR_TYPE_BIO | INTR_MPSAFE, + (driver_intr_t *)at91_vbus_poll, sc, + &sc->sc_vbus_intr_hdl); + } #endif if (err) { sc->sc_vbus_intr_hdl = NULL; @@ -317,8 +330,10 @@ at91_udp_detach(device_t dev) /* disable clocks */ at91_pmc_clock_disable(sc->sc_iclk); at91_pmc_clock_disable(sc->sc_fclk); + at91_pmc_clock_disable(sc->sc_mclk); at91_pmc_clock_deref(sc->sc_fclk); at91_pmc_clock_deref(sc->sc_iclk); + at91_pmc_clock_deref(sc->sc_mclk); return (0); } Modified: head/sys/dev/usb/controller/ohci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/ohci_atmelarm.c Tue Aug 21 19:55:24 2012 (r239530) +++ head/sys/dev/usb/controller/ohci_atmelarm.c Tue Aug 21 20:10:59 2012 (r239531) @@ -69,6 +69,7 @@ static device_detach_t ohci_atmelarm_det struct at91_ohci_softc { struct ohci_softc sc_ohci; /* must be first */ + struct at91_pmc_clock *mclk; struct at91_pmc_clock *iclk; struct at91_pmc_clock *fclk; }; @@ -98,6 +99,7 @@ ohci_atmelarm_attach(device_t dev) USB_GET_DMA_TAG(dev), &ohci_iterate_hw_softc)) { return (ENOMEM); } + sc->mclk = at91_pmc_clock_ref("mck"); sc->iclk = at91_pmc_clock_ref("ohci_clk"); sc->fclk = at91_pmc_clock_ref("uhpck"); @@ -143,6 +145,7 @@ ohci_atmelarm_attach(device_t dev) /* * turn on the clocks from the AT91's point of view. Keep the unit in reset. */ + at91_pmc_clock_enable(sc->mclk); at91_pmc_clock_enable(sc->iclk); at91_pmc_clock_enable(sc->fclk); bus_space_write_4(sc->sc_ohci.sc_io_tag, sc->sc_ohci.sc_io_hdl, @@ -191,8 +194,10 @@ ohci_atmelarm_detach(device_t dev) at91_pmc_clock_disable(sc->fclk); at91_pmc_clock_disable(sc->iclk); + at91_pmc_clock_disable(sc->mclk); at91_pmc_clock_deref(sc->fclk); at91_pmc_clock_deref(sc->iclk); + at91_pmc_clock_deref(sc->mclk); if (sc->sc_ohci.sc_irq_res && sc->sc_ohci.sc_intr_hdl) { /* From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 20:18: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 A2E21106566C; Tue, 21 Aug 2012 20:18:01 +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 8EAC18FC0C; Tue, 21 Aug 2012 20:18: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 q7LKI17a098940; Tue, 21 Aug 2012 20:18:01 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LKI1rG098938; Tue, 21 Aug 2012 20:18:01 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201208212018.q7LKI1rG098938@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 21 Aug 2012 20:18: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: r239532 - 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: Tue, 21 Aug 2012 20:18:01 -0000 Author: hselasky Date: Tue Aug 21 20:18:01 2012 New Revision: 239532 URL: http://svn.freebsd.org/changeset/base/239532 Log: Style. Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/at91dci_atmelarm.c Tue Aug 21 20:10:59 2012 (r239531) +++ head/sys/dev/usb/controller/at91dci_atmelarm.c Tue Aug 21 20:18:01 2012 (r239532) @@ -215,7 +215,7 @@ at91_udp_attach(device_t dev) bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->sc_vbus_irq_res == NULL) { at91_pio_gpio_set_interrupt(VBUS_BASE, VBUS_MASK, 0); - device_printf(dev, "No VBUS IRQ!"); + device_printf(dev, "No VBUS IRQ!\n"); } sc->sc_dci.sc_bus.bdev = device_add_child(dev, "usbus", -1); if (!(sc->sc_dci.sc_bus.bdev)) { From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 20:40: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 36B4B106566C; Tue, 21 Aug 2012 20:40:13 +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 220758FC0A; Tue, 21 Aug 2012 20:40:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LKeCuw002011; Tue, 21 Aug 2012 20:40:12 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LKeCKf002008; Tue, 21 Aug 2012 20:40:12 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201208212040.q7LKeCKf002008@svn.freebsd.org> From: Joel Dahl Date: Tue, 21 Aug 2012 20:40: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: r239533 - head/share/man/man3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 20:40:15 -0000 Author: joel (doc committer) Date: Tue Aug 21 20:40:12 2012 New Revision: 239533 URL: http://svn.freebsd.org/changeset/base/239533 Log: Remove trailing whitespace. Modified: head/share/man/man3/pthread_getcpuclockid.3 Modified: head/share/man/man3/pthread_getcpuclockid.3 ============================================================================== --- head/share/man/man3/pthread_getcpuclockid.3 Tue Aug 21 20:18:01 2012 (r239532) +++ head/share/man/man3/pthread_getcpuclockid.3 Tue Aug 21 20:40:12 2012 (r239533) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2012 +.Dd August 21, 2012 .Dt PTHREAD_GETCPUCLOCKID 3 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 22:23: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 06469106566C; Tue, 21 Aug 2012 22:23:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5C748FC08; Tue, 21 Aug 2012 22:23: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 q7LMNHpf016926; Tue, 21 Aug 2012 22:23:17 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LMNH0K016923; Tue, 21 Aug 2012 22:23:17 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201208212223.q7LMNH0K016923@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 21 Aug 2012 22:23: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: r239544 - in head/sys/dev: cxgb/ulp/tom cxgbe/tom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 22:23:18 -0000 Author: np Date: Tue Aug 21 22:23:17 2012 New Revision: 239544 URL: http://svn.freebsd.org/changeset/base/239544 Log: Deal with the case where a syncache entry added by the TOE driver is evicted from the syncache but a later syncache_expand succeeds because of syncookies. The TOE driver has to resort to more direct means to install its hooks in the socket in this case. Modified: head/sys/dev/cxgb/ulp/tom/cxgb_listen.c head/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgb/ulp/tom/cxgb_listen.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Tue Aug 21 21:46:44 2012 (r239543) +++ head/sys/dev/cxgb/ulp/tom/cxgb_listen.c Tue Aug 21 22:23:17 2012 (r239544) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define TCPSTATES #include @@ -759,6 +760,15 @@ reset: goto reset; } + if (__predict_false(!(synqe->flags & TP_SYNQE_EXPANDED))) { + struct inpcb *new_inp = sotoinpcb(so); + + INP_WLOCK(new_inp); + tcp_timer_activate(intotcpcb(new_inp), TT_KEEP, 0); + t3_offload_socket(tod, synqe, so); + INP_WUNLOCK(new_inp); + } + /* Remove the synq entry and release its reference on the lctx */ TAILQ_REMOVE(&lctx->synq, synqe, link); inp = release_lctx(td, lctx); @@ -1136,5 +1146,6 @@ t3_offload_socket(struct toedev *tod, vo offload_socket(so, toep); make_established(so, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); update_tid(td, toep, synqe->tid); + synqe->flags |= TP_SYNQE_EXPANDED; } #endif Modified: head/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h Tue Aug 21 21:46:44 2012 (r239543) +++ head/sys/dev/cxgb/ulp/tom/cxgb_toepcb.h Tue Aug 21 22:23:17 2012 (r239544) @@ -44,6 +44,7 @@ #define TP_IS_A_SYNQ_ENTRY (1 << 9) #define TP_ABORT_RPL_SENT (1 << 10) #define TP_SEND_FIN (1 << 11) +#define TP_SYNQE_EXPANDED (1 << 12) struct toepcb { TAILQ_ENTRY(toepcb) link; /* toep_list */ Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Tue Aug 21 21:46:44 2012 (r239543) +++ head/sys/dev/cxgbe/tom/t4_listen.c Tue Aug 21 22:23:17 2012 (r239544) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define TCPSTATES #include @@ -805,6 +806,7 @@ t4_offload_socket(struct toedev *tod, vo make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); toep->flags |= TPF_CPL_PENDING; update_tid(sc, synqe->tid, toep); + synqe->flags |= TPF_SYNQE_EXPANDED; } static inline void @@ -1349,6 +1351,24 @@ reset: goto reset; } + /* + * This is for the unlikely case where the syncache entry that we added + * has been evicted from the syncache, but the syncache_expand above + * works because of syncookies. + * + * XXX: we've held the tcbinfo lock throughout so there's no risk of + * anyone accept'ing a connection before we've installed our hooks, but + * this somewhat defeats the purpose of having a tod_offload_socket :-( + */ + if (__predict_false(!(synqe->flags & TPF_SYNQE_EXPANDED))) { + struct inpcb *new_inp = sotoinpcb(so); + + INP_WLOCK(new_inp); + tcp_timer_activate(intotcpcb(new_inp), TT_KEEP, 0); + t4_offload_socket(TOEDEV(ifp), synqe, so); + INP_WUNLOCK(new_inp); + } + /* Done with the synqe */ TAILQ_REMOVE(&lctx->synq, synqe, link); inp = release_lctx(sc, lctx); Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Tue Aug 21 21:46:44 2012 (r239543) +++ head/sys/dev/cxgbe/tom/t4_tom.h Tue Aug 21 22:23:17 2012 (r239544) @@ -66,6 +66,7 @@ enum { TPF_SYNQE = (1 << 8), /* synq_entry, not really a toepcb */ TPF_SYNQE_NEEDFREE = (1 << 9), /* synq_entry was malloc'd separately */ TPF_SYNQE_TCPDDP = (1 << 10), /* ulp_mode TCPDDP in toepcb */ + TPF_SYNQE_EXPANDED = (1 << 11), /* toepcb ready, tid context updated */ }; enum { From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 22:28: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 1AAC1106566C; Tue, 21 Aug 2012 22:28:15 +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 04CCC8FC08; Tue, 21 Aug 2012 22:28: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 q7LMSESl017772; Tue, 21 Aug 2012 22:28:14 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LMSEPO017765; Tue, 21 Aug 2012 22:28:14 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208212228.q7LMSEPO017765@svn.freebsd.org> From: Jim Harris Date: Tue, 21 Aug 2012 22: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: r239545 - in head/sys/dev/isci: . scil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 22:28:15 -0000 Author: jimharris Date: Tue Aug 21 22:28:14 2012 New Revision: 239545 URL: http://svn.freebsd.org/changeset/base/239545 Log: Fix/add support for SCSI UNMAP to ATA DSM translation. This addresses kernel panic observed when sending SCSI UNMAP commands to SATA disks attached to isci(4). 1) Flesh out callback routines to allocate/free buffers needed for translating SCSI UNMAP data to ATA DSM data. 2) Add controller-level pool for storing buffers previously allocated for UNMAP translation, to lessen chance of no buffer available under memory pressure. 3) Ensure driver properly handles case where buffer pool is empty and contigmalloc returns NULL. Sponsored by: Intel Reported by: Maksim Yevmenkin Discussed with: scottl MFC after: 3 days Modified: head/sys/dev/isci/isci.c head/sys/dev/isci/isci.h head/sys/dev/isci/isci_controller.c head/sys/dev/isci/scil/sati_unmap.c head/sys/dev/isci/scil/scif_sas_sati_binding.h head/sys/dev/isci/scil/scif_sas_stp_io_request.c Modified: head/sys/dev/isci/isci.c ============================================================================== --- head/sys/dev/isci/isci.c Tue Aug 21 22:23:17 2012 (r239544) +++ head/sys/dev/isci/isci.c Tue Aug 21 22:28:14 2012 (r239545) @@ -185,6 +185,7 @@ isci_detach(device_t device) for (i = 0; i < isci->controller_count; i++) { struct ISCI_CONTROLLER *controller = &isci->controllers[i]; SCI_STATUS status; + void *unmap_buffer; if (controller->scif_controller_handle != NULL) { scic_controller_disable_interrupts( @@ -218,6 +219,13 @@ isci_detach(device_t device) if (controller->remote_device_memory != NULL) free(controller->remote_device_memory, M_ISCI); + + while (1) { + sci_pool_get(controller->unmap_buffer_pool, unmap_buffer); + if (unmap_buffer == NULL) + break; + contigfree(unmap_buffer, PAGE_SIZE, M_ISCI); + } } /* The SCIF controllers have been stopped, so we can now Modified: head/sys/dev/isci/isci.h ============================================================================== --- head/sys/dev/isci/isci.h Tue Aug 21 22:23:17 2012 (r239544) +++ head/sys/dev/isci/isci.h Tue Aug 21 22:28:14 2012 (r239545) @@ -175,6 +175,7 @@ struct ISCI_CONTROLLER SCI_POOL_CREATE(remote_device_pool, struct ISCI_REMOTE_DEVICE *, SCI_MAX_REMOTE_DEVICES); SCI_POOL_CREATE(request_pool, struct ISCI_REQUEST *, SCI_MAX_IO_REQUESTS); SCI_POOL_CREATE(timer_pool, struct ISCI_TIMER *, SCI_MAX_TIMERS); + SCI_POOL_CREATE(unmap_buffer_pool, void *, SCI_MAX_REMOTE_DEVICES); }; struct ISCI_REQUEST Modified: head/sys/dev/isci/isci_controller.c ============================================================================== --- head/sys/dev/isci/isci_controller.c Tue Aug 21 22:23:17 2012 (r239544) +++ head/sys/dev/isci/isci_controller.c Tue Aug 21 22:28:14 2012 (r239545) @@ -145,6 +145,14 @@ void scif_cb_controller_stop_complete(SC isci_controller->is_started = FALSE; } +static void +isci_single_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) +{ + SCI_PHYSICAL_ADDRESS *phys_addr = arg; + + *phys_addr = seg[0].ds_addr; +} + /** * @brief This method will be invoked to allocate memory dynamically. * @@ -159,7 +167,29 @@ void scif_cb_controller_stop_complete(SC void scif_cb_controller_allocate_memory(SCI_CONTROLLER_HANDLE_T controller, SCI_PHYSICAL_MEMORY_DESCRIPTOR_T *mde) { + struct ISCI_CONTROLLER *isci_controller = (struct ISCI_CONTROLLER *) + sci_object_get_association(controller); + /* + * Note this routine is only used for buffers needed to translate + * SCSI UNMAP commands to ATA DSM commands for SATA disks. + * + * We first try to pull a buffer from the controller's pool, and only + * call contigmalloc if one isn't there. + */ + if (!sci_pool_empty(isci_controller->unmap_buffer_pool)) { + sci_pool_get(isci_controller->unmap_buffer_pool, + mde->virtual_address); + } else + mde->virtual_address = contigmalloc(PAGE_SIZE, + M_ISCI, M_NOWAIT, 0, BUS_SPACE_MAXADDR, + mde->constant_memory_alignment, 0); + + if (mde->virtual_address != NULL) + bus_dmamap_load(isci_controller->buffer_dma_tag, + NULL, mde->virtual_address, PAGE_SIZE, + isci_single_map, &mde->physical_address, + BUS_DMA_NOWAIT); } /** @@ -176,7 +206,16 @@ void scif_cb_controller_allocate_memory( void scif_cb_controller_free_memory(SCI_CONTROLLER_HANDLE_T controller, SCI_PHYSICAL_MEMORY_DESCRIPTOR_T * mde) { + struct ISCI_CONTROLLER *isci_controller = (struct ISCI_CONTROLLER *) + sci_object_get_association(controller); + /* + * Put the buffer back into the controller's buffer pool, rather + * than invoking configfree. This helps reduce chance we won't + * have buffers available when system is under memory pressure. + */ + sci_pool_put(isci_controller->unmap_buffer_pool, + mde->virtual_address); } void isci_controller_construct(struct ISCI_CONTROLLER *controller, @@ -228,6 +267,8 @@ void isci_controller_construct(struct IS for ( int i = 0; i < SCI_MAX_TIMERS; i++ ) { sci_pool_put(controller->timer_pool, timer++); } + + sci_pool_initialize(controller->unmap_buffer_pool); } SCI_STATUS isci_controller_initialize(struct ISCI_CONTROLLER *controller) Modified: head/sys/dev/isci/scil/sati_unmap.c ============================================================================== --- head/sys/dev/isci/scil/sati_unmap.c Tue Aug 21 22:23:17 2012 (r239544) +++ head/sys/dev/isci/scil/sati_unmap.c Tue Aug 21 22:28:14 2012 (r239545) @@ -335,8 +335,8 @@ SATI_STATUS sati_unmap_initial_processin sati_scsi_sense_data_construct( sequence, scsi_io, - SCSI_STATUS_CHECK_CONDITION, - SCSI_SENSE_ABORTED_COMMAND, + SCSI_STATUS_BUSY, + SCSI_SENSE_NO_SENSE, SCSI_ASC_NO_ADDITIONAL_SENSE, SCSI_ASCQ_NO_ADDITIONAL_SENSE ); Modified: head/sys/dev/isci/scil/scif_sas_sati_binding.h ============================================================================== --- head/sys/dev/isci/scil/scif_sas_sati_binding.h Tue Aug 21 22:23:17 2012 (r239544) +++ head/sys/dev/isci/scil/scif_sas_sati_binding.h Tue Aug 21 22:28:14 2012 (r239545) @@ -183,22 +183,16 @@ extern "C" { { \ SCIF_SAS_REQUEST_T* fw_request = (SCIF_SAS_REQUEST_T*)scsi_io; \ SCI_PHYSICAL_MEMORY_DESCRIPTOR_T mde; \ - SCI_PHYSICAL_ADDRESS phys_addr; \ mde.virtual_address = NULL; \ - sci_cb_make_physical_address(mde.physical_address, 0, 0); \ sci_base_mde_construct( \ &mde, 4, length, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS \ ); \ scif_cb_controller_allocate_memory( \ fw_request->device->domain->controller, &mde \ ); \ - scic_cb_io_request_get_physical_address(fw_request->device->domain->controller, \ - NULL, \ - mde.virtual_address, \ - &phys_addr); \ *(virt_address) = mde.virtual_address; \ - *(phys_address_low) = sci_cb_physical_address_lower(phys_addr); \ - *(phys_address_high) = sci_cb_physical_address_upper(phys_addr); \ + *(phys_address_low) = sci_cb_physical_address_lower(mde.physical_address); \ + *(phys_address_high) = sci_cb_physical_address_upper(mde.physical_address); \ } #define sati_cb_free_dma_buffer(scsi_io, virt_address) \ @@ -206,7 +200,6 @@ extern "C" { SCIF_SAS_REQUEST_T* fw_request = (SCIF_SAS_REQUEST_T*)scsi_io; \ SCI_PHYSICAL_MEMORY_DESCRIPTOR_T mde; \ mde.virtual_address = virt_address; \ - sci_cb_make_physical_address(mde.physical_address, 0, 0); \ sci_base_mde_construct( \ &mde, 4, 0, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS \ ); \ Modified: head/sys/dev/isci/scil/scif_sas_stp_io_request.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_stp_io_request.c Tue Aug 21 22:23:17 2012 (r239544) +++ head/sys/dev/isci/scil/scif_sas_stp_io_request.c Tue Aug 21 22:28:14 2012 (r239545) @@ -171,6 +171,8 @@ SCI_STATUS scif_sas_stp_io_request_const ); } + sati_sequence_terminate(&fw_io->parent.stp.sequence, fw_io, fw_io); + return SCI_SUCCESS; } /** From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 22:29: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 4A84C106564A; Tue, 21 Aug 2012 22:29:46 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id D56DE8FC19; Tue, 21 Aug 2012 22:29:45 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 3F6083592ED; Wed, 22 Aug 2012 00:29:44 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 24B092847B; Wed, 22 Aug 2012 00:29:44 +0200 (CEST) Date: Wed, 22 Aug 2012 00:29:44 +0200 From: Jilles Tjoelker To: "Simon J. Gerraty" Message-ID: <20120821222943.GA27203@stack.nl> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120821053519.BD5A158085@chaos.jnpr.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ruslan Ermilov , "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 22:29:46 -0000 On Mon, Aug 20, 2012 at 10:35:19PM -0700, Simon J. Gerraty wrote: > Hi, sorry about the slow response. > On Thu, 26 Jul 2012 12:49:03 +0400, Ruslan Ermilov writes: > >On Wed, Jul 18, 2012 at 05:57:43AM +0000, David E. O'Brien wrote: > >> Author: obrien > >> Date: Wed Jul 18 05:57:42 2012 > >> New Revision: 238563 > >> URL: http://svn.freebsd.org/changeset/base/238563 > >> Log: > >> a ";" tells make we want the shell to be used > >> Submitted by: Simon Gerraty > >> Modified: > >> head/gnu/usr.bin/groff/tmac/Makefile > >I don't quite understand what this change does, could you elaborate? > Sure. This is a consequence of bmake trying to be clever. > >Without -jN (in backwards compatibility mode), the "cd" is a no-op > >(whether it's terminated by `;' or not) because make will execute a > >single shell per command, with cwd set to ${.OBJDIR}. > Except on very weird systems, bmake is built in what NetBSD call > "native" mode, and even in compat mode will attempt to avoid the > overhead of all those shells. > Thus, unless it spots a shell meta char, it will try and skip the shell. > Shell builtins like 'cd' or 'chdir' cannot be directly invoked, but make > doesn't know that. Simply adding the ';' convinces it to use a shell. > It is still a no-op. On FreeBSD, the first two statements are partially false. All sh(1) builtins that correspond to utilities specified by POSIX (but not special builtins) have versions accessible to execve() (on 8.x and older, hash, type and ulimit are missing). This includes cd but not chdir, since chdir is not specified by POSIX. Also, FreeBSD make includes a somewhat arbitrary list of shell builtins, including cd, that cause it to invoke the shell even if there are no metacharacters. This list of shell builtins should probably be replaced with the list of POSIX special builtins, which are break continue eval exec exit export readonly return set shift times trap unset . : There is a portability issue in that a few systems refuse to comply to the part of POSIX (XCU 1.6 Built-In Utilities) that says that all specified utilities (except special builtins) shall be accessible via exec functions, env, find, nice, nohup, time, xargs. Working around this requires knowing which utilities are "generally" only provided as builtins. > >With -jN, "cd" becomes necessary because all commands are executed as > >a script by one shell (the reason it was added in the first place), > >but adding `;' is a no-op because commands are on separate lines. > A better way to construct targets like this is to put any excursion out > of .OBJDIR inside (): > (cd ${.CURDIR} && \ > ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ > koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR}) > then the cd ${.OBJDIR} isn't needed at all. > note use of && rather than ; which can be very dangerous This method makes more sense and should hardly cost any performance. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 23:26: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 DB1C81065673; Tue, 21 Aug 2012 23:26:15 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og110.obsmtp.com (exprod7og110.obsmtp.com [64.18.2.173]) by mx1.freebsd.org (Postfix) with ESMTP id CA3EB8FC1C; Tue, 21 Aug 2012 23:26:11 +0000 (UTC) Received: from P-EMHUB03-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob110.postini.com ([64.18.6.12]) with SMTP ID DSNKUDQZDQ8Y6OQwfaPLyzQPy9Db3Bt0vfTX@postini.com; Tue, 21 Aug 2012 16:26:14 PDT Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB03-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Tue, 21 Aug 2012 16:25:53 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q7LNPrh29756; Tue, 21 Aug 2012 16:25:53 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 35D4F58085; Tue, 21 Aug 2012 16:25:53 -0700 (PDT) To: Jilles Tjoelker In-Reply-To: <20120821222943.GA27203@stack.nl> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> <20120821222943.GA27203@stack.nl> Comments: In-reply-to: Jilles Tjoelker message dated "Wed, 22 Aug 2012 00:29:44 +0200." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Tue, 21 Aug 2012 16:25:53 -0700 Message-ID: <20120821232553.35D4F58085@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, "David E. O'Brien" , sjg@juniper.net, Ruslan Ermilov , svn-src-head@FreeBSD.org Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 23:26:16 -0000 On Wed, 22 Aug 2012 00:29:44 +0200, Jilles Tjoelker writes: >On FreeBSD, the first two statements are partially false. All sh(1) >builtins that correspond to utilities specified by POSIX (but not >special builtins) have versions accessible to execve() (on 8.x and That's interesting, especially for 'cd', though is there any use case in which it is actually useful? I'm drawing a blank. >older, hash, type and ulimit are missing). This includes cd but not >chdir, since chdir is not specified by POSIX. Also, FreeBSD make >includes a somewhat arbitrary list of shell builtins, including cd, that >cause it to invoke the shell even if there are no metacharacters. Yes, I pondered whether something like that might be worthwhile, but since a bare 'cd somewhere' all by itself is rather pointless, it seemed a corner case. >> A better way to construct targets like this is to put any excursion out >> of .OBJDIR inside (): > >> (cd ${.CURDIR} && \ >> ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ >> koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR}) > >> then the cd ${.OBJDIR} isn't needed at all. >> note use of && rather than ; which can be very dangerous > >This method makes more sense and should hardly cost any performance. Agreed. From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 23:44: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 471F6106564A; Tue, 21 Aug 2012 23:44:48 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 327D28FC15; Tue, 21 Aug 2012 23:44: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 q7LNimL6028153; Tue, 21 Aug 2012 23:44:48 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LNilhA028150; Tue, 21 Aug 2012 23:44:47 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208212344.q7LNilhA028150@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 21 Aug 2012 23: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: r239547 - 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: Tue, 21 Aug 2012 23:44:48 -0000 Author: gonzo Date: Tue Aug 21 23:44:47 2012 New Revision: 239547 URL: http://svn.freebsd.org/changeset/base/239547 Log: Get rid of ARM_BIG_ENDIAN for good: - remove leftovers in Makefile.arm - Let ld use default output format instead of providing one in ldscript Modified: head/sys/conf/Makefile.arm head/sys/conf/ldscript.arm Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Tue Aug 21 22:42:46 2012 (r239546) +++ head/sys/conf/Makefile.arm Tue Aug 21 23:44:47 2012 (r239547) @@ -35,17 +35,6 @@ INCLUDES+= -I$S/contrib/libfdt SYSTEM_LD:= ${SYSTEM_LD:$S/conf/ldscript.$M=ldscript.$M} SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscript.$M=ldscript.$M} -.if defined(ARM_BIG_ENDIAN) -CC += -mbig-endian -SYSTEM_LD += -EB -LD += -EB -.else -CC += -mlittle-endian -SYSTEM_LD += -EL -LD += -EL -.endif - - .if !defined(DEBUG) && !defined(PROFLEVEL) STRIP_FLAGS = -S .endif Modified: head/sys/conf/ldscript.arm ============================================================================== --- head/sys/conf/ldscript.arm Tue Aug 21 22:42:46 2012 (r239546) +++ head/sys/conf/ldscript.arm Tue Aug 21 23:44:47 2012 (r239547) @@ -1,5 +1,4 @@ /* $FreeBSD$ */ -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) From owner-svn-src-head@FreeBSD.ORG Tue Aug 21 23:55: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 E403D106566C; Tue, 21 Aug 2012 23:55:29 +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 CF1848FC0A; Tue, 21 Aug 2012 23:55: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 q7LNtTAZ029597; Tue, 21 Aug 2012 23:55:29 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LNtTh6029594; Tue, 21 Aug 2012 23:55:29 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201208212355.q7LNtTh6029594@svn.freebsd.org> From: Justin Hibbits Date: Tue, 21 Aug 2012 23:55: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: r239548 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Aug 2012 23:55:30 -0000 Author: jhibbits Date: Tue Aug 21 23:55:29 2012 New Revision: 239548 URL: http://svn.freebsd.org/changeset/base/239548 Log: phandle_t is unsigned, and OF_finddevice() returns (phandle_t)(-1) on failure, so check for that instead of 0. While here, provide a better description for ATI backlight driver. Reported by: jchandra@ MFC after: 3 days Modified: head/sys/powerpc/powermac/atibl.c head/sys/powerpc/powermac/nvbl.c Modified: head/sys/powerpc/powermac/atibl.c ============================================================================== --- head/sys/powerpc/powermac/atibl.c Tue Aug 21 23:44:47 2012 (r239547) +++ head/sys/powerpc/powermac/atibl.c Tue Aug 21 23:55:29 2012 (r239548) @@ -98,7 +98,7 @@ atibl_probe(device_t dev) handle = OF_finddevice("mac-io/backlight"); - if (handle <= 0) + if (handle == -1) return (ENXIO); if (OF_getprop(handle, "backlight-control", &control, sizeof(control)) < 0) @@ -107,7 +107,7 @@ atibl_probe(device_t dev) if (strcmp(control, "ati") != 0) return (ENXIO); - device_set_desc(dev, "PowerBook backlight"); + device_set_desc(dev, "PowerBook backlight for ATI graphics"); return (0); } Modified: head/sys/powerpc/powermac/nvbl.c ============================================================================== --- head/sys/powerpc/powermac/nvbl.c Tue Aug 21 23:44:47 2012 (r239547) +++ head/sys/powerpc/powermac/nvbl.c Tue Aug 21 23:55:29 2012 (r239548) @@ -94,7 +94,7 @@ nvbl_probe(device_t dev) handle = OF_finddevice("mac-io/backlight"); - if (handle <= 0) + if (handle == -1) return (ENXIO); if (OF_getprop(handle, "backlight-control", &control, sizeof(control)) < 0) From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 00:06: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 A3BA41065672; Wed, 22 Aug 2012 00:06:51 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 038778FC0C; Wed, 22 Aug 2012 00:06:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q7M06lGR055020; Wed, 22 Aug 2012 04:06:48 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q7M06lkt055019; Wed, 22 Aug 2012 04:06:47 +0400 (MSK) (envelope-from ache) Date: Wed, 22 Aug 2012 04:06:46 +0400 From: Andrey Chernov To: Hajimu UMEMOTO Message-ID: <20120822000645.GA54651@vniz.net> Mail-Followup-To: Andrey Chernov , Hajimu UMEMOTO , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> <20120821063027.GA41459@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r239356 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Aug 2012 00:06:51 -0000 On Tue, Aug 21, 2012 at 03:58:12PM +0900, Hajimu UMEMOTO wrote: > Okay, thanks. I solve this riddle, thanks to your helpful tips. Relevant part of my setup are at the end of this messae for anybody who may have the same problem. BTW, I notice that link-local router address behavior is strange and inconsistant for both 'host -6' and 'dig -6' commands. host -6 example.com fe80:: dig -6 @fe80:: example.com both hangs, but in the same time host -6 example.com fe80::% dig -6 @fe80::% example.com works! host -6 example.com fe80::%1 dig -6 #fe80::%1 example.com works too. Not understanding addresses without % or %1 looks like routing problems, but I don't know where to fix it. So, I try to use nameserver fe80::% (or with %1 suffix) in my resolv.conf, as result host -6 example.com dig -6 example.com (without NS specified) both hangs despite they working when exact the same NS address is given in their command lines. So, I finally decide to use my router addres from IPv6 /64 subnet (given by my tunnel). It not goes through the whole tunnel, but directly to the router. host -6 example.com dig -6 example.com both works when it exists in /etc/reslov.conf. What I don't understand why all that bad things happens with link-local router address. To be sure I test it under Win7 and it works normally. Finally, what is working: /etc/resolvconf.conf: name_servers_append= /etc/rc.conf: rtsol_flags="-R /etc/eat.sh" /etc/eat.sh: #!/bin/sh /bin/cat > /dev/null -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 05:15: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 B1411106564A; Wed, 22 Aug 2012 05:15:00 +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 979918FC0A; Wed, 22 Aug 2012 05:15: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 q7M5F0Md070932; Wed, 22 Aug 2012 05:15:00 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M5F0bX070928; Wed, 22 Aug 2012 05:15:00 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201208220515.q7M5F0bX070928@svn.freebsd.org> From: Tim Kientzle Date: Wed, 22 Aug 2012 05:15: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: r239553 - head/sys/arm/ti X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Aug 2012 05:15:00 -0000 Author: kientzle Date: Wed Aug 22 05:14:59 2012 New Revision: 239553 URL: http://svn.freebsd.org/changeset/base/239553 Log: After r239366, fix the ti_edma3.c driver to use the exact name as used in the FDT. Modified: head/sys/arm/ti/ti_edma3.c Modified: head/sys/arm/ti/ti_edma3.c ============================================================================== --- head/sys/arm/ti/ti_edma3.c Wed Aug 22 03:00:57 2012 (r239552) +++ head/sys/arm/ti/ti_edma3.c Wed Aug 22 05:14:59 2012 (r239553) @@ -142,7 +142,7 @@ static struct { static int ti_edma3_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "ti,edma")) + if (!ofw_bus_is_compatible(dev, "ti,edma3")) return (ENXIO); device_set_desc(dev, "TI EDMA Controller"); From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 06:37: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 5F5741065672; Wed, 22 Aug 2012 06:37:31 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A7078FC1B; Wed, 22 Aug 2012 06:37: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 q7M6bVCS082112; Wed, 22 Aug 2012 06:37:31 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7M6bVb3082106; Wed, 22 Aug 2012 06:37:31 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201208220637.q7M6bVb3082106@svn.freebsd.org> From: Hiroki Sato Date: Wed, 22 Aug 2012 06:37: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: r239562 - head/usr.sbin/makefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Aug 2012 06:37:31 -0000 Author: hrs Date: Wed Aug 22 06:37:30 2012 New Revision: 239562 URL: http://svn.freebsd.org/changeset/base/239562 Log: Add -p flag to create the image as a sparse file. Submitted by: Shesha Sreenivasamurthy PR: bin/167779 Modified: head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/makefs.8 head/usr.sbin/makefs/makefs.c head/usr.sbin/makefs/makefs.h Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Wed Aug 22 05:38:06 2012 (r239561) +++ head/usr.sbin/makefs/ffs.c Wed Aug 22 06:37:30 2012 (r239562) @@ -493,13 +493,25 @@ ffs_create_image(const char *image, fsin bufsize = sfs.f_iosize; #endif bufrem = fsopts->size; - if (debug & DEBUG_FS_CREATE_IMAGE) - printf( - "zero-ing image `%s', %lld sectors, using %d byte chunks\n", - image, (long long)bufrem, bufsize); - if ((buf = calloc(1, bufsize)) == NULL) { - warn("Can't create buffer for sector"); - return (-1); + if (fsopts->sparse) { + if (ftruncate(fsopts->fd, bufrem) == -1) { + warn("sparse option disabled.\n"); + fsopts->sparse = 0; + } + } + if (fsopts->sparse) { + /* File truncated at bufrem. Remaining is 0 */ + bufrem = 0; + buf = NULL; + } else { + if (debug & DEBUG_FS_CREATE_IMAGE) + printf("zero-ing image `%s', %lld sectors, " + "using %d byte chunks\n", image, (long long)bufrem, + bufsize); + if ((buf = calloc(1, bufsize)) == NULL) { + warn("Can't create buffer for sector"); + return (-1); + } } while (bufrem > 0) { i = write(fsopts->fd, buf, MIN(bufsize, bufrem)); @@ -511,7 +523,8 @@ ffs_create_image(const char *image, fsin } bufrem -= i; } - free(buf); + if (buf) + free(buf); /* make the file system */ if (debug & DEBUG_FS_CREATE_IMAGE) Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Wed Aug 22 05:38:06 2012 (r239561) +++ head/usr.sbin/makefs/makefs.8 Wed Aug 22 06:37:30 2012 (r239562) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2012 +.Dd August 22, 2012 .Dt MAKEFS 8 .Os .Sh NAME @@ -43,6 +43,7 @@ .Nd create a file system image from a directory tree or a mtree manifest .Sh SYNOPSIS .Nm +.Op Fl p .Op Fl x .Op Fl B Ar byte-order .Op Fl b Ar free-blocks @@ -188,6 +189,8 @@ Set file system specific options. .Ar fs-options is a comma separated list of options. Valid file system specific options are detailed below. +.It Fl p +Create the image as a sparse file. .It Fl S Ar sector-size Set the file system sector size to .Ar sector-size . Modified: head/usr.sbin/makefs/makefs.c ============================================================================== --- head/usr.sbin/makefs/makefs.c Wed Aug 22 05:38:06 2012 (r239561) +++ head/usr.sbin/makefs/makefs.c Wed Aug 22 06:37:30 2012 (r239562) @@ -112,7 +112,7 @@ main(int argc, char *argv[]) start_time.tv_sec = start.tv_sec; start_time.tv_nsec = start.tv_usec * 1000; - while ((ch = getopt(argc, argv, "B:b:d:f:F:M:m:N:o:s:S:t:x")) != -1) { + while ((ch = getopt(argc, argv, "B:b:d:f:F:M:m:N:o:ps:S:t:x")) != -1) { switch (ch) { case 'B': @@ -199,6 +199,9 @@ main(int argc, char *argv[]) } break; } + case 'p': + fsoptions.sparse = 1; + break; case 's': fsoptions.minsize = fsoptions.maxsize = @@ -346,7 +349,7 @@ usage(void) fprintf(stderr, "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n" -"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x]\n" +"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x] [-p]\n" "\t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", prog); exit(1); Modified: head/usr.sbin/makefs/makefs.h ============================================================================== --- head/usr.sbin/makefs/makefs.h Wed Aug 22 05:38:06 2012 (r239561) +++ head/usr.sbin/makefs/makefs.h Wed Aug 22 06:37:30 2012 (r239562) @@ -129,6 +129,7 @@ typedef struct { int freeblockpc; /* free block % */ int needswap; /* non-zero if byte swapping needed */ int sectorsize; /* sector size */ + int sparse; /* sparse image, don't fill it with zeros */ void *fs_specific; /* File system specific additions. */ } fsinfo_t; From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 10:17: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 59908106566C; Wed, 22 Aug 2012 10:17:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id CA8DD8FC0A; Wed, 22 Aug 2012 10:17:06 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q7MAH5El033843; Wed, 22 Aug 2012 14:17:05 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q7MAH5TS033842; Wed, 22 Aug 2012 14:17:05 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 22 Aug 2012 14:17:05 +0400 From: Gleb Smirnoff To: "Kenneth D. Merry" Message-ID: <20120822101705.GL20560@FreeBSD.org> References: <201208021357.q72DvoFJ088426@svn.freebsd.org> <20120821185014.GA28272@nargothrond.kdm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120821185014.GA28272@nargothrond.kdm.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238990 - in head/sys: net 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, 22 Aug 2012 10:17:07 -0000 On Tue, Aug 21, 2012 at 12:50:14PM -0600, Kenneth D. Merry wrote: K> On Thu, Aug 02, 2012 at 13:57:50 +0000, Gleb Smirnoff wrote: K> > Author: glebius K> > Date: Thu Aug 2 13:57:49 2012 K> > New Revision: 238990 K> > URL: http://svn.freebsd.org/changeset/base/238990 K> > K> > Log: K> > Fix races between in_lltable_prefix_free(), lla_lookup(), K> > llentry_free() and arptimer(): K> > K> > o Use callout_init_rw() for lle timeout, this allows us safely K> > disestablish them. K> > - This allows us to simplify the arptimer() and make it K> > race safe. K> > o Consistently use ifp->if_afdata_lock to lock access to K> > linked lists in the lle hashes. K> > o Introduce new lle flag LLE_LINKED, which marks an entry that K> > is attached to the hash. K> > - Use LLE_LINKED to avoid double unlinking via consequent K> > calls to llentry_free(). K> > - Mark lle with LLE_DELETED via |= operation istead of =, K> > so that other flags won't be lost. K> > o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more K> > consistent and provide more informative KASSERTs. K> > K> > The patch is a collaborative work of all submitters and myself. K> > K> > PR: kern/165863 K> > Submitted by: Andrey Zonov K> > Submitted by: Ryan Stone K> > Submitted by: Eric van Gyzen K> K> I'm running into this on stable/9, any plan on when this will get MFCed? I'm sorry, but after 9.1-RELEASE. Too large change to run MFC prior to release. I'd appreciate if you patch your stable/9 system manually and thus perform some testing prior to merge. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 11:45: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 BEC631065672; Wed, 22 Aug 2012 11:45:00 +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 38B278FC0A; Wed, 22 Aug 2012 11:44:59 +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 q7MBj5gt057748; Wed, 22 Aug 2012 14:45:05 +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 q7MBiqkR003085; Wed, 22 Aug 2012 14:44:52 +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 q7MBiqLs003084; Wed, 22 Aug 2012 14:44:52 +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: Wed, 22 Aug 2012 14:44:52 +0300 From: Konstantin Belousov To: Gleb Smirnoff Message-ID: <20120822114452.GC33100@deviant.kiev.zoral.com.ua> References: <201208021357.q72DvoFJ088426@svn.freebsd.org> <20120821185014.GA28272@nargothrond.kdm.org> <20120822101705.GL20560@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4ehG9HxkuyoI6jtY" Content-Disposition: inline In-Reply-To: <20120822101705.GL20560@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, "Kenneth D. Merry" Subject: Re: svn commit: r238990 - in head/sys: net 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, 22 Aug 2012 11:45:01 -0000 --4ehG9HxkuyoI6jtY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 22, 2012 at 02:17:05PM +0400, Gleb Smirnoff wrote: > On Tue, Aug 21, 2012 at 12:50:14PM -0600, Kenneth D. Merry wrote: > K> On Thu, Aug 02, 2012 at 13:57:50 +0000, Gleb Smirnoff wrote: > K> > Author: glebius > K> > Date: Thu Aug 2 13:57:49 2012 > K> > New Revision: 238990 > K> > URL: http://svn.freebsd.org/changeset/base/238990 > K> >=20 > K> > Log: > K> > Fix races between in_lltable_prefix_free(), lla_lookup(), > K> > llentry_free() and arptimer(): > K> > =20 > K> > o Use callout_init_rw() for lle timeout, this allows us safely > K> > disestablish them. > K> > - This allows us to simplify the arptimer() and make it > K> > race safe. > K> > o Consistently use ifp->if_afdata_lock to lock access to > K> > linked lists in the lle hashes. > K> > o Introduce new lle flag LLE_LINKED, which marks an entry that > K> > is attached to the hash. > K> > - Use LLE_LINKED to avoid double unlinking via consequent > K> > calls to llentry_free(). > K> > - Mark lle with LLE_DELETED via |=3D operation istead of =3D, > K> > so that other flags won't be lost. > K> > o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more > K> > consistent and provide more informative KASSERTs. > K> > =20 > K> > The patch is a collaborative work of all submitters and myself. > K> > =20 > K> > PR: kern/165863 > K> > Submitted by: Andrey Zonov > K> > Submitted by: Ryan Stone > K> > Submitted by: Eric van Gyzen > K>=20 > K> I'm running into this on stable/9, any plan on when this will get MFCe= d? >=20 > I'm sorry, but after 9.1-RELEASE. Too large change to run MFC prior to > release. >=20 > I'd appreciate if you patch your stable/9 system manually and thus > perform some testing prior to merge. FYI, 9.1 was already branched. Not that I encourage you to make a commit that would diverge the stable/9 from releng/9.1 while 9.1 is still rolling. But the stall on stable/9 due to freeze was too long and IMO its longevity is damaging. --4ehG9HxkuyoI6jtY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlA0xjQACgkQC3+MBN1Mb4hYFACdHdKc9PtlFDgJnhctZHQ8m4m8 BRUAn1+Pmt4sz+d+ASkEg0eZlZJ2wAMl =vVzQ -----END PGP SIGNATURE----- --4ehG9HxkuyoI6jtY-- From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 13:53: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 3DEF1106564A; Wed, 22 Aug 2012 13:53:38 +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 0EE918FC15; Wed, 22 Aug 2012 13:53: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 q7MDrbpV039554; Wed, 22 Aug 2012 13:53:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MDrbYB039551; Wed, 22 Aug 2012 13:53:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208221353.q7MDrbYB039551@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Aug 2012 13:53: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: r239564 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Aug 2012 13:53:38 -0000 Author: jhb Date: Wed Aug 22 13:53:37 2012 New Revision: 239564 URL: http://svn.freebsd.org/changeset/base/239564 Log: Revert r239356 and use an alternate algorithm. First, don't exit when the link goes down on an interface. Instead, teach dhclient to track changes in link state and to enter the reboot state when the link on an interface goes up causing dhclient to attempt to renew its existing lease. Second, remove the change I added to clear the old lease when dhclient exits due to an error (such as ifconfig down). If an interface is using autoconfiguration it should keep its autoconfiguration as much as possible. If the next time it needs a configuration it is able to reuse the previous autoconfiguration, then leaving the settings intact allows existing connections to survive temporary outages, etc. PR: bin/166656 MFC after: 1 month Modified: head/sbin/dhclient/dhclient.c head/sbin/dhclient/dhcpd.h Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Aug 22 08:27:37 2012 (r239563) +++ head/sbin/dhclient/dhclient.c Wed Aug 22 13:53:37 2012 (r239564) @@ -218,6 +218,7 @@ routehandler(struct protocol *p) struct sockaddr *sa; struct iaddr a; ssize_t n; + int linkstat; n = read(routefd, &msg, sizeof(msg)); rtm = (struct rt_msghdr *)msg; @@ -278,10 +279,14 @@ routehandler(struct protocol *p) ifi->name); goto die; } - if (!interface_link_status(ifi->name)) { - warning("Interface %s is down, dhclient exiting", - ifi->name); - goto die; + linkstat = interface_link_status(ifi->name); + if (linkstat != ifi->linkstat) { + debug("%s link state %s -> %s", ifi->name, + ifi->linkstat ? "up" : "down", + linkstat ? "up" : "down"); + ifi->linkstat = linkstat; + if (linkstat) + state_reboot(ifi); } break; case RTM_IFANNOUNCE: @@ -321,8 +326,6 @@ routehandler(struct protocol *p) die: script_init("FAIL", NULL); - if (ifi->client->active) - script_write_params("old_", ifi->client->active); if (ifi->client->alias) script_write_params("alias_", ifi->client->alias); script_go(); @@ -437,6 +440,7 @@ main(int argc, char *argv[]) } fprintf(stderr, " got link\n"); } + ifi->linkstat = 1; if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1) error("cannot open %s: %m", _PATH_DEVNULL); Modified: head/sbin/dhclient/dhcpd.h ============================================================================== --- head/sbin/dhclient/dhcpd.h Wed Aug 22 08:27:37 2012 (r239563) +++ head/sbin/dhclient/dhcpd.h Wed Aug 22 13:53:37 2012 (r239564) @@ -208,6 +208,7 @@ struct interface_info { int errors; int dead; u_int16_t index; + int linkstat; }; struct timeout { From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 15: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 CD337106564A; Wed, 22 Aug 2012 15:27:58 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id B330F8FC12; Wed, 22 Aug 2012 15:27:57 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:7258:12ff:fe22:d94b]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.5/8.14.5) with ESMTP/inet6 id q7MFRksi012875 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 23 Aug 2012 00:27:52 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Thu, 23 Aug 2012 00:27:46 +0900 Message-ID: From: Hajimu UMEMOTO To: Andrey Chernov In-Reply-To: <20120822000645.GA54651@vniz.net> References: <201208171553.q7HFrhuf090457@svn.freebsd.org> <201208171507.07699.jhb@freebsd.org> <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> <20120821063027.GA41459@vniz.net> <20120822000645.GA54651@vniz.net> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/24.1 (i386-portbld-freebsd9.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 9.1-PRERELEASE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Thu, 23 Aug 2012 00:27:52 +0900 (JST) X-Virus-Scanned: clamav-milter 0.97.5 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r239356 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Aug 2012 15:27:58 -0000 Hi, >>>>> On Wed, 22 Aug 2012 04:06:46 +0400 >>>>> Andrey Chernov said: ache> BTW, I notice that link-local router address behavior is ache> strange and inconsistant for both 'host -6' and 'dig -6' commands. ache> host -6 example.com fe80:: ache> dig -6 @fe80:: example.com ache> both hangs, but in the same time ache> host -6 example.com fe80::% ache> dig -6 @fe80::% example.com ache> works! ache> host -6 example.com fe80::%1 ache> dig -6 #fe80::%1 example.com ache> works too. Not understanding addresses without % or %1 looks like ache> routing problems, but I don't know where to fix it. A link-local address has a scope; an interface here. You cannot omit it on FreeBSD by default. To be able to omit it, specify something like ipv6_default_interface="em0" in your /etc/rc.conf. ache> So, I try to use ache> nameserver fe80::% (or with %1 suffix) ache> in my resolv.conf, as result ache> host -6 example.com ache> dig -6 example.com ache> (without NS specified) both hangs despite they working when exact the same ache> NS address is given in their command lines. Our stub resolver in libc should work with a link-local address as nameserver. However, host(1) and dig(1) don't use the stub resolver in libc, and use its own resolver. I suspect host(1) and dig(1) have some problem in handling a link-local address. In anyway, I don't recommend to use a link-local address for DNS. Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 16:09: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 C74601065670; Wed, 22 Aug 2012 16:09:20 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 7C1878FC12; Wed, 22 Aug 2012 16:09:20 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q7MG9Exu003861; Wed, 22 Aug 2012 10:09:14 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q7MG9EfR003860; Wed, 22 Aug 2012 10:09:14 -0600 (MDT) (envelope-from ken) Date: Wed, 22 Aug 2012 10:09:14 -0600 From: "Kenneth D. Merry" To: Gleb Smirnoff Message-ID: <20120822160914.GA1194@nargothrond.kdm.org> References: <201208021357.q72DvoFJ088426@svn.freebsd.org> <20120821185014.GA28272@nargothrond.kdm.org> <20120822101705.GL20560@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120822101705.GL20560@FreeBSD.org> User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238990 - in head/sys: net 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, 22 Aug 2012 16:09:20 -0000 On Wed, Aug 22, 2012 at 14:17:05 +0400, Gleb Smirnoff wrote: > On Tue, Aug 21, 2012 at 12:50:14PM -0600, Kenneth D. Merry wrote: > K> On Thu, Aug 02, 2012 at 13:57:50 +0000, Gleb Smirnoff wrote: > K> > Author: glebius > K> > Date: Thu Aug 2 13:57:49 2012 > K> > New Revision: 238990 > K> > URL: http://svn.freebsd.org/changeset/base/238990 > K> > > K> > Log: > K> > Fix races between in_lltable_prefix_free(), lla_lookup(), > K> > llentry_free() and arptimer(): > K> > > K> > o Use callout_init_rw() for lle timeout, this allows us safely > K> > disestablish them. > K> > - This allows us to simplify the arptimer() and make it > K> > race safe. > K> > o Consistently use ifp->if_afdata_lock to lock access to > K> > linked lists in the lle hashes. > K> > o Introduce new lle flag LLE_LINKED, which marks an entry that > K> > is attached to the hash. > K> > - Use LLE_LINKED to avoid double unlinking via consequent > K> > calls to llentry_free(). > K> > - Mark lle with LLE_DELETED via |= operation istead of =, > K> > so that other flags won't be lost. > K> > o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more > K> > consistent and provide more informative KASSERTs. > K> > > K> > The patch is a collaborative work of all submitters and myself. > K> > > K> > PR: kern/165863 > K> > Submitted by: Andrey Zonov > K> > Submitted by: Ryan Stone > K> > Submitted by: Eric van Gyzen > K> > K> I'm running into this on stable/9, any plan on when this will get MFCed? > > I'm sorry, but after 9.1-RELEASE. Too large change to run MFC prior to > release. I understand. > I'd appreciate if you patch your stable/9 system manually and thus > perform some testing prior to merge. I'm running stable/9 from late March (we're working on merging a newer version of stable/9), and have merged in these changes from head: 237571, 238222, 238945, 238967, 238990 At the moment I'm getting a panic inside arptimer: Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x0 fault code = supervisor read instruction, page not present instruction pointer = 0x20:0x0 stack pointer = 0x28:0xffffff800027da40 frame pointer = 0x28:0xffffff800027da80 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 12 (swi4: clock) [ thread pid 12 tid 100010 ] Stopped at 0: *** error reading from address 0 *** db> bt Tracing pid 12 tid 100010 td 0xfffffe00072158e0 uart_sab82532_class() at 0 arptimer() at arptimer+0xd0 softclock() at softclock+0x2ba intr_event_execute_handlers() at intr_event_execute_handlers+0x66 ithread_loop() at ithread_loop+0xb2 fork_exit() at fork_exit+0x135 fork_trampoline() at fork_trampoline+0xe --- trap 0, rip = 0, rsp = 0xffffff800027dcf0, rbp = 0 --- db> It looks like it's inside llentry_free(): (kgdb) up 15 #15 0xffffffff8056b420 in arptimer (arg=Variable "arg" is not available. ) at /usr/home/kenm/perforce7/sys/netinet/if_ether.c:189 189 pkts_dropped = llentry_free(lle); (kgdb) list 184 /* XXX: LOR avoidance. We still have ref on lle. */ 185 LLE_WUNLOCK(lle); 186 IF_AFDATA_LOCK(ifp); 187 LLE_WLOCK(lle); 188 LLE_REMREF(lle); 189 pkts_dropped = llentry_free(lle); 190 IF_AFDATA_UNLOCK(ifp); 191 ARPSTAT_ADD(dropped, pkts_dropped); 192 ARPSTAT_INC(timeouts); 193 CURVNET_RESTORE(); (kgdb) print lle $1 = (struct llentry *) 0xfffffe000aea8600 (kgdb) print *lle $2 = {lle_next = {le_next = 0x0, le_prev = 0xfffffe000a36dcd0}, lle_lock = { lock_object = {lo_name = 0xffffffff8090cc65 "lle", lo_flags = 73596928, lo_data = 0, lo_witness = 0x0}, rw_lock = 18446741874805922016}, lle_tbl = 0xfffffe000a36dc00, lle_head = 0xfffffe000a36dcd0, lle_free = 0, la_hold = 0x0, la_numheld = 0, la_expire = 33571, la_flags = 8192, la_asked = 0, la_preempt = 5, ln_byhint = 0, ln_state = 0, ln_router = 0, ln_ntick = 0, lle_refcnt = 1, ll_addr = {mac_aligned = 55295740969106, mac16 = {32914, 35583, 12874}}, lle_timer = {ln_timer_ch = {c_links = { sle = {sle_next = 0x0}, tqe = {tqe_next = 0x0, tqe_prev = 0xffffff81ed7e4760}}, c_time = 3357036, c_arg = 0xfffffe000aea8600, c_func = 0xffffffff8056b350 , c_lock = 0xfffffe000aea8610, c_flags = 16, c_cpu = 0}, la_timer = { c_links = {sle = {sle_next = 0x0}, tqe = {tqe_next = 0x0, tqe_prev = 0xffffff81ed7e4760}}, c_time = 3357036, c_arg = 0xfffffe000aea8600, c_func = 0xffffffff8056b350 , c_lock = 0xfffffe000aea8610, c_flags = 16, c_cpu = 0}}} (kgdb) down #14 0xffffffff80554950 in llentry_free (lle=0xfffffe000aea8600) at /usr/home/kenm/perforce7/sys/net/if_llatbl.c:137 137 LLE_FREE_LOCKED(lle); (kgdb) list 132 133 KASSERT(lle->la_numheld == 0, 134 ("%s: la_numheld %d > 0, pkts_droped %zd", __func__, 135 lle->la_numheld, pkts_dropped)); 136 137 LLE_FREE_LOCKED(lle); 138 139 return (pkts_dropped); 140 } 141 (kgdb) print lle->lle_free $3 = (void (*)(struct lltable *, struct llentry *)) 0 Looks like I'm missing SVN rev 232054. I'll merge that and try again. Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 16:18: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 314181065670; Wed, 22 Aug 2012 16:18:19 +0000 (UTC) (envelope-from jasone@freebsd.org) Received: from canonware.com (10140.x.rootbsd.net [204.109.63.53]) by mx1.freebsd.org (Postfix) with ESMTP id 0C2FE8FC08; Wed, 22 Aug 2012 16:18:19 +0000 (UTC) Received: from [192.168.168.12] (70-91-206-178-BusName-SFBA.hfc.comcastbusiness.net [70.91.206.178]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by canonware.com (Postfix) with ESMTPSA id 784EE28419; Wed, 22 Aug 2012 09:11:16 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) From: Jason Evans In-Reply-To: <50334957.6020201@FreeBSD.org> Date: Wed, 22 Aug 2012 09:11:15 -0700 Content-Transfer-Encoding: 7bit Message-Id: <64C5CE7C-1AB5-4F19-A261-5A166470A12D@freebsd.org> References: <201208201833.q7KIX58p075876@svn.freebsd.org> <1T3c9K-000Jlb-7g@internal.tormail.org> <50334957.6020201@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1485) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jan Beich Subject: Re: jemalloc and clang (was: Re: svn commit: r239462 - in head) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Aug 2012 16:18:19 -0000 On Aug 21, 2012, at 1:39 AM, Dimitry Andric wrote: > On 2012-08-21 02:17, Jan Beich wrote: > ... >> Time to revert r228540? >> >> Index: contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h >> =================================================================== >> --- contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (revision 239467) >> +++ contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (working copy) >> @@ -56,10 +56,6 @@ >> #ifndef JEMALLOC_TLS_MODEL >> # define JEMALLOC_TLS_MODEL /* Default. */ >> #endif >> -#ifdef __clang__ >> -# undef JEMALLOC_TLS_MODEL >> -# define JEMALLOC_TLS_MODEL /* clang does not support tls_model yet. */ >> -#endif >> >> #define STATIC_PAGE_SHIFT PAGE_SHIFT >> #define LG_SIZEOF_INT 2 > > Well, if Jason would like to support upstream jemalloc for different > versions of clang, it is probably better to to use __has_feature() > instead. > > Jason, what do you think of the attached patch? Or could we just remove > the whole #ifdef __clang__ part? > I'm happy with the above patch (completely removing the #ifdef __clang__). Jason From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 18:30: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 BFE921065672; Wed, 22 Aug 2012 18:30:13 +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 A5A3A8FC16; Wed, 22 Aug 2012 18: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 q7MIUDWr076178; Wed, 22 Aug 2012 18:30:13 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MIUDFa076175; Wed, 22 Aug 2012 18:30:13 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201208221830.q7MIUDFa076175@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 22 Aug 2012 18: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: r239567 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Aug 2012 18:30:13 -0000 Author: hselasky Date: Wed Aug 22 18:30:13 2012 New Revision: 239567 URL: http://svn.freebsd.org/changeset/base/239567 Log: Add new USB device ID. Submitted by: Dmitry Luhtionov MFC after: 1 week Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Wed Aug 22 17:16:05 2012 (r239566) +++ head/sys/dev/usb/serial/uftdi.c Wed Aug 22 18:30:13 2012 (r239567) @@ -434,6 +434,7 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(FTDI, SEMC_DSS20, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, SERIAL_2232D, UFTDI_TYPE_8U232AM), + UFTDI_DEV(FTDI, SERIAL_232RL, UFTDI_TYPE_AUTO), UFTDI_DEV(FTDI, SERIAL_4232H, UFTDI_TYPE_8U232AM), UFTDI_DEV(FTDI, SERIAL_8U100AX, UFTDI_TYPE_SIO), UFTDI_DEV(FTDI, SERIAL_8U232AM, UFTDI_TYPE_8U232AM), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Aug 22 17:16:05 2012 (r239566) +++ head/sys/dev/usb/usbdevs Wed Aug 22 18:30:13 2012 (r239567) @@ -1699,6 +1699,7 @@ product FSC E5400 0x1009 PrismGT USB 2. product FTDI SERIAL_8U100AX 0x8372 8U100AX Serial product FTDI SERIAL_8U232AM 0x6001 8U232AM Serial product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial +product FTDI SERIAL_232RL 0x6006 FT232RL Serial product FTDI SERIAL_2232C 0x6010 FT2232C Dual port Serial product FTDI 232H 0x6014 FTDI compatible adapter product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 18:35: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 8EEFD106566C; Wed, 22 Aug 2012 18:35:18 +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 605968FC1A; Wed, 22 Aug 2012 18:35: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 q7MIZIJe076857; Wed, 22 Aug 2012 18:35:18 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MIZI77076855; Wed, 22 Aug 2012 18:35:18 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208221835.q7MIZI77076855@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 18:35: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: r239568 - head/etc/rc.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: Wed, 22 Aug 2012 18:35:21 -0000 Author: obrien Date: Wed Aug 22 18:35:17 2012 New Revision: 239568 URL: http://svn.freebsd.org/changeset/base/239568 Log: Add dependencies based on security(7). Modified: head/etc/rc.d/securelevel Modified: head/etc/rc.d/securelevel ============================================================================== --- head/etc/rc.d/securelevel Wed Aug 22 18:30:13 2012 (r239567) +++ head/etc/rc.d/securelevel Wed Aug 22 18:35:17 2012 (r239568) @@ -4,6 +4,7 @@ # # PROVIDE: securelevel +# REQUIRE: adjkerntz ipfw ipfilter pf . /etc/rc.subr From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 18:43: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 077C2106564A; Wed, 22 Aug 2012 18:43:22 +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 CD87E8FC0C; Wed, 22 Aug 2012 18: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 q7MIhLx1077953; Wed, 22 Aug 2012 18:43:21 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MIhLU4077951; Wed, 22 Aug 2012 18:43:21 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208221843.q7MIhLU4077951@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 18: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: r239569 - head/etc/rc.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: Wed, 22 Aug 2012 18:43:22 -0000 Author: obrien Date: Wed Aug 22 18:43:21 2012 New Revision: 239569 URL: http://svn.freebsd.org/changeset/base/239569 Log: Remove old entropy seeding after consumption initializing /dev/random PRNG. Not doing so opens us up to replay attacks. Submitted by: Arthur Mesh Sponsored by: Juniper Networks Added: head/etc/rc.d/postrandom (contents, props changed) Modified: head/etc/rc.d/random Added: head/etc/rc.d/postrandom ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/postrandom Wed Aug 22 18:43:21 2012 (r239569) @@ -0,0 +1,41 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: postrandom +# REQUIRE: initrandom random var +# BEFORE: LOGIN +# KEYWORD: nojail + +. /etc/rc.subr + +name="postrandom" +start_cmd="${name}_start" +stop_cmd=":" + +# This will remove old ${entropy_file} and generate a new one. +# According to Bruce Schneier, this is stronly recomended in order +# to avoid using same ${entropy_file} across reboots. +# Reference: Chapter 10.6, Practical Cryptograpy, ISBN: 0-471-22357-3 + +postrandom_start() +{ + /etc/rc.d/random fastsaveseed + + case ${entropy_dir} in + [Nn][Oo]) + ;; + *) + entropy_dir=${entropy_dir:-/var/db/entropy} + if [ -d "${entropy_dir}" ]; then + if [ -w /dev/random ]; then + rm -f ${entropy_dir}/* + fi + fi + ;; + esac +} + +load_rc_config random +run_rc_command "$1" Modified: head/etc/rc.d/random ============================================================================== --- head/etc/rc.d/random Wed Aug 22 18:35:17 2012 (r239568) +++ head/etc/rc.d/random Wed Aug 22 18:43:21 2012 (r239569) @@ -4,7 +4,7 @@ # # PROVIDE: random -# REQUIRE: var initrandom +# REQUIRE: initrandom var # BEFORE: netif # KEYWORD: nojail shutdown @@ -14,6 +14,9 @@ name="random" start_cmd="random_start" stop_cmd="random_stop" +extra_commands="saveseed" +saveseed_cmd="${name}_stop" + feed_dev_random() { if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 18:46: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 B4F621065670; Wed, 22 Aug 2012 18:46:10 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id 783668FC12; Wed, 22 Aug 2012 18:46:10 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.5/8.14.5) with ESMTP id q7MIk4Mt018306; Wed, 22 Aug 2012 11:46:04 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.5/8.14.5/Submit) id q7MIk4vS018305; Wed, 22 Aug 2012 11:46:04 -0700 (PDT) (envelope-from sgk) Date: Wed, 22 Aug 2012 11:46:04 -0700 From: Steve Kargl To: "David E. O'Brien" Message-ID: <20120822184603.GA18294@troutmask.apl.washington.edu> References: <201208221843.q7MIhLU4077951@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201208221843.q7MIhLU4077951@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239569 - head/etc/rc.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: Wed, 22 Aug 2012 18:46:10 -0000 On Wed, Aug 22, 2012 at 06:43:21PM +0000, David E. O'Brien wrote: > + > +# This will remove old ${entropy_file} and generate a new one. > +# According to Bruce Schneier, this is stronly recomended in order s/stronly/strongly -- Steve From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 18:49: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 C29B9106564A; Wed, 22 Aug 2012 18:49:02 +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 ADF9B8FC14; Wed, 22 Aug 2012 18:49: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 q7MIn2QT078698; Wed, 22 Aug 2012 18:49:02 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MIn2YX078696; Wed, 22 Aug 2012 18:49:02 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208221849.q7MIn2YX078696@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 18:49: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: r239570 - head/etc/rc.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: Wed, 22 Aug 2012 18:49:02 -0000 Author: obrien Date: Wed Aug 22 18:49:02 2012 New Revision: 239570 URL: http://svn.freebsd.org/changeset/base/239570 Log: Depend on the new 'postrandom' instead of random. We need to limit the amount of time between consuming the entropy seeds and removing it in case of a kernel panic. Modified: head/etc/rc.d/adjkerntz Modified: head/etc/rc.d/adjkerntz ============================================================================== --- head/etc/rc.d/adjkerntz Wed Aug 22 18:43:21 2012 (r239569) +++ head/etc/rc.d/adjkerntz Wed Aug 22 18:49:02 2012 (r239570) @@ -4,7 +4,7 @@ # # PROVIDE: adjkerntz -# REQUIRE: FILESYSTEMS random +# REQUIRE: FILESYSTEMS postrandom # BEFORE: netif # KEYWORD: nojail From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 19:02: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 DA327106566C; Wed, 22 Aug 2012 19:02:07 +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 C58EB8FC1A; Wed, 22 Aug 2012 19:02: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 q7MJ273M080467; Wed, 22 Aug 2012 19:02:07 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJ276q080465; Wed, 22 Aug 2012 19:02:07 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208221902.q7MJ276q080465@svn.freebsd.org> From: Jim Harris Date: Wed, 22 Aug 2012 19:02: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: r239571 - head/usr.sbin/pmcstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Aug 2012 19:02:08 -0000 Author: jimharris Date: Wed Aug 22 19:02:07 2012 New Revision: 239571 URL: http://svn.freebsd.org/changeset/base/239571 Log: Add -m option (for printing sampled PCs to a file) to pmcstat usage message. Sponsored by: Intel MFC after: 3 days Modified: head/usr.sbin/pmcstat/pmcstat.c Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Wed Aug 22 18:49:02 2012 (r239570) +++ head/usr.sbin/pmcstat/pmcstat.c Wed Aug 22 19:02:07 2012 (r239571) @@ -509,6 +509,7 @@ pmcstat_show_usage(void) "\t -f spec\t pass \"spec\" to as plugin option\n" "\t -g\t\t produce gprof(1) compatible profiles\n" "\t -k dir\t\t set the path to the kernel\n" + "\t -m file\t print sampled PCs to \"file\"\n" "\t -n rate\t set sampling rate\n" "\t -o file\t send print output to \"file\"\n" "\t -p spec\t allocate a process-private counting PMC\n" From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 19:02: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 266951065678 for ; Wed, 22 Aug 2012 19:02:33 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 907BA8FC14 for ; Wed, 22 Aug 2012 19:02:32 +0000 (UTC) Received: by mail-lpp01m010-f54.google.com with SMTP id e12so939531lag.13 for ; Wed, 22 Aug 2012 12:02:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=Hyu/hP2unNNcZ1JvHhn9HyVplYAhTg8wCK88bQrzeq4=; b=Dq8ju/uHb9HHrodXpexliH2tT3HQ8S/q+yrkY1F+dKhMuAnYePGzkEYB/6zcggP1DP uU+qd0aXxiRaQnCpT7SvXdESSWukyyc2MItSWKTSe8xC5tHjiA+XuyTwn8y+2TGsKUAm 9BKslRkmdrBAOqYF7a9IEUVpqRNHh5DoPBDMp+ujsk7Yw50yp+TtVutxWZwSu9m7Uq7j fXjyiwWOhQNGFl4CMZ3mwKAfBD+hU6PB2AvWBFforBT/lyCExv24EJFdgRRRKFcT70wp gWLCpbc14jbBD2xgE+8Ldc4VJdoRcXpWEVrzUzQisuiFG2bXFJgqEyAJ9glo8l1UP6Pa HcSg== Received: by 10.152.110.70 with SMTP id hy6mr22348876lab.44.1345662151995; Wed, 22 Aug 2012 12:02:31 -0700 (PDT) Received: from zont-osx.local (ppp95-165-143-86.pppoe.spdop.ru. [95.165.143.86]) by mx.google.com with ESMTPS id j3sm1344149lbh.0.2012.08.22.12.02.30 (version=SSLv3 cipher=OTHER); Wed, 22 Aug 2012 12:02:31 -0700 (PDT) Sender: Andrey Zonov Message-ID: <50352CC1.8030608@FreeBSD.org> Date: Wed, 22 Aug 2012 23:02:25 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Hiroki Sato References: <201208220637.q7M6bVb3082106@svn.freebsd.org> In-Reply-To: <201208220637.q7M6bVb3082106@svn.freebsd.org> X-Enigmail-Version: 1.4.3 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigF98DDB1FEA1EB8BE8738E72B" X-Gm-Message-State: ALoCoQksVK2AtfBQT4XxKvad/XFGK5KaIkh8bCJ+AI2OQkK13PZtoh7+51PHsp3VpF5VlReuvB/j Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239562 - head/usr.sbin/makefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Aug 2012 19:02:33 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF98DDB1FEA1EB8BE8738E72B Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 8/22/12 10:37 AM, Hiroki Sato wrote: > Author: hrs > Date: Wed Aug 22 06:37:30 2012 > New Revision: 239562 > URL: http://svn.freebsd.org/changeset/base/239562 >=20 > Log: > Add -p flag to create the image as a sparse file. > =20 > Submitted by: Shesha Sreenivasamurthy > PR: bin/167779 >=20 > Modified: > head/usr.sbin/makefs/ffs.c > head/usr.sbin/makefs/makefs.8 > head/usr.sbin/makefs/makefs.c > head/usr.sbin/makefs/makefs.h >=20 [snip] >=20 > Modified: head/usr.sbin/makefs/makefs.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/usr.sbin/makefs/makefs.c Wed Aug 22 05:38:06 2012 (r239561) > +++ head/usr.sbin/makefs/makefs.c Wed Aug 22 06:37:30 2012 (r239562) > @@ -112,7 +112,7 @@ main(int argc, char *argv[]) > start_time.tv_sec =3D start.tv_sec; > start_time.tv_nsec =3D start.tv_usec * 1000; > =20 > - while ((ch =3D getopt(argc, argv, "B:b:d:f:F:M:m:N:o:s:S:t:x")) !=3D = -1) { > + while ((ch =3D getopt(argc, argv, "B:b:d:f:F:M:m:N:o:ps:S:t:x")) !=3D= -1) { > switch (ch) { > =20 > case 'B': > @@ -199,6 +199,9 @@ main(int argc, char *argv[]) > } > break; > } > + case 'p': > + fsoptions.sparse =3D 1; > + break; > =20 > case 's': > fsoptions.minsize =3D fsoptions.maxsize =3D > @@ -346,7 +349,7 @@ usage(void) > fprintf(stderr, > "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n"= > "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size= ]\n" > -"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x]\n" > +"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x] [-p]\n" style(9) violation. Options should be sorted. > "\t[-N userdb-dir] image-file directory | manifest [extra-directory ..= =2E]\n", > prog); > exit(1); >=20 > Modified: head/usr.sbin/makefs/makefs.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/makefs/makefs.h Wed Aug 22 05:38:06 2012 (r239561) > +++ head/usr.sbin/makefs/makefs.h Wed Aug 22 06:37:30 2012 (r239562) > @@ -129,6 +129,7 @@ typedef struct { > int freeblockpc; /* free block % */ > int needswap; /* non-zero if byte swapping needed */ > int sectorsize; /* sector size */ > + int sparse; /* sparse image, don't fill it with zeros */ > =20 > void *fs_specific; /* File system specific additions. */ > } fsinfo_t; >=20 --=20 Andrey Zonov --------------enigF98DDB1FEA1EB8BE8738E72B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJQNSzFAAoJEBWLemxX/CvT64AIAJ29hDJZLovM6XUzHkVUVflw n+3401/rVZbdbSA6XewJjdRARbhurjDfrDLipXuRxjKYAo0+x7cEN5w2EW/qKCw8 WmvO3ATF9hWlH0u6Y3oXMRJml0C6QirMtH2Pe7UdtEId+iJoVVePz6zxFw58x1NZ aCduPDdRXKthCdCc+Xf/j3DNdkL6IyN2c92BTAyO75Jjq7XVEca+qS6kh5q0pvBI xxQZ6TYFYFH+RXFxjqWpBjpPc/5hjauO46l9aPx4nBlVKetm3YfGPPGNEN7IVLH4 zHW1DCs9jW4WeODKKAbm94U0Paz9+e3UrqwADmPGQJk2YT7o9A7FV+ChGwuQVbc= =KqYW -----END PGP SIGNATURE----- --------------enigF98DDB1FEA1EB8BE8738E72B-- From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 19:27: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 E4947106564A; Wed, 22 Aug 2012 19:27:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D03068FC17; Wed, 22 Aug 2012 19:27: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 q7MJRgoq083952; Wed, 22 Aug 2012 19:27:42 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MJRge5083949; Wed, 22 Aug 2012 19:27:42 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201208221927.q7MJRge5083949@svn.freebsd.org> From: Hiroki Sato Date: Wed, 22 Aug 2012 19:27: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: r239574 - head/usr.sbin/makefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Aug 2012 19:27:43 -0000 Author: hrs Date: Wed Aug 22 19:27:42 2012 New Revision: 239574 URL: http://svn.freebsd.org/changeset/base/239574 Log: Sort options. Modified: head/usr.sbin/makefs/makefs.8 head/usr.sbin/makefs/makefs.c Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Wed Aug 22 19:27:17 2012 (r239573) +++ head/usr.sbin/makefs/makefs.8 Wed Aug 22 19:27:42 2012 (r239574) @@ -43,8 +43,7 @@ .Nd create a file system image from a directory tree or a mtree manifest .Sh SYNOPSIS .Nm -.Op Fl p -.Op Fl x +.Op Fl px .Op Fl B Ar byte-order .Op Fl b Ar free-blocks .Op Fl d Ar debug-mask Modified: head/usr.sbin/makefs/makefs.c ============================================================================== --- head/usr.sbin/makefs/makefs.c Wed Aug 22 19:27:17 2012 (r239573) +++ head/usr.sbin/makefs/makefs.c Wed Aug 22 19:27:42 2012 (r239574) @@ -349,7 +349,7 @@ usage(void) fprintf(stderr, "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n" -"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x] [-p]\n" +"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-px]\n" "\t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", prog); exit(1); From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 19:27: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 405771065673; Wed, 22 Aug 2012 19:27:46 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 285448FC19; Wed, 22 Aug 2012 19:27:44 +0000 (UTC) Received: by lbbgg13 with SMTP id gg13so1059845lbb.13 for ; Wed, 22 Aug 2012 12:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=2OW/jznCkHSovklMNXNwtP+2zEyYQyvXlDF8CrgQQu0=; b=KC3kTQvMmobb963pbM/qzd2v8vPFfs5zC+ZATr/GjjGcn5axjV5PZ9DvEP941aTxqj 17kYwHcbJvA0URAIPhtpdpqVWLFVYnFHT9iHWRaZIsUM1zy141NaxLVKpmPf/MzkJoOd zmYzYus+b41J2msXmIl9hK8wfb6PFKuLQOy93DqaMHDbkK1KX+VU605aEmHOblakJTD+ j3hibdM1Z45TwGCsjWVhPXi3iY5WzJ/bHhQTWEztv6dALQOXvt//V4dGyQ+xiBzPk7Mw 0nGYixkPN9pywPQoRIr4e04XmHeYpczCE0H5CEnLNcp/IujZSKNGiahkNbTusTCUIOLK YO7A== MIME-Version: 1.0 Received: by 10.152.146.163 with SMTP id td3mr22809754lab.26.1345663664086; Wed, 22 Aug 2012 12:27:44 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.102.39 with HTTP; Wed, 22 Aug 2012 12:27:44 -0700 (PDT) In-Reply-To: <201208221902.q7MJ276q080465@svn.freebsd.org> References: <201208221902.q7MJ276q080465@svn.freebsd.org> Date: Wed, 22 Aug 2012 20:27:44 +0100 X-Google-Sender-Auth: yli6AJKE9StRcQxePZPVRRNWa2U Message-ID: From: Attilio Rao To: Jim Harris Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239571 - head/usr.sbin/pmcstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: attilio@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, 22 Aug 2012 19:27:46 -0000 On Wed, Aug 22, 2012 at 8:02 PM, Jim Harris wrote: > Author: jimharris > Date: Wed Aug 22 19:02:07 2012 > New Revision: 239571 > URL: http://svn.freebsd.org/changeset/base/239571 > > Log: > Add -m option (for printing sampled PCs to a file) to pmcstat usage > message. Pointy hat to me. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 20:00: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 AEFDA106574F; Wed, 22 Aug 2012 20:00:41 +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 9B5AC8FC1C; Wed, 22 Aug 2012 20:00: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 q7MK0fss089029; Wed, 22 Aug 2012 20:00:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK0ff6089027; Wed, 22 Aug 2012 20:00:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208222000.q7MK0ff6089027@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Aug 2012 20:00: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: r239584 - 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: Wed, 22 Aug 2012 20:00:41 -0000 Author: jhb Date: Wed Aug 22 20:00:41 2012 New Revision: 239584 URL: http://svn.freebsd.org/changeset/base/239584 Log: Fix the 'show witness' DDB command to honor db_pager_quit. Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Wed Aug 22 19:56:41 2012 (r239583) +++ head/sys/kern/subr_witness.c Wed Aug 22 20:00:41 2012 (r239584) @@ -947,6 +947,8 @@ witness_ddb_display_descendants(int(*prn indent++; WITNESS_INDEX_ASSERT(w->w_index); for (i = 1; i <= w_max_used_index; i++) { + if (db_pager_quit) + return; if (w_rmatrix[w->w_index][i] & WITNESS_PARENT) witness_ddb_display_descendants(prnt, &w_data[i], indent); @@ -965,6 +967,8 @@ witness_ddb_display_list(int(*prnt)(cons /* This lock has no anscestors - display its descendants. */ witness_ddb_display_descendants(prnt, w, 0); + if (db_pager_quit) + return; } } @@ -986,12 +990,16 @@ witness_ddb_display(int(*prnt)(const cha */ prnt("Sleep locks:\n"); witness_ddb_display_list(prnt, &w_sleep); + if (db_pager_quit) + return; /* * Now do spin locks which have been acquired at least once. */ prnt("\nSpin locks:\n"); witness_ddb_display_list(prnt, &w_spin); + if (db_pager_quit) + return; /* * Finally, any locks which have not been acquired yet. @@ -1002,6 +1010,8 @@ witness_ddb_display(int(*prnt)(const cha continue; prnt("%s (type: %s, depth: %d)\n", w->w_name, w->w_class->lc_name, w->w_ddb_level); + if (db_pager_quit) + return; } } #endif /* DDB */ @@ -2398,6 +2408,8 @@ DB_SHOW_ALL_COMMAND(locks, db_witness_li db_printf("Process %d (%s) thread %p (%d)\n", p->p_pid, p->p_comm, td, td->td_tid); witness_ddb_list(td); + if (db_pager_quit) + return; } } } From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 20:01: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 961A81065687; Wed, 22 Aug 2012 20:01:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81E7E8FC1B; Wed, 22 Aug 2012 20:01: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 q7MK1dNa089239; Wed, 22 Aug 2012 20:01:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK1dBu089235; Wed, 22 Aug 2012 20:01:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208222001.q7MK1dBu089235@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Aug 2012 20:01: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: r239585 - 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: Wed, 22 Aug 2012 20:01:39 -0000 Author: jhb Date: Wed Aug 22 20:01:38 2012 New Revision: 239585 URL: http://svn.freebsd.org/changeset/base/239585 Log: Mark the idle threads as non-sleepable and also assert that an idle thread never blocks on a turnstile. Modified: head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/kern/subr_turnstile.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Wed Aug 22 20:00:41 2012 (r239584) +++ head/sys/kern/sched_4bsd.c Wed Aug 22 20:01:38 2012 (r239585) @@ -1598,6 +1598,7 @@ sched_idletd(void *dummy) { struct pcpuidlestat *stat; + THREAD_NO_SLEEPING(); stat = DPCPU_PTR(idlestat); for (;;) { mtx_assert(&Giant, MA_NOTOWNED); Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Aug 22 20:00:41 2012 (r239584) +++ head/sys/kern/sched_ule.c Wed Aug 22 20:01:38 2012 (r239585) @@ -2581,6 +2581,7 @@ sched_idletd(void *dummy) mtx_assert(&Giant, MA_NOTOWNED); td = curthread; tdq = TDQ_SELF(); + THREAD_NO_SLEEPING(); for (;;) { #ifdef SMP if (tdq_idled(tdq) == 0) Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Wed Aug 22 20:00:41 2012 (r239584) +++ head/sys/kern/subr_turnstile.c Wed Aug 22 20:01:38 2012 (r239585) @@ -684,6 +684,7 @@ turnstile_wait(struct turnstile *ts, str if (owner) MPASS(owner->td_proc->p_magic == P_MAGIC); MPASS(queue == TS_SHARED_QUEUE || queue == TS_EXCLUSIVE_QUEUE); + KASSERT(!TD_IS_IDLETHREAD(td), ("idle threads cannot block on locks")); /* * If the lock does not already have a turnstile, use this thread's From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 20:01: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 9456610657FB; Wed, 22 Aug 2012 20:01:58 +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 807518FC12; Wed, 22 Aug 2012 20:01: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 q7MK1wPd089300; Wed, 22 Aug 2012 20:01:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK1w8Y089298; Wed, 22 Aug 2012 20:01:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208222001.q7MK1w8Y089298@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Aug 2012 20:01: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: r239586 - 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: Wed, 22 Aug 2012 20:01:58 -0000 Author: jhb Date: Wed Aug 22 20:01:57 2012 New Revision: 239586 URL: http://svn.freebsd.org/changeset/base/239586 Log: Fix a typo. Modified: head/sys/kern/kern_module.c Modified: head/sys/kern/kern_module.c ============================================================================== --- head/sys/kern/kern_module.c Wed Aug 22 20:01:38 2012 (r239585) +++ head/sys/kern/kern_module.c Wed Aug 22 20:01:57 2012 (r239586) @@ -133,7 +133,7 @@ module_register_init(const void *arg) MOD_XLOCK; if (mod->file) { /* - * Once a module is succesfully loaded, move + * Once a module is successfully loaded, move * it to the head of the module list for this * linker file. This resorts the list so that * when the kernel linker iterates over the From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 20:02: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 3184C1065674; Wed, 22 Aug 2012 20:02:43 +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 1DB5E8FC21; Wed, 22 Aug 2012 20:02:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7MK2gPN089437; Wed, 22 Aug 2012 20:02:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK2gVY089435; Wed, 22 Aug 2012 20:02:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208222002.q7MK2gVY089435@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Aug 2012 20:02: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: r239587 - 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: Wed, 22 Aug 2012 20:02:43 -0000 Author: jhb Date: Wed Aug 22 20:02:42 2012 New Revision: 239587 URL: http://svn.freebsd.org/changeset/base/239587 Log: Assert that system calls do not leak a pinned thread (via sched_pin()) to userland. Modified: head/sys/kern/subr_syscall.c Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Wed Aug 22 20:01:57 2012 (r239586) +++ head/sys/kern/subr_syscall.c Wed Aug 22 20:02:42 2012 (r239587) @@ -188,6 +188,9 @@ syscallret(struct thread *td, int error, KASSERT((td->td_pflags & TDP_NOSLEEPING) == 0, ("System call %s returning with sleep disabled", syscallname(p, sa->code))); + KASSERT(td->td_pinned == 0, + ("System call %s returning with pinned thread", + syscallname(p, sa->code))); /* * Handle reschedule and other end-of-syscall issues From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 20:05:35 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 3A980106566C; Wed, 22 Aug 2012 20:05:35 +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 25A988FC08; Wed, 22 Aug 2012 20:05: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 q7MK5ZGW089835; Wed, 22 Aug 2012 20:05:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MK5YOa089833; Wed, 22 Aug 2012 20:05:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208222005.q7MK5YOa089833@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Aug 2012 20:05: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: r239588 - 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: Wed, 22 Aug 2012 20:05:35 -0000 Author: kib Date: Wed Aug 22 20:05:34 2012 New Revision: 239588 URL: http://svn.freebsd.org/changeset/base/239588 Log: Provide some compat32 shims for sysctl vfs.conflist. It is required for getvfsbyname(3) operation when called from 32bit process, and getvfsbyname(3) is used by recent bsdtar import. Reported by: many Tested by: David Naylor MFC after: 5 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Aug 22 20:02:42 2012 (r239587) +++ head/sys/kern/vfs_subr.c Wed Aug 22 20:05:34 2012 (r239588) @@ -41,6 +41,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_ddb.h" #include "opt_watchdog.h" @@ -3111,22 +3112,50 @@ DB_SHOW_COMMAND(mount, db_show_mount) /* * Fill in a struct xvfsconf based on a struct vfsconf. */ -static void -vfsconf2x(struct vfsconf *vfsp, struct xvfsconf *xvfsp) +static int +vfsconf2x(struct sysctl_req *req, struct vfsconf *vfsp) { + struct xvfsconf xvfsp; - strcpy(xvfsp->vfc_name, vfsp->vfc_name); - xvfsp->vfc_typenum = vfsp->vfc_typenum; - xvfsp->vfc_refcount = vfsp->vfc_refcount; - xvfsp->vfc_flags = vfsp->vfc_flags; + bzero(&xvfsp, sizeof(xvfsp)); + strcpy(xvfsp.vfc_name, vfsp->vfc_name); + xvfsp.vfc_typenum = vfsp->vfc_typenum; + xvfsp.vfc_refcount = vfsp->vfc_refcount; + xvfsp.vfc_flags = vfsp->vfc_flags; /* * These are unused in userland, we keep them * to not break binary compatibility. */ - xvfsp->vfc_vfsops = NULL; - xvfsp->vfc_next = NULL; + xvfsp.vfc_vfsops = NULL; + xvfsp.vfc_next = NULL; + return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); } +#ifdef COMPAT_FREEBSD32 +struct xvfsconf32 { + uint32_t vfc_vfsops; + char vfc_name[MFSNAMELEN]; + int32_t vfc_typenum; + int32_t vfc_refcount; + int32_t vfc_flags; + uint32_t vfc_next; +}; + +static int +vfsconf2x32(struct sysctl_req *req, struct vfsconf *vfsp) +{ + struct xvfsconf32 xvfsp; + + strcpy(xvfsp.vfc_name, vfsp->vfc_name); + xvfsp.vfc_typenum = vfsp->vfc_typenum; + xvfsp.vfc_refcount = vfsp->vfc_refcount; + xvfsp.vfc_flags = vfsp->vfc_flags; + xvfsp.vfc_vfsops = 0; + xvfsp.vfc_next = 0; + return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); +} +#endif + /* * Top level filesystem related information gathering. */ @@ -3134,14 +3163,16 @@ static int sysctl_vfs_conflist(SYSCTL_HANDLER_ARGS) { struct vfsconf *vfsp; - struct xvfsconf xvfsp; int error; error = 0; TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { - bzero(&xvfsp, sizeof(xvfsp)); - vfsconf2x(vfsp, &xvfsp); - error = SYSCTL_OUT(req, &xvfsp, sizeof xvfsp); +#ifdef COMPAT_FREEBSD32 + if (req->flags & SCTL_MASK32) + error = vfsconf2x32(req, vfsp); + else +#endif + error = vfsconf2x(req, vfsp); if (error) break; } @@ -3161,7 +3192,6 @@ vfs_sysctl(SYSCTL_HANDLER_ARGS) int *name = (int *)arg1 - 1; /* XXX */ u_int namelen = arg2 + 1; /* XXX */ struct vfsconf *vfsp; - struct xvfsconf xvfsp; log(LOG_WARNING, "userland calling deprecated sysctl, " "please rebuild world\n"); @@ -3185,9 +3215,12 @@ vfs_sysctl(SYSCTL_HANDLER_ARGS) break; if (vfsp == NULL) return (EOPNOTSUPP); - bzero(&xvfsp, sizeof(xvfsp)); - vfsconf2x(vfsp, &xvfsp); - return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); +#ifdef COMPAT_FREEBSD32 + if (req->flags & SCTL_MASK32) + return (vfsconf2x32(req, vfsp)); + else +#endif + return (vfsconf2x(req, vfsp)); } return (EOPNOTSUPP); } From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 20:06: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 DB8281065672; Wed, 22 Aug 2012 20:06:33 +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 B00598FC26; Wed, 22 Aug 2012 20:06:33 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 20698B9B7; Wed, 22 Aug 2012 16:06:33 -0400 (EDT) From: John Baldwin To: Jan Beich Date: Wed, 22 Aug 2012 16:06:22 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208221353.q7MDrbYB039551__4686.74262888289$1345643666$gmane$org@svn.freebsd.org> <1T4CmR-00012d-OP@internal.tormail.org> In-Reply-To: <1T4CmR-00012d-OP@internal.tormail.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201208221606.22178.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 22 Aug 2012 16:06:33 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239564 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Aug 2012 20:06:34 -0000 On Wednesday, August 22, 2012 11:24:05 am Jan Beich wrote: > (mx1.freebsd.org hates my smtp relay) > > John Baldwin writes: > > > Author: jhb > > Date: Wed Aug 22 13:53:37 2012 > > New Revision: 239564 > > URL: http://svn.freebsd.org/changeset/base/239564 > > > > Log: > > Revert r239356 and use an alternate algorithm. > > Doesn't help here. It now goes into an endless cycle trying to renew IP. > > $ (pciconf -l; dmesg) | fgrep -m2 fxp0 > fxp0@pci0:5:0:0: class=0x020000 card=0xb1440e11 chip=0x12298086 rev=0x08 hdr=0x00 > fxp0: port 0xd000-0xd03f mem 0xf9100000-0xf9100fff,0xf9000000-0xf90fffff irq 20 at device 0.0 on pci5 Please try this patch relative to what is in HEAD: Index: dhcpd.h =================================================================== --- dhcpd.h (revision 239564) +++ dhcpd.h (working copy) @@ -209,6 +209,7 @@ int dead; u_int16_t index; int linkstat; + time_t linktime; }; struct timeout { Index: dhclient.c =================================================================== --- dhclient.c (revision 239564) +++ dhclient.c (working copy) @@ -285,8 +285,14 @@ ifi->linkstat ? "up" : "down", linkstat ? "up" : "down"); ifi->linkstat = linkstat; - if (linkstat) + + /* + * XXX: Hardcoded 5 second grace window on + * link flaps. + */ + if (linkstat && (cur_time - ifi->linktime) >= 5) state_reboot(ifi); + ifi->linktime = cur_time; } break; case RTM_IFANNOUNCE: @@ -441,6 +447,7 @@ fprintf(stderr, " got link\n"); } ifi->linkstat = 1; + ifi->linktime = cur_time; if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1) error("cannot open %s: %m", _PATH_DEVNULL); -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 20:22: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 AD8BB106566B; Wed, 22 Aug 2012 20:22:55 +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 99EED8FC08; Wed, 22 Aug 2012 20:22: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 q7MKMtZH092128; Wed, 22 Aug 2012 20:22:55 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MKMtEt092126; Wed, 22 Aug 2012 20:22:55 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208222022.q7MKMtEt092126@svn.freebsd.org> From: Jim Harris Date: Wed, 22 Aug 2012 20:22: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: r239591 - 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: Wed, 22 Aug 2012 20:22:55 -0000 Author: jimharris Date: Wed Aug 22 20:22:55 2012 New Revision: 239591 URL: http://svn.freebsd.org/changeset/base/239591 Log: Remove unncessary atomic operation when reading process flags in PMC_PROC_IS_USING_PMCS macro. Invocations of this macro are not synchronized with setting/clearing of P_HWPMC flag, so the atomic operation here isn't needed. Removing the atomic operation provides noticeable improvement (5-6%) on some scheduler-intensive workloads with HWPMC_HOOKS enabled on an 8C Sandy Bridge Xeon system. Sponsored by: Intel Reviewed by: jhb MFC after: 1 week Modified: head/sys/sys/pmckern.h Modified: head/sys/sys/pmckern.h ============================================================================== --- head/sys/sys/pmckern.h Wed Aug 22 20:07:10 2012 (r239590) +++ head/sys/sys/pmckern.h Wed Aug 22 20:22:55 2012 (r239591) @@ -201,8 +201,7 @@ do { \ /* Check if a process is using HWPMCs.*/ #define PMC_PROC_IS_USING_PMCS(p) \ - (__predict_false(atomic_load_acq_int(&(p)->p_flag) & \ - P_HWPMC)) + (__predict_false(p->p_flag & P_HWPMC)) /* Check if a thread have pending user capture. */ #define PMC_IS_PENDING_CALLCHAIN(p) \ From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 20:56: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 B921A106566B; Wed, 22 Aug 2012 20:56:53 +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 A530C8FC0A; Wed, 22 Aug 2012 20:56: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 q7MKur1l096538; Wed, 22 Aug 2012 20:56:53 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MKurns096535; Wed, 22 Aug 2012 20:56:53 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208222056.q7MKurns096535@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 20:56: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: r239593 - head/etc/rc.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: Wed, 22 Aug 2012 20:56:53 -0000 Author: obrien Date: Wed Aug 22 20:56:53 2012 New Revision: 239593 URL: http://svn.freebsd.org/changeset/base/239593 Log: Fix comment misspelling. Submitted by: kargl Modified: head/etc/rc.d/postrandom Modified: head/etc/rc.d/postrandom ============================================================================== --- head/etc/rc.d/postrandom Wed Aug 22 20:34:23 2012 (r239592) +++ head/etc/rc.d/postrandom Wed Aug 22 20:56:53 2012 (r239593) @@ -15,7 +15,7 @@ start_cmd="${name}_start" stop_cmd=":" # This will remove old ${entropy_file} and generate a new one. -# According to Bruce Schneier, this is stronly recomended in order +# According to Bruce Schneier, this is strongly recomended in order # to avoid using same ${entropy_file} across reboots. # Reference: Chapter 10.6, Practical Cryptograpy, ISBN: 0-471-22357-3 From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 21:20: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 5FCAA106564A; Wed, 22 Aug 2012 21:20:23 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3BAFE8FC0C; Wed, 22 Aug 2012 21:20:21 +0000 (UTC) Received: by lbbgg13 with SMTP id gg13so44236lbb.13 for ; Wed, 22 Aug 2012 14:20:20 -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; bh=8iSPOeI7shXRnFpZ6/nkumuP2+dxOaT/BfzweaAjUG8=; b=qfCLxM5kPRvtKllHymqe9354rA9gQ1evym/xFRoy8Wp2zYEOSAluGYyEbzyCsjjqhf HIAekIuN8AW0frjqBKf/vVqVoSNr5KO8+8BShzjWNPqoBoCwZXxJEytVSSe6eh7LosuP WwSMLRWhXVgYwLcKEiywe8F/rRkxXmyacq3KL2vCKSTPK5YAI9hleAos7dNxCUI3dCaJ 5F9jjStFSJI5xruoPa0kulJOvno0GUb6Tw7xWD84Ed3B03b5Fd7H2G4K6nzLxUwDjFZI Cii2Z3lQRGxTbsUbDr2cDhrkF5euoioizjWt3yng7DUGsXXPzfOeQuZX6Nqp42v06sRu vRbQ== MIME-Version: 1.0 Received: by 10.112.101.194 with SMTP id fi2mr9841592lbb.104.1345670420780; Wed, 22 Aug 2012 14:20:20 -0700 (PDT) Received: by 10.112.60.227 with HTTP; Wed, 22 Aug 2012 14:20:20 -0700 (PDT) Received: by 10.112.60.227 with HTTP; Wed, 22 Aug 2012 14:20:20 -0700 (PDT) In-Reply-To: <201208222056.q7MKurns096535@svn.freebsd.org> References: <201208222056.q7MKurns096535@svn.freebsd.org> Date: Wed, 22 Aug 2012 22:20:20 +0100 Message-ID: From: Chris Rees To: "David E. O'Brien" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239593 - head/etc/rc.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: Wed, 22 Aug 2012 21:20:23 -0000 On 22 Aug 2012 21:57, "David E. O'Brien" wrote: > > Author: obrien > Date: Wed Aug 22 20:56:53 2012 > New Revision: 239593 > URL: http://svn.freebsd.org/changeset/base/239593 > > Log: > Fix comment misspelling. > > Submitted by: kargl > > Modified: > head/etc/rc.d/postrandom > > Modified: head/etc/rc.d/postrandom > ============================================================================== > --- head/etc/rc.d/postrandom Wed Aug 22 20:34:23 2012 (r239592) > +++ head/etc/rc.d/postrandom Wed Aug 22 20:56:53 2012 (r239593) > @@ -15,7 +15,7 @@ start_cmd="${name}_start" > stop_cmd=":" > > # This will remove old ${entropy_file} and generate a new one. > -# According to Bruce Schneier, this is stronly recomended in order > +# According to Bruce Schneier, this is strongly recomended in order > # to avoid using same ${entropy_file} across reboots. > # Reference: Chapter 10.6, Practical Cryptograpy, ISBN: 0-471-22357-3 Nitpicking... but recommended is also incorrect! Chris From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 21:30: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 986D01065670; Wed, 22 Aug 2012 21:30:55 +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 336548FC15; Wed, 22 Aug 2012 21:30:55 +0000 (UTC) Received: by obbun3 with SMTP id un3so148314obb.13 for ; Wed, 22 Aug 2012 14:30:54 -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; bh=J6tC5gHcm6CIMCQmIoW4lC3WjTitHWsVto6EbkC2czA=; b=eed+P5ZrFWMOAgLQ7CfC1tWhRrXPV379WZjaLkEiIs00PEgUTnf/VnKvTTm+F3uo7g tpNt45Dlq3h3wcW3UV3QBIq3IXdshXVy3zejwj5hm34A3RUp+QWuJ5daR5rr5jze4m7G 8hiw5imuTJNdt6umOJCaYJ9UD+jJv9PfbRSnlw7wWOd9SlmK88lwTrY5eBo6okUi0t4n F4cdZTpYCIa/Len2SrlnKmFzN9IIj4evb41nXTSMI7iZTNcG07BU3mYY6EZ5NMsj98jS eQIQRuk42Oj4KyMUay7oYpMd7I2ifaXbpgl4GPMIEugR7QV+efEHar2GiTJcG+uUgpeu VgfQ== MIME-Version: 1.0 Received: by 10.182.45.41 with SMTP id j9mr16671633obm.67.1345671054837; Wed, 22 Aug 2012 14:30:54 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Wed, 22 Aug 2012 14:30:54 -0700 (PDT) In-Reply-To: References: <201208222056.q7MKurns096535@svn.freebsd.org> Date: Wed, 22 Aug 2012 14:30:54 -0700 Message-ID: From: Garrett Cooper To: Chris Rees Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" Subject: Re: svn commit: r239593 - head/etc/rc.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: Wed, 22 Aug 2012 21:30:55 -0000 On Wed, Aug 22, 2012 at 2:20 PM, Chris Rees wrote: > On 22 Aug 2012 21:57, "David E. O'Brien" wrote: >> >> Author: obrien >> Date: Wed Aug 22 20:56:53 2012 >> New Revision: 239593 >> URL: http://svn.freebsd.org/changeset/base/239593 >> >> Log: >> Fix comment misspelling. >> >> Submitted by: kargl >> >> Modified: >> head/etc/rc.d/postrandom >> >> Modified: head/etc/rc.d/postrandom >> > ============================================================================== >> --- head/etc/rc.d/postrandom Wed Aug 22 20:34:23 2012 (r239592) >> +++ head/etc/rc.d/postrandom Wed Aug 22 20:56:53 2012 (r239593) >> @@ -15,7 +15,7 @@ start_cmd="${name}_start" >> stop_cmd=":" >> >> # This will remove old ${entropy_file} and generate a new one. >> -# According to Bruce Schneier, this is stronly recomended in order >> +# According to Bruce Schneier, this is strongly recomended in order >> # to avoid using same ${entropy_file} across reboots. >> # Reference: Chapter 10.6, Practical Cryptograpy, ISBN: 0-471-22357-3 > > Nitpicking... but recommended is also incorrect! As is "Cryptography". -Garrett From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 21:37:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id 25B701065670; Wed, 22 Aug 2012 21:37:38 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id B5821162977; Wed, 22 Aug 2012 21:37:37 +0000 (UTC) Message-ID: <50355121.3070408@FreeBSD.org> Date: Wed, 22 Aug 2012 14:37:37 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:14.0) Gecko/20120728 Thunderbird/14.0 MIME-Version: 1.0 To: "David E. O'Brien" References: <201208221835.q7MIZI77076855@svn.freebsd.org> In-Reply-To: <201208221835.q7MIZI77076855@svn.freebsd.org> X-Enigmail-Version: 1.4.3 OpenPGP: id=1A1ABC84 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: r239568 - head/etc/rc.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: Wed, 22 Aug 2012 21:37:38 -0000 Were these changes discussed somewhere and I missed it? I'm not opposed per se, but the security aspects should be discussed on freebsd-security@, and it's preferable that significant changes to rcorder be looked at on freebsd-rc@ as well. Can you hold off on MFC'ing any of this until it's been reviewed more thoroughly? Doug On 08/22/2012 11:35, David E. O'Brien wrote: > Author: obrien > Date: Wed Aug 22 18:35:17 2012 > New Revision: 239568 > URL: http://svn.freebsd.org/changeset/base/239568 > > Log: > Add dependencies based on security(7). > > Modified: > head/etc/rc.d/securelevel > > Modified: head/etc/rc.d/securelevel > ============================================================================== > --- head/etc/rc.d/securelevel Wed Aug 22 18:30:13 2012 (r239567) > +++ head/etc/rc.d/securelevel Wed Aug 22 18:35:17 2012 (r239568) > @@ -4,6 +4,7 @@ > # > > # PROVIDE: securelevel > +# REQUIRE: adjkerntz ipfw ipfilter pf > > . /etc/rc.subr > > -- I am only one, but I am one. I cannot do everything, but I can do something. And I will not let what I cannot do interfere with what I can do. -- Edward Everett Hale, (1822 - 1909) From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 22:17: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 A2B47106564A; Wed, 22 Aug 2012 22:17:36 +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 8E3BA8FC08; Wed, 22 Aug 2012 22:17: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 q7MMHaZv007234; Wed, 22 Aug 2012 22:17:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MMHa5U007231; Wed, 22 Aug 2012 22:17:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208222217.q7MMHa5U007231@svn.freebsd.org> From: Xin LI Date: Wed, 22 Aug 2012 22:17: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: r239595 - head/etc/rc.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: Wed, 22 Aug 2012 22:17:36 -0000 Author: delphij Date: Wed Aug 22 22:17:35 2012 New Revision: 239595 URL: http://svn.freebsd.org/changeset/base/239595 Log: Allow - be used in the name of a provider. Without this change it's not possible to specify a gptid in geli_devices. Modified: head/etc/rc.d/geli head/etc/rc.d/geli2 Modified: head/etc/rc.d/geli ============================================================================== --- head/etc/rc.d/geli Wed Aug 22 21:14:59 2012 (r239594) +++ head/etc/rc.d/geli Wed Aug 22 22:17:35 2012 (r239595) @@ -53,7 +53,7 @@ geli_start() fi for provider in ${devices}; do - provider_=`ltr ${provider} '/' '_'` + provider_=`ltr ${provider} '/-' '_'` eval "flags=\${geli_${provider_}_flags}" if [ -z "${flags}" ]; then Modified: head/etc/rc.d/geli2 ============================================================================== --- head/etc/rc.d/geli2 Wed Aug 22 21:14:59 2012 (r239594) +++ head/etc/rc.d/geli2 Wed Aug 22 22:17:35 2012 (r239595) @@ -42,7 +42,7 @@ geli2_start() devices=`geli_make_list` for provider in ${devices}; do - provider_=`ltr ${provider} '/' '_'` + provider_=`ltr ${provider} '/-' '_'` eval "autodetach=\${geli_${provider_}_autodetach}" if [ -z "${autodetach}" ]; then From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 22:25:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 664) id 83E251065744; Wed, 22 Aug 2012 22:25:12 +0000 (UTC) Date: Wed, 22 Aug 2012 15:25:11 -0700 From: David O'Brien To: Doug Barton Message-ID: <20120822222511.GD78670@dragon.NUXI.org> References: <201208221835.q7MIZI77076855@svn.freebsd.org> <50355121.3070408@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50355121.3070408@FreeBSD.org> X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? 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: r239568 - head/etc/rc.d 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, 22 Aug 2012 22:25:13 -0000 On Wed, Aug 22, 2012 at 02:37:37PM -0700, Doug Barton wrote: > Were these changes discussed somewhere and I missed it? They were not discussed. I did not see the need. This is simple functionality. If securelevel is raised > 0, one cannot start up a firewall nor make major changes to time. Thus these components are required to be done before raising securelevel. > I'm not opposed per se, but the security aspects should be discussed on > freebsd-security@, I'm sorry, I didn't feel that ensuring the software follows the published specification of its functionality to have such a security aspect. > and it's preferable that significant changes to > rcorder be looked at on freebsd-rc@ as well. I don't consider this to be a significant change. I do have some significant changes that I do want freebsd-rc@ to review I will be sending soon. > Can you hold off on MFC'ing any of this until it's been reviewed more > thoroughly? Yes. -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 22:30:05 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 2E9DF106564A; Wed, 22 Aug 2012 22:30:05 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id B10118FC0A; Wed, 22 Aug 2012 22:30:04 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 1592E3592ED; Thu, 23 Aug 2012 00:30:03 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id F02B42847B; Thu, 23 Aug 2012 00:30:02 +0200 (CEST) Date: Thu, 23 Aug 2012 00:30:02 +0200 From: Jilles Tjoelker To: "Simon J. Gerraty" Message-ID: <20120822223002.GA41104@stack.nl> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> <20120821222943.GA27203@stack.nl> <20120821232553.35D4F58085@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120821232553.35D4F58085@chaos.jnpr.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ruslan Ermilov , "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Aug 2012 22:30:05 -0000 On Tue, Aug 21, 2012 at 04:25:53PM -0700, Simon J. Gerraty wrote: > On Wed, 22 Aug 2012 00:29:44 +0200, Jilles Tjoelker writes: > >On FreeBSD, the first two statements are partially false. All sh(1) > >builtins that correspond to utilities specified by POSIX (but not > >special builtins) have versions accessible to execve() (on 8.x and > That's interesting, especially for 'cd', though is there any use case in > which it is actually useful? I'm drawing a blank. I think the most important reason is to reduce special cases. The POSIX developers did not want to create a second subset of utilities that are not available via execve() (the first subset is the special builtins). The burden on implementations is very low (see src/usr.bin/alias), and there are some possible use cases: 'cd' will fail if the directory does not exist. 'command -v' and 'command -V' will show information. 'read' will swallow input. 'type', 'umask' and 'ulimit' will show information. > >older, hash, type and ulimit are missing). This includes cd but not > >chdir, since chdir is not specified by POSIX. Also, FreeBSD make > >includes a somewhat arbitrary list of shell builtins, including cd, that > >cause it to invoke the shell even if there are no metacharacters. > Yes, I pondered whether something like that might be worthwhile, > but since a bare 'cd somewhere' all by itself is rather pointless, it > seemed a corner case. If it avoids the need to add semicolons for mysterious reasons, that may be enough reason. I think make's optimization of executing certain commands directly instead of passing them to sh should be rather invisible to the user, particularly if the optimization may be activated or deactivated by something seemingly innocuous like toggling -j. It seems not entirely possible to hide the optimization completely as that would require deeper knowledge of the shell in make. Shell builtins are usually found before a PATH search and there may be non-standard shell builtins. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 22:34: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 7CF86106566B; Wed, 22 Aug 2012 22:34: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 690588FC12; Wed, 22 Aug 2012 22:34: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 q7MMYulE009506; Wed, 22 Aug 2012 22:34:56 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MMYuCl009504; Wed, 22 Aug 2012 22:34:56 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208222234.q7MMYuCl009504@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 22:34: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: r239596 - head/etc/rc.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: Wed, 22 Aug 2012 22:34:56 -0000 Author: obrien Date: Wed Aug 22 22:34:55 2012 New Revision: 239596 URL: http://svn.freebsd.org/changeset/base/239596 Log: The entire comment block is now spell checked this time -- I promise. Modified: head/etc/rc.d/postrandom Modified: head/etc/rc.d/postrandom ============================================================================== --- head/etc/rc.d/postrandom Wed Aug 22 22:17:35 2012 (r239595) +++ head/etc/rc.d/postrandom Wed Aug 22 22:34:55 2012 (r239596) @@ -15,9 +15,9 @@ start_cmd="${name}_start" stop_cmd=":" # This will remove old ${entropy_file} and generate a new one. -# According to Bruce Schneier, this is strongly recomended in order +# According to Bruce Schneier, this is strongly recommended in order # to avoid using same ${entropy_file} across reboots. -# Reference: Chapter 10.6, Practical Cryptograpy, ISBN: 0-471-22357-3 +# Reference: Chapter 10.6, Practical Cryptography, ISBN: 0-471-22357-3 postrandom_start() { From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 22:48: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 177E5106566B; Wed, 22 Aug 2012 22:48:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 036D08FC14; Wed, 22 Aug 2012 22:48: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 q7MMmoGK011384; Wed, 22 Aug 2012 22:48:50 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MMmojL011382; Wed, 22 Aug 2012 22:48:50 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208222248.q7MMmojL011382@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 22 Aug 2012 22: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: r239597 - 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: Wed, 22 Aug 2012 22:48:51 -0000 Author: gonzo Date: Wed Aug 22 22:48:50 2012 New Revision: 239597 URL: http://svn.freebsd.org/changeset/base/239597 Log: Do not change "cachable" attribute for DMA memory allocated with BUS_DMA_COHERENT attribute The minimum unit for changing "cachable" attribute is page, so call to pmap_change_attr effectively disable cache for all pages that newly allocated DMA memory region spans on. The problem is that general-purpose memory could reside on these pages too and disabling cache might affect performance. Moreover ldrex/strex operators raise Data Abort exception when accessing memory on page with "cachable" attribute off. BUS_DMA_COHERENT does nto require memory to be coherent. It just suggests to do best effort for reducing synchronization overhead. Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Wed Aug 22 22:34:55 2012 (r239596) +++ head/sys/arm/arm/busdma_machdep-v6.c Wed Aug 22 22:48:50 2012 (r239597) @@ -618,10 +618,6 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi } dmat->map_count++; - if (flags & BUS_DMA_COHERENT) - pmap_change_attr((vm_offset_t)*vaddr, len, - BUS_DMA_NOCACHE); - CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, 0); return (0); From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 23:37: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 26F55106564A; Wed, 22 Aug 2012 23:37:25 +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 12CBF8FC08; Wed, 22 Aug 2012 23:37: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 q7MNbOmf017644; Wed, 22 Aug 2012 23:37:24 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MNbORo017642; Wed, 22 Aug 2012 23:37:24 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208222337.q7MNbORo017642@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 23:37: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: r239598 - head/etc/rc.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: Wed, 22 Aug 2012 23:37:25 -0000 Author: obrien Date: Wed Aug 22 23:37:24 2012 New Revision: 239598 URL: http://svn.freebsd.org/changeset/base/239598 Log: * Reinstate r128059's consumption of our best entropy first. r128060 for "hardware-supplied entropy" reversed this without reason, seems a typo. * Isolate "better than nothing" implementation to a function. Submitted by: obrien & Arthur Mesh Sponsored by: Juniper Networks Modified: head/etc/rc.d/initrandom Modified: head/etc/rc.d/initrandom ============================================================================== --- head/etc/rc.d/initrandom Wed Aug 22 22:48:50 2012 (r239597) +++ head/etc/rc.d/initrandom Wed Aug 22 23:37:24 2012 (r239598) @@ -21,6 +21,17 @@ feed_dev_random() fi } +better_than_nothing() +{ + # XXX temporary until we can improve the entropy + # harvesting rate. + # Entropy below is not great, but better than nothing. + # This unblocks the generator at startup + ( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww ) \ + | dd of=/dev/random bs=8k 2>/dev/null + cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null +} + initrandom_start() { soft_random_generator=`sysctl kern.random 2>/dev/null` @@ -52,14 +63,6 @@ initrandom_start() fi fi - # XXX temporary until we can improve the entropy - # harvesting rate. - # Entropy below is not great, but better than nothing. - # This unblocks the generator at startup - ( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww ) \ - | dd of=/dev/random bs=8k 2>/dev/null - cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null - # First pass at reseeding /dev/random. # case ${entropy_file} in @@ -72,6 +75,8 @@ initrandom_start() ;; esac + better_than_nothing() + echo -n ' kickstart' fi From owner-svn-src-head@FreeBSD.ORG Wed Aug 22 23:44: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 DA220106564A; Wed, 22 Aug 2012 23:44:12 +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 AC57F8FC0C; Wed, 22 Aug 2012 23:44: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 q7MNiCFJ018580; Wed, 22 Aug 2012 23:44:12 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7MNiC2n018578; Wed, 22 Aug 2012 23:44:12 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201208222344.q7MNiC2n018578@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Aug 2012 23:44: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: r239599 - head/etc/rc.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: Wed, 22 Aug 2012 23:44:13 -0000 Author: obrien Date: Wed Aug 22 23:44:12 2012 New Revision: 239599 URL: http://svn.freebsd.org/changeset/base/239599 Log: Correct style. Modified: head/etc/rc.d/initrandom Modified: head/etc/rc.d/initrandom ============================================================================== --- head/etc/rc.d/initrandom Wed Aug 22 23:37:24 2012 (r239598) +++ head/etc/rc.d/initrandom Wed Aug 22 23:44:12 2012 (r239599) @@ -75,7 +75,7 @@ initrandom_start() ;; esac - better_than_nothing() + better_than_nothing echo -n ' kickstart' fi From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 00:39: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 D42CB10656DA; Thu, 23 Aug 2012 00:39:33 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og104.obsmtp.com (exprod7og104.obsmtp.com [64.18.2.161]) by mx1.freebsd.org (Postfix) with ESMTP id 311468FC17; Thu, 23 Aug 2012 00:39:32 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob104.postini.com ([64.18.6.12]) with SMTP ID DSNKUDV7vUTMvzPXEcuG7tNxjN6WgzNXOF8T@postini.com; Wed, 22 Aug 2012 17:39:33 PDT Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Wed, 22 Aug 2012 17:36:04 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q7N0a3h67762; Wed, 22 Aug 2012 17:36:04 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 9B58458088; Wed, 22 Aug 2012 17:36:03 -0700 (PDT) To: Jilles Tjoelker In-Reply-To: <20120822223002.GA41104@stack.nl> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> <20120821222943.GA27203@stack.nl> <20120821232553.35D4F58085@chaos.jnpr.net> <20120822223002.GA41104@stack.nl> Comments: In-reply-to: Jilles Tjoelker message dated "Thu, 23 Aug 2012 00:30:02 +0200." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Wed, 22 Aug 2012 17:36:03 -0700 Message-ID: <20120823003603.9B58458088@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ruslan Ermilov , "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 00:39:34 -0000 On Thu, 23 Aug 2012 00:30:02 +0200, Jilles Tjoelker writes: >I think the most important reason is to reduce special cases. The POSIX >developers did not want to create a second subset of utilities that are >not available via execve() (the first subset is the special builtins). >The burden on implementations is very low (see src/usr.bin/alias), and >there are some possible use cases: The burden may be low, but so is the functionality ;-) 'cd' makes little sense in a child process. >'cd' will fail if the directory does not exist. so will 'test -d', and without giving the false impression that something useful will result if the directory does exist. >If it avoids the need to add semicolons for mysterious reasons, that may >be enough reason. I think everyone agrees that re-writing the target to remove the spurious 'cd' would have been better. That aside, I would disagree, at least for the case of 'cd'. It is only the fact that there is probably no way to construct a harmful example that did not involve a shell meta char (hence rendering the existance of /usr/bin/cd irrelevant). 'cd /tmp/dir && rm -rf *' would be rather dangerous if the && (or ;) didn't trigger use of a shell, and since as previously noted just 'cd /tmp/dir' is pretty pointless, the functionality is very low. In over 25 years of writing makefiles, I don't recall seeing this before. >I think make's optimization of executing certain commands directly >instead of passing them to sh should be rather invisible to the user, >particularly if the optimization may be activated or deactivated by >something seemingly innocuous like toggling -j. Changing the way the dependency graph is processed is probably more often the cause of surprises. But yes, makefiles which need work for -j (heck even separate objdirs) are common enough. >It seems not entirely possible to hide the optimization completely as >that would require deeper knowledge of the shell in make. Shell builtins >are usually found before a PATH search and there may be non-standard >shell builtins. True, which is a good argument for having a standard shell as part of the build environment. From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 01:43:02 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 289F2106566C; Thu, 23 Aug 2012 01:43:02 +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 14AC98FC12; Thu, 23 Aug 2012 01:43: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 q7N1h1Fm034133; Thu, 23 Aug 2012 01:43:01 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N1h1FQ034131; Thu, 23 Aug 2012 01:43:01 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201208230143.q7N1h1FQ034131@svn.freebsd.org> From: Jamie Gritton Date: Thu, 23 Aug 2012 01:43: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: r239601 - 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: Thu, 23 Aug 2012 01:43:02 -0000 Author: jamie Date: Thu Aug 23 01:43:01 2012 New Revision: 239601 URL: http://svn.freebsd.org/changeset/base/239601 Log: Remember that I'm using length-defined strings in parameters: Remove a bogus null terminator when stripping the netmask from IP addresses. This was causing later addresses in a comma-separated string to disappear. Use memcpy instead of strcpy. This could just cause Bad Things. PR: 170832 MFC after: 1 week Modified: head/usr.sbin/jail/config.c Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Thu Aug 23 00:39:08 2012 (r239600) +++ head/usr.sbin/jail/config.c Thu Aug 23 01:43:01 2012 (r239601) @@ -597,8 +597,7 @@ check_intparams(struct cfjail *j) "ip4.addr: bad netmask \"%s\"", cs); error = -1; } - *cs = '\0'; - s->len = cs - s->s + 1; + s->len = cs - s->s; } } } @@ -621,8 +620,7 @@ check_intparams(struct cfjail *j) cs); error = -1; } - *cs = '\0'; - s->len = cs - s->s + 1; + s->len = cs - s->s; } } } @@ -714,7 +712,7 @@ import_params(struct cfjail *j) value = alloca(vallen); cs = value; TAILQ_FOREACH_SAFE(s, &p->val, tq, ts) { - strcpy(cs, s->s); + memcpy(cs, s->s, s->len); if (ts != NULL) { cs += s->len + 1; cs[-1] = ','; From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 01:43: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 1BB2E106566B; Thu, 23 Aug 2012 01:43:23 +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 071038FC12; Thu, 23 Aug 2012 01:43: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 q7N1hMgd034215; Thu, 23 Aug 2012 01:43:22 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N1hM61034213; Thu, 23 Aug 2012 01:43:22 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201208230143.q7N1hM61034213@svn.freebsd.org> From: Jamie Gritton Date: Thu, 23 Aug 2012 01:43:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239602 - 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: Thu, 23 Aug 2012 01:43:23 -0000 Author: jamie Date: Thu Aug 23 01:43:22 2012 New Revision: 239602 URL: http://svn.freebsd.org/changeset/base/239602 Log: Pre-separate IP addresses passed on the command line, so they can be properly parsed for interface prefixes and netmask suffixes. This was already done for the old-style (fixed) command line, but missed for the new-style. MFC after: 1 week Modified: head/usr.sbin/jail/jail.c Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Thu Aug 23 01:43:01 2012 (r239601) +++ head/usr.sbin/jail/jail.c Thu Aug 23 01:43:22 2012 (r239602) @@ -304,9 +304,33 @@ main(int argc, char **argv) for (i++; i < argc; i++) add_param(NULL, NULL, IP_COMMAND, argv[i]); - break; } - add_param(NULL, NULL, 0, argv[i]); +#ifdef INET + else if (!strncmp(argv[i], "ip4.addr=", 9)) { + for (cs = argv[i] + 9;; cs = ncs + 1) { + ncs = strchr(cs, ','); + if (ncs) + *ncs = '\0'; + add_param(NULL, NULL, KP_IP4_ADDR, cs); + if (!ncs) + break; + } + } +#endif +#ifdef INET6 + else if (!strncmp(argv[i], "ip6.addr=", 9)) { + for (cs = argv[i] + 9;; cs = ncs + 1) { + ncs = strchr(cs, ','); + if (ncs) + *ncs = '\0'; + add_param(NULL, NULL, KP_IP6_ADDR, cs); + if (!ncs) + break; + } + } +#endif + else + add_param(NULL, NULL, 0, argv[i]); } } else { /* From the config file, perhaps with a specified jail */ From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 02:58: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 4EF94106566C; Thu, 23 Aug 2012 02:58:07 +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 3AB398FC14; Thu, 23 Aug 2012 02:58: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 q7N2w71K043759; Thu, 23 Aug 2012 02:58:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N2w7Xo043757; Thu, 23 Aug 2012 02:58:07 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208230258.q7N2w7Xo043757@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Aug 2012 02:58: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: r239603 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 02:58:07 -0000 Author: adrian Date: Thu Aug 23 02:58:06 2012 New Revision: 239603 URL: http://svn.freebsd.org/changeset/base/239603 Log: Add chipset names. Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Thu Aug 23 01:43:22 2012 (r239602) +++ head/sys/dev/ath/ath_hal/ah.c Thu Aug 23 02:58:06 2012 (r239603) @@ -101,9 +101,9 @@ ath_hal_mac_name(struct ath_hal *ah) return "5413"; case AR_SREV_VERSION_COBRA: return "2415"; - case AR_SREV_2425: + case AR_SREV_2425: /* Swan */ return "2425"; - case AR_SREV_2417: + case AR_SREV_2417: /* Nala */ return "2417"; case AR_XSREV_VERSION_OWL_PCI: return "5416"; From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 03:03: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 9DAF2106564A; Thu, 23 Aug 2012 03:03:01 +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 7E6278FC0A; Thu, 23 Aug 2012 03:03: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 q7N331q7044527; Thu, 23 Aug 2012 03:03:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N331Wh044523; Thu, 23 Aug 2012 03:03:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208230303.q7N331Wh044523@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Aug 2012 03:03: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: r239604 - in head/sys/dev/ath/ath_hal: . ar9003 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 03:03:01 -0000 Author: adrian Date: Thu Aug 23 03:03:00 2012 New Revision: 239604 URL: http://svn.freebsd.org/changeset/base/239604 Log: Add AR9380 devid HAL definitions and probe/attach strings. Obtained from: Device IDs are from Qualcomm Atheros Added: head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Thu Aug 23 02:58:06 2012 (r239603) +++ head/sys/dev/ath/ath_hal/ah.c Thu Aug 23 03:03:00 2012 (r239604) @@ -24,6 +24,7 @@ #include "ah_eeprom.h" /* for 5ghz fast clock flag */ #include "ar5416/ar5416reg.h" /* NB: includes ar5212reg.h */ +#include "ar9003/ar9300_devid.h" /* linker set of registered chips */ OS_SET_DECLARE(ah_chips, struct ath_hal_chip); @@ -123,6 +124,21 @@ ath_hal_mac_name(struct ath_hal *ah) if (AH_PRIVATE(ah)->ah_ispcie) return "9287"; return "9227"; + case AR_SREV_VERSION_AR9380: + if (ah->ah_macRev >= AR_SREV_REVISION_AR9580_10) + return "9580"; + return "9380"; + case AR_SREV_VERSION_AR9460: + return "9460"; + case AR_SREV_VERSION_AR9330: + return "9330"; + case AR_SREV_VERSION_AR9340: + return "9340"; + case AR_SREV_VERSION_QCA9550: + /* XXX should say QCA, not AR */ + return "9550"; + case AR_SREV_VERSION_AR9485: + return "9485"; } return "????"; } Added: head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h Thu Aug 23 03:03:00 2012 (r239604) @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2012, Qualcomm Atheros, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the following conditions are met: + * 1. The materials contained herein are unmodified and are used + * unmodified. + * 2. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following NO + * ''WARRANTY'' disclaimer below (''Disclaimer''), without + * modification. + * 3. Redistributions in binary form must reproduce at minimum a + * disclaimer similar to the Disclaimer below and any redistribution + * must be conditioned upon including a substantially similar + * Disclaimer requirement for further binary redistribution. + * 4. Neither the names of the above-listed copyright holders nor the + * names of any contributors may be used to endorse or promote + * product derived from this software without specific prior written + * permission. + * + * 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 __AR9300_DEVID_H__ +#define __AR9300_DEVID_H__ + +/* + * AR9380 HAL device IDs. + */ + +/* + * MAC Version and Revision + */ +#define AR_SREV_VERSION_AR9380 0x1C0 +#define AR_SREV_VERSION_AR9580 0x1C0 +#define AR_SREV_VERSION_AR9460 0x280 + +#define AR_SREV_VERSION_AR9330 0x200 +#define AR_SREV_VERSION_AR9340 0x300 +#define AR_SREV_VERSION_QCA9550 0x400 +#define AR_SREV_VERSION_AR9485 0x240 + +#define AR_SREV_REVISION_AR9380_10 0 /* AR9380 1.0 */ +#define AR_SREV_REVISION_AR9380_20 2 /* AR9380 2.0/2.1 */ +#define AR_SREV_REVISION_AR9380_22 3 /* AR9380 2.2 */ +#define AR_SREV_REVISION_AR9580_10 4 /* AR9580/Peacock 1.0 */ + +#define AR_SREV_REVISION_AR9330_10 0 /* AR9330 1.0 */ +#define AR_SREV_REVISION_AR9330_11 1 /* AR9330 1.1 */ +#define AR_SREV_REVISION_AR9330_12 2 /* AR9330 1.2 */ +#define AR_SREV_REVISION_AR9330_11_MASK 0xf /* AR9330 1.1 revision mask */ + +#define AR_SREV_REVISION_AR9485_10 0 /* AR9485 1.0 */ +#define AR_SREV_REVISION_AR9485_11 1 /* AR9485 1.1 */ + +#define AR_SREV_REVISION_AR9340_10 0 /* AR9340 1.0 */ +#define AR_SREV_REVISION_AR9340_11 1 /* AR9340 1.1 */ +#define AR_SREV_REVISION_AR9340_12 2 /* AR9340 1.2 */ +#define AR_SREV_REVISION_AR9340_MASK 0xf /* AR9340 revision mask */ + +#define AR_SREV_REVISION_AR9460_10 0 /* AR946x 1.0 */ + +#endif /* __AR9300_DEVID_H__ */ From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 03:25: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 D78F5106564A; Thu, 23 Aug 2012 03:25:09 +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 C29EB8FC12; Thu, 23 Aug 2012 03:25: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 q7N3P9G1047600; Thu, 23 Aug 2012 03:25:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N3P9Od047598; Thu, 23 Aug 2012 03:25:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208230325.q7N3P9Od047598@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Aug 2012 03: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: r239605 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 03:25:10 -0000 Author: adrian Date: Thu Aug 23 03:25:09 2012 New Revision: 239605 URL: http://svn.freebsd.org/changeset/base/239605 Log: Add some more interrupt handling bits. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Thu Aug 23 03:03:00 2012 (r239604) +++ head/sys/dev/ath/ath_hal/ah.h Thu Aug 23 03:25:09 2012 (r239605) @@ -412,20 +412,23 @@ typedef enum { typedef enum { HAL_INT_RX = 0x00000001, /* Non-common mapping */ HAL_INT_RXDESC = 0x00000002, /* Legacy mapping */ + HAL_INT_RXERR = 0x00000004, HAL_INT_RXHP = 0x00000001, /* EDMA */ HAL_INT_RXLP = 0x00000002, /* EDMA */ - HAL_INT_RXERR = 0x00000004, HAL_INT_RXNOFRM = 0x00000008, HAL_INT_RXEOL = 0x00000010, HAL_INT_RXORN = 0x00000020, HAL_INT_TX = 0x00000040, /* Non-common mapping */ HAL_INT_TXDESC = 0x00000080, HAL_INT_TIM_TIMER= 0x00000100, + HAL_INT_MCI = 0x00000200, + HAL_INT_BBPANIC = 0x00000400, HAL_INT_TXURN = 0x00000800, HAL_INT_MIB = 0x00001000, HAL_INT_RXPHY = 0x00004000, HAL_INT_RXKCM = 0x00008000, HAL_INT_SWBA = 0x00010000, + HAL_INT_BRSSI = 0x00020000, HAL_INT_BMISS = 0x00040000, HAL_INT_BNR = 0x00100000, HAL_INT_TIM = 0x00200000, /* Non-common mapping */ @@ -435,6 +438,8 @@ typedef enum { HAL_INT_CABEND = 0x02000000, /* Non-common mapping */ HAL_INT_TSFOOR = 0x04000000, /* Non-common mapping */ HAL_INT_TBTT = 0x08000000, /* Non-common mapping */ + /* Atheros ref driver has a generic timer interrupt now..*/ + HAL_INT_GENTIMER = 0x08000000, /* Non-common mapping */ HAL_INT_CST = 0x10000000, /* Non-common mapping */ HAL_INT_GTT = 0x20000000, /* Non-common mapping */ HAL_INT_FATAL = 0x40000000, /* Non-common mapping */ @@ -457,6 +462,7 @@ typedef enum { | HAL_INT_RXKCM | HAL_INT_SWBA | HAL_INT_BMISS + | HAL_INT_BRSSI | HAL_INT_BNR | HAL_INT_GPIO, } HAL_INT; From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 03:37: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 19098106564A; Thu, 23 Aug 2012 03:37:02 +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 02CB78FC08; Thu, 23 Aug 2012 03:37: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 q7N3b1ev049142; Thu, 23 Aug 2012 03:37:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N3b1DK049140; Thu, 23 Aug 2012 03:37:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208230337.q7N3b1DK049140@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Aug 2012 03:37: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: r239606 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 03:37:02 -0000 Author: adrian Date: Thu Aug 23 03:37:01 2012 New Revision: 239606 URL: http://svn.freebsd.org/changeset/base/239606 Log: Add a placeholder and typedefs for MFP (management frame protection.) Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Thu Aug 23 03:25:09 2012 (r239605) +++ head/sys/dev/ath/ath_hal/ah.h Thu Aug 23 03:37:01 2012 (r239606) @@ -830,6 +830,16 @@ typedef enum { } HAL_DFS_DOMAIN; /* + * MFP decryption options for initializing the MAC. + */ + +typedef enum { + HAL_MFP_QOSDATA = 0, /* Decrypt MFP frames like QoS data frames. All chips before Merlin. */ + HAL_MFP_PASSTHRU, /* Don't decrypt MFP frames at all. Passthrough */ + HAL_MFP_HW_CRYPTO /* hardware decryption enabled. Merlin can do it. */ +} HAL_MFP_OPT_T; + +/* * Flag for setting QUIET period */ typedef enum { @@ -1404,4 +1414,14 @@ int __ahdecl ath_hal_getcca(struct ath_h HAL_BOOL __ahdecl ath_hal_EepromDataRead(struct ath_hal *ah, u_int off, uint16_t *data); +/* + * For now, simply pass through MFP frames. + */ +static inline u_int32_t +ath_hal_get_mfp_qos(struct ath_hal *ah) +{ + //return AH_PRIVATE(ah)->ah_mfp_qos; + return HAL_MFP_QOSDATA; +} + #endif /* _ATH_AH_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 03:43: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 636081065674; Thu, 23 Aug 2012 03:43:01 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 0CFF78FC16; Thu, 23 Aug 2012 03:43:00 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q7N3h0QN097115; Wed, 22 Aug 2012 21:43:00 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q7N3gxWI097114; Wed, 22 Aug 2012 21:42:59 -0600 (MDT) (envelope-from ken) Date: Wed, 22 Aug 2012 21:42:59 -0600 From: "Kenneth D. Merry" To: Gleb Smirnoff Message-ID: <20120823034259.GA97058@nargothrond.kdm.org> References: <201208021357.q72DvoFJ088426@svn.freebsd.org> <20120802213344.GF70185@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120802213344.GF70185@FreeBSD.org> User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, "Bjoern A. Zeeb" , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238990 - in head/sys: net 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: Thu, 23 Aug 2012 03:43:01 -0000 On Fri, Aug 03, 2012 at 01:33:44 +0400, Gleb Smirnoff wrote: > On Thu, Aug 02, 2012 at 04:46:42PM +0000, Bjoern A. Zeeb wrote: > B> On Thu, 2 Aug 2012, Gleb Smirnoff wrote: > B> > B> > Author: glebius > B> > Date: Thu Aug 2 13:57:49 2012 > B> > New Revision: 238990 > B> > URL: http://svn.freebsd.org/changeset/base/238990 > B> > > B> > Log: > B> > Fix races between in_lltable_prefix_free(), lla_lookup(), > B> > llentry_free() and arptimer(): > B> > > B> > o Use callout_init_rw() for lle timeout, this allows us safely > B> > disestablish them. > B> > - This allows us to simplify the arptimer() and make it > B> > race safe. > B> > o Consistently use ifp->if_afdata_lock to lock access to > B> > linked lists in the lle hashes. > B> > o Introduce new lle flag LLE_LINKED, which marks an entry that > B> > is attached to the hash. > B> > - Use LLE_LINKED to avoid double unlinking via consequent > B> > calls to llentry_free(). > B> > - Mark lle with LLE_DELETED via |= operation istead of =, > B> > so that other flags won't be lost. > B> > o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more > B> > consistent and provide more informative KASSERTs. > B> > > B> > The patch is a collaborative work of all submitters and myself. > B> > B> Quoting from 2 year old memory you just introduced a possible deadlock > B> on tbale (or with that networkstack) teardown adding the extra af_data > B> write locking to the table walk. > > Can you please give more details? I didn't get it. What else needs > afdata lock and what does it hold which is held by table walk. Is there a deadlock in that particular change? If so, what will it take to fix it? Thanks, Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 04:35: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 2CDD8106564A; Thu, 23 Aug 2012 04:35:56 +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 F30948FC17; Thu, 23 Aug 2012 04:35: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 q7N4ZtsC057109; Thu, 23 Aug 2012 04:35:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N4Ztvq057107; Thu, 23 Aug 2012 04:35:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208230435.q7N4Ztvq057107@svn.freebsd.org> From: Warner Losh Date: Thu, 23 Aug 2012 04:35: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: r239607 - head/sys/dev/mmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 04:35:56 -0000 Author: imp Date: Thu Aug 23 04:35:55 2012 New Revision: 239607 URL: http://svn.freebsd.org/changeset/base/239607 Log: The check for MAXPHYS doesn't make sense, so remove it. Report errors indicated by the transport. If this is too chatty, I'll throw it behind a debug write. Remove commented out debugs that are no longer useful. Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Thu Aug 23 03:37:01 2012 (r239606) +++ head/sys/dev/mmc/mmcsd.c Thu Aug 23 04:35:55 2012 (r239607) @@ -88,6 +88,17 @@ struct mmcsd_softc { int suspend; }; +static const char *errmsg[] = +{ + "None", + "Timeout", + "Bad CRC", + "Fifo", + "Failed", + "Invalid", + "NO MEMORY" +}; + /* bus entry points */ static int mmcsd_attach(device_t dev); static int mmcsd_detach(device_t dev); @@ -169,13 +180,10 @@ mmcsd_attach(device_t dev) /* * Report the clock speed of the underlying hardware, which might be * different than what the card reports due to hardware limitations. - * Report how many blocks the hardware transfers at once, but clip the - * number to MAXPHYS since the system won't initiate larger transfers. + * Report how many blocks the hardware transfers at once. */ speed = mmcbr_get_clock(device_get_parent(dev)); maxblocks = mmc_get_max_data(dev); - if (maxblocks > MAXPHYS) - maxblocks = MAXPHYS; device_printf(dev, "%ju%cB <%s>%s at %s %d.%01dMHz/%dbit/%d-block\n", mb, unit, mmc_get_card_id_string(dev), mmc_get_read_only(dev) ? " (read-only)" : "", @@ -286,6 +294,14 @@ mmcsd_strategy(struct bio *bp) } } +static const char * +mmcsd_errmsg(int e) +{ + if (e < 0 || e > MMC_ERR_MAX) + return "Bad error code"; + return errmsg[e]; +} + static daddr_t mmcsd_rw(struct mmcsd_softc *sc, struct bio *bp) { @@ -337,12 +353,13 @@ mmcsd_rw(struct mmcsd_softc *sc, struct stop.flags = MMC_RSP_R1B | MMC_CMD_AC; req.stop = &stop; } -// printf("Len %d %lld-%lld flags %#x sz %d\n", -// (int)data.len, (long long)block, (long long)end, data.flags, sz); MMCBUS_WAIT_FOR_REQUEST(device_get_parent(dev), dev, &req); - if (req.cmd->error != MMC_ERR_NONE) + if (req.cmd->error != MMC_ERR_NONE) { + device_printf(dev, "Error indicated: %d %s\n", + req.cmd->error, mmcsd_errmsg(req.cmd->error)); break; + } block += numblocks; } return (block); From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 04:41: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 9DD4C106564A; Thu, 23 Aug 2012 04:41:39 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 163CB8FC0C; Thu, 23 Aug 2012 04:41:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q7N4fbns015923; Thu, 23 Aug 2012 08:41:37 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q7N4fbY0015918; Thu, 23 Aug 2012 08:41:37 +0400 (MSK) (envelope-from ache) Date: Thu, 23 Aug 2012 08:41:37 +0400 From: Andrey Chernov To: Hajimu UMEMOTO Message-ID: <20120823044137.GA7987@vniz.net> Mail-Followup-To: Andrey Chernov , Hajimu UMEMOTO , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> <20120821063027.GA41459@vniz.net> <20120822000645.GA54651@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r239356 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 04:41:39 -0000 On Thu, Aug 23, 2012 at 12:27:46AM +0900, Hajimu UMEMOTO wrote: > A link-local address has a scope; an interface here. You cannot omit > it on FreeBSD by default. To be able to omit it, specify something > like ipv6_default_interface="em0" in your /etc/rc.conf. Please enlighten me a bit. RFC 4007 "11.6. Omitting Zone Indices" states: "The format defined in this document does not intend to invalidate the original format for non-global addresses; that is, the format without the zone index portion. As described in Section 6, in some common cases with the notion of the default zone index, there can be no ambiguity about scope zones. In such an environment, the implementation can omit the "%" part." Does absolutely trusted IPv6 local net using link-local addresses only falls in that case? If yes, is there a way to make address scope optional for all link-local addresses in FreeBSD? Are link-local addresses ever usable for DNS or not due to their % part? F.e. for the case there is no global IPv6 net assigned at all but pure isolated IPv6 local network. > In anyway, I don't recommend to use a link-local address for DNS. Is it only due to their scope part or other reasons exists too? -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 05:15: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 CE9DF1065676; Thu, 23 Aug 2012 05:15:15 +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 B9BBA8FC16; Thu, 23 Aug 2012 05:15:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7N5FFsL062299; Thu, 23 Aug 2012 05:15:15 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7N5FFHc062297; Thu, 23 Aug 2012 05:15:15 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201208230515.q7N5FFHc062297@svn.freebsd.org> From: David Xu Date: Thu, 23 Aug 2012 05:15: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: r239609 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 05:15:15 -0000 Author: davidxu Date: Thu Aug 23 05:15:15 2012 New Revision: 239609 URL: http://svn.freebsd.org/changeset/base/239609 Log: Eliminate redundant code, _thr_spinlock_init() has already been called in init_private(), don't call it again in fork() wrapper. Modified: head/lib/libthr/thread/thr_fork.c Modified: head/lib/libthr/thread/thr_fork.c ============================================================================== --- head/lib/libthr/thread/thr_fork.c Thu Aug 23 04:57:56 2012 (r239608) +++ head/lib/libthr/thread/thr_fork.c Thu Aug 23 05:15:15 2012 (r239609) @@ -200,9 +200,6 @@ _fork(void) _rtld_atfork_post(rtld_locks); _thr_setthreaded(0); - /* reinitialize libc spinlocks. */ - _thr_spinlock_init(); - /* reinitalize library. */ _libpthread_init(curthread); From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 08:55: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 04841106566B; Thu, 23 Aug 2012 08:55:58 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id EB5F48FC15; Thu, 23 Aug 2012 08:55:56 +0000 (UTC) Received: from ameno.mahoroba.org (IDENT:Z1fJRrNRM+0ffE0naoJB4jgRcxh3yDTLzcEsx4X76WygOU74ZXpGZ9mLnRkCJsxu@ameno.mahoroba.org [IPv6:2001:2f0:104:8010:20a:79ff:fe69:ee6b]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.5/8.14.5) with ESMTP/inet6 id q7N8tlLh037496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 23 Aug 2012 17:55:51 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Thu, 23 Aug 2012 17:55:47 +0900 Message-ID: From: Hajimu UMEMOTO To: Andrey Chernov In-Reply-To: <20120823044137.GA7987@vniz.net> References: <20120818195724.GA74684@vniz.net> <201208201409.55544.jhb@freebsd.org> <20120821010311.GA8250@vniz.net> <20120821044553.GA11375@vniz.net> <20120821063027.GA41459@vniz.net> <20120822000645.GA54651@vniz.net> <20120823044137.GA7987@vniz.net> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/24.1 (i386-portbld-freebsd9.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 9.1-RC1 X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Thu, 23 Aug 2012 17:55:51 +0900 (JST) X-Virus-Scanned: clamav-milter 0.97.5 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r239356 - head/sbin/dhclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 08:55:58 -0000 Hi, >>>>> On Thu, 23 Aug 2012 08:41:37 +0400 >>>>> Andrey Chernov said: ache> On Thu, Aug 23, 2012 at 12:27:46AM +0900, Hajimu UMEMOTO wrote: > A link-local address has a scope; an interface here. You cannot omit > it on FreeBSD by default. To be able to omit it, specify something > like ipv6_default_interface="em0" in your /etc/rc.conf. ache> Please enlighten me a bit. ache> RFC 4007 "11.6. Omitting Zone Indices" states: ache> "The format defined in this document does not intend to invalidate the ache> original format for non-global addresses; that is, the format without ache> the zone index portion. As described in Section 6, in some common ache> cases with the notion of the default zone index, there can be no ache> ambiguity about scope zones. In such an environment, the ache> implementation can omit the "%" part." ache> Does absolutely trusted IPv6 local net using link-local addresses only ache> falls in that case? If yes, is there a way to make address scope optional ache> for all link-local addresses in FreeBSD? FreeBSD doesn't have a feature to define a zone manually. If a node has more than one interfaces, a link-local address without zone identifer has ambiguity. If you mean `all link-local addresses' are within one interface, yes, you can omit zone identifer by setting ipv6_default_interface' ache> Are link-local addresses ever usable for DNS or not due to their ache> % part? F.e. for the case there is no global IPv6 net assigned at ache> all but pure isolated IPv6 local network. > In anyway, I don't recommend to use a link-local address for DNS. ache> Is it only due to their scope part or other reasons exists too? As you saw, dig(1) and host(1) doesn't work well with a link-local address. Not only a zone identifier, but also some implementation may handle a link-local address (fe80:: prefix) as special. Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 10:38: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 7F885106564A; Thu, 23 Aug 2012 10:38:54 +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 2B1878FC0C; Thu, 23 Aug 2012 10:38:53 +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 8515725D3888; Thu, 23 Aug 2012 10:38:46 +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 9897ABE84F2; Thu, 23 Aug 2012 10:38:45 +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 m-UkyGeRzPpU; Thu, 23 Aug 2012 10:38:44 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 29A20BE84F1; Thu, 23 Aug 2012 10:38:44 +0000 (UTC) Date: Thu, 23 Aug 2012 10:38:43 +0000 (UTC) From: "Bjoern A. Zeeb" To: John Baldwin In-Reply-To: <201208222000.q7MK0ff6089027@svn.freebsd.org> Message-ID: References: <201208222000.q7MK0ff6089027@svn.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239584 - 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, 23 Aug 2012 10:38:54 -0000 On Wed, 22 Aug 2012, John Baldwin wrote: > Author: jhb > Date: Wed Aug 22 20:00:41 2012 > New Revision: 239584 > URL: http://svn.freebsd.org/changeset/base/239584 > > Log: > Fix the 'show witness' DDB command to honor db_pager_quit. Thanks! -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 12:20: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 6D257106567C; Thu, 23 Aug 2012 12:20:30 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 589228FC14; Thu, 23 Aug 2012 12:20: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 q7NCKUOf022584; Thu, 23 Aug 2012 12:20:30 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NCKUSh022582; Thu, 23 Aug 2012 12:20:30 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208231220.q7NCKUSh022582@svn.freebsd.org> From: Andrey Zonov Date: Thu, 23 Aug 2012 12:20: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: r239611 - head/usr.bin/truss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 12:20:30 -0000 Author: zont Date: Thu Aug 23 12:20:29 2012 New Revision: 239611 URL: http://svn.freebsd.org/changeset/base/239611 Log: - Put arguments for print_syscall_ret() function in proper order. Bug was introduced in r192025. Approved by: kib (mentor) Modified: head/usr.bin/truss/ia64-fbsd.c Modified: head/usr.bin/truss/ia64-fbsd.c ============================================================================== --- head/usr.bin/truss/ia64-fbsd.c Thu Aug 23 09:18:52 2012 (r239610) +++ head/usr.bin/truss/ia64-fbsd.c Thu Aug 23 12:20:29 2012 (r239611) @@ -294,7 +294,7 @@ ia64_syscall_exit(struct trussinfo *trus */ print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, - fsc.sc, retval); + retval, fsc.sc); clear_fsc(); return (retval); From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 14:27: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 B46CA106567F; Thu, 23 Aug 2012 14:27: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 89EDF8FC08; Thu, 23 Aug 2012 14:27:46 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E0734B91E; Thu, 23 Aug 2012 10:27:45 -0400 (EDT) From: John Baldwin To: Oleksandr Tymoshenko Date: Thu, 23 Aug 2012 07:46:57 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208222248.q7MMmojL011382@svn.freebsd.org> In-Reply-To: <201208222248.q7MMmojL011382@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201208230746.57495.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 23 Aug 2012 10:27:46 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239597 - 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, 23 Aug 2012 14:27:46 -0000 On Wednesday, August 22, 2012 6:48:50 pm Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Wed Aug 22 22:48:50 2012 > New Revision: 239597 > URL: http://svn.freebsd.org/changeset/base/239597 > > Log: > Do not change "cachable" attribute for DMA memory allocated with > BUS_DMA_COHERENT attribute > > The minimum unit for changing "cachable" attribute is page, so call > to pmap_change_attr effectively disable cache for all pages that newly > allocated DMA memory region spans on. The problem is that general-purpose > memory could reside on these pages too and disabling cache might affect > performance. Moreover ldrex/strex operators raise Data Abort exception > when accessing memory on page with "cachable" attribute off. > > BUS_DMA_COHERENT does nto require memory to be coherent. It just suggests > to do best effort for reducing synchronization overhead. Alternatively you could force an allocation with BUS_DMA_COHERENT to always allocate at least one page. Also, it is probably better to match what I recently did in x86 and use kmem_alloc_contig() or kmem_alloc_attr() for allocations with a custom memory attribute rather than using pmap_change_attr() directly. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 14:27: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 6C5BD1065670; Thu, 23 Aug 2012 14:27:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 2BBAC8FC18; Thu, 23 Aug 2012 14:27:50 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 73FFDB91E; Thu, 23 Aug 2012 10:27:49 -0400 (EDT) From: John Baldwin To: Marius Strobl , Bjoern Zeeb Date: Thu, 23 Aug 2012 10:12:52 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201111182239.pAIMdkCr003347@svn.freebsd.org> In-Reply-To: <201111182239.pAIMdkCr003347@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201208231012.52720.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 23 Aug 2012 10:27:49 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227687 - 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: Thu, 23 Aug 2012 14:27:50 -0000 On Friday, November 18, 2011 5:39:46 pm Marius Strobl wrote: > Author: marius > Date: Fri Nov 18 22:39:46 2011 > New Revision: 227687 > URL: http://svn.freebsd.org/changeset/base/227687 > > Log: > - Add a hint.miibus.X.phymask hint, allowing do individually exclude PHY > addresses from being probed and attaching something including ukphy(4) > to it. This is mainly necessarily for PHY switches that create duplicate > or fake PHYs on the bus that can corrupt the PHY state when accessed or > simply cause problems when ukphy(4) isolates the additional instances. > - Change miibus(4) to be a hinted bus, allowing to add child devices via > hints and to set their attach arguments (including for automatically > probed PHYs). This is mainly needed for PHY switches that violate IEEE > 802.3 and don't even implement the basic register set so we can't probe > them automatically. However, the ability to alter the attach arguments > for automatically probed PHYs is also useful as for example it allows > to test (or tell a user to test) new variant of a PHY with a specific > driver by letting an existing driver attach to it via manipulating the > IDs without the need to touch the source code or to limit a Gigabit > Ethernet PHY to only announce up to Fast Ethernet in order to save > energy by limiting the capability mask. Generally, a driver has to > be hinted via hint.phydrv.X.at="miibusY" and hint.phydrv.X.phyno="Z" > (which already is sufficient to add phydrvX at miibusY at PHY address > Z). Then optionally the following attach arguments additionally can > be configured: > hint.phydrv.X.id1 > hint.phydrv.X.id2 > hint.phydrv.X.capmask > - Some minor cleanup. I was looking at this today with bz to try to figure out how to use this. It strikes me that in a case of a bus with devices that have IDs it can be useful to not hardcode the driver name and unit number, but to be able to create a device and let the normal driver probe mechanics work. The existing miibus_hinted_child() routine already largely enforces that by ensuring that any new child has a unique phyno address. Two approaches I can think of are: 1) Never hardcode the name and unit number. 2) Don't hardcode the name and unit number if the name is "phy". This would let you do something like: hint.phy.0.at="miibus0" hint.phy.0.phyno="1" hint.phy.0.id1="xxx" hint.phy.0.id2="yyy" And then 'e1000phy' or 'brphy' or whoever could manage the phy. Though perhaps in the case of hinted children you want to always force the phy driver? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 16:00: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 BB14D1065670; Thu, 23 Aug 2012 16:00:04 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by mx1.freebsd.org (Postfix) with ESMTP id 788878FC08; Thu, 23 Aug 2012 16:00:04 +0000 (UTC) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id C95294C03BA; Thu, 23 Aug 2012 11:00:03 -0500 (CDT) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id C7B1A4C03A0; Thu, 23 Aug 2012 11:00:03 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id Eq9XAP9KyIBE; Thu, 23 Aug 2012 11:00:03 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id 916FB4C0372; Thu, 23 Aug 2012 11:00:01 -0500 (CDT) Message-ID: <5036537F.2060801@rice.edu> Date: Thu, 23 Aug 2012 10:59:59 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: John Baldwin References: <201208222248.q7MMmojL011382@svn.freebsd.org> <201208230746.57495.jhb@freebsd.org> In-Reply-To: <201208230746.57495.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Oleksandr Tymoshenko , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239597 - 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, 23 Aug 2012 16:00:05 -0000 On 08/23/2012 06:46, John Baldwin wrote: > On Wednesday, August 22, 2012 6:48:50 pm Oleksandr Tymoshenko wrote: >> Author: gonzo >> Date: Wed Aug 22 22:48:50 2012 >> New Revision: 239597 >> URL: http://svn.freebsd.org/changeset/base/239597 >> >> Log: >> Do not change "cachable" attribute for DMA memory allocated with >> BUS_DMA_COHERENT attribute >> >> The minimum unit for changing "cachable" attribute is page, so call >> to pmap_change_attr effectively disable cache for all pages that newly >> allocated DMA memory region spans on. The problem is that general-purpose >> memory could reside on these pages too and disabling cache might affect >> performance. Moreover ldrex/strex operators raise Data Abort exception >> when accessing memory on page with "cachable" attribute off. >> >> BUS_DMA_COHERENT does nto require memory to be coherent. It just suggests >> to do best effort for reducing synchronization overhead. > Alternatively you could force an allocation with BUS_DMA_COHERENT to always > allocate at least one page. Also, it is probably better to match what I > recently did in x86 and use kmem_alloc_contig() or kmem_alloc_attr() for > allocations with a custom memory attribute rather than using > pmap_change_attr() directly. > The arm pmap doesn't have the necessary support for memory attributes. pmap_page_{get,set}_memattr() are just stubs. Alan From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 16:25: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 2332C106566B; Thu, 23 Aug 2012 16:25:37 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D4E18FC20; Thu, 23 Aug 2012 16:25: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 q7NGPa5s057571; Thu, 23 Aug 2012 16:25:36 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NGPadO057568; Thu, 23 Aug 2012 16:25:36 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201208231625.q7NGPadO057568@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 23 Aug 2012 16:25: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: r239612 - head/sbin/camcontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 16:25:37 -0000 Author: jh Date: Thu Aug 23 16:25:36 2012 New Revision: 239612 URL: http://svn.freebsd.org/changeset/base/239612 Log: Check the return value of sbuf_finish(). Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Aug 23 12:20:29 2012 (r239611) +++ head/sbin/camcontrol/camcontrol.c Thu Aug 23 16:25:36 2012 (r239612) @@ -4758,7 +4758,10 @@ try_long: smp_report_general_sbuf(response, sizeof(*response), sb); - sbuf_finish(sb); + if (sbuf_finish(sb) != 0) { + warnx("%s: sbuf_finish", __func__); + goto bailout; + } printf("%s", sbuf_data(sb)); @@ -5129,7 +5132,10 @@ smpmaninfo(struct cam_device *device, in smp_report_manuf_info_sbuf(&response, sizeof(response), sb); - sbuf_finish(sb); + if (sbuf_finish(sb) != 0) { + warnx("%s: sbuf_finish", __func__); + goto bailout; + } printf("%s", sbuf_data(sb)); From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 17:03: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 4FFD2106564A; Thu, 23 Aug 2012 17:03:34 +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 3BF8A8FC12; Thu, 23 Aug 2012 17:03: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 q7NH3YX2062577; Thu, 23 Aug 2012 17:03:34 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NH3YgS062575; Thu, 23 Aug 2012 17:03:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208231703.q7NH3YgS062575@svn.freebsd.org> From: Dimitry Andric Date: Thu, 23 Aug 2012 17:03: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: r239613 - 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, 23 Aug 2012 17:03:34 -0000 Author: dim Date: Thu Aug 23 17:03:33 2012 New Revision: 239613 URL: http://svn.freebsd.org/changeset/base/239613 Log: Make sure bsd.dep.mk does not filter out -stdlib=xxx from CXXFLAGS, since this determines parts of the C++ include path. MFC after: 1 week Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Thu Aug 23 16:25:36 2012 (r239612) +++ head/share/mk/bsd.dep.mk Thu Aug 23 17:03:33 2012 (r239613) @@ -125,8 +125,10 @@ depend: beforedepend ${DEPENDFILE} after # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. -MKDEP_CFLAGS= ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} ${CFLAGS:M-ansi} -MKDEP_CXXFLAGS= ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} ${CXXFLAGS:M-std=*} ${CXXFLAGS:M-ansi} +MKDEP_CFLAGS= ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} \ + ${CFLAGS:M-ansi} +MKDEP_CXXFLAGS= ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} \ + ${CXXFLAGS:M-std=*} ${CXXFLAGS:M-ansi} ${CXXFLAGS:M-stdlib=*} DPSRCS+= ${SRCS} ${DEPENDFILE}: ${DPSRCS} From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 17:08: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 0E4B2106564A; Thu, 23 Aug 2012 17:08:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED6698FC14; Thu, 23 Aug 2012 17:08: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 q7NH8799063194; Thu, 23 Aug 2012 17:08:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NH87Ru063190; Thu, 23 Aug 2012 17:08:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208231708.q7NH87Ru063190@svn.freebsd.org> From: Dimitry Andric Date: Thu, 23 Aug 2012 17:08: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: r239614 - in head: lib/clang usr.bin/clang X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 17:08:08 -0000 Author: dim Date: Thu Aug 23 17:08:07 2012 New Revision: 239614 URL: http://svn.freebsd.org/changeset/base/239614 Log: Sprinkle a bit of style.Makefile(5) across various clang Makefiles. No functional changes. MFC after: 3 days Modified: head/lib/clang/clang.build.mk head/lib/clang/clang.lib.mk head/usr.bin/clang/clang.prog.mk Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Thu Aug 23 17:03:33 2012 (r239613) +++ head/lib/clang/clang.build.mk Thu Aug 23 17:08:07 2012 (r239614) @@ -1,15 +1,15 @@ # $FreeBSD$ -CLANG_SRCS=${LLVM_SRCS}/tools/clang +CLANG_SRCS= ${LLVM_SRCS}/tools/clang -CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \ - -I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \ - -I${LLVM_SRCS}/../../lib/clang/include \ - -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ - -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG +CFLAGS+= -I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \ + -I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \ + -I${LLVM_SRCS}/../../lib/clang/include \ + -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ + -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG # LLVM is not strict aliasing safe as of 12/31/2011 -CFLAGS+= -fno-strict-aliasing +CFLAGS+= -fno-strict-aliasing TARGET_ARCH?= ${MACHINE_ARCH} BUILD_ARCH?= ${MACHINE_ARCH} @@ -19,23 +19,23 @@ CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\" -DLLVM_HOSTTRIPLE=\"${BUILD_TRIPLE}\" .ifndef LLVM_REQUIRES_EH -CXXFLAGS+=-fno-exceptions +CXXFLAGS+= -fno-exceptions .else # If the library or program requires EH, it also requires RTTI. LLVM_REQUIRES_RTTI= .endif .ifndef LLVM_REQUIRES_RTTI -CXXFLAGS+=-fno-rtti +CXXFLAGS+= -fno-rtti .endif -CFLAGS+=-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" +CFLAGS+= -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" .PATH: ${LLVM_SRCS}/${SRCDIR} -TBLGEN?=tblgen -CLANG_TBLGEN?=clang-tblgen -TBLINC+=-I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target +TBLGEN?= tblgen +CLANG_TBLGEN?= clang-tblgen +TBLINC+= -I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/Intrinsics.td ${TBLGEN} -I ${LLVM_SRCS}/lib/VMCore ${TBLINC} -gen-intrinsic \ Modified: head/lib/clang/clang.lib.mk ============================================================================== --- head/lib/clang/clang.lib.mk Thu Aug 23 17:03:33 2012 (r239613) +++ head/lib/clang/clang.lib.mk Thu Aug 23 17:08:07 2012 (r239614) @@ -1,6 +1,6 @@ # $FreeBSD$ -LLVM_SRCS=${.CURDIR}/../../../contrib/llvm +LLVM_SRCS= ${.CURDIR}/../../../contrib/llvm .include "clang.build.mk" Modified: head/usr.bin/clang/clang.prog.mk ============================================================================== --- head/usr.bin/clang/clang.prog.mk Thu Aug 23 17:03:33 2012 (r239613) +++ head/usr.bin/clang/clang.prog.mk Thu Aug 23 17:08:07 2012 (r239614) @@ -1,14 +1,14 @@ # $FreeBSD$ -LLVM_SRCS=${.CURDIR}/../../../contrib/llvm +LLVM_SRCS= ${.CURDIR}/../../../contrib/llvm .include "../../lib/clang/clang.build.mk" .for lib in ${LIBDEPS} -DPADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a -LDADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a +DPADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a +LDADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a .endfor -BINDIR?=/usr/bin +BINDIR?= /usr/bin .include From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 17:40: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 8EA761065689; Thu, 23 Aug 2012 17:40:21 +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 5FAFE8FC16; Thu, 23 Aug 2012 17:40: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 q7NHeLm9067537; Thu, 23 Aug 2012 17:40:21 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NHeLsE067532; Thu, 23 Aug 2012 17:40:21 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201208231740.q7NHeLsE067532@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 23 Aug 2012 17:40: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: r239617 - 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: Thu, 23 Aug 2012 17:40:21 -0000 Author: hselasky Date: Thu Aug 23 17:40:20 2012 New Revision: 239617 URL: http://svn.freebsd.org/changeset/base/239617 Log: Add tunable for XHCI port routing. MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/controller/xhci.h head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Thu Aug 23 17:09:58 2012 (r239616) +++ head/sys/dev/usb/controller/xhci.c Thu Aug 23 17:40:20 2012 (r239617) @@ -84,14 +84,17 @@ __FBSDID("$FreeBSD$"); ((uint8_t *)&(((struct xhci_softc *)0)->sc_bus)))) #ifdef USB_DEBUG -static int xhcidebug = 0; +static int xhcidebug; +static int xhciroute; static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW, &xhcidebug, 0, "Debug level"); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW, + &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); - +TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); #endif #define XHCI_INTR_ENDPT 1 @@ -177,6 +180,16 @@ xhci_dump_device(struct xhci_softc *sc, } #endif +uint32_t +xhci_get_port_route(void) +{ +#ifdef USB_DEBUG + return (0xFFFFFFFFU ^ ((uint32_t)xhciroute)); +#else + return (0xFFFFFFFFU); +#endif +} + static void xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb) { Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Thu Aug 23 17:09:58 2012 (r239616) +++ head/sys/dev/usb/controller/xhci.h Thu Aug 23 17:40:20 2012 (r239617) @@ -499,6 +499,7 @@ struct xhci_softc { /* prototypes */ +uint32_t xhci_get_port_route(void); usb_error_t xhci_halt_controller(struct xhci_softc *); usb_error_t xhci_init(struct xhci_softc *, device_t); usb_error_t xhci_start_controller(struct xhci_softc *); Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Thu Aug 23 17:09:58 2012 (r239616) +++ head/sys/dev/usb/controller/xhci_pci.c Thu Aug 23 17:40:20 2012 (r239617) @@ -292,9 +292,9 @@ xhci_pci_take_controller(device_t self) /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ if (device_id == 0x1e318086 /* Panther Point */ || device_id == 0x8c318086 /* Lynx Point */) { - pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, 0xffffffff, 4); - pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, 0xffffffff, 4); + uint32_t temp = xhci_get_port_route(); + pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); + pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); } - return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 17: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 67E2D1065673; Thu, 23 Aug 2012 17:42:48 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.c2i.net [212.247.154.66]) by mx1.freebsd.org (Postfix) with ESMTP id 584C48FC18; Thu, 23 Aug 2012 17:42:46 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 144299957; Thu, 23 Aug 2012 19:42:40 +0200 From: Hans Petter Selasky To: Ian Lepore Date: Thu, 23 Aug 2012 19:43:29 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <1345496977.27688.332.camel@revolution.hippie.lan> In-Reply-To: <1345496977.27688.332.camel@revolution.hippie.lan> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201208231943.29308.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Andrew Turner Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller 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, 23 Aug 2012 17:42:48 -0000 On Monday 20 August 2012 23:09:37 Ian Lepore wrote: > On Mon, 2012-08-20 at 13:55 -0700, Adrian Chadd wrote: > > I have a report that AR71XX (MIPS) USB broke with this change. > > > > Thanks, > > > > > > Adrian > Hi Ian, Have you figured out the root cause for this? --HPS From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 17: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 80420106566B; Thu, 23 Aug 2012 17:58:23 +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 6BBE28FC0A; Thu, 23 Aug 2012 17:58: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 q7NHwN3u069914; Thu, 23 Aug 2012 17:58:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NHwNk8069911; Thu, 23 Aug 2012 17:58:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208231758.q7NHwNk8069911@svn.freebsd.org> From: Dimitry Andric Date: Thu, 23 Aug 2012 17:58: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: r239618 - in head/contrib/jemalloc: . include/jemalloc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 17:58:23 -0000 Author: dim Date: Thu Aug 23 17:58:22 2012 New Revision: 239618 URL: http://svn.freebsd.org/changeset/base/239618 Log: Since our clang now supports the tls_model attribute, remove the workaround for it in jemalloc_FreeBSD.h. Reviewed by: jasone Modified: head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Thu Aug 23 17:40:20 2012 (r239617) +++ head/contrib/jemalloc/FREEBSD-diffs Thu Aug 23 17:58:22 2012 (r239618) @@ -125,7 +125,7 @@ new file mode 100644 index 0000000..9efab93 --- /dev/null +++ b/include/jemalloc/jemalloc_FreeBSD.h -@@ -0,0 +1,80 @@ +@@ -0,0 +1,76 @@ +/* + * Override settings that were generated in jemalloc_defs.h as necessary. + */ @@ -184,10 +184,6 @@ index 0000000..9efab93 +#ifndef JEMALLOC_TLS_MODEL +# define JEMALLOC_TLS_MODEL /* Default. */ +#endif -+#ifdef __clang__ -+# undef JEMALLOC_TLS_MODEL -+# define JEMALLOC_TLS_MODEL /* clang does not support tls_model yet. */ -+#endif + +#define STATIC_PAGE_SHIFT PAGE_SHIFT +#define LG_SIZEOF_INT 2 Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Aug 23 17:40:20 2012 (r239617) +++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Aug 23 17:58:22 2012 (r239618) @@ -56,10 +56,6 @@ #ifndef JEMALLOC_TLS_MODEL # define JEMALLOC_TLS_MODEL /* Default. */ #endif -#ifdef __clang__ -# undef JEMALLOC_TLS_MODEL -# define JEMALLOC_TLS_MODEL /* clang does not support tls_model yet. */ -#endif #define STATIC_PAGE_SHIFT PAGE_SHIFT #define LG_SIZEOF_INT 2 From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 18:15: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 36852106566C; Thu, 23 Aug 2012 18:15:00 +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 217288FC12; Thu, 23 Aug 2012 18:15: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 q7NIExoW072117; Thu, 23 Aug 2012 18:14:59 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NIEx4h072114; Thu, 23 Aug 2012 18:14:59 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208231814.q7NIEx4h072114@svn.freebsd.org> From: Dimitry Andric Date: Thu, 23 Aug 2012 18:14: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: r239619 - head/contrib/llvm/tools/clang/lib/Sema X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 18:15:00 -0000 Author: dim Date: Thu Aug 23 18:14:59 2012 New Revision: 239619 URL: http://svn.freebsd.org/changeset/base/239619 Log: Pull in r162360 from upstream clang trunk: Merge existing attributes before processing pragmas in friend template declarations. Fixes pr13662. This should help when building Firefox with libc++. Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp Thu Aug 23 17:58:22 2012 (r239618) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp Thu Aug 23 18:14:59 2012 (r239619) @@ -1104,6 +1104,9 @@ Sema::CheckClassTemplate(Scope *S, unsig if (Attr) ProcessDeclAttributeList(S, NewClass, Attr); + if (PrevClassTemplate) + mergeDeclAttributes(NewClass, PrevClassTemplate->getTemplatedDecl()); + AddPushedVisibilityAttribute(NewClass); if (TUK != TUK_Friend) @@ -1138,8 +1141,6 @@ Sema::CheckClassTemplate(Scope *S, unsig NewTemplate->setInvalidDecl(); NewClass->setInvalidDecl(); } - if (PrevClassTemplate) - mergeDeclAttributes(NewClass, PrevClassTemplate->getTemplatedDecl()); ActOnDocumentableDecl(NewTemplate); From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 19:32: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 5EE2D106566C; Thu, 23 Aug 2012 19:32:58 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4665F8FC0C; Thu, 23 Aug 2012 19:32: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 q7NJWwFe082178; Thu, 23 Aug 2012 19:32:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NJWv2S082159; Thu, 23 Aug 2012 19:32:57 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208231932.q7NJWv2S082159@svn.freebsd.org> From: Martin Matuska Date: Thu, 23 Aug 2012 19:32: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: r239620 - in head: cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/f... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 19:32:58 -0000 Author: mm Date: Thu Aug 23 19:32:57 2012 New Revision: 239620 URL: http://svn.freebsd.org/changeset/base/239620 Log: Merge recent vendor changes: 3086 unnecessarily setting DS_FLAG_INCONSISTENT on async destroyed datasets 3090 vdev_reopen() during reguid causes vdev to be treated as corrupt 3102 vdev_uberblock_load() and vdev_validate() may read the wrong label Referenes: https://www.illumos.org/issues/3086 https://www.illumos.org/issues/3090 https://www.illumos.org/issues/3102 PR: kern/170912, kern/170914 Obtained from: illumos (changeset #13776, #13777) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Aug 23 19:32:57 2012 (r239620) @@ -364,7 +364,7 @@ ztest_info_t ztest_info[] = { { ztest_spa_rename, 1, &zopt_rarely }, { ztest_scrub, 1, &zopt_rarely }, { ztest_dsl_dataset_promote_busy, 1, &zopt_rarely }, - { ztest_vdev_attach_detach, 1, &zopt_rarely }, + { ztest_vdev_attach_detach, 1, &zopt_rarely }, { ztest_vdev_LUN_growth, 1, &zopt_rarely }, { ztest_vdev_add_remove, 1, &ztest_opts.zo_vdevtime }, @@ -415,6 +415,13 @@ static spa_t *ztest_spa = NULL; static ztest_ds_t *ztest_ds; static mutex_t ztest_vdev_lock; + +/* + * The ztest_name_lock protects the pool and dataset namespace used by + * the individual tests. To modify the namespace, consumers must grab + * this lock as writer. Grabbing the lock as reader will ensure that the + * namespace does not change while the lock is held. + */ static rwlock_t ztest_name_lock; static boolean_t ztest_dump_core = B_TRUE; @@ -2225,6 +2232,7 @@ ztest_zil_remount(ztest_ds_t *zd, uint64 { objset_t *os = zd->zd_os; + VERIFY(mutex_lock(&zd->zd_dirobj_lock) == 0); (void) rw_wrlock(&zd->zd_zilog_lock); /* zfsvfs_teardown() */ @@ -2235,6 +2243,7 @@ ztest_zil_remount(ztest_ds_t *zd, uint64 zil_replay(os, zd, ztest_replay_vector); (void) rw_unlock(&zd->zd_zilog_lock); + VERIFY(mutex_unlock(&zd->zd_dirobj_lock) == 0); } /* @@ -4860,10 +4869,16 @@ ztest_reguid(ztest_ds_t *zd, uint64_t id { spa_t *spa = ztest_spa; uint64_t orig, load; + int error; orig = spa_guid(spa); load = spa_load_guid(spa); - if (spa_change_guid(spa) != 0) + + (void) rw_wrlock(&ztest_name_lock); + error = spa_change_guid(spa); + (void) rw_unlock(&ztest_name_lock); + + if (error != 0) return; if (ztest_opts.zo_verbose >= 3) { @@ -5540,8 +5555,15 @@ ztest_freeze(void) */ kernel_init(FREAD | FWRITE); VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG)); + ASSERT(spa_freeze_txg(spa) == UINT64_MAX); VERIFY3U(0, ==, ztest_dataset_open(0)); ztest_dataset_close(0); + + spa->spa_debug = B_TRUE; + ztest_spa = spa; + txg_wait_synced(spa_get_dsl(spa), 0); + ztest_reguid(NULL, 0); + spa_close(spa, FTAG); kernel_fini(); } Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Aug 23 19:32:57 2012 (r239620) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -437,8 +437,8 @@ get_configs(libzfs_handle_t *hdl, pool_l uint_t i, nspares, nl2cache; boolean_t config_seen; uint64_t best_txg; - char *name, *hostname, *comment; - uint64_t version, guid; + char *name, *hostname; + uint64_t guid; uint_t children = 0; nvlist_t **child = NULL; uint_t holes; @@ -524,61 +524,54 @@ get_configs(libzfs_handle_t *hdl, pool_l * configuration: * * version - * pool guid - * name + * pool guid + * name + * pool txg (if available) * comment (if available) - * pool state + * pool state * hostid (if available) * hostname (if available) */ - uint64_t state; + uint64_t state, version, pool_txg; + char *comment = NULL; - verify(nvlist_lookup_uint64(tmp, - ZPOOL_CONFIG_VERSION, &version) == 0); - if (nvlist_add_uint64(config, - ZPOOL_CONFIG_VERSION, version) != 0) - goto nomem; - verify(nvlist_lookup_uint64(tmp, - ZPOOL_CONFIG_POOL_GUID, &guid) == 0); - if (nvlist_add_uint64(config, - ZPOOL_CONFIG_POOL_GUID, guid) != 0) - goto nomem; - verify(nvlist_lookup_string(tmp, - ZPOOL_CONFIG_POOL_NAME, &name) == 0); - if (nvlist_add_string(config, - ZPOOL_CONFIG_POOL_NAME, name) != 0) - goto nomem; + version = fnvlist_lookup_uint64(tmp, + ZPOOL_CONFIG_VERSION); + fnvlist_add_uint64(config, + ZPOOL_CONFIG_VERSION, version); + guid = fnvlist_lookup_uint64(tmp, + ZPOOL_CONFIG_POOL_GUID); + fnvlist_add_uint64(config, + ZPOOL_CONFIG_POOL_GUID, guid); + name = fnvlist_lookup_string(tmp, + ZPOOL_CONFIG_POOL_NAME); + fnvlist_add_string(config, + ZPOOL_CONFIG_POOL_NAME, name); - /* - * COMMENT is optional, don't bail if it's not - * there, instead, set it to NULL. - */ - if (nvlist_lookup_string(tmp, - ZPOOL_CONFIG_COMMENT, &comment) != 0) - comment = NULL; - else if (nvlist_add_string(config, - ZPOOL_CONFIG_COMMENT, comment) != 0) - goto nomem; + if (nvlist_lookup_uint64(tmp, + ZPOOL_CONFIG_POOL_TXG, &pool_txg) == 0) + fnvlist_add_uint64(config, + ZPOOL_CONFIG_POOL_TXG, pool_txg); - verify(nvlist_lookup_uint64(tmp, - ZPOOL_CONFIG_POOL_STATE, &state) == 0); - if (nvlist_add_uint64(config, - ZPOOL_CONFIG_POOL_STATE, state) != 0) - goto nomem; + if (nvlist_lookup_string(tmp, + ZPOOL_CONFIG_COMMENT, &comment) == 0) + fnvlist_add_string(config, + ZPOOL_CONFIG_COMMENT, comment); + + state = fnvlist_lookup_uint64(tmp, + ZPOOL_CONFIG_POOL_STATE); + fnvlist_add_uint64(config, + ZPOOL_CONFIG_POOL_STATE, state); hostid = 0; if (nvlist_lookup_uint64(tmp, ZPOOL_CONFIG_HOSTID, &hostid) == 0) { - if (nvlist_add_uint64(config, - ZPOOL_CONFIG_HOSTID, hostid) != 0) - goto nomem; - verify(nvlist_lookup_string(tmp, - ZPOOL_CONFIG_HOSTNAME, - &hostname) == 0); - if (nvlist_add_string(config, - ZPOOL_CONFIG_HOSTNAME, - hostname) != 0) - goto nomem; + fnvlist_add_uint64(config, + ZPOOL_CONFIG_HOSTID, hostid); + hostname = fnvlist_lookup_string(tmp, + ZPOOL_CONFIG_HOSTNAME); + fnvlist_add_string(config, + ZPOOL_CONFIG_HOSTNAME, hostname); } config_seen = B_TRUE; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Aug 23 19:32:57 2012 (r239620) @@ -1769,15 +1769,15 @@ dmu_init(void) dnode_init(); dbuf_init(); zfetch_init(); - arc_init(); l2arc_init(); + arc_init(); } void dmu_fini(void) { - l2arc_fini(); arc_fini(); + l2arc_fini(); zfetch_fini(); dbuf_fini(); dnode_fini(); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Thu Aug 23 19:32:57 2012 (r239620) @@ -1649,13 +1649,6 @@ dmu_recv_existing_end(dmu_recv_cookie_t dsl_dataset_t *ds = drc->drc_logical_ds; int err, myerr; - /* - * XXX hack; seems the ds is still dirty and dsl_pool_zil_clean() - * expects it to have a ds_user_ptr (and zil), but clone_swap() - * can close it. - */ - txg_wait_synced(ds->ds_dir->dd_pool, 0); - if (dsl_dataset_tryown(ds, FALSE, dmu_recv_tag)) { err = dsl_dataset_clone_swap(drc->drc_real_ds, ds, drc->drc_force); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Thu Aug 23 19:32:57 2012 (r239620) @@ -106,14 +106,8 @@ dsl_dataset_block_born(dsl_dataset_t *ds ASSERT(BP_GET_TYPE(bp) != DMU_OT_NONE); ASSERT(DMU_OT_IS_VALID(BP_GET_TYPE(bp))); if (ds == NULL) { - /* - * Account for the meta-objset space in its placeholder - * dsl_dir. - */ - ASSERT3U(compressed, ==, uncompressed); /* it's all metadata */ - dsl_dir_diduse_space(tx->tx_pool->dp_mos_dir, DD_USED_HEAD, - used, compressed, uncompressed, tx); - dsl_dir_dirty(tx->tx_pool->dp_mos_dir, tx); + dsl_pool_mos_diduse_space(tx->tx_pool, + used, compressed, uncompressed); return; } dmu_buf_will_dirty(ds->ds_dbuf, tx); @@ -149,15 +143,9 @@ dsl_dataset_block_kill(dsl_dataset_t *ds ASSERT(used > 0); if (ds == NULL) { - /* - * Account for the meta-objset space in its placeholder - * dataset. - */ dsl_free(tx->tx_pool, tx->tx_txg, bp); - - dsl_dir_diduse_space(tx->tx_pool->dp_mos_dir, DD_USED_HEAD, - -used, -compressed, -uncompressed, tx); - dsl_dir_dirty(tx->tx_pool->dp_mos_dir, tx); + dsl_pool_mos_diduse_space(tx->tx_pool, + -used, -compressed, -uncompressed); return (used); } ASSERT3P(tx->tx_pool, ==, ds->ds_dir->dd_pool); @@ -1116,26 +1104,26 @@ dsl_dataset_destroy(dsl_dataset_t *ds, v dummy_ds.ds_dir = dd; dummy_ds.ds_object = ds->ds_object; - /* - * Check for errors and mark this ds as inconsistent, in - * case we crash while freeing the objects. - */ - err = dsl_sync_task_do(dd->dd_pool, dsl_dataset_destroy_begin_check, - dsl_dataset_destroy_begin_sync, ds, NULL, 0); - if (err) - goto out; - - err = dmu_objset_from_ds(ds, &os); - if (err) - goto out; - - /* - * If async destruction is not enabled try to remove all objects - * while in the open context so that there is less work to do in - * the syncing context. - */ if (!spa_feature_is_enabled(dsl_dataset_get_spa(ds), &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + /* + * Check for errors and mark this ds as inconsistent, in + * case we crash while freeing the objects. + */ + err = dsl_sync_task_do(dd->dd_pool, + dsl_dataset_destroy_begin_check, + dsl_dataset_destroy_begin_sync, ds, NULL, 0); + if (err) + goto out; + + err = dmu_objset_from_ds(ds, &os); + if (err) + goto out; + + /* + * Remove all objects while in the open context so that + * there is less work to do in the syncing context. + */ for (obj = 0; err == 0; err = dmu_object_next(os, &obj, FALSE, ds->ds_phys->ds_prev_snap_txg)) { /* @@ -1146,30 +1134,25 @@ dsl_dataset_destroy(dsl_dataset_t *ds, v } if (err != ESRCH) goto out; - } - /* - * Only the ZIL knows how to free log blocks. - */ - zil_destroy(dmu_objset_zil(os), B_FALSE); - - /* - * Sync out all in-flight IO. - */ - txg_wait_synced(dd->dd_pool, 0); - - /* - * If we managed to free all the objects in open - * context, the user space accounting should be zero. - */ - if (ds->ds_phys->ds_bp.blk_fill == 0 && - dmu_objset_userused_enabled(os)) { - uint64_t count; + /* + * Sync out all in-flight IO. + */ + txg_wait_synced(dd->dd_pool, 0); - ASSERT(zap_count(os, DMU_USERUSED_OBJECT, &count) != 0 || - count == 0); - ASSERT(zap_count(os, DMU_GROUPUSED_OBJECT, &count) != 0 || - count == 0); + /* + * If we managed to free all the objects in open + * context, the user space accounting should be zero. + */ + if (ds->ds_phys->ds_bp.blk_fill == 0 && + dmu_objset_userused_enabled(os)) { + uint64_t count; + + ASSERT(zap_count(os, DMU_USERUSED_OBJECT, + &count) != 0 || count == 0); + ASSERT(zap_count(os, DMU_GROUPUSED_OBJECT, + &count) != 0 || count == 0); + } } rw_enter(&dd->dd_pool->dp_config_rwlock, RW_READER); @@ -1906,6 +1889,7 @@ dsl_dataset_destroy_sync(void *arg1, voi } else { zfeature_info_t *async_destroy = &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY]; + objset_t *os; /* * There's no next snapshot, so this is a head dataset. @@ -1917,6 +1901,8 @@ dsl_dataset_destroy_sync(void *arg1, voi dsl_deadlist_free(mos, ds->ds_phys->ds_deadlist_obj, tx); ds->ds_phys->ds_deadlist_obj = 0; + VERIFY3U(0, ==, dmu_objset_from_ds(ds, &os)); + if (!spa_feature_is_enabled(dp->dp_spa, async_destroy)) { err = old_synchronous_dataset_destroy(ds, tx); } else { @@ -1926,12 +1912,12 @@ dsl_dataset_destroy_sync(void *arg1, voi */ uint64_t used, comp, uncomp; - ASSERT(err == 0 || err == EBUSY); + zil_destroy_sync(dmu_objset_zil(os), tx); + if (!spa_feature_is_active(dp->dp_spa, async_destroy)) { spa_feature_incr(dp->dp_spa, async_destroy, tx); - dp->dp_bptree_obj = bptree_alloc( - dp->dp_meta_objset, tx); - VERIFY(zap_add(dp->dp_meta_objset, + dp->dp_bptree_obj = bptree_alloc(mos, tx); + VERIFY(zap_add(mos, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_BPTREE_OBJ, sizeof (uint64_t), 1, &dp->dp_bptree_obj, tx) == 0); @@ -1944,7 +1930,7 @@ dsl_dataset_destroy_sync(void *arg1, voi ASSERT(!DS_UNIQUE_IS_ACCURATE(ds) || ds->ds_phys->ds_unique_bytes == used); - bptree_add(dp->dp_meta_objset, dp->dp_bptree_obj, + bptree_add(mos, dp->dp_bptree_obj, &ds->ds_phys->ds_bp, ds->ds_phys->ds_prev_snap_txg, used, comp, uncomp, tx); dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD, @@ -2233,7 +2219,6 @@ dsl_dataset_sync(dsl_dataset_t *ds, zio_ dmu_buf_will_dirty(ds->ds_dbuf, tx); ds->ds_phys->ds_fsid_guid = ds->ds_fsid_guid; - dsl_dir_dirty(ds->ds_dir, tx); dmu_objset_sync(ds->ds_objset, zio, tx); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Thu Aug 23 19:32:57 2012 (r239620) @@ -195,7 +195,6 @@ errout: kmem_free(dd, sizeof (dsl_dir_t)); dmu_buf_rele(dbuf, tag); return (err); - } void @@ -229,7 +228,7 @@ dsl_dir_name(dsl_dir_t *dd, char *buf) } } -/* Calculate name legnth, avoiding all the strcat calls of dsl_dir_name */ +/* Calculate name length, avoiding all the strcat calls of dsl_dir_name */ int dsl_dir_namelen(dsl_dir_t *dd) { @@ -593,8 +592,6 @@ dsl_dir_sync(dsl_dir_t *dd, dmu_tx_t *tx { ASSERT(dmu_tx_is_syncing(tx)); - dmu_buf_will_dirty(dd->dd_dbuf, tx); - mutex_enter(&dd->dd_lock); ASSERT3U(dd->dd_tempreserved[tx->tx_txg&TXG_MASK], ==, 0); dprintf_dd(dd, "txg=%llu towrite=%lluK\n", tx->tx_txg, @@ -951,8 +948,6 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u ASSERT(dmu_tx_is_syncing(tx)); ASSERT(type < DD_USED_NUM); - dsl_dir_dirty(dd, tx); - if (needlock) mutex_enter(&dd->dd_lock); accounted_delta = parent_delta(dd, dd->dd_phys->dd_used_bytes, used); @@ -961,6 +956,7 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u dd->dd_phys->dd_compressed_bytes >= -compressed); ASSERT(uncompressed >= 0 || dd->dd_phys->dd_uncompressed_bytes >= -uncompressed); + dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_bytes += used; dd->dd_phys->dd_uncompressed_bytes += uncompressed; dd->dd_phys->dd_compressed_bytes += compressed; @@ -1002,13 +998,13 @@ dsl_dir_transfer_space(dsl_dir_t *dd, in if (delta == 0 || !(dd->dd_phys->dd_flags & DD_FLAG_USED_BREAKDOWN)) return; - dsl_dir_dirty(dd, tx); if (needlock) mutex_enter(&dd->dd_lock); ASSERT(delta > 0 ? dd->dd_phys->dd_used_breakdown[oldtype] >= delta : dd->dd_phys->dd_used_breakdown[newtype] >= -delta); ASSERT(dd->dd_phys->dd_used_bytes >= ABS(delta)); + dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_breakdown[oldtype] -= delta; dd->dd_phys->dd_used_breakdown[newtype] += delta; if (needlock) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Thu Aug 23 19:32:57 2012 (r239620) @@ -42,6 +42,7 @@ #include #include #include +#include int zfs_no_write_throttle = 0; int zfs_write_limit_shift = 3; /* 1/8th of physical memory */ @@ -111,12 +112,12 @@ dsl_pool_open_impl(spa_t *spa, uint64_t txg_list_create(&dp->dp_dirty_datasets, offsetof(dsl_dataset_t, ds_dirty_link)); + txg_list_create(&dp->dp_dirty_zilogs, + offsetof(zilog_t, zl_dirty_link)); txg_list_create(&dp->dp_dirty_dirs, offsetof(dsl_dir_t, dd_dirty_link)); txg_list_create(&dp->dp_sync_tasks, offsetof(dsl_sync_task_group_t, dstg_node)); - list_create(&dp->dp_synced_datasets, sizeof (dsl_dataset_t), - offsetof(dsl_dataset_t, ds_synced_link)); mutex_init(&dp->dp_lock, NULL, MUTEX_DEFAULT, NULL); @@ -249,9 +250,9 @@ dsl_pool_close(dsl_pool_t *dp) dmu_objset_evict(dp->dp_meta_objset); txg_list_destroy(&dp->dp_dirty_datasets); + txg_list_destroy(&dp->dp_dirty_zilogs); txg_list_destroy(&dp->dp_sync_tasks); txg_list_destroy(&dp->dp_dirty_dirs); - list_destroy(&dp->dp_synced_datasets); arc_flush(dp->dp_spa); txg_fini(dp); @@ -331,6 +332,21 @@ dsl_pool_create(spa_t *spa, nvlist_t *zp return (dp); } +/* + * Account for the meta-objset space in its placeholder dsl_dir. + */ +void +dsl_pool_mos_diduse_space(dsl_pool_t *dp, + int64_t used, int64_t comp, int64_t uncomp) +{ + ASSERT3U(comp, ==, uncomp); /* it's all metadata */ + mutex_enter(&dp->dp_lock); + dp->dp_mos_used_delta += used; + dp->dp_mos_compressed_delta += comp; + dp->dp_mos_uncompressed_delta += uncomp; + mutex_exit(&dp->dp_lock); +} + static int deadlist_enqueue_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) { @@ -349,11 +365,14 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t dmu_tx_t *tx; dsl_dir_t *dd; dsl_dataset_t *ds; - dsl_sync_task_group_t *dstg; objset_t *mos = dp->dp_meta_objset; hrtime_t start, write_time; uint64_t data_written; int err; + list_t synced_datasets; + + list_create(&synced_datasets, sizeof (dsl_dataset_t), + offsetof(dsl_dataset_t, ds_synced_link)); /* * We need to copy dp_space_towrite() before doing @@ -376,7 +395,7 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t * may sync newly-created datasets on pass 2. */ ASSERT(!list_link_active(&ds->ds_synced_link)); - list_insert_tail(&dp->dp_synced_datasets, ds); + list_insert_tail(&synced_datasets, ds); dsl_dataset_sync(ds, zio, tx); } DTRACE_PROBE(pool_sync__1setup); @@ -386,15 +405,20 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t ASSERT(err == 0); DTRACE_PROBE(pool_sync__2rootzio); - for (ds = list_head(&dp->dp_synced_datasets); ds; - ds = list_next(&dp->dp_synced_datasets, ds)) + /* + * After the data blocks have been written (ensured by the zio_wait() + * above), update the user/group space accounting. + */ + for (ds = list_head(&synced_datasets); ds; + ds = list_next(&synced_datasets, ds)) dmu_objset_do_userquota_updates(ds->ds_objset, tx); /* * Sync the datasets again to push out the changes due to * userspace updates. This must be done before we process the - * sync tasks, because that could cause a snapshot of a dataset - * whose ds_bp will be rewritten when we do this 2nd sync. + * sync tasks, so that any snapshots will have the correct + * user accounting information (and we won't get confused + * about which blocks are part of the snapshot). */ zio = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED); while (ds = txg_list_remove(&dp->dp_dirty_datasets, txg)) { @@ -405,30 +429,42 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t err = zio_wait(zio); /* - * Move dead blocks from the pending deadlist to the on-disk - * deadlist. + * Now that the datasets have been completely synced, we can + * clean up our in-memory structures accumulated while syncing: + * + * - move dead blocks from the pending deadlist to the on-disk deadlist + * - clean up zil records + * - release hold from dsl_dataset_dirty() */ - for (ds = list_head(&dp->dp_synced_datasets); ds; - ds = list_next(&dp->dp_synced_datasets, ds)) { + while (ds = list_remove_head(&synced_datasets)) { + objset_t *os = ds->ds_objset; bplist_iterate(&ds->ds_pending_deadlist, deadlist_enqueue_cb, &ds->ds_deadlist, tx); + ASSERT(!dmu_objset_is_dirty(os, txg)); + dmu_buf_rele(ds->ds_dbuf, ds); } - while (dstg = txg_list_remove(&dp->dp_sync_tasks, txg)) { - /* - * No more sync tasks should have been added while we - * were syncing. - */ - ASSERT(spa_sync_pass(dp->dp_spa) == 1); - dsl_sync_task_group_sync(dstg, tx); - } - DTRACE_PROBE(pool_sync__3task); - start = gethrtime(); while (dd = txg_list_remove(&dp->dp_dirty_dirs, txg)) dsl_dir_sync(dd, tx); write_time += gethrtime() - start; + /* + * The MOS's space is accounted for in the pool/$MOS + * (dp_mos_dir). We can't modify the mos while we're syncing + * it, so we remember the deltas and apply them here. + */ + if (dp->dp_mos_used_delta != 0 || dp->dp_mos_compressed_delta != 0 || + dp->dp_mos_uncompressed_delta != 0) { + dsl_dir_diduse_space(dp->dp_mos_dir, DD_USED_HEAD, + dp->dp_mos_used_delta, + dp->dp_mos_compressed_delta, + dp->dp_mos_uncompressed_delta, tx); + dp->dp_mos_used_delta = 0; + dp->dp_mos_compressed_delta = 0; + dp->dp_mos_uncompressed_delta = 0; + } + start = gethrtime(); if (list_head(&mos->os_dirty_dnodes[txg & TXG_MASK]) != NULL || list_head(&mos->os_free_dnodes[txg & TXG_MASK]) != NULL) { @@ -444,6 +480,27 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t hrtime_t, dp->dp_read_overhead); write_time -= dp->dp_read_overhead; + /* + * If we modify a dataset in the same txg that we want to destroy it, + * its dsl_dir's dd_dbuf will be dirty, and thus have a hold on it. + * dsl_dir_destroy_check() will fail if there are unexpected holds. + * Therefore, we want to sync the MOS (thus syncing the dd_dbuf + * and clearing the hold on it) before we process the sync_tasks. + * The MOS data dirtied by the sync_tasks will be synced on the next + * pass. + */ + DTRACE_PROBE(pool_sync__3task); + if (!txg_list_empty(&dp->dp_sync_tasks, txg)) { + dsl_sync_task_group_t *dstg; + /* + * No more sync tasks should have been added while we + * were syncing. + */ + ASSERT(spa_sync_pass(dp->dp_spa) == 1); + while (dstg = txg_list_remove(&dp->dp_sync_tasks, txg)) + dsl_sync_task_group_sync(dstg, tx); + } + dmu_tx_commit(tx); dp->dp_space_towrite[txg & TXG_MASK] = 0; @@ -492,15 +549,14 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t void dsl_pool_sync_done(dsl_pool_t *dp, uint64_t txg) { + zilog_t *zilog; dsl_dataset_t *ds; - objset_t *os; - while (ds = list_head(&dp->dp_synced_datasets)) { - list_remove(&dp->dp_synced_datasets, ds); - os = ds->ds_objset; - zil_clean(os->os_zil, txg); - ASSERT(!dmu_objset_is_dirty(os, txg)); - dmu_buf_rele(ds->ds_dbuf, ds); + while (zilog = txg_list_remove(&dp->dp_dirty_zilogs, txg)) { + ds = dmu_objset_ds(zilog->zl_os); + zil_clean(zilog, txg); + ASSERT(!dmu_objset_is_dirty(zilog->zl_os, txg)); + dmu_buf_rele(ds->ds_dbuf, zilog); } ASSERT(!dmu_objset_is_dirty(dp->dp_meta_objset, txg)); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Aug 23 19:32:57 2012 (r239620) @@ -120,6 +120,8 @@ const zio_taskq_info_t zio_taskqs[ZIO_TY static dsl_syncfunc_t spa_sync_version; static dsl_syncfunc_t spa_sync_props; +static dsl_checkfunc_t spa_change_guid_check; +static dsl_syncfunc_t spa_change_guid_sync; static boolean_t spa_has_active_shared_spare(spa_t *spa); static int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config, spa_load_state_t state, spa_import_type_t type, boolean_t mosconfig, @@ -683,6 +685,56 @@ spa_prop_clear_bootfs(spa_t *spa, uint64 } } +/*ARGSUSED*/ +static int +spa_change_guid_check(void *arg1, void *arg2, dmu_tx_t *tx) +{ + spa_t *spa = arg1; + uint64_t *newguid = arg2; + vdev_t *rvd = spa->spa_root_vdev; + uint64_t vdev_state; + + spa_config_enter(spa, SCL_STATE, FTAG, RW_READER); + vdev_state = rvd->vdev_state; + spa_config_exit(spa, SCL_STATE, FTAG); + + if (vdev_state != VDEV_STATE_HEALTHY) + return (ENXIO); + + ASSERT3U(spa_guid(spa), !=, *newguid); + + return (0); +} + +static void +spa_change_guid_sync(void *arg1, void *arg2, dmu_tx_t *tx) +{ + spa_t *spa = arg1; + uint64_t *newguid = arg2; + uint64_t oldguid; + vdev_t *rvd = spa->spa_root_vdev; + + oldguid = spa_guid(spa); + + spa_config_enter(spa, SCL_STATE, FTAG, RW_READER); + rvd->vdev_guid = *newguid; + rvd->vdev_guid_sum += (*newguid - oldguid); + vdev_config_dirty(rvd); + spa_config_exit(spa, SCL_STATE, FTAG); + +#ifdef __FreeBSD__ + /* + * TODO: until recent illumos logging changes are merged + * log reguid as pool property change + */ + spa_history_log_internal(LOG_POOL_PROPSET, spa, tx, + "guid change old=%llu new=%llu", oldguid, *newguid); +#else + spa_history_log_internal(spa, "guid change", tx, "old=%lld new=%lld", + oldguid, *newguid); +#endif +} + /* * Change the GUID for the pool. This is done so that we can later * re-import a pool built from a clone of our own vdevs. We will modify @@ -695,29 +747,23 @@ spa_prop_clear_bootfs(spa_t *spa, uint64 int spa_change_guid(spa_t *spa) { - uint64_t oldguid, newguid; - uint64_t txg; - - if (!(spa_mode_global & FWRITE)) - return (EROFS); - - txg = spa_vdev_enter(spa); - - if (spa->spa_root_vdev->vdev_state != VDEV_STATE_HEALTHY) - return (spa_vdev_exit(spa, NULL, txg, ENXIO)); + int error; + uint64_t guid; - oldguid = spa_guid(spa); - newguid = spa_generate_guid(NULL); - ASSERT3U(oldguid, !=, newguid); + mutex_enter(&spa_namespace_lock); + guid = spa_generate_guid(NULL); - spa->spa_root_vdev->vdev_guid = newguid; - spa->spa_root_vdev->vdev_guid_sum += (newguid - oldguid); + error = dsl_sync_task_do(spa_get_dsl(spa), spa_change_guid_check, + spa_change_guid_sync, spa, &guid, 5); - vdev_config_dirty(spa->spa_root_vdev); + if (error == 0) { + spa_config_sync(spa, B_FALSE, B_TRUE); + spa_event_notify(spa, NULL, ESC_ZFS_POOL_REGUID); + } - spa_event_notify(spa, NULL, ESC_ZFS_POOL_REGUID); + mutex_exit(&spa_namespace_lock); - return (spa_vdev_exit(spa, NULL, txg, 0)); + return (error); } /* @@ -6107,6 +6153,9 @@ spa_sync(spa_t *spa, uint64_t txg) rvd->vdev_children, txg, B_TRUE); } + if (error == 0) + spa->spa_last_synced_guid = rvd->vdev_guid; + spa_config_exit(spa, SCL_STATE, FTAG); if (error == 0) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Aug 23 19:32:57 2012 (r239620) @@ -1352,16 +1352,29 @@ spa_name(spa_t *spa) uint64_t spa_guid(spa_t *spa) { + dsl_pool_t *dp = spa_get_dsl(spa); + uint64_t guid; + /* * If we fail to parse the config during spa_load(), we can go through * the error path (which posts an ereport) and end up here with no root * vdev. We stash the original pool guid in 'spa_config_guid' to handle * this case. */ - if (spa->spa_root_vdev != NULL) + if (spa->spa_root_vdev == NULL) + return (spa->spa_config_guid); + + guid = spa->spa_last_synced_guid != 0 ? + spa->spa_last_synced_guid : spa->spa_root_vdev->vdev_guid; + + /* + * Return the most recently synced out guid unless we're + * in syncing context. + */ + if (dp && dsl_pool_sync_context(dp)) return (spa->spa_root_vdev->vdev_guid); else - return (spa->spa_config_guid); + return (guid); } uint64_t Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Thu Aug 23 19:32:57 2012 (r239620) @@ -82,7 +82,6 @@ typedef struct dsl_pool { /* No lock needed - sync context only */ blkptr_t dp_meta_rootbp; - list_t dp_synced_datasets; hrtime_t dp_read_overhead; uint64_t dp_throughput; /* bytes per millisec */ uint64_t dp_write_limit; @@ -96,10 +95,14 @@ typedef struct dsl_pool { kmutex_t dp_lock; uint64_t dp_space_towrite[TXG_SIZE]; uint64_t dp_tempreserved[TXG_SIZE]; + uint64_t dp_mos_used_delta; + uint64_t dp_mos_compressed_delta; + uint64_t dp_mos_uncompressed_delta; /* Has its own locking */ tx_state_t dp_tx; txg_list_t dp_dirty_datasets; + txg_list_t dp_dirty_zilogs; txg_list_t dp_dirty_dirs; txg_list_t dp_sync_tasks; @@ -139,6 +142,8 @@ int dsl_read_nolock(zio_t *pio, spa_t *s void dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_upgrade_dir_clones(dsl_pool_t *dp, dmu_tx_t *tx); +void dsl_pool_mos_diduse_space(dsl_pool_t *dp, + int64_t used, int64_t comp, int64_t uncomp); taskq_t *dsl_pool_vnrele_taskq(dsl_pool_t *dp); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Thu Aug 23 19:32:57 2012 (r239620) @@ -141,6 +141,7 @@ struct spa { vdev_t *spa_root_vdev; /* top-level vdev container */ uint64_t spa_config_guid; /* config pool guid */ uint64_t spa_load_guid; /* spa_load initialized guid */ + uint64_t spa_last_synced_guid; /* last synced guid */ list_t spa_config_dirty_list; /* vdevs with dirty config */ list_t spa_state_dirty_list; /* vdevs with dirty state */ spa_aux_vdev_t spa_spares; /* hot spares */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h Thu Aug 23 19:32:57 2012 (r239620) @@ -22,6 +22,9 @@ * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #ifndef _SYS_TXG_H #define _SYS_TXG_H @@ -115,7 +118,7 @@ extern boolean_t txg_sync_waiting(struct extern void txg_list_create(txg_list_t *tl, size_t offset); extern void txg_list_destroy(txg_list_t *tl); -extern int txg_list_empty(txg_list_t *tl, uint64_t txg); +extern boolean_t txg_list_empty(txg_list_t *tl, uint64_t txg); extern int txg_list_add(txg_list_t *tl, void *p, uint64_t txg); extern int txg_list_add_tail(txg_list_t *tl, void *p, uint64_t txg); extern void *txg_list_remove(txg_list_t *tl, uint64_t txg); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Thu Aug 23 19:32:57 2012 (r239620) @@ -142,7 +142,7 @@ extern nvlist_t *vdev_config_generate(sp struct uberblock; extern uint64_t vdev_label_offset(uint64_t psize, int l, uint64_t offset); extern int vdev_label_number(uint64_t psise, uint64_t offset); -extern nvlist_t *vdev_label_read_config(vdev_t *vd, int label); +extern nvlist_t *vdev_label_read_config(vdev_t *vd, uint64_t txg); extern void vdev_uberblock_load(vdev_t *, struct uberblock *, nvlist_t **); typedef enum { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Thu Aug 23 19:32:57 2012 (r239620) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -395,6 +396,7 @@ extern void zil_replay(objset_t *os, voi zil_replay_func_t *replay_func[TX_MAX_TYPE]); extern boolean_t zil_replaying(zilog_t *zilog, dmu_tx_t *tx); extern void zil_destroy(zilog_t *zilog, boolean_t keep_first); +extern void zil_destroy_sync(zilog_t *zilog, dmu_tx_t *tx); extern void zil_rollback_destroy(zilog_t *zilog, dmu_tx_t *tx); extern itx_t *zil_itx_create(uint64_t txtype, size_t lrsize); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h Thu Aug 23 19:32:57 2012 (r239620) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -130,6 +131,7 @@ struct zilog { zil_header_t zl_old_header; /* debugging aid */ uint_t zl_prev_blks[ZIL_PREV_BLKS]; /* size - sector rounded */ uint_t zl_prev_rotor; /* rotor for zl_prev[] */ + txg_node_t zl_dirty_link; /* protected by dp_dirty_zilogs list */ }; typedef struct zil_bp_node { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Thu Aug 23 19:32:57 2012 (r239620) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright 2011 Martin Matuska + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -596,7 +597,7 @@ txg_list_destroy(txg_list_t *tl) mutex_destroy(&tl->tl_lock); } -int +boolean_t txg_list_empty(txg_list_t *tl, uint64_t txg) { return (tl->tl_head[txg & TXG_MASK] == NULL); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Aug 23 18:14:59 2012 (r239619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Aug 23 19:32:57 2012 (r239620) @@ -1328,9 +1328,9 @@ vdev_validate(vdev_t *vd, boolean_t stri if (vd->vdev_ops->vdev_op_leaf && vdev_readable(vd)) { uint64_t aux_guid = 0; nvlist_t *nvl; + uint64_t txg = strict ? spa->spa_config_txg : -1ULL; - if ((label = vdev_label_read_config(vd, VDEV_BEST_LABEL)) == - NULL) { + if ((label = vdev_label_read_config(vd, txg)) == NULL) { vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, VDEV_AUX_BAD_LABEL); return (0); @@ -1512,7 +1512,7 @@ vdev_reopen(vdev_t *vd) !l2arc_vdev_present(vd)) l2arc_add_vdev(spa, vd); } else { - (void) vdev_validate(vd, B_TRUE); + (void) vdev_validate(vd, spa_last_synced_txg(spa)); } /* @@ -1971,7 +1971,7 @@ vdev_validate_aux(vdev_t *vd) if (!vdev_readable(vd)) return (0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 19: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 B21D9106566C; Thu, 23 Aug 2012 19:39:23 +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 9D2AC8FC17; Thu, 23 Aug 2012 19: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 q7NJdNe2083052; Thu, 23 Aug 2012 19:39:23 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NJdNgl083050; Thu, 23 Aug 2012 19:39:23 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201208231939.q7NJdNgl083050@svn.freebsd.org> From: Jamie Gritton Date: Thu, 23 Aug 2012 19: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: r239621 - 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: Thu, 23 Aug 2012 19:39:23 -0000 Author: jamie Date: Thu Aug 23 19:39:23 2012 New Revision: 239621 URL: http://svn.freebsd.org/changeset/base/239621 Log: Partially roll back r239601 - keep parameter strings both length-delimited and null-terminated at the same time, because they're later passed to libjail as null-terminated. That means I also need to add a nul byte when comma-combining array parameters. MFC after: 6 days Modified: head/usr.sbin/jail/config.c Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Thu Aug 23 19:32:57 2012 (r239620) +++ head/usr.sbin/jail/config.c Thu Aug 23 19:39:23 2012 (r239621) @@ -597,6 +597,7 @@ check_intparams(struct cfjail *j) "ip4.addr: bad netmask \"%s\"", cs); error = -1; } + *cs = '\0'; s->len = cs - s->s; } } @@ -620,6 +621,7 @@ check_intparams(struct cfjail *j) cs); error = -1; } + *cs = '\0'; s->len = cs - s->s; } } @@ -713,11 +715,10 @@ import_params(struct cfjail *j) cs = value; TAILQ_FOREACH_SAFE(s, &p->val, tq, ts) { memcpy(cs, s->s, s->len); - if (ts != NULL) { - cs += s->len + 1; - cs[-1] = ','; - } + cs += s->len + 1; + cs[-1] = ','; } + value[vallen - 1] = '\0'; } if (jailparam_import(jp, value) < 0) { error = -1; From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 19:40: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 D022710656D3; Thu, 23 Aug 2012 19:40:28 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BADBD8FC0A; Thu, 23 Aug 2012 19:40: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 q7NJeSBO083225; Thu, 23 Aug 2012 19:40:28 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NJeSYi083223; Thu, 23 Aug 2012 19:40:28 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208231940.q7NJeSYi083223@svn.freebsd.org> From: Martin Matuska Date: Thu, 23 Aug 2012 19:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239622 - head/contrib/libarchive/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 19:40:30 -0000 Author: mm Date: Thu Aug 23 19:40:28 2012 New Revision: 239622 URL: http://svn.freebsd.org/changeset/base/239622 Log: Apply fix for vendor pull request #17: Support appending to empty archives References: https://github.com/libarchive/libarchive/pull/17 Submitted by: myself Obtained from: libarchive master branch on github Modified: head/contrib/libarchive/tar/write.c Modified: head/contrib/libarchive/tar/write.c ============================================================================== --- head/contrib/libarchive/tar/write.c Thu Aug 23 19:39:23 2012 (r239621) +++ head/contrib/libarchive/tar/write.c Thu Aug 23 19:40:28 2012 (r239622) @@ -235,6 +235,7 @@ tar_mode_r(struct bsdtar *bsdtar) a = archive_read_new(); archive_read_support_filter_all(a); + archive_read_support_format_empty(a); archive_read_support_format_tar(a); archive_read_support_format_gnutar(a); r = archive_read_open_fd(a, bsdtar->fd, 10240); From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 19:46:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id 998B61065672; Thu, 23 Aug 2012 19:46:19 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 23D88163E52; Thu, 23 Aug 2012 19:43:56 +0000 (UTC) Message-ID: <503687FB.5020301@FreeBSD.org> Date: Thu, 23 Aug 2012 12:43:55 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: obrien@freebsd.org References: <201208221835.q7MIZI77076855@svn.freebsd.org> <50355121.3070408@FreeBSD.org> <20120822222511.GD78670@dragon.NUXI.org> In-Reply-To: <20120822222511.GD78670@dragon.NUXI.org> X-Enigmail-Version: 1.4.3 OpenPGP: id=1A1ABC84 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: r239568 - head/etc/rc.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, 23 Aug 2012 19:46:19 -0000 On 8/22/2012 3:25 PM, David O'Brien wrote: > On Wed, Aug 22, 2012 at 02:37:37PM -0700, Doug Barton wrote: >> Were these changes discussed somewhere and I missed it? > > They were not discussed. I did not see the need. > > This is simple functionality. If securelevel is raised > 0, one > cannot start up a firewall nor make major changes to time. > Thus these components are required to be done before raising securelevel. > > >> I'm not opposed per se, but the security aspects should be discussed on >> freebsd-security@, > > I'm sorry, I didn't feel that ensuring the software follows the > published specification of its functionality to have such a security > aspect. > >> and it's preferable that significant changes to >> rcorder be looked at on freebsd-rc@ as well. > > I don't consider this to be a significant change. > > I do have some significant changes that I do want freebsd-rc@ to > review I will be sending soon. > >> Can you hold off on MFC'ing any of this until it's been reviewed more >> thoroughly? > > Yes. Thanks. Just to reiterate, I'm not saying that either your changes or your methodology were wrong ... I personally would just like a little time to review them before we move forward. Doug -- I am only one, but I am one. I cannot do everything, but I can do something. And I will not let what I cannot do interfere with what I can do. -- Edward Everett Hale, (1822 - 1909) From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 21:31: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 1F652106564A; Thu, 23 Aug 2012 21:31:53 +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 0B2348FC0A; Thu, 23 Aug 2012 21:31: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 q7NLVqWx098188; Thu, 23 Aug 2012 21:31:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NLVqm6098185; Thu, 23 Aug 2012 21:31:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208232131.q7NLVqm6098185@svn.freebsd.org> From: Warner Losh Date: Thu, 23 Aug 2012 21:31: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: r239623 - 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: Thu, 23 Aug 2012 21:31:53 -0000 Author: imp Date: Thu Aug 23 21:31:52 2012 New Revision: 239623 URL: http://svn.freebsd.org/changeset/base/239623 Log: Use proper resource type when freeing. Submitted by: Ian Lapore (indirectly in a larger patch) Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Thu Aug 23 19:40:28 2012 (r239622) +++ head/sys/arm/at91/at91_mci.c Thu Aug 23 21:31:52 2012 (r239623) @@ -299,7 +299,7 @@ at91_mci_deactivate(device_t dev) sc->intrhand = 0; bus_generic_detach(sc->dev); if (sc->mem_res) - bus_release_resource(dev, SYS_RES_IOPORT, + bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->mem_res), sc->mem_res); sc->mem_res = 0; if (sc->irq_res) From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 21:32: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 6E38110657DF; Thu, 23 Aug 2012 21:32:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58CAB8FC14; Thu, 23 Aug 2012 21:32: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 q7NLW3pK098255; Thu, 23 Aug 2012 21:32:03 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NLW38a098252; Thu, 23 Aug 2012 21:32:03 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201208232132.q7NLW38a098252@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 23 Aug 2012 21:32: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: r239624 - 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, 23 Aug 2012 21:32:03 -0000 Author: np Date: Thu Aug 23 21:32:02 2012 New Revision: 239624 URL: http://svn.freebsd.org/changeset/base/239624 Log: Allow nmbjumbop, nmbjumbo9, and nmbjumbo16 to be set directly via loader tunables. MFC after: 1 month Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Thu Aug 23 21:31:52 2012 (r239623) +++ head/sys/kern/kern_mbuf.c Thu Aug 23 21:32:02 2012 (r239624) @@ -110,14 +110,23 @@ struct mbstat mbstat; static void tunable_mbinit(void *dummy) { - TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); /* This has to be done before VM init. */ + TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); if (nmbclusters == 0) nmbclusters = 1024 + maxusers * 64; - nmbjumbop = nmbclusters / 2; - nmbjumbo9 = nmbjumbop / 2; - nmbjumbo16 = nmbjumbo9 / 2; + + TUNABLE_INT_FETCH("kern.ipc.nmbjumbop", &nmbjumbop); + if (nmbjumbop == 0) + nmbjumbop = nmbclusters / 2; + + TUNABLE_INT_FETCH("kern.ipc.nmbjumbo9", &nmbjumbo9); + if (nmbjumbo9 == 0) + nmbjumbo9 = nmbclusters / 4; + + TUNABLE_INT_FETCH("kern.ipc.nmbjumbo16", &nmbjumbo16); + if (nmbjumbo16 == 0) + nmbjumbo16 = nmbclusters / 8; } SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL); From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 21:39:05 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 8C9E7106564A; Thu, 23 Aug 2012 21:39:05 +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 2763A8FC08; Thu, 23 Aug 2012 21:39:05 +0000 (UTC) Received: by obbun3 with SMTP id un3so3851070obb.13 for ; Thu, 23 Aug 2012 14:39:04 -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; bh=CH90NwQZqvurtqmcK/1Mz/StriwkL49qEk+muU1N6qU=; b=gZ7Nijn8W+gz3K9xADWfUbxw201SgTew4hdVGAwks1U7oPxjPdTJDg5+wPkD1xK0Wh XVSlbpdfP0dNi8q3teZF35Q6Lb1SnohpERHGxvMGx/m7CuH10vCpcSZFibRZeOeK7h2d zCKRZ8q9JA875yP9LUnDCpk1XBIC5wi4K/rMXRjJ1mrdZ8+7XulkP5vgjbaQQHAZG7t8 8wTCDcNTo4K+Q0F6sUhSV9+tJguGnaMgTEqpzcNz+piUSUuqxc8Fbn7D19z5/6rIAKTc qrWSoY/KxOScIyy75P0bCe0LqSOt7UbxnFKbihV1r1Bi+FH3yDsvfzBzrOJcr50IKgG5 rJvA== MIME-Version: 1.0 Received: by 10.182.31.102 with SMTP id z6mr2301848obh.66.1345757944677; Thu, 23 Aug 2012 14:39:04 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Thu, 23 Aug 2012 14:39:04 -0700 (PDT) In-Reply-To: <201208232132.q7NLW38a098252@svn.freebsd.org> References: <201208232132.q7NLW38a098252@svn.freebsd.org> Date: Thu, 23 Aug 2012 14:39:04 -0700 Message-ID: From: Garrett Cooper To: Navdeep Parhar Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239624 - 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, 23 Aug 2012 21:39:05 -0000 On Thu, Aug 23, 2012 at 2:32 PM, Navdeep Parhar wrote: > Author: np > Date: Thu Aug 23 21:32:02 2012 > New Revision: 239624 > URL: http://svn.freebsd.org/changeset/base/239624 > > Log: > Allow nmbjumbop, nmbjumbo9, and nmbjumbo16 to be set directly via loader > tunables. > > MFC after: 1 month > > Modified: > head/sys/kern/kern_mbuf.c > > Modified: head/sys/kern/kern_mbuf.c Thanks! From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 22:23: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 22B51106564A; Thu, 23 Aug 2012 22:23:57 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DF5C8FC08; Thu, 23 Aug 2012 22:23: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 q7NMNuTE005229; Thu, 23 Aug 2012 22:23:56 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NMNuOd005220; Thu, 23 Aug 2012 22:23:56 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201208232223.q7NMNuOd005220@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 23 Aug 2012 22:23: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: r239625 - head/sys/mips/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, 23 Aug 2012 22:23:57 -0000 Author: ray Date: Thu Aug 23 22:23:56 2012 New Revision: 239625 URL: http://svn.freebsd.org/changeset/base/239625 Log: Remove duplicated GEOM_PART_* options. PR: 170931 Approved by: adrian Modified: head/sys/mips/conf/AP93 head/sys/mips/conf/AP96 head/sys/mips/conf/PB47 head/sys/mips/conf/PB92 head/sys/mips/conf/ROUTERSTATION head/sys/mips/conf/RSPRO head/sys/mips/conf/RSPRO_STANDALONE head/sys/mips/conf/TP-WN1043ND Modified: head/sys/mips/conf/AP93 ============================================================================== --- head/sys/mips/conf/AP93 Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/AP93 Thu Aug 23 22:23:56 2012 (r239625) @@ -108,8 +108,6 @@ options USB_HOST_ALIGN=32 #device da # Read MSDOS formatted disks -options GEOM_PART_BSD -options GEOM_PART_MBR #options MSDOSFS # GPIO Bus Modified: head/sys/mips/conf/AP96 ============================================================================== --- head/sys/mips/conf/AP96 Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/AP96 Thu Aug 23 22:23:56 2012 (r239625) @@ -22,8 +22,6 @@ options AR71XX_REALMEM=64*1024*1024 options AR71XX_ENV_UBOOT # For DOS - enable if required -options GEOM_PART_BSD -options GEOM_PART_MBR options MSDOSFS # uncompress - to boot read-only lzma natively from flash Modified: head/sys/mips/conf/PB47 ============================================================================== --- head/sys/mips/conf/PB47 Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/PB47 Thu Aug 23 22:23:56 2012 (r239625) @@ -27,8 +27,6 @@ options AR71XX_ENV_UBOOT options AR71XX_REALMEM=64*1024*1024 # For DOS - enable if required -options GEOM_PART_BSD -options GEOM_PART_MBR options MSDOSFS # uncompress - to boot read-only lzma natively from flash Modified: head/sys/mips/conf/PB92 ============================================================================== --- head/sys/mips/conf/PB92 Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/PB92 Thu Aug 23 22:23:56 2012 (r239625) @@ -106,8 +106,6 @@ options USB_HOST_ALIGN=32 #device da # Read MSDOS formatted disks -options GEOM_PART_BSD -options GEOM_PART_MBR # options MSDOSFS # GPIO Bus Modified: head/sys/mips/conf/ROUTERSTATION ============================================================================== --- head/sys/mips/conf/ROUTERSTATION Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/ROUTERSTATION Thu Aug 23 22:23:56 2012 (r239625) @@ -16,8 +16,6 @@ device geom_uzip # compressed in-memory options GEOM_UZIP # For DOS -options GEOM_PART_BSD -options GEOM_PART_MBR options MSDOSFS # Boot path - redboot MFS Modified: head/sys/mips/conf/RSPRO ============================================================================== --- head/sys/mips/conf/RSPRO Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/RSPRO Thu Aug 23 22:23:56 2012 (r239625) @@ -17,8 +17,6 @@ device geom_uzip # compressed in-memory options GEOM_UZIP # For DOS -options GEOM_PART_BSD -options GEOM_PART_MBR options MSDOSFS # For etherswitch support Modified: head/sys/mips/conf/RSPRO_STANDALONE ============================================================================== --- head/sys/mips/conf/RSPRO_STANDALONE Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/RSPRO_STANDALONE Thu Aug 23 22:23:56 2012 (r239625) @@ -18,8 +18,6 @@ device geom_uzip # compressed in-memory options GEOM_UZIP # For DOS -options GEOM_PART_BSD -options GEOM_PART_MBR options MSDOSFS # .. first DOS-partitioned, BSD sliced flash disk Modified: head/sys/mips/conf/TP-WN1043ND ============================================================================== --- head/sys/mips/conf/TP-WN1043ND Thu Aug 23 21:32:02 2012 (r239624) +++ head/sys/mips/conf/TP-WN1043ND Thu Aug 23 22:23:56 2012 (r239625) @@ -29,8 +29,6 @@ device rtl8366rb # read MSDOS formatted disks - USB options MSDOSFS -options GEOM_PART_BSD -options GEOM_PART_MBR # Enable the uboot environment stuff rather then the # redboot stuff. From owner-svn-src-head@FreeBSD.ORG Thu Aug 23 22:38: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 C9788106583A; Thu, 23 Aug 2012 22:38:38 +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 6A1F58FC0A; Thu, 23 Aug 2012 22:38: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 q7NMcc42007211; Thu, 23 Aug 2012 22:38:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7NMccwx007206; Thu, 23 Aug 2012 22:38:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208232238.q7NMccwx007206@svn.freebsd.org> From: Warner Losh Date: Thu, 23 Aug 2012 22:38: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: r239626 - in head/sys: arm/at91 dev/spibus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 23 Aug 2012 22:38:39 -0000 Author: imp Date: Thu Aug 23 22:38:37 2012 New Revision: 239626 URL: http://svn.freebsd.org/changeset/base/239626 Log: Fetch the chip select in the bridge driver, like all the other spi bridges do. Modified: head/sys/arm/at91/at91_spi.c head/sys/dev/spibus/spi.h head/sys/dev/spibus/spibus.c Modified: head/sys/arm/at91/at91_spi.c ============================================================================== --- head/sys/arm/at91/at91_spi.c Thu Aug 23 22:23:56 2012 (r239625) +++ head/sys/arm/at91/at91_spi.c Thu Aug 23 22:38:37 2012 (r239626) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "spibus_if.h" @@ -270,13 +271,16 @@ at91_spi_transfer(device_t dev, device_t { struct at91_spi_softc *sc; bus_addr_t addr; - int err, i, j, mode[4]; + int err, i, j, mode[4], cs; KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, ("%s: TX/RX command sizes should be equal", __func__)); KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, ("%s: TX/RX data sizes should be equal", __func__)); + /* get the proper chip select */ + spibus_get_cs(child, &cs); + sc = device_get_softc(dev); i = 0; @@ -291,9 +295,9 @@ at91_spi_transfer(device_t dev, device_t * PSCDEC = 0 has a range of 0..3 for chip select. We * don't support PSCDEC = 1 which has a range of 0..15. */ - if (cmd->cs < 0 || cmd->cs > 3) { + if (cs < 0 || cs > 3) { device_printf(dev, - "Invalid chip select %d requested by %s\n", cmd->cs, + "Invalid chip select %d requested by %s\n", cs, device_get_nameunit(child)); err = EINVAL; goto out; @@ -304,7 +308,7 @@ at91_spi_transfer(device_t dev, device_t * The AT91RM9200 couldn't do CS high for CS 0. Other chips can, but we * don't support that yet, or other spi modes. */ - if (at91_is_rm92() && cmd->cs == 0 && + if (at91_is_rm92() && cs == 0 && (cmd->flags & SPI_CHIP_SELECT_HIGH) != 0) { device_printf(dev, "Invalid chip select high requested by %s for cs 0.\n", @@ -313,7 +317,7 @@ at91_spi_transfer(device_t dev, device_t goto out; } #endif - err = (RD4(sc, SPI_MR) & ~0x000f0000) | CS_TO_MR(cmd->cs); + err = (RD4(sc, SPI_MR) & ~0x000f0000) | CS_TO_MR(cs); WR4(sc, SPI_MR, err); /* Modified: head/sys/dev/spibus/spi.h ============================================================================== --- head/sys/dev/spibus/spi.h Thu Aug 23 22:23:56 2012 (r239625) +++ head/sys/dev/spibus/spi.h Thu Aug 23 22:38:37 2012 (r239626) @@ -1,7 +1,6 @@ /* $FreeBSD$ */ struct spi_command { - int cs; void *tx_cmd; uint32_t tx_cmd_sz; void *rx_cmd; Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Thu Aug 23 22:23:56 2012 (r239625) +++ head/sys/dev/spibus/spibus.c Thu Aug 23 22:38:37 2012 (r239626) @@ -158,9 +158,6 @@ spibus_hinted_child(device_t bus, const static int spibus_transfer_impl(device_t dev, device_t child, struct spi_command *cmd) { - /* Maybe set flags too? spi mode? */ - spibus_get_cs(dev, &cmd->cs); - return (SPIBUS_TRANSFER(device_get_parent(dev), child, cmd)); } From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 00:09: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 736DB1065672; Fri, 24 Aug 2012 00:09:50 +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 45A628FC12; Fri, 24 Aug 2012 00:09: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 q7O09os3021007; Fri, 24 Aug 2012 00:09:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O09o3u021005; Fri, 24 Aug 2012 00:09:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240009.q7O09o3u021005@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:09: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: r239627 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 00:09:50 -0000 Author: adrian Date: Fri Aug 24 00:09:49 2012 New Revision: 239627 URL: http://svn.freebsd.org/changeset/base/239627 Log: Add some new flags: * mfp support; * 4.9ghz support in the HAL; * device type - specifically, the bus type and whether it's a HB63 NIC (which requires some subtle chainmask handling differences in the AR5416 HAL.) Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Aug 23 22:38:37 2012 (r239626) +++ head/sys/dev/ath/ath_hal/ah_internal.h Fri Aug 24 00:09:49 2012 (r239627) @@ -228,7 +228,8 @@ typedef struct { halEnhancedDmaSupport : 1; uint32_t halIsrRacSupport : 1, halApmEnable : 1, - halIntrMitigation : 1; + halIntrMitigation : 1, + hal49GhzSupport : 1; uint32_t halWirelessModes; uint16_t halTotalQueues; @@ -245,7 +246,7 @@ typedef struct { uint32_t halIntrMask; uint8_t halTxStreams; uint8_t halRxStreams; - + HAL_MFP_OPT_T halMfpSupport; int halNumTxMaps; int halTxDescLen; int halTxStatusLen; @@ -258,6 +259,12 @@ typedef struct { struct regDomain; /* + * Definitions for ah_flags in ath_hal_private + */ +#define AH_USE_EEPROM 0x1 +#define AH_IS_HB63 0x2 + +/* * The ``private area'' follows immediately after the ``public area'' * in the data structure returned by ath_hal_attach. Private data are * used by device-independent code such as the regulatory domain support. @@ -316,7 +323,9 @@ struct ath_hal_private { uint16_t ah_phyRev; /* PHY revision */ uint16_t ah_analog5GhzRev; /* 2GHz radio revision */ uint16_t ah_analog2GhzRev; /* 5GHz radio revision */ + uint32_t ah_flags; /* misc flags */ uint8_t ah_ispcie; /* PCIE, special treatment */ + uint8_t ah_devType; /* card type - CB, PCI, PCIe */ HAL_OPMODE ah_opmode; /* operating mode from reset */ const struct ieee80211_channel *ah_curchan;/* operating channel */ From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 00:15: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 8E1A6106566C; Fri, 24 Aug 2012 00:15: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 798958FC12; Fri, 24 Aug 2012 00:15: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 q7O0FRxM022086; Fri, 24 Aug 2012 00:15:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0FRLF022083; Fri, 24 Aug 2012 00:15:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240015.q7O0FRLF022083@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:15: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: r239628 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 00:15:27 -0000 Author: adrian Date: Fri Aug 24 00:15:26 2012 New Revision: 239628 URL: http://svn.freebsd.org/changeset/base/239628 Log: Wrap this a little so it's slightly easier on the eyes. Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Fri Aug 24 00:09:49 2012 (r239627) +++ head/sys/dev/ath/ath_hal/ah_internal.h Fri Aug 24 00:15:26 2012 (r239628) @@ -514,7 +514,8 @@ isBigEndian(void) /* Analog register writes may require a delay between each one (eg Merlin?) */ #define OS_A_REG_RMW_FIELD(_a, _r, _f, _v) \ - do { OS_REG_WRITE(_a, _r, (OS_REG_READ(_a, _r) &~ (_f)) | (((_v) << _f##_S) & (_f))) ; OS_DELAY(100); } while (0) + do { OS_REG_WRITE(_a, _r, (OS_REG_READ(_a, _r) &~ (_f)) | \ + (((_v) << _f##_S) & (_f))) ; OS_DELAY(100); } while (0) #define OS_A_REG_WRITE(_a, _r, _v) \ do { OS_REG_WRITE(_a, _r, _v); OS_DELAY(100); } while (0) From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 00:17:40 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 50719106566B; Fri, 24 Aug 2012 00:17:40 +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 3BA968FC15; Fri, 24 Aug 2012 00:17: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 q7O0Heu7022517; Fri, 24 Aug 2012 00:17:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0HeHF022514; Fri, 24 Aug 2012 00:17:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240017.q7O0HeHF022514@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:17: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: r239629 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 00:17:40 -0000 Author: adrian Date: Fri Aug 24 00:17:39 2012 New Revision: 239629 URL: http://svn.freebsd.org/changeset/base/239629 Log: Add some more diagnostic codes. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah_diagcodes.h Modified: head/sys/dev/ath/ath_hal/ah_diagcodes.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_diagcodes.h Fri Aug 24 00:15:26 2012 (r239628) +++ head/sys/dev/ath/ath_hal/ah_diagcodes.h Fri Aug 24 00:17:39 2012 (r239629) @@ -63,6 +63,10 @@ enum { HAL_DIAG_CHECK_HANGS = 32, /* check h/w hangs */ HAL_DIAG_SETREGS = 33, /* write registers */ HAL_DIAG_CHANSURVEY = 34, /* channel survey */ + HAL_DIAG_PRINT_REG = 35, + HAL_DIAG_PRINT_REG_ALL = 36, + HAL_DIAG_CHANNELS = 37, + HAL_DIAG_PRINT_REG_COUNTER = 38, }; #endif /* _ATH_AH_DIAGCODES_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 00:33: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 8CBBD106564A; Fri, 24 Aug 2012 00:33: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 781988FC0A; Fri, 24 Aug 2012 00:33: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 q7O0XQKJ025382; Fri, 24 Aug 2012 00:33:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0XQFu025380; Fri, 24 Aug 2012 00:33:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240033.q7O0XQFu025380@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:33: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: r239630 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 00:33:26 -0000 Author: adrian Date: Fri Aug 24 00:33:25 2012 New Revision: 239630 URL: http://svn.freebsd.org/changeset/base/239630 Log: Add the MFP capability to ath_hal_getcapability(). Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Fri Aug 24 00:17:39 2012 (r239629) +++ head/sys/dev/ath/ath_hal/ah.c Fri Aug 24 00:33:25 2012 (r239630) @@ -718,7 +718,9 @@ ath_hal_getcapability(struct ath_hal *ah return pCap->halHasBBReadWar? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_SERIALISE_WAR: /* PCI register serialisation */ return pCap->halSerialiseRegWar ? HAL_OK : HAL_ENOTSUPP; - + case HAL_CAP_MFP: /* Management frame protection setting */ + *result = pCap->halMfpSupport; + return HAL_OK; default: return HAL_EINVAL; } From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 00:36: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 6E14A106566C; Fri, 24 Aug 2012 00:36:48 +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 596968FC0A; Fri, 24 Aug 2012 00:36: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 q7O0amJ5025991; Fri, 24 Aug 2012 00:36:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0amVr025989; Fri, 24 Aug 2012 00:36:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240036.q7O0amVr025989@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:36: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: r239631 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 00:36:48 -0000 Author: adrian Date: Fri Aug 24 00:36:47 2012 New Revision: 239631 URL: http://svn.freebsd.org/changeset/base/239631 Log: Add some more capabilities (unused at the present.) Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 00:33:25 2012 (r239630) +++ head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 00:36:47 2012 (r239631) @@ -163,8 +163,24 @@ typedef enum { HAL_CAP_HT20_SGI = 96, /* hardware supports HT20 short GI */ + HAL_CAP_LDPC = 99, + HAL_CAP_RXTSTAMP_PREC = 100, /* rx desc tstamp precision (bits) */ + + HAL_CAP_PHYRESTART_CLR_WAR = 106, /* in some cases, clear phy restart to fix bb hang */ + HAL_CAP_ENTERPRISE_MODE = 107, /* Enterprise mode features */ + HAL_CAP_LDPCWAR = 108, + HAL_CAP_CHANNEL_SWITCH_TIME_USEC = 109, /* Channel change time, usec */ + HAL_CAP_ENABLE_APM = 110, /* APM enabled */ + HAL_CAP_PCIE_LCR_EXTSYNC_EN = 111, + HAL_CAP_PCIE_LCR_OFFSET = 112, + HAL_CAP_ENHANCED_DFS_SUPPORT = 117, /* hardware supports enhanced DFS */ + HAL_CAP_MCI = 118, + HAL_CAP_SMARTANTENNA = 119, + HAL_CAP_TRAFFIC_FAST_RECOVER = 120, + HAL_CAP_TX_DIVERSITY = 121, + HAL_CAP_CRDC = 122, /* The following are private to the FreeBSD HAL (224 onward) */ From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 00:40:02 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 256D01065700; Fri, 24 Aug 2012 00:40:02 +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 0B5D88FC0C; Fri, 24 Aug 2012 00:40: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 q7O0e1U9026607; Fri, 24 Aug 2012 00:40:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0e1Y3026606; Fri, 24 Aug 2012 00:40:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240040.q7O0e1Y3026606@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:40: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: r239632 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 00:40:02 -0000 Author: adrian Date: Fri Aug 24 00:40:01 2012 New Revision: 239632 URL: http://svn.freebsd.org/changeset/base/239632 Log: Oops, fix copy/paste silliness. Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 00:36:47 2012 (r239631) +++ head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 00:40:01 2012 (r239632) @@ -176,11 +176,11 @@ typedef enum { HAL_CAP_PCIE_LCR_OFFSET = 112, HAL_CAP_ENHANCED_DFS_SUPPORT = 117, /* hardware supports enhanced DFS */ - HAL_CAP_MCI = 118, - HAL_CAP_SMARTANTENNA = 119, - HAL_CAP_TRAFFIC_FAST_RECOVER = 120, - HAL_CAP_TX_DIVERSITY = 121, - HAL_CAP_CRDC = 122, + HAL_CAP_MCI = 118, + HAL_CAP_SMARTANTENNA = 119, + HAL_CAP_TRAFFIC_FAST_RECOVER = 120, + HAL_CAP_TX_DIVERSITY = 121, + HAL_CAP_CRDC = 122, /* The following are private to the FreeBSD HAL (224 onward) */ From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 00:43: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 886FF1065679; Fri, 24 Aug 2012 00:43: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 745AC8FC20; Fri, 24 Aug 2012 00:43:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O0hBOF027240; Fri, 24 Aug 2012 00:43:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0hBCZ027238; Fri, 24 Aug 2012 00:43:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240043.q7O0hBCZ027238@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:43: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: r239633 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 00:43:11 -0000 Author: adrian Date: Fri Aug 24 00:43:10 2012 New Revision: 239633 URL: http://svn.freebsd.org/changeset/base/239633 Log: Add rfkill HAL accessor methods. Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Fri Aug 24 00:40:01 2012 (r239632) +++ head/sys/dev/ath/ath_hal/ah_internal.h Fri Aug 24 00:43:10 2012 (r239633) @@ -393,6 +393,13 @@ struct ath_hal_private { #define ath_hal_setInterrupts(_ah, _mask) \ (_ah)->ah_setInterrupts(_ah, _mask) +#define ath_hal_isrfkillenabled(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_RFSILENT, 1, AH_NULL) == HAL_OK) +#define ath_hal_enable_rfkill(_ah, _v) \ + ath_hal_setcapability(_ah, HAL_CAP_RFSILENT, 1, _v, AH_NULL) +#define ath_hal_hasrfkill_int(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_RFSILENT, 3, AH_NULL) == HAL_OK) + #define ath_hal_eepromDetach(_ah) do { \ if (AH_PRIVATE(_ah)->ah_eepromDetach != AH_NULL) \ AH_PRIVATE(_ah)->ah_eepromDetach(_ah); \ From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 00:52: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 9F3C61065673; Fri, 24 Aug 2012 00:52:38 +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 70FF18FC08; Fri, 24 Aug 2012 00:52: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 q7O0qc6X028979; Fri, 24 Aug 2012 00:52:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0qcXA028975; Fri, 24 Aug 2012 00:52:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240052.q7O0qcXA028975@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:52: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: r239634 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 00:52:38 -0000 Author: adrian Date: Fri Aug 24 00:52:37 2012 New Revision: 239634 URL: http://svn.freebsd.org/changeset/base/239634 Log: Add ath_hal_get_curmode() - this is used by the Osprey HAL. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Fri Aug 24 00:43:10 2012 (r239633) +++ head/sys/dev/ath/ath_hal/ah.c Fri Aug 24 00:52:37 2012 (r239634) @@ -420,6 +420,50 @@ ath_hal_computetxtime(struct ath_hal *ah return txTime; } +int +ath_hal_get_curmode(struct ath_hal *ah, const struct ieee80211_channel *chan) +{ + /* + * Pick a default mode at bootup. A channel change is inevitable. + */ + if (!chan) + return HAL_MODE_11NG_HT20; + + if (IEEE80211_IS_CHAN_TURBO(chan)) + return HAL_MODE_TURBO; + + /* check for NA_HT before plain A, since IS_CHAN_A includes NA_HT */ + if (IEEE80211_IS_CHAN_5GHZ(chan) && IEEE80211_IS_CHAN_HT20(chan)) + return HAL_MODE_11NA_HT20; + if (IEEE80211_IS_CHAN_5GHZ(chan) && IEEE80211_IS_CHAN_HT40U(chan)) + return HAL_MODE_11NA_HT40PLUS; + if (IEEE80211_IS_CHAN_5GHZ(chan) && IEEE80211_IS_CHAN_HT40D(chan)) + return HAL_MODE_11NA_HT40MINUS; + if (IEEE80211_IS_CHAN_A(chan)) + return HAL_MODE_11A; + + /* check for NG_HT before plain G, since IS_CHAN_G includes NG_HT */ + if (IEEE80211_IS_CHAN_2GHZ(chan) && IEEE80211_IS_CHAN_HT20(chan)) + return HAL_MODE_11NG_HT20; + if (IEEE80211_IS_CHAN_2GHZ(chan) && IEEE80211_IS_CHAN_HT40U(chan)) + return HAL_MODE_11NG_HT40PLUS; + if (IEEE80211_IS_CHAN_2GHZ(chan) && IEEE80211_IS_CHAN_HT40D(chan)) + return HAL_MODE_11NG_HT40MINUS; + + /* + * XXX For FreeBSD, will this work correctly given the DYN + * chan mode (OFDM+CCK dynamic) ? We have pure-G versions DYN-BG.. + */ + if (IEEE80211_IS_CHAN_G(chan)) + return HAL_MODE_11G; + if (IEEE80211_IS_CHAN_B(chan)) + return HAL_MODE_11B; + + HALASSERT(0); + return HAL_MODE_11NG_HT20; +} + + typedef enum { WIRELESS_MODE_11a = 0, WIRELESS_MODE_TURBO = 1, Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 00:43:10 2012 (r239633) +++ head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 00:52:37 2012 (r239634) @@ -1390,6 +1390,12 @@ extern void __ahdecl ath_hal_process_noi extern u_int __ahdecl ath_hal_getwirelessmodes(struct ath_hal*); /* + * Get the HAL wireless mode for the given channel. + */ +extern int ath_hal_get_curmode(struct ath_hal *ah, + const struct ieee80211_channel *chan); + +/* * Calculate the packet TX time for a legacy or 11n frame */ extern uint32_t __ahdecl ath_hal_pkt_txtime(struct ath_hal *ah, From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 00:54:32 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 84BD9106564A; Fri, 24 Aug 2012 00:54:32 +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 7045F8FC1A; Fri, 24 Aug 2012 00:54: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 q7O0sWgT029353; Fri, 24 Aug 2012 00:54:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O0sWXI029351; Fri, 24 Aug 2012 00:54:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240054.q7O0sWXI029351@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 00:54: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: r239635 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 00:54:32 -0000 Author: adrian Date: Fri Aug 24 00:54:31 2012 New Revision: 239635 URL: http://svn.freebsd.org/changeset/base/239635 Log: Oops, another copy/paste issue. Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 00:52:37 2012 (r239634) +++ head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 00:54:31 2012 (r239635) @@ -1392,7 +1392,7 @@ extern u_int __ahdecl ath_hal_getwireles /* * Get the HAL wireless mode for the given channel. */ -extern int ath_hal_get_curmode(struct ath_hal *ah, +extern int ath_hal_get_curmode(struct ath_hal *ah, const struct ieee80211_channel *chan); /* From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 01:12: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 B7898106566B; Fri, 24 Aug 2012 01:12:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2F028FC12; Fri, 24 Aug 2012 01:12: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 q7O1C785032544; Fri, 24 Aug 2012 01:12:07 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O1C7hl032541; Fri, 24 Aug 2012 01:12:07 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201208240112.q7O1C7hl032541@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 24 Aug 2012 01:12: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: r239636 - head/sys/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 01:12:07 -0000 Author: pfg Date: Fri Aug 24 01:12:07 2012 New Revision: 239636 URL: http://svn.freebsd.org/changeset/base/239636 Log: Add some basic definitions for a future htree implementation. MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2fs.h Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Fri Aug 24 00:54:31 2012 (r239635) +++ head/sys/fs/ext2fs/ext2_dinode.h Fri Aug 24 01:12:07 2012 (r239636) @@ -57,10 +57,12 @@ #define EXT2_COMPR 0x00000004 /* Compress file */ #define EXT2_SYNC 0x00000008 /* Synchronous updates */ #define EXT2_IMMUTABLE 0x00000010 /* Immutable file */ -#define EXT2_APPEND 0x00000020 /* writes to file may only append */ +#define EXT2_APPEND 0x00000020 /* writes to file may only append */ #define EXT2_NODUMP 0x00000040 /* do not dump file */ #define EXT2_NOATIME 0x00000080 /* do not update atime */ +#define EXT2_HTREE 0x00001000 /* HTree-indexed directory */ + /* * Definitions for nanosecond timestamps. * Ext3 inode versioning, 2006-12-13. Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Fri Aug 24 00:54:31 2012 (r239635) +++ head/sys/fs/ext2fs/ext2fs.h Fri Aug 24 01:12:07 2012 (r239636) @@ -210,6 +210,7 @@ struct m_ext2fs { #define EXT2F_COMPAT_PREALLOC 0x0001 #define EXT2F_COMPAT_HASJOURNAL 0x0004 #define EXT2F_COMPAT_RESIZE 0x0010 +#define EXT2F_COMPAT_HTREE 0x0020 #define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 #define EXT2F_ROCOMPAT_LARGEFILE 0x0002 From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 01:14: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 6E3FD106566C; Fri, 24 Aug 2012 01:14:01 +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 58F6A8FC0A; Fri, 24 Aug 2012 01:14: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 q7O1E1MV033126; Fri, 24 Aug 2012 01:14:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O1E1Xf033124; Fri, 24 Aug 2012 01:14:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240114.q7O1E1Xf033124@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 01:14: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: r239637 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 01:14:01 -0000 Author: adrian Date: Fri Aug 24 01:14:00 2012 New Revision: 239637 URL: http://svn.freebsd.org/changeset/base/239637 Log: Bring over some new EEPROM regulatory domain flags. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom.h Fri Aug 24 01:12:07 2012 (r239636) +++ head/sys/dev/ath/ath_hal/ah_eeprom.h Fri Aug 24 01:14:00 2012 (r239637) @@ -105,6 +105,10 @@ enum { AR_EEP_TEMPSENSE_SLOPE, /* int8_t* */ AR_EEP_TEMPSENSE_SLOPE_PAL_ON, /* int8_t* */ AR_EEP_FRAC_N_5G, /* uint8_t* */ + + /* New fields for AR9300 and later */ + AR_EEP_DRIVE_STRENGTH, + AR_EEP_PAPRD_ENABLED, }; typedef struct { @@ -127,6 +131,30 @@ typedef struct { #define CTL_2GHT40 7 #define CTL_5GHT40 8 +/* XXX must match what FCC/MKK/ETSI are defined as in ah_regdomain.h */ +#define HAL_REG_DMN_MASK 0xf0 +#define HAL_REGDMN_FCC 0x10 +#define HAL_REGDMN_MKK 0x40 +#define HAL_REGDMN_ETSI 0x30 + +#define is_reg_dmn_fcc(reg_dmn) \ + (((reg_dmn & HAL_REG_DMN_MASK) == HAL_REGDMN_FCC) ? 1 : 0) +#define is_reg_dmn_etsi(reg_dmn) \ + (((reg_dmn & HAL_REG_DMN_MASK) == HAL_REGDMN_ETSI) ? 1 : 0) +#define is_reg_dmn_mkk(reg_dmn) \ + (((reg_dmn & HAL_REG_DMN_MASK) == HAL_REGDMN_MKK) ? 1 : 0) + +#define AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040 +#define AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080 +#define AR_EEPROM_EEREGCAP_EN_KK_U2 0x0100 +#define AR_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200 +#define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400 +#define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800 + +/* regulatory capabilities prior to eeprom version 4.0 */ +#define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD_PRE4_0 0x4000 +#define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A_PRE4_0 0x8000 + #define AR_NO_SPUR 0x8000 /* XXX exposed to chip code */ From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 01:29: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 33F92106566B; Fri, 24 Aug 2012 01:29:47 +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 1E8728FC18; Fri, 24 Aug 2012 01:29: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 q7O1Tkt7035826; Fri, 24 Aug 2012 01:29:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O1TkJ8035821; Fri, 24 Aug 2012 01:29:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240129.q7O1TkJ8035821@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 01:29: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: r239638 - in 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, 24 Aug 2012 01:29:47 -0000 Author: adrian Date: Fri Aug 24 01:29:46 2012 New Revision: 239638 URL: http://svn.freebsd.org/changeset/base/239638 Log: Implement an API to fetch the default DFS parameters for the given chip. The only chip this is currently implemented for is the AR5416 HAL family. A follow-up commit will add AR5212 support. PR: kern/170904 Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_radar.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 01:14:00 2012 (r239637) +++ head/sys/dev/ath/ath_hal/ah.h Fri Aug 24 01:29:46 2012 (r239638) @@ -1223,6 +1223,8 @@ struct ath_hal { HAL_PHYERR_PARAM *pe); void __ahdecl(*ah_getDfsThresh)(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); + HAL_BOOL __ahdecl(*ah_getDfsDefaultThresh)(struct ath_hal *ah, + HAL_PHYERR_PARAM *pe); HAL_BOOL __ahdecl(*ah_procRadarEvent)(struct ath_hal *ah, struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, HAL_DFS_EVENT *event); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Aug 24 01:14:00 2012 (r239637) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Aug 24 01:29:46 2012 (r239638) @@ -253,6 +253,8 @@ extern HAL_BOOL ar5416SetRifsDelay(struc const struct ieee80211_channel *chan, HAL_BOOL enable); extern void ar5416EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); +extern HAL_BOOL ar5416GetDfsDefaultThresh(struct ath_hal *ah, + HAL_PHYERR_PARAM *pe); extern void ar5416GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); extern HAL_BOOL ar5416ProcessRadarEvent(struct ath_hal *ah, struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Aug 24 01:14:00 2012 (r239637) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Aug 24 01:29:46 2012 (r239638) @@ -156,6 +156,7 @@ ar5416InitState(struct ath_hal_5416 *ahp /* DFS Functions */ ah->ah_enableDfs = ar5416EnableDfs; ah->ah_getDfsThresh = ar5416GetDfsThresh; + ah->ah_getDfsDefaultThresh = ar5416GetDfsDefaultThresh; ah->ah_procRadarEvent = ar5416ProcessRadarEvent; ah->ah_isFastClockEnabled = ar5416IsFastClockEnabled; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_radar.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_radar.c Fri Aug 24 01:14:00 2012 (r239637) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_radar.c Fri Aug 24 01:29:46 2012 (r239638) @@ -29,6 +29,51 @@ #include "ah_eeprom_v14.h" /* for owl_get_ntxchains() */ /* + * These are default parameters for the AR5416 and + * later 802.11n NICs. They simply enable some + * radar pulse event generation. + * + * These are very likely not valid for the AR5212 era + * NICs. + * + * Since these define signal sizing and threshold + * parameters, they may need changing based on the + * specific antenna and receive amplifier + * configuration. + */ +#define AR5416_DFS_FIRPWR -33 +#define AR5416_DFS_RRSSI 20 +#define AR5416_DFS_HEIGHT 10 +#define AR5416_DFS_PRSSI 15 +#define AR5416_DFS_INBAND 15 +#define AR5416_DFS_RELPWR 8 +#define AR5416_DFS_RELSTEP 12 +#define AR5416_DFS_MAXLEN 255 + +HAL_BOOL +ar5416GetDfsDefaultThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) +{ + + /* + * These are general examples of the parameter values + * to use when configuring radar pulse detection for + * the AR5416, AR91xx, AR92xx NICs. They are only + * for testing and do require tuning depending upon the + * hardware and deployment specifics. + */ + pe->pe_firpwr = AR5416_DFS_FIRPWR; + pe->pe_rrssi = AR5416_DFS_RRSSI; + pe->pe_height = AR5416_DFS_HEIGHT; + pe->pe_prssi = AR5416_DFS_PRSSI; + pe->pe_inband = AR5416_DFS_INBAND; + pe->pe_relpwr = AR5416_DFS_RELPWR; + pe->pe_relstep = AR5416_DFS_RELSTEP; + pe->pe_maxlen = AR5416_DFS_MAXLEN; + + return (AH_TRUE); +} + +/* * Get the radar parameter values and return them in the pe * structure */ From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 06:55: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 37892106564A; Fri, 24 Aug 2012 06:55:17 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22BFC8FC08; Fri, 24 Aug 2012 06:55: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 q7O6tGTs086538; Fri, 24 Aug 2012 06:55:16 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O6tG6Y086536; Fri, 24 Aug 2012 06:55:16 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201208240655.q7O6tG6Y086536@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 24 Aug 2012 06:55: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: r239640 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 06:55:17 -0000 Author: ru Date: Fri Aug 24 06:55:16 2012 New Revision: 239640 URL: http://svn.freebsd.org/changeset/base/239640 Log: A workaround in r238563 was for makes (notably bmake) without the internal knowledge that "cd" is a shell's built-in. Such makes may attempt to exec() "cd" that in turn will fail on systems that lack the "cd" executable. Reworked this by eliminating the root cause. Submitted by: Simon Gerraty Modified: head/gnu/usr.bin/groff/tmac/Makefile Modified: head/gnu/usr.bin/groff/tmac/Makefile ============================================================================== --- head/gnu/usr.bin/groff/tmac/Makefile Fri Aug 24 05:36:37 2012 (r239639) +++ head/gnu/usr.bin/groff/tmac/Makefile Fri Aug 24 06:55:16 2012 (r239640) @@ -62,13 +62,12 @@ $f-s: $f .endfor beforeinstall: - cd ${DIST_DIR}; \ + (cd ${DIST_DIR} && \ ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ - ${NORMALFILES} ${DESTDIR}${TMACDIR} - cd ${.CURDIR}; \ + ${NORMALFILES} ${DESTDIR}${TMACDIR}) + (cd ${.CURDIR} && \ ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ - koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR} - cd ${.OBJDIR}; + koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR}) .for f in ${STRIPFILES} ${SPECIALFILES} ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ $f-s ${DESTDIR}${TMACDIR}/$f From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 07:32: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 C924D106566B; Fri, 24 Aug 2012 07:32:35 +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 B3BC08FC0C; Fri, 24 Aug 2012 07:32: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 q7O7WZEH091998; Fri, 24 Aug 2012 07:32:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O7WZbb091994; Fri, 24 Aug 2012 07:32:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240732.q7O7WZbb091994@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 07:32: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: r239642 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 07:32:36 -0000 Author: adrian Date: Fri Aug 24 07:32:35 2012 New Revision: 239642 URL: http://svn.freebsd.org/changeset/base/239642 Log: Add the method to fetch the default DFS parameters for the AR5212 PHY. I need to check whether new parameters were added for the AR5413 NIC. PR: kern/170904 Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Fri Aug 24 06:56:44 2012 (r239641) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Fri Aug 24 07:32:35 2012 (r239642) @@ -633,6 +633,8 @@ extern void ar5212AniReset(struct ath_ha extern HAL_BOOL ar5212IsNFCalInProgress(struct ath_hal *ah); extern HAL_BOOL ar5212WaitNFCalComplete(struct ath_hal *ah, int i); extern void ar5212EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); +extern HAL_BOOL ar5212GetDfsDefaultThresh(struct ath_hal *ah, + HAL_PHYERR_PARAM *pe); extern void ar5212GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); extern HAL_BOOL ar5212ProcessRadarEvent(struct ath_hal *ah, struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Aug 24 06:56:44 2012 (r239641) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Aug 24 07:32:35 2012 (r239642) @@ -137,6 +137,7 @@ static const struct ath_hal_private ar52 /* DFS Functions */ .ah_enableDfs = ar5212EnableDfs, .ah_getDfsThresh = ar5212GetDfsThresh, + .ah_getDfsDefaultThresh = ar5212GetDfsDefaultThresh, .ah_procRadarEvent = ar5212ProcessRadarEvent, .ah_isFastClockEnabled = ar5212IsFastClockEnabled, .ah_get11nExtBusy = ar5212Get11nExtBusy, Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Aug 24 06:56:44 2012 (r239641) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Aug 24 07:32:35 2012 (r239642) @@ -1163,6 +1163,35 @@ ar5212EnableDfs(struct ath_hal *ah, HAL_ OS_REG_WRITE(ah, AR_PHY_RADAR_0, val | AR_PHY_RADAR_0_ENA); } +/* + * Parameters for the AR5212 PHY. + * + * TODO: figure out what values were added for the AR5413 and later + * PHY; update these here. + */ +#define AR5212_DFS_FIRPWR -41 +#define AR5212_DFS_RRSSI 12 +#define AR5212_DFS_HEIGHT 20 +#define AR5212_DFS_PRSSI 22 +#define AR5212_DFS_INBAND 6 + +HAL_BOOL +ar5212GetDfsDefaultThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) +{ + + pe->pe_firpwr = AR5212_DFS_FIRPWR; + pe->pe_rrssi = AR5212_DFS_RRSSI; + pe->pe_height = AR5212_DFS_HEIGHT; + pe->pe_prssi = AR5212_DFS_PRSSI; + pe->pe_inband = AR5212_DFS_INBAND; + /* XXX look up what is needed for the AR5413 */ + pe->pe_relpwr = 0; + pe->pe_relstep = 0; + pe->pe_maxlen = 0; + + return (AH_TRUE); +} + void ar5212GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) { @@ -1250,7 +1279,7 @@ ar5212Get11nExtBusy(struct ath_hal *ah) } /* - * There's no channel survey support for the AR5211. + * There's no channel survey support for the AR5212. */ HAL_BOOL ar5212GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample) From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 07:35: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 F2C4E106564A; Fri, 24 Aug 2012 07:35:18 +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 C48718FC08; Fri, 24 Aug 2012 07:35: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 q7O7ZIwU092428; Fri, 24 Aug 2012 07:35:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O7ZIbo092423; Fri, 24 Aug 2012 07:35:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240735.q7O7ZIbo092423@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 07:35: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: r239643 - in head/sys/dev/ath/ath_hal: ar5210 ar5211 ar5212 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, 24 Aug 2012 07:35:19 -0000 Author: adrian Date: Fri Aug 24 07:35:18 2012 New Revision: 239643 URL: http://svn.freebsd.org/changeset/base/239643 Log: Add default values for the NumTxMaps capability. Modified: 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 Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri Aug 24 07:32:35 2012 (r239642) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri Aug 24 07:35:18 2012 (r239643) @@ -362,6 +362,7 @@ ar5210FillCapabilityInfo(struct ath_hal pCap->halSleepAfterBeaconBroken = AH_TRUE; pCap->halPSPollBroken = AH_FALSE; pCap->halNumMRRetries = 1; /* No hardware MRR support */ + pCap->halNumTxMaps = 1; /* Single TX ptr per descr */ pCap->halTotalQueues = HAL_NUM_TX_QUEUES; pCap->halKeyCacheSize = 64; Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri Aug 24 07:32:35 2012 (r239642) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri Aug 24 07:35:18 2012 (r239643) @@ -497,6 +497,7 @@ ar5211FillCapabilityInfo(struct ath_hal pCap->halPSPollBroken = AH_TRUE; pCap->halVEOLSupport = AH_TRUE; pCap->halNumMRRetries = 1; /* No hardware MRR support */ + pCap->halNumTxMaps = 1; /* Single TX ptr per descr */ pCap->halTotalQueues = HAL_NUM_TX_QUEUES; pCap->halKeyCacheSize = 128; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Aug 24 07:32:35 2012 (r239642) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Aug 24 07:35:18 2012 (r239643) @@ -826,6 +826,7 @@ ar5212FillCapabilityInfo(struct ath_hal pCap->halPSPollBroken = AH_TRUE; /* XXX fixed in later revs? */ pCap->halNumMRRetries = 4; /* Hardware supports 4 MRR */ + pCap->halNumTxMaps = 1; /* Single TX ptr per descr */ pCap->halVEOLSupport = AH_TRUE; pCap->halBssIdMaskSupport = AH_TRUE; pCap->halMcastKeySrchSupport = AH_TRUE; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Aug 24 07:32:35 2012 (r239642) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Aug 24 07:35:18 2012 (r239643) @@ -894,6 +894,7 @@ ar5416FillCapabilityInfo(struct ath_hal pCap->halPSPollBroken = AH_TRUE; /* XXX fixed in later revs? */ pCap->halNumMRRetries = 4; /* Hardware supports 4 MRR */ + pCap->halNumTxMaps = 1; /* Single TX ptr per descr */ pCap->halVEOLSupport = AH_TRUE; pCap->halBssIdMaskSupport = AH_TRUE; pCap->halMcastKeySrchSupport = AH_TRUE; /* Works on AR5416 and later */ From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 10:34: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 D2F6E106564A; Fri, 24 Aug 2012 10:34:52 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 772948FC08; Fri, 24 Aug 2012 10:34:52 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q7OAYphM036756; Fri, 24 Aug 2012 12:34:51 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q7OAYpE0036755; Fri, 24 Aug 2012 12:34:51 +0200 (CEST) (envelope-from marius) Date: Fri, 24 Aug 2012 12:34:51 +0200 From: Marius Strobl To: John Baldwin Message-ID: <20120824103451.GM28757@alchemy.franken.de> References: <201111182239.pAIMdkCr003347@svn.freebsd.org> <201208231012.52720.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201208231012.52720.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Marius Strobl , Bjoern Zeeb , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r227687 - 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, 24 Aug 2012 10:34:53 -0000 On Thu, Aug 23, 2012 at 10:12:52AM -0400, John Baldwin wrote: > On Friday, November 18, 2011 5:39:46 pm Marius Strobl wrote: > > Author: marius > > Date: Fri Nov 18 22:39:46 2011 > > New Revision: 227687 > > URL: http://svn.freebsd.org/changeset/base/227687 > > > > Log: > > - Add a hint.miibus.X.phymask hint, allowing do individually exclude PHY > > addresses from being probed and attaching something including ukphy(4) > > to it. This is mainly necessarily for PHY switches that create duplicate > > or fake PHYs on the bus that can corrupt the PHY state when accessed or > > simply cause problems when ukphy(4) isolates the additional instances. > > - Change miibus(4) to be a hinted bus, allowing to add child devices via > > hints and to set their attach arguments (including for automatically > > probed PHYs). This is mainly needed for PHY switches that violate IEEE > > 802.3 and don't even implement the basic register set so we can't probe > > them automatically. However, the ability to alter the attach arguments > > for automatically probed PHYs is also useful as for example it allows > > to test (or tell a user to test) new variant of a PHY with a specific > > driver by letting an existing driver attach to it via manipulating the > > IDs without the need to touch the source code or to limit a Gigabit > > Ethernet PHY to only announce up to Fast Ethernet in order to save > > energy by limiting the capability mask. Generally, a driver has to > > be hinted via hint.phydrv.X.at="miibusY" and hint.phydrv.X.phyno="Z" > > (which already is sufficient to add phydrvX at miibusY at PHY address > > Z). Then optionally the following attach arguments additionally can > > be configured: > > hint.phydrv.X.id1 > > hint.phydrv.X.id2 > > hint.phydrv.X.capmask > > - Some minor cleanup. > > I was looking at this today with bz to try to figure out how to use this. > It strikes me that in a case of a bus with devices that have IDs it can > be useful to not hardcode the driver name and unit number, but to be able > to create a device and let the normal driver probe mechanics work. The > existing miibus_hinted_child() routine already largely enforces that by > ensuring that any new child has a unique phyno address. Two approaches I > can think of are: > > 1) Never hardcode the name and unit number. > > 2) Don't hardcode the name and unit number if the name is "phy". > > This would let you do something like: > > hint.phy.0.at="miibus0" > hint.phy.0.phyno="1" > hint.phy.0.id1="xxx" > hint.phy.0.id2="yyy" > > And then 'e1000phy' or 'brphy' or whoever could manage the phy. Though > perhaps in the case of hinted children you want to always force the phy > driver? > I think to understand what you mean but fail to see an actual use case for it. If there's a real PHY on a MII bus a specialized driver like e1000phy(4) already knows about, there's no reason to use a hint to force it to probe and attach as that will be done automatically. If on the other hand, you'd want to say e1000phy(4) probe and attach a PHY it doesn't know about, you'd need to also alter its probe table but your approach doesn't provide any means to link a PHY hint with a certain driver. In general, the use for the latter is also very limited in reality as drivers have to not only take IDs into account but also things like chip revisions etc. (that's also why I think that attempts to make PCI drivers use a unified probing approach/tables in order to provide means to patch ID lists is rather pointless). The main purpose of the above commit is to force wildcard/hoover drivers like ukphy(4) to attach to non-IEEE 802.3 compliant "PHYs" without proper ID registers like so: hint.ukphy.0.at="miibus0" hint.ukphy.0.phyno="2" The use of the name of the driver to probe and attach in these hints mainly was done for consistency with the ISA etc. hints we have. However, as noted in the commit message, you can actually (ab)use these hints to also make a specialized driver probe and attach an unknown PHY (real or not) by faking the ID registers of a PHY it knows of. Note that for this to work, you actually need to put the appropriate contents of real ID registers into these hints and not just OUI and model as found in the driver. As noted above, the use for this method might be very limited in reality. Marius From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 12:36: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 5CC6F1065674; Fri, 24 Aug 2012 12:36:26 +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 1D60F8FC08; Fri, 24 Aug 2012 12:36:26 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6DF76B921; Fri, 24 Aug 2012 08:36:25 -0400 (EDT) From: John Baldwin To: Marius Strobl Date: Fri, 24 Aug 2012 07:50:41 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201111182239.pAIMdkCr003347@svn.freebsd.org> <201208231012.52720.jhb@freebsd.org> <20120824103451.GM28757@alchemy.franken.de> In-Reply-To: <20120824103451.GM28757@alchemy.franken.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201208240750.41304.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 24 Aug 2012 08:36:25 -0400 (EDT) Cc: svn-src-head@freebsd.org, Marius Strobl , Bjoern Zeeb , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r227687 - 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, 24 Aug 2012 12:36:26 -0000 On Friday, August 24, 2012 6:34:51 am Marius Strobl wrote: > On Thu, Aug 23, 2012 at 10:12:52AM -0400, John Baldwin wrote: > > On Friday, November 18, 2011 5:39:46 pm Marius Strobl wrote: > > > Author: marius > > > Date: Fri Nov 18 22:39:46 2011 > > > New Revision: 227687 > > > URL: http://svn.freebsd.org/changeset/base/227687 > > > > > > Log: > > > - Add a hint.miibus.X.phymask hint, allowing do individually exclude PHY > > > addresses from being probed and attaching something including ukphy(4) > > > to it. This is mainly necessarily for PHY switches that create duplicate > > > or fake PHYs on the bus that can corrupt the PHY state when accessed or > > > simply cause problems when ukphy(4) isolates the additional instances. > > > - Change miibus(4) to be a hinted bus, allowing to add child devices via > > > hints and to set their attach arguments (including for automatically > > > probed PHYs). This is mainly needed for PHY switches that violate IEEE > > > 802.3 and don't even implement the basic register set so we can't probe > > > them automatically. However, the ability to alter the attach arguments > > > for automatically probed PHYs is also useful as for example it allows > > > to test (or tell a user to test) new variant of a PHY with a specific > > > driver by letting an existing driver attach to it via manipulating the > > > IDs without the need to touch the source code or to limit a Gigabit > > > Ethernet PHY to only announce up to Fast Ethernet in order to save > > > energy by limiting the capability mask. Generally, a driver has to > > > be hinted via hint.phydrv.X.at="miibusY" and hint.phydrv.X.phyno="Z" > > > (which already is sufficient to add phydrvX at miibusY at PHY address > > > Z). Then optionally the following attach arguments additionally can > > > be configured: > > > hint.phydrv.X.id1 > > > hint.phydrv.X.id2 > > > hint.phydrv.X.capmask > > > - Some minor cleanup. > > > > I was looking at this today with bz to try to figure out how to use this. > > It strikes me that in a case of a bus with devices that have IDs it can > > be useful to not hardcode the driver name and unit number, but to be able > > to create a device and let the normal driver probe mechanics work. The > > existing miibus_hinted_child() routine already largely enforces that by > > ensuring that any new child has a unique phyno address. Two approaches I > > can think of are: > > > > 1) Never hardcode the name and unit number. > > > > 2) Don't hardcode the name and unit number if the name is "phy". > > > > This would let you do something like: > > > > hint.phy.0.at="miibus0" > > hint.phy.0.phyno="1" > > hint.phy.0.id1="xxx" > > hint.phy.0.id2="yyy" > > > > And then 'e1000phy' or 'brphy' or whoever could manage the phy. Though > > perhaps in the case of hinted children you want to always force the phy > > driver? > > > > I think to understand what you mean but fail to see an actual > use case for it. If there's a real PHY on a MII bus a specialized > driver like e1000phy(4) already knows about, there's no reason > to use a hint to force it to probe and attach as that will be > done automatically. If on the other hand, you'd want to say > e1000phy(4) probe and attach a PHY it doesn't know about, you'd > need to also alter its probe table but your approach doesn't > provide any means to link a PHY hint with a certain driver. > In general, the use for the latter is also very limited in > reality as drivers have to not only take IDs into account but > also things like chip revisions etc. (that's also why I think > that attempts to make PCI drivers use a unified probing > approach/tables in order to provide means to patch ID lists > is rather pointless). > The main purpose of the above commit is to force wildcard/hoover > drivers like ukphy(4) to attach to non-IEEE 802.3 compliant "PHYs" > without proper ID registers like so: > hint.ukphy.0.at="miibus0" > hint.ukphy.0.phyno="2" > The use of the name of the driver to probe and attach in these > hints mainly was done for consistency with the ISA etc. hints > we have. > However, as noted in the commit message, you can actually > (ab)use these hints to also make a specialized driver probe and > attach an unknown PHY (real or not) by faking the ID registers > of a PHY it knows of. Note that for this to work, you actually > need to put the appropriate contents of real ID registers into > these hints and not just OUI and model as found in the driver. > As noted above, the use for this method might be very limited > in reality. Ah, this is actually the specific use case bz@ is running into. :) That said, I do agree it's quite rare, and it may indeed be fine to just hardcode the name/unit in that case. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 12:36: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 E182B106564A; Fri, 24 Aug 2012 12:36:26 +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 B75068FC0A; Fri, 24 Aug 2012 12:36:26 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1100EB95D; Fri, 24 Aug 2012 08:36:26 -0400 (EDT) From: John Baldwin To: Warner Losh Date: Fri, 24 Aug 2012 08:30:46 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208232131.q7NLVqm6098185@svn.freebsd.org> In-Reply-To: <201208232131.q7NLVqm6098185@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201208240830.46202.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 24 Aug 2012 08:36:26 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239623 - 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: Fri, 24 Aug 2012 12:36:27 -0000 On Thursday, August 23, 2012 5:31:52 pm Warner Losh wrote: > Author: imp > Date: Thu Aug 23 21:31:52 2012 > New Revision: 239623 > URL: http://svn.freebsd.org/changeset/base/239623 > > Log: > Use proper resource type when freeing. > > Submitted by: Ian Lapore (indirectly in a larger patch) > > Modified: > head/sys/arm/at91/at91_mci.c > > Modified: head/sys/arm/at91/at91_mci.c > ============================================================================== > --- head/sys/arm/at91/at91_mci.c Thu Aug 23 19:40:28 2012 (r239622) > +++ head/sys/arm/at91/at91_mci.c Thu Aug 23 21:31:52 2012 (r239623) > @@ -299,7 +299,7 @@ at91_mci_deactivate(device_t dev) > sc->intrhand = 0; > bus_generic_detach(sc->dev); > if (sc->mem_res) > - bus_release_resource(dev, SYS_RES_IOPORT, > + bus_release_resource(dev, SYS_RES_MEMORY, > rman_get_rid(sc->mem_res), sc->mem_res); If I had my way, it would just be 'bus_release_resource(dev, sc->mem_res);'. There's no good reason the resource can't store its rid and type internally. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 13:55: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 D02BD106566B; Fri, 24 Aug 2012 13:55:22 +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 BAB5E8FC08; Fri, 24 Aug 2012 13:55: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 q7ODtMAf047723; Fri, 24 Aug 2012 13:55:22 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7ODtMHs047720; Fri, 24 Aug 2012 13:55:22 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201208241355.q7ODtMHs047720@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 24 Aug 2012 13:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239649 - head/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 13:55:22 -0000 Author: bschmidt Date: Fri Aug 24 13:55:22 2012 New Revision: 239649 URL: http://svn.freebsd.org/changeset/base/239649 Log: Document update of 802.11s IE identifiers. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Aug 24 13:11:30 2012 (r239648) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Fri Aug 24 13:55:22 2012 (r239649) @@ -282,6 +282,13 @@ A bug in TCP options padding, where the wrong padding bytes were used, has been fixed. + The IEEE 802.11s element identifiers have + been updated to reflect the final version of the amendment. This + update breaks compatibility with older mesh setups but is necessary + as the previous IDs are used by another amendment leading to + unexpected results when trying to associate with an accesspoint + using the affected IDs. + From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 16:37: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 5AE86106564A; Fri, 24 Aug 2012 16:37:01 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 451278FC0A; Fri, 24 Aug 2012 16:37: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 q7OGb0R3069245; Fri, 24 Aug 2012 16:37:00 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OGb079069242; Fri, 24 Aug 2012 16:37:00 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201208241637.q7OGb079069242@svn.freebsd.org> From: Roman Divacky Date: Fri, 24 Aug 2012 16:37: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: r239654 - in head/gnu/usr.bin/binutils: as libbfd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 16:37:01 -0000 Author: rdivacky Date: Fri Aug 24 16:37:00 2012 New Revision: 239654 URL: http://svn.freebsd.org/changeset/base/239654 Log: Dont use -Werror when building libbfd and gnu as on powerpc64 with clang as there are warnings. Reviewed by: nwhitehorn Modified: head/gnu/usr.bin/binutils/as/Makefile head/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64 Modified: head/gnu/usr.bin/binutils/as/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/as/Makefile Fri Aug 24 14:50:44 2012 (r239653) +++ head/gnu/usr.bin/binutils/as/Makefile Fri Aug 24 16:37:00 2012 (r239654) @@ -8,6 +8,10 @@ .PATH: ${SRCDIR}/gas ${SRCDIR}/gas/config +.if ${TARGET_ARCH} == "powerpc64" +NO_WERROR.clang= +.endif + PROG= as SRCS+= app.c \ as.c \ Modified: head/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64 ============================================================================== --- head/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64 Fri Aug 24 14:50:44 2012 (r239653) +++ head/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64 Fri Aug 24 16:37:00 2012 (r239654) @@ -3,6 +3,7 @@ ARCHS+= rs6000 DEFAULT_VECTOR= bfd_elf64_powerpc_vec +NO_WERROR.clang= SRCS+= cpu-powerpc.c \ cpu-rs6000.c \ From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 17:08: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 DC6EF106566B; Fri, 24 Aug 2012 17:08:02 +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 C7A448FC18; Fri, 24 Aug 2012 17:08: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 q7OH82v6073657; Fri, 24 Aug 2012 17:08:02 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OH82Hi073655; Fri, 24 Aug 2012 17:08:02 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208241708.q7OH82Hi073655@svn.freebsd.org> From: Jim Harris Date: Fri, 24 Aug 2012 17:08: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: r239655 - 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, 24 Aug 2012 17:08:03 -0000 Author: jimharris Date: Fri Aug 24 17:08:02 2012 New Revision: 239655 URL: http://svn.freebsd.org/changeset/base/239655 Log: Fix scsi_da's BIO_DELETE->SCSI_UNMAP translation to use correct local variable when determining various sizes related to SCSI UNMAP block descriptor lists. Sponsored by: Intel Reviewed by: mav MFC after: 3 days Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Aug 24 16:37:00 2012 (r239654) +++ head/sys/cam/scsi/scsi_da.c Fri Aug 24 17:08:02 2012 (r239655) @@ -1849,8 +1849,8 @@ dastart(struct cam_periph *periph, union softc->params.secsize > softc->unmap_max_lba) break; } while (1); - scsi_ulto2b(count * 16 + 6, &buf[0]); - scsi_ulto2b(count * 16, &buf[2]); + scsi_ulto2b(ranges * 16 + 6, &buf[0]); + scsi_ulto2b(ranges * 16, &buf[2]); scsi_unmap(&start_ccb->csio, /*retries*/da_retry_count, @@ -1858,7 +1858,7 @@ dastart(struct cam_periph *periph, union /*tag_action*/MSG_SIMPLE_Q_TAG, /*byte2*/0, /*data_ptr*/ buf, - /*dxfer_len*/ count * 16 + 8, + /*dxfer_len*/ ranges * 16 + 8, /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 17: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 9D6C2106566B; Fri, 24 Aug 2012 17: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 88D168FC12; Fri, 24 Aug 2012 17: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 q7OHbDRI077514; Fri, 24 Aug 2012 17:37:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OHbDU6077511; Fri, 24 Aug 2012 17:37:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208241737.q7OHbDU6077511@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 17:37: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: r239656 - 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: Fri, 24 Aug 2012 17:37:13 -0000 Author: adrian Date: Fri Aug 24 17:37:12 2012 New Revision: 239656 URL: http://svn.freebsd.org/changeset/base/239656 Log: Add an accessor macro for getting access to the default DFS parameters. PR: kern/170904 Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri Aug 24 17:08:02 2012 (r239655) +++ head/sys/dev/ath/if_athvar.h Fri Aug 24 17:37:12 2012 (r239656) @@ -1185,6 +1185,8 @@ void ath_intr(void *); ((*(_ah)->ah_enableDfs)((_ah), (_param))) #define ath_hal_getdfsthresh(_ah, _param) \ ((*(_ah)->ah_getDfsThresh)((_ah), (_param))) +#define ath_hal_getdfsdefaultthresh(_ah, _param) \ + ((*(_ah)->ah_getDfsDefaultThresh)((_ah), (_param))) #define ath_hal_procradarevent(_ah, _rxs, _fulltsf, _buf, _event) \ ((*(_ah)->ah_procRadarEvent)((_ah), (_rxs), (_fulltsf), \ (_buf), (_event))) From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 17:37: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 5E684106566C; Fri, 24 Aug 2012 17:37:52 +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 4971B8FC08; Fri, 24 Aug 2012 17:37: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 q7OHbqtY077620; Fri, 24 Aug 2012 17:37:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OHbq6e077618; Fri, 24 Aug 2012 17:37:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208241737.q7OHbq6e077618@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 17:37: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: r239657 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 17:37:52 -0000 Author: adrian Date: Fri Aug 24 17:37:51 2012 New Revision: 239657 URL: http://svn.freebsd.org/changeset/base/239657 Log: Correctly handle the "pe_enabled" flag - both when configuring DFS and fetching the current DFS configuration. PR: kern/170904 Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Aug 24 17:37:12 2012 (r239656) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Aug 24 17:37:51 2012 (r239657) @@ -1160,7 +1160,12 @@ ar5212EnableDfs(struct ath_hal *ah, HAL_ val &= ~AR_PHY_RADAR_0_INBAND; val |= SM(pe->pe_inband, AR_PHY_RADAR_0_INBAND); } - OS_REG_WRITE(ah, AR_PHY_RADAR_0, val | AR_PHY_RADAR_0_ENA); + if (pe->pe_enabled) + val |= AR_PHY_RADAR_0_ENA; + else + val &= ~ AR_PHY_RADAR_0_ENA; + + OS_REG_WRITE(ah, AR_PHY_RADAR_0, val); } /* @@ -1206,6 +1211,7 @@ ar5212GetDfsThresh(struct ath_hal *ah, H pe->pe_height = MS(val, AR_PHY_RADAR_0_HEIGHT); pe->pe_prssi = MS(val, AR_PHY_RADAR_0_PRSSI); pe->pe_inband = MS(val, AR_PHY_RADAR_0_INBAND); + pe->pe_enabled = !! (val & AR_PHY_RADAR_0_ENA); pe->pe_relpwr = 0; pe->pe_relstep = 0; From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 17:39: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 3E1081065670; Fri, 24 Aug 2012 17:39: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 1F13B8FC0C; Fri, 24 Aug 2012 17:39: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 q7OHdvN5077925; Fri, 24 Aug 2012 17:39:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OHdvlH077922; Fri, 24 Aug 2012 17:39:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208241739.q7OHdvlH077922@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 17:39: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: r239658 - head/sys/dev/ath/ath_dfs/null X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 24 Aug 2012 17:39:58 -0000 Author: adrian Date: Fri Aug 24 17:39:57 2012 New Revision: 239658 URL: http://svn.freebsd.org/changeset/base/239658 Log: Remove the hard-coded AR5416-series parameters and instead use the DFS parameters fetched from the HAL. Check whether the specific chipset supports RADAR reporting before enabling DFS; or some of the (unset) DFS methods may fail. Tested: * AR5210 (correctly didn't enable radar PHY reporting) * AR5212 (correctly enabled radar PHY reporting w/ the correct default parameters.) TODO: * Now that I have this capability check in place, I could remove the (empty) DFS methods from AR5210/AR5211. * Test on AR5416, AR9160, AR9280. PR: kern/170904 Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Fri Aug 24 17:37:51 2012 (r239657) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Fri Aug 24 17:39:57 2012 (r239658) @@ -72,28 +72,6 @@ __FBSDID("$FreeBSD$"); #include /* - * These are default parameters for the AR5416 and - * later 802.11n NICs. They simply enable some - * radar pulse event generation. - * - * These are very likely not valid for the AR5212 era - * NICs. - * - * Since these define signal sizing and threshold - * parameters, they may need changing based on the - * specific antenna and receive amplifier - * configuration. - */ -#define AR5416_DFS_FIRPWR -33 -#define AR5416_DFS_RRSSI 20 -#define AR5416_DFS_HEIGHT 10 -#define AR5416_DFS_PRSSI 15 -#define AR5416_DFS_INBAND 15 -#define AR5416_DFS_RELPWR 8 -#define AR5416_DFS_RELSTEP 12 -#define AR5416_DFS_MAXLEN 255 - -/* * Methods which are required */ @@ -125,30 +103,27 @@ ath_dfs_radar_enable(struct ath_softc *s #if 0 HAL_PHYERR_PARAM pe; + /* Check if the hardware supports radar reporting */ + /* XXX TODO: migrate HAL_CAP_RADAR/HAL_CAP_AR to somewhere public! */ + if (ath_hal_getcapability(sc->sc_ah, + HAL_CAP_PHYDIAG, 0, NULL) != HAL_OK) + return (0); + /* Check if the current channel is radar-enabled */ if (! IEEE80211_IS_CHAN_DFS(chan)) return (0); + /* Fetch the default parameters */ + memset(&pe, '\0', sizeof(pe)); + if (! ath_hal_getdfsdefaultthresh(sc->sc_ah, &pe)) + return (0); + /* Enable radar PHY error reporting */ sc->sc_dodfs = 1; - /* - * These are general examples of the parameter values - * to use when configuring radar pulse detection for - * the AR5416, AR91xx, AR92xx NICs. They are only - * for testing and do require tuning depending upon the - * hardware and deployment specifics. - */ - pe.pe_firpwr = AR5416_DFS_FIRPWR; - pe.pe_rrssi = AR5416_DFS_RRSSI; - pe.pe_height = AR5416_DFS_HEIGHT; - pe.pe_prssi = AR5416_DFS_PRSSI; - pe.pe_inband = AR5416_DFS_INBAND; - pe.pe_relpwr = AR5416_DFS_RELPWR; - pe.pe_relstep = AR5416_DFS_RELSTEP; - pe.pe_maxlen = AR5416_DFS_MAXLEN; + /* Tell the hardware to enable radar reporting */ pe.pe_enabled = 1; - + /* Flip on extension channel events only if doing HT40 */ if (IEEE80211_IS_CHAN_HT40(chan)) pe.pe_extchannel = 1; From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 21:08: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 18D91106564A; Fri, 24 Aug 2012 21:08:57 +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 048258FC0A; Fri, 24 Aug 2012 21:08: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 q7OL8un6005301; Fri, 24 Aug 2012 21:08:56 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OL8uIs005299; Fri, 24 Aug 2012 21:08:56 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201208242108.q7OL8uIs005299@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 24 Aug 2012 21:08: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: r239663 - 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: Fri, 24 Aug 2012 21:08:57 -0000 Author: bapt Date: Fri Aug 24 21:08:56 2012 New Revision: 239663 URL: http://svn.freebsd.org/changeset/base/239663 Log: - change ALWAYS_ASSUME_YES to ASSUME_ALWAYS_YES for consistency with pkg(8) - if not on a tty prompt about the missing pkg(8) but default on 'no' except if ASSUME_ALWAYS_YES is set MFC after: 2 days Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Fri Aug 24 20:41:31 2012 (r239662) +++ head/usr.sbin/pkg/pkg.c Fri Aug 24 21:08:56 2012 (r239663) @@ -425,10 +425,12 @@ main(__unused int argc, char *argv[]) * not tty. Check the environment to see if user has answer * tucked in there already. */ - if (getenv("ALWAYS_ASSUME_YES") == NULL && - isatty(fileno(stdin))) { + if (getenv("ASSUME_ALWAYS_YES") == NULL) { printf("%s", confirmation_message); - if (pkg_query_yes_no() == 0) + if (isatty(fileno(stdin)) && + pkg_query_yes_no() == 0) + exit(EXIT_FAILURE); + else exit(EXIT_FAILURE); } if (bootstrap_pkg() != 0) From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 21: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 4E83B1065673; Fri, 24 Aug 2012 21:45:53 +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 3A3638FC14; Fri, 24 Aug 2012 21: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 q7OLjrT3010297; Fri, 24 Aug 2012 21:45:53 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OLjrqB010295; Fri, 24 Aug 2012 21:45:53 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201208242145.q7OLjrqB010295@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 24 Aug 2012 21:45: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: r239664 - 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: Fri, 24 Aug 2012 21:45:53 -0000 Author: bapt Date: Fri Aug 24 21:45:52 2012 New Revision: 239664 URL: http://svn.freebsd.org/changeset/base/239664 Log: Fix confirmation logic when detecting a tty Reported by: mjg Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Fri Aug 24 21:08:56 2012 (r239663) +++ head/usr.sbin/pkg/pkg.c Fri Aug 24 21:45:52 2012 (r239664) @@ -427,10 +427,10 @@ main(__unused int argc, char *argv[]) */ if (getenv("ASSUME_ALWAYS_YES") == NULL) { printf("%s", confirmation_message); - if (isatty(fileno(stdin)) && - pkg_query_yes_no() == 0) + if (!isatty(fileno(stdin))) exit(EXIT_FAILURE); - else + + if (pkg_query_yes_no() == 0) exit(EXIT_FAILURE); } if (bootstrap_pkg() != 0) From owner-svn-src-head@FreeBSD.ORG Fri Aug 24 22:04: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 71DAB106564A; Fri, 24 Aug 2012 22:04:17 +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 5CE8E8FC16; Fri, 24 Aug 2012 22:04: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 q7OM4HO9012765; Fri, 24 Aug 2012 22:04:17 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7OM4HX0012763; Fri, 24 Aug 2012 22:04:17 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208242204.q7OM4HX0012763@svn.freebsd.org> From: Jim Harris Date: Fri, 24 Aug 2012 22:04: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: r239665 - 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: Fri, 24 Aug 2012 22:04:17 -0000 Author: jimharris Date: Fri Aug 24 22:04:16 2012 New Revision: 239665 URL: http://svn.freebsd.org/changeset/base/239665 Log: Clear freeze bit before calling xpt_release_devq. This ensures that any ccbs which immediately start during the call to xpt_release_devq see an accurate picture of the frozen_lun_mask. Sponsored by: Intel MFC after: 3 days Modified: head/sys/dev/isci/isci_remote_device.c Modified: head/sys/dev/isci/isci_remote_device.c ============================================================================== --- head/sys/dev/isci/isci_remote_device.c Fri Aug 24 21:45:52 2012 (r239664) +++ head/sys/dev/isci/isci_remote_device.c Fri Aug 24 22:04:16 2012 (r239665) @@ -278,12 +278,12 @@ isci_remote_device_release_lun_queue(str if (remote_device->frozen_lun_mask & (1 << lun)) { struct cam_path *path; + remote_device->frozen_lun_mask &= ~(1 << lun); xpt_create_path(&path, xpt_periph, cam_sim_path(remote_device->domain->controller->sim), remote_device->index, lun); xpt_release_devq(path, 1, TRUE); xpt_free_path(path); - remote_device->frozen_lun_mask &= ~(1 << lun); } } From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 00:47:55 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 CB685106564A; Sat, 25 Aug 2012 00:47:55 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B77528FC0A; Sat, 25 Aug 2012 00:47: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 q7P0lt7H036748; Sat, 25 Aug 2012 00:47:55 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P0ltM2036746; Sat, 25 Aug 2012 00:47:55 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201208250047.q7P0ltM2036746@svn.freebsd.org> From: Rui Paulo Date: Sat, 25 Aug 2012 00:47: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: r239666 - 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: Sat, 25 Aug 2012 00:47:55 -0000 Author: rpaulo Date: Sat Aug 25 00:47:55 2012 New Revision: 239666 URL: http://svn.freebsd.org/changeset/base/239666 Log: Set mdp only under #ifdef WII. Modified: head/sys/powerpc/aim/machdep.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Fri Aug 24 22:04:16 2012 (r239665) +++ head/sys/powerpc/aim/machdep.c Sat Aug 25 00:47:55 2012 (r239666) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" +#include "opt_platform.h" #include #include @@ -268,6 +269,7 @@ powerpc_init(vm_offset_t startkernel, vm trap_offset = 0; cacheline_warn = 0; +#ifdef WII /* * The Wii loader doesn't pass us any environment so, mdp * points to garbage at this point. The Wii CPU is a 750CL. @@ -275,6 +277,7 @@ powerpc_init(vm_offset_t startkernel, vm vers = mfpvr(); if ((vers & 0xfffff0e0) == (MPC750 << 16 | MPC750CL)) mdp = NULL; +#endif /* * Parse metadata if present and fetch parameters. Must be done From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 07:47: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 6E147106564A; Sat, 25 Aug 2012 07:47:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5998B8FC15; Sat, 25 Aug 2012 07:47: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 q7P7lDcU001305; Sat, 25 Aug 2012 07:47:13 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P7lD63001303; Sat, 25 Aug 2012 07:47:13 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208250747.q7P7lD63001303@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 07:47: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: r239667 - head/sys/dev/gxemul/cons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 07:47:13 -0000 Author: rwatson Date: Sat Aug 25 07:47:12 2012 New Revision: 239667 URL: http://svn.freebsd.org/changeset/base/239667 Log: Rename the gxemul console device to "ttyu0" to match the expectations of the default MIPS /etc/ttys. Sponsored by: DARPA, AFRL Modified: head/sys/dev/gxemul/cons/gxemul_cons.c Modified: head/sys/dev/gxemul/cons/gxemul_cons.c ============================================================================== --- head/sys/dev/gxemul/cons/gxemul_cons.c Sat Aug 25 00:47:55 2012 (r239666) +++ head/sys/dev/gxemul/cons/gxemul_cons.c Sat Aug 25 07:47:12 2012 (r239667) @@ -218,7 +218,7 @@ static void gxemul_cons_cnprobe(struct consdev *cp) { - sprintf(cp->cn_name, "gxcons"); + sprintf(cp->cn_name, "ttyu0"); cp->cn_pri = CN_NORMAL; } @@ -279,7 +279,7 @@ gxemul_cons_ttyinit(void *unused) tp = tty_alloc(&gxemul_cons_ttydevsw, NULL); tty_init_console(tp, 0); - tty_makedev(tp, NULL, "%s", "gxcons"); + tty_makedev(tp, NULL, "%s", "ttyu0"); callout_init(&gxemul_cons_callout, CALLOUT_MPSAFE); callout_reset(&gxemul_cons_callout, gxemul_cons_polltime, gxemul_cons_timeout, tp); From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 07:48: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 6E370106566C; Sat, 25 Aug 2012 07:48:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59C778FC14; Sat, 25 Aug 2012 07:48: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 q7P7mr0u001557; Sat, 25 Aug 2012 07:48:53 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P7mr1B001555; Sat, 25 Aug 2012 07:48:53 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208250748.q7P7mr1B001555@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 07:48: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: r239668 - head/sys/dev/gxemul/cons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 07:48:53 -0000 Author: rwatson Date: Sat Aug 25 07:48:52 2012 New Revision: 239668 URL: http://svn.freebsd.org/changeset/base/239668 Log: In the gxemul console, check the RB_SERIAL boot flag, and change the relative priority of the gxemul console in line with its role as a "seiral console". This allows it to override video console drivers that might otherwise take precdence, subject to that boot flag. Sponsored by: DARPA, AFRL Modified: head/sys/dev/gxemul/cons/gxemul_cons.c Modified: head/sys/dev/gxemul/cons/gxemul_cons.c ============================================================================== --- head/sys/dev/gxemul/cons/gxemul_cons.c Sat Aug 25 07:47:12 2012 (r239667) +++ head/sys/dev/gxemul/cons/gxemul_cons.c Sat Aug 25 07:48:52 2012 (r239668) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -219,7 +220,7 @@ gxemul_cons_cnprobe(struct consdev *cp) { sprintf(cp->cn_name, "ttyu0"); - cp->cn_pri = CN_NORMAL; + cp->cn_pri = (boothowto & RB_SERIAL) ? CN_REMOTE : CN_NORMAL; } static void From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 08:02: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 2EBFE106564A; Sat, 25 Aug 2012 08:02:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AC1C8FC0A; Sat, 25 Aug 2012 08:02: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 q7P82k2l003488; Sat, 25 Aug 2012 08:02:46 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P82ksh003486; Sat, 25 Aug 2012 08:02:46 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208250802.q7P82ksh003486@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 08:02: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: r239669 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 08:02:47 -0000 Author: rwatson Date: Sat Aug 25 08:02:46 2012 New Revision: 239669 URL: http://svn.freebsd.org/changeset/base/239669 Log: On MIPS, when printing page fault information for an unexpected exception type, explicitly print out "unknown" rather than the empty string, and include the exception type number for ease of debugging. Sponsored by: DARPA, AFRL Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Sat Aug 25 07:48:52 2012 (r239668) +++ head/sys/mips/mips/trap.c Sat Aug 25 08:02:46 2012 (r239669) @@ -1465,15 +1465,17 @@ log_bad_page_fault(char *msg, struct tra read_or_write = "read"; break; default: - read_or_write = ""; + read_or_write = "unknown"; } pc = frame->pc + (DELAYBRANCH(frame->cause) ? 4 : 0); - log(LOG_ERR, "%s: pid %d tid %ld (%s), uid %d: pc %#jx got a %s fault at %#jx\n", + log(LOG_ERR, "%s: pid %d tid %ld (%s), uid %d: pc %#jx got a %s fault " + "(type %#x) at %#jx\n", msg, p->p_pid, (long)td->td_tid, p->p_comm, p->p_ucred ? p->p_ucred->cr_uid : -1, (intmax_t)pc, read_or_write, + trap_type, (intmax_t)frame->badvaddr); /* log registers in trap frame */ From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 08: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 7C430106564A; Sat, 25 Aug 2012 08:09:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 665838FC14; Sat, 25 Aug 2012 08: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 q7P89cH6004451; Sat, 25 Aug 2012 08:09:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P89cdS004442; Sat, 25 Aug 2012 08:09:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208250809.q7P89cdS004442@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 08: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: r239670 - in head/sys: conf dev/fb dev/syscons mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 08:09:38 -0000 Author: rwatson Date: Sat Aug 25 08:09:37 2012 New Revision: 239670 URL: http://svn.freebsd.org/changeset/base/239670 Log: Provide basic glue to allow syscons to be used on MIPS, modelled on PowerPC support. This was clearly not something syscons was designed to do (very specific assumptions about the nature of VGA consoles on PCs), but fortunately others have long since blazed the way on making it work regardless of that. Sponsored by: DARPA, AFRL Added: head/sys/mips/mips/sc_machdep.c (contents, props changed) Modified: head/sys/conf/files.mips head/sys/conf/options.mips head/sys/dev/fb/fbreg.h head/sys/dev/syscons/schistory.c head/sys/dev/syscons/scterm-teken.c head/sys/dev/syscons/syscons.c Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Sat Aug 25 08:02:46 2012 (r239669) +++ head/sys/conf/files.mips Sat Aug 25 08:09:37 2012 (r239670) @@ -122,3 +122,9 @@ dev/ofw/ofw_fdt.c optional fdt dev/fdt/fdt_mips.c optional fdt +dev/fb/fb.c optional sc +dev/kbd/kbd.c optional sc +dev/syscons/scgfbrndr.c optional sc +dev/syscons/scterm-teken.c optional sc +dev/syscons/scvtb.c optional sc +mips/mips/sc_machdep.c optional sc Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Sat Aug 25 08:02:46 2012 (r239669) +++ head/sys/conf/options.mips Sat Aug 25 08:09:37 2012 (r239670) @@ -46,6 +46,10 @@ CFE_CONSOLE opt_global.h CFE_ENV opt_global.h CFE_ENV_SIZE opt_global.h +GFB_DEBUG opt_gfb.h +GFB_NO_FONT_LOADING opt_gfb.h +GFB_NO_MODE_CHANGE opt_gfb.h + NOFPU opt_global.h TICK_USE_YAMON_FREQ opt_global.h Modified: head/sys/dev/fb/fbreg.h ============================================================================== --- head/sys/dev/fb/fbreg.h Sat Aug 25 08:02:46 2012 (r239669) +++ head/sys/dev/fb/fbreg.h Sat Aug 25 08:09:37 2012 (r239670) @@ -92,6 +92,29 @@ void ofwfb_fillw(int pat, void *base, si u_int16_t ofwfb_readw(u_int16_t *addr); void ofwfb_writew(u_int16_t *addr, u_int16_t val); +#elif defined(__mips__) + +/* + * Use amd64/i386-like settings under the assumption that MIPS-based display + * drivers will have to add a level of indirection between a syscons-managed + * frame buffer and the actual video hardware. We are forced to do this + * because syscons doesn't carry around required busspace handles and tags to + * use here. This is only really a problem for true VGA devices hooked up to + * MIPS, as others will be performing a translation anyway. + */ +#define bcopy_io(s, d, c) memcpy((void *)(d), (void *)(s), (c)) +#define bcopy_toio(s, d, c) memcpy((void *)(d), (void *)(s), (c)) +#define bcopy_fromio(s, d, c) memcpy((void *)(d), (void *)(s), (c)) +#define bzero_io(d, c) memset((void *)(d), 0, (c)) +#define fill_io(p, d, c) memset((void *)(d), (p), (c)) +static __inline void +fillw(int val, uint16_t *buf, size_t size) +{ + while (size--) + *buf++ = val; +} +#define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) + #else /* !__i386__ && !__amd64__ && !__ia64__ && !__sparc64__ && !__powerpc__ */ #define bcopy_io(s, d, c) memcpy_io((d), (s), (c)) #define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c)) Modified: head/sys/dev/syscons/schistory.c ============================================================================== --- head/sys/dev/syscons/schistory.c Sat Aug 25 08:02:46 2012 (r239669) +++ head/sys/dev/syscons/schistory.c Sat Aug 25 08:09:37 2012 (r239670) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) +#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) #include #else #include Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Sat Aug 25 08:02:46 2012 (r239669) +++ head/sys/dev/syscons/scterm-teken.c Sat Aug 25 08:09:37 2012 (r239670) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) +#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) #include #else #include Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Sat Aug 25 08:02:46 2012 (r239669) +++ head/sys/dev/syscons/syscons.c Sat Aug 25 08:09:37 2012 (r239670) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) +#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) #include #else #include Added: head/sys/mips/mips/sc_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/sc_machdep.c Sat Aug 25 08:09:37 2012 (r239670) @@ -0,0 +1,90 @@ +/*- + * Copyright (c) 2003 Jake Burkholder. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static sc_softc_t sc_softcs[8]; + +int +sc_get_cons_priority(int *unit, int *flags) +{ + + *unit = 0; + *flags = 0; + return (CN_INTERNAL); +} + +int +sc_max_unit(void) +{ + return (1); +} + +sc_softc_t * +sc_get_softc(int unit, int flags) +{ + sc_softc_t *sc; + + if (unit < 0) + return (NULL); + sc = &sc_softcs[unit]; + sc->unit = unit; + if ((sc->flags & SC_INIT_DONE) == 0) { + sc->keyboard = -1; + sc->adapter = -1; + sc->cursor_char = SC_CURSOR_CHAR; + sc->mouse_char = SC_MOUSE_CHAR; + } + return (sc); +} + +void +sc_get_bios_values(bios_values_t *values) +{ + values->cursor_start = 0; + values->cursor_end = 32; + values->shift_state = 0; +} + +int +sc_tone(int hz) +{ + return (0); +} From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 08:31: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 D6D74106566B; Sat, 25 Aug 2012 08:31:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1D6B8FC14; Sat, 25 Aug 2012 08:31: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 q7P8VLuD007395; Sat, 25 Aug 2012 08:31:21 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P8VLkT007389; Sat, 25 Aug 2012 08:31:21 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208250831.q7P8VLkT007389@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 08:31: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: r239671 - in head/sys: conf mips/beri mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 08:31:22 -0000 Author: rwatson Date: Sat Aug 25 08:31:21 2012 New Revision: 239671 URL: http://svn.freebsd.org/changeset/base/239671 Log: Add preliminary support for the SRI International / University of Cambridge Bluespec Extensible RISC Implementation (BERI) processor. BERI is a 64-bit MIPS ISA soft CPU core that can be synthesised to Altera and Xilinx FPGAs, and is being used for CPU and OS research at several institutions. Sponsored by: DARPA, AFRL Added: head/sys/mips/beri/ head/sys/mips/beri/beri_machdep.c (contents, props changed) head/sys/mips/beri/files.beri (contents, props changed) head/sys/mips/beri/std.beri (contents, props changed) Modified: head/sys/conf/options.mips head/sys/mips/mips/machdep.c Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Sat Aug 25 08:09:37 2012 (r239670) +++ head/sys/conf/options.mips Sat Aug 25 08:31:21 2012 (r239671) @@ -37,6 +37,7 @@ CPU_SB1 opt_global.h CPU_CNMIPS opt_global.h CPU_RMI opt_global.h CPU_NLM opt_global.h +CPU_BERI opt_global.h COMPAT_FREEBSD32 opt_compat.h Added: head/sys/mips/beri/beri_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/beri/beri_machdep.c Sat Aug 25 08:31:21 2012 (r239671) @@ -0,0 +1,165 @@ +/*- + * Copyright (c) 2006 Wojciech A. Koszek + * 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_ddb.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 +#include +#include +#include +#include + +extern int *edata; +extern int *end; + +void +platform_cpu_init() +{ + /* Nothing special */ +} + +static void +mips_init(void) +{ + int i; + + for (i = 0; i < 10; i++) { + phys_avail[i] = 0; + } + + /* phys_avail regions are in bytes */ + phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); + phys_avail[1] = ctob(realmem); + + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1]; + + physmem = realmem; + + init_param1(); + init_param2(physmem); + mips_cpu_init(); + pmap_bootstrap(); + mips_proc0_init(); + mutex_init(); + kdb_init(); +#ifdef KDB + if (boothowto & RB_KDB) + kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); +#endif +} + +/* + * Perform a board-level soft-reset. + * + * XXXRW: BERI doesn't yet have a board-level soft-reset. + */ +void +platform_reset(void) +{ + + panic("%s: not yet", __func__); +} + +void +platform_start(__register_t a0, __register_t a1, __register_t a2, + __register_t a3) +{ + vm_offset_t kernend; + uint64_t platform_counter_freq; + int argc = a0; + char **argv = (char **)a1; + char **envp = (char **)a2; + unsigned int memsize = a3; + int i; + + /* clear the BSS and SBSS segments */ + kernend = (vm_offset_t)&end; + memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + + mips_postboot_fixup(); + + mips_pcpu0_init(); + + /* + * XXXRW: We have no way to compare wallclock time to cycle rate on + * BERI, so for now assume we run at the MALTA default (100MHz). + */ + platform_counter_freq = MIPS_DEFAULT_HZ; + mips_timer_early_init(platform_counter_freq); + + cninit(); + printf("entry: platform_start()\n"); + + bootverbose = 1; + if (bootverbose) { + printf("cmd line: "); + for (i = 0; i < argc; i++) + printf("%s ", argv[i]); + printf("\n"); + + printf("envp:\n"); + for (i = 0; envp[i]; i += 2) + printf("\t%s = %s\n", envp[i], envp[i+1]); + + printf("memsize = %08x\n", memsize); + } + + realmem = btoc(memsize); + mips_init(); + + mips_timer_init_params(platform_counter_freq, 0); +} Added: head/sys/mips/beri/files.beri ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/beri/files.beri Sat Aug 25 08:31:21 2012 (r239671) @@ -0,0 +1,4 @@ +# $FreeBSD$ +mips/beri/beri_machdep.c standard +mips/mips/intr_machdep.c standard +mips/mips/tick.c standard Added: head/sys/mips/beri/std.beri ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/beri/std.beri Sat Aug 25 08:31:21 2012 (r239671) @@ -0,0 +1,4 @@ +# $FreeBSD$ +files "../beri/files.beri" + +cpu CPU_MIPS4KC Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Sat Aug 25 08:09:37 2012 (r239670) +++ head/sys/mips/mips/machdep.c Sat Aug 25 08:31:21 2012 (r239671) @@ -346,7 +346,12 @@ mips_vector_init(void) bcopy(MipsTLBMiss, (void *)MIPS_UTLB_MISS_EXC_VEC, MipsTLBMissEnd - MipsTLBMiss); -#if defined(__mips_n64) || defined(CPU_RMI) || defined(CPU_NLM) + /* + * XXXRW: Why don't we install the XTLB handler for all 64-bit + * architectures? + */ +#if defined(__mips_n64) || defined(CPU_RMI) || defined(CPU_NLM) || defined (CPU_BERI) +/* Fake, but sufficient, for the 32-bit with 64-bit hardware addresses */ bcopy(MipsTLBMiss, (void *)MIPS_XTLB_MISS_EXC_VEC, MipsTLBMissEnd - MipsTLBMiss); #endif From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 09:26: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 537AA106564A; Sat, 25 Aug 2012 09:26:38 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF1B18FC12; Sat, 25 Aug 2012 09:26: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 q7P9QbU5014753; Sat, 25 Aug 2012 09:26:37 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7P9QbcQ014751; Sat, 25 Aug 2012 09:26:37 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201208250926.q7P9QbcQ014751@svn.freebsd.org> From: Randall Stewart Date: Sat, 25 Aug 2012 09:26: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: r239672 - 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, 25 Aug 2012 09:26:38 -0000 Author: rrs Date: Sat Aug 25 09:26:37 2012 New Revision: 239672 URL: http://svn.freebsd.org/changeset/base/239672 Log: This small change takes care of a race condition that can occur when both sides close at the same time. If that occurs, without this fix the connection enters FIN1 on both sides and they will forever send FIN|ACK at each other until the connection times out. This is because we stopped processing the FIN|ACK and thus did not advance the sequence and so never ACK'd each others FIN. This fix adjusts it so we *do* process the FIN properly and the race goes away ;-) MFC after: 1 month Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat Aug 25 08:31:21 2012 (r239671) +++ head/sys/netinet/tcp_input.c Sat Aug 25 09:26:37 2012 (r239672) @@ -2414,6 +2414,16 @@ tcp_do_segment(struct mbuf *m, struct tc } } else tp->snd_cwnd += tp->t_maxseg; + if ((thflags & TH_FIN) && + (TCPS_HAVERCVDFIN(tp->t_state) == 0)) { + /* + * If its a fin we need to process + * it to avoid a race where both + * sides enter FIN-WAIT and send FIN|ACK + * at the same time. + */ + break; + } (void) tcp_output(tp); goto drop; } else if (tp->t_dupacks == tcprexmtthresh) { @@ -2453,6 +2463,16 @@ tcp_do_segment(struct mbuf *m, struct tc } tp->snd_nxt = th->th_ack; tp->snd_cwnd = tp->t_maxseg; + if ((thflags & TH_FIN) && + (TCPS_HAVERCVDFIN(tp->t_state) == 0)) { + /* + * If its a fin we need to process + * it to avoid a race where both + * sides enter FIN-WAIT and send FIN|ACK + * at the same time. + */ + break; + } (void) tcp_output(tp); KASSERT(tp->snd_limited <= 2, ("%s: tp->snd_limited too big", @@ -2479,6 +2499,16 @@ tcp_do_segment(struct mbuf *m, struct tc (tp->snd_nxt - tp->snd_una) + (tp->t_dupacks - tp->snd_limited) * tp->t_maxseg; + if ((thflags & TH_FIN) && + (TCPS_HAVERCVDFIN(tp->t_state) == 0)) { + /* + * If its a fin we need to process + * it to avoid a race where both + * sides enter FIN-WAIT and send FIN|ACK + * at the same time. + */ + break; + } (void) tcp_output(tp); sent = tp->snd_max - oldsndmax; if (sent > tp->t_maxseg) { From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 10:36: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 69F44106566C; Sat, 25 Aug 2012 10:36:32 +0000 (UTC) (envelope-from thomas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 548B98FC0A; Sat, 25 Aug 2012 10:36: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 q7PAaW6o024829; Sat, 25 Aug 2012 10:36:32 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PAaWhi024826; Sat, 25 Aug 2012 10:36:32 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201208251036.q7PAaWhi024826@svn.freebsd.org> From: Thomas Quinot Date: Sat, 25 Aug 2012 10:36: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: r239673 - head/sys/geom/multipath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 10:36:32 -0000 Author: thomas Date: Sat Aug 25 10:36:31 2012 New Revision: 239673 URL: http://svn.freebsd.org/changeset/base/239673 Log: (g_multipath_rotate): Fix algorithm so that it does rotate over all good providers, not just the last two. PR: kern/170379 Reviewed by: mav MFC after: 2 weeks Modified: head/sys/geom/multipath/g_multipath.c Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Sat Aug 25 09:26:37 2012 (r239672) +++ head/sys/geom/multipath/g_multipath.c Sat Aug 25 10:36:31 2012 (r239673) @@ -590,19 +590,26 @@ g_multipath_destroy_geom(struct gctl_req static int g_multipath_rotate(struct g_geom *gp) { - struct g_consumer *lcp; + struct g_consumer *lcp, *first_good_cp = NULL; struct g_multipath_softc *sc = gp->softc; + int active_cp_seen = 0; g_topology_assert(); if (sc == NULL) return (ENXIO); LIST_FOREACH(lcp, &gp->consumer, consumer) { if ((lcp->index & MP_BAD) == 0) { - if (sc->sc_active != lcp) + if (first_good_cp == NULL) + first_good_cp = lcp; + if (active_cp_seen) break; } + if (sc->sc_active == lcp) + active_cp_seen = 1; } - if (lcp) { + if (lcp == NULL) + lcp = first_good_cp; + if (lcp && lcp != sc->sc_active) { sc->sc_active = lcp; if (sc->sc_active_active != 1) printf("GEOM_MULTIPATH: %s is now active path in %s\n", From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 11:07: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 BE527106566C; Sat, 25 Aug 2012 11:07:43 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6B7B8FC16; Sat, 25 Aug 2012 11:07: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 q7PB7h3e028272; Sat, 25 Aug 2012 11:07:43 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PB7hZR028266; Sat, 25 Aug 2012 11:07:43 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208251107.q7PB7hZR028266@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 11:07: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: r239674 - in head: share/man/man4 sys/conf sys/dev/altera sys/dev/altera/avgen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 11:07:43 -0000 Author: rwatson Date: Sat Aug 25 11:07:43 2012 New Revision: 239674 URL: http://svn.freebsd.org/changeset/base/239674 Log: Add altera_avgen(4), a generic device driver to be used by hard and soft CPU cores on Altera FPGAs. The device driver allows memory-mapped devices on Altera's Avalon SoC bus to be exported to userspace via device nodes. device.hints directories dictate device name, permissible access methods, physical address and length, and I/O alignment. Devices can be accessed using read(2)/write(2), but also memory mapped in userspace using mmap(2). Devices attach directly to the Nexus, as is common for embedded device drivers; in the future something more mature might be desirable. There is currently no facility to support directing device-originated interrupts to userspace. In the future, this device driver may be renamed to socgen(4), as it can in principle also be used with other system-on-chip (SoC) busses, such as Axi on ASICs and FPGAs. However, we have only tested it on Avalon busses with memory-mapped ROMs, frame buffers, etc. Sponsored by: DARPA, AFRL Added: head/share/man/man4/altera_avgen.4 (contents, props changed) head/sys/dev/altera/ head/sys/dev/altera/avgen/ head/sys/dev/altera/avgen/altera_avgen.c (contents, props changed) head/sys/dev/altera/avgen/altera_avgen.h (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Aug 25 10:36:31 2012 (r239673) +++ head/share/man/man4/Makefile Sat Aug 25 11:07:43 2012 (r239674) @@ -32,6 +32,7 @@ MAN= aac.4 \ alc.4 \ ale.4 \ alpm.4 \ + altera_avgen.4 \ altq.4 \ amdpm.4 \ ${_amdsbwd.4} \ Added: head/share/man/man4/altera_avgen.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/altera_avgen.4 Sat Aug 25 11:07:43 2012 (r239674) @@ -0,0 +1,155 @@ +.\"- +.\" Copyright (c) 2012 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +.\" ("CTSRD"), as part of the DARPA CRASH research programme. +.\" +.\" 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 August 18, 2012 +.Dt ALTERA_AVGEN 4 +.Os +.Sh NAME +.Nm altera_avgen +.Nd driver for generic Altera Avalon-bus-attached, memory-mapped devices +.Sh SYNOPSIS +.Cd "device altera_avgen" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.altera_avgen.0.at="nexus0" +.Cd hint.altera_avgen.0.maddr=0x7f00a000 +.Cd hint.altera_avgen.0.msize=20 +.Cd hint.altera_avgen.0.width=4 +.Cd hint.altera_avgen.0.fileio="rw" +.Cd hint.altera_avgen.0.devname="berirom" +.Sh DESCRIPTION +The +.Nm +device driver provides generic support for memory-mapped devices on the +Altera Avalon bus. +.Pa device.hints +entries configure the address, size, I/O disposition, and +.Pa /dev +device node name that will be used. +The +.Xr open , +.Xr read , +.Xr write , +and +.Xr mmap +system calls (and variations) may be used on +.Nm +device nodes, subject to constraints imposed using +.Pa device.hints +entries. +Although reading and writing mapped memory is supported, +.Nm +does not currently support directing device interrupts to userspace. +.Pp +A number of +.Pa device.hints +sub-fields are available to configure +.Nm +device instances: +.Bl -tag -width devunit +.It maddr +base physical address of the memory region to export; must be aligned to +.Li width +.Ot msize +length of the memory region export; must be aligned to +.Li width +.It width +Granularity at which +.Xr read 2 +and +.Xr write 2 +operations will be performed. +Larger requests will be broken down into +.Li width -sized +operations; smaller requests will be rejected. +I/O operations must be aligned to +.Li width . +.It fileio +allowed file descriptor operations; +.Li r +authorizes +.Xr read 2 ; +.Li w +authorizes +.Xr write 2 . +.It mmapio +allowed +.Xr mmap 2 +permissions; +.Li w +authorizes +.Dv PROT_WRITE ; +.Li r +authorizes +.Dv PROT_READ ; +.Li x +authorizes +.Dv PROT_EXEC . +.It devname +specifies a device name relative to +.Pa /dev . +.It devunit +specifies a device unit number; no unit number is used if this is unspecified. +.El +.Sh SEE ALSO +.Xr mmap 2 , +.Xr open 2 , +.Xr read 2 , +.Xr write 2 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were +developed by SRI International and the University of Cambridge Computer +Laboratory under DARPA/AFRL contract +.Pq FA8750-10-C-0237 +.Pq Do CTSRD Dc , +as part of the DARPA CRASH research programme. +This device driver was written by +.An Robert N. M. Watson . +.Sh BUGS +.Nm +is intended to support the writing of userspace device drivers; however, it +does not permit directing interrupts to userspace, only memory-mapped I/O. +.Pp +.Nm +supports only a +.Li nexus +bus attachment, which is appropriate for system-on-chip busses such as +Altera's Avalon bus. +If the target device is off of another bus type, then additional bus +attachments will be required. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Aug 25 10:36:31 2012 (r239673) +++ head/sys/conf/files Sat Aug 25 11:07:43 2012 (r239674) @@ -659,6 +659,7 @@ dev/aic7xxx/aic7xxx_osm.c optional ahc dev/aic7xxx/aic7xxx_pci.c optional ahc pci dev/alc/if_alc.c optional alc pci dev/ale/if_ale.c optional ale pci +dev/altera/avgen/altera_avgen.c optional altera_avgen dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amrp amr dev/amr/amr_disk.c optional amr Added: head/sys/dev/altera/avgen/altera_avgen.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/avgen/altera_avgen.c Sat Aug 25 11:07:43 2012 (r239674) @@ -0,0 +1,451 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 +#include + +#include + +#include + +/* + * Generic device driver for allowing read(), write(), and mmap() on + * memory-mapped, Avalon-attached devices. There is no actual dependence on + * Avalon, so conceivably this should just be soc_dev or similar, since many + * system-on-chip bus environments would work fine with the same code. + */ + +static d_mmap_t altera_avgen_mmap; +static d_read_t altera_avgen_read; +static d_write_t altera_avgen_write; + +static struct cdevsw avg_cdevsw = { + .d_version = D_VERSION, + .d_mmap = altera_avgen_mmap, + .d_read = altera_avgen_read, + .d_write = altera_avgen_write, + .d_name = "altera_avgen", +}; + +static int +altera_avgen_read(struct cdev *dev, struct uio *uio, int flag) +{ + struct altera_avgen_softc *sc; + u_long offset, size; +#ifdef NOTYET + uint64_t v8; +#endif + uint32_t v4; + uint16_t v2; + uint8_t v1; + u_int width; + int error; + + sc = dev->si_drv1; + if ((sc->avg_flags & ALTERA_AVALON_FLAG_READ) == 0) + return (EACCES); + width = sc->avg_width; + if (uio->uio_offset < 0 || uio->uio_offset % width != 0 || + uio->uio_resid % width != 0) + return (ENODEV); + size = rman_get_size(sc->avg_res); + if ((uio->uio_offset + uio->uio_resid < 0) || + (uio->uio_offset + uio->uio_resid > size)) + return (ENODEV); + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + width > size) + return (ENODEV); + switch (width) { + case 1: + v1 = bus_read_1(sc->avg_res, offset); + error = uiomove(&v1, sizeof(v1), uio); + break; + + case 2: + v2 = bus_read_2(sc->avg_res, offset); + error = uiomove(&v2, sizeof(v2), uio); + break; + + case 4: + v4 = bus_read_4(sc->avg_res, offset); + error = uiomove(&v4, sizeof(v4), uio); + break; + +#ifdef NOTYET + case 8: + v8 = bus_read_8(sc->avg_res, offset); + error = uiomove(&v8, sizeof(v8), uio); + break; + +#endif + + default: + panic("%s: unexpected widthment %u", __func__, width); + } + if (error) + return (error); + } + return (0); +} + +static int +altera_avgen_write(struct cdev *dev, struct uio *uio, int flag) +{ + struct altera_avgen_softc *sc; + u_long offset, size; +#ifdef NOTYET + uint64_t v8; +#endif + uint32_t v4; + uint16_t v2; + uint8_t v1; + u_int width; + int error; + + sc = dev->si_drv1; + if ((sc->avg_flags & ALTERA_AVALON_FLAG_WRITE) == 0) + return (EACCES); + width = sc->avg_width; + if (uio->uio_offset < 0 || uio->uio_offset % width != 0 || + uio->uio_resid % width != 0) + return (ENODEV); + size = rman_get_size(sc->avg_res); + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + width > size) + return (ENODEV); + switch (width) { + case 1: + error = uiomove(&v1, sizeof(v1), uio); + if (error) + return (error); + bus_write_1(sc->avg_res, offset, v1); + break; + + case 2: + error = uiomove(&v2, sizeof(v2), uio); + if (error) + return (error); + bus_write_2(sc->avg_res, offset, v2); + break; + + case 4: + error = uiomove(&v4, sizeof(v4), uio); + if (error) + return (error); + bus_write_4(sc->avg_res, offset, v4); + break; + +#ifdef NOTYET + case 8: + error = uiomove(&v8, sizeof(v8), uio); + if (error) + return (error); + bus_write_8(sc->avg_res, offset, v8); + break; +#endif + + default: + panic("%s: unexpected width %u", __func__, width); + } + } + return (0); +} + +static int +altera_avgen_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) +{ + struct altera_avgen_softc *sc; + + sc = dev->si_drv1; + if (nprot & VM_PROT_READ) { + if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_READ) == 0) + return (EACCES); + } + if (nprot & VM_PROT_WRITE) { + if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_WRITE) == 0) + return (EACCES); + } + if (nprot & VM_PROT_EXECUTE) { + if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_EXEC) == 0) + return (EACCES); + } + if (trunc_page(offset) == offset && + rman_get_size(sc->avg_res) >= offset + PAGE_SIZE) { + *paddr = rman_get_start(sc->avg_res) + offset; + *memattr = VM_MEMATTR_UNCACHEABLE; + } else + return (ENODEV); + return (0); +} + +static int +altera_avgen_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Generic Altera Avalon device attachment"); + return (BUS_PROBE_DEFAULT); +} + +static int +altera_avgen_process_options(struct altera_avgen_softc *sc, + const char *str_fileio, const char *str_mmapio, const char *str_devname, + int devunit) +{ + const char *cp; + device_t dev = sc->avg_dev; + + /* + * Check for valid combinations of options. + */ + if (str_fileio == NULL && str_mmapio == NULL) { + device_printf(dev, + "at least one of %s or %s must be specified\n", + ALTERA_AVALON_STR_FILEIO, ALTERA_AVALON_STR_MMAPIO); + return (ENXIO); + } + if (str_devname == NULL && devunit != -1) { + device_printf(dev, "%s requires %s be specified\n", + ALTERA_AVALON_STR_DEVUNIT, ALTERA_AVALON_STR_DEVNAME); + return (ENXIO); + } + + /* + * Extract, digest, and save values. + */ + switch (sc->avg_width) { + case 1: + case 2: + case 4: +#ifdef NOTYET + case 8: +#endif + break; + + default: + device_printf(dev, "%s unsupported value %u\n", + ALTERA_AVALON_STR_WIDTH, sc->avg_width); + return (ENXIO); + } + sc->avg_flags = 0; + if (str_fileio != NULL) { + for (cp = str_fileio; *cp != '\0'; cp++) { + switch (*cp) { + case ALTERA_AVALON_CHAR_READ: + sc->avg_flags |= ALTERA_AVALON_FLAG_READ; + break; + + case ALTERA_AVALON_CHAR_WRITE: + sc->avg_flags |= ALTERA_AVALON_FLAG_WRITE; + break; + + default: + device_printf(dev, + "invalid %s character %c\n", + ALTERA_AVALON_STR_FILEIO, *cp); + return (ENXIO); + } + } + } + if (str_mmapio != NULL) { + for (cp = str_mmapio; *cp != '\0'; cp++) { + switch (*cp) { + case ALTERA_AVALON_CHAR_READ: + sc->avg_flags |= ALTERA_AVALON_FLAG_MMAP_READ; + break; + + case ALTERA_AVALON_CHAR_WRITE: + sc->avg_flags |= + ALTERA_AVALON_FLAG_MMAP_WRITE; + break; + + case ALTERA_AVALON_CHAR_EXEC: + sc->avg_flags |= ALTERA_AVALON_FLAG_MMAP_EXEC; + break; + + default: + device_printf(dev, + "invalid %s character %c\n", + ALTERA_AVALON_STR_MMAPIO, *cp); + return (ENXIO); + } + } + } + return (0); +} + +static int +altera_avgen_nexus_attach(device_t dev) +{ + struct altera_avgen_softc *sc; + const char *str_fileio, *str_mmapio; + const char *str_devname; + char devname[SPECNAMELEN + 1]; + int devunit, error; + + sc = device_get_softc(dev); + sc->avg_dev = dev; + sc->avg_unit = device_get_unit(dev); + + /* + * Query non-standard hints to find out what operations are permitted + * on the device, and whether it is cached. + */ + str_fileio = NULL; + str_mmapio = NULL; + str_devname = NULL; + devunit = -1; + sc->avg_width = 1; + error = resource_int_value(device_get_name(dev), device_get_unit(dev), + ALTERA_AVALON_STR_WIDTH, &sc->avg_width); + if (error != 0 && error != ENOENT) { + device_printf(dev, "invalid %s\n", ALTERA_AVALON_STR_WIDTH); + return (error); + } + (void)resource_string_value(device_get_name(dev), + device_get_unit(dev), ALTERA_AVALON_STR_FILEIO, &str_fileio); + (void)resource_string_value(device_get_name(dev), + device_get_unit(dev), ALTERA_AVALON_STR_MMAPIO, &str_mmapio); + (void)resource_string_value(device_get_name(dev), + device_get_unit(dev), ALTERA_AVALON_STR_DEVNAME, &str_devname); + (void)resource_int_value(device_get_name(dev), device_get_unit(dev), + ALTERA_AVALON_STR_DEVUNIT, &devunit); + error = altera_avgen_process_options(sc, str_fileio, str_mmapio, + str_devname, devunit); + if (error) + return (error); + + /* Select a device name. */ + if (str_devname != NULL) { + if (devunit != -1) + (void)snprintf(devname, sizeof(devname), "%s%d", + str_devname, devunit); + else + (void)snprintf(devname, sizeof(devname), "%s", + str_devname); + } else + snprintf(devname, sizeof(devname), "%s%d", "avgen", + sc->avg_unit); + + /* Memory allocation and checking. */ + sc->avg_rid = 0; + sc->avg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->avg_rid, RF_ACTIVE); + if (sc->avg_res == NULL) { + device_printf(dev, "couldn't map memory\n"); + return (ENXIO); + } + if (rman_get_size(sc->avg_res) >= PAGE_SIZE || str_mmapio != NULL) { + if (rman_get_size(sc->avg_res) % PAGE_SIZE != 0) { + device_printf(dev, + "memory region not even multiple of page size\n"); + error = ENXIO; + goto error; + } + if (rman_get_start(sc->avg_res) % PAGE_SIZE != 0) { + device_printf(dev, "memory region not page-aligned\n"); + error = ENXIO; + goto error; + } + } + + /* Device node allocation. */ + if (str_devname == NULL) { + str_devname = "altera_avgen%d"; + devunit = sc->avg_unit; + } + if (devunit != -1) + sc->avg_cdev = make_dev(&avg_cdevsw, sc->avg_unit, UID_ROOT, + GID_WHEEL, S_IRUSR | S_IWUSR, str_devname, devunit); + else + sc->avg_cdev = make_dev(&avg_cdevsw, sc->avg_unit, UID_ROOT, + GID_WHEEL, S_IRUSR | S_IWUSR, str_devname); + if (sc->avg_cdev == NULL) { + device_printf(sc->avg_dev, "%s: make_dev failed\n", __func__); + error = ENXIO; + goto error; + } + /* XXXRW: Slight race between make_dev(9) and here. */ + sc->avg_cdev->si_drv1 = sc; + return (0); + +error: + bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); + return (error); +} + +static int +altera_avgen_nexus_detach(device_t dev) +{ + struct altera_avgen_softc *sc; + + sc = device_get_softc(dev); + destroy_dev(sc->avg_cdev); + bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); + return (0); +} + +static device_method_t altera_avgen_nexus_methods[] = { + DEVMETHOD(device_probe, altera_avgen_nexus_probe), + DEVMETHOD(device_attach, altera_avgen_nexus_attach), + DEVMETHOD(device_detach, altera_avgen_nexus_detach), + { 0, 0 } +}; + +static driver_t altera_avgen_nexus_driver = { + "altera_avgen", + altera_avgen_nexus_methods, + sizeof(struct altera_avgen_softc), +}; + +static devclass_t altera_avgen_devclass; + +DRIVER_MODULE(avgen, nexus, altera_avgen_nexus_driver, altera_avgen_devclass, + 0, 0); Added: head/sys/dev/altera/avgen/altera_avgen.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/avgen/altera_avgen.h Sat Aug 25 11:07:43 2012 (r239674) @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 _DEV_ALTERA_AVALON_H_ +#define _DEV_ALTERA_AVALON_H_ + +struct altera_avgen_softc { + /* + * Bus-related fields. + */ + device_t avg_dev; + int avg_unit; + + /* + * The device node and memory-mapped I/O region. + */ + struct cdev *avg_cdev; + struct resource *avg_res; + int avg_rid; + + /* + * Access properties configured by device.hints. + */ + u_int avg_flags; + u_int avg_width; +}; + +/* + * Various flags extracted from device.hints to configure operations on the + * device. + */ +#define ALTERA_AVALON_FLAG_READ 0x01 +#define ALTERA_AVALON_FLAG_WRITE 0x02 +#define ALTERA_AVALON_FLAG_MMAP_READ 0x04 +#define ALTERA_AVALON_FLAG_MMAP_WRITE 0x08 +#define ALTERA_AVALON_FLAG_MMAP_EXEC 0x10 + +#define ALTERA_AVALON_CHAR_READ 'r' +#define ALTERA_AVALON_CHAR_WRITE 'w' +#define ALTERA_AVALON_CHAR_EXEC 'x' + +#define ALTERA_AVALON_STR_WIDTH "width" +#define ALTERA_AVALON_STR_FILEIO "fileio" +#define ALTERA_AVALON_STR_MMAPIO "mmapio" +#define ALTERA_AVALON_STR_DEVNAME "devname" +#define ALTERA_AVALON_STR_DEVUNIT "devunit" + +/* + * Driver setup routines from the bus attachment/teardown. + */ +int altera_avgen_attach(struct altera_avgen_softc *sc); +void altera_avgen_detach(struct altera_avgen_softc *sc); + +#endif /* _DEV_ALTERA_AVALON_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 11: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 CBA6F106566B; Sat, 25 Aug 2012 11:19:20 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B38CE8FC12; Sat, 25 Aug 2012 11: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 q7PBJK6J029552; Sat, 25 Aug 2012 11:19:20 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PBJKtf029543; Sat, 25 Aug 2012 11:19:20 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208251119.q7PBJKtf029543@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 11: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: r239675 - in head: share/man/man4 sys/conf sys/dev/altera/sdcard X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 11:19:20 -0000 Author: rwatson Date: Sat Aug 25 11:19:20 2012 New Revision: 239675 URL: http://svn.freebsd.org/changeset/base/239675 Log: Add a device driver for the Altera University Program SD Card IP Core, which can be synthesised in Altera FPGAs. An altera_sdcardc device probes during the boot, and /dev/altera_sdcard devices come and go as inserted and removed. The device driver attaches directly to the Nexus, as is common for system-on-chip device drivers. This IP core suffers a number of significant limitations, including a lack of interrupt-driven I/O -- we must implement timer-driven polling, only CSD 0 cards (up to 2G) are supported, there are serious memory access issues that require the driver to verify writes to memory-mapped buffers, undocumented alignment requirements, and erroneous error returns. The driver must therefore work quite hard, despite a fairly simple hardware-software interface. The IP core also supports at most one outstanding I/O at a time, so is not a speed demon. However, with the above workarounds, and subject to performance problems, it works quite reliably in practice, and we can use it for read-write mounts of root file systems, etc. Sponsored by: DARPA, AFRL Added: head/share/man/man4/altera_sdcard.4 (contents, props changed) head/sys/dev/altera/sdcard/ head/sys/dev/altera/sdcard/altera_sdcard.c (contents, props changed) head/sys/dev/altera/sdcard/altera_sdcard.h (contents, props changed) head/sys/dev/altera/sdcard/altera_sdcard_disk.c (contents, props changed) head/sys/dev/altera/sdcard/altera_sdcard_io.c (contents, props changed) head/sys/dev/altera/sdcard/altera_sdcard_nexus.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Aug 25 11:07:43 2012 (r239674) +++ head/share/man/man4/Makefile Sat Aug 25 11:19:20 2012 (r239675) @@ -33,6 +33,7 @@ MAN= aac.4 \ ale.4 \ alpm.4 \ altera_avgen.4 \ + altera_sdcard.4 \ altq.4 \ amdpm.4 \ ${_amdsbwd.4} \ Added: head/share/man/man4/altera_sdcard.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/altera_sdcard.4 Sat Aug 25 11:19:20 2012 (r239675) @@ -0,0 +1,118 @@ +.\"- +.\" Copyright (c) 2012 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +.\" ("CTSRD"), as part of the DARPA CRASH research programme. +.\" +.\" 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 August 18, 2012 +.Dt ALTERA_SDCARD 4 +.Os +.Sh NAME +.Nm altera_sdcard +.Nd driver for the Altera University Program Secure Data Card IP Core +.Sh SYNOPSIS +.Cd "device altera_sdcard" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.altera_sdcardc.0.at="nexus0" +.Cd hint.altera_sdcardc.0.maddr=0x7f008000 +.Cd hint.altera_sdcardc.0.msize=0x400 +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Altera University Program Secure Data +Card (SD Card) IP Core device. +A controller device, +.Li altera_sdcardcX , +will be attached during boot. +Inserted disks are presented as +.Xr disk 9 +devices, +.Li altera_sdcardX , +corresponding to the controller number. +.Sh HARDWARE +The current version of the +.Nm +driver supports the SD Card IP core as described in the August 2011 version of +Altera's documentation. +The core supports only cards up to 2G (CSD 0); larger cards, or cards using +newer CSD versions, will not be detected. +The IP core has two key limitations: a lack of interrupt support, requiring +timer-driven polling to detect I/O completion, and support for only single +512-byte block read and write operations at a time. +The combined effect of those two limits is that the system clock rate, +.Dv HZ , +must be set to at least 200 in order to accomplish the maximum 100KB/s data +rate supported by the IP core. +.Sh SEE ALSO +.Xr disk 9 +.Rs +.%T Altera University Program Secure Data Card IP Core +.%D August 2011 +.%I Altera Corporation - University Program +.%U ftp://ftp.altera.com/up/pub/Altera_Material/11.0/University_Program_IP_Cores/Memory/SD_Card_Interface_for_SoPC_Builder.pdf +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were +developed by SRI International and the University of Cambridge Computer +Laboratory under DARPA/AFRL contract +.Pq FA8750-10-C-0237 +.Pq Do CTSRD Dc , +as part of the DARPA CRASH research programme. +This device driver was written by +.An Robert N. M. Watson . +.Sh BUGS +.Nm +contains a number of work-arounds for IP core bugs. +Perhaps most critically, +.Nm +ignores the CRC error bit returned in the RR1 register, which appears to be +unexpectedly set by the IP core. +.Pp +.Nm +uses fixed polling intervals are used for card insertion/removal and +I/O completion detection; an adaptive strategy might improve performance by +reducing the latency to detecting completed I/O. +However, in our experiments, using polling rates greater than 200 times a +second did not improve performance. +.Pp +.Nm +supports only a +.Li nexus +bus attachment, which is appropriate for system-on-chip busses such as +Altera's Avalon bus. +If the IP core is configured off of another bus type, then additional bus +attachments will be required. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Aug 25 11:07:43 2012 (r239674) +++ head/sys/conf/files Sat Aug 25 11:19:20 2012 (r239675) @@ -660,6 +660,10 @@ dev/aic7xxx/aic7xxx_pci.c optional ahc p dev/alc/if_alc.c optional alc pci dev/ale/if_ale.c optional ale pci dev/altera/avgen/altera_avgen.c optional altera_avgen +dev/altera/sdcard/altera_sdcard.c optional altera_sdcard +dev/altera/sdcard/altera_sdcard_disk.c optional altera_sdcard +dev/altera/sdcard/altera_sdcard_io.c optional altera_sdcard +dev/altera/sdcard/altera_sdcard_nexus.c optional altera_sdcard dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amrp amr dev/amr/amr_disk.c optional amr Added: head/sys/dev/altera/sdcard/altera_sdcard.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/sdcard/altera_sdcard.c Sat Aug 25 11:19:20 2012 (r239675) @@ -0,0 +1,402 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 + +#include + +#include + +/* + * Device driver for the Altera University Program Secure Data Card IP Core, + * as described in the similarly named SOPC Builder IP Core specification. + * This soft core is not a full SD host controller interface (SDHCI) but + * instead provides a set of memory mapped registers and memory buffer that + * mildly abstract the SD Card protocol, but without providing DMA or + * interrupts. However, it does hide the details of voltage and + * communications negotiation. This driver implements disk(9), but due to the + * lack of interrupt support, must rely on timer-driven polling to determine + * when I/Os have completed. + * + * TODO: + * + * 1. Implement DISKFLAG_CANDELETE / SD Card sector erase support. + * 2. Implement d_ident from SD Card CID serial number field. + * 3. Handle read-only SD Cards. + * 4. Tune timeouts based on real-world SD Card speeds. + */ + +void +altera_sdcard_attach(struct altera_sdcard_softc *sc) +{ + + ALTERA_SDCARD_LOCK_INIT(sc); + ALTERA_SDCARD_CONDVAR_INIT(sc); + sc->as_disk = NULL; + bioq_init(&sc->as_bioq); + sc->as_currentbio = NULL; + sc->as_state = ALTERA_SDCARD_STATE_NOCARD; + sc->as_taskqueue = taskqueue_create("altera_sdcardc taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->as_taskqueue); + taskqueue_start_threads(&sc->as_taskqueue, 1, PI_DISK, + "altera_sdcardc%d taskqueue", sc->as_unit); + TIMEOUT_TASK_INIT(sc->as_taskqueue, &sc->as_task, 0, + altera_sdcard_task, sc); + + /* + * Kick off timer-driven processing with a manual poll so that we + * synchronously detect an already-inserted SD Card during the boot or + * other driver attach point. + */ + altera_sdcard_task(sc, 1); +} + +void +altera_sdcard_detach(struct altera_sdcard_softc *sc) +{ + + KASSERT(sc->as_taskqueue != NULL, ("%s: taskqueue not present", + __func__)); + + /* + * Winding down the driver on detach is a bit complex. Update the + * flags to indicate that a detach has been requested, and then wait + * for in-progress I/O to wind down before continuing. + */ + ALTERA_SDCARD_LOCK(sc); + sc->as_flags |= ALTERA_SDCARD_FLAG_DETACHREQ; + while (sc->as_state != ALTERA_SDCARD_STATE_DETACHED) + ALTERA_SDCARD_CONDVAR_WAIT(sc); + ALTERA_SDCARD_UNLOCK(sc); + + /* + * Now wait for the possibly still executing taskqueue to drain. In + * principle no more events will be scheduled as we've transitioned to + * a detached state, but there might still be a request in execution. + */ + while (taskqueue_cancel_timeout(sc->as_taskqueue, &sc->as_task, NULL)) + taskqueue_drain_timeout(sc->as_taskqueue, &sc->as_task); + + /* + * Simulate a disk removal if one is present to deal with any pending + * or queued I/O. + */ + if (sc->as_disk != NULL) + altera_sdcard_disk_remove(sc); + KASSERT(bioq_first(&sc->as_bioq) == NULL, + ("%s: non-empty bioq", __func__)); + + /* + * Free any remaining allocated resources. + */ + taskqueue_free(sc->as_taskqueue); + sc->as_taskqueue = NULL; + ALTERA_SDCARD_CONDVAR_DESTROY(sc); + ALTERA_SDCARD_LOCK_DESTROY(sc); +} + +/* + * Set up and start the next I/O. Transition to the I/O state, but allow the + * caller to schedule the next timeout, as this may be called either from an + * initial attach context, or from the task queue, which requires different + * behaviour. + */ +static void +altera_sdcard_nextio(struct altera_sdcard_softc *sc) +{ + struct bio *bp; + + ALTERA_SDCARD_LOCK_ASSERT(sc); + KASSERT(sc->as_currentbio == NULL, + ("%s: bio already active", __func__)); + + bp = bioq_takefirst(&sc->as_bioq); + if (bp == NULL) + panic("%s: bioq empty", __func__); + altera_sdcard_io_start(sc, bp); + sc->as_state = ALTERA_SDCARD_STATE_IO; +} + +static void +altera_sdcard_task_nocard(struct altera_sdcard_softc *sc) +{ + + ALTERA_SDCARD_LOCK_ASSERT(sc); + + /* + * Handle device driver detach. + */ + if (sc->as_flags & ALTERA_SDCARD_FLAG_DETACHREQ) { + sc->as_state = ALTERA_SDCARD_STATE_DETACHED; + return; + } + + /* + * If there is no card insertion, remain in NOCARD. + */ + if (!(altera_sdcard_read_asr(sc) & ALTERA_SDCARD_ASR_CARDPRESENT)) + return; + + /* + * Read the CSD -- it may contain values that the driver can't handle, + * either because of an unsupported version/feature, or because the + * card is misbehaving. This triggers a transition to + * ALTERA_SDCARD_STATE_BADCARD. We rely on the CSD read to print a + * banner about how the card is problematic, since it has more + * information. The bad card state allows us to print that banner + * once rather than each time we notice the card is there, and still + * bad. + */ + if (altera_sdcard_read_csd(sc) != 0) { + sc->as_state = ALTERA_SDCARD_STATE_BADCARD; + return; + } + + /* + * Process card insertion and upgrade to the IDLE state. + */ + altera_sdcard_disk_insert(sc); + sc->as_state = ALTERA_SDCARD_STATE_IDLE; +} + +static void +altera_sdcard_task_badcard(struct altera_sdcard_softc *sc) +{ + + ALTERA_SDCARD_LOCK_ASSERT(sc); + + /* + * Handle device driver detach. + */ + if (sc->as_flags & ALTERA_SDCARD_FLAG_DETACHREQ) { + sc->as_state = ALTERA_SDCARD_STATE_DETACHED; + return; + } + + /* + * Handle safe card removal -- no teardown is required, just a state + * transition. + */ + if (!(altera_sdcard_read_asr(sc) & ALTERA_SDCARD_ASR_CARDPRESENT)) + sc->as_state = ALTERA_SDCARD_STATE_NOCARD; +} + +static void +altera_sdcard_task_idle(struct altera_sdcard_softc *sc) +{ + + ALTERA_SDCARD_LOCK_ASSERT(sc); + + /* + * Handle device driver detach. + */ + if (sc->as_flags & ALTERA_SDCARD_FLAG_DETACHREQ) { + sc->as_state = ALTERA_SDCARD_STATE_DETACHED; + return; + } + + /* + * Handle safe card removal. + */ + if (!(altera_sdcard_read_asr(sc) & ALTERA_SDCARD_ASR_CARDPRESENT)) { + altera_sdcard_disk_remove(sc); + sc->as_state = ALTERA_SDCARD_STATE_NOCARD; + } +} + +static void +altera_sdcard_task_io(struct altera_sdcard_softc *sc) +{ + uint16_t asr; + + ALTERA_SDCARD_LOCK_ASSERT(sc); + KASSERT(sc->as_currentbio != NULL, ("%s: no current I/O", __func__)); + + asr = altera_sdcard_read_asr(sc); + + /* + * Check for unexpected card removal during an I/O. + */ + if (!(asr & ALTERA_SDCARD_ASR_CARDPRESENT)) { + altera_sdcard_disk_remove(sc); + if (sc->as_flags & ALTERA_SDCARD_FLAG_DETACHREQ) + sc->as_state = ALTERA_SDCARD_STATE_DETACHED; + else + sc->as_state = ALTERA_SDCARD_STATE_NOCARD; + return; + } + + /* + * If the I/O isn't complete, remain in the IO state without further + * action, even if DETACHREQ is in flight. + */ + if (asr & ALTERA_SDCARD_ASR_CMDINPROGRESS) + return; + + /* + * Handle various forms of I/O completion, successful and otherwise. + * The I/O layer may restart the transaction if an error occurred, in + * which case remain in the IO state and reschedule. + */ + if (!altera_sdcard_io_complete(sc, asr)) + return; + + /* + * Now that I/O is complete, process detach requests in preference to + * starting new I/O. + */ + if (sc->as_flags & ALTERA_SDCARD_FLAG_DETACHREQ) { + sc->as_state = ALTERA_SDCARD_STATE_DETACHED; + return; + } + + /* + * Finally, either start the next I/O or transition to the IDLE state. + */ + if (bioq_first(&sc->as_bioq) != NULL) + altera_sdcard_nextio(sc); + else + sc->as_state = ALTERA_SDCARD_STATE_IDLE; +} + +static void +altera_sdcard_task_rechedule(struct altera_sdcard_softc *sc) +{ + int interval; + + /* + * Reschedule based on new state. Or not, if detaching the device + * driver. Treat a bad card as though it were no card at all. + */ + switch (sc->as_state) { + case ALTERA_SDCARD_STATE_NOCARD: + case ALTERA_SDCARD_STATE_BADCARD: + interval = ALTERA_SDCARD_TIMEOUT_NOCARD; + break; + + case ALTERA_SDCARD_STATE_IDLE: + interval = ALTERA_SDCARD_TIMEOUT_IDLE; + break; + + case ALTERA_SDCARD_STATE_IO: + if (sc->as_flags & ALTERA_SDCARD_FLAG_IOERROR) + interval = ALTERA_SDCARD_TIMEOUT_IOERROR; + else + interval = ALTERA_SDCARD_TIMEOUT_IO; + break; + + default: + panic("%s: invalid exit state %d", __func__, sc->as_state); + } + taskqueue_enqueue_timeout(sc->as_taskqueue, &sc->as_task, interval); +} + +/* + * Because the Altera SD Card IP Core doesn't support interrupts, we do all + * asynchronous work from a timeout. Poll at two different rates -- an + * infrequent check for card insertion status changes, and a frequent one for + * I/O completion. The task should never start in DETACHED, as that would + * imply that a previous instance failed to cancel rather than reschedule. + */ +void +altera_sdcard_task(void *arg, int pending) +{ + struct altera_sdcard_softc *sc; + + sc = arg; + KASSERT(sc->as_state != ALTERA_SDCARD_STATE_DETACHED, + ("%s: already in detached", __func__)); + + ALTERA_SDCARD_LOCK(sc); + switch (sc->as_state) { + case ALTERA_SDCARD_STATE_NOCARD: + altera_sdcard_task_nocard(sc); + break; + + case ALTERA_SDCARD_STATE_BADCARD: + altera_sdcard_task_badcard(sc); + break; + + case ALTERA_SDCARD_STATE_IDLE: + altera_sdcard_task_idle(sc); + break; + + case ALTERA_SDCARD_STATE_IO: + altera_sdcard_task_io(sc); + break; + + default: + panic("%s: invalid enter state %d", __func__, sc->as_state); + } + + /* + * If we have transitioned to DETACHED, signal the detach thread and + * cancel the timeout-driven task. Otherwise reschedule on an + * appropriate timeout. + */ + if (sc->as_state == ALTERA_SDCARD_STATE_DETACHED) + ALTERA_SDCARD_CONDVAR_SIGNAL(sc); + else + altera_sdcard_task_rechedule(sc); + ALTERA_SDCARD_UNLOCK(sc); +} + +void +altera_sdcard_start(struct altera_sdcard_softc *sc) +{ + + ALTERA_SDCARD_LOCK_ASSERT(sc); + + KASSERT(sc->as_state == ALTERA_SDCARD_STATE_IDLE, + ("%s: starting when not IDLE", __func__)); + + taskqueue_cancel_timeout(sc->as_taskqueue, &sc->as_task, NULL); + altera_sdcard_nextio(sc); + taskqueue_enqueue_timeout(sc->as_taskqueue, &sc->as_task, + ALTERA_SDCARD_TIMEOUT_IO); +} Added: head/sys/dev/altera/sdcard/altera_sdcard.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/sdcard/altera_sdcard.h Sat Aug 25 11:19:20 2012 (r239675) @@ -0,0 +1,247 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 _DEV_ALTERA_SDCARD_H_ +#define _DEV_ALTERA_SDCARD_H_ + +#define ALTERA_SDCARD_CSD_SIZE 16 +struct altera_sdcard_csd { + uint8_t csd_data[ALTERA_SDCARD_CSD_SIZE]; +} __aligned(2); /* CSD is read in 16-bit chunks, so align to match. */ + +struct altera_sdcard_softc { + device_t as_dev; + int as_unit; + struct resource *as_res; + int as_rid; + struct mtx as_lock; + struct cv as_condvar; + int as_state; + int as_flags; + struct disk *as_disk; + struct taskqueue *as_taskqueue; + struct timeout_task as_task; + + /* + * Fields relating to in-progress and pending I/O, if any. + */ + struct bio_queue_head as_bioq; + struct bio *as_currentbio; + u_int as_retriesleft; + + /* + * Infrequently changing fields cached from the SD Card IP Core. + */ + struct altera_sdcard_csd as_csd; + uint8_t as_csd_structure; /* CSD version. */ + uint64_t as_mediasize; +}; + +#define ALTERA_SDCARD_LOCK(sc) mtx_lock(&(sc)->as_lock) +#define ALTERA_SDCARD_LOCK_ASSERT(sc) mtx_assert(&(sc)->as_lock, MA_OWNED) +#define ALTERA_SDCARD_LOCK_DESTROY(sc) mtx_destroy(&(sc)->as_lock) +#define ALTERA_SDCARD_LOCK_INIT(sc) mtx_init(&(sc)->as_lock, \ + "altera_sdcard", NULL, MTX_DEF) +#define ALTERA_SDCARD_UNLOCK(sc) mtx_unlock(&(sc)->as_lock) + +#define ALTERA_SDCARD_CONDVAR_DESTROY(sc) cv_destroy(&(sc)->as_condvar) +#define ALTERA_SDCARD_CONDVAR_INIT(sc) cv_init(&(sc)->as_condvar, \ + "altera_sdcard_detach_wait") +#define ALTERA_SDCARD_CONDVAR_SIGNAL(dc) cv_signal(&(sc)->as_condvar) +#define ALTERA_SDCARD_CONDVAR_WAIT(sc) cv_wait(&(sc)->as_condvar, \ + &(sc)->as_lock) + +/* + * States an instance can be in at any given moment. + */ +#define ALTERA_SDCARD_STATE_NOCARD 1 /* No card inserted. */ +#define ALTERA_SDCARD_STATE_BADCARD 2 /* Card bad/not supported. */ +#define ALTERA_SDCARD_STATE_IDLE 3 /* Card present but idle. */ +#define ALTERA_SDCARD_STATE_IO 4 /* Card in I/O currently. */ +#define ALTERA_SDCARD_STATE_DETACHED 5 /* Driver is detaching. */ + +/* + * Different timeout intervals based on state. When just looking for a card + * status change, check twice a second. When we're actively waiting on I/O + * completion, check every millisecond. + */ +#define ALTERA_SDCARD_TIMEOUT_NOCARD (hz/2) +#define ALTERA_SDCARD_TIMEOUT_IDLE (hz/2) +#define ALTERA_SDCARD_TIMEOUT_IO (1) +#define ALTERA_SDCARD_TIMEOUT_IOERROR (hz/5) + +/* + * Maximum number of retries on an I/O. + */ +#define ALTERA_SDCARD_RETRY_LIMIT 10 + +/* + * Driver status flags. + */ +#define ALTERA_SDCARD_FLAG_DETACHREQ 0x00000001 /* Detach requested. */ +#define ALTERA_SDCARD_FLAG_IOERROR 0x00000002 /* Error in progress. */ + +/* + * Functions for performing low-level register and memory I/O to/from the SD + * Card IP Core. In general, only code in altera_sdcard_io.c is aware of the + * hardware interface. + */ +uint16_t altera_sdcard_read_asr(struct altera_sdcard_softc *sc); +int altera_sdcard_read_csd(struct altera_sdcard_softc *sc); + +int altera_sdcard_io_complete(struct altera_sdcard_softc *sc, + uint16_t asr); +void altera_sdcard_io_start(struct altera_sdcard_softc *sc, + struct bio *bp); + +/* + * Constants for interpreting the SD Card Card Specific Data (CSD) register. + */ +#define ALTERA_SDCARD_CSD_STRUCTURE_BYTE 15 +#define ALTERA_SDCARD_CSD_STRUCTURE_MASK 0xc0 /* 2 bits */ +#define ALTERA_SDCARD_CSD_STRUCTURE_RSHIFT 6 + +#define ALTERA_SDCARD_CSD_READ_BL_LEN_BYTE 10 +#define ALTERA_SDCARD_CSD_READ_BL_LEN_MASK 0x0f /* 4 bits */ + +/* + * C_SIZE is a 12-bit field helpfully split over three differe bytes of CSD + * data. Software ease of use was not a design consideration. + */ +#define ALTERA_SDCARD_CSD_C_SIZE_BYTE0 7 +#define ALTERA_SDCARD_CSD_C_SIZE_MASK0 0xc /* top 2 bits */ +#define ALTERA_SDCARD_CSD_C_SIZE_RSHIFT0 6 + +#define ALTERA_SDCARD_CSD_C_SIZE_BYTE1 8 +#define ALTERA_SDCARD_CSD_C_SIZE_MASK1 0xff /* 8 bits */ +#define ALTERA_SDCARD_CSD_C_SIZE_LSHIFT1 2 + +#define ALTERA_SDCARD_CSD_C_SIZE_BYTE2 9 +#define ALTERA_SDCARD_CSD_C_SIZE_MASK2 0x03 /* bottom 2 bits */ +#define ALTERA_SDCARD_CSD_C_SIZE_LSHIFT2 10 + +#define ALTERA_SDCARD_CSD_C_SIZE_MULT_BYTE0 5 +#define ALTERA_SDCARD_CSD_C_SIZE_MULT_MASK0 0x80 /* top 1 bit */ +#define ALTERA_SDCARD_CSD_C_SIZE_MULT_RSHIFT0 7 + +#define ALTERA_SDCARD_CSD_C_SIZE_MULT_BYTE1 6 +#define ALTERA_SDCARD_CSD_C_SIZE_MULT_MASK1 0x03 /* bottom 2 bits */ +#define ALTERA_SDCARD_CSD_C_SIZE_MULT_LSHIFT1 1 + +/* + * I/O register/buffer offsets, from Table 4.1.1 in the Altera University + * Program SD Card IP Core specification. + */ +#define ALTERA_SDCARD_OFF_RXTX_BUFFER 0 /* 512-byte I/O buffer */ +#define ALTERA_SDCARD_OFF_CID 512 /* 16-byte Card ID number */ +#define ALTERA_SDCARD_OFF_CSD 528 /* 16-byte Card Specific Data */ +#define ALTERA_SDCARD_OFF_OCR 544 /* Operating Conditions Reg */ +#define ALTERA_SDCARD_OFF_SR 548 /* SD Card Status Register */ +#define ALTERA_SDCARD_OFF_RCA 552 /* Relative Card Address Reg */ +#define ALTERA_SDCARD_OFF_CMD_ARG 556 /* Command Argument Register */ +#define ALTERA_SDCARD_OFF_CMD 560 /* Command Register */ +#define ALTERA_SDCARD_OFF_ASR 564 /* Auxiliary Status Register */ +#define ALTERA_SDCARD_OFF_RR1 568 /* Response R1 */ + +/* + * The Altera IP Core provides a 16-bit "Additional Status Register" (ASR) + * beyond those described in the SD Card specification that captures IP Core + * transaction state, such as whether the last command is in progress, the + * card has been removed, etc. + */ +#define ALTERA_SDCARD_ASR_CMDVALID 0x0001 +#define ALTERA_SDCARD_ASR_CARDPRESENT 0x0002 +#define ALTERA_SDCARD_ASR_CMDINPROGRESS 0x0004 +#define ALTERA_SDCARD_ASR_SRVALID 0x0008 +#define ALTERA_SDCARD_ASR_CMDTIMEOUT 0x0010 +#define ALTERA_SDCARD_ASR_CMDDATAERROR 0x0020 + +/* + * The Altera IP Core claims to provide a 16-bit "Response R1" register (RR1) + * to provide more detailed error reporting when a read or write fails. + * + * XXXRW: The specification claims that this field is 16-bit, but then + * proceeds to define values as though it is 32-bit. In practice, 16-bit + * seems more likely as the register is not 32-bit aligned. + */ +#define ALTERA_SDCARD_RR1_INITPROCRUNNING 0x0100 +#define ALTERA_SDCARD_RR1_ERASEINTERRUPTED 0x0200 +#define ALTERA_SDCARD_RR1_ILLEGALCOMMAND 0x0400 +#define ALTERA_SDCARD_RR1_COMMANDCRCFAILED 0x0800 +#define ALTERA_SDCARD_RR1_ADDRESSMISALIGNED 0x1000 +#define ALTERA_SDCARD_RR1_ADDRBLOCKRANGE 0x2000 + +/* + * Not all RR1 values are "errors" per se -- check only for the ones that are + * when performing error handling. + */ +#define ALTERA_SDCARD_RR1_ERRORMASK \ + (ALTERA_SDCARD_RR1_ERASEINTERRUPTED | ALTERA_SDCARD_RR1_ILLEGALCOMMAND | \ + ALTERA_SDCARD_RR1_COMMANDCRCFAILED | ALTERA_SDCARD_RR1_ADDRESSMISALIGNED |\ + ALTERA_SDCARD_RR1_ADDRBLOCKRANGE) + +/* + * Although SD Cards may have various sector sizes, the Altera IP Core + * requires that I/O be done in 512-byte chunks. + */ +#define ALTERA_SDCARD_SECTORSIZE 512 + +/* + * SD Card commands used in this driver. + */ +#define ALTERA_SDCARD_CMD_SEND_RCA 0x03 /* Retrieve card RCA. */ +#define ALTERA_SDCARD_CMD_SEND_CSD 0x09 /* Retrieve CSD register. */ +#define ALTERA_SDCARD_CMD_SEND_CID 0x0A /* Retrieve CID register. */ +#define ALTERA_SDCARD_CMD_READ_BLOCK 0x11 /* Read block from disk. */ +#define ALTERA_SDCARD_CMD_WRITE_BLOCK 0x18 /* Write block to disk. */ + +/* + * Functions exposed by the device driver core to newbus(9) bus attachment + * implementations. + */ +void altera_sdcard_attach(struct altera_sdcard_softc *sc); +void altera_sdcard_detach(struct altera_sdcard_softc *sc); +void altera_sdcard_task(void *arg, int pending); + +/* + * Functions exposed by the device driver core to the disk(9) front-end. + */ +void altera_sdcard_start(struct altera_sdcard_softc *sc); + +/* + * Functions relating to the implementation of disk(9) KPIs for the SD Card + * driver. + */ +void altera_sdcard_disk_insert(struct altera_sdcard_softc *sc); +void altera_sdcard_disk_remove(struct altera_sdcard_softc *sc); + +#endif /* _DEV_ALTERA_SDCARD_H_ */ Added: head/sys/dev/altera/sdcard/altera_sdcard_disk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/sdcard/altera_sdcard_disk.c Sat Aug 25 11:19:20 2012 (r239675) @@ -0,0 +1,185 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 + +#include + +#include + +static int +altera_sdcard_disk_dump(void *arg, void *virtual, vm_offset_t physical, + off_t offset, size_t length) +{ + + panic("%s: not yet", __func__); +} + +static int +altera_sdcard_disk_ioctl(struct disk *disk, u_long cmd, void *data, int fflag, + struct thread *td) +{ + + /* XXXRW: more here? */ + return (EINVAL); +} + +static void +altera_sdcard_disk_strategy(struct bio *bp) +{ + struct altera_sdcard_softc *sc; + + /* + * Although the SD Card doesn't need sorting, we don't want to + * introduce barriers, so use bioq_disksort(). + */ + sc = bp->bio_disk->d_drv1; + ALTERA_SDCARD_LOCK(sc); + switch (sc->as_state) { + case ALTERA_SDCARD_STATE_NOCARD: + device_printf(sc->as_dev, "%s: unexpected I/O on NOCARD", + __func__); + biofinish(bp, NULL, ENXIO); + break; + + case ALTERA_SDCARD_STATE_BADCARD: + device_printf(sc->as_dev, "%s: unexpected I/O on BADCARD", + __func__); + biofinish(bp, NULL, ENXIO); + break; + + case ALTERA_SDCARD_STATE_DETACHED: + device_printf(sc->as_dev, "%s: unexpected I/O on DETACHED", + __func__); + biofinish(bp, NULL, ENXIO); + + case ALTERA_SDCARD_STATE_IDLE: + bioq_disksort(&sc->as_bioq, bp); + altera_sdcard_start(sc); + break; + + case ALTERA_SDCARD_STATE_IO: + bioq_disksort(&sc->as_bioq, bp); + break; + + default: + panic("%s: invalid state %d", __func__, sc->as_state); + } + ALTERA_SDCARD_UNLOCK(sc); +} + +void +altera_sdcard_disk_insert(struct altera_sdcard_softc *sc) +{ + struct disk *disk; + uint64_t size; + + ALTERA_SDCARD_LOCK_ASSERT(sc); + + /* + * Because the disk insertion routine occupies the driver instance's + * task queue thread, and the disk(9) instance isn't hooked up yet by + * definition, the only other source of events of concern is a thread + * initiating driver detach. That thread has to issue a detach + * request and await an ACK from the taskqueue thread. It is + * therefore safe to drop the lock here. + */ + ALTERA_SDCARD_UNLOCK(sc); + disk = disk_alloc(); + disk->d_drv1 = sc; + disk->d_name = "altera_sdcard"; + disk->d_unit = sc->as_unit; + disk->d_strategy = altera_sdcard_disk_strategy; + disk->d_dump = altera_sdcard_disk_dump; + disk->d_ioctl = altera_sdcard_disk_ioctl; + disk->d_sectorsize = ALTERA_SDCARD_SECTORSIZE; + disk->d_mediasize = sc->as_mediasize; + disk->d_maxsize = ALTERA_SDCARD_SECTORSIZE; + sc->as_disk = disk; + disk_create(disk, DISK_VERSION); + ALTERA_SDCARD_LOCK(sc); + + /* + * Print a pretty-ish card insertion string. We could stand to + * decorate this further, e.g., with card vendor information. + */ + size = sc->as_mediasize / (1000 * 1000); + device_printf(sc->as_dev, "%juM SD Card inserted\n", (uintmax_t)size); +} + +void +altera_sdcard_disk_remove(struct altera_sdcard_softc *sc) +{ + struct disk *disk; + + ALTERA_SDCARD_LOCK_ASSERT(sc); + KASSERT(sc->as_disk != NULL, ("%s: as_disk NULL", __func__)); + + /* + * sc->as_state will be updated by the caller. + * + * XXXRW: Is it OK to call disk_destroy() under the mutex, or should + * we be deferring that to the calling context once it is released? + */ + disk = sc->as_disk; + disk_gone(disk); + disk_destroy(disk); + sc->as_disk = NULL; + + /* + * Cancel all outstanding I/O on the SD Card. + */ + if (sc->as_currentbio != NULL) { + device_printf(sc->as_dev, "%s: SD Card removed during I/O", + __func__); + biofinish(sc->as_currentbio, NULL, ENXIO); + sc->as_currentbio = NULL; + } + bioq_flush(&sc->as_bioq, NULL, ENXIO); + device_printf(sc->as_dev, "SD Card removed\n"); +} Added: head/sys/dev/altera/sdcard/altera_sdcard_io.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/sdcard/altera_sdcard_io.c Sat Aug 25 11:19:20 2012 (r239675) @@ -0,0 +1,447 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 11:30: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 4F687106566C; Sat, 25 Aug 2012 11:30:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 377188FC12; Sat, 25 Aug 2012 11:30: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 q7PBUbfu030980; Sat, 25 Aug 2012 11:30:37 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PBUbJG030972; Sat, 25 Aug 2012 11:30:37 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208251130.q7PBUbJG030972@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 11:30: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: r239676 - in head: share/man/man4 sys/dev/altera/jtag_uart sys/mips/beri X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 11:30:37 -0000 Author: rwatson Date: Sat Aug 25 11:30:36 2012 New Revision: 239676 URL: http://svn.freebsd.org/changeset/base/239676 Log: Add altera_jtag_uart(4), a device driver for Altera's JTAG UART soft core, which presents a UART-like interface over the Avalon bus that can be addressed over JTAG. This IP core proves extremely useful, allowing us to connect trivially to the FreeBSD console over JTAG for FPGA-embedded hard and soft cores. As interrupts are optionally configured for this soft core, we support both interrupt-driven and polled modes of operation, which must be selected using device.hints. UART instances appear in /dev as ttyu0, ttyu1, etc. However, it also contains a number of quirks, which make it difficult to tell when JTAG is connected, and some buffering issues. We work around these as best we can, using various heuristics. While the majority of this device driver is not only not BERI-specific, but also not MIPS-specific, for now add its defines in the BERI files list, as the console-level parts are aware of where the first JTAG UART is mapped on Avalon, and contain MIPS-specific address translation, to use before Newbus and device.hints are available. Sponsored by: DARPA, AFRL Added: head/share/man/man4/altera_jtag_uart.4 (contents, props changed) head/sys/dev/altera/jtag_uart/ head/sys/dev/altera/jtag_uart/altera_jtag_uart.h (contents, props changed) head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c (contents, props changed) head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c (contents, props changed) head/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/mips/beri/files.beri Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Aug 25 11:19:20 2012 (r239675) +++ head/share/man/man4/Makefile Sat Aug 25 11:30:36 2012 (r239676) @@ -33,6 +33,7 @@ MAN= aac.4 \ ale.4 \ alpm.4 \ altera_avgen.4 \ + altera_jtag_uart.4 \ altera_sdcard.4 \ altq.4 \ amdpm.4 \ Added: head/share/man/man4/altera_jtag_uart.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/altera_jtag_uart.4 Sat Aug 25 11:30:36 2012 (r239676) @@ -0,0 +1,121 @@ +.\"- +.\" Copyright (c) 2012 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +.\" ("CTSRD"), as part of the DARPA CRASH research programme. +.\" +.\" 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 August 18, 2012 +.Dt ALTERA_JTAG_UART 4 +.Os +.Sh NAME +.Nm altera_jtag_uart +.Nd driver for the Altera JTAG UART Core +.Sh SYNOPSIS +.Cd "device altera_jtag_uart" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.altera_jtag_uart.0.at="nexus0" +.Cd hint.altera_jtag_uart.0.maddr=0x7f000000 +.Cd hint.altera_jtag_uart.0.msize=0x40 +.Cd hint.altera_jtag_uart.0.irq=0 +.Cd hint.altera_jtag_uart.1.at="nexus0" +.Cd hint.altera_jtag_uart.1.maddr=0x7f001000 +.Cd hint.altera_jtag_uart.1.msize=0x40 +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Altera JTAG UART core, which allows +multiple UART-like streams to be carried over JTAG. +.Nm +allows JTAG UART streams to be attached to both the low-level console +interface, used for direct kernel input and output, and the +.Xr tty 4 +layer, to be used with +.Xr ttys 5 +and +.Xr login 1 . +Sequential Altera JTAG UART devices will appear as +.Li ttyu0 , +.Li ttyu1 , +etc. +.Sh HARDWARE +Altera JTAG UART devices can be connected to using Altera's +.Pa nios2-terminal +program, with the instance selected using the +.Li --instance +argument on the management host. +.Nm +supports JTAG UART cores with or without interrupt lines connected; if the +.Li irq +portion of the +.Pa device.hints +entry is omitted, the driver will poll rather than configure interrupts. +.Sh SEE ALSO +.Xr login 1 , +.Xr tty 4 , +.Xr ttys 5 +.Rs +.%T Altera Embedded Peripherals IP User Guide +.%D June 2011 +.%I Altera Corporation +.%U http://www.altera.com/literature/ug/ug_embedded_ip.pdf +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were +developed by SRI International and the University of Cambridge Computer +Laboratory under DARPA/AFRL contract +.Pq FA8750-10-C-0237 +.Pq Do CTSRD Dc , +as part of the DARPA CRASH research programme. +This device driver was written by +.An Robert N. M. Watson . +.Sh BUGS +.Nm +must dynamically poll to detect when JTAG is present, in order to disable flow +control in the event that there is no receiving endpoint. +Otherwise, the boot may hang waiting for the JTAG client to be attached, and +user processes attached to JTAG UART devices might block indefinitely. +However, there is no way to flush the output buffer once JTAG is detected to +have disappeared; this means that a small amount of stale output data will +remain in the output buffer, being displayed by +.Li nios2-terminal +when it is connected. +Loss of JTAG will not generate a hang-up event, as that is rarely the desired +behaviour. +.Pp +.Li nios2-terminal +does not place the client-side TTY in raw mode, and so by default will not +pass all control characters through to the UART. Added: head/sys/dev/altera/jtag_uart/altera_jtag_uart.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart.h Sat Aug 25 11:30:36 2012 (r239676) @@ -0,0 +1,197 @@ +/*- + * Copyright (c) 2011-2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 _DEV_ALTERA_JTAG_UART_H_ +#define _DEV_ALTERA_JTAG_UART_H_ + +struct altera_jtag_uart_softc { + device_t ajus_dev; + int ajus_unit; + + /* + * Hardware resources. + */ + struct resource *ajus_irq_res; + int ajus_irq_rid; + void *ajus_irq_cookie; + struct resource *ajus_mem_res; + int ajus_mem_rid; + + /* + * TTY resources. + */ + struct tty *ajus_ttyp; + int ajus_alt_break_state; + + /* + * Driver resources. + */ + u_int ajus_flags; + struct mtx *ajus_lockp; + struct mtx ajus_lock; + struct callout ajus_io_callout; + struct callout ajus_ac_callout; + + /* + * One-character buffer required because it's not possible to peek at + * the input FIFO without reading it. + */ + int ajus_buffer_valid; + int *ajus_buffer_validp; + uint8_t ajus_buffer_data; + uint8_t *ajus_buffer_datap; + int ajus_jtag_present; + int *ajus_jtag_presentp; + u_int ajus_jtag_missed; + u_int *ajus_jtag_missedp; +}; + +#define AJU_TTYNAME "ttyu" + +/* + * Flag values for ajus_flags. + */ +#define ALTERA_JTAG_UART_FLAG_CONSOLE 0x00000001 /* Is console. */ + +/* + * Because tty-level use of the I/O ports completes with low-level console + * use, spinlocks must be employed here. + */ +#define AJU_CONSOLE_LOCK_INIT() do { \ + mtx_init(&aju_cons_lock, "aju_cons_lock", NULL, MTX_SPIN); \ +} while (0) + +#define AJU_CONSOLE_LOCK() do { \ + if (!kdb_active) \ + mtx_lock_spin(&aju_cons_lock); \ +} while (0) + +#define AJU_CONSOLE_LOCK_ASSERT() { \ + if (!kdb_active) \ + mtx_assert(&aju_cons_lock, MA_OWNED); \ +} while (0) + +#define AJU_CONSOLE_UNLOCK() do { \ + if (!kdb_active) \ + mtx_unlock_spin(&aju_cons_lock); \ +} while (0) + +#define AJU_LOCK_INIT(sc) do { \ + mtx_init(&(sc)->ajus_lock, "aju_lock", NULL, MTX_SPIN); \ +} while (0) + +#define AJU_LOCK_DESTROY(sc) do { \ + mtx_destroy(&(sc)->ajus_lock); \ +} while (0) + +#define AJU_LOCK(sc) do { \ + mtx_lock_spin((sc)->ajus_lockp); \ +} while (0) + +#define AJU_LOCK_ASSERT(sc) do { \ + mtx_assert((sc)->ajus_lockp, MA_OWNED); \ +} while (0) + +#define AJU_UNLOCK(sc) do { \ + mtx_unlock_spin((sc)->ajus_lockp); \ +} while (0) + +/* + * When a TTY-level Altera JTAG UART instance is also the low-level console, + * the TTY layer borrows the console-layer lock and buffer rather than using + * its own. + */ +extern struct mtx aju_cons_lock; +extern char aju_cons_buffer_data; +extern int aju_cons_buffer_valid; +extern int aju_cons_jtag_present; +extern u_int aju_cons_jtag_missed; + +/* + * Base physical address of the JTAG UART in BERI. + */ +#define BERI_UART_BASE 0x7f000000 /* JTAG UART */ + +/*- + * Routines for interacting with the BERI console JTAG UART. Programming + * details from the June 2011 "Embedded Peripherals User Guide" by Altera + * Corporation, tables 6-2 (JTAG UART Core Register Map), 6-3 (Data Register + * Bits), and 6-4 (Control Register Bits). + * + * Offsets of data and control registers relative to the base. Altera + * conventions are maintained in BERI. + */ +#define ALTERA_JTAG_UART_DATA_OFF 0x00000000 +#define ALTERA_JTAG_UART_CONTROL_OFF 0x00000004 + +/* + * Offset 0: 'data' register -- bits 31-16 (RAVAIL), 15 (RVALID), + * 14-8 (Reserved), 7-0 (DATA). + * + * DATA - One byte read or written. + * RAVAIL - Bytes available to read (excluding the current byte). + * RVALID - Whether the byte in DATA is valid. + */ +#define ALTERA_JTAG_UART_DATA_DATA 0x000000ff +#define ALTERA_JTAG_UART_DATA_RESERVED 0x00007f00 +#define ALTERA_JTAG_UART_DATA_RVALID 0x00008000 +#define ALTERA_JTAG_UART_DATA_RAVAIL 0xffff0000 +#define ALTERA_JTAG_UART_DATA_RAVAIL_SHIFT 16 + +/*- + * Offset 1: 'control' register -- bits 31-16 (WSPACE), 15-11 (Reserved), + * 10 (AC), 9 (WI), 8 (RI), 7..2 (Reserved), 1 (WE), 0 (RE). + * + * RE - Enable read interrupts. + * WE - Enable write interrupts. + * RI - Read interrupt pending. + * WI - Write interrupt pending. + * AC - Activity bit; set to '1' to clear to '0'. + * WSPACE - Space available in the write FIFO. + */ +#define ALTERA_JTAG_UART_CONTROL_RE 0x00000001 +#define ALTERA_JTAG_UART_CONTROL_WE 0x00000002 +#define ALTERA_JTAG_UART_CONTROL_RESERVED0 0x000000fc +#define ALTERA_JTAG_UART_CONTROL_RI 0x00000100 +#define ALTERA_JTAG_UART_CONTROL_WI 0x00000200 +#define ALTERA_JTAG_UART_CONTROL_AC 0x00000400 +#define ALTERA_JTAG_UART_CONTROL_RESERVED1 0x0000f800 +#define ALTERA_JTAG_UART_CONTROL_WSPACE 0xffff0000 +#define ALTERA_JTAG_UART_CONTROL_WSPACE_SHIFT 16 + +/* + * Driver attachment functions for Nexus. + */ +int altera_jtag_uart_attach(struct altera_jtag_uart_softc *sc); +void altera_jtag_uart_detach(struct altera_jtag_uart_softc *sc); + +#endif /* _DEV_ALTERA_JTAG_UART_H_ */ Added: head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c Sat Aug 25 11:30:36 2012 (r239676) @@ -0,0 +1,318 @@ +/*- + * Copyright (c) 2011-2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 + +/* + * One-byte buffer as we can't check whether the UART is readable without + * actually reading from it, synchronised by a spinlock; this lock also + * synchronises access to the I/O ports for non-atomic sequences. These + * symbols are public so that the TTY layer can use them when working on an + * instance of the UART that is also a low-level console. + */ +char aju_cons_buffer_data; +int aju_cons_buffer_valid; +int aju_cons_jtag_present; +u_int aju_cons_jtag_missed; +struct mtx aju_cons_lock; + +/* + * Low-level console driver functions. + */ +static cn_probe_t aju_cnprobe; +static cn_init_t aju_cninit; +static cn_term_t aju_cnterm; +static cn_getc_t aju_cngetc; +static cn_putc_t aju_cnputc; +static cn_grab_t aju_cngrab; +static cn_ungrab_t aju_cnungrab; + +/* + * JTAG sets the ALTERA_JTAG_UART_CONTROL_AC bit whenever it accesses the + * FIFO. This allows us to (sort of) tell when JTAG is present, so that we + * can adopt lossy, rather than blocking, behaviour when JTAG isn't there. + * When it is present, we do full flow control. This delay is how long we + * wait to see if JTAG has really disappeared when finding a full buffer and + * no AC bit set. + */ +#define ALTERA_JTAG_UART_AC_POLL_DELAY 10000 + +/* + * I/O routines lifted from Deimos. This is not only MIPS-specific, but also + * BERI-specific, as we're hard coding the the address at which we expect to + * find the Altera JTAG UART and using it unconditionally. We use these + * low-level routines so that we can perform console I/O long before newbus + * has initialised and devices have attached. The TTY layer of the driver + * knows about this, and uses the console-layer spinlock instead of the + * TTY-layer lock to avoid confusion between layers for the console UART. + * + * XXXRW: The only place this inter-layer behaviour breaks down is if the + * low-level console is used for polled read while the TTY driver is also + * looking for input. Probably we should also share buffers between layers. + */ +#define MIPS_XKPHYS_UNCACHED_BASE 0x9000000000000000 + +typedef uint64_t paddr_t; +typedef uint64_t vaddr_t; + +static inline vaddr_t +mips_phys_to_uncached(paddr_t phys) +{ + + return (phys | MIPS_XKPHYS_UNCACHED_BASE); +} + +static inline uint32_t +mips_ioread_uint32(vaddr_t vaddr) +{ + uint32_t v; + + __asm__ __volatile__ ("lw %0, 0(%1)" : "=r" (v) : "r" (vaddr)); + return (v); +} + +static inline void +mips_iowrite_uint32(vaddr_t vaddr, uint32_t v) +{ + + __asm__ __volatile__ ("sw %0, 0(%1)" : : "r" (v), "r" (vaddr)); +} + +/* + * Little-endian versions of 32-bit I/O routines. + */ +static inline uint32_t +mips_ioread_uint32le(vaddr_t vaddr) +{ + + return (le32toh(mips_ioread_uint32(vaddr))); +} + +static inline void +mips_iowrite_uint32le(vaddr_t vaddr, uint32_t v) +{ + + mips_iowrite_uint32(vaddr, htole32(v)); +} + +/* + * Low-level read and write register routines; the Altera UART is little + * endian, so we byte swap 32-bit reads and writes. + */ +static inline uint32_t +aju_cons_data_read(void) +{ + + return (mips_ioread_uint32le(mips_phys_to_uncached(BERI_UART_BASE + + ALTERA_JTAG_UART_DATA_OFF))); +} + +static inline void +aju_cons_data_write(uint32_t v) +{ + + mips_iowrite_uint32le(mips_phys_to_uncached(BERI_UART_BASE + + ALTERA_JTAG_UART_DATA_OFF), v); +} + +static inline uint32_t +aju_cons_control_read(void) +{ + + return (mips_ioread_uint32le(mips_phys_to_uncached(BERI_UART_BASE + + ALTERA_JTAG_UART_CONTROL_OFF))); +} + +static inline void +aju_cons_control_write(uint32_t v) +{ + + mips_iowrite_uint32le(mips_phys_to_uncached(BERI_UART_BASE + + ALTERA_JTAG_UART_CONTROL_OFF), v); +} + +/* + * Slightly higher-level routines aware of buffering and flow control. + */ +static int +aju_cons_readable(void) +{ + uint32_t v; + + AJU_CONSOLE_LOCK_ASSERT(); + + if (aju_cons_buffer_valid) + return (1); + v = aju_cons_data_read(); + if ((v & ALTERA_JTAG_UART_DATA_RVALID) != 0) { + aju_cons_buffer_valid = 1; + aju_cons_buffer_data = (v & ALTERA_JTAG_UART_DATA_DATA); + return (1); + } + return (0); +} + +static void +aju_cons_write(char ch) +{ + uint32_t v; + + AJU_CONSOLE_LOCK_ASSERT(); + + /* + * The flow control logic here is somewhat subtle: we want to wait for + * write buffer space only while JTAG is present. However, we can't + * directly ask if JTAG is present -- just whether it's been seen + * since we last cleared the ALTERA_JTAG_UART_CONTROL_AC bit. As + * such, implement a polling loop in which we both wait for space and + * try to decide whether JTAG has disappeared on us. We will have to + * wait one complete polling delay to detect that JTAG has gone away, + * but otherwise shouldn't wait any further once it has gone. And we + * had to wait for buffer space anyway, if it was there. + * + * If JTAG is spotted, reset the TTY-layer miss counter so console- + * layer clearing of the bit doesn't trigger a TTY-layer + * disconnection. + * + * XXXRW: The polling delay may require tuning. + */ + v = aju_cons_control_read(); + if (v & ALTERA_JTAG_UART_CONTROL_AC) { + aju_cons_jtag_present = 1; + aju_cons_jtag_missed = 0; + v &= ~ALTERA_JTAG_UART_CONTROL_AC; + aju_cons_control_write(v); + } + while ((v & ALTERA_JTAG_UART_CONTROL_WSPACE) == 0) { + if (!aju_cons_jtag_present) + return; + DELAY(ALTERA_JTAG_UART_AC_POLL_DELAY); + v = aju_cons_control_read(); + if (v & ALTERA_JTAG_UART_CONTROL_AC) { + aju_cons_jtag_present = 1; + v &= ~ALTERA_JTAG_UART_CONTROL_AC; + aju_cons_control_write(v); + } else + aju_cons_jtag_present = 0; + } + aju_cons_data_write(ch); +} + +static char +aju_cons_read(void) +{ + + AJU_CONSOLE_LOCK_ASSERT(); + + while (!aju_cons_readable()); + aju_cons_buffer_valid = 0; + return (aju_cons_buffer_data); +} + +/* + * Implementation of a FreeBSD low-level, polled console driver. + */ +static void +aju_cnprobe(struct consdev *cp) +{ + + sprintf(cp->cn_name, "%s%d", AJU_TTYNAME, 0); + cp->cn_pri = (boothowto & RB_SERIAL) ? CN_REMOTE : CN_NORMAL; +} + +static void +aju_cninit(struct consdev *cp) +{ + uint32_t v; + + AJU_CONSOLE_LOCK_INIT(); + + AJU_CONSOLE_LOCK(); + v = aju_cons_control_read(); + v &= ~ALTERA_JTAG_UART_CONTROL_AC; + aju_cons_control_write(v); + AJU_CONSOLE_UNLOCK(); +} + +static void +aju_cnterm(struct consdev *cp) +{ + +} + +static int +aju_cngetc(struct consdev *cp) +{ + int ret; + + AJU_CONSOLE_LOCK(); + ret = aju_cons_read(); + AJU_CONSOLE_UNLOCK(); + return (ret); +} + +static void +aju_cnputc(struct consdev *cp, int c) +{ + + AJU_CONSOLE_LOCK(); + aju_cons_write(c); + AJU_CONSOLE_UNLOCK(); +} + +static void +aju_cngrab(struct consdev *cp) +{ + +} + +static void +aju_cnungrab(struct consdev *cp) +{ + +} + +CONSOLE_DRIVER(aju); Added: head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c Sat Aug 25 11:30:36 2012 (r239676) @@ -0,0 +1,143 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 + +#include + +#include + +/* + * Nexus bus attachment for Altera JTAG UARTs. Appropriate for most Altera + * FPGA SoC-style configurations in which the IP core will be exposed to the + * processor via a memory-mapped Avalon bus. + */ +static int +altera_jtag_uart_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Altera JTAG UART"); + return (BUS_PROBE_DEFAULT); +} + +static int +altera_jtag_uart_nexus_attach(device_t dev) +{ + struct altera_jtag_uart_softc *sc; + int error; + + error = 0; + sc = device_get_softc(dev); + sc->ajus_dev = dev; + sc->ajus_unit = device_get_unit(dev); + sc->ajus_mem_rid = 0; + sc->ajus_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->ajus_mem_rid, RF_ACTIVE); + if (sc->ajus_mem_res == NULL) { + device_printf(dev, "couldn't map memory\n"); + error = ENXIO; + goto out; + } + + /* + * Interrupt support is optional -- if we can't allocate an IRQ, then + * we fall back on polling. + */ + sc->ajus_irq_rid = 0; + sc->ajus_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->ajus_irq_rid, RF_ACTIVE | RF_SHAREABLE); + if (sc->ajus_irq_res == NULL) + device_printf(dev, + "IRQ unavailable; selecting polled operation\n"); + error = altera_jtag_uart_attach(sc); +out: + if (error) { + if (sc->ajus_irq_res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, + sc->ajus_irq_rid, sc->ajus_irq_res); + if (sc->ajus_mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, + sc->ajus_mem_rid, sc->ajus_mem_res); + } + return (error); +} + +static int +altera_jtag_uart_nexus_detach(device_t dev) +{ + struct altera_jtag_uart_softc *sc; + + sc = device_get_softc(dev); + KASSERT(sc->ajus_mem_res != NULL, ("%s: resources not allocated", + __func__)); + + altera_jtag_uart_detach(sc); + bus_release_resource(dev, SYS_RES_IRQ, sc->ajus_irq_rid, + sc->ajus_irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, sc->ajus_mem_rid, + sc->ajus_mem_res); + return (0); +} + +static device_method_t altera_jtag_uart_nexus_methods[] = { + DEVMETHOD(device_probe, altera_jtag_uart_nexus_probe), + DEVMETHOD(device_attach, altera_jtag_uart_nexus_attach), + DEVMETHOD(device_detach, altera_jtag_uart_nexus_detach), + { 0, 0 } +}; + +static driver_t altera_jtag_uart_nexus_driver = { + "altera_jtag_uart", + altera_jtag_uart_nexus_methods, + sizeof(struct altera_jtag_uart_softc), +}; + +static devclass_t altera_jtag_uart_devclass; + +DRIVER_MODULE(altera_jtag_uart, nexus, altera_jtag_uart_nexus_driver, + altera_jtag_uart_devclass, 0, 0); Added: head/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c Sat Aug 25 11:30:36 2012 (r239676) @@ -0,0 +1,474 @@ +/*- + * Copyright (c) 2011-2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 + +/* + * If one of the Altera JTAG UARTs is currently the system console, register + * it here. + */ +static struct altera_jtag_uart_softc *aju_cons_sc; + +static tsw_outwakeup_t aju_outwakeup; +static void aju_ac_callout(void *); +static void aju_io_callout(void *); + +static struct ttydevsw aju_ttydevsw = { + .tsw_flags = TF_NOPREFIX, + .tsw_outwakeup = aju_outwakeup, +}; + +/* + * When polling for the AC bit, the number of times we have to not see it + * before assuming JTAG has disappeared on us. By default, one second. + */ +#define AJU_JTAG_MAXMISS 5 + +/* + * Polling intervals for input/output and JTAG connection events. + */ +#define AJU_IO_POLLINTERVAL (hz/100) +#define AJU_AC_POLLINTERVAL (hz/5) + +/* + * Low-level read and write register routines; the Altera UART is little + * endian, so we byte swap 32-bit reads and writes. + */ +static inline uint32_t +aju_data_read(struct altera_jtag_uart_softc *sc) +{ + + return (le32toh(bus_read_4(sc->ajus_mem_res, + ALTERA_JTAG_UART_DATA_OFF))); +} + +static inline void +aju_data_write(struct altera_jtag_uart_softc *sc, uint32_t v) +{ + + bus_write_4(sc->ajus_mem_res, ALTERA_JTAG_UART_DATA_OFF, htole32(v)); +} + +static inline uint32_t +aju_control_read(struct altera_jtag_uart_softc *sc) +{ + + return (le32toh(bus_read_4(sc->ajus_mem_res, + ALTERA_JTAG_UART_CONTROL_OFF))); +} + +static inline void +aju_control_write(struct altera_jtag_uart_softc *sc, uint32_t v) +{ + + bus_write_4(sc->ajus_mem_res, ALTERA_JTAG_UART_CONTROL_OFF, + htole32(v)); +} + +/* + * Slightly higher-level routines aware of buffering and flow control. + */ +static inline int +aju_writable(struct altera_jtag_uart_softc *sc) +{ + + return ((aju_control_read(sc) & + ALTERA_JTAG_UART_CONTROL_WSPACE) != 0); +} + +static inline int +aju_readable(struct altera_jtag_uart_softc *sc) +{ + uint32_t v; + + AJU_LOCK_ASSERT(sc); + + if (*sc->ajus_buffer_validp) + return (1); + v = aju_data_read(sc); + if ((v & ALTERA_JTAG_UART_DATA_RVALID) != 0) { + *sc->ajus_buffer_validp = 1; + *sc->ajus_buffer_datap = (v & ALTERA_JTAG_UART_DATA_DATA); + return (1); + } + return (0); +} + +static char +aju_read(struct altera_jtag_uart_softc *sc) +{ + + AJU_LOCK_ASSERT(sc); + + while (!aju_readable(sc)); + *sc->ajus_buffer_validp = 0; + return (*sc->ajus_buffer_datap); +} + +/* + * Routines for enabling and disabling interrupts for read and write. + */ +static void +aju_intr_readable_enable(struct altera_jtag_uart_softc *sc) +{ + uint32_t v; + + AJU_LOCK_ASSERT(sc); + + v = aju_control_read(sc); + v |= ALTERA_JTAG_UART_CONTROL_RE; + aju_control_write(sc, v); +} + +static void +aju_intr_writable_enable(struct altera_jtag_uart_softc *sc) +{ + uint32_t v; + + AJU_LOCK_ASSERT(sc); + + v = aju_control_read(sc); + v |= ALTERA_JTAG_UART_CONTROL_WE; + aju_control_write(sc, v); +} + +static void +aju_intr_writable_disable(struct altera_jtag_uart_softc *sc) +{ + uint32_t v; + + AJU_LOCK_ASSERT(sc); + + v = aju_control_read(sc); + v &= ~ALTERA_JTAG_UART_CONTROL_WE; + aju_control_write(sc, v); +} + +static void +aju_intr_disable(struct altera_jtag_uart_softc *sc) +{ + uint32_t v; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 11:34: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 C4247106564A; Sat, 25 Aug 2012 11:34:55 +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 AFB578FC08; Sat, 25 Aug 2012 11:34: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 q7PBYtmU031549; Sat, 25 Aug 2012 11:34:55 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PBYtLk031547; Sat, 25 Aug 2012 11:34:55 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201208251134.q7PBYtLk031547@svn.freebsd.org> From: Joel Dahl Date: Sat, 25 Aug 2012 11:34: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: r239677 - 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, 25 Aug 2012 11:34:55 -0000 Author: joel (doc committer) Date: Sat Aug 25 11:34:55 2012 New Revision: 239677 URL: http://svn.freebsd.org/changeset/base/239677 Log: Minor mdoc fix. Modified: head/share/man/man4/altera_avgen.4 Modified: head/share/man/man4/altera_avgen.4 ============================================================================== --- head/share/man/man4/altera_avgen.4 Sat Aug 25 11:30:36 2012 (r239676) +++ head/share/man/man4/altera_avgen.4 Sat Aug 25 11:34:55 2012 (r239677) @@ -79,7 +79,7 @@ device instances: .It maddr base physical address of the memory region to export; must be aligned to .Li width -.Ot msize +.It msize length of the memory region export; must be aligned to .Li width .It width From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 12:02: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 79E0B1065670; Sat, 25 Aug 2012 12:02:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6440C8FC17; Sat, 25 Aug 2012 12:02: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 q7PC2E1T034677; Sat, 25 Aug 2012 12:02:14 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PC2EL6034670; Sat, 25 Aug 2012 12:02:14 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208251202.q7PC2EL6034670@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 12:02: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: r239679 - head/sys/mips/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: Sat, 25 Aug 2012 12:02:14 -0000 Author: rwatson Date: Sat Aug 25 12:02:13 2012 New Revision: 239679 URL: http://svn.freebsd.org/changeset/base/239679 Log: Add reference kernel configurations for FreeBSD/beri in simulation, on the Terasic DE-4, and Terasic tPad Altera-based boards. Sponsored by: DARPA, AFRL Added: head/sys/mips/conf/BERI_DE4.hints (contents, props changed) head/sys/mips/conf/BERI_DE4_MDROOT (contents, props changed) head/sys/mips/conf/BERI_DE4_SDROOT (contents, props changed) head/sys/mips/conf/BERI_SIM.hints (contents, props changed) head/sys/mips/conf/BERI_SIM_MDROOT (contents, props changed) head/sys/mips/conf/BERI_TEMPLATE (contents, props changed) head/sys/mips/conf/BERI_TPAD.hints (contents, props changed) Added: head/sys/mips/conf/BERI_DE4.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_DE4.hints Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,72 @@ +# $FreeBSD$ + +# +# Altera JTAG UARTs configured for console, debugging, and data putput on the +# Terasic DE-4. +# +hint.altera_jtag_uart.0.at="nexus0" +hint.altera_jtag_uart.0.maddr=0x7f000000 +hint.altera_jtag_uart.0.msize=0x40 +hint.altera_jtag_uart.0.irq=0 + +hint.altera_jtag_uart.1.at="nexus0" +hint.altera_jtag_uart.1.maddr=0x7f001000 +hint.altera_jtag_uart.1.msize=0x40 + +hint.altera_jtag_uart.2.at="nexus0" +hint.altera_jtag_uart.2.maddr=0x7f002000 +hint.altera_jtag_uart.2.msize=0x40 + +# +# On-board DE4 and tPad SD Card IP core +# +hint.altera_sdcardc.0.at="nexus0" +hint.altera_sdcardc.0.maddr=0x7f008000 +hint.altera_sdcardc.0.msize=0x400 + +# +# BERI Hardware Version ROM +# +hint.altera_avgen.0.at="nexus0" +hint.altera_avgen.0.maddr=0x7F00A000 +hint.altera_avgen.0.msize=20 +hint.altera_avgen.0.width=4 +hint.altera_avgen.0.fileio="rw" +hint.altera_avgen.0.devname="berirom" + +# +# Expose the DE4 flash via an Avalon "generic" device. +# This is incompatible with the isf(4) driver. +# +#hint.altera_avgen.0.at="nexus0" +#hint.altera_avgen.0.maddr=0x74000000 +#hint.altera_avgen.0.msize=0x4000000 +#hint.altera_avgen.0.width=2 +#hint.altera_avgen.0.fileio="rw" +#hint.altera_avgen.0.mmapio="rwx" +#hint.altera_avgen.0.devname="de4flash" + +# Reserved configuration blocks. Don't touch. +hint.map.0.at="isf0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x00020000 +hint.map.0.name="config" +hint.map.0.readonly=1 + +# Hardwired location of bitfile +hint.map.1.at="isf0" +hint.map.1.start=0x00020000 +hint.map.1.end=0x01820000 +hint.map.1.name="fpga" + +# Kernel on first chip +hint.map.2.at="isf0" +hint.map.2.start=0x01820000 +hint.map.2.end=0x02000000 +hint.map.2.name="reserved" + +# The second chip +hint.map.3.at="isf1" +hint.map.3.start=0x00000000 +hint.map.3.end=0x02000000 +hint.map.3.name="kernel" Added: head/sys/mips/conf/BERI_DE4_MDROOT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_DE4_MDROOT Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,28 @@ +# +# BERI_DE4 -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC +# Implementation) FPGA soft core, as configured in its Terasic DE-4 reference +# configuration. +# +# $FreeBSD$ +# + +include "BERI_TEMPLATE" + +ident BERI_DE4_MDROOT + +hints "BERI_DE4.hints" #Default places to look for devices. + +# +# This kernel configuration uses an embedded 8MB memory root file system. +# Adjust the following path based on local requirements. +# +options MD_ROOT # MD is a potential root device +options MD_ROOT_SIZE=8192 +makeoptions MFS_IMAGE=/local/scratch/rnw24/mdroot.img +options ROOTDEVNAME=\"ufs:md0\" + +device altera_avgen +device altera_jtag_uart +device altera_sdcard + +device sc Added: head/sys/mips/conf/BERI_DE4_SDROOT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_DE4_SDROOT Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,21 @@ +# +# BERI_DE4 -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC +# Implementation) FPGA soft core, as configured in its Terasic DE-4 reference +# configuration. +# +# $FreeBSD$ +# + +include "BERI_TEMPLATE" + +ident BERI_DE4_SDROOT + +hints "BERI_DE4.hints" #Default places to look for devices. + +options ROOTDEVNAME=\"ufs:altera_sdcard0\" + +device altera_avgen +device altera_jtag_uart +device altera_sdcard + +device sc Added: head/sys/mips/conf/BERI_SIM.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_SIM.hints Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +# +# Altera JTAG UARTs configured for console, debugging, and data putput on the +# BERI simulator. +# +hint.altera_jtag_uart.0.at="nexus0" +hint.altera_jtag_uart.0.maddr=0x7f000000 +hint.altera_jtag_uart.0.msize=0x40 +hint.altera_jtag_uart.0.irq=0 + +hint.altera_jtag_uart.1.at="nexus0" +hint.altera_jtag_uart.1.maddr=0x7f001000 +hint.altera_jtag_uart.1.msize=0x40 + +hint.altera_jtag_uart.2.at="nexus0" +hint.altera_jtag_uart.2.maddr=0x7f002000 +hint.altera_jtag_uart.2.msize=0x40 + +# +# On-board DE4 and tPad SD Card IP core -- also present in Bluespec +# simulation. +# +hint.altera_sdcardc.0.at="nexus0" +hint.altera_sdcardc.0.maddr=0x7f008000 +hint.altera_sdcardc.0.msize=0x400 Added: head/sys/mips/conf/BERI_SIM_MDROOT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_SIM_MDROOT Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,25 @@ +# +# BERI_SIM -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC +# Implementation) FPGA soft core, as configured for simulation. +# +# $FreeBSD$ +# + +include "BERI_TEMPLATE" + +ident BERI_SIM_MDROOT + +hints "BERI_SIM.hints" #Default places to look for devices. + +# +# This kernel configuration uses an embedded 8MB memory root file system. +# Adjust the following path based on local requirements. +# +options MD_ROOT # MD is a potential root device +options MD_ROOT_SIZE=8192 +makeoptions MFS_IMAGE=/local/scratch/rnw24/mdroot.img +options ROOTDEVNAME=\"ufs:md0\" + +device altera_avgen +device altera_jtag_uart +device altera_sdcard Added: head/sys/mips/conf/BERI_TEMPLATE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_TEMPLATE Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,58 @@ +# +# BERI_TEMPLATE -- a template kernel configuration for the SRI/Cambridge +# "BERI" (Bluespec Extensible RISC Implementation) FPGA soft core CPU. This +# kernel configuration file will be included by other board-specific files, +# and so contains only BERI features common across all board targets. +# +# $FreeBSD$ +# + +ident BERI_TEMPLATE + +machine mips mips64 + +cpu CPU_BERI + +options HZ=200 + +makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" + +makeoptions KERNLOADADDR=0xffffffff80100000 + +include "../beri/std.beri" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols + +makeoptions MODULES_OVERRIDE="" + +options DDB +options KDB +options ALT_BREAK_TO_DEBUGGER +options KTRACE + +options CAPABILITY_MODE +options CAPABILITIES + +options SCHED_ULE + +options FFS #Berkeley Fast Filesystem + +options INET +options INET6 +options NFSCL +options NFS_ROOT + +# Debugging for use in -current +#options DEADLKRES #Enable the deadlock resolver +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed + +device geom_map + +device md +device ether +device loop +device random +device snp Added: head/sys/mips/conf/BERI_TPAD.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_TPAD.hints Sat Aug 25 12:02:13 2012 (r239679) @@ -0,0 +1,51 @@ +# $FreeBSD$ + +# +# Altera JTAG UARTs configured for console, debugging, and data putput on the +# Terasic tPad. +# +hint.altera_jtag_uart.0.at="nexus0" +hint.altera_jtag_uart.0.maddr=0x7f000000 +hint.altera_jtag_uart.0.msize=0x40 +hint.altera_jtag_uart.0.irq=0 + +hint.altera_jtag_uart.1.at="nexus0" +hint.altera_jtag_uart.1.maddr=0x7f001000 +hint.altera_jtag_uart.1.msize=0x40 + +hint.altera_jtag_uart.2.at="nexus0" +hint.altera_jtag_uart.2.maddr=0x7f002000 +hint.altera_jtag_uart.2.msize=0x40 + +# +# Expose the tPad touchscreen device via an Avalon "generic" device. Observe +# that this is a portion of DRAM, so some care may be required in how memory +# is exposed to FreeBSD to avoid use of that DRAM for both the touch screen +# and FreeBSD use. +# +# Two separate devices are used here because alignment/width requirements for +# I/O differ: the frame buffer accepts 16-bit I/O, and the touch input device +# requires 32-bit I/O. +# +hint.altera_avgen.0.at="nexus0" +hint.altera_avgen.0.maddr=0x04000000 +hint.altera_avgen.0.msize=0x01000000 +hint.altera_avgen.0.width=2 +hint.altera_avgen.0.fileio="rw" +hint.altera_avgen.0.mmapio="rw" +hint.altera_avgen.0.devname="display" + +hint.altera_avgen.1.at="nexus0" +hint.altera_avgen.1.maddr=0x05000000 +hint.altera_avgen.1.msize=0x00000020 +hint.altera_avgen.1.width=4 +hint.altera_avgen.1.fileio="rw" +hint.altera_avgen.1.mmapio="rw" +hint.altera_avgen.1.devname="touch" + +# +# On-board DE4 and tPad SD Card IP core +# +hint.altera_sdcardc.0.at="nexus0" +hint.altera_sdcardc.0.maddr=0x7f008000 +hint.altera_sdcardc.0.msize=0x400 From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 13:15: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 89AFE106564A; Sat, 25 Aug 2012 13:15:45 +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 74BA98FC15; Sat, 25 Aug 2012 13:15: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 q7PDFjxu042497; Sat, 25 Aug 2012 13:15:45 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PDFj25042495; Sat, 25 Aug 2012 13:15:45 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208251315.q7PDFj25042495@svn.freebsd.org> From: Dimitry Andric Date: Sat, 25 Aug 2012 13:15: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: r239680 - 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: Sat, 25 Aug 2012 13:15:45 -0000 Author: dim Date: Sat Aug 25 13:15:44 2012 New Revision: 239680 URL: http://svn.freebsd.org/changeset/base/239680 Log: Add libcxxrt's objects (prefixing them with cxxrt_ to avoid collisions) to libc++.a and libc++_p.a, to make static linking of C++ executables with libc++ easier. This is similar to the approach used in libstdc++. MFC after: 2 weeks Modified: head/lib/libc++/Makefile Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Sat Aug 25 12:02:13 2012 (r239679) +++ head/lib/libc++/Makefile Sat Aug 25 13:15:44 2012 (r239680) @@ -35,8 +35,25 @@ SRCS+= algorithm.cpp\ utility.cpp\ valarray.cpp +CXXRT_SRCS+= libelftc_dem_gnu3.c\ + terminate.cc\ + dynamic_cast.cc\ + memory.cc\ + auxhelper.cc\ + exception.cc\ + stdexcept.cc\ + typeinfo.cc\ + guard.cc + +.for _S in ${CXXRT_SRCS} +STATICOBJS+= cxxrt_${_S:R}.o +cxxrt_${_S}: + ln -sf ${LIBCXXRTDIR}/${_S} ${.TARGET} +.endfor + WARNS= 0 -CXXFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -std=c++0x -nostdlib -DLIBCXXRT +CFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -nostdlib -DLIBCXXRT +CXXFLAGS+= -std=c++0x DPADD= ${LIBCXXRT} LDADD= -lcxxrt From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 16:55: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 8E240106567B; Sat, 25 Aug 2012 16:55:39 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 794EC8FC19; Sat, 25 Aug 2012 16:55: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 q7PGtdTE067303; Sat, 25 Aug 2012 16:55:39 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PGtdn4067300; Sat, 25 Aug 2012 16:55:39 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201208251655.q7PGtdn4067300@svn.freebsd.org> From: Alan Cox Date: Sat, 25 Aug 2012 16:55: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: r239681 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 16:55:39 -0000 Author: alc Date: Sat Aug 25 16:55:38 2012 New Revision: 239681 URL: http://svn.freebsd.org/changeset/base/239681 Log: Retire PV_TABLE_MOD. When we destroy or write protect a dirty mapping, we call vm_page_dirty(). Maintaining the PV_TABLE_MOD flag, in addition, serves no useful purpose. Modified: head/sys/mips/include/pmap.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Sat Aug 25 13:15:44 2012 (r239680) +++ head/sys/mips/include/pmap.h Sat Aug 25 16:55:38 2012 (r239681) @@ -73,7 +73,6 @@ struct md_page { TAILQ_HEAD(, pv_entry) pv_list; }; -#define PV_TABLE_MOD 0x01 /* modified */ #define PV_TABLE_REF 0x02 /* referenced */ #define ASID_BITS 8 Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Aug 25 13:15:44 2012 (r239680) +++ head/sys/mips/mips/pmap.c Sat Aug 25 16:55:38 2012 (r239681) @@ -195,7 +195,7 @@ static int _pmap_unwire_pte_hold(pmap_t static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); static vm_page_t _pmap_allocpte(pmap_t pmap, unsigned ptepindex, int flags); static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t); -static pt_entry_t init_pte_prot(vm_page_t m, vm_prot_t prot); +static pt_entry_t init_pte_prot(vm_page_t m, vm_prot_t access, vm_prot_t prot); #ifdef SMP static void pmap_invalidate_page_action(void *arg); @@ -1431,12 +1431,10 @@ pmap_pv_reclaim(pmap_t locked_pmap) vm_page_dirty(m); if (m->md.pv_flags & PV_TABLE_REF) vm_page_aflag_set(m, PGA_REFERENCED); + m->md.pv_flags &= ~PV_TABLE_REF; TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); - if (TAILQ_EMPTY(&m->md.pv_list)) { + if (TAILQ_EMPTY(&m->md.pv_list)) vm_page_aflag_clear(m, PGA_WRITEABLE); - m->md.pv_flags &= ~(PV_TABLE_REF | - PV_TABLE_MOD); - } pc->pc_map[field] |= 1UL << bit; pmap_unuse_pt(pmap, va, *pde); freed++; @@ -1705,7 +1703,7 @@ pmap_remove_pte(struct pmap *pmap, pt_en } if (m->md.pv_flags & PV_TABLE_REF) vm_page_aflag_set(m, PGA_REFERENCED); - m->md.pv_flags &= ~(PV_TABLE_REF | PV_TABLE_MOD); + m->md.pv_flags &= ~PV_TABLE_REF; pmap_remove_entry(pmap, m, va); } @@ -1877,7 +1875,7 @@ pmap_remove_all(vm_page_t m) } vm_page_aflag_clear(m, PGA_WRITEABLE); - m->md.pv_flags &= ~(PV_TABLE_REF | PV_TABLE_MOD); + m->md.pv_flags &= ~PV_TABLE_REF; rw_wunlock(&pvh_global_lock); } @@ -1936,7 +1934,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sv if (page_is_managed(pa) && pte_test(&pbits, PTE_D)) { m = PHYS_TO_VM_PAGE(pa); vm_page_dirty(m); - m->md.pv_flags &= ~PV_TABLE_MOD; } pte_clear(&pbits, PTE_D); pte_set(&pbits, PTE_RO); @@ -2082,8 +2079,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, validate: if ((access & VM_PROT_WRITE) != 0) - m->md.pv_flags |= PV_TABLE_MOD | PV_TABLE_REF; - rw = init_pte_prot(m, prot); + m->md.pv_flags |= PV_TABLE_REF; + rw = init_pte_prot(m, access, prot); #ifdef PMAP_DEBUG printf("pmap_enter: va: %p -> pa: %p\n", (void *)va, (void *)pa); @@ -2114,8 +2111,7 @@ validate: if (page_is_managed(opa) && (opa != pa)) { if (om->md.pv_flags & PV_TABLE_REF) vm_page_aflag_set(om, PGA_REFERENCED); - om->md.pv_flags &= - ~(PV_TABLE_REF | PV_TABLE_MOD); + om->md.pv_flags &= ~PV_TABLE_REF; } if (pte_test(&origpte, PTE_D)) { KASSERT(!pte_test(&origpte, PTE_RO), @@ -2751,7 +2747,6 @@ pmap_remove_write(vm_page_t m) if (pte_test(&pbits, PTE_D)) { pte_clear(&pbits, PTE_D); vm_page_dirty(m); - m->md.pv_flags &= ~PV_TABLE_MOD; } pte_set(&pbits, PTE_RO); if (pbits != *pte) { @@ -2808,10 +2803,7 @@ pmap_is_modified(vm_page_t m) (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); rw_wlock(&pvh_global_lock); - if (m->md.pv_flags & PV_TABLE_MOD) - rv = TRUE; - else - rv = pmap_testbit(m, PTE_D); + rv = pmap_testbit(m, PTE_D); rw_wunlock(&pvh_global_lock); return (rv); } @@ -2876,7 +2868,6 @@ pmap_clear_modify(vm_page_t m) } PMAP_UNLOCK(pmap); } - m->md.pv_flags &= ~PV_TABLE_MOD; rw_wunlock(&pvh_global_lock); } @@ -3259,14 +3250,14 @@ page_is_managed(vm_paddr_t pa) } static pt_entry_t -init_pte_prot(vm_page_t m, vm_prot_t prot) +init_pte_prot(vm_page_t m, vm_prot_t access, vm_prot_t prot) { pt_entry_t rw; if (!(prot & VM_PROT_WRITE)) rw = PTE_V | PTE_RO; else if ((m->oflags & VPO_UNMANAGED) == 0) { - if ((m->md.pv_flags & PV_TABLE_MOD) != 0) + if ((access & VM_PROT_WRITE) != 0) rw = PTE_V | PTE_D; else rw = PTE_V; @@ -3318,7 +3309,7 @@ pmap_emulate_modified(pmap_t pmap, vm_of if (!page_is_managed(pa)) panic("pmap_emulate_modified: unmanaged page"); m = PHYS_TO_VM_PAGE(pa); - m->md.pv_flags |= (PV_TABLE_REF | PV_TABLE_MOD); + m->md.pv_flags |= PV_TABLE_REF; PMAP_UNLOCK(pmap); return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 17:15: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 64B9D106564A; Sat, 25 Aug 2012 17:15:34 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50ABA8FC0C; Sat, 25 Aug 2012 17:15: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 q7PHFYee070343; Sat, 25 Aug 2012 17:15:34 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PHFYfK070341; Sat, 25 Aug 2012 17:15:34 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201208251715.q7PHFYfK070341@svn.freebsd.org> From: Rui Paulo Date: Sat, 25 Aug 2012 17:15: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: r239682 - 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: Sat, 25 Aug 2012 17:15:34 -0000 Author: rpaulo Date: Sat Aug 25 17:15:33 2012 New Revision: 239682 URL: http://svn.freebsd.org/changeset/base/239682 Log: Unbreak tinderbox. Modified: head/sys/powerpc/aim/machdep.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sat Aug 25 16:55:38 2012 (r239681) +++ head/sys/powerpc/aim/machdep.c Sat Aug 25 17:15:33 2012 (r239682) @@ -258,7 +258,10 @@ powerpc_init(vm_offset_t startkernel, vm size_t trap_offset; void *kmdp; char *env; - register_t msr, scratch, vers; + register_t msr, scratch; +#ifdef WII + register_t vers; +#endif uint8_t *cache_check; int cacheline_warn; #ifndef __powerpc64__ From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 17:34: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 C91E0106566C; Sat, 25 Aug 2012 17:34:49 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B53398FC12; Sat, 25 Aug 2012 17:34: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 q7PHYn9C072732; Sat, 25 Aug 2012 17:34:49 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PHYnNF072729; Sat, 25 Aug 2012 17:34:49 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201208251734.q7PHYnNF072729@svn.freebsd.org> From: Brooks Davis Date: Sat, 25 Aug 2012 17:34: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: r239683 - head/sys/mips/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: Sat, 25 Aug 2012 17:34:49 -0000 Author: brooks Date: Sat Aug 25 17:34:48 2012 New Revision: 239683 URL: http://svn.freebsd.org/changeset/base/239683 Log: Don't include syscons in the config just yet. We haven't imported the touchscreen driver yet. Modified: head/sys/mips/conf/BERI_DE4_MDROOT head/sys/mips/conf/BERI_DE4_SDROOT Modified: head/sys/mips/conf/BERI_DE4_MDROOT ============================================================================== --- head/sys/mips/conf/BERI_DE4_MDROOT Sat Aug 25 17:15:33 2012 (r239682) +++ head/sys/mips/conf/BERI_DE4_MDROOT Sat Aug 25 17:34:48 2012 (r239683) @@ -25,4 +25,4 @@ device altera_avgen device altera_jtag_uart device altera_sdcard -device sc +#device sc Modified: head/sys/mips/conf/BERI_DE4_SDROOT ============================================================================== --- head/sys/mips/conf/BERI_DE4_SDROOT Sat Aug 25 17:15:33 2012 (r239682) +++ head/sys/mips/conf/BERI_DE4_SDROOT Sat Aug 25 17:34:48 2012 (r239683) @@ -18,4 +18,4 @@ device altera_avgen device altera_jtag_uart device altera_sdcard -device sc +#device sc From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 17:57: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 56476106564A; Sat, 25 Aug 2012 17:57:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2842B8FC12; Sat, 25 Aug 2012 17:57: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 q7PHvpF2075317; Sat, 25 Aug 2012 17:57:51 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PHvoJg075316; Sat, 25 Aug 2012 17:57:50 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208251757.q7PHvoJg075316@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 17:57: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: r239684 - head/sys/mips/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, 25 Aug 2012 17:57:51 -0000 Author: rwatson Date: Sat Aug 25 17:57:50 2012 New Revision: 239684 URL: http://svn.freebsd.org/changeset/base/239684 Log: Add MD syscons header file for MIPS. Sponsored by: DARPA, AFRL Added: head/sys/mips/include/sc_machdep.h (contents, props changed) Added: head/sys/mips/include/sc_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/include/sc_machdep.h Sat Aug 25 17:57:50 2012 (r239684) @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 2003 Jake Burkholder. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_SC_MACHDEP_H_ +#define _MACHINE_SC_MACHDEP_H_ + +/* Color attributes for foreground text */ + +#define FG_BLACK 0x0 +#define FG_BLUE 0x1 +#define FG_GREEN 0x2 +#define FG_CYAN 0x3 +#define FG_RED 0x4 +#define FG_MAGENTA 0x5 +#define FG_BROWN 0x6 +#define FG_LIGHTGREY 0x7 /* aka white */ +#define FG_DARKGREY 0x8 +#define FG_LIGHTBLUE 0x9 +#define FG_LIGHTGREEN 0xa +#define FG_LIGHTCYAN 0xb +#define FG_LIGHTRED 0xc +#define FG_LIGHTMAGENTA 0xd +#define FG_YELLOW 0xe +#define FG_WHITE 0xf /* aka bright white */ +#define FG_BLINK 0x80 + +/* Color attributes for text background */ + +#define BG_BLACK 0x00 +#define BG_BLUE 0x10 +#define BG_GREEN 0x20 +#define BG_CYAN 0x30 +#define BG_RED 0x40 +#define BG_MAGENTA 0x50 +#define BG_BROWN 0x60 +#define BG_LIGHTGREY 0x70 +#define BG_DARKGREY 0x80 +#define BG_LIGHTBLUE 0x90 +#define BG_LIGHTGREEN 0xa0 +#define BG_LIGHTCYAN 0xb0 +#define BG_LIGHTRED 0xc0 +#define BG_LIGHTMAGENTA 0xd0 +#define BG_YELLOW 0xe0 +#define BG_WHITE 0xf0 + +#endif /* !_MACHINE_SC_MACHDEP_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 18:08: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 9DFDE1065673; Sat, 25 Aug 2012 18:08:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86FE68FC18; Sat, 25 Aug 2012 18:08: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 q7PI8LUW076584; Sat, 25 Aug 2012 18:08:21 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PI8LXK076576; Sat, 25 Aug 2012 18:08:21 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201208251808.q7PI8LXK076576@svn.freebsd.org> From: Brooks Davis Date: Sat, 25 Aug 2012 18:08: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: r239685 - in head: share/man/man4 sys/conf sys/dev/isf sys/mips/conf usr.sbin usr.sbin/isfctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 18:08:21 -0000 Author: brooks Date: Sat Aug 25 18:08:20 2012 New Revision: 239685 URL: http://svn.freebsd.org/changeset/base/239685 Log: Add isf(4), a driver for the Intel StrataFlash family of NOR flash parts. The driver attempts to support all documented parts, but has only been tested with the 512Mbit part on the Terasic DE4 FPGA board. It should be trivial to adapt the driver's attach routine to other embedded boards using with any parts in the family. Also import isfctl(8) which can be used to erase sections of the flash. Sponsored by: DARPA, AFRL Added: head/share/man/man4/isf.4 (contents, props changed) head/sys/dev/isf/ head/sys/dev/isf/isf.c (contents, props changed) head/sys/dev/isf/isf.h (contents, props changed) head/sys/dev/isf/isf_nexus.c (contents, props changed) head/usr.sbin/isfctl/ head/usr.sbin/isfctl/Makefile (contents, props changed) head/usr.sbin/isfctl/isfctl.8 (contents, props changed) head/usr.sbin/isfctl/isfctl.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files head/sys/mips/conf/BERI_DE4.hints head/sys/mips/conf/BERI_DE4_MDROOT head/sys/mips/conf/BERI_DE4_SDROOT head/usr.sbin/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Aug 25 17:57:50 2012 (r239684) +++ head/share/man/man4/Makefile Sat Aug 25 18:08:20 2012 (r239685) @@ -192,6 +192,7 @@ MAN= aac.4 \ ipwfw.4 \ isci.4 \ iscsi_initiator.4 \ + isf.4 \ isp.4 \ ispfw.4 \ iwi.4 \ Added: head/share/man/man4/isf.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/isf.4 Sat Aug 25 18:08:20 2012 (r239685) @@ -0,0 +1,135 @@ +.\"- +.\" Copyright (c) 2012 SRI International +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +.\" ("CTSRD"), as part of the DARPA CRASH research programme. +.\" +.\" 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 August 3, 2012 +.Dt ISF 4 +.Os +.Sh NAME +.Nm isf +.Nd driver for Intel StrataFlash NOR flash devices +.Sh SYNOPSIS +.Cd "device isf" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.isf.0.at="nexus0" +.Cd hint.isf.0.maddr=0x74000000 +.Cd hint.isf.0.msize=0x2000000 +.Sh DESCRIPTION +The +.Nm +device driver provides support for Intel StrataFlash NOR flash devices. +Devices are presented as +.Xr disk 9 +devices and read access is supported along with limited write support. +Erasing blocks is supported the +.Dv ISF_ERASE +ioctl. +.Pp +The erase block size of +.Nm +devices is 128K. +NOR flash blocks contains all 1's after an erase cycle. +Writes to +.Nm +devices are allowed to succeed if and only if they all bits in the write +block (512-bytes) remain the same or transition from 1 to 0. +.Sh HARDWARE +The current version of the +.Nm +driver is known to support the 64MB part found on the Altera DE4 board. +It attempts to support other StrataFlash parts documented in the +datasheet, but those are untested. +.Sh IOCTLS +The +.Nm device +supports the +.Xr ioctl 2 +command codes: +.Bl -tag -width ISF_ERASE +.It Dv ISF_ERASE +Erase one or more blocks. +.Dv ISF_ERASE is defined as follows: +.Bd -literal + struct isf_range { + off_t ir_off; + size_t ir_size; + }; + + #define ISF_ERASE _IOW('I', 1, struct isf_range) +.Ed +.Pp +The +.Li ir_off +member marks the beginning of the area to be erased and must fall on at 128K +boundary. +The +.Li ir_size +member indicates the size of the area to be erased and must a multiple +of 128K. +.El +.Sh SEE ALSO +.Xr isfctl 4 , +.Xr disk 9 +.Rs +.%T Intel StrataFlash Embedded Memory (P30) +.%D November 1, 2005 +.%I Intel Corporation +.%U http://www.xilinx.com/products/boards/ml505/datasheets/30666604.pdf +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were +developed by SRI International and the University of Cambridge Computer +Laboratory under DARPA/AFRL contract +.Pq FA8750-10-C-0237 +.Pq Do CTSRD Dc , +as part of the DARPA CRASH research programme. +.Sh BUGS +While an erase is in progress, all read and write operations return +.Er EBUSY . +In principle, reads could be allowed outside the programming region the +blocked currently being erased resides in and writes could be allowed by +suspending the erase, but neither of these is currently implemented. +.Pp +Depending on the flash part ether the top or bottom 128K of the flash +address space is divided into 4 32K erase blocks. +The +.Nm +driver hides this from the user requiring that all erase requests be +multiples of 128K in size and erasing the individual blocks as needed at +the top or bottom. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Aug 25 17:57:50 2012 (r239684) +++ head/sys/conf/files Sat Aug 25 18:08:20 2012 (r239685) @@ -1380,6 +1380,8 @@ dev/iscsi/initiator/isc_cam.c optional i dev/iscsi/initiator/isc_soc.c optional iscsi_initiator scbus dev/iscsi/initiator/isc_sm.c optional iscsi_initiator scbus dev/iscsi/initiator/isc_subr.c optional iscsi_initiator scbus +dev/isf/isf.c optional isf +dev/isf/isf_nexus.c optional isf dev/isp/isp.c optional isp dev/isp/isp_freebsd.c optional isp dev/isp/isp_library.c optional isp Added: head/sys/dev/isf/isf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/isf/isf.c Sat Aug 25 18:08:20 2012 (r239685) @@ -0,0 +1,740 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 +#include + +#include + +#include + +/* Read Mode */ +#define ISF_CMD_RA 0xFF /* Read Array mode */ +#define ISF_CMD_RSR 0x70 /* Read Status Register mode */ +#define ISF_CMD_RDI 0x90 /* Read Device ID/Config Reg mode */ +#define ISF_CMD_RQ 0x98 /* Read Query mode */ +#define ISF_CMD_CSR 0x50 /* Clear Status Register */ + +/* Write Mode */ +#define ISF_CMD_WPS 0x40 /* Word Program Setup */ +#define ISF_CMD_BPS 0xE8 /* Buffered Program Setup */ +#define ISF_CMD_BPC 0xD0 /* Buffered Program Confirm */ + +/* Erase Mode */ +#define ISF_CMD_BES 0x20 /* Block Erase Setup */ +#define ISF_CMD_BEC 0xD0 /* Block Erase Confirm */ + +/* Block Locking/Unlocking */ +#define ISF_CMD_LBS 0x60 /* Lock Block Setup */ +#define ISF_CMD_LB 0x01 /* Lock Block */ +#define ISF_CMD_UB 0xD0 /* Unlock Block */ + +/* + * Read Device Identifier registers. + * + * NOTE: ISF_RDIR_BLC is relative to the block base address. + */ +#define ISF_REG_MC 0x00 /* Manufacture Code */ +#define ISF_REG_ID 0x01 /* Device ID Code */ +#define ISF_REG_BLC 0x02 /* Block Lock Configuration */ +#define ISF_REG_RCR 0x05 /* Read Configuration Register */ + +/* + * Protection Registers + */ +#define ISF_REG_L0 0x80 /* Lock Register 0 */ +#define ISF_REG_FPP 0x81 /* 64-bit Factory Protection Register */ +#define ISF_REG_UPP 0x85 /* 64-bit User Protection Register */ +#define ISF_REG_L1 0x89 /* Lock Register 1 */ +#define ISF_REG_PP1 0x8A /* 128-bit Protection Register 1 */ +#define ISF_REG_PP2 0x92 /* 128-bit Protection Register 2 */ +#define ISF_REG_PP3 0x9A /* 128-bit Protection Register 3 */ +#define ISF_REG_PP4 0xA2 /* 128-bit Protection Register 4 */ +#define ISF_REG_PP5 0xAA /* 128-bit Protection Register 5 */ +#define ISF_REG_PP6 0xB2 /* 128-bit Protection Register 6 */ +#define ISF_REG_PP7 0xBA /* 128-bit Protection Register 7 */ +#define ISF_REG_PP8 0xC2 /* 128-bit Protection Register 8 */ +#define ISF_REG_PP9 0xCA /* 128-bit Protection Register 9 */ +#define ISF_REG_PP10 0xD2 /* 128-bit Protection Register 10 */ +#define ISF_REG_PP11 0xDA /* 128-bit Protection Register 11 */ +#define ISF_REG_PP12 0xE2 /* 128-bit Protection Register 12 */ +#define ISF_REG_PP13 0xEA /* 128-bit Protection Register 13 */ +#define ISF_REG_PP14 0xF2 /* 128-bit Protection Register 14 */ +#define ISF_REG_PP15 0xFA /* 128-bit Protection Register 15 */ +#define ISF_REG_PP16 0x102 /* 128-bit Protection Register 16 */ + +#define ISF_SR_BWS (1 << 0) /* BEFP Status */ +#define ISF_SR_BLS (1 << 1) /* Block-Locked Status */ +#define ISF_SR_PSS (1 << 2) /* Program Suspend Status */ +#define ISF_SR_VPPS (1 << 3) /* Vpp Status */ +#define ISF_SR_PS (1 << 4) /* Program Status */ +#define ISF_SR_ES (1 << 5) /* Erase Status */ +#define ISF_SR_ESS (1 << 6) /* Erase Suspend Status */ +#define ISF_SR_DWS (1 << 7) /* Device Write Status */ +#define ISF_SR_FSC_MASK (ISF_SR_VPPS | ISF_SR_PS | ISF_SR_BLS) + +#define ISF_BUFFER_PROGRAM + +MALLOC_DEFINE(M_ISF, "isf_data", "Intel StrateFlash driver"); +static int isf_debug = 0; + +static struct isf_chips { + uint16_t chip_id; + size_t chip_size; + const char *chip_desc; +} chip_ids[] = { + { 0x8817, 0x0800000, "64-Mbit Top Parameter" }, + { 0x881A, 0x0800000, "64-Mbit Bottom Parameter" }, + { 0x8818, 0x1000000, "128-Mbit Top Parameter" }, + { 0x881B, 0x1000000, "128-Mbit Bottom Parameter" }, + { 0x8919, 0x2000000, "256-Mbit Top Parameter" }, + { 0x891C, 0x2000000, "256-Mbit Bottom Parameter" }, + { 0x8961, 0x2000000, "512-Mbit package (half)" }, + { 0x0000, 0x0000000, NULL } +}; + +static void isf_task(void *arg); + +/* + * Device driver for the Intel StrataFlash NOR flash device. This + * implementation is known to work with 256Mb instances of the device, but may + * also work with other 64/128/512Mb parts without much work. Multiple + * device instances should be used when multiple parts are in the same + * physical package, due to variable block size support in the StrataFlash + * part. + */ + +static uint16_t +isf_read_reg(struct isf_softc *sc, uint16_t reg) +{ + + if (isf_debug) + device_printf(sc->isf_dev, "isf_read_reg(0x%02x)\n", reg); + return (le16toh(bus_read_2(sc->isf_res, reg * 2))); +} + +static uint64_t +isf_read_reg64(struct isf_softc *sc, uint16_t reg) +{ + uint64_t val; + uint16_t *val16 = (uint16_t *)&val; + + if (isf_debug) + device_printf(sc->isf_dev, "isf_read_reg64(0x%02x)\n", reg); + val16[0] = bus_read_2(sc->isf_res, reg * 2); + val16[1] = bus_read_2(sc->isf_res, (reg+1) * 2); + val16[2] = bus_read_2(sc->isf_res, (reg+2) * 2); + val16[3] = bus_read_2(sc->isf_res, (reg+3) * 2); + + return(le64toh(val)); +} + +static uint16_t +isf_read_off(struct isf_softc *sc, off_t off) +{ + + KASSERT(off >= 0, ("%s: negative offset\n", __func__)); + KASSERT(off < sc->isf_disk->d_mediasize, + ("%s: offset out side address space 0x%08jx \n", __func__, + (intmax_t)off)); + + if (isf_debug) + device_printf(sc->isf_dev, "isf_read_off(0x%08jx)\n", + (intmax_t)off); + return (le16toh(bus_read_2(sc->isf_res, off))); +} + +static void +isf_write_cmd(struct isf_softc *sc, off_t off, uint16_t cmd) +{ + + if (isf_debug) + device_printf(sc->isf_dev, "isf_write_cmd(0x%08jx, 0x%02x)\n", + off, cmd); + bus_write_2(sc->isf_res, off, htole16(cmd)); +} + +static uint16_t +isf_read_status(struct isf_softc *sc, off_t off) +{ + + isf_write_cmd(sc, off/2, ISF_CMD_RSR); + return isf_read_off(sc, off); +} + +static void +isf_clear_status(struct isf_softc *sc) +{ + + isf_write_cmd(sc, 0, ISF_CMD_CSR); +} + +static int +isf_full_status_check(struct isf_softc *sc, off_t off) +{ + int error = 0; + uint16_t status; + + status = isf_read_status(sc, off); + if (status & ISF_SR_VPPS) { + device_printf(sc->isf_dev, "Vpp Range Error\n"); + error = EIO; + } else if (status & ISF_SR_PS) { + device_printf(sc->isf_dev, "Program Error\n"); + error = EIO; + } else if (status & ISF_SR_BLS) { + device_printf(sc->isf_dev, "Device Protect Error\n"); + error = EIO; + } + isf_clear_status(sc); + + return(error); +} + +static int +isf_full_erase_status_check(struct isf_softc *sc, off_t off) +{ + int error = 0; + uint16_t status; + + status = isf_read_status(sc, off); + if (status & ISF_SR_VPPS) { + device_printf(sc->isf_dev, "Vpp Range Error\n"); + error = EIO; + } else if (status & (ISF_SR_PS|ISF_SR_ES)) { + device_printf(sc->isf_dev, "Command Sequence Error\n"); + error = EIO; + } else if (status & ISF_SR_ES) { + device_printf(sc->isf_dev, "Block Erase Error\n"); + error = EIO; + } else if (status & ISF_SR_BLS) { + device_printf(sc->isf_dev, "Block Locked Error\n"); + error = EIO; + } + isf_clear_status(sc); + + return(error); +} + +static void +isf_unlock_block(struct isf_softc *sc, off_t off) +{ + + isf_write_cmd(sc, off, ISF_CMD_LBS); + isf_write_cmd(sc, off, ISF_CMD_UB); + isf_write_cmd(sc, off, ISF_CMD_RA); +} + +static void +isf_lock_block(struct isf_softc *sc, off_t off) +{ + + isf_write_cmd(sc, off, ISF_CMD_LBS); + isf_write_cmd(sc, off, ISF_CMD_LB); + isf_write_cmd(sc, off, ISF_CMD_RA); +} + +static void +isf_read(struct isf_softc *sc, off_t off, void *data, size_t len) +{ + + KASSERT((uintptr_t)data % 2 == 0, + ("%s: unaligned data %p", __func__, data)); + KASSERT((len <= ISF_SECTORSIZE) && (len % 2 == 0), + ("%s: invalid length %ju", __func__, len)); + KASSERT(off % ISF_SECTORSIZE == 0, + ("%s: invalid offset %ju\n", __func__, off)); + + /* + * It is not permitted to read blocks that are in the process of + * being erased, but we know they will be all 1's after the + * erase so just report that value if asked about a block that + * is being erased. + */ + if (sc->isf_bstate[off / ISF_ERASE_BLOCK] == BS_ERASING) + memset(data, 0xFF, len); + else + bus_read_region_2(sc->isf_res, off, (uint16_t *)data, len / 2); +} + +static int +isf_write(struct isf_softc *sc, off_t off, void *data, size_t len) +{ + int cycles, error = 0; + uint16_t *dp; + uint16_t status; + off_t coff; + + KASSERT((uintptr_t)data % 2 == 0, + ("%s: unaligned data %p", __func__, data)); + KASSERT((len <= ISF_SECTORSIZE) && (len % 2 == 0), + ("%s: invalid length %ju", __func__, len)); + KASSERT(off % ISF_SECTORSIZE == 0, + ("%s: invalid offset %ju\n", __func__, off)); + KASSERT(!sc->isf_erasing, + ("%s: trying to write while erasing\n", __func__)); + KASSERT(sc->isf_bstate[off / ISF_ERASE_BLOCK] != BS_ERASING, + ("%s: block being erased at %ju\n", __func__, off)); + + isf_unlock_block(sc, off); + +#ifdef ISF_BUFFER_PROGRAM + for (dp = data, coff = off; dp - (uint16_t *)data < len / 2; + dp += 32, coff += 64) { + isf_clear_status(sc); + isf_write_cmd(sc, coff, ISF_CMD_BPS); + cycles = 0xFFFF; + while ( !(isf_read_off(sc, coff) & ISF_SR_DWS) ) { + if (cycles-- == 0) { + device_printf(sc->isf_dev, "timeout waiting" + " for write to start at 0x08%jx\n", + (intmax_t)coff); + return (EIO); + } + isf_write_cmd(sc, coff, ISF_CMD_BPS); + } + + /* When writing N blocks, send N-1 as the count */ + isf_write_cmd(sc, coff, 31); + bus_write_region_2(sc->isf_res, coff, dp, 32); + + isf_write_cmd(sc, coff, ISF_CMD_BPC); + + status = isf_read_off(sc, coff); + cycles = 0xFFFFF; + while ( !(status & ISF_SR_DWS) ) { + if (cycles-- == 0) { + device_printf(sc->isf_dev, "timeout waiting" + " for write to complete at 0x08%jx\n", + (intmax_t)coff); + error = EIO; + break; + } + status = isf_read_off(sc, coff); + } + isf_full_status_check(sc, off); + + isf_write_cmd(sc, coff, ISF_CMD_RA); + } +#else + for (dp = data, coff = off; dp - (uint16_t *)data < len / 2; + dp++, coff += 2) { + isf_write_cmd(sc, coff, ISF_CMD_WPS); + bus_write_2(sc->isf_res, coff, *dp); + status = isf_read_off(sc, coff); + cycles=0xFFFFF; + while ( !(status & ISF_SR_DWS) ) { + if (cycles-- == 0) { + device_printf(sc->isf_dev, "timeout waiting" + " for write to complete at 0x08%jx\n", + (intmax_t)coff); + error = EIO; + break; + } + status = isf_read_off(sc, coff); + } + + } + isf_full_status_check(sc, off); + isf_write_cmd(sc, coff, ISF_CMD_RA); +#endif + + isf_lock_block(sc, off); + + return error; +} + +static void +isf_erase_at(struct isf_softc *sc, off_t off) +{ + int cycles; + uint16_t status; + + isf_unlock_block(sc, off); + isf_clear_status(sc); + + isf_write_cmd(sc, off, ISF_CMD_BES); + isf_write_cmd(sc, off, ISF_CMD_BEC); + + cycles=0xFFFFFF; + status = isf_read_off(sc, off); + while ( !(status & ISF_SR_DWS) ) { +#ifdef NOTYET + ISF_SLEEP(sc, sc, hz); +#endif + if (cycles-- == 0) { + device_printf(sc->isf_dev, + "Giving up on erase\n"); + break; + } + status = isf_read_off(sc, off); + } + + isf_full_erase_status_check(sc, off); + + isf_lock_block(sc, off); + + isf_write_cmd(sc, off, ISF_CMD_RA); +} + +static void +isf_erase_range(struct isf_softc *sc, off_t blk_off, size_t size) +{ + off_t off; + off_t ms = sc->isf_disk->d_mediasize; + + KASSERT(blk_off % ISF_ERASE_BLOCK == 0, + ("%s: invalid offset %ju\n", __func__, blk_off)); + + ISF_LOCK_ASSERT(sc); + + for (off = blk_off; off < blk_off + size; off += ISF_ERASE_BLOCK) { + sc->isf_bstate[off / ISF_ERASE_BLOCK] = BS_ERASING; + + /* + * The first or last 128K is four blocks depending which + * part this is. For now, just assume both are and + * erase four times. + */ + if (off == 0 || ms - off == ISF_ERASE_BLOCK) { + isf_erase_at(sc, off); + isf_erase_at(sc, off + 0x08000); + isf_erase_at(sc, off + 0x10000); + isf_erase_at(sc, off + 0x18000); + } else + isf_erase_at(sc, off); + + sc->isf_bstate[off / ISF_ERASE_BLOCK] = BS_STEADY; + } +} + +/* + * disk(9) methods. + */ +static int +isf_disk_ioctl(struct disk *disk, u_long cmd, void *data, int fflag, + struct thread *td) +{ + int error = 0; + struct isf_softc *sc = disk->d_drv1; + struct isf_range *ir; + + switch (cmd) { + case ISF_ERASE: + ir = data; + if (ir->ir_off % ISF_ERASE_BLOCK != 0 || + ir->ir_off >= disk->d_mediasize || + ir->ir_size == 0 || + ir->ir_size % ISF_ERASE_BLOCK != 0 || + ir->ir_off + ir->ir_size > disk->d_mediasize) { + error = EINVAL; + break; + } + ISF_LOCK(sc); + if (sc->isf_erasing) { + ISF_UNLOCK(sc); + error = EBUSY; + break; + } + sc->isf_erasing = 1; + isf_erase_range(sc, ir->ir_off, ir->ir_size); + sc->isf_erasing = 0; + ISF_UNLOCK(sc); + break; + default: + error = EINVAL; + } + + return (error); +} + +static void +isf_disk_strategy(struct bio *bp) +{ + struct isf_softc *sc = bp->bio_disk->d_drv1;; + + /* + * We advertise a block size and maximum I/O size up the stack; catch + * any attempts to not follow the rules. + */ + KASSERT(bp->bio_bcount == ISF_SECTORSIZE, + ("%s: I/O size not %d", __func__, ISF_SECTORSIZE)); + + ISF_LOCK(sc); + bioq_disksort(&sc->isf_bioq, bp); + ISF_WAKEUP(sc); + ISF_UNLOCK(sc); +} + +static void +isf_task(void *arg) +{ + struct isf_softc *sc = arg; + struct bio *bp; + int ss = sc->isf_disk->d_sectorsize; + int error, i; + + for (;;) { + ISF_LOCK(sc); + do { + bp = bioq_first(&sc->isf_bioq); + if (bp == NULL) { + if (sc->isf_doomed) + kproc_exit(0); + else + ISF_SLEEP(sc, sc, 0); + } + } while (bp == NULL); + bioq_remove(&sc->isf_bioq, bp); + + error = 0; + switch (bp->bio_cmd) { + case BIO_READ: + isf_read(sc, bp->bio_pblkno * ss, bp->bio_data, + bp->bio_bcount); + break; + + case BIO_WRITE: + /* + * In principle one could suspend the in-progress + * erase, process any pending writes to other + * blocks and then proceed, but that seems + * overly complex for the likely usage modes. + */ + if (sc->isf_erasing) { + error = EBUSY; + break; + } + + /* + * Read in the block we want to write and check that + * we're only setting bits to 0. If an erase would + * be required return an I/O error. + */ + isf_read(sc, bp->bio_pblkno * ss, sc->isf_rbuf, + bp->bio_bcount); + for (i = 0; i < bp->bio_bcount / 2; i++) + if ((sc->isf_rbuf[i] & + ((uint16_t *)bp->bio_data)[i]) != + ((uint16_t *)bp->bio_data)[i]) { + device_printf(sc->isf_dev, "write" + " requires erase at 0x%08jx\n", + bp->bio_pblkno * ss); + error = EIO; + break; + } + if (error != 0) + break; + + error = isf_write(sc, bp->bio_pblkno * ss, + bp->bio_data, bp->bio_bcount); + break; + + default: + panic("%s: unsupported I/O operation %d", __func__, + bp->bio_cmd); + } + if (error == 0) + biodone(bp); + else + biofinish(bp, NULL, error); + ISF_UNLOCK(sc); + } +} + +static void +isf_dump_info(struct isf_softc *sc) +{ + int i; + int32_t reg; + + isf_write_cmd(sc, 0, ISF_CMD_RDI); + device_printf(sc->isf_dev, "manufacturer code: 0x%04x\n", + isf_read_reg(sc, ISF_REG_MC)); + device_printf(sc->isf_dev, "device id code: 0x%04x\n", + isf_read_reg(sc, ISF_REG_ID)); + device_printf(sc->isf_dev, "read config register: 0x%04x\n", + isf_read_reg(sc, ISF_REG_RCR)); + + device_printf(sc->isf_dev, "lock register 0: 0x%04x\n", + isf_read_reg(sc, ISF_REG_L0)); + device_printf(sc->isf_dev, "lock register 1: 0x%04x\n", + isf_read_reg(sc, ISF_REG_L1)); + + device_printf(sc->isf_dev, "factory PPR: 0x%016jx\n", + (uintmax_t)isf_read_reg64(sc, ISF_REG_FPP)); + device_printf(sc->isf_dev, "user PPR (64-bit): 0x%016jx\n", + (uintmax_t)isf_read_reg64(sc, ISF_REG_UPP)); + + for (reg = ISF_REG_PP1, i = 1; reg <= ISF_REG_PP16; reg += 8, i++) { + /* XXX: big-endian ordering of uint64_t's */ + device_printf(sc->isf_dev, + "user PPR [%02d]: 0x%016jx%016jx\n", i, + (uintmax_t)isf_read_reg64(sc, reg+4), + (uintmax_t)isf_read_reg64(sc, reg)); + } + + isf_write_cmd(sc, 0, ISF_CMD_RA); +} + +static void +isf_disk_insert(struct isf_softc *sc, off_t mediasize) +{ + struct disk *disk; + + sc->isf_doomed = 0; + sc->isf_erasing = 0; + sc->isf_bstate = malloc(sizeof(*sc->isf_bstate) * + (mediasize / ISF_ERASE_BLOCK), M_ISF, M_ZERO | M_WAITOK); + kproc_create(&isf_task, sc, &sc->isf_proc, 0, 0, "isf"); + + disk = disk_alloc(); + disk->d_drv1 = sc; + disk->d_name = "isf"; + disk->d_unit = sc->isf_unit; + disk->d_strategy = isf_disk_strategy; + disk->d_ioctl = isf_disk_ioctl; + disk->d_sectorsize = ISF_SECTORSIZE; + disk->d_mediasize = mediasize; + disk->d_maxsize = ISF_SECTORSIZE; + sc->isf_disk = disk; + + if (bootverbose) + isf_dump_info(sc); + + disk_create(disk, DISK_VERSION); + device_printf(sc->isf_dev, "%juM flash device\n", + (uintmax_t)disk->d_mediasize / (1024 * 1024)); + +} + +static void +isf_disk_remove(struct isf_softc *sc) +{ + struct disk *disk; + + ISF_LOCK_ASSERT(sc); + KASSERT(sc->isf_disk != NULL, ("%s: isf_disk NULL", __func__)); + + sc->isf_doomed = 1; + ISF_WAKEUP(sc); + ISF_SLEEP(sc, sc->isf_proc, 0); + + /* + * XXXRW: Is it OK to call disk_destroy() under the mutex, or should + * we be deferring that to the calling context once it is released? + */ + disk = sc->isf_disk; + disk_gone(disk); + disk_destroy(disk); + sc->isf_disk = NULL; + free(sc->isf_bstate, M_ISF); + device_printf(sc->isf_dev, "flash device removed\n"); +} + +int +isf_attach(struct isf_softc *sc) +{ + uint16_t id; + u_long start, size; + struct isf_chips *cp = chip_ids; + + start = rman_get_start(sc->isf_res); + if (start % 2 != 0) { + device_printf(sc->isf_dev, + "Unsupported flash start alignment %lu\n", + start); + return (ENXIO); + } + + isf_write_cmd(sc, 0, ISF_CMD_RDI); + id = isf_read_reg(sc, ISF_REG_ID); + while (cp->chip_id != id) + cp++; + if (cp->chip_desc == NULL) { + device_printf(sc->isf_dev, + "Unsupported device ID 0x%04x\n", id); + return (ENXIO); + } + isf_write_cmd(sc, 0, ISF_CMD_RA); + + size = rman_get_size(sc->isf_res); + if (size != cp->chip_size) { + device_printf(sc->isf_dev, + "Unsupported flash size %lu\n", size); + return (ENXIO); + } + + bioq_init(&sc->isf_bioq); + ISF_LOCK_INIT(sc); + sc->isf_disk = NULL; + isf_disk_insert(sc, size); + return(0); +} + +void +isf_detach(struct isf_softc *sc) +{ + + /* + * Simulate a disk removal if one is present to deal with any pending + * or queued I/O. This will occur as a result of a device driver + * detach -- the Intel StrataFlash has no notion of removal itself. + * + * XXXRW: Is the locking here right? + */ + ISF_LOCK(sc); + isf_disk_remove(sc); + bioq_flush(&sc->isf_bioq, NULL, ENXIO); + KASSERT(bioq_first(&sc->isf_bioq) == NULL, + ("%s: non-empty bioq", __func__)); + ISF_UNLOCK(sc); + ISF_LOCK_DESTROY(sc); +} Added: head/sys/dev/isf/isf.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/isf/isf.h Sat Aug 25 18:08:20 2012 (r239685) @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 _DEV_ISF_H_ +#define _DEV_ISF_H_ + +struct isf_range { + off_t ir_off; /* Offset of range to delete (set to 0xFF) */ + size_t ir_size; /* Size of range */ +}; + +#define ISF_ERASE _IOW('I', 1, struct isf_range) + +/* + * Ordinary read and write operations are limited to 512 bytes. + * We support erasing 128K blocks and ignore the fact that portions of the + * flash are in fact divided into 32K blocks. + */ +#define ISF_SECTORSIZE (512) +#define ISF_ERASE_BLOCK (128 * 1024) + +#ifdef _KERNEL +MALLOC_DECLARE(M_ISF); + +enum bstate { + BS_STEADY = 0, + BS_ERASING +}; + +struct isf_softc { + device_t isf_dev; + int isf_unit; + struct resource *isf_res; + int isf_rid; + struct mtx isf_lock; + struct disk *isf_disk; + struct proc *isf_proc; + int isf_doomed; + + /* + * Fields relating to in-progress and pending I/O, if any. + */ + struct bio_queue_head isf_bioq; + uint16_t isf_rbuf[ISF_SECTORSIZE / 2]; + int isf_erasing; + enum bstate *isf_bstate; +}; + +#define ISF_LOCK(sc) mtx_lock(&(sc)->isf_lock) +#define ISF_LOCK_ASSERT(sc) mtx_assert(&(sc)->isf_lock, MA_OWNED) +#define ISF_LOCK_DESTROY(sc) mtx_destroy(&(sc)->isf_lock) +#define ISF_LOCK_INIT(sc) mtx_init(&(sc)->isf_lock, "isf", NULL, \ + MTX_DEF) +#define ISF_SLEEP(sc, wait, timo) mtx_sleep((wait), \ + &(sc)->isf_lock, PRIBIO, \ + "isf", (timo)) +#define ISF_UNLOCK(sc) mtx_unlock(&(sc)->isf_lock) +#define ISF_WAKEUP(sc) wakeup((sc)) + +int isf_attach(struct isf_softc *sc); +void isf_detach(struct isf_softc *sc); +#endif /* _KERNEL */ + +#endif /* _DEV_ISF_H_ */ Added: head/sys/dev/isf/isf_nexus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 19:30: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 12A4D106566B; Sat, 25 Aug 2012 19:30:16 +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 F24478FC18; Sat, 25 Aug 2012 19:30: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 q7PJUFSm085671; Sat, 25 Aug 2012 19:30:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PJUF12085669; Sat, 25 Aug 2012 19:30:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208251930.q7PJUF12085669@svn.freebsd.org> From: Dimitry Andric Date: Sat, 25 Aug 2012 19:30: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: r239686 - 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: Sat, 25 Aug 2012 19:30:16 -0000 Author: dim Date: Sat Aug 25 19:30:15 2012 New Revision: 239686 URL: http://svn.freebsd.org/changeset/base/239686 Log: When using -stdlib=libc++, add the correct dependency to .depend in bsd.prog.mk. Submitted by: Yamaya Takashi MFC after: 2 weeks Modified: head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Sat Aug 25 18:08:20 2012 (r239685) +++ head/share/mk/bsd.prog.mk Sat Aug 25 19:30:15 2012 (r239686) @@ -126,10 +126,14 @@ _EXTRADEPEND: .else echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE} .if defined(PROG_CXX) +.if !empty(CXXFLAGS:M-stdlib=libc++) + echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE} +.else echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} .endif .endif .endif +.endif .if !target(install) From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 20:01:32 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 6953E106567B; Sat, 25 Aug 2012 20:01:32 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53D9E8FC16; Sat, 25 Aug 2012 20:01: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 q7PK1W8l089237; Sat, 25 Aug 2012 20:01:32 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PK1WAq089235; Sat, 25 Aug 2012 20:01:32 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208252001.q7PK1WAq089235@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 25 Aug 2012 20:01: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: r239687 - 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: Sat, 25 Aug 2012 20:01:32 -0000 Author: gonzo Date: Sat Aug 25 20:01:31 2012 New Revision: 239687 URL: http://svn.freebsd.org/changeset/base/239687 Log: Add clrex, strex , ldrex, strex and variants Submitted by: Alexander Rybalko Modified: head/sys/arm/arm/disassem.c Modified: head/sys/arm/arm/disassem.c ============================================================================== --- head/sys/arm/arm/disassem.c Sat Aug 25 19:30:15 2012 (r239686) +++ head/sys/arm/arm/disassem.c Sat Aug 25 20:01:31 2012 (r239687) @@ -130,6 +130,17 @@ static const struct arm32_insn arm32_i[] { 0x0c500000, 0x04100000, "ldr", "daW" }, { 0x0c500000, 0x04400000, "strb", "daW" }, { 0x0c500000, 0x04500000, "ldrb", "daW" }, +#ifdef __FreeBSD_ARCH_armv6__ + { 0xffffffff, 0xf57ff01f, "clrex", "c" }, + { 0x0ff00ff0, 0x01800f90, "strex", "dmo" }, + { 0x0ff00fff, 0x01900f9f, "ldrex", "do" }, + { 0x0ff00ff0, 0x01a00f90, "strexd", "dmo" }, + { 0x0ff00fff, 0x01b00f9f, "ldrexd", "do" }, + { 0x0ff00ff0, 0x01c00f90, "strexb", "dmo" }, + { 0x0ff00fff, 0x01d00f9f, "ldrexb", "do" }, + { 0x0ff00ff0, 0x01e00f90, "strexh", "dmo" }, + { 0x0ff00fff, 0x01f00f9f, "ldrexh", "do" }, +#endif { 0x0e1f0000, 0x080d0000, "stm", "YnWl" },/* separate out r13 base */ { 0x0e1f0000, 0x081d0000, "ldm", "YnWl" },/* separate out r13 base */ { 0x0e100000, 0x08000000, "stm", "XnWl" }, From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 20:13: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 B2EFE1065674; Sat, 25 Aug 2012 20:13:19 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E38E8FC16; Sat, 25 Aug 2012 20:13: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 q7PKDJRQ090570; Sat, 25 Aug 2012 20:13:19 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PKDJjO090568; Sat, 25 Aug 2012 20:13:19 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208252013.q7PKDJjO090568@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 25 Aug 2012 20:13: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: r239688 - head/sys/arm/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, 25 Aug 2012 20:13:19 -0000 Author: gonzo Date: Sat Aug 25 20:13:19 2012 New Revision: 239688 URL: http://svn.freebsd.org/changeset/base/239688 Log: ARM11 might have more then 32 interrupts, e.g. BCM2835: 72 interrupts Modified: head/sys/arm/include/intr.h Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Sat Aug 25 20:01:31 2012 (r239687) +++ head/sys/arm/include/intr.h Sat Aug 25 20:13:19 2012 (r239688) @@ -52,6 +52,8 @@ #define NIRQ 64 #elif defined(CPU_CORTEXA) #define NIRQ 128 +#elif defined(CPU_ARM11) +#define NIRQ 128 #else #define NIRQ 32 #endif From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 20:18: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 482A5106564A; Sat, 25 Aug 2012 20:18:13 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 330508FC08; Sat, 25 Aug 2012 20:18: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 q7PKIDO3091147; Sat, 25 Aug 2012 20:18:13 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PKIDZn091145; Sat, 25 Aug 2012 20:18:13 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208252018.q7PKIDZn091145@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 25 Aug 2012 20:18: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: r239689 - 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: Sat, 25 Aug 2012 20:18:13 -0000 Author: gonzo Date: Sat Aug 25 20:18:12 2012 New Revision: 239689 URL: http://svn.freebsd.org/changeset/base/239689 Log: Do not swap byte order if we assign default value for intr_cells Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sat Aug 25 20:13:19 2012 (r239688) +++ head/sys/dev/fdt/fdt_common.c Sat Aug 25 20:18:12 2012 (r239689) @@ -524,7 +524,8 @@ fdt_intr_to_rl(phandle_t node, struct re debugf("no intr-cells defined, defaulting to 1\n"); intr_cells = 1; } - intr_cells = fdt32_to_cpu(intr_cells); + else + intr_cells = fdt32_to_cpu(intr_cells); intr_num = OF_getprop_alloc(node, "interrupts", intr_cells * sizeof(pcell_t), (void **)&intr); From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 21:13: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 A21DC106564A; Sat, 25 Aug 2012 21:13:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CAE88FC12; Sat, 25 Aug 2012 21:13: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 q7PLD075097506; Sat, 25 Aug 2012 21:13:00 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PLD0CY097504; Sat, 25 Aug 2012 21:13:00 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208252113.q7PLD0CY097504@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 25 Aug 2012 21:13: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: r239690 - head/sys/arm/ti X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 21:13:00 -0000 Author: gonzo Date: Sat Aug 25 21:13:00 2012 New Revision: 239690 URL: http://svn.freebsd.org/changeset/base/239690 Log: Style cleanup Modified: head/sys/arm/ti/ti_machdep.c Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Sat Aug 25 20:18:12 2012 (r239689) +++ head/sys/arm/ti/ti_machdep.c Sat Aug 25 21:13:00 2012 (r239690) @@ -339,9 +339,6 @@ initarm(struct arm_boot_params *abp) &memsize) != 0) while(1); -// if (fdt_immr_addr(OMAP44XX_L4_PERIPH_VBASE) != 0) -// while (1); - /* Platform-specific initialisation */ pmap_bootstrap_lastaddr = DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE; @@ -522,7 +519,7 @@ initarm(struct arm_boot_params *abp) undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); - init_proc0(kernelstack.pv_va); + init_proc0(kernelstack.pv_va); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 22:35: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 B1F18106564A; Sat, 25 Aug 2012 22:35:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DDE98FC08; Sat, 25 Aug 2012 22:35: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 q7PMZU1N007197; Sat, 25 Aug 2012 22:35:30 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PMZUih007188; Sat, 25 Aug 2012 22:35:30 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208252235.q7PMZUih007188@svn.freebsd.org> From: Robert Watson Date: Sat, 25 Aug 2012 22:35: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: r239691 - in head: share/man/man4 sys/dev/terasic sys/dev/terasic/mtl sys/mips/beri sys/mips/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: Sat, 25 Aug 2012 22:35:30 -0000 Author: rwatson Date: Sat Aug 25 22:35:29 2012 New Revision: 239691 URL: http://svn.freebsd.org/changeset/base/239691 Log: Add terasic_mtl(4), a device driver for the Terasic Multi-Touch LCD, used with Terasic's DE-4 and other similar FPGA boards. This display is 800x480 and includes a capacitive touch screen, multi-touch gesture recognition, etc. This device driver depends on a Cambridge- provided IP core that allows the MTL device to be hooked up to the Altera Avalon SoC bus, and also provides a VGA-like text frame buffer. Although it is compiled as a single device driver, it actually implements a number of different device nodes exporting various aspects of this multi-function device to userspace: - Simple memory-mapped driver for the MTL 24-bit pixel frame buffer. - Simple memory-mapped driver for the MTL control register set. - Simple memory-mapped driver for the MTL text frame buffer. - syscons attachment for the MTL text frame buffer. This driver attaches directly to Nexus as is common for SoC device drivers, and for the time being is considered BERI-specific, although in principle it might be used with other hard and soft cores on Altera FPGAs. Control registers, including touchscreen input, are simply memory mapped; in the future it would be desirable to hook up a more conventional device node that can stream events, support kqueue(2)/ poll(2)/select(2), etc. This is the first use of syscons on MIPS, as far as I can tell, and there are some loose ends, such as an inability to use the hardware cursor. More fundamentally, it appears that syscons(4) assumes that either a host is PC-like (i386, amd64) *or* it must be using a graphical frame buffer. While the MTL supports a graphical frame buffer, using the text frame buffer is preferable for console use. Fixing this issue in syscons(4) requires non-trivial changes, as the text frame buffer support assumes that direct memory access can be done to the text frame buffer without using bus accessor methods, which is not the case on MIPS. As a workaround for this, we instead double-buffer and pretend to be a graphical frame buffer exposing text accessor methods, leading to some quirks in syscons behaviour. Sponsored by: DARPA, AFRL Added: head/share/man/man4/terasic_mtl.4 (contents, props changed) head/sys/dev/terasic/ head/sys/dev/terasic/mtl/ head/sys/dev/terasic/mtl/terasic_mtl.c (contents, props changed) head/sys/dev/terasic/mtl/terasic_mtl.h (contents, props changed) head/sys/dev/terasic/mtl/terasic_mtl_nexus.c (contents, props changed) head/sys/dev/terasic/mtl/terasic_mtl_pixel.c (contents, props changed) head/sys/dev/terasic/mtl/terasic_mtl_reg.c (contents, props changed) head/sys/dev/terasic/mtl/terasic_mtl_syscons.c (contents, props changed) head/sys/dev/terasic/mtl/terasic_mtl_text.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/mips/beri/files.beri head/sys/mips/conf/BERI_DE4.hints head/sys/mips/conf/BERI_DE4_MDROOT head/sys/mips/conf/BERI_DE4_SDROOT Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Aug 25 21:13:00 2012 (r239690) +++ head/share/man/man4/Makefile Sat Aug 25 22:35:29 2012 (r239691) @@ -457,6 +457,7 @@ MAN= aac.4 \ targ.4 \ tcp.4 \ tdfx.4 \ + terasic_mtl.4 \ termios.4 \ textdump.4 \ ti.4 \ Added: head/share/man/man4/terasic_mtl.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/terasic_mtl.4 Sat Aug 25 22:35:29 2012 (r239691) @@ -0,0 +1,132 @@ +.\"- +.\" Copyright (c) 2012 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +.\" ("CTSRD"), as part of the DARPA CRASH research programme. +.\" +.\" 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 August 18, 2012 +.Dt TERASIC_MTL 4 +.Os +.Sh NAME +.Nm terasic_mtl +.Nd driver for the Terasic/Cambridge Multi-Touch LCD device +.Sh SYNOPSIS +.Cd "device terasic_mtl" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.terasic_mtl.0.at="nexus0" +.Cd hint.terasic_mtl.0.reg_maddr=0x70400000 +.Cd hint.terasic_mtl.0.reg_msize=0x1000 +.Cd hint.terasic_mtl.0.pixel_maddr=0x70000000 +.Cd hint.terasic_mtl.0.pixel_msize=0x177000 +.Cd hint.terasic_mtl.0.text_maddr=0x70177000 +.Cd hint.terasic_mtl.0.text_msize=0x2000 +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Terasic Multi-Touch LCD combined as +controlled by a University of Cambridge's IP Core. +Three device nodes are instantiated, representing various services supported +by the device: +.Bl -tag -width terasic_pixelX +.It terasic_regX +Memory-mapped register interface, including touch screen input. +.It terasic_pixelX +Memory-mapped pixel-oriented frame buffer. +.It terasic_textX +Memory-mapped text-oriented frame buffer. +.El +.Pp +.Nm +devices are also attached to the +.Xr syscons 4 +framework, which implements a VT-compatible terminal connected to the +.Xr tty 4 +framework. +.Li ttyvX +device nodes may be added to +.Xr ttys 5 +in order to launch +.Xr login 1 +sessions at boot. +.Pp +Register, text, and pixel devices may be accessed using +.Xr read 2 +and +.Xr write 2 +system calls, and also memory mapped using +.Xr mmap 2 . +.Sh SEE ALSO +.Xr login 1 , +.Xr ioctl 2 , +.Xr mmap 2 , +.Xr poll 2 , +.Xr read 2 , +.Xr write 2 , +.Xr syscons 4 , +.Xr tty 4 , +.Xr ttys 5 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +device driver and this manual page were +developed by SRI International and the University of Cambridge Computer +Laboratory under DARPA/AFRL contract +.Pq FA8750-10-C-0237 +.Pq Do CTSRD Dc , +as part of the DARPA CRASH research programme. +This device driver was written by +.An Robert N. M. Watson . +.Sh BUGS +.Nm +The +.Xr syscons 4 +attachment does not support the hardware cursor feature. +.Pp +A more structured interface to control registers using the +.Xr ioctl 2 +system call, would sometimes be preferable to memory mapping. +For touch screen input, it would be highly desirable to offer a streaming +interface whose events can be managed using +.Xr poll 2 +and related system calls, with the kernel performing polling rather than the +userspace application. +.Pp +.Nm +supports only a +.Li nexus +bus attachment, which is appropriate for system-on-chip busses such as +Altera's Avalon bus. +If the IP core is configured off of another bus type, then additional bus +attachments will be required. Added: head/sys/dev/terasic/mtl/terasic_mtl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/mtl/terasic_mtl.c Sat Aug 25 22:35:29 2012 (r239691) @@ -0,0 +1,110 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 /* struct vt_mode */ +#include /* video_adapter_t */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +/* + * Device driver for the Terasic Multitouch LCD (MTL). Three separate + * sub-drivers that support, respectively, access to device control registers, + * the pixel frame buffer, and the text frame buffer. The last of these is + * also hooked up to syscons. + * + * Eventually, the frame buffer control registers and touch screen input FIFO + * will end up being separate sub-drivers as well. + * + * Note: sub-driver detach routines must check whether or not they have + * attached as they may be called even if the attach routine hasn't been, on + * an error. + */ +int +terasic_mtl_attach(struct terasic_mtl_softc *sc) +{ + int error; + + error = terasic_mtl_reg_attach(sc); + if (error) + goto error; + error = terasic_mtl_pixel_attach(sc); + if (error) + goto error; + error = terasic_mtl_text_attach(sc); + if (error) + goto error; + /* + * XXXRW: Once we've attached syscons, we can't detach it, so do it + * last. + */ + error = terasic_mtl_syscons_attach(sc); + if (error) + goto error; + terasic_mtl_blend_default_set(sc, TERASIC_MTL_COLOR_BLACK); + terasic_mtl_blend_pixel_set(sc, TERASIC_MTL_ALPHA_TRANSPARENT); + terasic_mtl_blend_textfg_set(sc, TERASIC_MTL_ALPHA_OPAQUE); + terasic_mtl_blend_textbg_set(sc, TERASIC_MTL_ALPHA_OPAQUE); + return (0); +error: + terasic_mtl_text_detach(sc); + terasic_mtl_pixel_detach(sc); + terasic_mtl_reg_detach(sc); + return (error); +} + +void +terasic_mtl_detach(struct terasic_mtl_softc *sc) +{ + + /* XXXRW: syscons can't detach, but we try anyway, only to panic. */ + terasic_mtl_syscons_detach(sc); + + /* All other aspects of the driver can detach just fine. */ + terasic_mtl_text_detach(sc); + terasic_mtl_pixel_detach(sc); + terasic_mtl_reg_detach(sc); +} Added: head/sys/dev/terasic/mtl/terasic_mtl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/mtl/terasic_mtl.h Sat Aug 25 22:35:29 2012 (r239691) @@ -0,0 +1,210 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 _DEV_TERASIC_MTL_H_ +#define _DEV_TERASIC_MTL_H_ + +struct terasic_mtl_softc { + /* + * syscons requires that its video_adapter_t be at the front of the + * softc, so place syscons fields first, which we otherwise would + * probably not do. + */ + video_adapter_t mtl_va; + + /* + * Bus-related fields. + */ + device_t mtl_dev; + int mtl_unit; + + /* + * The MTL driver doesn't require a lot of synchronisation; however, + * the lock is used to protect read-modify-write operations on MTL + * registers. + */ + struct mtx mtl_lock; + + /* + * Control register device -- mappable from userspace. + */ + struct cdev *mtl_reg_cdev; + struct resource *mtl_reg_res; + int mtl_reg_rid; + + /* + * Graphics frame buffer device -- mappable form userspace. + */ + struct cdev *mtl_pixel_cdev; + struct resource *mtl_pixel_res; + int mtl_pixel_rid; + + /* + * Text frame buffer device -- mappable from userspace, and syscons + * hookup. + */ + struct cdev *mtl_text_cdev; + struct resource *mtl_text_res; + int mtl_text_rid; + uint16_t *mtl_text_soft; +}; + +#define TERASIC_MTL_LOCK(sc) mtx_lock(&(sc)->mtl_lock) +#define TERASIC_MTL_LOCK_ASSERT(sc) mtx_assert(&(sc)->mtl_lock, MA_OWNED) +#define TERASIC_MTL_LOCK_DESTROY(sc) mtx_destroy(&(sc)->mtl_lock) +#define TERASIC_MTL_LOCK_INIT(sc) mtx_init(&(sc)->mtl_lock, \ + "terasic_mtl", NULL, MTX_DEF) +#define TERASIC_MTL_UNLOCK(sc) mtx_unlock(&(sc)->mtl_lock) + +/* + * Constant properties of the MTL text frame buffer. + */ +#define TERASIC_MTL_COLS 100 +#define TERASIC_MTL_ROWS 40 + +/* + * MTL control register offsets. + */ +#define TERASIC_MTL_OFF_BLEND 0 +#define TERASIC_MTL_OFF_TEXTCURSOR 4 +#define TERASIC_MTL_OFF_TEXTFRAMEBUFADDR 8 +#define TERASIC_MTL_OFF_TOUCHPOINT_X1 12 +#define TERASIC_MTL_OFF_TOUCHPOINT_Y1 16 +#define TERASIC_MTL_OFF_TOUCHPOINT_X2 20 +#define TERASIC_MTL_OFF_TOUCHPOINT_Y2 24 +#define TERASIC_MTL_OFF_TOUCHGESTURE 28 + +/* + * Constants to help interpret various control registers. + */ +#define TERASIC_MTL_BLEND_DEFAULT_MASK 0x0f000000 +#define TERASIC_MTL_BLEND_DEFAULT_SHIFT 24 +#define TERASIC_MTL_BLEND_PIXEL_MASK 0x00ff0000 +#define TERASIC_MTL_BLEND_PIXEL_SHIFT 16 +#define TERASIC_MTL_BLEND_TEXTFG_MASK 0x0000ff00 +#define TERASIC_MTL_BLEND_TEXTFG_SHIFT 8 +#define TERASIC_MTL_BLEND_TEXTBG_MASK 0x000000ff +#define TERASIC_MTL_BLEND_TEXTBG_SHIFT 0 +#define TERASIC_MTL_TEXTCURSOR_COL_MASK 0xff00 +#define TERASIC_MTL_TEXTCURSOR_COL_SHIFT 8 +#define TERASIC_MTL_TEXTCURSOR_ROW_MASK 0xff + +/* + * Colours used both by VGA-like text rendering, and for the default display + * colour. + */ +#define TERASIC_MTL_COLOR_BLACK 0 +#define TERASIC_MTL_COLOR_DARKBLUE 1 +#define TERASIC_MTL_COLOR_DARKGREEN 2 +#define TERASIC_MTL_COLOR_DARKCYAN 3 +#define TERASIC_MTL_COLOR_DARKRED 4 +#define TERASIC_MTL_COLOR_DARKMAGENTA 5 +#define TERASIC_MTL_COLOR_BROWN 6 +#define TERASIC_MTL_COLOR_LIGHTGREY 7 +#define TERASIC_MTL_COLOR_DARKGREY 8 +#define TERASIC_MTL_COLOR_LIGHTBLUE 9 +#define TERASIC_MTL_COLOR_LIGHTGREEN 10 +#define TERASIC_MTL_COLOR_LIGHTCYAN 11 +#define TERASIC_MTL_COLOR_LIGHTRED 12 +#define TERASIC_MTL_COLOR_LIGHTMAGENTA 13 +#define TERASIC_MTL_COLOR_LIGHTYELLOW 14 +#define TERASIC_MTL_COLOR_WHITE 15 +#define TERASIC_MTL_COLORMASK_BLINK 0x80 + +/* + * Constants to help interpret the text frame buffer. + */ +#define TERASIC_MTL_TEXTFRAMEBUF_EXPECTED_ADDR 0x0177000 +#define TERASIC_MTL_TEXTFRAMEBUF_CHAR_SHIFT 0 +#define TERASIC_MTL_TEXTFRAMEBUF_ATTR_SHIFT 8 + +/* + * Alpha-blending constants. + */ +#define TERASIC_MTL_ALPHA_TRANSPARENT 0 +#define TERASIC_MTL_ALPHA_OPAQUE 255 + +/* + * Driver setup routines from the bus attachment/teardown. + */ +int terasic_mtl_attach(struct terasic_mtl_softc *sc); +void terasic_mtl_detach(struct terasic_mtl_softc *sc); + +/* + * Sub-driver setup routines. + */ +int terasic_mtl_pixel_attach(struct terasic_mtl_softc *sc); +void terasic_mtl_pixel_detach(struct terasic_mtl_softc *sc); +int terasic_mtl_reg_attach(struct terasic_mtl_softc *sc); +void terasic_mtl_reg_detach(struct terasic_mtl_softc *sc); +int terasic_mtl_syscons_attach(struct terasic_mtl_softc *sc); +void terasic_mtl_syscons_detach(struct terasic_mtl_softc *sc); +int terasic_mtl_text_attach(struct terasic_mtl_softc *sc); +void terasic_mtl_text_detach(struct terasic_mtl_softc *sc); + +/* + * Control register I/O routines. + */ +void terasic_mtl_reg_blank(struct terasic_mtl_softc *sc); + +void terasic_mtl_reg_blend_get(struct terasic_mtl_softc *sc, + uint32_t *blendp); +void terasic_mtl_reg_blend_set(struct terasic_mtl_softc *sc, + uint32_t blend); +void terasic_mtl_reg_textcursor_get(struct terasic_mtl_softc *sc, + uint8_t *colp, uint8_t *rowp); +void terasic_mtl_reg_textcursor_set(struct terasic_mtl_softc *sc, + uint8_t col, uint8_t row); +void terasic_mtl_reg_textframebufaddr_get(struct terasic_mtl_softc *sc, + uint32_t *addrp); +void terasic_mtl_reg_textframebufaddr_set(struct terasic_mtl_softc *sc, + uint32_t addr); + +/* + * Read-modify-write updates of sub-bytes of the blend register. + */ +void terasic_mtl_blend_default_set(struct terasic_mtl_softc *sc, + uint8_t colour); +void terasic_mtl_blend_pixel_set(struct terasic_mtl_softc *sc, + uint8_t alpha); +void terasic_mtl_blend_textfg_set(struct terasic_mtl_softc *sc, + uint8_t alpha); +void terasic_mtl_blend_textbg_set(struct terasic_mtl_softc *sc, + uint8_t alpha); + +/* + * Text frame buffer I/O routines. + */ +void terasic_mtl_text_putc(struct terasic_mtl_softc *sc, u_int x, u_int y, + uint8_t c, uint8_t a); + +#endif /* _DEV_TERASIC_MTL_H_ */ Added: head/sys/dev/terasic/mtl/terasic_mtl_nexus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/mtl/terasic_mtl_nexus.c Sat Aug 25 22:35:29 2012 (r239691) @@ -0,0 +1,196 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 /* struct vt_mode */ +#include /* video_adapter_t */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +static int +terasic_mtl_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Terasic Multi-touch LCD (MTL)"); + return (BUS_PROBE_DEFAULT); +} + +static int +terasic_mtl_nexus_attach(device_t dev) +{ + struct terasic_mtl_softc *sc; + u_long pixel_maddr, text_maddr, reg_maddr; + u_long pixel_msize, text_msize, reg_msize; + int error; + + sc = device_get_softc(dev); + sc->mtl_dev = dev; + sc->mtl_unit = device_get_unit(dev); + + /* + * Query non-standard hints to find the locations of our two memory + * regions. Enforce certain alignment and size requirements. + */ + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "reg_maddr", ®_maddr) != 0 || (reg_maddr % PAGE_SIZE != 0)) { + device_printf(dev, "improper register address"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "reg_msize", ®_msize) != 0 || (reg_msize % PAGE_SIZE != 0)) { + device_printf(dev, "improper register size"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "pixel_maddr", &pixel_maddr) != 0 || + (pixel_maddr % PAGE_SIZE != 0)) { + device_printf(dev, "improper pixel frame buffer address"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "pixel_msize", &pixel_msize) != 0 || + (pixel_msize % PAGE_SIZE != 0)) { + device_printf(dev, "improper pixel frame buffer size"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "text_maddr", &text_maddr) != 0 || + (text_maddr % PAGE_SIZE != 0)) { + device_printf(dev, "improper text frame buffer address"); + return (ENXIO); + } + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + "text_msize", &text_msize) != 0 || + (text_msize % PAGE_SIZE != 0)) { + device_printf(dev, "improper text frame buffer size"); + return (ENXIO); + } + + /* + * Allocate resources. + */ + sc->mtl_reg_rid = 0; + sc->mtl_reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY, + &sc->mtl_reg_rid, reg_maddr, reg_maddr + reg_msize - 1, + reg_msize, RF_ACTIVE); + if (sc->mtl_reg_res == NULL) { + device_printf(dev, "couldn't map register memory\n"); + error = ENXIO; + goto error; + } + device_printf(sc->mtl_dev, "registers at mem %p-%p\n", + (void *)reg_maddr, (void *)(reg_maddr + reg_msize)); + sc->mtl_pixel_rid = 0; + sc->mtl_pixel_res = bus_alloc_resource(dev, SYS_RES_MEMORY, + &sc->mtl_pixel_rid, pixel_maddr, pixel_maddr + pixel_msize - 1, + pixel_msize, RF_ACTIVE); + if (sc->mtl_pixel_res == NULL) { + device_printf(dev, "couldn't map pixel memory\n"); + error = ENXIO; + goto error; + } + device_printf(sc->mtl_dev, "pixel frame buffer at mem %p-%p\n", + (void *)pixel_maddr, (void *)(pixel_maddr + pixel_msize)); + sc->mtl_text_rid = 0; + sc->mtl_text_res = bus_alloc_resource(dev, SYS_RES_MEMORY, + &sc->mtl_text_rid, text_maddr, text_maddr + text_msize - 1, + text_msize, RF_ACTIVE); + if (sc->mtl_text_res == NULL) { + device_printf(dev, "couldn't map text memory\n"); + error = ENXIO; + goto error; + } + device_printf(sc->mtl_dev, "text frame buffer at mem %p-%p\n", + (void *)text_maddr, (void *)(text_maddr + text_msize)); + error = terasic_mtl_attach(sc); + if (error == 0) + return (0); +error: + if (sc->mtl_text_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_text_rid, + sc->mtl_text_res); + if (sc->mtl_pixel_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_pixel_rid, + sc->mtl_pixel_res); + if (sc->mtl_reg_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_reg_rid, + sc->mtl_reg_res); + return (error); +} + +static int +terasic_mtl_nexus_detach(device_t dev) +{ + struct terasic_mtl_softc *sc; + + sc = device_get_softc(dev); + terasic_mtl_detach(sc); + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_text_rid, + sc->mtl_text_res); + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_pixel_rid, + sc->mtl_pixel_res); + bus_release_resource(dev, SYS_RES_MEMORY, sc->mtl_reg_rid, + sc->mtl_reg_res); + return (0); +} + +static device_method_t terasic_mtl_nexus_methods[] = { + DEVMETHOD(device_probe, terasic_mtl_nexus_probe), + DEVMETHOD(device_attach, terasic_mtl_nexus_attach), + DEVMETHOD(device_detach, terasic_mtl_nexus_detach), + { 0, 0 } +}; + +static driver_t terasic_mtl_nexus_driver = { + "terasic_mtl", + terasic_mtl_nexus_methods, + sizeof(struct terasic_mtl_softc), +}; + +static devclass_t terasic_mtl_devclass; + +DRIVER_MODULE(mtl, nexus, terasic_mtl_nexus_driver, terasic_mtl_devclass, 0, + 0); Added: head/sys/dev/terasic/mtl/terasic_mtl_pixel.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/mtl/terasic_mtl_pixel.c Sat Aug 25 22:35:29 2012 (r239691) @@ -0,0 +1,159 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 /* struct vt_mode */ +#include /* video_adapter_t */ +#include +#include +#include +#include + +#include +#include +#include + +#include + +static d_mmap_t terasic_mtl_pixel_mmap; +static d_read_t terasic_mtl_pixel_read; +static d_write_t terasic_mtl_pixel_write; + +static struct cdevsw mtl_pixel_cdevsw = { + .d_version = D_VERSION, + .d_mmap = terasic_mtl_pixel_mmap, + .d_read = terasic_mtl_pixel_read, + .d_write = terasic_mtl_pixel_write, + .d_name = "terasic_mtl_pixel", +}; + +/* + * All I/O to/from the MTL pixel device must be 32-bit, and aligned to 32-bit. + */ +static int +terasic_mtl_pixel_read(struct cdev *dev, struct uio *uio, int flag) +{ + struct terasic_mtl_softc *sc; + u_long offset, size; + uint32_t v; + int error; + + if (uio->uio_offset < 0 || uio->uio_offset % 4 != 0 || + uio->uio_resid % 4 != 0) + return (ENODEV); + sc = dev->si_drv1; + size = rman_get_size(sc->mtl_pixel_res); + error = 0; + if ((uio->uio_offset + uio->uio_resid < 0) || + (uio->uio_offset + uio->uio_resid > size)) + return (ENODEV); + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + sizeof(v) > size) + return (ENODEV); + v = bus_read_4(sc->mtl_pixel_res, offset); + error = uiomove(&v, sizeof(v), uio); + if (error) + return (error); + } + return (error); +} + +static int +terasic_mtl_pixel_write(struct cdev *dev, struct uio *uio, int flag) +{ + struct terasic_mtl_softc *sc; + u_long offset, size; + uint32_t v; + int error; + + if (uio->uio_offset < 0 || uio->uio_offset % 4 != 0 || + uio->uio_resid % 4 != 0) + return (ENODEV); + sc = dev->si_drv1; + size = rman_get_size(sc->mtl_pixel_res); + error = 0; + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + sizeof(v) > size) + return (ENODEV); + error = uiomove(&v, sizeof(v), uio); + if (error) + return (error); + bus_write_4(sc->mtl_pixel_res, offset, v); + } + return (error); +} + +static int +terasic_mtl_pixel_mmap(struct cdev *dev, vm_ooffset_t offset, + vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr) +{ + struct terasic_mtl_softc *sc; + int error; + + sc = dev->si_drv1; + error = 0; + if (trunc_page(offset) == offset && + rman_get_size(sc->mtl_pixel_res) >= offset + PAGE_SIZE) { + *paddr = rman_get_start(sc->mtl_pixel_res) + offset; + *memattr = VM_MEMATTR_UNCACHEABLE; + } else + error = ENODEV; + return (error); +} + +int +terasic_mtl_pixel_attach(struct terasic_mtl_softc *sc) +{ + + sc->mtl_pixel_cdev = make_dev(&mtl_pixel_cdevsw, sc->mtl_unit, + UID_ROOT, GID_WHEEL, 0400, "mtl_pixel%d", sc->mtl_unit); + if (sc->mtl_pixel_cdev == NULL) { + device_printf(sc->mtl_dev, "%s: make_dev failed\n", __func__); + return (ENXIO); + } + /* XXXRW: Slight race between make_dev(9) and here. */ + sc->mtl_pixel_cdev->si_drv1 = sc; + return (0); +} + +void +terasic_mtl_pixel_detach(struct terasic_mtl_softc *sc) +{ + + if (sc->mtl_pixel_cdev != NULL) + destroy_dev(sc->mtl_pixel_cdev); +} Added: head/sys/dev/terasic/mtl/terasic_mtl_reg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/mtl/terasic_mtl_reg.c Sat Aug 25 22:35:29 2012 (r239691) @@ -0,0 +1,278 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * 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 /* struct vt_mode */ +#include +#include /* video_adapter_t */ +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +static d_mmap_t terasic_mtl_reg_mmap; +static d_read_t terasic_mtl_reg_read; +static d_write_t terasic_mtl_reg_write; + +static struct cdevsw terasic_mtl_reg_cdevsw = { + .d_version = D_VERSION, + .d_mmap = terasic_mtl_reg_mmap, + .d_read = terasic_mtl_reg_read, + .d_write = terasic_mtl_reg_write, + .d_name = "terasic_mtl_reg", +}; + +/* + * All I/O to/from the MTL register device must be 32-bit, and aligned to + * 32-bit. + */ +static int +terasic_mtl_reg_read(struct cdev *dev, struct uio *uio, int flag) +{ + struct terasic_mtl_softc *sc; + u_long offset, size; + uint32_t v; + int error; + + if (uio->uio_offset < 0 || uio->uio_offset % 4 != 0 || + uio->uio_resid % 4 != 0) + return (ENODEV); + sc = dev->si_drv1; + size = rman_get_size(sc->mtl_reg_res); + error = 0; + if ((uio->uio_offset + uio->uio_resid < 0) || + (uio->uio_offset + uio->uio_resid > size)) + return (ENODEV); + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + sizeof(v) > size) + return (ENODEV); + v = bus_read_4(sc->mtl_reg_res, offset); + error = uiomove(&v, sizeof(v), uio); + if (error) + return (error); + } + return (error); +} + +static int +terasic_mtl_reg_write(struct cdev *dev, struct uio *uio, int flag) +{ + struct terasic_mtl_softc *sc; + u_long offset, size; + uint32_t v; + int error; + + if (uio->uio_offset < 0 || uio->uio_offset % 4 != 0 || + uio->uio_resid % 4 != 0) + return (ENODEV); + sc = dev->si_drv1; + size = rman_get_size(sc->mtl_reg_res); + error = 0; + while (uio->uio_resid > 0) { + offset = uio->uio_offset; + if (offset + sizeof(v) > size) + return (ENODEV); + error = uiomove(&v, sizeof(v), uio); + if (error) + return (error); + bus_write_4(sc->mtl_reg_res, offset, v); + } + return (error); +} + +static int +terasic_mtl_reg_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) +{ + struct terasic_mtl_softc *sc; + int error; + + sc = dev->si_drv1; + error = 0; + if (trunc_page(offset) == offset && + rman_get_size(sc->mtl_reg_res) >= offset + PAGE_SIZE) { + *paddr = rman_get_start(sc->mtl_reg_res) + offset; + *memattr = VM_MEMATTR_UNCACHEABLE; + } else + error = ENODEV; + return (error); +} + +void +terasic_mtl_reg_blend_get(struct terasic_mtl_softc *sc, uint32_t *blendp) +{ + + *blendp = le32toh(bus_read_4(sc->mtl_reg_res, TERASIC_MTL_OFF_BLEND)); +} + +void +terasic_mtl_reg_blend_set(struct terasic_mtl_softc *sc, uint32_t blend) +{ + + bus_write_4(sc->mtl_reg_res, TERASIC_MTL_OFF_BLEND, htole32(blend)); +} + +void +terasic_mtl_blend_default_set(struct terasic_mtl_softc *sc, uint8_t colour) +{ + uint32_t v; + + TERASIC_MTL_LOCK(sc); + terasic_mtl_reg_blend_get(sc, &v); + v &= ~TERASIC_MTL_BLEND_DEFAULT_MASK; + v |= colour << TERASIC_MTL_BLEND_DEFAULT_SHIFT; + terasic_mtl_reg_blend_set(sc, v); + TERASIC_MTL_UNLOCK(sc); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 23:01: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 7AA2D1065673; Sat, 25 Aug 2012 23:01:58 +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 6607A8FC1C; Sat, 25 Aug 2012 23:01: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 q7PN1wSv010229; Sat, 25 Aug 2012 23:01:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PN1wQR010227; Sat, 25 Aug 2012 23:01:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208252301.q7PN1wQR010227@svn.freebsd.org> From: Alexander Motin Date: Sat, 25 Aug 2012 23:01: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: r239693 - head/sys/dev/ahci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 23:01:58 -0000 Author: mav Date: Sat Aug 25 23:01:57 2012 New Revision: 239693 URL: http://svn.freebsd.org/changeset/base/239693 Log: Return "locally assigned" Enclosure Logical Identifier instead of 8 zero bytes. Zeroes there are incorrect and tend to cause false device ID matches. Modified: head/sys/dev/ahci/ahciem.c Modified: head/sys/dev/ahci/ahciem.c ============================================================================== --- head/sys/dev/ahci/ahciem.c Sat Aug 25 22:45:26 2012 (r239692) +++ head/sys/dev/ahci/ahciem.c Sat Aug 25 23:01:57 2012 (r239693) @@ -380,6 +380,8 @@ ahci_em_emulate_ses_on_led(device_t dev, ccb->ataio.cmd.sector_count >= 16) { bzero(buf, ccb->ataio.dxfer_len); buf[0] = 64; /* Valid bytes. */ + buf[2] = 0x30; /* NAA Locally Assigned. */ + strncpy(&buf[3], device_get_nameunit(dev), 7); strncpy(&buf[10], "AHCI ", SID_VENDOR_SIZE); strncpy(&buf[18], "SGPIO Enclosure ", SID_PRODUCT_SIZE); strncpy(&buf[34], "1.00", SID_REVISION_SIZE); From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 23:08: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 49297106564A; Sat, 25 Aug 2012 23:08:25 +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 342508FC0C; Sat, 25 Aug 2012 23:08: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 q7PN8PM1011084; Sat, 25 Aug 2012 23:08:25 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PN8O33011081; Sat, 25 Aug 2012 23:08:24 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208252308.q7PN8O33011081@svn.freebsd.org> From: Dimitry Andric Date: Sat, 25 Aug 2012 23:08: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: r239695 - in head/gnu/lib: libstdc++ libsupc++ X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 23:08:25 -0000 Author: dim Date: Sat Aug 25 23:08:24 2012 New Revision: 239695 URL: http://svn.freebsd.org/changeset/base/239695 Log: For building libstdc++ and libsupc++, filter out any -stdlib=libc++ option from CXXFLAGS, otherwise these libraries will not build. Similarly, filter out any -std=xxx options that aren't supported. Submitted by: Yamaya Takashi MFC after: 2 weeks Modified: head/gnu/lib/libstdc++/Makefile head/gnu/lib/libsupc++/Makefile Modified: head/gnu/lib/libstdc++/Makefile ============================================================================== --- head/gnu/lib/libstdc++/Makefile Sat Aug 25 23:03:45 2012 (r239694) +++ head/gnu/lib/libstdc++/Makefile Sat Aug 25 23:08:24 2012 (r239695) @@ -22,6 +22,7 @@ CFLAGS+= -I${GCCLIB}/include -I${SRCDIR} CFLAGS+= -frandom-seed=RepeatabilityConsideredGood CXXFLAGS+= -fno-implicit-templates -ffunction-sections -fdata-sections \ -Wno-deprecated +CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]} PO_CXXFLAGS= ${CXXFLAGS:N-ffunction-sections} DPADD= ${LIBM} Modified: head/gnu/lib/libsupc++/Makefile ============================================================================== --- head/gnu/lib/libsupc++/Makefile Sat Aug 25 23:03:45 2012 (r239694) +++ head/gnu/lib/libsupc++/Makefile Sat Aug 25 23:08:24 2012 (r239695) @@ -24,6 +24,7 @@ CFLAGS+= -I${GCCLIB}/include -I${SRCDIR} CFLAGS+= -I${.CURDIR}/../libstdc++ -I. CFLAGS+= -frandom-seed=RepeatabilityConsideredGood CXXFLAGS+= -fno-implicit-templates -ffunction-sections -fdata-sections +CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]} PO_CXXFLAGS= ${CXXFLAGS:N-ffunction-sections} HDRS= exception new typeinfo cxxabi.h exception_defines.h From owner-svn-src-head@FreeBSD.ORG Sat Aug 25 23:59:32 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 35DDD1065689; Sat, 25 Aug 2012 23:59:32 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F07E8FC0A; Sat, 25 Aug 2012 23:59: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 q7PNxVFA018143; Sat, 25 Aug 2012 23:59:31 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7PNxVrT018134; Sat, 25 Aug 2012 23:59:31 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208252359.q7PNxVrT018134@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 25 Aug 2012 23:59: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: r239696 - in head/sys: arm/arm arm/include conf dev/fb dev/syscons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 25 Aug 2012 23:59:32 -0000 Author: gonzo Date: Sat Aug 25 23:59:31 2012 New Revision: 239696 URL: http://svn.freebsd.org/changeset/base/239696 Log: Piggyback MIPS changes and add ARM syscons support for devices with framebuffer While here - sort #if defined() order alphabetically Added: head/sys/arm/arm/sc_machdep.c (contents, props changed) head/sys/arm/include/sc_machdep.h (contents, props changed) Modified: head/sys/conf/files.arm head/sys/conf/options.arm head/sys/dev/fb/fbreg.h head/sys/dev/syscons/schistory.c head/sys/dev/syscons/scterm-teken.c head/sys/dev/syscons/syscons.c Added: head/sys/arm/arm/sc_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/sc_machdep.c Sat Aug 25 23:59:31 2012 (r239696) @@ -0,0 +1,90 @@ +/*- + * Copyright (c) 2003 Jake Burkholder. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static sc_softc_t sc_softcs[8]; + +int +sc_get_cons_priority(int *unit, int *flags) +{ + + *unit = 0; + *flags = 0; + return (CN_INTERNAL); +} + +int +sc_max_unit(void) +{ + return (1); +} + +sc_softc_t * +sc_get_softc(int unit, int flags) +{ + sc_softc_t *sc; + + if (unit < 0) + return (NULL); + sc = &sc_softcs[unit]; + sc->unit = unit; + if ((sc->flags & SC_INIT_DONE) == 0) { + sc->keyboard = -1; + sc->adapter = -1; + sc->cursor_char = SC_CURSOR_CHAR; + sc->mouse_char = SC_MOUSE_CHAR; + } + return (sc); +} + +void +sc_get_bios_values(bios_values_t *values) +{ + values->cursor_start = 0; + values->cursor_end = 32; + values->shift_state = 0; +} + +int +sc_tone(int hz) +{ + return (0); +} Added: head/sys/arm/include/sc_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/sc_machdep.h Sat Aug 25 23:59:31 2012 (r239696) @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 2003 Jake Burkholder. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_SC_MACHDEP_H_ +#define _MACHINE_SC_MACHDEP_H_ + +/* Color attributes for foreground text */ + +#define FG_BLACK 0x0 +#define FG_BLUE 0x1 +#define FG_GREEN 0x2 +#define FG_CYAN 0x3 +#define FG_RED 0x4 +#define FG_MAGENTA 0x5 +#define FG_BROWN 0x6 +#define FG_LIGHTGREY 0x7 /* aka white */ +#define FG_DARKGREY 0x8 +#define FG_LIGHTBLUE 0x9 +#define FG_LIGHTGREEN 0xa +#define FG_LIGHTCYAN 0xb +#define FG_LIGHTRED 0xc +#define FG_LIGHTMAGENTA 0xd +#define FG_YELLOW 0xe +#define FG_WHITE 0xf /* aka bright white */ +#define FG_BLINK 0x80 + +/* Color attributes for text background */ + +#define BG_BLACK 0x00 +#define BG_BLUE 0x10 +#define BG_GREEN 0x20 +#define BG_CYAN 0x30 +#define BG_RED 0x40 +#define BG_MAGENTA 0x50 +#define BG_BROWN 0x60 +#define BG_LIGHTGREY 0x70 +#define BG_DARKGREY 0x80 +#define BG_LIGHTBLUE 0x90 +#define BG_LIGHTGREEN 0xa0 +#define BG_LIGHTCYAN 0xb0 +#define BG_LIGHTRED 0xc0 +#define BG_LIGHTMAGENTA 0xd0 +#define BG_YELLOW 0xe0 +#define BG_WHITE 0xf0 + +#endif /* !_MACHINE_SC_MACHDEP_H_ */ Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Sat Aug 25 23:08:24 2012 (r239695) +++ head/sys/conf/files.arm Sat Aug 25 23:59:31 2012 (r239696) @@ -1,4 +1,9 @@ # $FreeBSD$ +font.h optional sc \ + compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ + no-obj no-implicit-rule before-depend \ + clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" + crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb arm/arm/autoconf.c standard @@ -37,6 +42,7 @@ arm/arm/nexus.c standard arm/arm/pl310.c optional pl310 arm/arm/pmap.c optional cpu_arm9 | cpu_arm9e | cpu_fa526 | cpu_sa1100 | cpu_sa1110 | cpu_xscale_80219 | cpu_xscale_80321 | cpu_xscale_81342 | cpu_xscale_ixp425 | cpu_xscale_ixp435 | cpu_xscale_pxa2x0 arm/arm/pmap-v6.c optional cpu_arm11 | cpu_cortexa | cpu_mv_pj4b +arm/arm/sc_machdep.c optional sc arm/arm/setcpsr.S standard arm/arm/setstack.s standard arm/arm/stack_machdep.c optional ddb | stack @@ -53,13 +59,18 @@ arm/fpe-arm/armfpe_glue.S optional armfp arm/fpe-arm/armfpe_init.c optional armfpe arm/fpe-arm/armfpe.S optional armfpe cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs compile-with "${ZFS_C}" +dev/fb/fb.c optional sc dev/hwpmc/hwpmc_arm.c optional hwpmc +dev/kbd/kbd.c optional sc dev/ofw/openfirm.c optional fdt dev/ofw/openfirmio.c optional fdt dev/ofw/ofw_bus_if.m optional fdt dev/ofw/ofw_if.m optional fdt dev/ofw/ofw_bus_subr.c optional fdt dev/ofw/ofw_fdt.c optional fdt +dev/syscons/scgfbrndr.c optional sc +dev/syscons/scterm-teken.c optional sc +dev/syscons/scvtb.c optional sc geom/geom_bsd.c optional geom_bsd geom/geom_bsd_enc.c optional geom_bsd geom/geom_mbr.c optional geom_mbr Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Sat Aug 25 23:08:24 2012 (r239695) +++ head/sys/conf/options.arm Sat Aug 25 23:59:31 2012 (r239696) @@ -55,4 +55,7 @@ VM_MAXUSER_ADDRESS opt_global.h AT91_ATE_USE_RMII opt_at91.h AT91_MCI_HAS_4WIRE opt_at91.h AT91_MCI_SLOT_B opt_at91.h +GFB_DEBUG opt_gfb.h +GFB_NO_FONT_LOADING opt_gfb.h +GFB_NO_MODE_CHANGE opt_gfb.h AT91C_MAIN_CLOCK opt_at91.h Modified: head/sys/dev/fb/fbreg.h ============================================================================== --- head/sys/dev/fb/fbreg.h Sat Aug 25 23:08:24 2012 (r239695) +++ head/sys/dev/fb/fbreg.h Sat Aug 25 23:59:31 2012 (r239696) @@ -92,7 +92,7 @@ void ofwfb_fillw(int pat, void *base, si u_int16_t ofwfb_readw(u_int16_t *addr); void ofwfb_writew(u_int16_t *addr, u_int16_t val); -#elif defined(__mips__) +#elif defined(__mips__) || defined(__arm__) /* * Use amd64/i386-like settings under the assumption that MIPS-based display @@ -115,6 +115,11 @@ fillw(int val, uint16_t *buf, size_t siz } #define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) +#if defined(__arm__) +#define readw(a) (*(uint16_t*)(a)) +#define writew(a, v) (*(uint16_t*)(a) = (v)) +#endif + #else /* !__i386__ && !__amd64__ && !__ia64__ && !__sparc64__ && !__powerpc__ */ #define bcopy_io(s, d, c) memcpy_io((d), (s), (c)) #define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c)) Modified: head/sys/dev/syscons/schistory.c ============================================================================== --- head/sys/dev/syscons/schistory.c Sat Aug 25 23:08:24 2012 (r239695) +++ head/sys/dev/syscons/schistory.c Sat Aug 25 23:59:31 2012 (r239696) @@ -42,7 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) +#if defined(__arm__) || defined(__mips__) || \ + defined(__powerpc__) || defined(__sparc64__) #include #else #include Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Sat Aug 25 23:08:24 2012 (r239695) +++ head/sys/dev/syscons/scterm-teken.c Sat Aug 25 23:59:31 2012 (r239696) @@ -40,7 +40,8 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) +#if defined(__arm__) || defined(__mips__) || \ + defined(__powerpc__) || defined(__sparc64__) #include #else #include Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Sat Aug 25 23:08:24 2012 (r239695) +++ head/sys/dev/syscons/syscons.c Sat Aug 25 23:59:31 2012 (r239696) @@ -62,7 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__sparc64__) || defined(__powerpc__) || defined(__mips__) +#if defined(__arm__) || defined(__mips__) || \ + defined(__powerpc__) || defined(__sparc64__) #include #else #include