From owner-svn-src-head@FreeBSD.ORG Sun Jul 18 00:24:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 075BC1065670; Sun, 18 Jul 2010 00:24:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB46F8FC18; Sun, 18 Jul 2010 00:24:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6I0O1up084231; Sun, 18 Jul 2010 00:24:01 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6I0O1rC084228; Sun, 18 Jul 2010 00:24:01 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201007180024.o6I0O1rC084228@svn.freebsd.org> From: Rick Macklem Date: Sun, 18 Jul 2010 00:24: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: r210201 - in head/sys/fs: nfs nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jul 2010 00:24:02 -0000 Author: rmacklem Date: Sun Jul 18 00:24:01 2010 New Revision: 210201 URL: http://svn.freebsd.org/changeset/base/210201 Log: Change the nfscl_mustflush() function in the experimental NFSv4 client to return a boolean_t in order to make it more compatible with style(9). MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsclient/nfs_clsubs.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Sat Jul 17 18:35:39 2010 (r210200) +++ head/sys/fs/nfs/nfs_var.h Sun Jul 18 00:24:01 2010 (r210201) @@ -467,7 +467,7 @@ void nfscl_docb(struct nfsrv_descript *, void nfscl_releasealllocks(struct nfsclclient *, vnode_t, NFSPROC_T *); int nfscl_lockt(vnode_t, struct nfsclclient *, u_int64_t, u_int64_t, struct flock *, NFSPROC_T *); -int nfscl_mustflush(vnode_t); +boolean_t nfscl_mustflush(vnode_t); int nfscl_nodeleg(vnode_t, int); int nfscl_removedeleg(vnode_t, NFSPROC_T *, nfsv4stateid_t *); int nfscl_getref(struct nfsmount *); Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Sat Jul 17 18:35:39 2010 (r210200) +++ head/sys/fs/nfsclient/nfs_clstate.c Sun Jul 18 00:24:01 2010 (r210201) @@ -3735,7 +3735,7 @@ nfscl_tryclose(struct nfsclopen *op, str * to the server. This might be a big performance win in some environments. * (Not useful until the client does caching on local stable storage.) */ -APPLESTATIC int +APPLESTATIC boolean_t nfscl_mustflush(vnode_t vp) { struct nfsclclient *clp; @@ -3746,12 +3746,12 @@ nfscl_mustflush(vnode_t vp) np = VTONFS(vp); nmp = VFSTONFS(vnode_mount(vp)); if (!NFSHASNFSV4(nmp)) - return (1); + return (TRUE); NFSLOCKCLSTATE(); clp = nfscl_findcl(nmp); if (clp == NULL) { NFSUNLOCKCLSTATE(); - return (1); + return (TRUE); } dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); if (dp != NULL && (dp->nfsdl_flags & (NFSCLDL_WRITE | NFSCLDL_RECALL)) @@ -3759,10 +3759,10 @@ nfscl_mustflush(vnode_t vp) (dp->nfsdl_sizelimit >= np->n_size || !NFSHASSTRICT3530(nmp))) { NFSUNLOCKCLSTATE(); - return (0); + return (FALSE); } NFSUNLOCKCLSTATE(); - return (1); + return (TRUE); } /* Modified: head/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clsubs.c Sat Jul 17 18:35:39 2010 (r210200) +++ head/sys/fs/nfsclient/nfs_clsubs.c Sun Jul 18 00:24:01 2010 (r210201) @@ -188,7 +188,8 @@ ncl_getattrcache(struct vnode *vp, struc struct nfsnode *np; struct vattr *vap; struct nfsmount *nmp; - int timeo, mustflush; + int timeo; + boolean_t mustflush; np = VTONFS(vp); vap = &np->n_vattr.na_vattr; @@ -230,7 +231,7 @@ ncl_getattrcache(struct vnode *vp, struc #endif if ((time_second - np->n_attrstamp) >= timeo && - (mustflush != 0 || np->n_attrstamp == 0)) { + (mustflush || np->n_attrstamp == 0)) { newnfsstats.attrcache_misses++; mtx_unlock(&np->n_mtx); #ifdef NFS_ACDEBUG From owner-svn-src-head@FreeBSD.ORG Sun Jul 18 05:09:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33CD7106564A; Sun, 18 Jul 2010 05:09:11 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21A8B8FC08; Sun, 18 Jul 2010 05:09:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6I59BI7049828; Sun, 18 Jul 2010 05:09:11 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6I59B6B049826; Sun, 18 Jul 2010 05:09:11 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201007180509.o6I59B6B049826@svn.freebsd.org> From: Lawrence Stewart Date: Sun, 18 Jul 2010 05:09: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: r210203 - 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, 18 Jul 2010 05:09:11 -0000 Author: lstewart Date: Sun Jul 18 05:09:10 2010 New Revision: 210203 URL: http://svn.freebsd.org/changeset/base/210203 Log: - Move common code from the hook functions that fills in a packet node struct to a separate inline function. This further reduces duplicate code that didn't have a good reason to stay as it was. - Reorder the malloc of a pkt_node struct in the hook functions such that it only occurs if we managed to find a usable tcpcb associated with the packet. - Make the inp_locally_locked variable's type consistent with the prototype of siftr_siftdata(). Sponsored by: FreeBSD Foundation Modified: head/sys/netinet/siftr.c Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Sun Jul 18 04:27:39 2010 (r210202) +++ head/sys/netinet/siftr.c Sun Jul 18 05:09:10 2010 (r210203) @@ -746,6 +746,67 @@ siftr_findinpcb(int ipver, struct ip *ip } +static inline void +siftr_siftdata(struct pkt_node *pn, struct inpcb *inp, struct tcpcb *tp, + int ipver, int dir, int inp_locally_locked) +{ +#ifdef SIFTR_IPV6 + if (ipver == INP_IPV4) { + pn->ip_laddr[3] = inp->inp_laddr.s_addr; + pn->ip_faddr[3] = inp->inp_faddr.s_addr; +#else + *((uint32_t *)pn->ip_laddr) = inp->inp_laddr.s_addr; + *((uint32_t *)pn->ip_faddr) = inp->inp_faddr.s_addr; +#endif +#ifdef SIFTR_IPV6 + } else { + pn->ip_laddr[0] = inp->in6p_laddr.s6_addr32[0]; + pn->ip_laddr[1] = inp->in6p_laddr.s6_addr32[1]; + pn->ip_laddr[2] = inp->in6p_laddr.s6_addr32[2]; + pn->ip_laddr[3] = inp->in6p_laddr.s6_addr32[3]; + pn->ip_faddr[0] = inp->in6p_faddr.s6_addr32[0]; + pn->ip_faddr[1] = inp->in6p_faddr.s6_addr32[1]; + pn->ip_faddr[2] = inp->in6p_faddr.s6_addr32[2]; + pn->ip_faddr[3] = inp->in6p_faddr.s6_addr32[3]; + } +#endif + pn->tcp_localport = inp->inp_lport; + pn->tcp_foreignport = inp->inp_fport; + pn->snd_cwnd = tp->snd_cwnd; + pn->snd_wnd = tp->snd_wnd; + pn->rcv_wnd = tp->rcv_wnd; + pn->snd_bwnd = tp->snd_bwnd; + pn->snd_ssthresh = tp->snd_ssthresh; + pn->snd_scale = tp->snd_scale; + pn->rcv_scale = tp->rcv_scale; + pn->conn_state = tp->t_state; + pn->max_seg_size = tp->t_maxseg; + pn->smoothed_rtt = tp->t_srtt; + pn->sack_enabled = (tp->t_flags & TF_SACK_PERMIT) != 0; + pn->flags = tp->t_flags; + pn->rxt_length = tp->t_rxtcur; + pn->snd_buf_hiwater = inp->inp_socket->so_snd.sb_hiwat; + pn->snd_buf_cc = inp->inp_socket->so_snd.sb_cc; + pn->rcv_buf_hiwater = inp->inp_socket->so_rcv.sb_hiwat; + pn->rcv_buf_cc = inp->inp_socket->so_rcv.sb_cc; + pn->sent_inflight_bytes = tp->snd_max - tp->snd_una; + + /* We've finished accessing the tcb so release the lock. */ + if (inp_locally_locked) + INP_RUNLOCK(inp); + + pn->ipver = ipver; + pn->direction = dir; + + /* + * Significantly more accurate than using getmicrotime(), but slower! + * Gives true microsecond resolution at the expense of a hit to + * maximum pps throughput processing when SIFTR is loaded and enabled. + */ + microtime(&pn->tval); +} + + /* * pfil hook that is called for each IPv4 packet making its way through the * stack in either direction. @@ -758,13 +819,13 @@ static int siftr_chkpkt(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, struct inpcb *inp) { - struct pkt_node *pkt_node; + struct pkt_node *pn; struct ip *ip; struct tcphdr *th; struct tcpcb *tp; struct siftr_stats *ss; unsigned int ip_hl; - uint8_t inp_locally_locked; + int inp_locally_locked; inp_locally_locked = 0; ss = DPCPU_PTR(ss); @@ -818,18 +879,6 @@ siftr_chkpkt(void *arg, struct mbuf **m, INP_LOCK_ASSERT(inp); - pkt_node = malloc(sizeof(struct pkt_node), M_SIFTR_PKTNODE, - M_NOWAIT | M_ZERO); - - if (pkt_node == NULL) { - if (dir == PFIL_IN) - ss->nskip_in_malloc++; - else - ss->nskip_out_malloc++; - - goto inp_unlock; - } - /* Find the TCP control block that corresponds with this packet */ tp = intotcpcb(inp); @@ -844,53 +893,21 @@ siftr_chkpkt(void *arg, struct mbuf **m, else ss->nskip_out_tcpcb++; - free(pkt_node, M_SIFTR_PKTNODE); goto inp_unlock; } - /* Fill in pkt_node data */ -#ifdef SIFTR_IPV6 - pkt_node->ip_laddr[3] = inp->inp_laddr.s_addr; - pkt_node->ip_faddr[3] = inp->inp_faddr.s_addr; -#else - *((uint32_t *)pkt_node->ip_laddr) = inp->inp_laddr.s_addr; - *((uint32_t *)pkt_node->ip_faddr) = inp->inp_faddr.s_addr; -#endif - pkt_node->tcp_localport = inp->inp_lport; - pkt_node->tcp_foreignport = inp->inp_fport; - pkt_node->snd_cwnd = tp->snd_cwnd; - pkt_node->snd_wnd = tp->snd_wnd; - pkt_node->rcv_wnd = tp->rcv_wnd; - pkt_node->snd_bwnd = tp->snd_bwnd; - pkt_node->snd_ssthresh = tp->snd_ssthresh; - pkt_node->snd_scale = tp->snd_scale; - pkt_node->rcv_scale = tp->rcv_scale; - pkt_node->conn_state = tp->t_state; - pkt_node->max_seg_size = tp->t_maxseg; - pkt_node->smoothed_rtt = tp->t_srtt; - pkt_node->sack_enabled = (tp->t_flags & TF_SACK_PERMIT) != 0; - pkt_node->flags = tp->t_flags; - pkt_node->rxt_length = tp->t_rxtcur; - pkt_node->snd_buf_hiwater = inp->inp_socket->so_snd.sb_hiwat; - pkt_node->snd_buf_cc = inp->inp_socket->so_snd.sb_cc; - pkt_node->rcv_buf_hiwater = inp->inp_socket->so_rcv.sb_hiwat; - pkt_node->rcv_buf_cc = inp->inp_socket->so_rcv.sb_cc; - pkt_node->sent_inflight_bytes = tp->snd_max - tp->snd_una; + pn = malloc(sizeof(struct pkt_node), M_SIFTR_PKTNODE, M_NOWAIT|M_ZERO); - /* We've finished accessing the tcb so release the lock. */ - if (inp_locally_locked) - INP_RUNLOCK(inp); + if (pn == NULL) { + if (dir == PFIL_IN) + ss->nskip_in_malloc++; + else + ss->nskip_out_malloc++; - /* These are safe to access without the inp lock. */ - pkt_node->ipver = INP_IPV4; - pkt_node->direction = dir; + goto inp_unlock; + } - /* - * Significantly more accurate than using getmicrotime(), but slower! - * Gives true microsecond resolution at the expense of a hit to - * maximum pps throughput processing when SIFTR is loaded and enabled. - */ - microtime(&(pkt_node->tval)); + siftr_siftdata(pn, inp, tp, INP_IPV4, dir, inp_locally_locked); if (siftr_generate_hashes) { if ((*m)->m_pkthdr.csum_flags & CSUM_TCP) { @@ -950,11 +967,11 @@ siftr_chkpkt(void *arg, struct mbuf **m, * find a way to create the hash and checksum in the same pass * over the bytes. */ - pkt_node->hash = hash_pkt(*m, ip_hl); + pn->hash = hash_pkt(*m, ip_hl); } mtx_lock(&siftr_pkt_queue_mtx); - STAILQ_INSERT_TAIL(&pkt_queue, pkt_node, nodes); + STAILQ_INSERT_TAIL(&pkt_queue, pn, nodes); mtx_unlock(&siftr_pkt_queue_mtx); goto ret; @@ -973,13 +990,13 @@ static int siftr_chkpkt6(void *arg, struct mbuf **m, struct ifnet *ifp, int dir, struct inpcb *inp) { - struct pkt_node *pkt_node; + struct pkt_node *pn; struct ip6_hdr *ip6; struct tcphdr *th; struct tcpcb *tp; struct siftr_stats *ss; unsigned int ip6_hl; - uint8_t inp_locally_locked; + int inp_locally_locked; inp_locally_locked = 0; ss = DPCPU_PTR(ss); @@ -1037,18 +1054,6 @@ siftr_chkpkt6(void *arg, struct mbuf **m inp_locally_locked = 1; } - pkt_node = malloc(sizeof(struct pkt_node), M_SIFTR_PKTNODE, - M_NOWAIT | M_ZERO); - - if (pkt_node == NULL) { - if (dir == PFIL_IN) - ss->nskip_in_malloc++; - else - ss->nskip_out_malloc++; - - goto inp_unlock6; - } - /* Find the TCP control block that corresponds with this packet. */ tp = intotcpcb(inp); @@ -1063,59 +1068,26 @@ siftr_chkpkt6(void *arg, struct mbuf **m else ss->nskip_out_tcpcb++; - free(pkt_node, M_SIFTR_PKTNODE); goto inp_unlock6; } - /* Fill in pkt_node data. */ - pkt_node->ip_laddr[0] = inp->in6p_laddr.s6_addr32[0]; - pkt_node->ip_laddr[1] = inp->in6p_laddr.s6_addr32[1]; - pkt_node->ip_laddr[2] = inp->in6p_laddr.s6_addr32[2]; - pkt_node->ip_laddr[3] = inp->in6p_laddr.s6_addr32[3]; - pkt_node->ip_faddr[0] = inp->in6p_faddr.s6_addr32[0]; - pkt_node->ip_faddr[1] = inp->in6p_faddr.s6_addr32[1]; - pkt_node->ip_faddr[2] = inp->in6p_faddr.s6_addr32[2]; - pkt_node->ip_faddr[3] = inp->in6p_faddr.s6_addr32[3]; - pkt_node->tcp_localport = inp->inp_lport; - pkt_node->tcp_foreignport = inp->inp_fport; - pkt_node->snd_cwnd = tp->snd_cwnd; - pkt_node->snd_wnd = tp->snd_wnd; - pkt_node->rcv_wnd = tp->rcv_wnd; - pkt_node->snd_bwnd = tp->snd_bwnd; - pkt_node->snd_ssthresh = tp->snd_ssthresh; - pkt_node->snd_scale = tp->snd_scale; - pkt_node->rcv_scale = tp->rcv_scale; - pkt_node->conn_state = tp->t_state; - pkt_node->max_seg_size = tp->t_maxseg; - pkt_node->smoothed_rtt = tp->t_srtt; - pkt_node->sack_enabled = (tp->t_flags & TF_SACK_PERMIT) != 0; - pkt_node->flags = tp->t_flags; - pkt_node->rxt_length = tp->t_rxtcur; - pkt_node->snd_buf_hiwater = inp->inp_socket->so_snd.sb_hiwat; - pkt_node->snd_buf_cc = inp->inp_socket->so_snd.sb_cc; - pkt_node->rcv_buf_hiwater = inp->inp_socket->so_rcv.sb_hiwat; - pkt_node->rcv_buf_cc = inp->inp_socket->so_rcv.sb_cc; - pkt_node->sent_inflight_bytes = tp->snd_max - tp->snd_una; + pn = malloc(sizeof(struct pkt_node), M_SIFTR_PKTNODE, M_NOWAIT|M_ZERO); - /* We've finished accessing the tcb so release the lock. */ - if (inp_locally_locked) - INP_RUNLOCK(inp); + if (pn == NULL) { + if (dir == PFIL_IN) + ss->nskip_in_malloc++; + else + ss->nskip_out_malloc++; - /* These are safe to access without the inp lock. */ - pkt_node->ipver = INP_IPV6; - pkt_node->direction = dir; + goto inp_unlock6; + } - /* - * Significantly more accurate than using getmicrotime(), but slower! - * Gives true microsecond resolution at the expense of a hit to - * maximum pps throughput processing when SIFTR is loaded and enabled. - */ - microtime(&(pkt_node->tval)); + siftr_siftdata(pn, inp, tp, INP_IPV6, dir, inp_locally_locked); - /* XXX: Figure out how to do hash calcs for IPv6 */ + /* XXX: Figure out how to generate hashes for IPv6 packets. */ mtx_lock(&siftr_pkt_queue_mtx); - STAILQ_INSERT_TAIL(&pkt_queue, pkt_node, nodes); + STAILQ_INSERT_TAIL(&pkt_queue, pn, nodes); mtx_unlock(&siftr_pkt_queue_mtx); goto ret6; From owner-svn-src-head@FreeBSD.ORG Sun Jul 18 07:55:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 031601065675; Sun, 18 Jul 2010 07:55:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E68F48FC0A; Sun, 18 Jul 2010 07:55:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6I7tMWW086919; Sun, 18 Jul 2010 07:55:22 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6I7tMVf086917; Sun, 18 Jul 2010 07:55:22 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201007180755.o6I7tMVf086917@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Jul 2010 07: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: r210213 - head/sys/fs/unionfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jul 2010 07:55:23 -0000 Author: trasz Date: Sun Jul 18 07:55:22 2010 New Revision: 210213 URL: http://svn.freebsd.org/changeset/base/210213 Log: Fix build. Submitted by: Andreas Tobler Modified: head/sys/fs/unionfs/union_subr.c Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Sun Jul 18 07:42:54 2010 (r210212) +++ head/sys/fs/unionfs/union_subr.c Sun Jul 18 07:55:22 2010 (r210213) @@ -50,6 +50,7 @@ #include #include #include +#include #include From owner-svn-src-head@FreeBSD.ORG Sun Jul 18 08:34:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 372261065675; Sun, 18 Jul 2010 08:34:45 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2652E8FC14; Sun, 18 Jul 2010 08:34:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6I8YjoH095596; Sun, 18 Jul 2010 08:34:45 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6I8YjkC095593; Sun, 18 Jul 2010 08:34:45 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201007180834.o6I8YjkC095593@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 18 Jul 2010 08:34: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: r210215 - 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: Sun, 18 Jul 2010 08:34:45 -0000 Author: simon Date: Sun Jul 18 08:34:44 2010 New Revision: 210215 URL: http://svn.freebsd.org/changeset/base/210215 Log: Cross reference tree(3) and queue(3). MFC after: 1 week Modified: head/share/man/man3/queue.3 head/share/man/man3/tree.3 Modified: head/share/man/man3/queue.3 ============================================================================== --- head/share/man/man3/queue.3 Sun Jul 18 07:59:55 2010 (r210214) +++ head/share/man/man3/queue.3 Sun Jul 18 08:34:44 2010 (r210215) @@ -998,6 +998,8 @@ while (n1 != NULL) { } TAILQ_INIT(&head); .Ed +.Sh SEE ALSO +.Xr tree 3 .Sh HISTORY The .Nm queue Modified: head/share/man/man3/tree.3 ============================================================================== --- head/share/man/man3/tree.3 Sun Jul 18 07:59:55 2010 (r210214) +++ head/share/man/man3/tree.3 Sun Jul 18 08:34:44 2010 (r210215) @@ -497,6 +497,8 @@ and return the pointer to the removed element otherwise they return .Dv NULL to indicate an error. +.Sh SEE ALSO +.Xr queue 3 .Sh AUTHORS The author of the tree macros is .An Niels Provos . From owner-svn-src-head@FreeBSD.ORG Sun Jul 18 08:54:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81FD4106564A; Sun, 18 Jul 2010 08:54:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7174D8FC13; Sun, 18 Jul 2010 08:54:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6I8sVBi099942; Sun, 18 Jul 2010 08:54:31 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6I8sV3R099940; Sun, 18 Jul 2010 08:54:31 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201007180854.o6I8sV3R099940@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Jul 2010 08:54: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: r210216 - 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: Sun, 18 Jul 2010 08:54:31 -0000 Author: trasz Date: Sun Jul 18 08:54:31 2010 New Revision: 210216 URL: http://svn.freebsd.org/changeset/base/210216 Log: Style fix. Modified: head/sys/sys/resource.h Modified: head/sys/sys/resource.h ============================================================================== --- head/sys/sys/resource.h Sun Jul 18 08:34:44 2010 (r210215) +++ head/sys/sys/resource.h Sun Jul 18 08:54:31 2010 (r210216) @@ -92,7 +92,7 @@ struct rusage { #define RLIMIT_NPROC 7 /* number of processes */ #define RLIMIT_NOFILE 8 /* number of open files */ #define RLIMIT_SBSIZE 9 /* maximum size of all socket buffers */ -#define RLIMIT_VMEM 10 /* virtual process size (inclusive of mmap) */ +#define RLIMIT_VMEM 10 /* virtual process size (inclusive of mmap) */ #define RLIMIT_AS RLIMIT_VMEM /* standard name for RLIMIT_VMEM */ #define RLIMIT_NPTS 11 /* pseudo-terminals */ #define RLIMIT_SWAP 12 /* swap used */ From owner-svn-src-head@FreeBSD.ORG Sun Jul 18 10:15:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BE7C1065672; Sun, 18 Jul 2010 10:15:34 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B4328FC08; Sun, 18 Jul 2010 10:15:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6IAFYln018741; Sun, 18 Jul 2010 10:15:34 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6IAFXvK018739; Sun, 18 Jul 2010 10:15:33 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201007181015.o6IAFXvK018739@svn.freebsd.org> From: Ivan Voras Date: Sun, 18 Jul 2010 10:15: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: r210217 - 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: Sun, 18 Jul 2010 10:15:34 -0000 Author: ivoras Date: Sun Jul 18 10:15:33 2010 New Revision: 210217 URL: http://svn.freebsd.org/changeset/base/210217 Log: In keeping with the Age-of-the-fruitbat theme, scale up hirunningspace on machines which can clearly afford the memory. This is a somewhat conservative version of the patch - more fine tuning may be necessary. Idea from: Thread on hackers@ Discussed with: alc Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Jul 18 08:54:31 2010 (r210216) +++ head/sys/kern/vfs_bio.c Sun Jul 18 10:15:33 2010 (r210217) @@ -621,7 +621,9 @@ bufinit(void) lobufspace = hibufspace - MAXBSIZE; lorunningspace = 512 * 1024; - hirunningspace = 1024 * 1024; + hirunningspace = lmin(roundup(hibufspace/64, MAXBSIZE), 16*1024*1024); + if (hirunningspace < 1024 * 1024) + hirunningspace = 1024 * 1024; /* * Limit the amount of malloc memory since it is wired permanently into From owner-svn-src-head@FreeBSD.ORG Sun Jul 18 11:13:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B03361065675; Sun, 18 Jul 2010 11:13:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F6578FC18; Sun, 18 Jul 2010 11:13:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6IBDaxO031647; Sun, 18 Jul 2010 11:13:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6IBDaRq031645; Sun, 18 Jul 2010 11:13:36 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201007181113.o6IBDaRq031645@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Jul 2010 11:13: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: r210220 - 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: Sun, 18 Jul 2010 11:13:36 -0000 Author: trasz Date: Sun Jul 18 11:13:36 2010 New Revision: 210220 URL: http://svn.freebsd.org/changeset/base/210220 Log: Style fix - keep the line length below 80 characters. Submitted by: bde@ Modified: head/sys/sys/resource.h Modified: head/sys/sys/resource.h ============================================================================== --- head/sys/sys/resource.h Sun Jul 18 11:03:32 2010 (r210219) +++ head/sys/sys/resource.h Sun Jul 18 11:13:36 2010 (r210220) @@ -92,7 +92,7 @@ struct rusage { #define RLIMIT_NPROC 7 /* number of processes */ #define RLIMIT_NOFILE 8 /* number of open files */ #define RLIMIT_SBSIZE 9 /* maximum size of all socket buffers */ -#define RLIMIT_VMEM 10 /* virtual process size (inclusive of mmap) */ +#define RLIMIT_VMEM 10 /* virtual process size (incl. mmap) */ #define RLIMIT_AS RLIMIT_VMEM /* standard name for RLIMIT_VMEM */ #define RLIMIT_NPTS 11 /* pseudo-terminals */ #define RLIMIT_SWAP 12 /* swap used */ From owner-svn-src-head@FreeBSD.ORG Sun Jul 18 12:45:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 700CE1065670; Sun, 18 Jul 2010 12:45:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EA6B8FC1C; Sun, 18 Jul 2010 12:45:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6ICjWZf051708; Sun, 18 Jul 2010 12:45:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6ICjWRJ051706; Sun, 18 Jul 2010 12:45:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201007181245.o6ICjWRJ051706@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 18 Jul 2010 12:45: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: r210221 - in head: bin/sh tools/regression/bin/sh/parser X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jul 2010 12:45:32 -0000 Author: jilles Date: Sun Jul 18 12:45:31 2010 New Revision: 210221 URL: http://svn.freebsd.org/changeset/base/210221 Log: sh: Allow a background command consisting solely of redirections. Example: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18DA810656AB; Sun, 18 Jul 2010 19:29:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 076878FC13; Sun, 18 Jul 2010 19:29:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6IJTC8e040319; Sun, 18 Jul 2010 19:29:12 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6IJTC89040318; Sun, 18 Jul 2010 19:29:12 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201007181929.o6IJTC89040318@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Jul 2010 19:29: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: r210224 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jul 2010 19:29:13 -0000 Author: trasz Date: Sun Jul 18 19:29:12 2010 New Revision: 210224 URL: http://svn.freebsd.org/changeset/base/210224 Log: Remove outdated comment and move part of it into more applicable place. Modified: head/sys/kern/kern_resource.c head/sys/sys/resourcevar.h Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Sun Jul 18 18:52:00 2010 (r210223) +++ head/sys/kern/kern_resource.c Sun Jul 18 19:29:12 2010 (r210224) @@ -1169,11 +1169,6 @@ lim_rlimit(struct proc *p, int which, st p->p_sysent->sv_fixlimit(rlp, which); } -/* - * Find the uidinfo structure for a uid. This structure is used to - * track the total resource consumption (process count, socket buffer - * size, etc.) for the uid and impose limits. - */ void uihashinit() { Modified: head/sys/sys/resourcevar.h ============================================================================== --- head/sys/sys/resourcevar.h Sun Jul 18 18:52:00 2010 (r210223) +++ head/sys/sys/resourcevar.h Sun Jul 18 19:29:12 2010 (r210224) @@ -80,7 +80,9 @@ struct plimit { }; /*- - * Per uid resource consumption + * Per uid resource consumption. This structure is used to track + * the total resource consumption (process count, socket buffer size, + * etc) for the uid and impose limits. * * Locking guide: * (a) Constant from inception From owner-svn-src-head@FreeBSD.ORG Sun Jul 18 20:23:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DD1E1065675; Sun, 18 Jul 2010 20:23:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B2558FC18; Sun, 18 Jul 2010 20:23:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6IKNBFl052237; Sun, 18 Jul 2010 20:23:11 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6IKNBaU052215; Sun, 18 Jul 2010 20:23:11 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201007182023.o6IKNBaU052215@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Jul 2010 20:23: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: r210225 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jul 2010 20:23:11 -0000 Author: trasz Date: Sun Jul 18 20:23:10 2010 New Revision: 210225 URL: http://svn.freebsd.org/changeset/base/210225 Log: The "/*-" comment marker is supposed to denote copyrights. Remove non-copyright occurences from sys/sys/ and sys/kern/. Modified: head/sys/kern/init_main.c head/sys/kern/kern_prot.c head/sys/kern/kern_resource.c head/sys/kern/kern_tc.c head/sys/kern/subr_disk.c head/sys/kern/subr_prof.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_extattr.c head/sys/sys/cdefs.h head/sys/sys/disk.h head/sys/sys/kthread.h head/sys/sys/mbuf.h head/sys/sys/proc.h head/sys/sys/resourcevar.h head/sys/sys/signal.h head/sys/sys/socketvar.h head/sys/sys/time.h head/sys/sys/timetc.h head/sys/sys/types.h Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/kern/init_main.c Sun Jul 18 20:23:10 2010 (r210225) @@ -539,7 +539,7 @@ proc0_init(void *dummy __unused) vm_map_init(&vmspace0.vm_map, vmspace_pmap(&vmspace0), p->p_sysent->sv_minuser, p->p_sysent->sv_maxuser); - /*- + /* * call the init and ctor for the new thread and proc * we wait to do this until all other structures * are fairly sane. Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/kern/kern_prot.c Sun Jul 18 20:23:10 2010 (r210225) @@ -1316,7 +1316,7 @@ SYSCTL_INT(_security_bsd, OID_AUTO, see_ &see_other_uids, 0, "Unprivileged processes may see subjects/objects with different real uid"); -/*- +/* * Determine if u1 "can see" the subject specified by u2, according to the * 'see_other_uids' policy. * Returns: 0 for permitted, ESRCH otherwise @@ -1375,7 +1375,7 @@ cr_seeothergids(struct ucred *u1, struct return (0); } -/*- +/* * Determine if u1 "can see" the subject specified by u2. * Returns: 0 for permitted, an errno value otherwise * Locks: none @@ -1400,7 +1400,7 @@ cr_cansee(struct ucred *u1, struct ucred return (0); } -/*- +/* * Determine if td "can see" the subject specified by p. * Returns: 0 for permitted, an errno value otherwise * Locks: Sufficient locks to protect p->p_ucred must be held. td really @@ -1431,7 +1431,7 @@ static int conservative_signals = 1; SYSCTL_INT(_security_bsd, OID_AUTO, conservative_signals, CTLFLAG_RW, &conservative_signals, 0, "Unprivileged processes prevented from " "sending certain signals to processes whose credentials have changed"); -/*- +/* * Determine whether cred may deliver the specified signal to proc. * Returns: 0 for permitted, an errno value otherwise. * Locks: A lock must be held for proc. @@ -1507,7 +1507,7 @@ cr_cansignal(struct ucred *cred, struct return (0); } -/*- +/* * Determine whether td may deliver the specified signal to p. * Returns: 0 for permitted, an errno value otherwise * Locks: Sufficient locks to protect various components of td and p @@ -1548,7 +1548,7 @@ p_cansignal(struct thread *td, struct pr return (cr_cansignal(td->td_ucred, p, signum)); } -/*- +/* * Determine whether td may reschedule p. * Returns: 0 for permitted, an errno value otherwise * Locks: Sufficient locks to protect various components of td and p @@ -1600,7 +1600,7 @@ SYSCTL_INT(_security_bsd, OID_AUTO, unpr &unprivileged_proc_debug, 0, "Unprivileged processes may use process debugging facilities"); -/*- +/* * Determine whether td may debug p. * Returns: 0 for permitted, an errno value otherwise * Locks: Sufficient locks to protect various components of td and p @@ -1698,7 +1698,7 @@ p_candebug(struct thread *td, struct pro return (0); } -/*- +/* * Determine whether the subject represented by cred can "see" a socket. * Returns: 0 for permitted, ENOENT otherwise. */ @@ -1724,7 +1724,7 @@ cr_canseesocket(struct ucred *cred, stru } #if defined(INET) || defined(INET6) -/*- +/* * Determine whether the subject represented by cred can "see" a socket. * Returns: 0 for permitted, ENOENT otherwise. */ @@ -1751,7 +1751,7 @@ cr_canseeinpcb(struct ucred *cred, struc } #endif -/*- +/* * Determine whether td can wait for the exit of p. * Returns: 0 for permitted, an errno value otherwise * Locks: Sufficient locks to protect various components of td and p @@ -2112,7 +2112,7 @@ setsugid(struct proc *p) p->p_stops = 0; } -/*- +/* * Change a process's effective uid. * Side effects: newcred->cr_uid and newcred->cr_uidinfo will be modified. * References: newcred must be an exclusive credential reference for the @@ -2128,7 +2128,7 @@ change_euid(struct ucred *newcred, struc newcred->cr_uidinfo = euip; } -/*- +/* * Change a process's effective gid. * Side effects: newcred->cr_gid will be modified. * References: newcred must be an exclusive credential reference for the @@ -2141,7 +2141,7 @@ change_egid(struct ucred *newcred, gid_t newcred->cr_groups[0] = egid; } -/*- +/* * Change a process's real uid. * Side effects: newcred->cr_ruid will be updated, newcred->cr_ruidinfo * will be updated, and the old and new cr_ruidinfo proc @@ -2161,7 +2161,7 @@ change_ruid(struct ucred *newcred, struc (void)chgproccnt(newcred->cr_ruidinfo, 1, 0); } -/*- +/* * Change a process's real gid. * Side effects: newcred->cr_rgid will be updated. * References: newcred must be an exclusive credential reference for the @@ -2174,7 +2174,7 @@ change_rgid(struct ucred *newcred, gid_t newcred->cr_rgid = rgid; } -/*- +/* * Change a process's saved uid. * Side effects: newcred->cr_svuid will be updated. * References: newcred must be an exclusive credential reference for the @@ -2187,7 +2187,7 @@ change_svuid(struct ucred *newcred, uid_ newcred->cr_svuid = svuid; } -/*- +/* * Change a process's saved gid. * Side effects: newcred->cr_svgid will be updated. * References: newcred must be an exclusive credential reference for the Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/kern/kern_resource.c Sun Jul 18 20:23:10 2010 (r210225) @@ -1247,7 +1247,7 @@ uihold(uip) refcount_acquire(&uip->ui_ref); } -/*- +/* * Since uidinfo structs have a long lifetime, we use an * opportunistic refcounting scheme to avoid locking the lookup hash * for each release. Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/kern/kern_tc.c Sun Jul 18 20:23:10 2010 (r210225) @@ -484,7 +484,7 @@ tc_windup(void) th->th_offset_count = ncount; } - /*- + /* * Recalculate the scaling factor. We want the number of 1/2^64 * fractions of a second per period of the hardware counter, taking * into account the th_adjustment factor which the NTP PLL/adjtime(2) Modified: head/sys/kern/subr_disk.c ============================================================================== --- head/sys/kern/subr_disk.c Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/kern/subr_disk.c Sun Jul 18 20:23:10 2010 (r210225) @@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$"); #include #include -/*- +/* * Disk error is the preface to plaintive error messages * about failing disk transfers. It prints messages of the form * "hp0g: BLABLABLA cmd=read fsbn 12345 of 12344-12347" Modified: head/sys/kern/subr_prof.c ============================================================================== --- head/sys/kern/subr_prof.c Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/kern/subr_prof.c Sun Jul 18 20:23:10 2010 (r210225) @@ -254,7 +254,7 @@ kmstartup(dummy) mcount_overhead -= empty_loop_time; mexitcount_overhead -= empty_loop_time; - /*- + /* * Profiling overheads are determined by the times between the * following events: * MC1: mcount() is called Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/kern/uipc_mbuf.c Sun Jul 18 20:23:10 2010 (r210225) @@ -161,7 +161,7 @@ m_freem(struct mbuf *mb) mb = m_free(mb); } -/*- +/* * Configure a provided mbuf to refer to the provided external storage * buffer and setup a reference count for said buffer. If the setting * up of the reference count fails, the M_EXT bit will not be set. If Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/kern/uipc_usrreq.c Sun Jul 18 20:23:10 2010 (r210225) @@ -165,7 +165,7 @@ SYSCTL_ULONG(_net_local_seqpacket, OID_A SYSCTL_INT(_net_local, OID_AUTO, inflight, CTLFLAG_RD, &unp_rights, 0, "File descriptors in flight."); -/*- +/* * Locking and synchronization: * * Three types of locks exit in the local domain socket implementation: a Modified: head/sys/kern/vfs_extattr.c ============================================================================== --- head/sys/kern/vfs_extattr.c Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/kern/vfs_extattr.c Sun Jul 18 20:23:10 2010 (r210225) @@ -149,7 +149,7 @@ out: return (error); } -/*- +/* * Set a named extended attribute on a file or directory * * Arguments: unlocked vnode "vp", attribute namespace "attrnamespace", @@ -317,7 +317,7 @@ extattr_set_link(td, uap) return (error); } -/*- +/* * Get a named extended attribute on a file or directory * * Arguments: unlocked vnode "vp", attribute namespace "attrnamespace", @@ -638,7 +638,7 @@ extattr_delete_link(td, uap) return(error); } -/*- +/* * Retrieve a list of extended attributes on a file or directory. * * Arguments: unlocked vnode "vp", attribute namespace 'attrnamespace", Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/sys/cdefs.h Sun Jul 18 20:23:10 2010 (r210225) @@ -463,7 +463,7 @@ #define __DEQUALIFY(type, var) ((type)(uintptr_t)(const volatile void *)(var)) #endif -/*- +/* * The following definitions are an extension of the behavior originally * implemented in , but with a different level of granularity. * POSIX.1 requires that the macros we test be defined before any standard @@ -546,7 +546,7 @@ #define __ISO_C_VISIBLE 0 #endif /* _POSIX_C_SOURCE */ #else -/*- +/* * Deal with _ANSI_SOURCE: * If it is defined, and no other compilation environment is explicitly * requested, then define our internal feature-test macros to zero. This Modified: head/sys/sys/disk.h ============================================================================== --- head/sys/sys/disk.h Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/sys/disk.h Sun Jul 18 20:23:10 2010 (r210225) @@ -26,40 +26,40 @@ void disk_err(struct bio *bp, const char #endif #define DIOCGSECTORSIZE _IOR('d', 128, u_int) - /*- + /* * Get the sectorsize of the device in bytes. The sectorsize is the * smallest unit of data which can be transfered from this device. * Usually this is a power of two but it may not be. (ie: CDROM audio) */ #define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */ - /*- + /* * Get the size of the entire device in bytes. This should be a * multiple of the sectorsize. */ #define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware sectorcount */ - /*- + /* * Get the firmwares notion of number of sectors per track. This * value is mostly used for compatibility with various ill designed * disk label formats. Don't use it unless you have to. */ #define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware headcount */ - /*- + /* * Get the firmwares notion of number of heads per cylinder. This * value is mostly used for compatibility with various ill designed * disk label formats. Don't use it unless you have to. */ #define DIOCSKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */ - /*- + /* * Enable/Disable (the argument is boolean) the device for kernel * core dumps. */ #define DIOCGFRONTSTUFF _IOR('d', 134, off_t) - /*- + /* * Many disk formats have some amount of space reserved at the * start of the disk to hold bootblocks, various disklabels and * similar stuff. This ioctl returns the number of such bytes @@ -67,18 +67,18 @@ void disk_err(struct bio *bp, const char */ #define DIOCGFLUSH _IO('d', 135) /* Flush write cache */ - /*- + /* * Flush write cache of the device. */ #define DIOCGDELETE _IOW('d', 136, off_t[2]) /* Delete data */ - /*- + /* * Mark data on the device as unused. */ #define DISK_IDENT_SIZE 256 #define DIOCGIDENT _IOR('d', 137, char[DISK_IDENT_SIZE]) - /*- + /* * Get the ident of the given provider. Ident is (most of the time) * a uniqe and fixed provider's identifier. Ident's properties are as * follow: @@ -99,19 +99,19 @@ void disk_err(struct bio *bp, const char */ #define DIOCGPROVIDERNAME _IOR('d', 138, char[MAXPATHLEN]) - /*- + /* * Store the provider name, given a device path, in a buffer. The buffer * must be at least MAXPATHLEN bytes long. */ #define DIOCGSTRIPESIZE _IOR('d', 139, off_t) /* Get stripe size in bytes */ - /*- + /* * Get the size of the device's optimal access block in bytes. * This should be a multiple of the sectorsize. */ #define DIOCGSTRIPEOFFSET _IOR('d', 140, off_t) /* Get stripe offset in bytes */ - /*- + /* * Get the offset of the first device's optimal access block in bytes. * This should be a multiple of the sectorsize. */ Modified: head/sys/sys/kthread.h ============================================================================== --- head/sys/sys/kthread.h Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/sys/kthread.h Sun Jul 18 20:23:10 2010 (r210225) @@ -31,7 +31,7 @@ #include -/*- +/* * A kernel process descriptor; used to start "internal" daemons. * * Note: global_procpp may be NULL for no global save area. Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/sys/mbuf.h Sun Jul 18 20:23:10 2010 (r210225) @@ -59,7 +59,7 @@ #define M_MAXCOMPRESS (MHLEN / 2) /* max amount to copy for compression */ #ifdef _KERNEL -/*- +/* * Macro for type conversion: convert mbuf pointer to data pointer of correct * type: * @@ -827,7 +827,7 @@ struct mbuf *m_split(struct mbuf *, int, struct mbuf *m_uiotombuf(struct uio *, int, int, int, int); struct mbuf *m_unshare(struct mbuf *, int how); -/*- +/* * Network packets may have annotations attached by affixing a list of * "packet tags" to the pkthdr structure. Packet tags are dynamically * allocated semi-opaque data structures that have a fixed header Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/sys/proc.h Sun Jul 18 20:23:10 2010 (r210225) @@ -112,7 +112,7 @@ struct pargs { u_char ar_args[1]; /* Arguments. */ }; -/*- +/* * Description of a process. * * This structure contains the information needed to manage a thread of Modified: head/sys/sys/resourcevar.h ============================================================================== --- head/sys/sys/resourcevar.h Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/sys/resourcevar.h Sun Jul 18 20:23:10 2010 (r210225) @@ -79,7 +79,7 @@ struct plimit { int pl_refcnt; /* number of references */ }; -/*- +/* * Per uid resource consumption. This structure is used to track * the total resource consumption (process count, socket buffer size, * etc) for the uid and impose limits. Modified: head/sys/sys/signal.h ============================================================================== --- head/sys/sys/signal.h Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/sys/signal.h Sun Jul 18 20:23:10 2010 (r210225) @@ -122,7 +122,7 @@ /* #define SIG_CATCH ((__sighandler_t *)2) See signalvar.h */ #define SIG_HOLD ((__sighandler_t *)3) -/*- +/* * Type of a signal handling function. * * Language spec sez signal handlers take exactly one arg, even though we Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/sys/socketvar.h Sun Jul 18 20:23:10 2010 (r210225) @@ -57,7 +57,7 @@ typedef u_quad_t so_gen_t; struct socket; -/*- +/* * Locking key to struct socket: * (a) constant after allocation, no locking required. * (b) locked by SOCK_LOCK(so). Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/sys/time.h Sun Jul 18 20:23:10 2010 (r210225) @@ -90,7 +90,7 @@ bintime_sub(struct bintime *bt, const st bt->sec -= bt2->sec; } -/*- +/* * Background information: * * When converting between timestamps on parallel timescales of differing Modified: head/sys/sys/timetc.h ============================================================================== --- head/sys/sys/timetc.h Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/sys/timetc.h Sun Jul 18 20:23:10 2010 (r210225) @@ -16,7 +16,7 @@ #error "no user-serviceable parts inside" #endif -/*- +/* * `struct timecounter' is the interface between the hardware which implements * a timecounter and the MI code which uses this to keep track of time. * Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Sun Jul 18 19:29:12 2010 (r210224) +++ head/sys/sys/types.h Sun Jul 18 20:23:10 2010 (r210225) @@ -287,7 +287,7 @@ typedef int boolean_t; typedef struct device *device_t; typedef __intfptr_t intfptr_t; -/*- +/* * XXX this is fixed width for historical reasons. It should have had type * __int_fast32_t. Fixed-width types should not be used unless binary * compatibility is essential. Least-width types should be used even less From owner-svn-src-head@FreeBSD.ORG Sun Jul 18 20:33:59 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id E8CB21065679 for ; Sun, 18 Jul 2010 20:33:58 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 61D461537DF for ; Sun, 18 Jul 2010 20:33:58 +0000 (UTC) Received: (qmail 74813 invoked from network); 18 Jul 2010 20:33:58 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2010 20:33:58 -0000 Message-ID: <4C436535.7000000@freebsd.org> Date: Sun, 18 Jul 2010 13:33:57 -0700 From: Colin Percival User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.10) Gecko/20100627 Thunderbird/3.0.5 MIME-Version: 1.0 To: Edward Tomasz Napierala References: <201007182023.o6IKNBaU052215@svn.freebsd.org> In-Reply-To: <201007182023.o6IKNBaU052215@svn.freebsd.org> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r210225 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jul 2010 20:33:59 -0000 On 07/18/10 13:23, Edward Tomasz Napierala wrote: > Log: > The "/*-" comment marker is supposed to denote copyrights. Remove non-copyright > occurences from sys/sys/ and sys/kern/. The "/*-" comment marker indicates to utilities that comments should not be re-wrapped. Some of the comments you've changed would distinctly suffer if they were re-wrapped, e.g., > -/*- > +/* > * Change a process's real uid. > * Side effects: newcred->cr_ruid will be updated, newcred->cr_ruidinfo > * will be updated, and the old and new cr_ruidinfo proc If you don't want to have "/*-" for these, please change them instead to "/**", since that is an alternative "box comment" marker. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Sun Jul 18 20:57:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DC261065672; Sun, 18 Jul 2010 20:57:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B04E8FC0A; Sun, 18 Jul 2010 20:57:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6IKvsFG059975; Sun, 18 Jul 2010 20:57:54 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6IKvsJ4059925; Sun, 18 Jul 2010 20:57:54 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201007182057.o6IKvsJ4059925@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 18 Jul 2010 20:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210226 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jul 2010 20:57:54 -0000 Author: trasz Date: Sun Jul 18 20:57:53 2010 New Revision: 210226 URL: http://svn.freebsd.org/changeset/base/210226 Log: Revert r210225 - turns out I was wrong; the "/*-" is not license-only thing; it's also used to indicate that the comment should not be automatically rewrapped. Explained by: cperciva@ Modified: head/sys/kern/init_main.c head/sys/kern/kern_prot.c head/sys/kern/kern_resource.c head/sys/kern/kern_tc.c head/sys/kern/subr_disk.c head/sys/kern/subr_prof.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_extattr.c head/sys/sys/cdefs.h head/sys/sys/disk.h head/sys/sys/kthread.h head/sys/sys/mbuf.h head/sys/sys/proc.h head/sys/sys/resourcevar.h head/sys/sys/signal.h head/sys/sys/socketvar.h head/sys/sys/time.h head/sys/sys/timetc.h head/sys/sys/types.h Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/kern/init_main.c Sun Jul 18 20:57:53 2010 (r210226) @@ -539,7 +539,7 @@ proc0_init(void *dummy __unused) vm_map_init(&vmspace0.vm_map, vmspace_pmap(&vmspace0), p->p_sysent->sv_minuser, p->p_sysent->sv_maxuser); - /* + /*- * call the init and ctor for the new thread and proc * we wait to do this until all other structures * are fairly sane. Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/kern/kern_prot.c Sun Jul 18 20:57:53 2010 (r210226) @@ -1316,7 +1316,7 @@ SYSCTL_INT(_security_bsd, OID_AUTO, see_ &see_other_uids, 0, "Unprivileged processes may see subjects/objects with different real uid"); -/* +/*- * Determine if u1 "can see" the subject specified by u2, according to the * 'see_other_uids' policy. * Returns: 0 for permitted, ESRCH otherwise @@ -1375,7 +1375,7 @@ cr_seeothergids(struct ucred *u1, struct return (0); } -/* +/*- * Determine if u1 "can see" the subject specified by u2. * Returns: 0 for permitted, an errno value otherwise * Locks: none @@ -1400,7 +1400,7 @@ cr_cansee(struct ucred *u1, struct ucred return (0); } -/* +/*- * Determine if td "can see" the subject specified by p. * Returns: 0 for permitted, an errno value otherwise * Locks: Sufficient locks to protect p->p_ucred must be held. td really @@ -1431,7 +1431,7 @@ static int conservative_signals = 1; SYSCTL_INT(_security_bsd, OID_AUTO, conservative_signals, CTLFLAG_RW, &conservative_signals, 0, "Unprivileged processes prevented from " "sending certain signals to processes whose credentials have changed"); -/* +/*- * Determine whether cred may deliver the specified signal to proc. * Returns: 0 for permitted, an errno value otherwise. * Locks: A lock must be held for proc. @@ -1507,7 +1507,7 @@ cr_cansignal(struct ucred *cred, struct return (0); } -/* +/*- * Determine whether td may deliver the specified signal to p. * Returns: 0 for permitted, an errno value otherwise * Locks: Sufficient locks to protect various components of td and p @@ -1548,7 +1548,7 @@ p_cansignal(struct thread *td, struct pr return (cr_cansignal(td->td_ucred, p, signum)); } -/* +/*- * Determine whether td may reschedule p. * Returns: 0 for permitted, an errno value otherwise * Locks: Sufficient locks to protect various components of td and p @@ -1600,7 +1600,7 @@ SYSCTL_INT(_security_bsd, OID_AUTO, unpr &unprivileged_proc_debug, 0, "Unprivileged processes may use process debugging facilities"); -/* +/*- * Determine whether td may debug p. * Returns: 0 for permitted, an errno value otherwise * Locks: Sufficient locks to protect various components of td and p @@ -1698,7 +1698,7 @@ p_candebug(struct thread *td, struct pro return (0); } -/* +/*- * Determine whether the subject represented by cred can "see" a socket. * Returns: 0 for permitted, ENOENT otherwise. */ @@ -1724,7 +1724,7 @@ cr_canseesocket(struct ucred *cred, stru } #if defined(INET) || defined(INET6) -/* +/*- * Determine whether the subject represented by cred can "see" a socket. * Returns: 0 for permitted, ENOENT otherwise. */ @@ -1751,7 +1751,7 @@ cr_canseeinpcb(struct ucred *cred, struc } #endif -/* +/*- * Determine whether td can wait for the exit of p. * Returns: 0 for permitted, an errno value otherwise * Locks: Sufficient locks to protect various components of td and p @@ -2112,7 +2112,7 @@ setsugid(struct proc *p) p->p_stops = 0; } -/* +/*- * Change a process's effective uid. * Side effects: newcred->cr_uid and newcred->cr_uidinfo will be modified. * References: newcred must be an exclusive credential reference for the @@ -2128,7 +2128,7 @@ change_euid(struct ucred *newcred, struc newcred->cr_uidinfo = euip; } -/* +/*- * Change a process's effective gid. * Side effects: newcred->cr_gid will be modified. * References: newcred must be an exclusive credential reference for the @@ -2141,7 +2141,7 @@ change_egid(struct ucred *newcred, gid_t newcred->cr_groups[0] = egid; } -/* +/*- * Change a process's real uid. * Side effects: newcred->cr_ruid will be updated, newcred->cr_ruidinfo * will be updated, and the old and new cr_ruidinfo proc @@ -2161,7 +2161,7 @@ change_ruid(struct ucred *newcred, struc (void)chgproccnt(newcred->cr_ruidinfo, 1, 0); } -/* +/*- * Change a process's real gid. * Side effects: newcred->cr_rgid will be updated. * References: newcred must be an exclusive credential reference for the @@ -2174,7 +2174,7 @@ change_rgid(struct ucred *newcred, gid_t newcred->cr_rgid = rgid; } -/* +/*- * Change a process's saved uid. * Side effects: newcred->cr_svuid will be updated. * References: newcred must be an exclusive credential reference for the @@ -2187,7 +2187,7 @@ change_svuid(struct ucred *newcred, uid_ newcred->cr_svuid = svuid; } -/* +/*- * Change a process's saved gid. * Side effects: newcred->cr_svgid will be updated. * References: newcred must be an exclusive credential reference for the Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/kern/kern_resource.c Sun Jul 18 20:57:53 2010 (r210226) @@ -1247,7 +1247,7 @@ uihold(uip) refcount_acquire(&uip->ui_ref); } -/* +/*- * Since uidinfo structs have a long lifetime, we use an * opportunistic refcounting scheme to avoid locking the lookup hash * for each release. Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/kern/kern_tc.c Sun Jul 18 20:57:53 2010 (r210226) @@ -484,7 +484,7 @@ tc_windup(void) th->th_offset_count = ncount; } - /* + /*- * Recalculate the scaling factor. We want the number of 1/2^64 * fractions of a second per period of the hardware counter, taking * into account the th_adjustment factor which the NTP PLL/adjtime(2) Modified: head/sys/kern/subr_disk.c ============================================================================== --- head/sys/kern/subr_disk.c Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/kern/subr_disk.c Sun Jul 18 20:57:53 2010 (r210226) @@ -23,7 +23,7 @@ __FBSDID("$FreeBSD$"); #include #include -/* +/*- * Disk error is the preface to plaintive error messages * about failing disk transfers. It prints messages of the form * "hp0g: BLABLABLA cmd=read fsbn 12345 of 12344-12347" Modified: head/sys/kern/subr_prof.c ============================================================================== --- head/sys/kern/subr_prof.c Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/kern/subr_prof.c Sun Jul 18 20:57:53 2010 (r210226) @@ -254,7 +254,7 @@ kmstartup(dummy) mcount_overhead -= empty_loop_time; mexitcount_overhead -= empty_loop_time; - /* + /*- * Profiling overheads are determined by the times between the * following events: * MC1: mcount() is called Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/kern/uipc_mbuf.c Sun Jul 18 20:57:53 2010 (r210226) @@ -161,7 +161,7 @@ m_freem(struct mbuf *mb) mb = m_free(mb); } -/* +/*- * Configure a provided mbuf to refer to the provided external storage * buffer and setup a reference count for said buffer. If the setting * up of the reference count fails, the M_EXT bit will not be set. If Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/kern/uipc_usrreq.c Sun Jul 18 20:57:53 2010 (r210226) @@ -165,7 +165,7 @@ SYSCTL_ULONG(_net_local_seqpacket, OID_A SYSCTL_INT(_net_local, OID_AUTO, inflight, CTLFLAG_RD, &unp_rights, 0, "File descriptors in flight."); -/* +/*- * Locking and synchronization: * * Three types of locks exit in the local domain socket implementation: a Modified: head/sys/kern/vfs_extattr.c ============================================================================== --- head/sys/kern/vfs_extattr.c Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/kern/vfs_extattr.c Sun Jul 18 20:57:53 2010 (r210226) @@ -149,7 +149,7 @@ out: return (error); } -/* +/*- * Set a named extended attribute on a file or directory * * Arguments: unlocked vnode "vp", attribute namespace "attrnamespace", @@ -317,7 +317,7 @@ extattr_set_link(td, uap) return (error); } -/* +/*- * Get a named extended attribute on a file or directory * * Arguments: unlocked vnode "vp", attribute namespace "attrnamespace", @@ -638,7 +638,7 @@ extattr_delete_link(td, uap) return(error); } -/* +/*- * Retrieve a list of extended attributes on a file or directory. * * Arguments: unlocked vnode "vp", attribute namespace 'attrnamespace", Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/sys/cdefs.h Sun Jul 18 20:57:53 2010 (r210226) @@ -463,7 +463,7 @@ #define __DEQUALIFY(type, var) ((type)(uintptr_t)(const volatile void *)(var)) #endif -/* +/*- * The following definitions are an extension of the behavior originally * implemented in , but with a different level of granularity. * POSIX.1 requires that the macros we test be defined before any standard @@ -546,7 +546,7 @@ #define __ISO_C_VISIBLE 0 #endif /* _POSIX_C_SOURCE */ #else -/* +/*- * Deal with _ANSI_SOURCE: * If it is defined, and no other compilation environment is explicitly * requested, then define our internal feature-test macros to zero. This Modified: head/sys/sys/disk.h ============================================================================== --- head/sys/sys/disk.h Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/sys/disk.h Sun Jul 18 20:57:53 2010 (r210226) @@ -26,40 +26,40 @@ void disk_err(struct bio *bp, const char #endif #define DIOCGSECTORSIZE _IOR('d', 128, u_int) - /* + /*- * Get the sectorsize of the device in bytes. The sectorsize is the * smallest unit of data which can be transfered from this device. * Usually this is a power of two but it may not be. (ie: CDROM audio) */ #define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */ - /* + /*- * Get the size of the entire device in bytes. This should be a * multiple of the sectorsize. */ #define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware sectorcount */ - /* + /*- * Get the firmwares notion of number of sectors per track. This * value is mostly used for compatibility with various ill designed * disk label formats. Don't use it unless you have to. */ #define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware headcount */ - /* + /*- * Get the firmwares notion of number of heads per cylinder. This * value is mostly used for compatibility with various ill designed * disk label formats. Don't use it unless you have to. */ #define DIOCSKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */ - /* + /*- * Enable/Disable (the argument is boolean) the device for kernel * core dumps. */ #define DIOCGFRONTSTUFF _IOR('d', 134, off_t) - /* + /*- * Many disk formats have some amount of space reserved at the * start of the disk to hold bootblocks, various disklabels and * similar stuff. This ioctl returns the number of such bytes @@ -67,18 +67,18 @@ void disk_err(struct bio *bp, const char */ #define DIOCGFLUSH _IO('d', 135) /* Flush write cache */ - /* + /*- * Flush write cache of the device. */ #define DIOCGDELETE _IOW('d', 136, off_t[2]) /* Delete data */ - /* + /*- * Mark data on the device as unused. */ #define DISK_IDENT_SIZE 256 #define DIOCGIDENT _IOR('d', 137, char[DISK_IDENT_SIZE]) - /* + /*- * Get the ident of the given provider. Ident is (most of the time) * a uniqe and fixed provider's identifier. Ident's properties are as * follow: @@ -99,19 +99,19 @@ void disk_err(struct bio *bp, const char */ #define DIOCGPROVIDERNAME _IOR('d', 138, char[MAXPATHLEN]) - /* + /*- * Store the provider name, given a device path, in a buffer. The buffer * must be at least MAXPATHLEN bytes long. */ #define DIOCGSTRIPESIZE _IOR('d', 139, off_t) /* Get stripe size in bytes */ - /* + /*- * Get the size of the device's optimal access block in bytes. * This should be a multiple of the sectorsize. */ #define DIOCGSTRIPEOFFSET _IOR('d', 140, off_t) /* Get stripe offset in bytes */ - /* + /*- * Get the offset of the first device's optimal access block in bytes. * This should be a multiple of the sectorsize. */ Modified: head/sys/sys/kthread.h ============================================================================== --- head/sys/sys/kthread.h Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/sys/kthread.h Sun Jul 18 20:57:53 2010 (r210226) @@ -31,7 +31,7 @@ #include -/* +/*- * A kernel process descriptor; used to start "internal" daemons. * * Note: global_procpp may be NULL for no global save area. Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/sys/mbuf.h Sun Jul 18 20:57:53 2010 (r210226) @@ -59,7 +59,7 @@ #define M_MAXCOMPRESS (MHLEN / 2) /* max amount to copy for compression */ #ifdef _KERNEL -/* +/*- * Macro for type conversion: convert mbuf pointer to data pointer of correct * type: * @@ -827,7 +827,7 @@ struct mbuf *m_split(struct mbuf *, int, struct mbuf *m_uiotombuf(struct uio *, int, int, int, int); struct mbuf *m_unshare(struct mbuf *, int how); -/* +/*- * Network packets may have annotations attached by affixing a list of * "packet tags" to the pkthdr structure. Packet tags are dynamically * allocated semi-opaque data structures that have a fixed header Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/sys/proc.h Sun Jul 18 20:57:53 2010 (r210226) @@ -112,7 +112,7 @@ struct pargs { u_char ar_args[1]; /* Arguments. */ }; -/* +/*- * Description of a process. * * This structure contains the information needed to manage a thread of Modified: head/sys/sys/resourcevar.h ============================================================================== --- head/sys/sys/resourcevar.h Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/sys/resourcevar.h Sun Jul 18 20:57:53 2010 (r210226) @@ -79,7 +79,7 @@ struct plimit { int pl_refcnt; /* number of references */ }; -/* +/*- * Per uid resource consumption. This structure is used to track * the total resource consumption (process count, socket buffer size, * etc) for the uid and impose limits. Modified: head/sys/sys/signal.h ============================================================================== --- head/sys/sys/signal.h Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/sys/signal.h Sun Jul 18 20:57:53 2010 (r210226) @@ -122,7 +122,7 @@ /* #define SIG_CATCH ((__sighandler_t *)2) See signalvar.h */ #define SIG_HOLD ((__sighandler_t *)3) -/* +/*- * Type of a signal handling function. * * Language spec sez signal handlers take exactly one arg, even though we Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/sys/socketvar.h Sun Jul 18 20:57:53 2010 (r210226) @@ -57,7 +57,7 @@ typedef u_quad_t so_gen_t; struct socket; -/* +/*- * Locking key to struct socket: * (a) constant after allocation, no locking required. * (b) locked by SOCK_LOCK(so). Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/sys/time.h Sun Jul 18 20:57:53 2010 (r210226) @@ -90,7 +90,7 @@ bintime_sub(struct bintime *bt, const st bt->sec -= bt2->sec; } -/* +/*- * Background information: * * When converting between timestamps on parallel timescales of differing Modified: head/sys/sys/timetc.h ============================================================================== --- head/sys/sys/timetc.h Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/sys/timetc.h Sun Jul 18 20:57:53 2010 (r210226) @@ -16,7 +16,7 @@ #error "no user-serviceable parts inside" #endif -/* +/*- * `struct timecounter' is the interface between the hardware which implements * a timecounter and the MI code which uses this to keep track of time. * Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Sun Jul 18 20:23:10 2010 (r210225) +++ head/sys/sys/types.h Sun Jul 18 20:57:53 2010 (r210226) @@ -287,7 +287,7 @@ typedef int boolean_t; typedef struct device *device_t; typedef __intfptr_t intfptr_t; -/* +/*- * XXX this is fixed width for historical reasons. It should have had type * __int_fast32_t. Fixed-width types should not be used unless binary * compatibility is essential. Least-width types should be used even less From owner-svn-src-head@FreeBSD.ORG Sun Jul 18 22:35:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B1F1106566B; Sun, 18 Jul 2010 22:35:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A8CA8FC12; Sun, 18 Jul 2010 22:35:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6IMZkZv081274; Sun, 18 Jul 2010 22:35:46 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6IMZkvN081273; Sun, 18 Jul 2010 22:35:46 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201007182235.o6IMZkvN081273@svn.freebsd.org> From: Rick Macklem Date: Sun, 18 Jul 2010 22:35: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: r210227 - head/sys/fs/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jul 2010 22:35:46 -0000 Author: rmacklem Date: Sun Jul 18 22:35:46 2010 New Revision: 210227 URL: http://svn.freebsd.org/changeset/base/210227 Log: Add a call to nfscl_mustflush() in nfs_close() of the experimental NFSv4 client, so that attributes are not acquired from the server when a delegation for the file is held. This can reduce the number of Getattr Ops significantly. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sun Jul 18 20:57:53 2010 (r210226) +++ head/sys/fs/nfsclient/nfs_clvnops.c Sun Jul 18 22:35:46 2010 (r210227) @@ -709,7 +709,7 @@ nfs_close(struct vop_close_args *ap) /* * Get attributes so "change" is up to date. */ - if (!error) { + if (error == 0 && nfscl_mustflush(vp)) { ret = nfsrpc_getattr(vp, cred, ap->a_td, &nfsva, NULL); if (!ret) { From owner-svn-src-head@FreeBSD.ORG Sun Jul 18 23:34:49 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94E12106566C; Sun, 18 Jul 2010 23:34:49 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 56C918FC13; Sun, 18 Jul 2010 23:34:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o6INST9M027192; Sun, 18 Jul 2010 17:28:29 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 18 Jul 2010 17:28:55 -0600 (MDT) Message-Id: <20100718.172855.190216127575145889.imp@bsdimp.com> To: cperciva@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <4C436535.7000000@freebsd.org> References: <201007182023.o6IKNBaU052215@svn.freebsd.org> <4C436535.7000000@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, trasz@FreeBSD.org Subject: Re: svn commit: r210225 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jul 2010 23:34:49 -0000 In message: <4C436535.7000000@freebsd.org> Colin Percival writes: : On 07/18/10 13:23, Edward Tomasz Napierala wrote: : > Log: : > The "/*-" comment marker is supposed to denote copyrights. Remove non-copyright : > occurences from sys/sys/ and sys/kern/. : : The "/*-" comment marker indicates to utilities that comments should not be : re-wrapped. Some of the comments you've changed would distinctly suffer if : they were re-wrapped, e.g., : : > -/*- : > +/* : > * Change a process's real uid. : > * Side effects: newcred->cr_ruid will be updated, newcred->cr_ruidinfo : > * will be updated, and the old and new cr_ruidinfo proc : : If you don't want to have "/*-" for these, please change them instead to : "/**", since that is an alternative "box comment" marker. Agreed. I specifically didn't *remove* any of the prior /*- comments when I used that to denote the license... Warner From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 02:26:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5E42106566B; Mon, 19 Jul 2010 02:26:59 +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 D5DB98FC16; Mon, 19 Jul 2010 02:26:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6J2Qxgt031799; Mon, 19 Jul 2010 02:26:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6J2QxLE031798; Mon, 19 Jul 2010 02:26:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201007190226.o6J2QxLE031798@svn.freebsd.org> From: Alexander Motin Date: Mon, 19 Jul 2010 02:26: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: r210228 - head/usr.bin/systat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jul 2010 02:27:00 -0000 Author: mav Date: Mon Jul 19 02:26:59 2010 New Revision: 210228 URL: http://svn.freebsd.org/changeset/base/210228 Log: Partially revert r209312, restoring ability to fit "stray irqX" names into into available 10 characters by dropping "irq" in the middle of string. Modified: head/usr.bin/systat/vmstat.c Modified: head/usr.bin/systat/vmstat.c ============================================================================== --- head/usr.bin/systat/vmstat.c Sun Jul 18 22:35:46 2010 (r210227) +++ head/usr.bin/systat/vmstat.c Mon Jul 19 02:26:59 2010 (r210228) @@ -259,18 +259,22 @@ initkre(void) cp1 = cp1 + 2; cp2 = strdup(cp); bcopy(cp1, cp, sz - (cp1 - cp) + 1); - /* If line is long - drop "irq", - if too long - drop "irqN". */ - if (sz <= 10 + 1) { - strcat(cp, " "); - strcat(cp, cp2); - } else if (sz <= 10 + 4) { + if (sz <= 10 + 4) { strcat(cp, " "); strcat(cp, cp2 + 3); } free(cp2); } } + + /* + * Convert "name irqN" to "name N" if the former is + * longer than the field width. + */ + if ((cp1 = strstr(cp, "irq")) != NULL && + strlen(cp) > 10) + bcopy(cp1 + 3, cp1, strlen(cp1 + 3) + 1); + intrname[i] = cp; cp = nextcp; } From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 03:42:04 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A75B1065670; Mon, 19 Jul 2010 03:42:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 02FB38FC17; Mon, 19 Jul 2010 03:42:03 +0000 (UTC) Received: from c122-106-145-25.carlnfd1.nsw.optusnet.com.au (c122-106-145-25.carlnfd1.nsw.optusnet.com.au [122.106.145.25]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o6J3fx2x001912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Jul 2010 13:42:01 +1000 Date: Mon, 19 Jul 2010 13:41:59 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Colin Percival In-Reply-To: <4C436535.7000000@freebsd.org> Message-ID: <20100719132004.B5329@delplex.bde.org> References: <201007182023.o6IKNBaU052215@svn.freebsd.org> <4C436535.7000000@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Edward Tomasz Napierala Subject: Re: svn commit: r210225 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 03:42:04 -0000 On Sun, 18 Jul 2010, Colin Percival wrote: > On 07/18/10 13:23, Edward Tomasz Napierala wrote: >> Log: >> The "/*-" comment marker is supposed to denote copyrights. Remove non-copyright >> occurences from sys/sys/ and sys/kern/. > > The "/*-" comment marker indicates to utilities that comments should not be > re-wrapped. Some of the comments you've changed would distinctly suffer if > they were re-wrapped, e.g., Indeed, the use of this marker for copyright comments is secondary: - most copyright comments would be mangled if they were re-wrapped. Thus ones that don't have the marker are usually wrong. There is an alternative marker "/**" (see indent(1)). Use of this would be just a style bug. Use of full box comments (with comments ornated in boxes made of mostly "*"'s or possibly hyphens or bars or even terminal-specific box drawing characters) would be a larger style bug. indent(1) only claims to support these markers in connection with supporting full box comments. - someone made copyright comments easier to find by using this marker for them constently. >> -/*- >> +/* >> * Change a process's real uid. >> * Side effects: newcred->cr_ruid will be updated, newcred->cr_ruidinfo >> * will be updated, and the old and new cr_ruidinfo proc > > If you don't want to have "/*-" for these, please change them instead to > "/**", since that is an alternative "box comment" marker. Ugh, please don't do this. I want to have "/*-" for normal (but intricately formatted) block comments. Most files should have probably have more of these than copyright comments. However, many intricately formatted block comments are missing the marker. I added the -nfcb flag to indent(1) for avoiding mangling of any block comment, and use it in my .indent.pro, so I rarely see this mangling. The "/**" marker is already used to make doxygen markup especially ugly. I don't know if this is part of the doxygen markup or of the "@foo" markup does everything. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 14:59:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25C5110656AD; Mon, 19 Jul 2010 14:59:24 +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 F00948FC28; Mon, 19 Jul 2010 14:59:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JExNrt098880; Mon, 19 Jul 2010 14:59:23 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JExNVr098879; Mon, 19 Jul 2010 14:59:23 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201007191459.o6JExNVr098879@svn.freebsd.org> From: Rui Paulo Date: Mon, 19 Jul 2010 14:59: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: r210237 - head/cddl/contrib/opensolaris/cmd/plockstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jul 2010 14:59:24 -0000 Author: rpaulo Date: Mon Jul 19 14:59:23 2010 New Revision: 210237 URL: http://svn.freebsd.org/changeset/base/210237 Log: MFV: OpenSolaris' plockstat utility. Sponsored by: The FreeBSD Foundation Added: head/cddl/contrib/opensolaris/cmd/plockstat/ - copied from r210236, vendor/opensolaris/dist/cmd/plockstat/ Modified: Directory Properties: head/cddl/contrib/opensolaris/ (props changed) From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 15:03:26 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C94A106566B; Mon, 19 Jul 2010 15:03:26 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 284E58FC21; Mon, 19 Jul 2010 15:03:26 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 445E91FFC34; Mon, 19 Jul 2010 15:03:25 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 6FBE384815; Mon, 19 Jul 2010 17:01:11 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bruce Evans References: <201007182023.o6IKNBaU052215@svn.freebsd.org> <4C436535.7000000@freebsd.org> <20100719132004.B5329@delplex.bde.org> Date: Mon, 19 Jul 2010 17:01:11 +0200 In-Reply-To: <20100719132004.B5329@delplex.bde.org> (Bruce Evans's message of "Mon, 19 Jul 2010 13:41:59 +1000 (EST)") Message-ID: <868w57cy88.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Edward Tomasz Napierala , Colin Percival Subject: Re: svn commit: r210225 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 15:03:26 -0000 Bruce Evans writes: > The "/**" marker is already used to make doxygen markup especially ugly. > I don't know if this is part of the doxygen markup or of the "@foo" > markup does everything. The presence or absence of @keywords is irrelevant, and there are alternative syntaxes, but /** is the most commonly used marker. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 15:05:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBDB0106567C; Mon, 19 Jul 2010 15:05: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 BB3EE8FC0C; Mon, 19 Jul 2010 15:05:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JF5Z55000439; Mon, 19 Jul 2010 15:05:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JF5ZSr000437; Mon, 19 Jul 2010 15:05:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201007191505.o6JF5ZSr000437@svn.freebsd.org> From: Adrian Chadd Date: Mon, 19 Jul 2010 15:05: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: r210238 - head/sys/dev/flash X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jul 2010 15:05:35 -0000 Author: adrian Date: Mon Jul 19 15:05:35 2010 New Revision: 210238 URL: http://svn.freebsd.org/changeset/base/210238 Log: Include 4k/32k erase commands. These were sourced from the MX25L128 datasheet and match up with what is used in Linux mtd/devices/m25p80.c . Add a FreeBSD keyword whilst I'm here. Modified: head/sys/dev/flash/mx25lreg.h (contents, props changed) Modified: head/sys/dev/flash/mx25lreg.h ============================================================================== --- head/sys/dev/flash/mx25lreg.h Mon Jul 19 14:59:23 2010 (r210237) +++ head/sys/dev/flash/mx25lreg.h Mon Jul 19 15:05:35 2010 (r210238) @@ -23,6 +23,8 @@ * 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 __MX25LREG_H__ @@ -41,6 +43,8 @@ #define CMD_PAGE_PROGRAM 0x02 #define CMD_SECTOR_ERASE 0xD8 #define CMD_BULK_ERASE 0xC7 +#define CMD_BLOCK_4K_ERASE 0x20 +#define CMD_BLOCK_32K_ERASE 0x52 /* * Status register flags From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 16:38:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1B4C1065676; Mon, 19 Jul 2010 16:38:45 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C055E8FC1B; Mon, 19 Jul 2010 16:38:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JGcjO4021522; Mon, 19 Jul 2010 16:38:45 GMT (envelope-from nork@svn.freebsd.org) Received: (from nork@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JGcjFs021520; Mon, 19 Jul 2010 16:38:45 GMT (envelope-from nork@svn.freebsd.org) Message-Id: <201007191638.o6JGcjFs021520@svn.freebsd.org> From: Norikatsu Shigemura Date: Mon, 19 Jul 2010 16:38: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: r210243 - head/usr.sbin/tzsetup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jul 2010 16:38:45 -0000 Author: nork Date: Mon Jul 19 16:38:45 2010 New Revision: 210243 URL: http://svn.freebsd.org/changeset/base/210243 Log: Fix support for chrooted installs. Approved by: imp (mentor) Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Mon Jul 19 16:08:47 2010 (r210242) +++ head/usr.sbin/tzsetup/tzsetup.c Mon Jul 19 16:38:45 2010 (r210243) @@ -821,16 +821,16 @@ main(int argc, char **argv) "or you don't know, please choose NO here!"); if (!DIALOG_UTC(title, prompt, 7, 72)) { if (reallydoit) - unlink(_PATH_WALL_CMOS_CLOCK); + unlink(path_wall_cmos_clock); } else { if (reallydoit) { - fd = open(_PATH_WALL_CMOS_CLOCK, + fd = open(path_wall_cmos_clock, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IRGRP | S_IROTH); if (fd < 0) { end_dialog(); err(1, "create %s", - _PATH_WALL_CMOS_CLOCK); + path_wall_cmos_clock); } close(fd); } From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 18:01:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E20691065673; Mon, 19 Jul 2010 18:01:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEF8A8FC08; Mon, 19 Jul 2010 18:01:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JI16jP040263; Mon, 19 Jul 2010 18:01:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JI167C040261; Mon, 19 Jul 2010 18:01:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007191801.o6JI167C040261@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 19 Jul 2010 18:01: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: r210244 - head/sys/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 18:01:07 -0000 Author: yongari Date: Mon Jul 19 18:01:06 2010 New Revision: 210244 URL: http://svn.freebsd.org/changeset/base/210244 Log: Implement WOL. WOL is supported on RTL8139B or newer controllers. PR: kern/148013 Modified: head/sys/pci/if_rl.c Modified: head/sys/pci/if_rl.c ============================================================================== --- head/sys/pci/if_rl.c Mon Jul 19 16:38:45 2010 (r210243) +++ head/sys/pci/if_rl.c Mon Jul 19 18:01:06 2010 (r210244) @@ -222,6 +222,8 @@ static int rl_suspend(device_t); static void rl_tick(void *); static void rl_txeof(struct rl_softc *); static void rl_watchdog(struct rl_softc *); +static void rl_setwol(struct rl_softc *); +static void rl_clrwol(struct rl_softc *); #ifdef RL_USEIOSPACE #define RL_RES SYS_RES_IOPORT @@ -803,7 +805,7 @@ rl_attach(device_t dev) struct rl_type *t; struct sysctl_ctx_list *ctx; struct sysctl_oid_list *children; - int error = 0, i, rid; + int error = 0, hwrev, i, pmc, rid; int unit; uint16_t rl_did = 0; char tn[32]; @@ -938,6 +940,25 @@ rl_attach(device_t dev) ifp->if_start = rl_start; ifp->if_init = rl_init; ifp->if_capabilities = IFCAP_VLAN_MTU; + /* Check WOL for RTL8139B or newer controllers. */ + if (sc->rl_type == RL_8139 && + pci_find_extcap(sc->rl_dev, PCIY_PMG, &pmc) == 0) { + hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV; + switch (hwrev) { + case RL_HWREV_8139B: + case RL_HWREV_8130: + case RL_HWREV_8139C: + case RL_HWREV_8139D: + case RL_HWREV_8101: + case RL_HWREV_8100: + ifp->if_capabilities |= IFCAP_WOL; + /* Disable WOL. */ + rl_clrwol(sc); + break; + default: + break; + } + } ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -1926,7 +1947,7 @@ rl_ioctl(struct ifnet *ifp, u_long comma struct ifreq *ifr = (struct ifreq *)data; struct mii_data *mii; struct rl_softc *sc = ifp->if_softc; - int error = 0; + int error = 0, mask; switch (command) { case SIOCSIFFLAGS: @@ -1953,6 +1974,7 @@ rl_ioctl(struct ifnet *ifp, u_long comma error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: + mask = ifr->ifr_reqcap ^ ifp->if_capenable; #ifdef DEVICE_POLLING if (ifr->ifr_reqcap & IFCAP_POLLING && !(ifp->if_capenable & IFCAP_POLLING)) { @@ -1978,6 +2000,15 @@ rl_ioctl(struct ifnet *ifp, u_long comma return (error); } #endif /* DEVICE_POLLING */ + if ((mask & IFCAP_WOL) != 0 && + (ifp->if_capabilities & IFCAP_WOL) != 0) { + if ((mask & IFCAP_WOL_UCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_UCAST; + if ((mask & IFCAP_WOL_MCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_MCAST; + if ((mask & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; + } break; default: error = ether_ioctl(ifp, command, data); @@ -2066,6 +2097,7 @@ rl_suspend(device_t dev) RL_LOCK(sc); rl_stop(sc); + rl_setwol(sc); sc->suspended = 1; RL_UNLOCK(sc); @@ -2082,12 +2114,31 @@ rl_resume(device_t dev) { struct rl_softc *sc; struct ifnet *ifp; + int pmc; + uint16_t pmstat; sc = device_get_softc(dev); ifp = sc->rl_ifp; RL_LOCK(sc); + if ((ifp->if_capabilities & IFCAP_WOL) != 0 && + pci_find_extcap(sc->rl_dev, PCIY_PMG, &pmc) == 0) { + /* Disable PME and clear PME status. */ + pmstat = pci_read_config(sc->rl_dev, + pmc + PCIR_POWER_STATUS, 2); + if ((pmstat & PCIM_PSTAT_PMEENABLE) != 0) { + pmstat &= ~PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->rl_dev, + pmc + PCIR_POWER_STATUS, pmstat, 2); + } + /* + * Clear WOL matching such that normal Rx filtering + * wouldn't interfere with WOL patterns. + */ + rl_clrwol(sc); + } + /* reinitialize interface if necessary */ if (ifp->if_flags & IFF_UP) rl_init_locked(sc); @@ -2112,7 +2163,93 @@ rl_shutdown(device_t dev) RL_LOCK(sc); rl_stop(sc); + /* + * Mark interface as down since otherwise we will panic if + * interrupt comes in later on, which can happen in some + * cases. + */ + sc->rl_ifp->if_flags &= ~IFF_UP; + rl_setwol(sc); RL_UNLOCK(sc); return (0); } + +static void +rl_setwol(struct rl_softc *sc) +{ + struct ifnet *ifp; + int pmc; + uint16_t pmstat; + uint8_t v; + + RL_LOCK_ASSERT(sc); + + ifp = sc->rl_ifp; + if ((ifp->if_capabilities & IFCAP_WOL) == 0) + return; + if (pci_find_extcap(sc->rl_dev, PCIY_PMG, &pmc) != 0) + return; + + /* Enable config register write. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE); + + /* Enable PME. */ + v = CSR_READ_1(sc, RL_CFG1); + v &= ~RL_CFG1_PME; + if ((ifp->if_capenable & IFCAP_WOL) != 0) + v |= RL_CFG1_PME; + CSR_WRITE_1(sc, RL_CFG1, v); + + v = CSR_READ_1(sc, RL_CFG3); + v &= ~(RL_CFG3_WOL_LINK | RL_CFG3_WOL_MAGIC); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + v |= RL_CFG3_WOL_MAGIC; + CSR_WRITE_1(sc, RL_CFG3, v); + + /* Config register write done. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); + + v = CSR_READ_1(sc, RL_CFG5); + v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST); + v &= ~RL_CFG5_WOL_LANWAKE; + if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0) + v |= RL_CFG5_WOL_UCAST; + if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0) + v |= RL_CFG5_WOL_MCAST | RL_CFG5_WOL_BCAST; + if ((ifp->if_capenable & IFCAP_WOL) != 0) + v |= RL_CFG5_WOL_LANWAKE; + CSR_WRITE_1(sc, RL_CFG5, v); + /* Request PME if WOL is requested. */ + pmstat = pci_read_config(sc->rl_dev, pmc + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->rl_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); +} + +static void +rl_clrwol(struct rl_softc *sc) +{ + struct ifnet *ifp; + uint8_t v; + + ifp = sc->rl_ifp; + if ((ifp->if_capabilities & IFCAP_WOL) == 0) + return; + + /* Enable config register write. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE); + + v = CSR_READ_1(sc, RL_CFG3); + v &= ~(RL_CFG3_WOL_LINK | RL_CFG3_WOL_MAGIC); + CSR_WRITE_1(sc, RL_CFG3, v); + + /* Config register write done. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); + + v = CSR_READ_1(sc, RL_CFG5); + v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST); + v &= ~RL_CFG5_WOL_LANWAKE; + CSR_WRITE_1(sc, RL_CFG5, v); +} From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 18:20:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30CD61065672; Mon, 19 Jul 2010 18:20:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DA5C8FC1B; Mon, 19 Jul 2010 18:20:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JIKja5044888; Mon, 19 Jul 2010 18:20:45 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JIKjSl044886; Mon, 19 Jul 2010 18:20:45 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007191820.o6JIKjSl044886@svn.freebsd.org> From: Andriy Gapon Date: Mon, 19 Jul 2010 18:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210245 - head/contrib/binutils/ld/emultempl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jul 2010 18:20:45 -0000 Author: avg Date: Mon Jul 19 18:20:44 2010 New Revision: 210245 URL: http://svn.freebsd.org/changeset/base/210245 Log: binutils/ld: fix incorrect placement of __start_SECNAME in some cases __start_SECNAME and __stop_SECNAME symbols are automatically generated by ld for orphan sections, i.e. those not explicitely referenced by a linker script. The symbols are supposed to be placed correspondingly at the start and the end of the section in output file. In some cases __start_SECNAME may be placed at the address after the end of the previous section (if any) and before the start the section. This happens when following conditions are met: 1. the orphan section is found in more than one input file 2. the orphan section has different alignment requirements across input files 3. the first instance of the section encountered doesn't have the greatest alignment requirement In these conditions resulting output section will be placed at address after the end of the previous section aligned to the greatest alignment requirement in the inputs, but __start_SECNAME will be placed at address after the end of the previous section aligned to the alignment requirement of the first input in which the section is encountered. See commit message of r196118 for a concrete example of problems caused by this bug. The fix is to place __start_SECNAME inside the section and use ABSOLUTE directive, rather than placing __start_SECNAME outside the section and trying to guess address alignment. This fix is in line with upstream binutils change/fix made between versions 2.19 and 2.20 in revision of 1.307 ldlang.c. MFC after: 3 weeks Modified: head/contrib/binutils/ld/emultempl/elf32.em Modified: head/contrib/binutils/ld/emultempl/elf32.em ============================================================================== --- head/contrib/binutils/ld/emultempl/elf32.em Mon Jul 19 18:01:06 2010 (r210244) +++ head/contrib/binutils/ld/emultempl/elf32.em Mon Jul 19 18:20:44 2010 (r210245) @@ -1314,26 +1314,6 @@ gld${EMULATION_NAME}_place_orphan (lang_ lang_list_init (stat_ptr); } - if (config.build_constructors) - { - /* If the name of the section is representable in C, then create - symbols to mark the start and the end of the section. */ - for (ps = secname; *ps != '\0'; ps++) - if (! ISALNUM (*ps) && *ps != '_') - break; - if (*ps == '\0') - { - char *symname; - etree_type *e_align; - - symname = (char *) xmalloc (ps - secname + sizeof "__start_"); - sprintf (symname, "__start_%s", secname); - e_align = exp_unop (ALIGN_K, - exp_intop ((bfd_vma) 1 << s->alignment_power)); - lang_add_assignment (exp_assop ('=', symname, e_align)); - } - } - address = NULL; if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0) address = exp_intop ((bfd_vma) 0); @@ -1354,6 +1334,26 @@ gld${EMULATION_NAME}_place_orphan (lang_ (etree_type *) NULL, load_base); + if (config.build_constructors) + { + /* If the name of the section is representable in C, then create + symbols to mark the start and the end of the section. */ + for (ps = secname; *ps != '\0'; ps++) + if (! ISALNUM (*ps) && *ps != '_') + break; + if (*ps == '\0') + { + char *symname; + etree_type *e_align; + + symname = (char *) xmalloc (ps - secname + sizeof "__start_"); + sprintf (symname, "__start_%s", secname); + lang_add_assignment (exp_assop ('=', symname, + exp_unop (ABSOLUTE, + exp_nameop (NAME, ".")))); + } + } + lang_add_section (&os->children, s, os, file); lang_leave_output_section_statement From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 18:41:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BDA6106564A; Mon, 19 Jul 2010 18:41:52 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F4FF8FC1A; Mon, 19 Jul 2010 18:41:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JIfptF049681; Mon, 19 Jul 2010 18:41:51 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JIfpLN049679; Mon, 19 Jul 2010 18:41:51 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201007191841.o6JIfpLN049679@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 19 Jul 2010 18:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210246 - in head/sys: arm/mv conf 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: Mon, 19 Jul 2010 18:41:52 -0000 Author: raj Date: Mon Jul 19 18:41:50 2010 New Revision: 210246 URL: http://svn.freebsd.org/changeset/base/210246 Log: Move MRVL FDT fixups and PIC decode routine to a platform specific area. This allows for better encapsulation (and eliminates generic fdt_arm.c, at least for now). Deleted: head/sys/dev/fdt/fdt_arm.c Modified: head/sys/arm/mv/common.c head/sys/conf/files.arm Modified: head/sys/arm/mv/common.c ============================================================================== --- head/sys/arm/mv/common.c Mon Jul 19 18:20:44 2010 (r210245) +++ head/sys/arm/mv/common.c Mon Jul 19 18:41:50 2010 (r210246) @@ -1834,3 +1834,45 @@ fdt_win_setup(void) return (0); } + +static void +fdt_fixup_busfreq(phandle_t root) +{ + phandle_t sb; + pcell_t freq; + + /* + * This fixup sets the simple-bus bus-frequency property. + */ + + if ((sb = fdt_find_compatible(root, "simple-bus", 1)) == 0) + return; + + freq = cpu_to_fdt32(get_tclk()); + OF_setprop(sb, "bus-frequency", (void *)&freq, sizeof(freq)); +} + +struct fdt_fixup_entry fdt_fixup_table[] = { + { "mrvl,DB-88F6281", &fdt_fixup_busfreq }, + { NULL, NULL } +}; + +static int +fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, + int *pol) +{ + + if (!fdt_is_compatible(node, "mrvl,pic")) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + +fdt_pic_decode_t fdt_pic_table[] = { + &fdt_pic_decode_ic, + NULL +}; Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Mon Jul 19 18:20:44 2010 (r210245) +++ head/sys/conf/files.arm Mon Jul 19 18:41:50 2010 (r210246) @@ -47,7 +47,6 @@ arm/arm/vm_machdep.c standard arm/fpe-arm/armfpe_glue.S optional armfpe arm/fpe-arm/armfpe_init.c optional armfpe arm/fpe-arm/armfpe.S optional armfpe -dev/fdt/fdt_arm.c optional fdt dev/hwpmc/hwpmc_arm.c optional hwpmc dev/ofw/openfirm.c optional fdt dev/ofw/openfirmio.c optional fdt From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 18:47:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FD54106564A; Mon, 19 Jul 2010 18:47:20 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BD818FC14; Mon, 19 Jul 2010 18:47:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JIlKqs050977; Mon, 19 Jul 2010 18:47:20 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JIlJYG050941; Mon, 19 Jul 2010 18:47:19 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201007191847.o6JIlJYG050941@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 19 Jul 2010 18:47: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: r210247 - in head/sys: arm/include arm/mv dev/fdt dev/uart powerpc/booke powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 18:47:20 -0000 Author: raj Date: Mon Jul 19 18:47:18 2010 New Revision: 210247 URL: http://svn.freebsd.org/changeset/base/210247 Log: Eliminate FDT_IMMR_VA define. This removes platform dependencies from /fdt.h for the benfit of portability. Modified: head/sys/arm/include/fdt.h head/sys/arm/mv/mv_machdep.c head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h head/sys/dev/uart/uart_bus_fdt.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/include/fdt.h Modified: head/sys/arm/include/fdt.h ============================================================================== --- head/sys/arm/include/fdt.h Mon Jul 19 18:41:50 2010 (r210246) +++ head/sys/arm/include/fdt.h Mon Jul 19 18:47:18 2010 (r210247) @@ -37,18 +37,10 @@ #include #include +#include #include #include -#include -#include - -/* - * This is the base virtual address the internal mem-mapped registers (IMMR) - * range is available at. - */ -#define FDT_IMMR_VA MV_BASE - /* Max interrupt number */ #define FDT_INTR_MAX NIRQ Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Mon Jul 19 18:41:50 2010 (r210246) +++ head/sys/arm/mv/mv_machdep.c Mon Jul 19 18:47:18 2010 (r210247) @@ -380,7 +380,7 @@ initarm(void *mdp, void *unused __unused &memsize) != 0) while(1); - if (fdt_immr_addr() != 0) + if (fdt_immr_addr(MV_BASE) != 0) while (1); /* Platform-specific initialisation */ Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Mon Jul 19 18:41:50 2010 (r210246) +++ head/sys/dev/fdt/fdt_common.c Mon Jul 19 18:47:18 2010 (r210247) @@ -63,7 +63,7 @@ vm_offset_t fdt_immr_va; vm_offset_t fdt_immr_size; int -fdt_immr_addr(void) +fdt_immr_addr(vm_offset_t immr_va) { pcell_t ranges[6], *rangesptr; phandle_t node; @@ -122,7 +122,7 @@ moveon: size = fdt_data_get((void *)rangesptr, size_cells); fdt_immr_pa = base; - fdt_immr_va = FDT_IMMR_VA; + fdt_immr_va = immr_va; fdt_immr_size = size; return (0); Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Mon Jul 19 18:41:50 2010 (r210246) +++ head/sys/dev/fdt/fdt_common.h Mon Jul 19 18:47:18 2010 (r210247) @@ -90,7 +90,7 @@ int fdt_data_verify(void *, int); phandle_t fdt_find_compatible(phandle_t, const char *, int); int fdt_get_mem_regions(struct mem_region *, int *, uint32_t *); int fdt_get_phyaddr(phandle_t node, int *); -int fdt_immr_addr(void); +int fdt_immr_addr(vm_offset_t); int fdt_regsize(phandle_t, u_long *, u_long *); int fdt_intr_decode(phandle_t, pcell_t *, int *, int *, int *); int fdt_intr_to_rl(phandle_t, struct resource_list *, struct fdt_sense_level *); Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Mon Jul 19 18:41:50 2010 (r210246) +++ head/sys/dev/uart/uart_bus_fdt.c Mon Jul 19 18:47:18 2010 (r210247) @@ -188,7 +188,7 @@ uart_cpu_getdev(int devtype, struct uart err = fdt_regsize(node, &start, &size); if (err) return (ENXIO); - start += FDT_IMMR_VA; + start += fdt_immr_va; uart_bus_space_mem = fdtbus_bs_tag; uart_bus_space_io = NULL; Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Mon Jul 19 18:41:50 2010 (r210246) +++ head/sys/powerpc/booke/machdep.c Mon Jul 19 18:47:18 2010 (r210247) @@ -319,7 +319,7 @@ e500_init(u_int32_t startkernel, u_int32 if (OF_init((void *)dtbp) != 0) while (1); - if (fdt_immr_addr() != 0) + if (fdt_immr_addr(CCSRBAR_VA) != 0) while (1); OF_interpret("perform-fixup", 0); Modified: head/sys/powerpc/include/fdt.h ============================================================================== --- head/sys/powerpc/include/fdt.h Mon Jul 19 18:41:50 2010 (r210246) +++ head/sys/powerpc/include/fdt.h Mon Jul 19 18:47:18 2010 (r210247) @@ -34,14 +34,6 @@ #include #include -#include -#include - -/* - * This is the base virtual address the internal mem-mapped registers (IMMR) - * range is available at. - */ -#define FDT_IMMR_VA CCSRBAR_VA /* Max interrupt number */ #define FDT_INTR_MAX INTR_VECTORS From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 18:56:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C2951065674; Mon, 19 Jul 2010 18:56:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 598468FC17; Mon, 19 Jul 2010 18:56:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JIuILL053061; Mon, 19 Jul 2010 18:56:18 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JIuI85053059; Mon, 19 Jul 2010 18:56:18 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007191856.o6JIuI85053059@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 19 Jul 2010 18:56: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: r210248 - head/sys/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: Mon, 19 Jul 2010 18:56:18 -0000 Author: jkim Date: Mon Jul 19 18:56:18 2010 New Revision: 210248 URL: http://svn.freebsd.org/changeset/base/210248 Log: Fix two long-standing line wrapping bugs in VGA renderer for pixel mode. Font size may be smaller than 16 and logical scan line may be larger than the displayed scan line. MFC after: 3 days Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Mon Jul 19 18:47:18 2010 (r210247) +++ head/sys/dev/syscons/scvgarndr.c Mon Jul 19 18:56:18 2010 (r210248) @@ -766,8 +766,9 @@ vga_vgadraw_direct(scr_stat *scp, int fr d += 8 * pixel_size; if ((i % scp->xsize) == scp->xsize - 1) - d += scp->xoff * 16 * pixel_size + - (scp->font_size - 1) * line_width; + d += scp->xoff * scp->font_size * pixel_size + + scp->font_size * line_width - + scp->xpixel * pixel_size; } } From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 19:19:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C8DC106566B; Mon, 19 Jul 2010 19:19:34 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38C198FC1D; Mon, 19 Jul 2010 19:19:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JJJYGn058379; Mon, 19 Jul 2010 19:19:34 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JJJYVX058372; Mon, 19 Jul 2010 19:19:34 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201007191919.o6JJJYVX058372@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 19 Jul 2010 19:19: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: r210249 - in head/sys: arm/mv arm/mv/discovery arm/mv/kirkwood arm/mv/orion 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: Mon, 19 Jul 2010 19:19:34 -0000 Author: raj Date: Mon Jul 19 19:19:33 2010 New Revision: 210249 URL: http://svn.freebsd.org/changeset/base/210249 Log: Now that we are fully FDT-driven on MRVL platforms, remove PHYSMEM_SIZE option. Modified: head/sys/arm/mv/discovery/std.db78xxx head/sys/arm/mv/kirkwood/std.db88f6xxx head/sys/arm/mv/kirkwood/std.sheevaplug head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/orion/std.db88f5xxx head/sys/conf/options.arm Modified: head/sys/arm/mv/discovery/std.db78xxx ============================================================================== --- head/sys/arm/mv/discovery/std.db78xxx Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/discovery/std.db78xxx Mon Jul 19 19:19:33 2010 (r210249) @@ -9,5 +9,4 @@ makeoptions KERNVIRTADDR=0xc0900000 options KERNPHYSADDR=0x00900000 options KERNVIRTADDR=0xc0900000 options PHYSADDR=0x00000000 -options PHYSMEM_SIZE=0x20000000 options STARTUP_PAGETABLE_ADDR=0x00100000 Modified: head/sys/arm/mv/kirkwood/std.db88f6xxx ============================================================================== --- head/sys/arm/mv/kirkwood/std.db88f6xxx Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/kirkwood/std.db88f6xxx Mon Jul 19 19:19:33 2010 (r210249) @@ -3,5 +3,3 @@ include "../mv/std.mv" include "../mv/kirkwood/std.kirkwood" files "../mv/kirkwood/files.kirkwood" - -options PHYSMEM_SIZE=0x20000000 Modified: head/sys/arm/mv/kirkwood/std.sheevaplug ============================================================================== --- head/sys/arm/mv/kirkwood/std.sheevaplug Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/kirkwood/std.sheevaplug Mon Jul 19 19:19:33 2010 (r210249) @@ -3,5 +3,3 @@ include "../mv/std.mv" include "../mv/kirkwood/std.kirkwood" files "../mv/kirkwood/files.sheevaplug" - -options PHYSMEM_SIZE=0x20000000 Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/mv_machdep.c Mon Jul 19 19:19:33 2010 (r210249) @@ -153,7 +153,7 @@ static int availmem_regions_sz; static void print_kenv(void); static void print_kernel_section_addr(void); -static void physmap_init(int); +static void physmap_init(void); static int platform_devmap_init(void); static int platform_mpp_init(void); @@ -202,7 +202,7 @@ print_kernel_section_addr(void) } static void -physmap_init(int hardcoded) +physmap_init(void) { int i, j, cnt; vm_offset_t phys_kernelend, kernload; @@ -213,22 +213,6 @@ physmap_init(int hardcoded) kernload = KERNPHYSADDR; /* - * Use hardcoded physical addresses if we don't use memory regions - * from metadata. - */ - if (hardcoded) { - phys_avail[0] = 0; - phys_avail[1] = kernload; - - phys_avail[2] = phys_kernelend; - phys_avail[3] = PHYSMEM_SIZE; - - phys_avail[4] = 0; - phys_avail[5] = 0; - return; - } - - /* * Remove kernel physical address range from avail * regions list. Page align all regions. * Non-page aligned memory isn't very interesting to us. @@ -352,12 +336,6 @@ initarm(void *mdp, void *unused __unused } else { /* Fall back to hardcoded metadata. */ lastaddr = fake_preload_metadata(); - - /* - * Assume a single memory region of size specified in board - * configuration file. - */ - memsize = PHYSMEM_SIZE; } #if defined(FDT_DTB_STATIC) @@ -602,10 +580,8 @@ initarm(void *mdp, void *unused __unused /* * Prepare map of physical memory regions available to vm subsystem. - * If metadata pointer doesn't point to a valid address, use hardcoded - * values. */ - physmap_init((mdp != NULL) ? 0 : 1); + physmap_init(); /* Do basic tuning, hz etc */ init_param1(); Modified: head/sys/arm/mv/orion/std.db88f5xxx ============================================================================== --- head/sys/arm/mv/orion/std.db88f5xxx Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/orion/std.db88f5xxx Mon Jul 19 19:19:33 2010 (r210249) @@ -9,5 +9,4 @@ makeoptions KERNVIRTADDR=0xc0900000 options KERNPHYSADDR=0x00900000 options KERNVIRTADDR=0xc0900000 options PHYSADDR=0x00000000 -options PHYSMEM_SIZE=0x08000000 options STARTUP_PAGETABLE_ADDR=0x00100000 Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/conf/options.arm Mon Jul 19 19:19:33 2010 (r210249) @@ -23,7 +23,6 @@ KERNPHYSADDR opt_global.h KERNVIRTADDR opt_global.h LOADERRAMADDR opt_global.h PHYSADDR opt_global.h -PHYSMEM_SIZE opt_global.h SKYEYE_WORKAROUNDS opt_global.h SOC_MV_DISCOVERY opt_global.h SOC_MV_KIRKWOOD opt_global.h From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 20:19:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0114F106567D; Mon, 19 Jul 2010 20:19:14 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6430B8FC12; Mon, 19 Jul 2010 20:19:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JKJESi072069; Mon, 19 Jul 2010 20:19:14 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JKJEg5072065; Mon, 19 Jul 2010 20:19:14 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201007192019.o6JKJEg5072065@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 19 Jul 2010 20:19: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: r210254 - in head/etc: defaults periodic/security X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jul 2010 20:19:16 -0000 Author: gabor Date: Mon Jul 19 20:19:14 2010 New Revision: 210254 URL: http://svn.freebsd.org/changeset/base/210254 Log: - Add a periodic script, which can be used to find installed ports' files with mismatched checksum PR: conf/124641 Submitted by: Alex Kozlov Approved by: delphij (mentor) Added: head/etc/periodic/security/460.chkportsum (contents, props changed) Modified: head/etc/defaults/periodic.conf head/etc/periodic/security/Makefile Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Mon Jul 19 19:54:37 2010 (r210253) +++ head/etc/defaults/periodic.conf Mon Jul 19 20:19:14 2010 (r210254) @@ -171,6 +171,9 @@ daily_status_security_passwdless_enable= # 410.logincheck daily_status_security_logincheck_enable="YES" +# 460.chkportsum +daily_status_security_chkportsum_enable="NO" # Check ports w/ wrong checksum + # 500.ipfwdenied daily_status_security_ipfwdenied_enable="YES" Added: head/etc/periodic/security/460.chkportsum ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/periodic/security/460.chkportsum Mon Jul 19 20:19:14 2010 (r210254) @@ -0,0 +1,68 @@ +#!/bin/sh - +# +# Copyright (c) 2010 The FreeBSD Project +# 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$ +# + +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +. /etc/periodic/security/security.functions + +rc=0 + +echo "" +echo 'Checking for ports with mismatched checksums:' + +case "${daily_status_security_chkportsum_enable}" in + [Yy][Ee][Ss]) + pkg_info -ga 2>/dev/null | \ + while read one two three; do + case ${one} in + Information) + case ${two} in + for) name=${three%%:} ;; + *) name='??' ;; + esac + ;; + Mismatched|'') ;; + *) + if [ -n ${name} ]; then + echo ${name}: ${one} + fi + ;; + esac + done + ;; + *) + rc=0 + ;; +esac + +exit $rc Modified: head/etc/periodic/security/Makefile ============================================================================== --- head/etc/periodic/security/Makefile Mon Jul 19 19:54:37 2010 (r210253) +++ head/etc/periodic/security/Makefile Mon Jul 19 20:19:14 2010 (r210254) @@ -7,6 +7,7 @@ FILES= 100.chksetuid \ 300.chkuid0 \ 400.passwdless \ 410.logincheck \ + 460.chkportsum \ 700.kernelmsg \ 800.loginfail \ 900.tcpwrap \ From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 20:22:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6CAA1065677; Mon, 19 Jul 2010 20:22:21 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95BB98FC13; Mon, 19 Jul 2010 20:22:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JKMLXB072821; Mon, 19 Jul 2010 20:22:21 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JKMLr3072819; Mon, 19 Jul 2010 20:22:21 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201007192022.o6JKMLr3072819@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 19 Jul 2010 20:22: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: r210255 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jul 2010 20:22:21 -0000 Author: gabor Date: Mon Jul 19 20:22:21 2010 New Revision: 210255 URL: http://svn.freebsd.org/changeset/base/210255 Log: - Add Latinamerican keymaps to sysinstall's Makefile so that it can find them [1] - While here, also add a missing Spanish entry PR: bin/67365 [1] Submitted by: Pedro F. Giffuni [1] Approved by: delphij (mentor) Modified: head/usr.sbin/sysinstall/Makefile Modified: head/usr.sbin/sysinstall/Makefile ============================================================================== --- head/usr.sbin/sysinstall/Makefile Mon Jul 19 20:19:14 2010 (r210254) +++ head/usr.sbin/sysinstall/Makefile Mon Jul 19 20:22:21 2010 (r210255) @@ -79,8 +79,9 @@ KEYMAPS= be.iso bg.bds.ctrlcaps bg.phone ce.iso2 cs.latin2.qwertz danish.iso el.iso07 \ estonian.cp850 estonian.iso estonian.iso15 finnish.iso fr.iso \ german.iso gr.elot.acc gr.us101.acc hr.iso hu.iso2.101keys \ - it.iso icelandic.iso jp.106 norwegian.iso pl_PL.ISO8859-2 \ - pt.iso ru.koi8-r si.iso sk.iso2 spanish.iso swedish.iso \ + it.iso icelandic.iso jp.106 latinamerican latinamerican.iso.acc \ + norwegian.iso pl_PL.ISO8859-2 \ + pt.iso ru.koi8-r si.iso sk.iso2 spanish.iso spanish.iso.acc swedish.iso \ swissfrench.iso \ swissgerman.iso ua.koi8-u ua.koi8-u.shift.alt uk.iso us.dvorak \ us.iso us.pc-ctrl us.unix From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 20:31:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D226D1065674; Mon, 19 Jul 2010 20:31:04 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0B648FC08; Mon, 19 Jul 2010 20:31:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JKV4Tu074808; Mon, 19 Jul 2010 20:31:04 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JKV4ue074806; Mon, 19 Jul 2010 20:31:04 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007192031.o6JKV4ue074806@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 19 Jul 2010 20:31: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: r210256 - head/sys/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: Mon, 19 Jul 2010 20:31:04 -0000 Author: jkim Date: Mon Jul 19 20:31:04 2010 New Revision: 210256 URL: http://svn.freebsd.org/changeset/base/210256 Log: Improve style slightly. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Mon Jul 19 20:22:21 2010 (r210255) +++ head/sys/dev/syscons/scvgarndr.c Mon Jul 19 20:31:04 2010 (r210256) @@ -171,39 +171,42 @@ static u_short mouse_or_mask[16] = { #endif #ifdef SC_PIXEL_MODE -#define VIDEO_MEMORY_POS(scp, pos, x) \ - scp->sc->adp->va_window + \ - x * scp->xoff + \ - scp->yoff * scp->font_size * scp->sc->adp->va_line_width + \ - x * (pos % scp->xsize) + \ - scp->font_size * scp->sc->adp->va_line_width * (pos / scp->xsize) - -#define vga_drawpxl(pos, color) \ - switch (scp->sc->adp->va_info.vi_depth) { \ - case 32: \ - writel(pos, vga_palette32[color]); \ - break; \ - case 24: \ - if (((pos) & 1) == 0) { \ - writew(pos, vga_palette32[color]); \ - writeb(pos + 2, vga_palette32[color] >> 16);\ - } else { \ - writeb(pos, vga_palette32[color]); \ - writew(pos + 1, vga_palette32[color] >> 8);\ - } \ - break; \ - case 16: \ - if (scp->sc->adp->va_info.vi_pixel_fsizes[1] == 5)\ - writew(pos, vga_palette15[color]); \ - else \ - writew(pos, vga_palette16[color]); \ - break; \ - case 15: \ - writew(pos, vga_palette15[color]); \ - break; \ - case 8: \ - writeb(pos, (uint8_t)color); \ - } +#define GET_PIXEL(scp, pos, x, w) \ +({ \ + (scp)->sc->adp->va_window + \ + (x) * (scp)->xoff + \ + (scp)->yoff * (scp)->font_size * (w) + \ + (x) * ((pos) % (scp)->xsize) + \ + (scp)->font_size * (w) * ((pos) / (scp)->xsize); \ +}) + +#define DRAW_PIXEL(scp, pos, color) do { \ + switch ((scp)->sc->adp->va_info.vi_depth) { \ + case 32: \ + writel((pos), vga_palette32[color]); \ + break; \ + case 24: \ + if (((pos) & 1) == 0) { \ + writew((pos), vga_palette32[color]); \ + writeb((pos) + 2, vga_palette32[color] >> 16); \ + } else { \ + writeb((pos), vga_palette32[color]); \ + writew((pos) + 1, vga_palette32[color] >> 8); \ + } \ + break; \ + case 16: \ + if ((scp)->sc->adp->va_info.vi_pixel_fsizes[1] == 5) \ + writew((pos), vga_palette15[color]); \ + else \ + writew((pos), vga_palette16[color]); \ + break; \ + case 15: \ + writew((pos), vga_palette15[color]); \ + break; \ + case 8: \ + writeb((pos), (uint8_t)(color)); \ + } \ +} while (0) static uint32_t vga_palette32[16] = { 0x000000, 0x0000ad, 0x00ad00, 0x00adad, @@ -589,7 +592,7 @@ vga_pxlborder_direct(scr_stat *scp, int e = s + line_width * scp->yoff * scp->font_size; for (f = s; f < e; f += pixel_size) - vga_drawpxl(f, color); + DRAW_PIXEL(scp, f, color); } y = (scp->yoff + scp->ysize) * scp->font_size; @@ -599,7 +602,7 @@ vga_pxlborder_direct(scr_stat *scp, int e = s + line_width * (scp->ypixel - y); for (f = s; f < e; f += pixel_size) - vga_drawpxl(f, color); + DRAW_PIXEL(scp, f, color); } y = scp->yoff * scp->font_size; @@ -611,7 +614,7 @@ vga_pxlborder_direct(scr_stat *scp, int e = s + scp->xoff * 8 * pixel_size; for (f = s; f < e; f += pixel_size) - vga_drawpxl(f, color); + DRAW_PIXEL(scp, f, color); } if (x > 0) { @@ -621,7 +624,7 @@ vga_pxlborder_direct(scr_stat *scp, int e = s + x * 8 * pixel_size; for (f = s; f < e; f += pixel_size) - vga_drawpxl(f, color); + DRAW_PIXEL(scp, f, color); } } } @@ -677,7 +680,7 @@ vga_egadraw(scr_stat *scp, int from, int line_width = scp->sc->adp->va_line_width; - d = VIDEO_MEMORY_POS(scp, from, 1); + d = GET_PIXEL(scp, from, 1, line_width); outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ outw(GDCIDX, 0x0003); /* data rotate/function select */ @@ -724,7 +727,7 @@ vga_egadraw(scr_stat *scp, int from, int static void vga_vgadraw_direct(scr_stat *scp, int from, int count, int flip) { - vm_offset_t d = 0; + vm_offset_t d; vm_offset_t e; u_char *f; u_short col1, col2, color; @@ -735,7 +738,7 @@ vga_vgadraw_direct(scr_stat *scp, int fr line_width = scp->sc->adp->va_line_width; pixel_size = scp->sc->adp->va_info.vi_pixel_size; - d = VIDEO_MEMORY_POS(scp, from, 8 * pixel_size); + d = GET_PIXEL(scp, from, 8 * pixel_size, line_width); if (from + count > scp->xsize * scp->ysize) count = scp->xsize * scp->ysize - from; @@ -757,7 +760,7 @@ vga_vgadraw_direct(scr_stat *scp, int fr for (j = 0; j < scp->font_size; ++j, ++f) { for (k = 0; k < 8; ++k) { color = *f & (1 << (7 - k)) ? col1 : col2; - vga_drawpxl(e + pixel_size * k, color); + DRAW_PIXEL(scp, e + pixel_size * k, color); } e += line_width; @@ -785,10 +788,10 @@ vga_vgadraw_planar(scr_stat *scp, int fr int a; u_char c; - d = VIDEO_MEMORY_POS(scp, from, 1); - line_width = scp->sc->adp->va_line_width; + d = GET_PIXEL(scp, from, 1, line_width); + outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */ outw(GDCIDX, 0x0003); /* data rotate/function select */ outw(GDCIDX, 0x0f01); /* set/reset enable */ @@ -847,7 +850,7 @@ vga_pxlcursor_shape(scr_stat *scp, int b static void draw_pxlcursor_direct(scr_stat *scp, int at, int on, int flip) { - vm_offset_t d = 0; + vm_offset_t d; u_char *f; int line_width, pixel_size; int height; @@ -858,7 +861,7 @@ draw_pxlcursor_direct(scr_stat *scp, int line_width = scp->sc->adp->va_line_width; pixel_size = scp->sc->adp->va_info.vi_pixel_size; - d = VIDEO_MEMORY_POS(scp, at, 8 * pixel_size) + + d = GET_PIXEL(scp, at, 8 * pixel_size, line_width) + (scp->font_size - scp->curs_attr.base - 1) * line_width; a = sc_vtb_geta(&scp->vtb, at); @@ -879,7 +882,7 @@ draw_pxlcursor_direct(scr_stat *scp, int for (i = 0; i < height; ++i, --f) { for (j = 0; j < 8; ++j) { color = *f & (1 << (7 - j)) ? col1 : col2; - vga_drawpxl(d + pixel_size * j, color); + DRAW_PIXEL(scp, d + pixel_size * j, color); } d -= line_width; @@ -900,7 +903,7 @@ draw_pxlcursor_planar(scr_stat *scp, int line_width = scp->sc->adp->va_line_width; - d = VIDEO_MEMORY_POS(scp, at, 1) + + d = GET_PIXEL(scp, at, 1, line_width) + (scp->font_size - scp->curs_attr.base - 1) * line_width; outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 21:13:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9D531065674; Mon, 19 Jul 2010 21:13:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A96D8FC13; Mon, 19 Jul 2010 21:13:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JLD7Qi084356; Mon, 19 Jul 2010 21:13:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JLD7TD084354; Mon, 19 Jul 2010 21:13:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007192113.o6JLD7TD084354@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 19 Jul 2010 21:13: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: r210257 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 21:13:07 -0000 Author: yongari Date: Mon Jul 19 21:13:07 2010 New Revision: 210257 URL: http://svn.freebsd.org/changeset/base/210257 Log: When we didn't find a matching flash device, do not touch flash config data. While I'm here, use return code of bce_init_nvram() to set error instead of directly setting ENODEV. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Mon Jul 19 20:31:04 2010 (r210256) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 21:13:07 2010 (r210257) @@ -2264,7 +2264,8 @@ bce_init_nvram(struct bce_softc *sc) sc->bce_flash_info = NULL; BCE_PRINTF("%s(%d): Unknown Flash NVRAM found!\n", __FILE__, __LINE__); - rc = ENODEV; + DBEXIT(BCE_VERBOSE_NVRAM); + return (ENODEV); } bce_init_nvram_get_flash_size: @@ -4796,10 +4797,8 @@ bce_chipinit(struct bce_softc *sc) } /* Prepare NVRAM for access. */ - if (bce_init_nvram(sc)) { - rc = ENODEV; + if ((rc = bce_init_nvram(sc)) != 0) goto bce_chipinit_exit; - } /* Set the kernel bypass block size */ val = REG_RD(sc, BCE_MQ_CONFIG); From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 21:25:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80372106564A; Mon, 19 Jul 2010 21:25:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 714198FC1E; Mon, 19 Jul 2010 21:25:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JLP5E1087077; Mon, 19 Jul 2010 21:25:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JLP5qY087075; Mon, 19 Jul 2010 21:25:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007192125.o6JLP5qY087075@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 19 Jul 2010 21:25: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: r210259 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 21:25:05 -0000 Author: yongari Date: Mon Jul 19 21:25:05 2010 New Revision: 210259 URL: http://svn.freebsd.org/changeset/base/210259 Log: Have bce_init_ctx() return error code and make caller check the return code. If context was not setup correctly give up initialization. While I'm here move variable declarations to the beginning of the function. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Mon Jul 19 21:24:48 2010 (r210258) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 21:25:05 2010 (r210259) @@ -429,7 +429,7 @@ static void bce_init_locked (struct bce static void bce_init (void *); static void bce_mgmt_init_locked (struct bce_softc *sc); -static void bce_init_ctx (struct bce_softc *); +static int bce_init_ctx (struct bce_softc *); static void bce_get_mac_addr (struct bce_softc *); static void bce_set_mac_addr (struct bce_softc *); static void bce_phy_intr (struct bce_softc *); @@ -4396,16 +4396,18 @@ bce_init_cpus(struct bce_softc *sc) /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static int bce_init_ctx(struct bce_softc *sc) { + u32 offset, val, vcid_addr; + int i, j, rc, retry_cnt; + rc = 0; DBENTER(BCE_VERBOSE_RESET | BCE_VERBOSE_CTX); if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { - int i, retry_cnt = CTX_INIT_RETRY_COUNT; - u32 val; + retry_cnt = CTX_INIT_RETRY_COUNT; DBPRINT(sc, BCE_INFO_CTX, "Initializing 5709 context.\n"); @@ -4426,15 +4428,14 @@ bce_init_ctx(struct bce_softc *sc) break; DELAY(2); } - - /* ToDo: Consider returning an error here. */ - DBRUNIF((val & BCE_CTX_COMMAND_MEM_INIT), - BCE_PRINTF("%s(): Context memory initialization " - "failed!\n", __FUNCTION__)); + if ((val & BCE_CTX_COMMAND_MEM_INIT) != 0) { + BCE_PRINTF("%s(): Context memory initialization failed!\n", + __FUNCTION__); + rc = EBUSY; + goto init_ctx_fail; + } for (i = 0; i < sc->ctx_pages; i++) { - int j; - /* Set the physical address of the context memory. */ REG_WR(sc, BCE_CTX_HOST_PAGE_TBL_DATA0, BCE_ADDR_LO(sc->ctx_paddr[i] & 0xfffffff0) | @@ -4452,14 +4453,14 @@ bce_init_ctx(struct bce_softc *sc) break; DELAY(5); } - - /* ToDo: Consider returning an error here. */ - DBRUNIF((val & BCE_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ), - BCE_PRINTF("%s(): Failed to initialize " - "context page %d!\n", __FUNCTION__, i)); + if ((val & BCE_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ) != 0) { + BCE_PRINTF("%s(): Failed to initialize " + "context page %d!\n", __FUNCTION__, i); + rc = EBUSY; + goto init_ctx_fail; + } } } else { - u32 vcid_addr, offset; DBPRINT(sc, BCE_INFO, "Initializing 5706/5708 context.\n"); @@ -4486,7 +4487,9 @@ bce_init_ctx(struct bce_softc *sc) } } +init_ctx_fail: DBEXIT(BCE_VERBOSE_RESET | BCE_VERBOSE_CTX); + return (rc); } @@ -4785,7 +4788,8 @@ bce_chipinit(struct bce_softc *sc) BCE_MISC_ENABLE_STATUS_BITS_CONTEXT_ENABLE); /* Initialize context mapping and zero out the quick contexts. */ - bce_init_ctx(sc); + if ((rc = bce_init_ctx(sc)) != 0) + goto bce_chipinit_exit; /* Initialize the on-boards CPUs */ bce_init_cpus(sc); From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 21:32:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 207B31065670; Mon, 19 Jul 2010 21:32:48 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11C318FC19; Mon, 19 Jul 2010 21:32:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JLWlDW088789; Mon, 19 Jul 2010 21:32:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JLWlm0088787; Mon, 19 Jul 2010 21:32:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007192132.o6JLWlm0088787@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 19 Jul 2010 21:32: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: r210260 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 21:32:48 -0000 Author: yongari Date: Mon Jul 19 21:32:47 2010 New Revision: 210260 URL: http://svn.freebsd.org/changeset/base/210260 Log: Don't change current media in bce_stop(). There is no need to do this here. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Mon Jul 19 21:25:05 2010 (r210259) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 21:32:47 2010 (r210260) @@ -4577,9 +4577,6 @@ static void bce_stop(struct bce_softc *sc) { struct ifnet *ifp; - struct ifmedia_entry *ifm; - struct mii_data *mii = NULL; - int mtmp, itmp; DBENTER(BCE_VERBOSE_RESET); @@ -4587,8 +4584,6 @@ bce_stop(struct bce_softc *sc) ifp = sc->bce_ifp; - mii = device_get_softc(sc->bce_miibus); - callout_stop(&sc->bce_tick_callout); /* Disable the transmit/receive blocks. */ @@ -4607,25 +4602,6 @@ bce_stop(struct bce_softc *sc) /* Free TX buffers. */ bce_free_tx_chain(sc); - /* - * Isolate/power down the PHY, but leave the media selection - * unchanged so that things will be put back to normal when - * we bring the interface back up. - */ - - itmp = ifp->if_flags; - ifp->if_flags |= IFF_UP; - - /* If we are called from bce_detach(), mii is already NULL. */ - if (mii != NULL) { - ifm = mii->mii_media.ifm_cur; - mtmp = ifm->ifm_media; - ifm->ifm_media = IFM_ETHER | IFM_NONE; - mii_mediachg(mii); - ifm->ifm_media = mtmp; - } - - ifp->if_flags = itmp; sc->watchdog_timer = 0; sc->bce_link_up = FALSE; From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 21:38:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A422106568A; Mon, 19 Jul 2010 21:38:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E678C8FC14; Mon, 19 Jul 2010 21:38:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JLc7Gi089992; Mon, 19 Jul 2010 21:38:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JLc7ZX089990; Mon, 19 Jul 2010 21:38:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007192138.o6JLc7ZX089990@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 19 Jul 2010 21:38: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: r210261 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 21:38:08 -0000 Author: yongari Date: Mon Jul 19 21:38:07 2010 New Revision: 210261 URL: http://svn.freebsd.org/changeset/base/210261 Log: Correctly check the result of media selection. Previously it always returned success. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Mon Jul 19 21:32:47 2010 (r210260) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 21:38:07 2010 (r210261) @@ -423,7 +423,7 @@ static void bce_start (struct ifnet *) static int bce_ioctl (struct ifnet *, u_long, caddr_t); static void bce_watchdog (struct bce_softc *); static int bce_ifmedia_upd (struct ifnet *); -static void bce_ifmedia_upd_locked (struct ifnet *); +static int bce_ifmedia_upd_locked (struct ifnet *); static void bce_ifmedia_sts (struct ifnet *, struct ifmediareq *); static void bce_init_locked (struct bce_softc *); static void bce_init (void *); @@ -5789,15 +5789,16 @@ static int bce_ifmedia_upd(struct ifnet *ifp) { struct bce_softc *sc = ifp->if_softc; + int error; DBENTER(BCE_VERBOSE); BCE_LOCK(sc); - bce_ifmedia_upd_locked(ifp); + error = bce_ifmedia_upd_locked(ifp); BCE_UNLOCK(sc); DBEXIT(BCE_VERBOSE); - return (0); + return (error); } @@ -5807,14 +5808,16 @@ bce_ifmedia_upd(struct ifnet *ifp) /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static int bce_ifmedia_upd_locked(struct ifnet *ifp) { struct bce_softc *sc = ifp->if_softc; struct mii_data *mii; + int error; DBENTER(BCE_VERBOSE_PHY); + error = 0; BCE_LOCK_ASSERT(sc); mii = device_get_softc(sc->bce_miibus); @@ -5828,10 +5831,11 @@ bce_ifmedia_upd_locked(struct ifnet *ifp LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } - mii_mediachg(mii); + error = mii_mediachg(mii); } DBEXIT(BCE_VERBOSE_PHY); + return (error); } From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 21:38:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94D9110656AA; Mon, 19 Jul 2010 21:38:15 +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 6D3498FC20; Mon, 19 Jul 2010 21:38:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JLcFbb090062; Mon, 19 Jul 2010 21:38:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JLcFhu090060; Mon, 19 Jul 2010 21:38:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201007192138.o6JLcFhu090060@svn.freebsd.org> From: Adrian Chadd Date: Mon, 19 Jul 2010 21:38: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: r210262 - head/sys/dev/flash X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jul 2010 21:38:15 -0000 Author: adrian Date: Mon Jul 19 21:38:15 2010 New Revision: 210262 URL: http://svn.freebsd.org/changeset/base/210262 Log: Extend the mx25l flash device support to include a set of per-device flags. Some of these parts will support 4K/32K block erases rather than a sector erase. This includes (at least) the MX25L128. Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Mon Jul 19 21:38:07 2010 (r210261) +++ head/sys/dev/flash/mx25l.c Mon Jul 19 21:38:15 2010 (r210262) @@ -45,6 +45,10 @@ __FBSDID("$FreeBSD$"); #include +#define FL_NONE 0x00 +#define FL_ERASE_4K 0x01 +#define FL_ERASE_32K 0x02 + struct mx25l_flash_ident { const char *name; @@ -52,6 +56,7 @@ struct mx25l_flash_ident uint16_t device_id; unsigned int sectorsize; unsigned int sectorcount; + unsigned int flags; }; struct mx25l_softc @@ -64,6 +69,7 @@ struct mx25l_softc struct disk *sc_disk; struct proc *sc_p; struct bio_queue_head sc_bio_queue; + unsigned int flags; }; #define M25PXX_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) @@ -83,10 +89,10 @@ static void mx25l_strategy(struct bio *b static void mx25l_task(void *arg); struct mx25l_flash_ident flash_devices[] = { - { "mx25ll32", 0xc2, 0x2016, 64 * 1024, 64 }, - { "mx25ll64", 0xc2, 0x2017, 64 * 1024, 128 }, - { "mx25ll128", 0xc2, 0x2018, 64 * 1024, 256 }, - { "s25fl128", 0x01, 0x2018, 64 * 1024, 256 }, + { "mx25ll32", 0xc2, 0x2016, 64 * 1024, 64, FL_NONE }, + { "mx25ll64", 0xc2, 0x2017, 64 * 1024, 128, FL_NONE }, + { "mx25ll128", 0xc2, 0x2018, 64 * 1024, 256, FL_ERASE_4K | FL_ERASE_32K }, + { "s25fl128", 0x01, 0x2018, 64 * 1024, 256, FL_NONE }, }; static uint8_t @@ -369,6 +375,7 @@ mx25l_attach(device_t dev) sc->sc_disk->d_dump = NULL; /* NB: no dumps */ /* Sectorsize for erase operations */ sc->sc_sectorsize = ident->sectorsize; + sc->flags = ident->flags; /* NB: use stripesize to hold the erase/region size for RedBoot */ sc->sc_disk->d_stripesize = ident->sectorsize; From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 21:41:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC0971065674; Mon, 19 Jul 2010 21:41:54 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDF0B8FC16; Mon, 19 Jul 2010 21:41:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JLfsak090973; Mon, 19 Jul 2010 21:41:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JLfsr3090971; Mon, 19 Jul 2010 21:41:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007192141.o6JLfsr3090971@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 19 Jul 2010 21:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210263 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 21:41:55 -0000 Author: yongari Date: Mon Jul 19 21:41:54 2010 New Revision: 210263 URL: http://svn.freebsd.org/changeset/base/210263 Log: Do not report current link state if interface is not UP. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Mon Jul 19 21:38:15 2010 (r210262) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 21:41:54 2010 (r210263) @@ -5855,6 +5855,10 @@ bce_ifmedia_sts(struct ifnet *ifp, struc BCE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + BCE_UNLOCK(sc); + return; + } mii = device_get_softc(sc->bce_miibus); mii_pollstat(mii); From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 21:46:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF7D2106566B; Mon, 19 Jul 2010 21:46: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 A180C8FC19; Mon, 19 Jul 2010 21:46:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JLkeeX092051; Mon, 19 Jul 2010 21:46:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JLken5092049; Mon, 19 Jul 2010 21:46:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201007192146.o6JLken5092049@svn.freebsd.org> From: Adrian Chadd Date: Mon, 19 Jul 2010 21:46: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: r210264 - head/sys/dev/flash X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jul 2010 21:46:40 -0000 Author: adrian Date: Mon Jul 19 21:46:40 2010 New Revision: 210264 URL: http://svn.freebsd.org/changeset/base/210264 Log: Extend the mx25l erase function to support different erase commands. Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Mon Jul 19 21:41:54 2010 (r210263) +++ head/sys/dev/flash/mx25l.c Mon Jul 19 21:46:40 2010 (r210264) @@ -184,7 +184,7 @@ mx25l_set_writable(device_t dev, int wri } static void -mx25l_erase_sector(device_t dev, off_t sector) +mx25l_erase_cmd(device_t dev, off_t sector, uint8_t ecmd) { uint8_t txBuf[4], rxBuf[4]; struct spi_command cmd; @@ -197,7 +197,7 @@ mx25l_erase_sector(device_t dev, off_t s memset(txBuf, 0, sizeof(txBuf)); memset(rxBuf, 0, sizeof(rxBuf)); - txBuf[0] = CMD_SECTOR_ERASE; + txBuf[0] = ecmd; cmd.tx_cmd = txBuf; cmd.rx_cmd = rxBuf; cmd.rx_cmd_sz = 4; @@ -258,7 +258,7 @@ mx25l_write(device_t dev, off_t offset, * If we crossed sector boundary - erase next sector */ if (((offset + bytes_writen) % sc->sc_sectorsize) == 0) - mx25l_erase_sector(dev, offset + bytes_writen); + mx25l_erase_cmd(dev, offset + bytes_writen, CMD_SECTOR_ERASE); txBuf[0] = CMD_PAGE_PROGRAM; txBuf[1] = ((write_offset >> 16) & 0xff); From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 21:50:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44AB31065674; Mon, 19 Jul 2010 21:50:44 +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 36DE48FC16; Mon, 19 Jul 2010 21:50:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JLoitE092974; Mon, 19 Jul 2010 21:50:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JLoi9h092972; Mon, 19 Jul 2010 21:50:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201007192150.o6JLoi9h092972@svn.freebsd.org> From: Adrian Chadd Date: Mon, 19 Jul 2010 21:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210265 - head/sys/dev/flash X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jul 2010 21:50:44 -0000 Author: adrian Date: Mon Jul 19 21:50:43 2010 New Revision: 210265 URL: http://svn.freebsd.org/changeset/base/210265 Log: Fix naming to be consistent. Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Mon Jul 19 21:46:40 2010 (r210264) +++ head/sys/dev/flash/mx25l.c Mon Jul 19 21:50:43 2010 (r210265) @@ -69,7 +69,7 @@ struct mx25l_softc struct disk *sc_disk; struct proc *sc_p; struct bio_queue_head sc_bio_queue; - unsigned int flags; + unsigned int sc_flags; }; #define M25PXX_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) @@ -375,7 +375,7 @@ mx25l_attach(device_t dev) sc->sc_disk->d_dump = NULL; /* NB: no dumps */ /* Sectorsize for erase operations */ sc->sc_sectorsize = ident->sectorsize; - sc->flags = ident->flags; + sc->sc_flags = ident->flags; /* NB: use stripesize to hold the erase/region size for RedBoot */ sc->sc_disk->d_stripesize = ident->sectorsize; From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 23:25:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0500106566B; Mon, 19 Jul 2010 23:25:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2F8B8FC12; Mon, 19 Jul 2010 23:25:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JNPJVL015303; Mon, 19 Jul 2010 23:25:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JNPJIE015301; Mon, 19 Jul 2010 23:25:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007192325.o6JNPJIE015301@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 19 Jul 2010 23:25: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: r210267 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 23:25:19 -0000 Author: yongari Date: Mon Jul 19 23:25:19 2010 New Revision: 210267 URL: http://svn.freebsd.org/changeset/base/210267 Log: Add KASSERT to check number of returned DMA segments. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Mon Jul 19 22:28:07 2010 (r210266) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 23:25:19 2010 (r210267) @@ -3088,6 +3088,8 @@ bce_dma_map_addr(void *arg, bus_dma_segm { bus_addr_t *busaddr = arg; + KASSERT(nseg == 1, ("%s(): Too many segments returned (%d)!", + __FUNCTION__, nseg)); /* Simulate a mapping failure. */ DBRUNIF(DB_RANDOMTRUE(dma_map_addr_failed_sim_control), error = ENOMEM); From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 23:33:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14AF51065670; Mon, 19 Jul 2010 23:33:43 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0716D8FC0A; Mon, 19 Jul 2010 23:33:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JNXgZ1017318; Mon, 19 Jul 2010 23:33:42 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JNXg3F017316; Mon, 19 Jul 2010 23:33:42 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201007192333.o6JNXg3F017316@svn.freebsd.org> From: Rick Macklem Date: Mon, 19 Jul 2010 23:33: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: r210268 - head/sys/fs/nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jul 2010 23:33:43 -0000 Author: rmacklem Date: Mon Jul 19 23:33:42 2010 New Revision: 210268 URL: http://svn.freebsd.org/changeset/base/210268 Log: For the experimental NFSv4 server's dumplocks operation, add the MPSAFE flag to cn_flags so that it doesn't panic. The panics weren't seen since nfsdumpstate(8) is broken for the "-l" case, so this was never done. I'll do a separate commit to fix nfsdumpstate(8). Submitted by: zack.kirsch at isilon.com MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonport.c Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Mon Jul 19 23:25:19 2010 (r210267) +++ head/sys/fs/nfs/nfs_commonport.c Mon Jul 19 23:33:42 2010 (r210268) @@ -210,7 +210,8 @@ nfsrv_lookupfilename(struct nameidata *n { int error; - NDINIT(ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, fname, p); + NDINIT(ndp, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE, UIO_USERSPACE, fname, + p); error = namei(ndp); if (!error) { NDFREE(ndp, NDF_ONLY_PNBUF); From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 23:35:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B49BF106566B; Mon, 19 Jul 2010 23:35:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A44B58FC18; Mon, 19 Jul 2010 23:35:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JNZhWg017798; Mon, 19 Jul 2010 23:35:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JNZhkp017796; Mon, 19 Jul 2010 23:35:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007192335.o6JNZhkp017796@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 19 Jul 2010 23:35: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: r210269 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 23:35:43 -0000 Author: yongari Date: Mon Jul 19 23:35:43 2010 New Revision: 210269 URL: http://svn.freebsd.org/changeset/base/210269 Log: Use bus_get_dma_tag() to get parent tag. Also use BUS_SPACE_MAXSIZE_32BIT to specify sum of all segment lengths. Previously it used MAXBSIZE which was wrong. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Mon Jul 19 23:33:42 2010 (r210268) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 23:35:43 2010 (r210269) @@ -3146,10 +3146,10 @@ bce_dma_alloc(device_t dev) /* * Allocate the parent bus DMA tag appropriate for PCI. */ - if (bus_dma_tag_create(NULL, 1, BCE_DMA_BOUNDARY, + if (bus_dma_tag_create(bus_get_dma_tag(dev), 1, BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, - MAXBSIZE, BUS_SPACE_UNRESTRICTED, BUS_SPACE_MAXSIZE_32BIT, - 0, NULL, NULL, &sc->parent_tag)) { + BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, + &sc->parent_tag)) { BCE_PRINTF("%s(%d): Could not allocate parent DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 23:41:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F097106566B; Mon, 19 Jul 2010 23:41:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 466478FC0A; Mon, 19 Jul 2010 23:41:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JNfkTJ019183; Mon, 19 Jul 2010 23:41:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JNfk0K019181; Mon, 19 Jul 2010 23:41:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007192341.o6JNfk0K019181@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 19 Jul 2010 23:41: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: r210270 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 23:41:46 -0000 Author: yongari Date: Mon Jul 19 23:41:45 2010 New Revision: 210270 URL: http://svn.freebsd.org/changeset/base/210270 Log: Specify BUS_DMA_ZERO flag to bus_dmamem_alloc(9) and remove bzero() calls. Also add BUS_DMA_COHERENT flag to bus_dmamem_alloc(9) to take advantage of efficient synchronization for architectures that support that feature. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Mon Jul 19 23:35:43 2010 (r210269) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 23:41:45 2010 (r210270) @@ -3172,15 +3172,14 @@ bce_dma_alloc(device_t dev) } if(bus_dmamem_alloc(sc->status_tag, (void **)&sc->status_block, - BUS_DMA_NOWAIT, &sc->status_map)) { + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->status_map)) { BCE_PRINTF("%s(%d): Could not allocate status block " "DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } - bzero((char *)sc->status_block, BCE_STATUS_BLK_SZ); - error = bus_dmamap_load(sc->status_tag, sc->status_map, sc->status_block, BCE_STATUS_BLK_SZ, bce_dma_map_addr, &sc->status_block_paddr, BUS_DMA_NOWAIT); @@ -3211,15 +3210,13 @@ bce_dma_alloc(device_t dev) } if (bus_dmamem_alloc(sc->stats_tag, (void **)&sc->stats_block, - BUS_DMA_NOWAIT, &sc->stats_map)) { + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->stats_map)) { BCE_PRINTF("%s(%d): Could not allocate statistics block " "DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } - bzero((char *)sc->stats_block, BCE_STATS_BLK_SZ); - error = bus_dmamap_load(sc->stats_tag, sc->stats_map, sc->stats_block, BCE_STATS_BLK_SZ, bce_dma_map_addr, &sc->stats_block_paddr, BUS_DMA_NOWAIT); @@ -3265,7 +3262,7 @@ bce_dma_alloc(device_t dev) if(bus_dmamem_alloc(sc->ctx_tag, (void **)&sc->ctx_block[i], - BUS_DMA_NOWAIT, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->ctx_map[i])) { BCE_PRINTF("%s(%d): Could not allocate CTX " "DMA memory!\n", __FILE__, __LINE__); @@ -3273,8 +3270,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - bzero((char *)sc->ctx_block[i], BCM_PAGE_SIZE); - error = bus_dmamap_load(sc->ctx_tag, sc->ctx_map[i], sc->ctx_block[i], BCM_PAGE_SIZE, bce_dma_map_addr, &sc->ctx_paddr[i], BUS_DMA_NOWAIT); @@ -3310,7 +3305,8 @@ bce_dma_alloc(device_t dev) for (i = 0; i < TX_PAGES; i++) { if(bus_dmamem_alloc(sc->tx_bd_chain_tag, - (void **)&sc->tx_bd_chain[i], BUS_DMA_NOWAIT, + (void **)&sc->tx_bd_chain[i], + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->tx_bd_chain_map[i])) { BCE_PRINTF("%s(%d): Could not allocate TX descriptor " "chain DMA memory!\n", __FILE__, __LINE__); @@ -3386,7 +3382,8 @@ bce_dma_alloc(device_t dev) for (i = 0; i < RX_PAGES; i++) { if (bus_dmamem_alloc(sc->rx_bd_chain_tag, - (void **)&sc->rx_bd_chain[i], BUS_DMA_NOWAIT, + (void **)&sc->rx_bd_chain[i], + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->rx_bd_chain_map[i])) { BCE_PRINTF("%s(%d): Could not allocate RX descriptor " "chain DMA memory!\n", __FILE__, __LINE__); @@ -3394,8 +3391,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - bzero((char *)sc->rx_bd_chain[i], BCE_RX_CHAIN_PAGE_SZ); - error = bus_dmamap_load(sc->rx_bd_chain_tag, sc->rx_bd_chain_map[i], sc->rx_bd_chain[i], BCE_RX_CHAIN_PAGE_SZ, bce_dma_map_addr, @@ -3429,9 +3424,10 @@ bce_dma_alloc(device_t dev) "size = 0x%jX)\n", __FUNCTION__, (uintmax_t) max_size, max_segments, (uintmax_t) max_seg_size); - if (bus_dma_tag_create(sc->parent_tag, 1, BCE_DMA_BOUNDARY, - sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, max_size, - max_segments, max_seg_size, 0, NULL, NULL, &sc->rx_mbuf_tag)) { + if (bus_dma_tag_create(sc->parent_tag, 1, + BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, + max_size, max_segments, max_seg_size, 0, NULL, NULL, + &sc->rx_mbuf_tag)) { BCE_PRINTF("%s(%d): Could not allocate RX mbuf DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3468,7 +3464,8 @@ bce_dma_alloc(device_t dev) for (i = 0; i < PG_PAGES; i++) { if (bus_dmamem_alloc(sc->pg_bd_chain_tag, - (void **)&sc->pg_bd_chain[i], BUS_DMA_NOWAIT, + (void **)&sc->pg_bd_chain[i], + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->pg_bd_chain_map[i])) { BCE_PRINTF("%s(%d): Could not allocate page " "descriptor chain DMA memory!\n", @@ -3477,8 +3474,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - bzero((char *)sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ); - error = bus_dmamap_load(sc->pg_bd_chain_tag, sc->pg_bd_chain_map[i], sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ, bce_dma_map_addr, From owner-svn-src-head@FreeBSD.ORG Mon Jul 19 23:48:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BDDF106566C; Mon, 19 Jul 2010 23:48:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B6F98FC13; Mon, 19 Jul 2010 23:48:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JNm3lL021547; Mon, 19 Jul 2010 23:48:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6JNm3Kd021543; Mon, 19 Jul 2010 23:48:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007192348.o6JNm3Kd021543@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 19 Jul 2010 23:48: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: r210271 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 23:48:03 -0000 Author: yongari Date: Mon Jul 19 23:48:03 2010 New Revision: 210271 URL: http://svn.freebsd.org/changeset/base/210271 Log: Specify BCE_RX_BUF_ALIGN alignment for RX buffers. All bce(4) controllers require RX buffers aligned on BCE_RX_BUF_ALIGN bytes. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcereg.h Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Mon Jul 19 23:41:45 2010 (r210270) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 23:48:03 2010 (r210271) @@ -3424,7 +3424,7 @@ bce_dma_alloc(device_t dev) "size = 0x%jX)\n", __FUNCTION__, (uintmax_t) max_size, max_segments, (uintmax_t) max_seg_size); - if (bus_dma_tag_create(sc->parent_tag, 1, + if (bus_dma_tag_create(sc->parent_tag, BCE_RX_BUF_ALIGN, BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, max_size, max_segments, max_seg_size, 0, NULL, NULL, &sc->rx_mbuf_tag)) { Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Mon Jul 19 23:41:45 2010 (r210270) +++ head/sys/dev/bce/if_bcereg.h Mon Jul 19 23:48:03 2010 (r210271) @@ -6316,6 +6316,7 @@ struct fw_info { #define BCE_DMA_ALIGN 8 #define BCE_DMA_BOUNDARY 0 +#define BCE_RX_BUF_ALIGN 16 #define BCE_MAX_CONTEXT 4 From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 00:32:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B36791065672; Tue, 20 Jul 2010 00:32:11 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A51048FC0A; Tue, 20 Jul 2010 00:32:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6K0WBPW031702; Tue, 20 Jul 2010 00:32:11 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6K0WBm6031700; Tue, 20 Jul 2010 00:32:11 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201007200032.o6K0WBm6031700@svn.freebsd.org> From: Rick Macklem Date: Tue, 20 Jul 2010 00:32: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: r210272 - head/usr.sbin/nfsdumpstate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 00:32:11 -0000 Author: rmacklem Date: Tue Jul 20 00:32:11 2010 New Revision: 210272 URL: http://svn.freebsd.org/changeset/base/210272 Log: Fix handling of the "-l" argument for nfsdumpstate(8). Submitted by: zack.kirsch at isilon.com MFC after: 2 weeks Modified: head/usr.sbin/nfsdumpstate/nfsdumpstate.c Modified: head/usr.sbin/nfsdumpstate/nfsdumpstate.c ============================================================================== --- head/usr.sbin/nfsdumpstate/nfsdumpstate.c Mon Jul 19 23:48:03 2010 (r210271) +++ head/usr.sbin/nfsdumpstate/nfsdumpstate.c Tue Jul 20 00:32:11 2010 (r210272) @@ -76,7 +76,7 @@ main(int argc, char **argv) errx(1, "nfsd not loaded - self terminating"); openstate = 0; lockfile = NULL; - while ((ch = getopt(argc, argv, "ol")) != -1) + while ((ch = getopt(argc, argv, "ol:")) != -1) switch (ch) { case 'o': openstate = 1; From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 02:23:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7252106566B; Tue, 20 Jul 2010 02:23:12 +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 D66EB8FC12; Tue, 20 Jul 2010 02:23:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6K2NCBQ056526; Tue, 20 Jul 2010 02:23:12 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6K2NCAi056524; Tue, 20 Jul 2010 02:23:12 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201007200223.o6K2NCAi056524@svn.freebsd.org> From: David Xu Date: Tue, 20 Jul 2010 02:23: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: r210274 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 02:23:13 -0000 Author: davidxu Date: Tue Jul 20 02:23:12 2010 New Revision: 210274 URL: http://svn.freebsd.org/changeset/base/210274 Log: Fix function name in error messages. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Jul 20 00:46:18 2010 (r210273) +++ head/sys/kern/kern_sig.c Tue Jul 20 02:23:12 2010 (r210274) @@ -2029,9 +2029,9 @@ tdsendsignal(struct proc *p, struct thre PROC_LOCK_ASSERT(p, MA_OWNED); if (!_SIG_VALID(sig)) - panic("tdsignal(): invalid signal %d", sig); + panic("%s(): invalid signal %d", __func__, sig); - KASSERT(ksi == NULL || !KSI_ONQ(ksi), ("tdsignal: ksi on queue")); + KASSERT(ksi == NULL || !KSI_ONQ(ksi), ("%s: ksi on queue", __func__)); /* * IEEE Std 1003.1-2001: return success when killing a zombie. From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 03:10:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 917AF106566B; Tue, 20 Jul 2010 03:10:22 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DE028FC17; Tue, 20 Jul 2010 03:10:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6K3AMuo067022; Tue, 20 Jul 2010 03:10:22 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6K3AMLe067018; Tue, 20 Jul 2010 03:10:22 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201007200310.o6K3AMLe067018@svn.freebsd.org> From: Andrew Thompson Date: Tue, 20 Jul 2010 03:10: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: r210275 - in head: share/man/man4 sys/dev/usb sys/dev/usb/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, 20 Jul 2010 03:10:22 -0000 Author: thompsa Date: Tue Jul 20 03:10:22 2010 New Revision: 210275 URL: http://svn.freebsd.org/changeset/base/210275 Log: - Support for Globetrotter iCON 452. - Fixed the interface probe routine to only attach to USB interfaces the driver actually supports. This allows other drivers to attach to things like MicroSD slots etc. - Fixed network interface enumeration to be globally sequential instead of relying on the USB interface numbers. This make sure the first network interface always is at uhso0 and the second at usho1 and so on. - Added a radio kill switch; exposed through sysctl. - Updated the manual page to be verbose about the number of serial ports and include iCON 452 in the set of tested hardware. Submitted by: Fredrik Lindberg Modified: head/share/man/man4/uhso.4 head/sys/dev/usb/net/uhso.c head/sys/dev/usb/usbdevs Modified: head/share/man/man4/uhso.4 ============================================================================== --- head/share/man/man4/uhso.4 Tue Jul 20 02:23:12 2010 (r210274) +++ head/share/man/man4/uhso.4 Tue Jul 20 03:10:22 2010 (r210275) @@ -43,8 +43,9 @@ based on their packet interface. Each device has a set of serial ports and a raw IP packet interface. The serial ports of the device are accessed through the .Xr ucom 4 -driver which makes them behave like a -.Xr tty 4 . +driver which makes them behave like +.Xr tty 4 +devices. The packet interface is exposed as a network interface. .Pp Establishing a connection on the packet interface is achieved by using the @@ -60,10 +61,19 @@ these calls. Each device usually have at least two or more serial ports, their individual purpose can be identified through .Xr sysctl 8 . +Ports identified as +.Dq Modem +features a normal modem interface that can be used with PPP. +Ports identified as +.Dq Diagnostic +uses a proprietary binary interface used for firmware upgrades, this port does not +have a AT command interface and can not be used to control the device. +Other ports features an AT command interface that can be used for normal device control. .Sh HARDWARE The .Nm -driver supports at least the following cards +driver should work with most devices from Option. +The following devices have been verified to work .Pp .Bl -bullet -compact .It @@ -71,6 +81,8 @@ Option GlobeSurfer iCON 7.2 (new firmwar .It Option iCON 225 .It +Option iCON 452 +.It Option iCON 505 .El .Pp @@ -92,7 +104,8 @@ to 0 using .It Pa /dev/cuaU?.? .El .Sh EXAMPLES -Establishing a packet interface connection +Establishing a packet interface connection using the AT command interface available +at one of the serial ports .Bd -literal -offset indent AT+CGDCONT=1,,"apn.provider" AT_OWANCALL=1,1,1 Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Tue Jul 20 02:23:12 2010 (r210274) +++ head/sys/dev/usb/net/uhso.c Tue Jul 20 03:10:22 2010 (r210275) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009 Fredrik Lindberg + * Copyright (c) 2010 Fredrik Lindberg * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -81,6 +82,7 @@ struct uhso_softc { struct usb_device *sc_udev; struct mtx sc_mtx; uint32_t sc_type; /* Interface definition */ + int sc_radio; struct usb_xfer *sc_xfer[3]; uint8_t sc_iface_no; @@ -155,6 +157,7 @@ struct uhso_softc { * Note that these definitions are arbitrary and do not match the values * returned by the auto config descriptor. */ +#define UHSO_PORT_TYPE_UNKNOWN 0x00 #define UHSO_PORT_TYPE_CTL 0x01 #define UHSO_PORT_TYPE_APP 0x02 #define UHSO_PORT_TYPE_APP2 0x03 @@ -185,7 +188,7 @@ static char *uhso_port[] = { * descriptor values. */ static unsigned char uhso_port_map[] = { - 0, + UHSO_PORT_TYPE_UNKNOWN, UHSO_PORT_TYPE_DIAG, UHSO_PORT_TYPE_GPS, UHSO_PORT_TYPE_GPSCTL, @@ -243,6 +246,9 @@ static char *uhso_port_type_sysctl[] = { #define UHSO_STATIC_IFACE 0x01 #define UHSO_AUTO_IFACE 0x02 +/* ifnet device unit allocations */ +static struct unrhdr *uhso_ifnet_unit = NULL; + static const struct usb_device_id uhso_devs[] = { #define UHSO_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } /* Option GlobeSurfer iCON 7.2 */ @@ -272,6 +278,8 @@ static const struct usb_device_id uhso_d UHSO_DEV(OPTION, GTICON322, UHSO_STATIC_IFACE), /* Option iCON 505 */ UHSO_DEV(OPTION, ICON505, UHSO_AUTO_IFACE), + /* Option iCON 452 */ + UHSO_DEV(OPTION, ICON505, UHSO_AUTO_IFACE), #undef UHSO_DEV }; @@ -432,9 +440,9 @@ static const struct usb_config uhso_bs_c }; static int uhso_probe_iface(struct uhso_softc *, int, - int (*probe)(struct uhso_softc *, int)); -static int uhso_probe_iface_auto(struct uhso_softc *, int); -static int uhso_probe_iface_static(struct uhso_softc *, int); + int (*probe)(struct usb_device *, int)); +static int uhso_probe_iface_auto(struct usb_device *, int); +static int uhso_probe_iface_static(struct usb_device *, int); static int uhso_attach_muxserial(struct uhso_softc *, struct usb_interface *, int type); static int uhso_attach_bulkserial(struct uhso_softc *, struct usb_interface *, @@ -444,6 +452,8 @@ static int uhso_attach_ifnet(struct uhs static void uhso_test_autoinst(void *, struct usb_device *, struct usb_attach_arg *); static int uhso_driver_loaded(struct module *, int, void *); +static int uhso_radio_sysctl(SYSCTL_HANDLER_ARGS); +static int uhso_radio_ctrl(struct uhso_softc *, int); static void uhso_ucom_start_read(struct ucom_softc *); static void uhso_ucom_stop_read(struct ucom_softc *); @@ -497,6 +507,7 @@ static int uhso_probe(device_t self) { struct usb_attach_arg *uaa = device_get_ivars(self); + int error; if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); @@ -505,7 +516,20 @@ uhso_probe(device_t self) if (uaa->device->ddesc.bDeviceClass != 0xff) return (ENXIO); - return (usbd_lookup_id_by_uaa(uhso_devs, sizeof(uhso_devs), uaa)); + error = usbd_lookup_id_by_uaa(uhso_devs, sizeof(uhso_devs), uaa); + if (error != 0) + return (error); + + /* + * Probe device to see if we are able to attach + * to this interface or not. + */ + if (USB_GET_DRIVER_INFO(uaa) == UHSO_AUTO_IFACE) { + if (uhso_probe_iface_auto(uaa->device, + uaa->info.bIfaceNum) == 0) + return (ENXIO); + } + return (error); } static int @@ -517,7 +541,7 @@ uhso_attach(device_t self) struct usb_interface_descriptor *id; struct sysctl_ctx_list *sctx; struct sysctl_oid *soid; - struct sysctl_oid *tree, *tty_node; + struct sysctl_oid *tree = NULL, *tty_node; struct ucom_softc *ucom; struct uhso_tty *ht; int i, error, port; @@ -531,6 +555,7 @@ uhso_attach(device_t self) sc->sc_ucom = NULL; sc->sc_ttys = 0; + sc->sc_radio = 1; cd = usbd_get_config_descriptor(uaa->device); id = usbd_get_interface_descriptor(uaa->iface); @@ -566,6 +591,8 @@ uhso_attach(device_t self) SYSCTL_ADD_STRING(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "type", CTLFLAG_RD, uhso_port[UHSO_IFACE_PORT(sc->sc_type)], 0, "Port available at this interface"); + SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "radio", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, uhso_radio_sysctl, "I", "Enable radio"); /* * The default interface description on most Option devices isn't @@ -655,6 +682,7 @@ uhso_detach(device_t self) if (sc->sc_ifp != NULL) { callout_drain(&sc->sc_c); + free_unr(uhso_ifnet_unit, sc->sc_ifp->if_dunit); mtx_lock(&sc->sc_mtx); uhso_if_stop(sc); bpfdetach(sc->sc_ifp); @@ -701,9 +729,12 @@ uhso_driver_loaded(struct module *mod, i /* register our autoinstall handler */ uhso_etag = EVENTHANDLER_REGISTER(usb_dev_configured, uhso_test_autoinst, NULL, EVENTHANDLER_PRI_ANY); + /* create our unit allocator for inet devs */ + uhso_ifnet_unit = new_unrhdr(0, INT_MAX, NULL); break; case MOD_UNLOAD: EVENTHANDLER_DEREGISTER(usb_dev_configured, uhso_etag); + delete_unrhdr(uhso_ifnet_unit); break; default: return (EOPNOTSUPP); @@ -717,7 +748,7 @@ uhso_driver_loaded(struct module *mod, i * Returns a bit mask with the interface capabilities. */ static int -uhso_probe_iface_auto(struct uhso_softc *sc, int index) +uhso_probe_iface_auto(struct usb_device *udev, int index) { struct usb_device_request req; usb_error_t uerr; @@ -731,11 +762,11 @@ uhso_probe_iface_auto(struct uhso_softc USETW(req.wIndex, 0); USETW(req.wLength, 17); - uerr = usbd_do_request_flags(sc->sc_udev, NULL, &req, buf, + uerr = usbd_do_request_flags(udev, NULL, &req, buf, 0, &actlen, USB_MS_HZ); if (uerr != 0) { - device_printf(sc->sc_dev, "usbd_do_request_flags failed: %s\n", - usbd_errstr(uerr)); + printf("%s: usbd_do_request_flags failed, %s\n", + __func__, usbd_errstr(uerr)); return (0); } @@ -759,23 +790,35 @@ uhso_probe_iface_auto(struct uhso_softc case UHSO_PORT_TYPE_NETWORK: return (UHSO_IFACE_SPEC(UHSO_IF_NET | UHSO_IF_MUX, UHSO_PORT_SERIAL | UHSO_PORT_NETWORK, port)); - case UHSO_PORT_TYPE_VOICE: - /* Don't claim 'voice' ports */ - return (0); - default: + case UHSO_PORT_TYPE_DIAG: + case UHSO_PORT_TYPE_DIAG2: + case UHSO_PORT_TYPE_CTL: + case UHSO_PORT_TYPE_APP: + case UHSO_PORT_TYPE_APP2: + case UHSO_PORT_TYPE_MODEM: return (UHSO_IFACE_SPEC(UHSO_IF_BULK, UHSO_PORT_SERIAL, port)); + case UHSO_PORT_TYPE_MSD: + return (0); + case UHSO_PORT_TYPE_UNKNOWN: + default: + return (0); } return (0); } +/* + * Returns the capabilities of interfaces for devices that don't + * support the automatic query. + * Returns a bit mask with the interface capabilities. + */ static int -uhso_probe_iface_static(struct uhso_softc *sc, int index) +uhso_probe_iface_static(struct usb_device *udev, int index) { struct usb_config_descriptor *cd; - cd = usbd_get_config_descriptor(sc->sc_udev); + cd = usbd_get_config_descriptor(udev); if (cd->bNumInterface <= 3) { /* Cards with 3 or less interfaces */ switch (index) { @@ -817,14 +860,14 @@ uhso_probe_iface_static(struct uhso_soft */ static int uhso_probe_iface(struct uhso_softc *sc, int index, - int (*probe)(struct uhso_softc *, int)) + int (*probe)(struct usb_device *, int)) { struct usb_interface *iface; int type, error; UHSO_DPRINTF(1, "Probing for interface %d, probe_func=%p\n", index, probe); - type = probe(sc, index); + type = probe(sc->sc_udev, index); UHSO_DPRINTF(1, "Probe result %x\n", type); if (type <= 0) return (ENXIO); @@ -888,6 +931,47 @@ uhso_probe_iface(struct uhso_softc *sc, return (0); } +static int +uhso_radio_ctrl(struct uhso_softc *sc, int onoff) +{ + struct usb_device_request req; + usb_error_t uerr; + + req.bmRequestType = UT_VENDOR; + req.bRequest = onoff ? 0x82 : 0x81; + USETW(req.wValue, 0); + USETW(req.wIndex, 0); + USETW(req.wLength, 0); + + uerr = usbd_do_request(sc->sc_udev, NULL, &req, NULL); + if (uerr != 0) { + device_printf(sc->sc_dev, "usbd_do_request_flags failed: %s\n", + usbd_errstr(uerr)); + return (-1); + } + return (onoff); +} + +static int +uhso_radio_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct uhso_softc *sc = arg1; + int error, radio; + + radio = sc->sc_radio; + error = sysctl_handle_int(oidp, &radio, 0, req); + if (error) + return (error); + if (radio != sc->sc_radio) { + radio = radio != 0 ? 1 : 0; + error = uhso_radio_ctrl(sc, radio); + if (error != -1) + sc->sc_radio = radio; + + } + return (0); +} + /* * Expands allocated memory to fit an additional TTY. * Two arrays are kept with matching indexes, one for ucom and one @@ -1435,13 +1519,14 @@ uhso_ucom_stop_write(struct ucom_softc * } } -static int uhso_attach_ifnet(struct uhso_softc *sc, struct usb_interface *iface, - int type) +static int +uhso_attach_ifnet(struct uhso_softc *sc, struct usb_interface *iface, int type) { struct ifnet *ifp; usb_error_t uerr; struct sysctl_ctx_list *sctx; struct sysctl_oid *soid; + unsigned int devunit; uerr = usbd_transfer_setup(sc->sc_udev, &iface->idesc->bInterfaceNumber, sc->sc_if_xfer, @@ -1463,7 +1548,14 @@ static int uhso_attach_ifnet(struct uhso callout_reset(&sc->sc_c, 1, uhso_if_rxflush, sc); mtx_unlock(&sc->sc_mtx); - if_initname(ifp, device_get_name(sc->sc_dev), device_get_unit(sc->sc_dev)); + /* + * We create our own unit numbers for ifnet devices because the + * USB interface unit numbers can be at arbitrary positions yielding + * odd looking device names. + */ + devunit = alloc_unr(uhso_ifnet_unit); + + if_initname(ifp, device_get_name(sc->sc_dev), devunit); ifp->if_mtu = UHSO_MAX_MTU; ifp->if_ioctl = uhso_if_ioctl; ifp->if_init = uhso_if_init; Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jul 20 02:23:12 2010 (r210274) +++ head/sys/dev/usb/usbdevs Tue Jul 20 03:10:22 2010 (r210275) @@ -2301,6 +2301,7 @@ product OPTION ICONEDGE 0xc031 GlobeSur product OPTION MODHSXPA 0xd013 Globetrotter HSUPA product OPTION ICON321 0xd031 Globetrotter HSUPA product OPTION ICON505 0xd055 Globetrotter iCON 505 +product OPTION_ICON452 0x7901 Globetrotter iCON 452 /* OvisLink product */ product OVISLINK RT3072 0x3072 RT3072 From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 03:11:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFD4F106567B; Tue, 20 Jul 2010 03:11:26 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C2E58FC1E; Tue, 20 Jul 2010 03:11:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6K3BQni067448; Tue, 20 Jul 2010 03:11:26 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6K3BQWj067446; Tue, 20 Jul 2010 03:11:26 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201007200311.o6K3BQWj067446@svn.freebsd.org> From: Andrew Thompson Date: Tue, 20 Jul 2010 03:11: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: r210276 - head/usr.sbin/uhsoctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 03:11:26 -0000 Author: thompsa Date: Tue Jul 20 03:11:26 2010 New Revision: 210276 URL: http://svn.freebsd.org/changeset/base/210276 Log: - Fixed automatic detection of the control serial port. - Fixed segmentation fault when an invalid network interface was given. - More helpful message in case of wrong PIN number. Submitted by: Fredrik Lindberg Modified: head/usr.sbin/uhsoctl/uhsoctl.c Modified: head/usr.sbin/uhsoctl/uhsoctl.c ============================================================================== --- head/usr.sbin/uhsoctl/uhsoctl.c Tue Jul 20 03:10:22 2010 (r210275) +++ head/usr.sbin/uhsoctl/uhsoctl.c Tue Jul 20 03:11:26 2010 (r210276) @@ -66,6 +66,7 @@ #define TTY_NAME "/dev/%s" #define SYSCTL_TEST "dev.uhso.%d.%%driver" +#define SYSCTL_LOCATION "dev.uhso.%d.%%location" #define SYSCTL_PORTS "dev.uhso.%d.ports" #define SYSCTL_NETIF "dev.uhso.%d.netif" #define SYSCTL_NAME_TTY "dev.uhso.%d.port.%s.tty" @@ -207,9 +208,6 @@ tmr_run(struct timers *tmrs) while (te->timeout <= 0) { te2 = TAILQ_NEXT(te, next); TAILQ_REMOVE(&tmrs->head, te, next); - if (te2 != NULL) - te2->timeout -= tmrs->res; - te->func(te->id, te->arg); free(te); te = te2; @@ -579,12 +577,13 @@ readline(int fd, char *buf, size_t bufsz static int at_cmd(struct ctx *ctx, const char *resp, resp_cb cb, resp_arg *ra, const char *cf, ...) { + char buf[512]; + char cmd[64]; size_t l; int n, error, retval = 0; va_list ap; fd_set set; - char buf[512]; - char cmd[64]; + char *p; va_start(ap, cf); vsnprintf(cmd, sizeof(cmd), cf, ap); @@ -614,12 +613,12 @@ at_cmd(struct ctx *ctx, const char *resp do { FD_SET(ctx->fd, &set); error = select(ctx->fd + 1, &set, NULL, NULL, NULL); - if (error < 0 && errno == EINTR && ctx->flags & FLG_WDEXP) { + if (ctx->flags & FLG_WDEXP) { watchdog_disable(ctx); - retval = -2; - break; + return (-2); } } while (error <= 0 && errno == EINTR); + watchdog_disable(ctx); if (error <= 0) { retval = -2; @@ -635,24 +634,30 @@ at_cmd(struct ctx *ctx, const char *resp if (strcmp(buf, "\r\n") == 0 || strcmp(buf, "\n") == 0) continue; + if ((p = strchr(buf, '\r')) != NULL) + *p = '\0'; + else if ((p = strchr(buf, '\n')) != NULL) + *p = '\0'; #ifdef DEBUG - fprintf(stderr, "SYNC_RESP: %s", buf); + fprintf(stderr, "SYNC_RESP: %s\n", buf); #endif + /* Skip local echo */ + if (strncasecmp(cmd, buf, strlen(buf)) == 0) + continue; + + if (cb != NULL) + cb(ra, cmd, buf); + if (strncmp(buf, "OK", 2) == 0) { + retval = retval ? retval : 0; break; - } - else if (strncmp(buf, "ERROR", 5) == 0) { + } else if (strstr(buf, "ERROR") != NULL) { retval = -1; break; } - - if (resp != NULL) { - retval = strncmp(resp, buf, l); - if (retval == 0 && cb != NULL) { - cb(ra, cmd, buf); - } - } + if (resp != NULL) + retval = strncmp(buf, resp, l); } #ifdef DEBUG fprintf(stderr, "SYNC_RETVAL=%d\n", retval); @@ -684,6 +689,10 @@ saveresp(resp_arg *ra, const char *cmd, char **buf; int i = ra->val[1].int32; +#ifdef DEBUG + fprintf(stderr, "Save '%s'\n", resp); +#endif + buf = realloc(ra->val[0].ptr, sizeof(char *) * (i + 1)); if (buf == NULL) return; @@ -695,6 +704,19 @@ saveresp(resp_arg *ra, const char *cmd, } static void +freeresp(resp_arg *ra) +{ + char **buf; + int i; + + buf = ra->val[0].ptr; + for (i = 0; i < ra->val[1].int32; i++) { + free(buf[i]); + } + free(buf); +} + +static void at_async_creg(void *arg, const char *resp) { struct ctx *ctx = arg; @@ -992,129 +1014,119 @@ static const char *port_type_list[] = { /* * Attempts to find a list of control tty for the interface - * FreeBSD attaches USb devices per interface so we have to go through + * FreeBSD attaches USB devices per interface so we have to go through * hoops to find which ttys that belong to our network interface. */ static char ** get_tty(struct ctx *ctx) { - char buf[64]; - char data[128]; - size_t len; - int error; - unsigned int i; + char buf[64], data[128]; + int error, i, usbport, usbport0, list_size = 0; char **list = NULL; - int list_size = 0; - const char **p; + size_t len; + const char **p, *q; + /* + * Look for the network interface first + */ for (i = 0; ; i++) { - /* Basic test to check if we're even in the right ballpark */ + /* Check if we still have uhso nodes to check */ snprintf(buf, 64, SYSCTL_TEST, i); len = 127; error = sysctlbyname(buf, data, &len, NULL, 0); + data[len] = '\0'; #ifdef DEBUG fprintf(stderr, "sysctl %s returned(%d): %s\n", buf, error, error == 0 ? data : "FAILED"); #endif - if (error < 0) - return NULL; - if (strcasecmp(data, "uhso") != 0) + if (error < 0 || strcasecmp(data, "uhso") != 0) return NULL; - /* Check for interface */ + /* Check if this node contains the network interface we want */ snprintf(buf, 64, SYSCTL_NETIF, i); len = 127; error = sysctlbyname(buf, data, &len, NULL, 0); + data[len] = '\0'; #ifdef DEBUG fprintf(stderr, "sysctl %s returned(%d): %s\n", buf, error, error == 0 ? data : "FAILED"); #endif - if (error < 0) - continue; + if (error == 0 && strcasecmp(data, ctx->ifnam) == 0) + break; + } - if (strcasecmp(data, ctx->ifnam) != 0) - continue; + /* Figure out the USB port location */ + snprintf(buf, 64, SYSCTL_LOCATION, i); + len = 127; + error = sysctlbyname(buf, data, &len, NULL, 0); + data[len] = '\0'; #ifdef DEBUG - fprintf(stderr, "Found %s at %s\n", ctx->ifnam, buf); + fprintf(stderr, "sysctl %s returned(%d): %s\n", + buf, error, error == 0 ? data : "FAILED"); #endif - break; - } + if (error != 0) + return (NULL); - /* Add multiplexed ports */ - for (p = port_type_list; *p != NULL; p++) { - snprintf(buf, 64, SYSCTL_NAME_TTY, i, *p); - len = 127; - error = sysctlbyname(buf, data, &len, NULL, 0); + q = strstr(data, "port="); + if (q != NULL) { + error = sscanf(q, " port=%d", &usbport); + if (error != 1) { #ifdef DEBUG - fprintf(stderr, "sysctl %s returned(%d): %s\n", - buf, error, error == 0 ? data : "FAILED"); + fprintf(stderr, "failed to read usb port location from '%s'\n", data); #endif - if (error == 0) { - list = realloc(list, (list_size + 1) * sizeof(char *)); - list[list_size] = malloc(strlen(data) + strlen(TTY_NAME)); - sprintf(list[list_size], TTY_NAME, data); - list_size++; + return (NULL); } + } else { +#ifdef DEBUG + fprintf(stderr, "failed to parse location '%s'\n", data); +#endif + return (NULL); } - - /* - * We can return directly if we found multiplexed serial ports because - * devices with these ports only have additional diagnostic ports (useless) - * and modem ports (for used with pppd). - */ - if (list_size > 0) { - list = realloc(list, (list_size + 1) * sizeof(char *)); - list[list_size] = NULL; - return list; - } +#ifdef DEBUG + fprintf(stderr, "USB port location=%d\n", usbport); +#endif /* - * The network port is on a high numbered interface so we walk backwards until - * we hit anything other than application/control. + * Now go through it all again but only look at those matching the + * usb port location we found. */ - - for (--i; i >= 0; i--) { - /* Basic test to check if we're even in the right ballpark */ - snprintf(buf, 64, SYSCTL_TEST, i); + for (i = 0; ; i++) { + snprintf(buf, 64, SYSCTL_LOCATION, i); len = 127; + memset(&data, 0, sizeof(data)); error = sysctlbyname(buf, data, &len, NULL, 0); -#ifdef DEBUG - fprintf(stderr, "sysctl %s returned(%d): %s\n", - buf, error, error == 0 ? data : "FAILED"); -#endif - if (error < 0) - break; - if (strcasecmp(data, "uhso") != 0) + if (error != 0) break; + data[len] = '\0'; + q = strstr(data, "port="); + if (q == NULL) + continue; + sscanf(q, " port=%d", &usbport0); + if (usbport != usbport0) + continue; - /* Test for useable ports */ + /* Try to add ports */ for (p = port_type_list; *p != NULL; p++) { - snprintf(buf, 64, SYSCTL_NAME_TTY, i, p); + snprintf(buf, 64, SYSCTL_NAME_TTY, i, *p); len = 127; + memset(&data, 0, sizeof(data)); error = sysctlbyname(buf, data, &len, NULL, 0); + data[len] = '\0'; +#ifdef DEBUG + fprintf(stderr, "sysctl %s returned(%d): %s\n", + buf, error, error == 0 ? data : "FAILED"); +#endif if (error == 0) { list = realloc(list, (list_size + 1) * sizeof(char *)); list[list_size] = malloc(strlen(data) + strlen(TTY_NAME)); - sprintf(list[list_size], TTY_NAME, data); - list_size++; + sprintf(list[list_size], TTY_NAME, data); + list_size++; } } - - /* HACK! first port is a diagnostic port, we abort here */ - snprintf(buf, 64, SYSCTL_NAME_TTY, i, "diagnostic"); - len = 127; - error = sysctlbyname(buf, data, &len, NULL, 0); -#ifdef DEBUG - fprintf(stderr, "sysctl %s returned(%d): %s\n", - buf, error, error == 0 ? data : "FAILED"); -#endif - if (error == 0) - break; } - list = realloc(list, (list_size + 1) * sizeof(char *)); list[list_size] = NULL; - return list; + return (list); } static int @@ -1146,13 +1158,28 @@ do_connect(struct ctx *ctx, const char * error = at_cmd(ctx, NULL, NULL, NULL, "AT\r\n"); if (error == -2) { - warnx("failed to read from device"); + warnx("failed to read from device %s", tty); return (-1); } /* Check for PIN */ error = at_cmd(ctx, "+CPIN: READY", NULL, NULL, "AT+CPIN?\r\n"); if (error != 0) { + ra.val[0].ptr = NULL; + ra.val[1].int32 = 0; + error = at_cmd(ctx, "+CME ERROR", saveresp, &ra, "AT+CPIN?\r\n"); + if (ra.val[1].int32 > 0) { + char *p; + + buf = ra.val[0].ptr; + if (strstr(buf[0], "+CME ERROR:") != NULL) { + buf[0] += 12; + errx(1, buf[0]); + } + freeresp(&ra); + } else + freeresp(&ra); + if (ctx->pin == NULL) { errx(1, "device requires PIN"); } @@ -1445,6 +1472,8 @@ main(int argc, char *argv[]) } else { tty_list = get_tty(&ctx); + if (tty_list == NULL) + errx(1, "%s does not appear to be a uhso device", ifnam); #ifdef DEBUG if (tty_list == NULL) { fprintf(stderr, "get_tty returned empty list\n"); @@ -1507,7 +1536,7 @@ main(int argc, char *argv[]) network_access_type[ctx.con_net_type]); if (ctx.dbm < 0) printf(", signal: %d dBm", ctx.dbm); - printf("\r"); + printf("\t\t\t\r"); fflush(stdout); } } From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 05:22:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66394106564A; Tue, 20 Jul 2010 05:22:14 +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 51A008FC15; Tue, 20 Jul 2010 05:22:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6K5MEM5096562; Tue, 20 Jul 2010 05:22:14 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6K5MEC2096560; Tue, 20 Jul 2010 05:22:14 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201007200522.o6K5MEC2096560@svn.freebsd.org> From: Martin Matuska Date: Tue, 20 Jul 2010 05:22: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: r210282 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 05:22:14 -0000 Author: mm Date: Tue Jul 20 05:22:14 2010 New Revision: 210282 URL: http://svn.freebsd.org/changeset/base/210282 Log: To improve latency, lower default vfs.zfs.vdev.max_pending from 35 to 10 OpenSolaris onnv changeset (partial): 10801:e0bf032e8673 Approved by: pjd, delphij (mentor) Obtained from: OpenSolaris (Bug ID 6891731) MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Tue Jul 20 05:16:10 2010 (r210281) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Tue Jul 20 05:22:14 2010 (r210282) @@ -38,7 +38,7 @@ * of i/os pending to each device (before it starts ramping up to * max_pending). */ -int zfs_vdev_max_pending = 35; +int zfs_vdev_max_pending = 10; int zfs_vdev_min_pending = 4; /* deadline = pri + (LBOLT >> time_shift) */ From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 06:38:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0EE31065680; Tue, 20 Jul 2010 06:38:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F2028FC18; Tue, 20 Jul 2010 06:38:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6K6cvSv013662; Tue, 20 Jul 2010 06:38:57 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6K6cvB0013660; Tue, 20 Jul 2010 06:38:57 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201007200638.o6K6cvB0013660@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 20 Jul 2010 06:38: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: r210283 - 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: Tue, 20 Jul 2010 06:38:57 -0000 Author: trasz Date: Tue Jul 20 06:38:57 2010 New Revision: 210283 URL: http://svn.freebsd.org/changeset/base/210283 Log: Add reference to uhsoctl(1). Modified: head/share/man/man4/uhso.4 Modified: head/share/man/man4/uhso.4 ============================================================================== --- head/share/man/man4/uhso.4 Tue Jul 20 05:22:14 2010 (r210282) +++ head/share/man/man4/uhso.4 Tue Jul 20 06:38:57 2010 (r210283) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2010 +.Dd July 20, 2010 .Dt UHSO 4 .Os .Sh NAME @@ -130,6 +130,7 @@ The connection can be terminated with AT_OWANCALL=1,0,1 .Ed .Sh SEE ALSO +.Xr uhsoctl 1 , .Xr ucom 4 , .Xr usb 4 .Sh AUTHORS From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 07:19:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10E75106564A; Tue, 20 Jul 2010 07:19:44 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB3088FC2A; Tue, 20 Jul 2010 07:19:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6K7Jhtf022825; Tue, 20 Jul 2010 07:19:43 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6K7Jhfj022824; Tue, 20 Jul 2010 07:19:43 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201007200719.o6K7Jhfj022824@svn.freebsd.org> From: Juli Mallett Date: Tue, 20 Jul 2010 07:19: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: r210286 - head/sys/contrib/octeon-sdk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 07:19:44 -0000 Author: jmallett Date: Tue Jul 20 07:19:43 2010 New Revision: 210286 URL: http://svn.freebsd.org/changeset/base/210286 Log: Import the Cavium Simple Executive from the Cavium Octeon SDK. The Simple Executive is a library that can be used by standalone applications and kernels to abstract access to Octeon SoC and board-specific hardware and facilities. The FreeBSD port to Octeon will be updated to use this where possible. Added: head/sys/contrib/octeon-sdk/ - copied from r210285, vendor-sys/octeon-sdk/dist/ From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 07:27:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E1FA106564A; Tue, 20 Jul 2010 07:27:36 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DA248FC1B; Tue, 20 Jul 2010 07:27:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6K7RaWj024632; Tue, 20 Jul 2010 07:27:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6K7Ra6f024630; Tue, 20 Jul 2010 07:27:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007200727.o6K7Ra6f024630@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 20 Jul 2010 07:27: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: r210287 - head/usr.sbin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 07:27:36 -0000 Author: nwhitehorn Date: Tue Jul 20 07:27:36 2010 New Revision: 210287 URL: http://svn.freebsd.org/changeset/base/210287 Log: Build some powerpc-specific utilities on powerpc64 as well. Submitted by: Andreas Tobler Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Jul 20 07:19:43 2010 (r210286) +++ head/usr.sbin/Makefile Tue Jul 20 07:27:36 2010 (r210287) @@ -512,7 +512,7 @@ _mount_smbfs= mount_smbfs _zzz= zzz .endif -.if ${MACHINE_ARCH} == "powerpc" +.if ${MACHINE_CPUARCH} == "powerpc" _mount_smbfs= mount_smbfs _nvram= nvram _ofwdump= ofwdump From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 10:15:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55EEA1065672; Tue, 20 Jul 2010 10:15:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id DB7D58FC1E; Tue, 20 Jul 2010 10:15:06 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id E270141C759; Tue, 20 Jul 2010 12:15:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id BiMAl1xa7rq9; Tue, 20 Jul 2010 12:15:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 5C2AF41C752; Tue, 20 Jul 2010 12:15:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 728A44448F3; Tue, 20 Jul 2010 10:13:03 +0000 (UTC) Date: Tue, 20 Jul 2010 10:13:03 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Pyun YongHyeon In-Reply-To: <201007192141.o6JLfsr3090971@svn.freebsd.org> Message-ID: <20100720101118.H57851@maildrop.int.zabbadoz.net> References: <201007192141.o6JLfsr3090971@svn.freebsd.org> X-OpenPGP-Key: 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: r210263 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 10:15:07 -0000 On Mon, 19 Jul 2010, Pyun YongHyeon wrote: > Author: yongari > Date: Mon Jul 19 21:41:54 2010 > New Revision: 210263 > URL: http://svn.freebsd.org/changeset/base/210263 > > Log: > Do not report current link state if interface is not UP. Hmm, not sure what exactly the code change does but by your description I think I would like to be able to see a porper (updated) result in the media: line of ifconfig no matter if it's UP or not. If this doesn't change that behaviour, just ignore me;) > Reviewed by: davidch > > Modified: > head/sys/dev/bce/if_bce.c > > Modified: head/sys/dev/bce/if_bce.c > ============================================================================== > --- head/sys/dev/bce/if_bce.c Mon Jul 19 21:38:15 2010 (r210262) > +++ head/sys/dev/bce/if_bce.c Mon Jul 19 21:41:54 2010 (r210263) > @@ -5855,6 +5855,10 @@ bce_ifmedia_sts(struct ifnet *ifp, struc > > BCE_LOCK(sc); > > + if ((ifp->if_flags & IFF_UP) == 0) { > + BCE_UNLOCK(sc); > + return; > + } > mii = device_get_softc(sc->bce_miibus); > > mii_pollstat(mii); > -- Bjoern A. Zeeb From August on I will have a life. It's now up to you to do the maths and count to 64. -- Bondorf, Germany, 14th June 2010 From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 10:45:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18356106567A; Tue, 20 Jul 2010 10:45:06 +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 083978FC1B; Tue, 20 Jul 2010 10:45:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KAj59D068684; Tue, 20 Jul 2010 10:45:05 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KAj5hn068681; Tue, 20 Jul 2010 10:45:05 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201007201045.o6KAj5hn068681@svn.freebsd.org> From: Bernhard Schmidt Date: Tue, 20 Jul 2010 10:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210289 - 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: Tue, 20 Jul 2010 10:45:06 -0000 Author: bschmidt Date: Tue Jul 20 10:45:05 2010 New Revision: 210289 URL: http://svn.freebsd.org/changeset/base/210289 Log: Update manpage to reflect changes regarding the 6050's firmware. MFC after: 3 days Modified: head/share/man/man4/iwn.4 head/share/man/man4/iwnfw.4 Modified: head/share/man/man4/iwn.4 ============================================================================== --- head/share/man/man4/iwn.4 Tue Jul 20 10:00:35 2010 (r210288) +++ head/share/man/man4/iwn.4 Tue Jul 20 10:45:05 2010 (r210289) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2010 +.Dd July 20, 2010 .Dt IWN 4 .Os .Sh NAME @@ -51,6 +51,7 @@ Choose one from: .Cd "device iwn5000fw" .Cd "device iwn5150fw" .Cd "device iwn6000fw" +.Cd "device iwn6050fw" .Ed .Pp Or you can use @@ -70,6 +71,7 @@ iwn1000fw_load="YES" iwn5000fw_load="YES" iwn5150fw_load="YES" iwn6000fw_load="YES" +iwn6050fw_load="YES" .Ed .Sh DESCRIPTION The Modified: head/share/man/man4/iwnfw.4 ============================================================================== --- head/share/man/man4/iwnfw.4 Tue Jul 20 10:00:35 2010 (r210288) +++ head/share/man/man4/iwnfw.4 Tue Jul 20 10:45:05 2010 (r210289) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2010 +.Dd July 20, 2010 .Dt IWNFW 4 .Os .Sh NAME @@ -45,6 +45,7 @@ of the following: .Cd "device iwn5000fw" .Cd "device iwn5150fw" .Cd "device iwn6000fw" +.Cd "device iwn6050fw" .Ed .Pp Alternatively, to load the driver as a @@ -56,6 +57,7 @@ iwn1000fw_load="YES" iwn5000fw_load="YES" iwn5150fw_load="YES" iwn6000fw_load="YES" +iwn6050fw_load="YES" .Ed .Sh DESCRIPTION This module provides access to firmware sets for the From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 10:58:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C12181065672; Tue, 20 Jul 2010 10:58:56 +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 AFB478FC13; Tue, 20 Jul 2010 10:58:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KAwuTW073278; Tue, 20 Jul 2010 10:58:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KAwuUE073270; Tue, 20 Jul 2010 10:58:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201007201058.o6KAwuUE073270@svn.freebsd.org> From: Alexander Motin Date: Tue, 20 Jul 2010 10:58: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: r210290 - in head/sys: dev/acpica kern sys x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 10:58:56 -0000 Author: mav Date: Tue Jul 20 10:58:56 2010 New Revision: 210290 URL: http://svn.freebsd.org/changeset/base/210290 Log: Extend timer driver API to report also minimal and maximal supported period lengths. Make MI wrapper code to validate periods in request. Make kernel clock management code to honor these hardware limitations while choosing hz, stathz and profhz values. Modified: head/sys/dev/acpica/acpi_hpet.c head/sys/kern/kern_clocksource.c head/sys/kern/kern_et.c head/sys/sys/timeet.h head/sys/x86/isa/atrtc.c head/sys/x86/isa/clock.c head/sys/x86/x86/local_apic.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Tue Jul 20 10:45:05 2010 (r210289) +++ head/sys/dev/acpica/acpi_hpet.c Tue Jul 20 10:58:56 2010 (r210290) @@ -154,15 +154,16 @@ hpet_start(struct eventtimer *et, t->div = (sc->freq * (period->frac >> 32)) >> 32; if (period->sec != 0) t->div += sc->freq * period->sec; - if (first == NULL) - first = period; } else { t->mode = 2; t->div = 0; } - fdiv = (sc->freq * (first->frac >> 32)) >> 32; - if (first->sec != 0) - fdiv += sc->freq * first->sec; + if (first != NULL) { + fdiv = (sc->freq * (first->frac >> 32)) >> 32; + if (first->sec != 0) + fdiv += sc->freq * first->sec; + } else + fdiv = t->div; t->last = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT)) { t->caps |= HPET_TCNF_TYPE; @@ -583,6 +584,11 @@ hpet_attach(device_t dev) if ((t->caps & HPET_TCAP_PER_INT) == 0) t->et.et_quality -= 10; t->et.et_frequency = sc->freq; + t->et.et_min_period.sec = 0; + t->et.et_min_period.frac = 0x00004000LL << 32; + t->et.et_max_period.sec = 0xffffffff / sc->freq; + t->et.et_max_period.frac = + ((0xffffffffLL << 32) / sc->freq) << 32; t->et.et_start = hpet_start; t->et.et_stop = hpet_stop; t->et.et_priv = &sc->t[i]; Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Tue Jul 20 10:45:05 2010 (r210289) +++ head/sys/kern/kern_clocksource.c Tue Jul 20 10:58:56 2010 (r210290) @@ -87,11 +87,9 @@ static DPCPU_DEFINE(tc, configtimer); (bt)->sec = 0; \ (bt)->frac = ((uint64_t)0x8000000000000000 / (freq)) << 1; \ } -#define BT2FREQ(bt, freq) \ -{ \ - *(freq) = ((uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) / \ - ((bt)->frac >> 1); \ -} +#define BT2FREQ(bt) \ + (((uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) / \ + ((bt)->frac >> 1)) /* Per-CPU timer1 handler. */ static int @@ -295,6 +293,26 @@ restart: #endif } +static int +round_freq(struct eventtimer *et, int freq) +{ + uint64_t div; + + if (et->et_frequency != 0) { + div = (et->et_frequency + freq / 2) / freq; + if (et->et_flags & ET_FLAGS_POW2DIV) + div = 1 << (flsl(div + div / 2) - 1); + freq = (et->et_frequency + div / 2) / div; + } + if (et->et_min_period.sec > 0) + freq = 0; + else if (et->et_max_period.frac != 0) + freq = min(freq, BT2FREQ(&et->et_min_period)); + if (et->et_max_period.sec == 0 && et->et_max_period.frac != 0) + freq = max(freq, BT2FREQ(&et->et_max_period)); + return (freq); +} + /* * Configure and start event timers. */ @@ -327,21 +345,25 @@ cpu_initclocks_bsp(void) singlemul = 4; } if (timer[1] == NULL) { - base = hz * singlemul; - if (base < 128) + base = round_freq(timer[0], hz * singlemul); + singlemul = max((base + hz / 2) / hz, 1); + hz = (base + singlemul / 2) / singlemul; + if (base <= 128) stathz = base; else { div = base / 128; - if (div % 2 == 0) + if (div >= singlemul && (div % singlemul) == 0) div++; stathz = base / div; } profhz = stathz; - while ((profhz + stathz) <= 8192) + while ((profhz + stathz) <= 128 * 64) profhz += stathz; + profhz = round_freq(timer[0], profhz); } else { - stathz = 128; - profhz = stathz * 64; + hz = round_freq(timer[0], hz); + stathz = round_freq(timer[1], 127); + profhz = round_freq(timer[1], stathz * 64); } ET_LOCK(); cpu_restartclocks(); @@ -385,7 +407,9 @@ cpu_restartclocks(void) } else { timer1hz = hz; timer2hz = profiling_on ? profhz : stathz; + timer2hz = round_freq(timer[1], timer2hz); } + timer1hz = round_freq(timer[0], timer1hz); printf("Starting kernel event timers: %s @ %dHz, %s @ %dHz\n", timer[0]->et_name, timer1hz, timer[1] ? timer[1]->et_name : "NONE", timer2hz); Modified: head/sys/kern/kern_et.c ============================================================================== --- head/sys/kern/kern_et.c Tue Jul 20 10:45:05 2010 (r210289) +++ head/sys/kern/kern_et.c Tue Jul 20 10:58:56 2010 (r210290) @@ -167,6 +167,26 @@ et_start(struct eventtimer *et, if ((et->et_flags & ET_FLAGS_ONESHOT) == 0 && period == NULL) return (ENODEV); + if (first != NULL) { + if (first->sec < et->et_min_period.sec || + (first->sec == et->et_min_period.sec && + first->frac < et->et_min_period.frac)) + first = &et->et_min_period; + if (first->sec > et->et_max_period.sec || + (first->sec == et->et_max_period.sec && + first->frac > et->et_max_period.frac)) + first = &et->et_max_period; + } + if (period != NULL) { + if (period->sec < et->et_min_period.sec || + (period->sec == et->et_min_period.sec && + period->frac < et->et_min_period.frac)) + period = &et->et_min_period; + if (period->sec > et->et_max_period.sec || + (period->sec == et->et_max_period.sec && + period->frac > et->et_max_period.frac)) + period = &et->et_max_period; + } if (et->et_start) return (et->et_start(et, first, period)); return (0); Modified: head/sys/sys/timeet.h ============================================================================== --- head/sys/sys/timeet.h Tue Jul 20 10:45:05 2010 (r210289) +++ head/sys/sys/timeet.h Tue Jul 20 10:58:56 2010 (r210290) @@ -61,6 +61,7 @@ struct eventtimer { #define ET_FLAGS_ONESHOT 2 #define ET_FLAGS_PERCPU 4 #define ET_FLAGS_C3STOP 8 +#define ET_FLAGS_POW2DIV 16 int et_quality; /* * Used to determine if this timecounter is better than @@ -69,6 +70,8 @@ struct eventtimer { int et_active; u_int64_t et_frequency; /* Base frequency in Hz. */ + struct bintime et_min_period; + struct bintime et_max_period; et_start_t *et_start; et_stop_t *et_stop; et_event_cb_t *et_event_cb; Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Tue Jul 20 10:45:05 2010 (r210289) +++ head/sys/x86/isa/atrtc.c Tue Jul 20 10:58:56 2010 (r210290) @@ -276,9 +276,13 @@ atrtc_attach(device_t dev) bus_bind_intr(dev, sc->intr_res, 0); } sc->et.et_name = "RTC"; - sc->et.et_flags = ET_FLAGS_PERIODIC; + sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_POW2DIV; sc->et.et_quality = 0; sc->et.et_frequency = 32768; + sc->et.et_min_period.sec = 0; + sc->et.et_min_period.frac = 0x0008LL << 48; + sc->et.et_max_period.sec = 0; + sc->et.et_max_period.frac = 0x8000LL << 48; sc->et.et_start = rtc_start; sc->et.et_stop = rtc_stop; sc->et.et_priv = dev; Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Tue Jul 20 10:45:05 2010 (r210289) +++ head/sys/x86/isa/clock.c Tue Jul 20 10:58:56 2010 (r210290) @@ -665,6 +665,11 @@ attimer_attach(device_t dev) sc->et.et_flags = ET_FLAGS_PERIODIC; sc->et.et_quality = 100; sc->et.et_frequency = i8254_freq; + sc->et.et_min_period.sec = 0; + sc->et.et_min_period.frac = ((1LL << 62) / i8254_freq) << 2; + sc->et.et_max_period.sec = 0xffff / i8254_freq; + sc->et.et_max_period.frac = + ((0xffffLL << 48) / i8254_freq) << 16; sc->et.et_start = attimer_start; sc->et.et_stop = attimer_stop; sc->et.et_priv = dev; Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Tue Jul 20 10:45:05 2010 (r210289) +++ head/sys/x86/x86/local_apic.c Tue Jul 20 10:58:56 2010 (r210290) @@ -263,6 +263,11 @@ lapic_init(vm_paddr_t addr) lapic_et.et_quality -= 100; } lapic_et.et_frequency = 0; + /* We don't know frequency yet, so trying to guess. */ + lapic_et.et_min_period.sec = 0; + lapic_et.et_min_period.frac = 0x00001000LL << 32; + lapic_et.et_max_period.sec = 1; + lapic_et.et_max_period.frac = 0; lapic_et.et_start = lapic_et_start; lapic_et.et_stop = lapic_et_stop; lapic_et.et_priv = NULL; @@ -493,6 +498,12 @@ lapic_et_start(struct eventtimer *et, printf("lapic: Divisor %lu, Frequency %lu Hz\n", lapic_timer_divisor, value); et->et_frequency = value; + et->et_min_period.sec = 0; + et->et_min_period.frac = + ((1LL << 63) / et->et_frequency) << 1; + et->et_max_period.sec = 0xffffffff / et->et_frequency; + et->et_max_period.frac = + ((0xffffffffLL << 32) / et->et_frequency) << 32; } la = &lapics[lapic_id()]; /* From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 11:19:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7275210656DD; Tue, 20 Jul 2010 11:19:49 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 370638FC27; Tue, 20 Jul 2010 11:19:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o6KBIfIi057368; Tue, 20 Jul 2010 05:18:41 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 20 Jul 2010 05:19:09 -0600 (MDT) Message-Id: <20100720.051909.123717654796701540.imp@bsdimp.com> To: jmallett@freebsd.org From: "M. Warner Losh" In-Reply-To: <201007200719.o6K7Jhfj022824@svn.freebsd.org> References: <201007200719.o6K7Jhfj022824@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r210286 - head/sys/contrib/octeon-sdk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 11:19:49 -0000 In message: <201007200719.o6K7Jhfj022824@svn.freebsd.org> Juli Mallett writes: : Author: jmallett : Date: Tue Jul 20 07:19:43 2010 : New Revision: 210286 : URL: http://svn.freebsd.org/changeset/base/210286 : : Log: : Import the Cavium Simple Executive from the Cavium Octeon SDK. The Simple : Executive is a library that can be used by standalone applications and kernels : to abstract access to Octeon SoC and board-specific hardware and facilities. : The FreeBSD port to Octeon will be updated to use this where possible. It should be noted that this is from the Cavium User's site and has basically a BSD license with a special disclaimer of liability/warranty. Cavium documents this as being compatible with the closed-source version that Cavium makes available under NDA. Warner From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 11:20:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D435C1065675; Tue, 20 Jul 2010 11:20:45 +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 C49348FC13; Tue, 20 Jul 2010 11:20:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KBKjFt078211; Tue, 20 Jul 2010 11:20:45 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KBKjuD078209; Tue, 20 Jul 2010 11:20:45 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201007201120.o6KBKjuD078209@svn.freebsd.org> From: Rui Paulo Date: Tue, 20 Jul 2010 11:20: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: r210292 - 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, 20 Jul 2010 11:20:45 -0000 Author: rpaulo Date: Tue Jul 20 11:20:45 2010 New Revision: 210292 URL: http://svn.freebsd.org/changeset/base/210292 Log: Fix typo in comment. Modified: head/sys/sys/priv.h Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Tue Jul 20 11:08:56 2010 (r210291) +++ head/sys/sys/priv.h Tue Jul 20 11:20:45 2010 (r210292) @@ -497,7 +497,7 @@ #ifdef _KERNEL /* - * Privilege check interfaces, modeled after historic suser() interfacs, but + * Privilege check interfaces, modeled after historic suser() interfaces, but * with the addition of a specific privilege name. No flags are currently * defined for the API. Historically, flags specified using the real uid * instead of the effective uid, and whether or not the check should be From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 11:46:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60BD21065674; Tue, 20 Jul 2010 11:46:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5029F8FC13; Tue, 20 Jul 2010 11:46:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KBkjAc083934; Tue, 20 Jul 2010 11:46:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KBkj3j083931; Tue, 20 Jul 2010 11:46:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201007201146.o6KBkj3j083931@svn.freebsd.org> From: Alexander Motin Date: Tue, 20 Jul 2010 11:46: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: r210293 - 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, 20 Jul 2010 11:46:45 -0000 Author: mav Date: Tue Jul 20 11:46:45 2010 New Revision: 210293 URL: http://svn.freebsd.org/changeset/base/210293 Log: Refactor Marvell ARM SoC timer driver to the new timer infrastructure. Modified: head/sys/arm/mv/files.mv head/sys/arm/mv/timer.c Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Tue Jul 20 11:20:45 2010 (r210292) +++ head/sys/arm/mv/files.mv Tue Jul 20 11:46:45 2010 (r210293) @@ -32,3 +32,5 @@ dev/mge/if_mge.c optional mge dev/mvs/mvs_soc.c optional mvs dev/uart/uart_dev_ns8250.c optional uart dev/usb/controller/ehci_mv.c optional ehci + +kern/kern_clocksource.c standard Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Tue Jul 20 11:20:45 2010 (r210292) +++ head/sys/arm/mv/timer.c Tue Jul 20 11:46:45 2010 (r210293) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -51,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define MV_TIMER_TICK (get_tclk() / hz) #define INITIAL_TIMECOUNTER (0xffffffff) #define MAX_WATCHDOG_TICKS (0xffffffff) @@ -60,6 +60,7 @@ struct mv_timer_softc { bus_space_tag_t timer_bst; bus_space_handle_t timer_bsh; struct mtx timer_mtx; + struct eventtimer et; }; static struct resource_spec mv_timer_spec[] = { @@ -85,12 +86,14 @@ static void mv_set_timer_rel(uint32_t, u static void mv_watchdog_enable(void); static void mv_watchdog_disable(void); static void mv_watchdog_event(void *, unsigned int, int *); -static void mv_setup_timer(void); -static void mv_setup_timercount(void); +static int mv_timer_start(struct eventtimer *et, + struct bintime *first, struct bintime *period); +static int mv_timer_stop(struct eventtimer *et); +static void mv_setup_timers(void); static struct timecounter mv_timer_timecounter = { .tc_get_timecount = mv_timer_get_timecount, - .tc_name = "CPU Timer", + .tc_name = "CPUTimer1", .tc_frequency = 0, /* This is assigned on the fly in the init sequence */ .tc_counter_mask = ~0u, .tc_quality = 1000, @@ -113,6 +116,7 @@ mv_timer_attach(device_t dev) int error; void *ihl; struct mv_timer_softc *sc; + uint32_t irq_cause, irq_mask; if (timer_softc != NULL) return (ENXIO); @@ -134,14 +138,36 @@ mv_timer_attach(device_t dev) EVENTHANDLER_REGISTER(watchdog_list, mv_watchdog_event, sc, 0); if (bus_setup_intr(dev, sc->timer_res[1], INTR_TYPE_CLK, - mv_hardclock, NULL, NULL, &ihl) != 0) { + mv_hardclock, NULL, sc, &ihl) != 0) { bus_release_resources(dev, mv_timer_spec, sc->timer_res); - device_printf(dev, "could not setup hardclock interrupt\n"); + device_printf(dev, "Could not setup interrupt.\n"); return (ENXIO); } - mv_setup_timercount(); - timers_initialized = 1; + mv_setup_timers(); + irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); + irq_cause &= ~(IRQ_TIMER0); + write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); + irq_mask = read_cpu_ctrl(BRIDGE_IRQ_MASK); + irq_mask |= IRQ_TIMER0_MASK; + write_cpu_ctrl(BRIDGE_IRQ_MASK, irq_mask); + + sc->et.et_name = "CPUTimer0"; + sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT; + sc->et.et_quality = 1000; + sc->et.et_frequency = get_tclk(); + sc->et.et_min_period.sec = 0; + sc->et.et_min_period.frac = + ((0xfLL << 60) / sc->et.et_frequency) << 4; + sc->et.et_max_period.sec = 0xfffffff0 / sc->et.et_frequency; + sc->et.et_max_period.frac = + ((0xfffffff0LL << 32) / sc->et.et_frequency) << 32; + sc->et.et_start = mv_timer_start; + sc->et.et_stop = mv_timer_stop; + sc->et.et_priv = sc; + et_register(&sc->et); + mv_timer_timecounter.tc_frequency = get_tclk(); + tc_init(&mv_timer_timecounter); return (0); } @@ -149,11 +175,12 @@ mv_timer_attach(device_t dev) static int mv_hardclock(void *arg) { + struct mv_timer_softc *sc; uint32_t irq_cause; - struct trapframe *frame; - frame = (struct trapframe *)arg; - hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + sc = (struct mv_timer_softc *)arg; + if (sc->et.et_active) + sc->et.et_event_cb(&sc->et, sc->et.et_arg); irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); irq_cause &= ~(IRQ_TIMER0); @@ -189,32 +216,8 @@ mv_timer_get_timecount(struct timecounte void cpu_initclocks(void) { - uint32_t irq_cause, irq_mask; - - mv_setup_timer(); - - irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE); - irq_cause &= ~(IRQ_TIMER0); - write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause); - - irq_mask = read_cpu_ctrl(BRIDGE_IRQ_MASK); - irq_mask |= IRQ_TIMER0_MASK; - write_cpu_ctrl(BRIDGE_IRQ_MASK, irq_mask); - - mv_timer_timecounter.tc_frequency = get_tclk(); - tc_init(&mv_timer_timecounter); -} - -void -cpu_startprofclock(void) -{ - -} - -void -cpu_stopprofclock(void) -{ + cpu_initclocks_bsp(); } void @@ -362,26 +365,60 @@ mv_watchdog_event(void *arg, unsigned in mtx_unlock(&timer_softc->timer_mtx); } -static void -mv_setup_timer(void) +static int +mv_timer_start(struct eventtimer *et, + struct bintime *first, struct bintime *period) +{ + struct mv_timer_softc *sc; + uint32_t val, val1; + + /* Calculate dividers. */ + sc = (struct mv_timer_softc *)et->et_priv; + if (period != NULL) { + val = (sc->et.et_frequency * (period->frac >> 32)) >> 32; + if (period->sec != 0) + val += sc->et.et_frequency * period->sec; + } else + val = 0; + if (first != NULL) { + val1 = (sc->et.et_frequency * (first->frac >> 32)) >> 32; + if (first->sec != 0) + val1 += sc->et.et_frequency * first->sec; + } else + val1 = val; + + /* Apply configuration. */ + mv_set_timer_rel(0, val); + mv_set_timer(0, val1); + val = mv_get_timer_control(); + val |= CPU_TIMER0_EN; + if (period != NULL) + val |= CPU_TIMER0_AUTO; + mv_set_timer_control(val); + return (0); +} + +static int +mv_timer_stop(struct eventtimer *et) { uint32_t val; - mv_set_timer_rel(0, MV_TIMER_TICK); - mv_set_timer(0, MV_TIMER_TICK); val = mv_get_timer_control(); - val |= CPU_TIMER0_EN | CPU_TIMER0_AUTO; + val &= ~(CPU_TIMER0_EN | CPU_TIMER0_AUTO); mv_set_timer_control(val); + return (0); } static void -mv_setup_timercount(void) +mv_setup_timers(void) { uint32_t val; mv_set_timer_rel(1, INITIAL_TIMECOUNTER); mv_set_timer(1, INITIAL_TIMECOUNTER); val = mv_get_timer_control(); + val &= ~(CPU_TIMER0_EN | CPU_TIMER0_AUTO); val |= CPU_TIMER1_EN | CPU_TIMER1_AUTO; mv_set_timer_control(val); + timers_initialized = 1; } From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 12:36:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0BA9106566B; Tue, 20 Jul 2010 12:36:36 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A72938FC13; Tue, 20 Jul 2010 12:36:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KCaaxS095032; Tue, 20 Jul 2010 12:36:36 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KCaaRx095029; Tue, 20 Jul 2010 12:36:36 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201007201236.o6KCaaRx095029@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 20 Jul 2010 12:36: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: r210294 - in head/sys: i386/i386 pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 12:36:36 -0000 Author: tijl Date: Tue Jul 20 12:36:36 2010 New Revision: 210294 URL: http://svn.freebsd.org/changeset/base/210294 Log: Store fsbase and gsbase in the right fields of the mcontext. They were switched. PR: i386/148344 Approved by: kib (mentor) MFC after: 1 week Modified: head/sys/i386/i386/machdep.c head/sys/pc98/pc98/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Jul 20 11:46:45 2010 (r210293) +++ head/sys/i386/i386/machdep.c Tue Jul 20 12:36:36 2010 (r210294) @@ -645,10 +645,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* * Unconditionally fill the fsbase and gsbase into the mcontext. */ - sdp = &td->td_pcb->pcb_gsd; + sdp = &td->td_pcb->pcb_fsd; sf.sf_uc.uc_mcontext.mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; - sdp = &td->td_pcb->pcb_fsd; + sdp = &td->td_pcb->pcb_gsd; sf.sf_uc.uc_mcontext.mc_gsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; @@ -3255,9 +3255,9 @@ get_mcontext(struct thread *td, mcontext * mcontext after mc_fpstate. */ get_fpcontext(td, mcp); - sdp = &td->td_pcb->pcb_gsd; - mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; sdp = &td->td_pcb->pcb_fsd; + mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; + sdp = &td->td_pcb->pcb_gsd; mcp->mc_gsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; return (0); Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Tue Jul 20 11:46:45 2010 (r210293) +++ head/sys/pc98/pc98/machdep.c Tue Jul 20 12:36:36 2010 (r210294) @@ -580,10 +580,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* * Unconditionally fill the fsbase and gsbase into the mcontext. */ - sdp = &td->td_pcb->pcb_gsd; + sdp = &td->td_pcb->pcb_fsd; sf.sf_uc.uc_mcontext.mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; - sdp = &td->td_pcb->pcb_fsd; + sdp = &td->td_pcb->pcb_gsd; sf.sf_uc.uc_mcontext.mc_gsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; @@ -2583,9 +2583,9 @@ get_mcontext(struct thread *td, mcontext * mcontext after mc_fpstate. */ get_fpcontext(td, mcp); - sdp = &td->td_pcb->pcb_gsd; - mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; sdp = &td->td_pcb->pcb_fsd; + mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; + sdp = &td->td_pcb->pcb_gsd; mcp->mc_gsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; return (0); From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 12:58:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E13C1065670; Tue, 20 Jul 2010 12:58:48 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 1B2E18FC08; Tue, 20 Jul 2010 12:58:48 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 063F31DD686; Tue, 20 Jul 2010 14:58:47 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id E797F17225; Tue, 20 Jul 2010 14:58:46 +0200 (CEST) Date: Tue, 20 Jul 2010 14:58:46 +0200 From: Jilles Tjoelker To: Gabor Kovesdan Message-ID: <20100720125846.GA17638@stack.nl> References: <201007192019.o6JKJEg5072065@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201007192019.o6JKJEg5072065@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r210254 - in head/etc: defaults periodic/security X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 12:58:48 -0000 On Mon, Jul 19, 2010 at 08:19:14PM +0000, Gabor Kovesdan wrote: > Author: gabor > Date: Mon Jul 19 20:19:14 2010 > New Revision: 210254 > URL: http://svn.freebsd.org/changeset/base/210254 > Log: > - Add a periodic script, which can be used to find installed ports' files with > mismatched checksum > PR: conf/124641 > Submitted by: Alex Kozlov > Approved by: delphij (mentor) This seems useful, although not primarily from a security perspective (if they can overwrite /usr/local/bin/foo, they can probably also modify /var/db/pkg/foo/+CONTENTS accordingly), but to detect misbehaved things that modify or delete files belonging to packages. [snip] > Added: head/etc/periodic/security/460.chkportsum > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/etc/periodic/security/460.chkportsum Mon Jul 19 20:19:14 2010 (r210254) > @@ -0,0 +1,68 @@ > +#!/bin/sh - > +# > +# Copyright (c) 2010 The FreeBSD Project > +# 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$ > +# > + > +if [ -r /etc/defaults/periodic.conf ] > +then > + . /etc/defaults/periodic.conf > + source_periodic_confs > +fi > + > +. /etc/periodic/security/security.functions > + > +rc=0 > + > +echo "" > +echo 'Checking for ports with mismatched checksums:' > + > +case "${daily_status_security_chkportsum_enable}" in > + [Yy][Ee][Ss]) > + pkg_info -ga 2>/dev/null | \ The stderr output is also interesting, as it contains error messages about files that are in a package but do not exist. Unfortunately, pkg_info -ga 2>&1 | ... will mix the stderr with the stdout in an unusable way. I suppose pkg_info -g should be modified so the missing files are in the stdout. > + while read one two three; do > + case ${one} in > + Information) > + case ${two} in > + for) name=${three%%:} ;; > + *) name='??' ;; The indentation seems wrong here. > + esac > + ;; > + Mismatched|'') ;; > + *) > + if [ -n ${name} ]; then Note that this is true if name is empty or not set. You probably want [ -n "${name}" ] > + echo ${name}: ${one} This handles pathnames with spaces incorrectly. Consider reading lines with IFS= read -r line This also collapses the nested case statements to one, for 'Information for'*, Mismatched*, '' and /*. The variables in the echo commands should be quoted to avoid word splitting and pathname generation. > + fi > + ;; > + esac > + done > + ;; > + *) > + rc=0 > + ;; > +esac > + > +exit $rc -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 13:03:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E63D3106567A; Tue, 20 Jul 2010 13:03:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B71FA8FC23; Tue, 20 Jul 2010 13:03:35 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4C96846B52; Tue, 20 Jul 2010 09:03:35 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EE8548A03C; Tue, 20 Jul 2010 09:03:33 -0400 (EDT) From: John Baldwin To: Ivan Voras Date: Mon, 19 Jul 2010 08:29:21 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100217; KDE/4.4.5; amd64; ; ) References: <201007181015.o6IAFXvK018739@svn.freebsd.org> In-Reply-To: <201007181015.o6IAFXvK018739@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201007190829.21995.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 20 Jul 2010 09:03:33 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.0 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_24_48 autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r210217 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 13:03:36 -0000 On Sunday, July 18, 2010 6:15:33 am Ivan Voras wrote: > Author: ivoras > Date: Sun Jul 18 10:15:33 2010 > New Revision: 210217 > URL: http://svn.freebsd.org/changeset/base/210217 > > Log: > In keeping with the Age-of-the-fruitbat theme, scale up hirunningspace on > machines which can clearly afford the memory. > > This is a somewhat conservative version of the patch - more fine tuning may be > necessary. > > Idea from: Thread on hackers@ > Discussed with: alc > > Modified: > head/sys/kern/vfs_bio.c > > Modified: head/sys/kern/vfs_bio.c > ============================================================================== > --- head/sys/kern/vfs_bio.c Sun Jul 18 08:54:31 2010 (r210216) > +++ head/sys/kern/vfs_bio.c Sun Jul 18 10:15:33 2010 (r210217) > @@ -621,7 +621,9 @@ bufinit(void) > lobufspace = hibufspace - MAXBSIZE; > > lorunningspace = 512 * 1024; > - hirunningspace = 1024 * 1024; > + hirunningspace = lmin(roundup(hibufspace/64, MAXBSIZE), 16*1024*1024); > + if (hirunningspace < 1024 * 1024) > + hirunningspace = 1024 * 1024; Presumably you could use 'lmax(lmin(..., 16 * 1024 * 1024), 1024 * 1024))'? Also, the common style throughout the kernel is to provide spaces around operators like '/' and '*'. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 13:59:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F1721065675; Tue, 20 Jul 2010 13:59:51 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE9B8FC14; Tue, 20 Jul 2010 13:59:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KDxpX8013559; Tue, 20 Jul 2010 13:59:51 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KDxptc013557; Tue, 20 Jul 2010 13:59:51 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201007201359.o6KDxptc013557@svn.freebsd.org> From: Ivan Voras Date: Tue, 20 Jul 2010 13:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210295 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 13:59:51 -0000 Author: ivoras Date: Tue Jul 20 13:59:51 2010 New Revision: 210295 URL: http://svn.freebsd.org/changeset/base/210295 Log: Fix expression style. Prodded by: jhb Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue Jul 20 12:36:36 2010 (r210294) +++ head/sys/kern/vfs_bio.c Tue Jul 20 13:59:51 2010 (r210295) @@ -621,9 +621,8 @@ bufinit(void) lobufspace = hibufspace - MAXBSIZE; lorunningspace = 512 * 1024; - hirunningspace = lmin(roundup(hibufspace/64, MAXBSIZE), 16*1024*1024); - if (hirunningspace < 1024 * 1024) - hirunningspace = 1024 * 1024; + hirunningspace = lmax(lmin(roundup(hibufspace / 64, MAXBSIZE), + 16 * 1024 * 1024), 1024 * 1024); /* * Limit the amount of malloc memory since it is wired permanently into From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 14:26:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E5041065670 for ; Tue, 20 Jul 2010 14:26:09 +0000 (UTC) (envelope-from kozlov@ravenloft.kiev.ua) Received: from hosting.nash.net.ua (hosting.nash.net.ua [193.151.252.10]) by mx1.freebsd.org (Postfix) with SMTP id 6B7F48FC1D for ; Tue, 20 Jul 2010 14:26:07 +0000 (UTC) Received: (qmail 7090 invoked by uid 509); 20 Jul 2010 14:26:06 -0000 Received: from ravenloft.kiev.ua (94.244.131.95) by hosting.nash.net.ua with SMTP; 20 Jul 2010 14:26:06 -0000 Date: Tue, 20 Jul 2010 17:25:05 +0300 From: Alex Kozlov To: Jilles Tjoelker , Gabor Kovesdan , svn-src-head@freebsd.org, spam@rm-rf.kiev.ua Message-ID: <20100720142505.GA28760@ravenloft.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Cc: Subject: Re: svn commit: r210254 - in head/etc: defaults periodic/security X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 14:26:09 -0000 On Tue, Jul 20, 2010 at 02:58:46PM +0200, Jilles Tjoelker wrote: > On Mon, Jul 19, 2010 at 08:19:14PM +0000, Gabor Kovesdan wrote: > > + pkg_info -ga 2>/dev/null | \ > > The stderr output is also interesting, as it contains error messages > about files that are in a package but do not exist. Unfortunately, > pkg_info -ga 2>&1 | ... > will mix the stderr with the stdout in an unusable way. I suppose > pkg_info -g should be modified so the missing files are in the stdout. I know, but I couldn't find a reliable way to parse mixed output. If You modify pkg_info it will be great. I immediately fix this script. > > + ;; > > + Mismatched|'') ;; > > + *) > > + if [ -n ${name} ]; then > Note that this is true if name is empty or not set. You probably want > [ -n "${name}" ] Yes, good catch. > > > + echo ${name}: ${one} > > This handles pathnames with spaces incorrectly. Consider reading lines > with > IFS= read -r line > This also collapses the nested case statements to one, for > 'Information for'*, Mismatched*, '' and /*. > > The variables in the echo commands should be quoted to avoid word > splitting and pathname generation. It's makes parser stateful and overly complex, I will think about most simple way to do this. Fortunately, at the moment very few, if any, ports have files with space in names. -- Adios From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 14:27:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CE92106566C; Tue, 20 Jul 2010 14:27:09 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C57C8FC2B; Tue, 20 Jul 2010 14:27:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KER9jd019723; Tue, 20 Jul 2010 14:27:09 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KER9Q8019720; Tue, 20 Jul 2010 14:27:09 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <201007201427.o6KER9Q8019720@svn.freebsd.org> From: Ollivier Robert Date: Tue, 20 Jul 2010 14:27: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: r210296 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 14:27:09 -0000 Author: roberto Date: Tue Jul 20 14:27:09 2010 New Revision: 210296 URL: http://svn.freebsd.org/changeset/base/210296 Log: Week days are all lowercase in French. cf. http://www.academie-francaise.fr/langue/questions.html#jourdelasemaine (FR) PR: misc/148792 Submitted by: Mathieu MFC after: 1 weeks Modified: head/share/timedef/fr_FR.ISO8859-1.src head/share/timedef/fr_FR.UTF-8.src Modified: head/share/timedef/fr_FR.ISO8859-1.src ============================================================================== --- head/share/timedef/fr_FR.ISO8859-1.src Tue Jul 20 13:59:51 2010 (r210295) +++ head/share/timedef/fr_FR.ISO8859-1.src Tue Jul 20 14:27:09 2010 (r210296) @@ -35,23 +35,23 @@ décembre # # Short weekday names # -Dim -Lun -Mar -Mer -Jeu -Ven -Sam +dim +lun +mar +mer +jeu +ven +sam # # Long weekday names # -Dimanche -Lundi -Mardi -Mercredi -Jeudi -Vendredi -Samedi +dimanche +lundi +mardi +mercredi +jeudi +vendredi +samedi # # X_fmt # Modified: head/share/timedef/fr_FR.UTF-8.src ============================================================================== --- head/share/timedef/fr_FR.UTF-8.src Tue Jul 20 13:59:51 2010 (r210295) +++ head/share/timedef/fr_FR.UTF-8.src Tue Jul 20 14:27:09 2010 (r210296) @@ -35,23 +35,23 @@ décembre # # Short weekday names # -Dim -Lun -Mar -Mer -Jeu -Ven -Sam +dim +lun +mar +mer +jeu +ven +sam # # Long weekday names # -Dimanche -Lundi -Mardi -Mercredi -Jeudi -Vendredi -Samedi +dimanche +lundi +mardi +mercredi +jeudi +vendredi +samedi # # X_fmt # From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 15:48:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7999106566B; Tue, 20 Jul 2010 15:48:29 +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 D59E48FC13; Tue, 20 Jul 2010 15:48:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KFmT2R037969; Tue, 20 Jul 2010 15:48:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KFmTLO037962; Tue, 20 Jul 2010 15:48:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201007201548.o6KFmTLO037962@svn.freebsd.org> From: Alexander Motin Date: Tue, 20 Jul 2010 15:48: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: r210298 - in head/sys: arm/mv dev/acpica kern x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 15:48:30 -0000 Author: mav Date: Tue Jul 20 15:48:29 2010 New Revision: 210298 URL: http://svn.freebsd.org/changeset/base/210298 Log: Fix several un-/signedness bugs of r210290 and r210293. Add one more check. Modified: head/sys/arm/mv/timer.c head/sys/dev/acpica/acpi_hpet.c head/sys/kern/kern_clocksource.c head/sys/x86/isa/atrtc.c head/sys/x86/isa/clock.c head/sys/x86/x86/local_apic.c Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Tue Jul 20 15:34:27 2010 (r210297) +++ head/sys/arm/mv/timer.c Tue Jul 20 15:48:29 2010 (r210298) @@ -158,10 +158,10 @@ mv_timer_attach(device_t dev) sc->et.et_frequency = get_tclk(); sc->et.et_min_period.sec = 0; sc->et.et_min_period.frac = - ((0xfLL << 60) / sc->et.et_frequency) << 4; - sc->et.et_max_period.sec = 0xfffffff0 / sc->et.et_frequency; + ((0x00000002LLU << 32) / sc->et.et_frequency) << 32; + sc->et.et_max_period.sec = 0xfffffff0U / sc->et.et_frequency; sc->et.et_max_period.frac = - ((0xfffffff0LL << 32) / sc->et.et_frequency) << 32; + ((0xfffffffeLLU << 32) / sc->et.et_frequency) << 32; sc->et.et_start = mv_timer_start; sc->et.et_stop = mv_timer_stop; sc->et.et_priv = sc; Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Tue Jul 20 15:34:27 2010 (r210297) +++ head/sys/dev/acpica/acpi_hpet.c Tue Jul 20 15:48:29 2010 (r210298) @@ -585,10 +585,10 @@ hpet_attach(device_t dev) t->et.et_quality -= 10; t->et.et_frequency = sc->freq; t->et.et_min_period.sec = 0; - t->et.et_min_period.frac = 0x00004000LL << 32; - t->et.et_max_period.sec = 0xffffffff / sc->freq; + t->et.et_min_period.frac = 0x00004000LLU << 32; + t->et.et_max_period.sec = 0xfffffffeLLU / sc->freq; t->et.et_max_period.frac = - ((0xffffffffLL << 32) / sc->freq) << 32; + ((0xfffffffeLLU << 32) / sc->freq) << 32; t->et.et_start = hpet_start; t->et.et_stop = hpet_stop; t->et.et_priv = &sc->t[i]; Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Tue Jul 20 15:34:27 2010 (r210297) +++ head/sys/kern/kern_clocksource.c Tue Jul 20 15:48:29 2010 (r210298) @@ -299,14 +299,14 @@ round_freq(struct eventtimer *et, int fr uint64_t div; if (et->et_frequency != 0) { - div = (et->et_frequency + freq / 2) / freq; + div = lmax((et->et_frequency + freq / 2) / freq, 1); if (et->et_flags & ET_FLAGS_POW2DIV) div = 1 << (flsl(div + div / 2) - 1); freq = (et->et_frequency + div / 2) / div; } if (et->et_min_period.sec > 0) freq = 0; - else if (et->et_max_period.frac != 0) + else if (et->et_min_period.frac != 0) freq = min(freq, BT2FREQ(&et->et_min_period)); if (et->et_max_period.sec == 0 && et->et_max_period.frac != 0) freq = max(freq, BT2FREQ(&et->et_max_period)); @@ -365,6 +365,7 @@ cpu_initclocks_bsp(void) stathz = round_freq(timer[1], 127); profhz = round_freq(timer[1], stathz * 64); } + tick = 1000000 / hz; ET_LOCK(); cpu_restartclocks(); ET_UNLOCK(); Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Tue Jul 20 15:34:27 2010 (r210297) +++ head/sys/x86/isa/atrtc.c Tue Jul 20 15:48:29 2010 (r210298) @@ -280,9 +280,9 @@ atrtc_attach(device_t dev) sc->et.et_quality = 0; sc->et.et_frequency = 32768; sc->et.et_min_period.sec = 0; - sc->et.et_min_period.frac = 0x0008LL << 48; + sc->et.et_min_period.frac = 0x0008LLU << 48; sc->et.et_max_period.sec = 0; - sc->et.et_max_period.frac = 0x8000LL << 48; + sc->et.et_max_period.frac = 0x8000LLU << 48; sc->et.et_start = rtc_start; sc->et.et_stop = rtc_stop; sc->et.et_priv = dev; Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Tue Jul 20 15:34:27 2010 (r210297) +++ head/sys/x86/isa/clock.c Tue Jul 20 15:48:29 2010 (r210298) @@ -666,10 +666,11 @@ attimer_attach(device_t dev) sc->et.et_quality = 100; sc->et.et_frequency = i8254_freq; sc->et.et_min_period.sec = 0; - sc->et.et_min_period.frac = ((1LL << 62) / i8254_freq) << 2; + sc->et.et_min_period.frac = + ((0x0002LLU << 48) / i8254_freq) << 16; sc->et.et_max_period.sec = 0xffff / i8254_freq; sc->et.et_max_period.frac = - ((0xffffLL << 48) / i8254_freq) << 16; + ((0xfffeLLU << 48) / i8254_freq) << 16; sc->et.et_start = attimer_start; sc->et.et_stop = attimer_stop; sc->et.et_priv = dev; Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Tue Jul 20 15:34:27 2010 (r210297) +++ head/sys/x86/x86/local_apic.c Tue Jul 20 15:48:29 2010 (r210298) @@ -500,10 +500,10 @@ lapic_et_start(struct eventtimer *et, et->et_frequency = value; et->et_min_period.sec = 0; et->et_min_period.frac = - ((1LL << 63) / et->et_frequency) << 1; - et->et_max_period.sec = 0xffffffff / et->et_frequency; + ((0x00000002LLU << 32) / et->et_frequency) << 32; + et->et_max_period.sec = 0xfffffffeLLU / et->et_frequency; et->et_max_period.frac = - ((0xffffffffLL << 32) / et->et_frequency) << 32; + ((0xfffffffeLLU << 32) / et->et_frequency) << 32; } la = &lapics[lapic_id()]; /* From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 16:57:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0B43106568B; Tue, 20 Jul 2010 16:57:35 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7EF448FC12; Tue, 20 Jul 2010 16:57:35 +0000 (UTC) Received: by pvh1 with SMTP id 1so2581830pvh.13 for ; Tue, 20 Jul 2010 09:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=Mhkkym+9p5yoGKk4B7w7XHu0FQ6z2htrzdxeOD4hGX0=; b=HmeWOnAnJaJH7uNoOvEMfKZnmDFAi/djgkFVxr9luqLsHGHJC/G8W116bxHjuBzrmp vkcWHh0RfX/cKZYSxlySNyoCBg+rddp5BBbQW7CZ+t+Z9oyREM6s28X7Xsugo785q/G0 Z0xhMax4/8CGeW2RL8qHzwOpPbwajE0A+Kc8E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=yEdvPyIdsHRGgovDeDGEDOQTs+HZ1m2mIs2IOO8hgf9iYZ3B27JaXN/WsGMUDf7sTF dAxjN4hC2ORn2N9AJMazCLzaV7G4qNoJvsMybpdp3w5hF4suvJUjH4X2Qn2wQ1Zkev1w yUy3Wh+Xl7BlHwulBIGlH+D06DjHH1DGEnXIc= Received: by 10.142.140.20 with SMTP id n20mr9665808wfd.334.1279645044098; Tue, 20 Jul 2010 09:57:24 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id n2sm7961000wfl.1.2010.07.20.09.57.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 20 Jul 2010 09:57:22 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Tue, 20 Jul 2010 09:56:32 -0700 From: Pyun YongHyeon Date: Tue, 20 Jul 2010 09:56:32 -0700 To: "Bjoern A. Zeeb" Message-ID: <20100720165632.GA6631@michelle.cdnetworks.com> References: <201007192141.o6JLfsr3090971@svn.freebsd.org> <20100720101118.H57851@maildrop.int.zabbadoz.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100720101118.H57851@maildrop.int.zabbadoz.net> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pyun YongHyeon Subject: Re: svn commit: r210263 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: 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, 20 Jul 2010 16:57:35 -0000 On Tue, Jul 20, 2010 at 10:13:03AM +0000, Bjoern A. Zeeb wrote: > On Mon, 19 Jul 2010, Pyun YongHyeon wrote: > > >Author: yongari > >Date: Mon Jul 19 21:41:54 2010 > >New Revision: 210263 > >URL: http://svn.freebsd.org/changeset/base/210263 > > > >Log: > > Do not report current link state if interface is not UP. > > > Hmm, not sure what exactly the code change does but by your > description I think I would like to be able to see a porper (updated) > result in the media: line of ifconfig no matter if it's UP or not. > > If this doesn't change that behaviour, just ignore me;) > I'm afraid this change will effectively disable that feature. Why you need to know current link state if interface is DOWN? Note, the reported link state, when interface is in DOWN, could be wrong because driver will restart auto-negotiation. With this change it will just say current media. BEFORE this change: bce3: flags=8802 metric 0 mtu 1500 options=c01bb ether 00:10:18:3e:13:3e media: Ethernet autoselect (none) status: no carrier OR if it manage to establish link: bce3: flags=8802 metric 0 mtu 1500 options=c01bb ether 00:10:18:3e:13:3e media: Ethernet autoselect (1000baseT ) status: active AFTER this change: bce3: flags=8802 metric 0 mtu 1500 options=c01bb ether 00:10:18:3e:13:3e media: Ethernet autoselect From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 17:04:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21575106575E for ; Tue, 20 Jul 2010 17:04:40 +0000 (UTC) (envelope-from kozlov@ravenloft.kiev.ua) Received: from hosting.nash.net.ua (hosting.nash.net.ua [193.151.252.10]) by mx1.freebsd.org (Postfix) with SMTP id 570E88FC12 for ; Tue, 20 Jul 2010 17:04:38 +0000 (UTC) Received: (qmail 9059 invoked by uid 509); 20 Jul 2010 17:04:38 -0000 Received: from ravenloft.kiev.ua (94.244.131.95) by hosting.nash.net.ua with SMTP; 20 Jul 2010 17:04:38 -0000 Date: Tue, 20 Jul 2010 20:03:33 +0300 From: Alex Kozlov To: Jilles Tjoelker , Gabor Kovesdan , svn-src-head@freebsd.org, spam@rm-rf.kiev.ua Message-ID: <20100720170333.GA51595@ravenloft.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Cc: Subject: Re: svn commit: r210254 - in head/etc: defaults periodic/security X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 17:04:40 -0000 On Tue, Jul 20, 2010 at 05:25:05PM +0300, Alex Kozlov wrote: > > > + echo ${name}: ${one} > > > > This handles pathnames with spaces incorrectly. Consider reading lines > > with > > IFS= read -r line > > This also collapses the nested case statements to one, for > > 'Information for'*, Mismatched*, '' and /*. > > > > The variables in the echo commands should be quoted to avoid word > > splitting and pathname generation. > It's makes parser stateful and overly complex, I will think about most > simple way to do this. Fortunately, at the moment very few, if any, ports > have files with space in names. It's seems I was wrong, We have more that 10k files with spaces in ports. What do think about this solution? Index: etc/periodic/security/460.chkportsum @@ -26,8 +26,10 @@ ;; Mismatched|'') ;; *) - if [ -n ${name} ]; then - echo ${name}: ${one} + if [ -n "${name}" ]; then + #handle filenames with spaces + file="${one} ${two} ${three}" + echo "${name}: ${file%% fails the original MD5 checksum}" fi ;; esac -- Adios From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 17:16:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF6481065690; Tue, 20 Jul 2010 17:16:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D87C18FC0A; Tue, 20 Jul 2010 17:16:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KHGwX1057696; Tue, 20 Jul 2010 17:16:58 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KHGwPG057676; Tue, 20 Jul 2010 17:16:58 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201007201716.o6KHGwPG057676@svn.freebsd.org> From: Ed Schouten Date: Tue, 20 Jul 2010 17:16: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: r210299 - in head: . contrib/llvm contrib/llvm/autoconf contrib/llvm/autoconf/m4 contrib/llvm/bindings/ada/llvm contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/includ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 17:16:59 -0000 Author: ed Date: Tue Jul 20 17:16:57 2010 New Revision: 210299 URL: http://svn.freebsd.org/changeset/base/210299 Log: Upgrade our Clang in base to r108428. This commit merges the latest LLVM sources from the vendor space. It also updates the build glue to match the new sources. Clang's version number is changed to match LLVM's, which means /usr/include/clang/2.0 has been renamed to /usr/include/clang/2.8. Obtained from: projects/clangbsd Added: head/contrib/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h - copied unchanged from r210288, vendor/llvm/dist/include/llvm/ADT/DAGDeltaAlgorithm.h head/contrib/llvm/include/llvm/Analysis/CodeMetrics.h - copied unchanged from r210288, vendor/llvm/dist/include/llvm/Analysis/CodeMetrics.h head/contrib/llvm/include/llvm/Analysis/Loads.h - copied unchanged from r210288, vendor/llvm/dist/include/llvm/Analysis/Loads.h head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h - copied unchanged from r210288, vendor/llvm/dist/include/llvm/CodeGen/FunctionLoweringInfo.h head/contrib/llvm/include/llvm/CodeGen/PostRAHazardRecognizer.h - copied unchanged from r210288, vendor/llvm/dist/include/llvm/CodeGen/PostRAHazardRecognizer.h head/contrib/llvm/include/llvm/MC/MCObjectStreamer.h - copied unchanged from r210288, vendor/llvm/dist/include/llvm/MC/MCObjectStreamer.h head/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h - copied unchanged from r210288, vendor/llvm/dist/include/llvm/MC/MCParser/MCAsmParserExtension.h head/contrib/llvm/include/llvm/Support/COFF.h - copied unchanged from r210288, vendor/llvm/dist/include/llvm/Support/COFF.h head/contrib/llvm/include/llvm/Target/TargetCallingConv.h - copied unchanged from r210288, vendor/llvm/dist/include/llvm/Target/TargetCallingConv.h head/contrib/llvm/lib/Analysis/Loads.cpp - copied unchanged from r210288, vendor/llvm/dist/lib/Analysis/Loads.cpp head/contrib/llvm/lib/CodeGen/CallingConvLower.cpp - copied unchanged from r210288, vendor/llvm/dist/lib/CodeGen/CallingConvLower.cpp head/contrib/llvm/lib/CodeGen/InlineSpiller.cpp - copied unchanged from r210288, vendor/llvm/dist/lib/CodeGen/InlineSpiller.cpp head/contrib/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp - copied unchanged from r210288, vendor/llvm/dist/lib/CodeGen/PostRAHazardRecognizer.cpp head/contrib/llvm/lib/MC/MCObjectStreamer.cpp - copied unchanged from r210288, vendor/llvm/dist/lib/MC/MCObjectStreamer.cpp head/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp - copied unchanged from r210288, vendor/llvm/dist/lib/MC/MCParser/DarwinAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp - copied unchanged from r210288, vendor/llvm/dist/lib/MC/MCParser/ELFAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/MCAsmParserExtension.cpp - copied unchanged from r210288, vendor/llvm/dist/lib/MC/MCParser/MCAsmParserExtension.cpp head/contrib/llvm/lib/MC/WinCOFFObjectWriter.cpp - copied unchanged from r210288, vendor/llvm/dist/lib/MC/WinCOFFObjectWriter.cpp head/contrib/llvm/lib/MC/WinCOFFStreamer.cpp - copied unchanged from r210288, vendor/llvm/dist/lib/MC/WinCOFFStreamer.cpp head/contrib/llvm/lib/Support/DAGDeltaAlgorithm.cpp - copied unchanged from r210288, vendor/llvm/dist/lib/Support/DAGDeltaAlgorithm.cpp head/contrib/llvm/lib/Target/ARM/Thumb2HazardRecognizer.cpp - copied unchanged from r210288, vendor/llvm/dist/lib/Target/ARM/Thumb2HazardRecognizer.cpp head/contrib/llvm/lib/Target/ARM/Thumb2HazardRecognizer.h - copied unchanged from r210288, vendor/llvm/dist/lib/Target/ARM/Thumb2HazardRecognizer.h head/contrib/llvm/lib/Transforms/Hello/Hello.exports - copied unchanged from r210288, vendor/llvm/dist/lib/Transforms/Hello/Hello.exports head/contrib/llvm/tools/clang/include/clang/Basic/Attr.td - copied unchanged from r210288, vendor/clang/dist/include/clang/Basic/Attr.td head/contrib/llvm/tools/clang/include/clang/Basic/AttrKinds.h - copied unchanged from r210288, vendor/clang/dist/include/clang/Basic/AttrKinds.h head/contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td - copied unchanged from r210288, vendor/clang/dist/include/clang/Basic/DeclNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td - copied unchanged from r210288, vendor/clang/dist/include/clang/Basic/StmtNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/Version.inc.in - copied unchanged from r210288, vendor/clang/dist/include/clang/Basic/Version.inc.in head/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td - copied unchanged from r210288, vendor/clang/dist/include/clang/Basic/arm_neon.td head/contrib/llvm/tools/clang/include/clang/Checker/AnalysisConsumer.h - copied unchanged from r210288, vendor/clang/dist/include/clang/Checker/AnalysisConsumer.h head/contrib/llvm/tools/clang/include/clang/Checker/FrontendActions.h - copied unchanged from r210288, vendor/clang/dist/include/clang/Checker/FrontendActions.h head/contrib/llvm/tools/clang/include/clang/Checker/PathDiagnosticClients.h - copied unchanged from r210288, vendor/clang/dist/include/clang/Checker/PathDiagnosticClients.h head/contrib/llvm/tools/clang/include/clang/CodeGen/BackendUtil.h - copied unchanged from r210288, vendor/clang/dist/include/clang/CodeGen/BackendUtil.h head/contrib/llvm/tools/clang/include/clang/CodeGen/CodeGenAction.h - copied unchanged from r210288, vendor/clang/dist/include/clang/CodeGen/CodeGenAction.h head/contrib/llvm/tools/clang/include/clang/Frontend/AnalyzerOptions.h - copied unchanged from r210288, vendor/clang/dist/include/clang/Frontend/AnalyzerOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h - copied unchanged from r210288, vendor/clang/dist/include/clang/Frontend/CodeGenOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/PCHDeserializationListener.h - copied unchanged from r210288, vendor/clang/dist/include/clang/Frontend/PCHDeserializationListener.h head/contrib/llvm/tools/clang/include/clang/Rewrite/ASTConsumers.h - copied unchanged from r210288, vendor/clang/dist/include/clang/Rewrite/ASTConsumers.h head/contrib/llvm/tools/clang/include/clang/Rewrite/FixItRewriter.h - copied unchanged from r210288, vendor/clang/dist/include/clang/Rewrite/FixItRewriter.h head/contrib/llvm/tools/clang/include/clang/Rewrite/FrontendActions.h - copied unchanged from r210288, vendor/clang/dist/include/clang/Rewrite/FrontendActions.h head/contrib/llvm/tools/clang/include/clang/Rewrite/Rewriters.h - copied unchanged from r210288, vendor/clang/dist/include/clang/Rewrite/Rewriters.h head/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp - copied unchanged from r210288, vendor/clang/dist/lib/AST/ExprClassification.cpp head/contrib/llvm/tools/clang/lib/Checker/AnalysisConsumer.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Checker/AnalysisConsumer.cpp head/contrib/llvm/tools/clang/lib/Checker/CStringChecker.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Checker/CStringChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/FrontendActions.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Checker/FrontendActions.cpp head/contrib/llvm/tools/clang/lib/Checker/HTMLDiagnostics.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Checker/HTMLDiagnostics.cpp head/contrib/llvm/tools/clang/lib/Checker/IdempotentOperationChecker.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Checker/IdempotentOperationChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/PlistDiagnostics.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Checker/PlistDiagnostics.cpp head/contrib/llvm/tools/clang/lib/Checker/StackAddrLeakChecker.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Checker/StackAddrLeakChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/StreamChecker.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Checker/StreamChecker.cpp head/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp - copied unchanged from r210288, vendor/clang/dist/lib/CodeGen/BackendUtil.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGException.h - copied unchanged from r210288, vendor/clang/dist/lib/CodeGen/CGException.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp - copied unchanged from r210288, vendor/clang/dist/lib/CodeGen/CodeGenAction.cpp head/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftCXXABI.cpp - copied unchanged from r210288, vendor/clang/dist/lib/CodeGen/MicrosoftCXXABI.cpp head/contrib/llvm/tools/clang/lib/Headers/arm_neon.td - copied unchanged from r210288, vendor/clang/dist/lib/Headers/arm_neon.td head/contrib/llvm/tools/clang/lib/Rewrite/FixItRewriter.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Rewrite/FixItRewriter.cpp head/contrib/llvm/tools/clang/lib/Rewrite/FrontendActions.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Rewrite/FrontendActions.cpp head/contrib/llvm/tools/clang/lib/Rewrite/HTMLPrint.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Rewrite/HTMLPrint.cpp head/contrib/llvm/tools/clang/lib/Rewrite/RewriteMacros.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Rewrite/RewriteMacros.cpp head/contrib/llvm/tools/clang/lib/Rewrite/RewriteObjC.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Rewrite/RewriteObjC.cpp head/contrib/llvm/tools/clang/lib/Rewrite/RewriteTest.cpp - copied unchanged from r210288, vendor/clang/dist/lib/Rewrite/RewriteTest.cpp head/contrib/llvm/tools/clang/runtime/ - copied from r210288, vendor/clang/dist/runtime/ head/contrib/llvm/tools/clang/utils/FuzzTest - copied unchanged from r210288, vendor/clang/dist/utils/FuzzTest head/contrib/llvm/utils/TableGen/ClangAttrEmitter.cpp - copied unchanged from r210288, vendor/llvm/dist/utils/TableGen/ClangAttrEmitter.cpp head/contrib/llvm/utils/TableGen/ClangAttrEmitter.h - copied unchanged from r210288, vendor/llvm/dist/utils/TableGen/ClangAttrEmitter.h head/contrib/llvm/utils/TableGen/NeonEmitter.cpp - copied unchanged from r210288, vendor/llvm/dist/utils/TableGen/NeonEmitter.cpp head/contrib/llvm/utils/TableGen/NeonEmitter.h - copied unchanged from r210288, vendor/llvm/dist/utils/TableGen/NeonEmitter.h head/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-tuple.h - copied unchanged from r210288, vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-tuple.h head/lib/clang/include/clang/AST/Attrs.inc (contents, props changed) head/lib/clang/include/clang/AST/DeclNodes.inc (contents, props changed) head/lib/clang/include/clang/Basic/AttrList.inc (contents, props changed) head/lib/clang/include/clang/Basic/Version.inc (contents, props changed) head/lib/clang/include/clang/Basic/arm_neon.inc (contents, props changed) head/lib/clang/libllvmasmparser/ head/lib/clang/libllvmasmparser/Makefile (contents, props changed) Replaced: head/contrib/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp - copied unchanged from r210288, vendor/llvm/dist/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.h - copied unchanged from r210288, vendor/llvm/dist/lib/ExecutionEngine/JIT/JITDebugRegisterer.h Deleted: head/contrib/llvm/lib/CodeGen/ExactHazardRecognizer.cpp head/contrib/llvm/lib/CodeGen/ExactHazardRecognizer.h head/contrib/llvm/lib/CodeGen/RegAllocLocal.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/CallingConvLower.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.h head/contrib/llvm/lib/CodeGen/SimpleHazardRecognizer.h head/contrib/llvm/lib/Target/X86/X86COFF.h head/contrib/llvm/tools/clang/include/clang/AST/StmtNodes.td head/contrib/llvm/tools/clang/include/clang/CodeGen/CodeGenOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/AnalysisConsumer.h head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenAction.h head/contrib/llvm/tools/clang/include/clang/Frontend/FixItRewriter.h head/contrib/llvm/tools/clang/include/clang/Frontend/PathDiagnosticClients.h head/contrib/llvm/tools/clang/lib/Checker/ReturnStackAddressChecker.cpp head/contrib/llvm/tools/clang/lib/Frontend/AnalysisConsumer.cpp head/contrib/llvm/tools/clang/lib/Frontend/CodeGenAction.cpp head/contrib/llvm/tools/clang/lib/Frontend/FixItRewriter.cpp head/contrib/llvm/tools/clang/lib/Frontend/HTMLDiagnostics.cpp head/contrib/llvm/tools/clang/lib/Frontend/HTMLPrint.cpp head/contrib/llvm/tools/clang/lib/Frontend/PlistDiagnostics.cpp head/contrib/llvm/tools/clang/lib/Frontend/RewriteMacros.cpp head/contrib/llvm/tools/clang/lib/Frontend/RewriteObjC.cpp head/contrib/llvm/tools/clang/lib/Frontend/RewriteTest.cpp head/contrib/llvm/tools/clang/lib/Runtime/Makefile Modified: head/ObsoleteFiles.inc head/contrib/llvm/CMakeLists.txt head/contrib/llvm/Makefile head/contrib/llvm/Makefile.config.in head/contrib/llvm/Makefile.rules head/contrib/llvm/autoconf/configure.ac head/contrib/llvm/autoconf/m4/link_options.m4 head/contrib/llvm/bindings/ada/llvm/llvm.ads head/contrib/llvm/configure head/contrib/llvm/include/llvm-c/Core.h head/contrib/llvm/include/llvm-c/Target.h head/contrib/llvm/include/llvm-c/lto.h head/contrib/llvm/include/llvm/ADT/APFloat.h head/contrib/llvm/include/llvm/ADT/APInt.h head/contrib/llvm/include/llvm/ADT/DenseMap.h head/contrib/llvm/include/llvm/ADT/EquivalenceClasses.h head/contrib/llvm/include/llvm/ADT/FoldingSet.h head/contrib/llvm/include/llvm/ADT/ImmutableIntervalMap.h head/contrib/llvm/include/llvm/ADT/PostOrderIterator.h head/contrib/llvm/include/llvm/ADT/SetVector.h head/contrib/llvm/include/llvm/ADT/SmallPtrSet.h head/contrib/llvm/include/llvm/ADT/SmallVector.h head/contrib/llvm/include/llvm/ADT/Statistic.h head/contrib/llvm/include/llvm/ADT/Triple.h head/contrib/llvm/include/llvm/ADT/ValueMap.h head/contrib/llvm/include/llvm/ADT/ilist.h head/contrib/llvm/include/llvm/AbstractTypeUser.h head/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h head/contrib/llvm/include/llvm/Analysis/CFGPrinter.h head/contrib/llvm/include/llvm/Analysis/CaptureTracking.h head/contrib/llvm/include/llvm/Analysis/DebugInfo.h head/contrib/llvm/include/llvm/Analysis/DominatorInternals.h head/contrib/llvm/include/llvm/Analysis/Dominators.h head/contrib/llvm/include/llvm/Analysis/InlineCost.h head/contrib/llvm/include/llvm/Analysis/IntervalIterator.h head/contrib/llvm/include/llvm/Analysis/LoopInfo.h head/contrib/llvm/include/llvm/Analysis/MemoryBuiltins.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h head/contrib/llvm/include/llvm/Analysis/ValueTracking.h head/contrib/llvm/include/llvm/Bitcode/ReaderWriter.h head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h head/contrib/llvm/include/llvm/CodeGen/FastISel.h head/contrib/llvm/include/llvm/CodeGen/GCMetadata.h head/contrib/llvm/include/llvm/CodeGen/GCMetadataPrinter.h head/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h head/contrib/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h head/contrib/llvm/include/llvm/CodeGen/LiveInterval.h head/contrib/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h head/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineFunctionPass.h head/contrib/llvm/include/llvm/CodeGen/MachineInstr.h head/contrib/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineLoopInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineOperand.h head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h head/contrib/llvm/include/llvm/CodeGen/Passes.h head/contrib/llvm/include/llvm/CodeGen/ProcessImplicitDefs.h head/contrib/llvm/include/llvm/CodeGen/RegisterCoalescer.h head/contrib/llvm/include/llvm/CodeGen/RegisterScavenging.h head/contrib/llvm/include/llvm/CodeGen/RuntimeLibcalls.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/Config/config.h.in head/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h head/contrib/llvm/include/llvm/GlobalValue.h head/contrib/llvm/include/llvm/InlineAsm.h head/contrib/llvm/include/llvm/InstrTypes.h head/contrib/llvm/include/llvm/Instructions.h head/contrib/llvm/include/llvm/IntrinsicInst.h head/contrib/llvm/include/llvm/Intrinsics.td head/contrib/llvm/include/llvm/LinkAllPasses.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/MCObjectWriter.h head/contrib/llvm/include/llvm/MC/MCParser/AsmLexer.h head/contrib/llvm/include/llvm/MC/MCParser/AsmParser.h head/contrib/llvm/include/llvm/MC/MCParser/MCAsmLexer.h head/contrib/llvm/include/llvm/MC/MCParser/MCAsmParser.h head/contrib/llvm/include/llvm/MC/MCSection.h head/contrib/llvm/include/llvm/MC/MCSectionCOFF.h head/contrib/llvm/include/llvm/MC/MCStreamer.h head/contrib/llvm/include/llvm/MC/SectionKind.h head/contrib/llvm/include/llvm/Module.h head/contrib/llvm/include/llvm/Pass.h head/contrib/llvm/include/llvm/PassAnalysisSupport.h head/contrib/llvm/include/llvm/PassManagers.h head/contrib/llvm/include/llvm/PassSupport.h head/contrib/llvm/include/llvm/Support/CFG.h head/contrib/llvm/include/llvm/Support/CallSite.h head/contrib/llvm/include/llvm/Support/Dwarf.h head/contrib/llvm/include/llvm/Support/ELF.h head/contrib/llvm/include/llvm/Support/IRBuilder.h head/contrib/llvm/include/llvm/Support/IRReader.h head/contrib/llvm/include/llvm/Support/MemoryBuffer.h head/contrib/llvm/include/llvm/Support/Regex.h head/contrib/llvm/include/llvm/Support/StringPool.h head/contrib/llvm/include/llvm/Support/Timer.h head/contrib/llvm/include/llvm/Support/raw_ostream.h head/contrib/llvm/include/llvm/SymbolTableListTraits.h head/contrib/llvm/include/llvm/System/DataTypes.h.cmake head/contrib/llvm/include/llvm/System/Path.h head/contrib/llvm/include/llvm/Target/Target.td head/contrib/llvm/include/llvm/Target/TargetAsmParser.h head/contrib/llvm/include/llvm/Target/TargetInstrDesc.h head/contrib/llvm/include/llvm/Target/TargetInstrInfo.h head/contrib/llvm/include/llvm/Target/TargetInstrItineraries.h head/contrib/llvm/include/llvm/Target/TargetLowering.h head/contrib/llvm/include/llvm/Target/TargetOpcodes.h head/contrib/llvm/include/llvm/Target/TargetOptions.h head/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h head/contrib/llvm/include/llvm/Transforms/IPO.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/Cloning.h head/contrib/llvm/include/llvm/Transforms/Utils/Local.h head/contrib/llvm/include/llvm/Type.h head/contrib/llvm/include/llvm/Use.h head/contrib/llvm/include/llvm/Value.h head/contrib/llvm/lib/Analysis/AliasAnalysis.cpp head/contrib/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp head/contrib/llvm/lib/Analysis/AliasDebugger.cpp head/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/CMakeLists.txt head/contrib/llvm/lib/Analysis/ConstantFolding.cpp head/contrib/llvm/lib/Analysis/DebugInfo.cpp head/contrib/llvm/lib/Analysis/DomPrinter.cpp head/contrib/llvm/lib/Analysis/IPA/CallGraph.cpp head/contrib/llvm/lib/Analysis/IPA/GlobalsModRef.cpp head/contrib/llvm/lib/Analysis/InlineCost.cpp head/contrib/llvm/lib/Analysis/InstructionSimplify.cpp head/contrib/llvm/lib/Analysis/Lint.cpp head/contrib/llvm/lib/Analysis/LoopInfo.cpp head/contrib/llvm/lib/Analysis/MemoryBuiltins.cpp head/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp head/contrib/llvm/lib/Analysis/PostDominators.cpp head/contrib/llvm/lib/Analysis/ProfileInfo.cpp head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp head/contrib/llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp head/contrib/llvm/lib/Analysis/ScalarEvolutionNormalization.cpp head/contrib/llvm/lib/Analysis/ValueTracking.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/Bitcode/Writer/ValueEnumerator.cpp head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.h head/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.h head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DIE.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h head/contrib/llvm/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp head/contrib/llvm/lib/CodeGen/BranchFolding.cpp head/contrib/llvm/lib/CodeGen/BranchFolding.h head/contrib/llvm/lib/CodeGen/CMakeLists.txt head/contrib/llvm/lib/CodeGen/CalcSpillWeights.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/DwarfEHPrepare.cpp head/contrib/llvm/lib/CodeGen/ELFCodeEmitter.cpp head/contrib/llvm/lib/CodeGen/GCStrategy.cpp head/contrib/llvm/lib/CodeGen/IfConversion.cpp head/contrib/llvm/lib/CodeGen/IntrinsicLowering.cpp head/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp head/contrib/llvm/lib/CodeGen/LatencyPriorityQueue.cpp head/contrib/llvm/lib/CodeGen/LiveInterval.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp head/contrib/llvm/lib/CodeGen/LiveStackAnalysis.cpp head/contrib/llvm/lib/CodeGen/LiveVariables.cpp head/contrib/llvm/lib/CodeGen/LowerSubregs.cpp head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp head/contrib/llvm/lib/CodeGen/MachineCSE.cpp head/contrib/llvm/lib/CodeGen/MachineDominators.cpp head/contrib/llvm/lib/CodeGen/MachineFunction.cpp head/contrib/llvm/lib/CodeGen/MachineInstr.cpp head/contrib/llvm/lib/CodeGen/MachineLICM.cpp head/contrib/llvm/lib/CodeGen/MachineModuleInfo.cpp head/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp head/contrib/llvm/lib/CodeGen/MachineSink.cpp head/contrib/llvm/lib/CodeGen/MachineVerifier.cpp head/contrib/llvm/lib/CodeGen/OptimizeExts.cpp head/contrib/llvm/lib/CodeGen/OptimizePHIs.cpp head/contrib/llvm/lib/CodeGen/PBQP/HeuristicSolver.h head/contrib/llvm/lib/CodeGen/PBQP/Heuristics/Briggs.h head/contrib/llvm/lib/CodeGen/PHIElimination.cpp head/contrib/llvm/lib/CodeGen/Passes.cpp head/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp head/contrib/llvm/lib/CodeGen/PreAllocSplitting.cpp head/contrib/llvm/lib/CodeGen/ProcessImplicitDefs.cpp head/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp head/contrib/llvm/lib/CodeGen/RegAllocFast.cpp head/contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp head/contrib/llvm/lib/CodeGen/RegAllocPBQP.cpp head/contrib/llvm/lib/CodeGen/RegisterCoalescer.cpp head/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAG.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAGEmit.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.h head/contrib/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt 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/LegalizeDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.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/ScheduleDAGFast.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.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/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/SimpleRegisterCoalescing.cpp head/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.h head/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp head/contrib/llvm/lib/CodeGen/SlotIndexes.cpp head/contrib/llvm/lib/CodeGen/Spiller.cpp head/contrib/llvm/lib/CodeGen/Spiller.h 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/VirtRegRewriter.cpp head/contrib/llvm/lib/CompilerDriver/Tool.cpp head/contrib/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp head/contrib/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JIT.h head/contrib/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp head/contrib/llvm/lib/Linker/LinkItems.cpp head/contrib/llvm/lib/MC/CMakeLists.txt 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/MCExpr.cpp head/contrib/llvm/lib/MC/MCMachOStreamer.cpp head/contrib/llvm/lib/MC/MCParser/AsmLexer.cpp head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp head/contrib/llvm/lib/MC/MCParser/CMakeLists.txt head/contrib/llvm/lib/MC/MCParser/MCAsmLexer.cpp head/contrib/llvm/lib/MC/MCParser/MCAsmParser.cpp head/contrib/llvm/lib/MC/MCSectionCOFF.cpp head/contrib/llvm/lib/MC/MachObjectWriter.cpp head/contrib/llvm/lib/Support/APFloat.cpp head/contrib/llvm/lib/Support/APInt.cpp head/contrib/llvm/lib/Support/CMakeLists.txt head/contrib/llvm/lib/Support/DeltaAlgorithm.cpp head/contrib/llvm/lib/Support/Dwarf.cpp head/contrib/llvm/lib/Support/FileUtilities.cpp head/contrib/llvm/lib/Support/FoldingSet.cpp head/contrib/llvm/lib/Support/MemoryBuffer.cpp head/contrib/llvm/lib/Support/PrettyStackTrace.cpp head/contrib/llvm/lib/Support/Regex.cpp head/contrib/llvm/lib/Support/SmallPtrSet.cpp head/contrib/llvm/lib/Support/SmallVector.cpp head/contrib/llvm/lib/Support/StringPool.cpp head/contrib/llvm/lib/Support/Timer.cpp head/contrib/llvm/lib/Support/Triple.cpp head/contrib/llvm/lib/Support/raw_ostream.cpp head/contrib/llvm/lib/System/Disassembler.cpp head/contrib/llvm/lib/System/Path.cpp head/contrib/llvm/lib/System/Unix/Path.inc head/contrib/llvm/lib/System/Unix/Program.inc head/contrib/llvm/lib/System/Unix/Signals.inc head/contrib/llvm/lib/System/Win32/Path.inc head/contrib/llvm/lib/System/Win32/Signals.inc head/contrib/llvm/lib/Target/ARM/ARM.h head/contrib/llvm/lib/Target/ARM/ARM.td head/contrib/llvm/lib/Target/ARM/ARMAddressingModes.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/ARMCodeEmitter.cpp head/contrib/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp head/contrib/llvm/lib/Target/ARM/ARMConstantPoolValue.h head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.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.h 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.h head/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp head/contrib/llvm/lib/Target/ARM/ARMMachineFunctionInfo.h head/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td head/contrib/llvm/lib/Target/ARM/ARMScheduleA8.td head/contrib/llvm/lib/Target/ARM/ARMScheduleA9.td head/contrib/llvm/lib/Target/ARM/ARMScheduleV6.td head/contrib/llvm/lib/Target/ARM/ARMSubtarget.h head/contrib/llvm/lib/Target/ARM/ARMTargetMachine.cpp head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp head/contrib/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp head/contrib/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp head/contrib/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h head/contrib/llvm/lib/Target/ARM/CMakeLists.txt head/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp head/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.h head/contrib/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h head/contrib/llvm/lib/Target/ARM/NEONMoveFix.cpp head/contrib/llvm/lib/Target/ARM/NEONPreAllocPass.cpp head/contrib/llvm/lib/Target/ARM/README.txt head/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.h 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/Alpha/AlphaISelLowering.cpp head/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.h head/contrib/llvm/lib/Target/Alpha/AlphaInstrFormats.td head/contrib/llvm/lib/Target/Alpha/AlphaInstrInfo.cpp head/contrib/llvm/lib/Target/Alpha/AlphaInstrInfo.h head/contrib/llvm/lib/Target/Alpha/AlphaInstrInfo.td head/contrib/llvm/lib/Target/Alpha/AlphaMCAsmInfo.cpp head/contrib/llvm/lib/Target/Alpha/AlphaMCAsmInfo.h head/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp head/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.h head/contrib/llvm/lib/Target/Blackfin/BlackfinISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.h head/contrib/llvm/lib/Target/Blackfin/BlackfinInstrInfo.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinInstrInfo.h head/contrib/llvm/lib/Target/Blackfin/BlackfinInstrInfo.td head/contrib/llvm/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinMCAsmInfo.h head/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.h head/contrib/llvm/lib/Target/CBackend/CBackend.cpp head/contrib/llvm/lib/Target/CellSPU/SPUCallingConv.td head/contrib/llvm/lib/Target/CellSPU/SPUFrameInfo.h head/contrib/llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp 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.h head/contrib/llvm/lib/Target/CellSPU/SPUMCAsmInfo.cpp head/contrib/llvm/lib/Target/CellSPU/SPUMCAsmInfo.h head/contrib/llvm/lib/Target/CellSPU/SPUNodes.td head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.h head/contrib/llvm/lib/Target/CppBackend/CPPBackend.cpp head/contrib/llvm/lib/Target/MBlaze/AsmPrinter/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.h head/contrib/llvm/lib/Target/MBlaze/MBlazeMCAsmInfo.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeMCAsmInfo.h head/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.h head/contrib/llvm/lib/Target/MSIL/MSILWriter.cpp head/contrib/llvm/lib/Target/MSIL/MSILWriter.h head/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.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/MSP430MCAsmInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430MCAsmInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h head/contrib/llvm/lib/Target/Mangler.cpp head/contrib/llvm/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.h 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/MipsMCAsmInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsMCAsmInfo.h head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h head/contrib/llvm/lib/Target/PIC16/PIC16DebugInfo.cpp head/contrib/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp head/contrib/llvm/lib/Target/PIC16/PIC16ISelLowering.h head/contrib/llvm/lib/Target/PIC16/PIC16InstrInfo.cpp head/contrib/llvm/lib/Target/PIC16/PIC16InstrInfo.h head/contrib/llvm/lib/Target/PIC16/PIC16InstrInfo.td head/contrib/llvm/lib/Target/PIC16/PIC16MCAsmInfo.cpp head/contrib/llvm/lib/Target/PIC16/PIC16MCAsmInfo.h head/contrib/llvm/lib/Target/PIC16/PIC16MemSelOpt.cpp head/contrib/llvm/lib/Target/PIC16/PIC16Passes/PIC16Cloner.cpp head/contrib/llvm/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h head/contrib/llvm/lib/Target/PIC16/PIC16RegisterInfo.cpp head/contrib/llvm/lib/Target/PIC16/PIC16RegisterInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h head/contrib/llvm/lib/Target/README.txt 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/SparcInstrInfo.h head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td head/contrib/llvm/lib/Target/Sparc/SparcMCAsmInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcMCAsmInfo.h head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h head/contrib/llvm/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.h head/contrib/llvm/lib/Target/SystemZ/SystemZInstrFP.td head/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.td head/contrib/llvm/lib/Target/SystemZ/SystemZMCAsmInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZMCAsmInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td head/contrib/llvm/lib/Target/TargetInstrInfo.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/X86AsmLexer.cpp head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp head/contrib/llvm/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp head/contrib/llvm/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.h head/contrib/llvm/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp head/contrib/llvm/lib/Target/X86/AsmPrinter/X86IntelInstPrinter.cpp head/contrib/llvm/lib/Target/X86/AsmPrinter/X86IntelInstPrinter.h head/contrib/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp head/contrib/llvm/lib/Target/X86/Disassembler/CMakeLists.txt head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp head/contrib/llvm/lib/Target/X86/README-SSE.txt head/contrib/llvm/lib/Target/X86/README-X86-64.txt head/contrib/llvm/lib/Target/X86/README.txt head/contrib/llvm/lib/Target/X86/X86.h head/contrib/llvm/lib/Target/X86/X86AsmBackend.cpp 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/X86FixupKinds.h head/contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp head/contrib/llvm/lib/Target/X86/X86FloatingPointRegKill.cpp 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/X86Instr64bit.td head/contrib/llvm/lib/Target/X86/X86InstrBuilder.h 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/X86MCCodeEmitter.cpp 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/X86Subtarget.cpp head/contrib/llvm/lib/Target/X86/X86Subtarget.h head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp head/contrib/llvm/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.h head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td head/contrib/llvm/lib/Target/XCore/XCoreMCAsmInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreMCAsmInfo.h head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h head/contrib/llvm/lib/Transforms/Hello/Hello.cpp head/contrib/llvm/lib/Transforms/Hello/Makefile head/contrib/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp head/contrib/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp head/contrib/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp head/contrib/llvm/lib/Transforms/IPO/Inliner.cpp head/contrib/llvm/lib/Transforms/IPO/LowerSetJmp.cpp head/contrib/llvm/lib/Transforms/IPO/MergeFunctions.cpp head/contrib/llvm/lib/Transforms/IPO/PartialInlining.cpp head/contrib/llvm/lib/Transforms/IPO/PartialSpecialization.cpp head/contrib/llvm/lib/Transforms/IPO/StripSymbols.cpp head/contrib/llvm/lib/Transforms/IPO/StructRetPromotion.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombine.h 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/InstCombinePHI.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/OptimalEdgeProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp head/contrib/llvm/lib/Transforms/Scalar/ABCD.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/GVN.cpp head/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp head/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopDeletion.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopIndexSplit.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/MemCpyOptimizer.cpp head/contrib/llvm/lib/Transforms/Scalar/Reassociate.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/TailDuplication.cpp head/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp head/contrib/llvm/lib/Transforms/Utils/AddrModeMatcher.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/CloneLoop.cpp head/contrib/llvm/lib/Transforms/Utils/CloneModule.cpp head/contrib/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp head/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp head/contrib/llvm/lib/Transforms/Utils/LCSSA.cpp head/contrib/llvm/lib/Transforms/Utils/Local.cpp head/contrib/llvm/lib/Transforms/Utils/LoopSimplify.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUnroll.cpp head/contrib/llvm/lib/Transforms/Utils/LowerInvoke.cpp head/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp head/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp head/contrib/llvm/lib/Transforms/Utils/ValueMapper.h head/contrib/llvm/lib/VMCore/AsmWriter.cpp head/contrib/llvm/lib/VMCore/AutoUpgrade.cpp head/contrib/llvm/lib/VMCore/ConstantFold.cpp head/contrib/llvm/lib/VMCore/Core.cpp head/contrib/llvm/lib/VMCore/Instruction.cpp head/contrib/llvm/lib/VMCore/Instructions.cpp head/contrib/llvm/lib/VMCore/IntrinsicInst.cpp head/contrib/llvm/lib/VMCore/Metadata.cpp head/contrib/llvm/lib/VMCore/Module.cpp head/contrib/llvm/lib/VMCore/Pass.cpp head/contrib/llvm/lib/VMCore/PassManager.cpp head/contrib/llvm/lib/VMCore/Value.cpp head/contrib/llvm/lib/VMCore/Verifier.cpp head/contrib/llvm/tools/Makefile head/contrib/llvm/tools/bugpoint/BugDriver.h head/contrib/llvm/tools/bugpoint/CrashDebugger.cpp head/contrib/llvm/tools/bugpoint/ExtractFunction.cpp head/contrib/llvm/tools/bugpoint/ListReducer.h head/contrib/llvm/tools/bugpoint/Miscompilation.cpp head/contrib/llvm/tools/bugpoint/ToolRunner.h head/contrib/llvm/tools/clang/CMakeLists.txt head/contrib/llvm/tools/clang/Makefile head/contrib/llvm/tools/clang/NOTES.txt head/contrib/llvm/tools/clang/README.txt head/contrib/llvm/tools/clang/include/Makefile head/contrib/llvm/tools/clang/include/clang-c/Index.h head/contrib/llvm/tools/clang/include/clang-c/Makefile head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h head/contrib/llvm/tools/clang/include/clang/AST/Attr.h head/contrib/llvm/tools/clang/include/clang/AST/CMakeLists.txt head/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.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/DeclFriend.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/DeclVisitor.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/ExternalASTSource.h head/contrib/llvm/tools/clang/include/clang/AST/Makefile 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/StmtIterator.h head/contrib/llvm/tools/clang/include/clang/AST/TemplateBase.h head/contrib/llvm/tools/clang/include/clang/AST/TemplateName.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/AST/TypeLocBuilder.h head/contrib/llvm/tools/clang/include/clang/AST/TypeNodes.def head/contrib/llvm/tools/clang/include/clang/AST/UsuallyTinyPtrVector.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/PrintfFormatString.h head/contrib/llvm/tools/clang/include/clang/Analysis/Support/BumpVector.h head/contrib/llvm/tools/clang/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsPPC.def head/contrib/llvm/tools/clang/include/clang/Basic/CMakeLists.txt head/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.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/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/FileManager.h head/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/Makefile head/contrib/llvm/tools/clang/include/clang/Basic/PartialDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.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/Version.h head/contrib/llvm/tools/clang/include/clang/Checker/BugReporter/BugReporter.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/Checker.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/CheckerVisitor.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/Environment.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/ExplodedGraph.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/GRCoreEngine.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/GRExprEngine.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/GRState.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/GRSubEngine.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/GRTransferFuncs.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/MemRegion.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/SVals.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/SValuator.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/Store.h head/contrib/llvm/tools/clang/include/clang/Checker/PathSensitive/SymbolManager.h head/contrib/llvm/tools/clang/include/clang/CodeGen/ModuleBuilder.h head/contrib/llvm/tools/clang/include/clang/Driver/Action.h 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.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/HostInfo.h head/contrib/llvm/tools/clang/include/clang/Driver/Makefile 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/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/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/FrontendPluginRegistry.h head/contrib/llvm/tools/clang/include/clang/Frontend/PCHBitCodes.h head/contrib/llvm/tools/clang/include/clang/Frontend/PCHReader.h head/contrib/llvm/tools/clang/include/clang/Frontend/PCHWriter.h head/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnosticPrinter.h head/contrib/llvm/tools/clang/include/clang/Frontend/TypeXML.def head/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h head/contrib/llvm/tools/clang/include/clang/Index/CallGraph.h head/contrib/llvm/tools/clang/include/clang/Index/Entity.h head/contrib/llvm/tools/clang/include/clang/Index/Indexer.h head/contrib/llvm/tools/clang/include/clang/Index/TranslationUnit.h head/contrib/llvm/tools/clang/include/clang/Lex/PPCallbacks.h head/contrib/llvm/tools/clang/include/clang/Lex/Pragma.h head/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h head/contrib/llvm/tools/clang/include/clang/Lex/Token.h head/contrib/llvm/tools/clang/include/clang/Makefile head/contrib/llvm/tools/clang/include/clang/Parse/Action.h head/contrib/llvm/tools/clang/include/clang/Parse/AttributeList.h head/contrib/llvm/tools/clang/include/clang/Parse/DeclSpec.h head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h head/contrib/llvm/tools/clang/include/clang/Parse/Template.h head/contrib/llvm/tools/clang/include/clang/Rewrite/RewriteRope.h head/contrib/llvm/tools/clang/include/clang/Rewrite/Rewriter.h head/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h head/contrib/llvm/tools/clang/include/clang/Sema/ExternalSemaSource.h head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp head/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp head/contrib/llvm/tools/clang/lib/AST/AttrImpl.cpp head/contrib/llvm/tools/clang/lib/AST/CMakeLists.txt 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/Expr.cpp head/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp head/contrib/llvm/tools/clang/lib/AST/Makefile 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/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/TemplateName.cpp head/contrib/llvm/tools/clang/lib/AST/Type.cpp head/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp head/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp head/contrib/llvm/tools/clang/lib/Analysis/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp head/contrib/llvm/tools/clang/lib/Analysis/Makefile head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp head/contrib/llvm/tools/clang/lib/Basic/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp head/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp head/contrib/llvm/tools/clang/lib/Basic/Makefile head/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/Checker/AttrNonNullChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/BasicConstraintManager.cpp head/contrib/llvm/tools/clang/lib/Checker/BasicObjCFoundationChecks.cpp head/contrib/llvm/tools/clang/lib/Checker/BasicObjCFoundationChecks.h head/contrib/llvm/tools/clang/lib/Checker/BasicStore.cpp head/contrib/llvm/tools/clang/lib/Checker/BugReporter.cpp head/contrib/llvm/tools/clang/lib/Checker/BuiltinFunctionChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/CFRefCount.cpp head/contrib/llvm/tools/clang/lib/Checker/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Checker/CallInliner.cpp head/contrib/llvm/tools/clang/lib/Checker/CastSizeChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/CheckSecuritySyntaxOnly.cpp head/contrib/llvm/tools/clang/lib/Checker/Environment.cpp head/contrib/llvm/tools/clang/lib/Checker/FlatStore.cpp head/contrib/llvm/tools/clang/lib/Checker/GRCoreEngine.cpp head/contrib/llvm/tools/clang/lib/Checker/GRExprEngine.cpp head/contrib/llvm/tools/clang/lib/Checker/GRExprEngineExperimentalChecks.cpp head/contrib/llvm/tools/clang/lib/Checker/GRExprEngineExperimentalChecks.h head/contrib/llvm/tools/clang/lib/Checker/GRExprEngineInternalChecks.h head/contrib/llvm/tools/clang/lib/Checker/GRState.cpp head/contrib/llvm/tools/clang/lib/Checker/LLVMConventionsChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/Makefile head/contrib/llvm/tools/clang/lib/Checker/MallocChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/MemRegion.cpp head/contrib/llvm/tools/clang/lib/Checker/OSAtomicChecker.cpp head/contrib/llvm/tools/clang/lib/Checker/PathDiagnostic.cpp head/contrib/llvm/tools/clang/lib/Checker/RangeConstraintManager.cpp head/contrib/llvm/tools/clang/lib/Checker/RegionStore.cpp head/contrib/llvm/tools/clang/lib/Checker/SVals.cpp head/contrib/llvm/tools/clang/lib/Checker/SValuator.cpp head/contrib/llvm/tools/clang/lib/Checker/SimpleConstraintManager.cpp head/contrib/llvm/tools/clang/lib/Checker/SimpleConstraintManager.h head/contrib/llvm/tools/clang/lib/Checker/SimpleSValuator.cpp head/contrib/llvm/tools/clang/lib/Checker/Store.cpp head/contrib/llvm/tools/clang/lib/Checker/SymbolManager.cpp head/contrib/llvm/tools/clang/lib/Checker/VLASizeChecker.cpp head/contrib/llvm/tools/clang/lib/CodeGen/ABIInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.h 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.h head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.h head/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp 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/CGExprComplex.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.h head/contrib/llvm/tools/clang/lib/CodeGen/CGRTTI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGTemporaries.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.h head/contrib/llvm/tools/clang/lib/CodeGen/CMakeLists.txt 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/CodeGenTypes.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h head/contrib/llvm/tools/clang/lib/CodeGen/GlobalDecl.h head/contrib/llvm/tools/clang/lib/CodeGen/Makefile head/contrib/llvm/tools/clang/lib/CodeGen/Mangle.cpp head/contrib/llvm/tools/clang/lib/CodeGen/Mangle.h head/contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Driver/Action.cpp head/contrib/llvm/tools/clang/lib/Driver/Arg.cpp head/contrib/llvm/tools/clang/lib/Driver/ArgList.cpp head/contrib/llvm/tools/clang/lib/Driver/CMakeLists.txt 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/HostInfo.cpp head/contrib/llvm/tools/clang/lib/Driver/Makefile head/contrib/llvm/tools/clang/lib/Driver/OptTable.cpp head/contrib/llvm/tools/clang/lib/Driver/Option.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/Frontend/ASTConsumers.cpp head/contrib/llvm/tools/clang/lib/Frontend/ASTMerge.cpp head/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp head/contrib/llvm/tools/clang/lib/Frontend/BoostConAction.cpp head/contrib/llvm/tools/clang/lib/Frontend/CMakeLists.txt 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/FrontendAction.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendActions.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendOptions.cpp head/contrib/llvm/tools/clang/lib/Frontend/GeneratePCH.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/Makefile head/contrib/llvm/tools/clang/lib/Frontend/PCHReader.cpp head/contrib/llvm/tools/clang/lib/Frontend/PCHReaderDecl.cpp head/contrib/llvm/tools/clang/lib/Frontend/PCHReaderStmt.cpp head/contrib/llvm/tools/clang/lib/Frontend/PCHWriter.cpp head/contrib/llvm/tools/clang/lib/Frontend/PCHWriterDecl.cpp head/contrib/llvm/tools/clang/lib/Frontend/PCHWriterStmt.cpp head/contrib/llvm/tools/clang/lib/Frontend/PrintParserCallbacks.cpp head/contrib/llvm/tools/clang/lib/Frontend/PrintPreprocessedOutput.cpp head/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp head/contrib/llvm/tools/clang/lib/Frontend/Warnings.cpp head/contrib/llvm/tools/clang/lib/Headers/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Headers/Makefile head/contrib/llvm/tools/clang/lib/Headers/altivec.h head/contrib/llvm/tools/clang/lib/Headers/emmintrin.h head/contrib/llvm/tools/clang/lib/Headers/smmintrin.h head/contrib/llvm/tools/clang/lib/Headers/stddef.h head/contrib/llvm/tools/clang/lib/Headers/stdint.h head/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h head/contrib/llvm/tools/clang/lib/Index/CallGraph.cpp head/contrib/llvm/tools/clang/lib/Index/Entity.cpp head/contrib/llvm/tools/clang/lib/Index/EntityImpl.h head/contrib/llvm/tools/clang/lib/Index/Indexer.cpp head/contrib/llvm/tools/clang/lib/Index/Makefile 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/Makefile head/contrib/llvm/tools/clang/lib/Lex/PPCaching.cpp head/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp head/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp head/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp head/contrib/llvm/tools/clang/lib/Makefile head/contrib/llvm/tools/clang/lib/Parse/AttributeList.cpp head/contrib/llvm/tools/clang/lib/Parse/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Parse/DeclSpec.cpp head/contrib/llvm/tools/clang/lib/Parse/Makefile 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/ParseInit.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp head/contrib/llvm/tools/clang/lib/Parse/ParsePragma.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/Parser.cpp head/contrib/llvm/tools/clang/lib/Parse/RAIIObjectsForParser.h head/contrib/llvm/tools/clang/lib/Rewrite/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Rewrite/Makefile head/contrib/llvm/tools/clang/lib/Rewrite/RewriteRope.cpp head/contrib/llvm/tools/clang/lib/Rewrite/Rewriter.cpp head/contrib/llvm/tools/clang/lib/Sema/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp head/contrib/llvm/tools/clang/lib/Sema/Lookup.h head/contrib/llvm/tools/clang/lib/Sema/Makefile head/contrib/llvm/tools/clang/lib/Sema/Sema.cpp head/contrib/llvm/tools/clang/lib/Sema/Sema.h head/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCXXCast.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.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/SemaExprObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaInit.h 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/SemaStmt.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.h 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/SemaType.cpp head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h head/contrib/llvm/tools/clang/tools/Makefile head/contrib/llvm/tools/clang/tools/c-index-test/Makefile head/contrib/llvm/tools/clang/tools/c-index-test/c-index-test.c head/contrib/llvm/tools/clang/tools/driver/CMakeLists.txt head/contrib/llvm/tools/clang/tools/driver/Makefile 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/libclang/CIndex.cpp head/contrib/llvm/tools/clang/tools/libclang/CIndexCodeCompletion.cpp head/contrib/llvm/tools/clang/tools/libclang/CIndexer.cpp head/contrib/llvm/tools/clang/tools/libclang/CMakeLists.txt head/contrib/llvm/tools/clang/tools/libclang/CXCursor.cpp head/contrib/llvm/tools/clang/tools/libclang/CXSourceLocation.h head/contrib/llvm/tools/clang/tools/libclang/CXTypes.cpp head/contrib/llvm/tools/clang/tools/libclang/Makefile head/contrib/llvm/tools/clang/tools/libclang/libclang.darwin.exports head/contrib/llvm/tools/clang/tools/libclang/libclang.exports head/contrib/llvm/tools/clang/tools/scan-build/ccc-analyzer head/contrib/llvm/tools/clang/utils/TestUtils/pch-test.pl head/contrib/llvm/tools/edis/EDDisassembler.cpp head/contrib/llvm/tools/edis/Makefile head/contrib/llvm/tools/gold/gold-plugin.cpp head/contrib/llvm/tools/llc/llc.cpp head/contrib/llvm/tools/llvm-extract/llvm-extract.cpp head/contrib/llvm/tools/llvm-link/llvm-link.cpp head/contrib/llvm/tools/llvm-mc/Makefile head/contrib/llvm/tools/llvm-mc/llvm-mc.cpp head/contrib/llvm/tools/llvm-nm/llvm-nm.cpp head/contrib/llvm/tools/llvmc/plugins/Base/Base.td.in head/contrib/llvm/tools/lto/LTOCodeGenerator.cpp head/contrib/llvm/tools/opt/GraphPrinters.cpp head/contrib/llvm/tools/opt/PrintSCC.cpp head/contrib/llvm/tools/opt/opt.cpp head/contrib/llvm/utils/FileUpdate/FileUpdate.cpp head/contrib/llvm/utils/NewNightlyTest.pl head/contrib/llvm/utils/TableGen/ARMDecoderEmitter.cpp head/contrib/llvm/utils/TableGen/ARMDecoderEmitter.h head/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/CMakeLists.txt head/contrib/llvm/utils/TableGen/ClangASTNodesEmitter.cpp head/contrib/llvm/utils/TableGen/ClangASTNodesEmitter.h head/contrib/llvm/utils/TableGen/CodeEmitterGen.cpp head/contrib/llvm/utils/TableGen/CodeGenInstruction.cpp head/contrib/llvm/utils/TableGen/CodeGenTarget.cpp head/contrib/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/EDEmitter.cpp head/contrib/llvm/utils/TableGen/FastISelEmitter.cpp head/contrib/llvm/utils/TableGen/InstrInfoEmitter.cpp head/contrib/llvm/utils/TableGen/Record.cpp head/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp head/contrib/llvm/utils/TableGen/TGParser.cpp head/contrib/llvm/utils/TableGen/TGParser.h head/contrib/llvm/utils/TableGen/TableGen.cpp head/contrib/llvm/utils/TableGen/X86RecognizableInstr.cpp head/contrib/llvm/utils/TableGen/X86RecognizableInstr.h head/contrib/llvm/utils/buildit/GNUmakefile head/contrib/llvm/utils/buildit/build_llvm head/contrib/llvm/utils/count/count.c head/contrib/llvm/utils/lit/lit/TestRunner.py head/contrib/llvm/utils/unittest/UnitTestMain/Makefile head/contrib/llvm/utils/unittest/googletest/Makefile head/contrib/llvm/utils/unittest/googletest/README.LLVM head/contrib/llvm/utils/unittest/googletest/gtest-death-test.cc head/contrib/llvm/utils/unittest/googletest/gtest-filepath.cc head/contrib/llvm/utils/unittest/googletest/gtest-port.cc head/contrib/llvm/utils/unittest/googletest/gtest-test-part.cc head/contrib/llvm/utils/unittest/googletest/gtest-typed-test.cc head/contrib/llvm/utils/unittest/googletest/gtest.cc head/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-death-test.h head/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-message.h head/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-param-test.h head/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-spi.h head/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-test-part.h head/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-typed-test.h head/contrib/llvm/utils/unittest/googletest/include/gtest/gtest.h head/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h head/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h head/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h head/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h head/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-linked_ptr.h head/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util-generated.h head/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h head/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h head/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-string.h head/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-type-util.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/llvm/Config/AsmParsers.def head/lib/clang/include/llvm/Config/AsmPrinters.def head/lib/clang/include/llvm/Config/Disassemblers.def head/lib/clang/include/llvm/Config/Targets.def head/lib/clang/libclanganalysis/Makefile head/lib/clang/libclangast/Makefile head/lib/clang/libclangbasic/Makefile head/lib/clang/libclangchecker/Makefile head/lib/clang/libclangcodegen/Makefile head/lib/clang/libclangdriver/Makefile head/lib/clang/libclangfrontend/Makefile head/lib/clang/libclanglex/Makefile head/lib/clang/libclangparse/Makefile head/lib/clang/libclangrewrite/Makefile head/lib/clang/libclangsema/Makefile head/lib/clang/libllvmanalysis/Makefile head/lib/clang/libllvmarmasmparser/Makefile head/lib/clang/libllvmarmasmprinter/Makefile head/lib/clang/libllvmarmcodegen/Makefile head/lib/clang/libllvmarminfo/Makefile head/lib/clang/libllvmasmprinter/Makefile head/lib/clang/libllvmbitreader/Makefile head/lib/clang/libllvmbitwriter/Makefile head/lib/clang/libllvmcodegen/Makefile head/lib/clang/libllvmcore/Makefile head/lib/clang/libllvminstcombine/Makefile head/lib/clang/libllvmipa/Makefile head/lib/clang/libllvmipo/Makefile head/lib/clang/libllvmmc/Makefile head/lib/clang/libllvmmcparser/Makefile head/lib/clang/libllvmmipsasmprinter/Makefile head/lib/clang/libllvmmipscodegen/Makefile head/lib/clang/libllvmmipsinfo/Makefile head/lib/clang/libllvmpowerpcasmprinter/Makefile head/lib/clang/libllvmpowerpccodegen/Makefile head/lib/clang/libllvmpowerpcinfo/Makefile head/lib/clang/libllvmscalaropts/Makefile head/lib/clang/libllvmselectiondag/Makefile head/lib/clang/libllvmsupport/Makefile head/lib/clang/libllvmsystem/Makefile head/lib/clang/libllvmtarget/Makefile head/lib/clang/libllvmtransformutils/Makefile head/lib/clang/libllvmx86asmparser/Makefile head/lib/clang/libllvmx86asmprinter/Makefile head/lib/clang/libllvmx86codegen/Makefile head/lib/clang/libllvmx86info/Makefile head/usr.bin/clang/clang/Makefile head/usr.bin/clang/tblgen/Makefile Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Jul 20 15:48:29 2010 (r210298) +++ head/ObsoleteFiles.inc Tue Jul 20 17:16:57 2010 (r210299) @@ -14,6 +14,14 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100720: new clang import which bumps version from 2.0 to 2.8 +OLD_FILES+=usr/include/clang/2.0/emmintrin.h +OLD_FILES+=usr/include/clang/2.0/mm_malloc.h +OLD_FILES+=usr/include/clang/2.0/mmintrin.h +OLD_FILES+=usr/include/clang/2.0/pmmintrin.h +OLD_FILES+=usr/include/clang/2.0/tmmintrin.h +OLD_FILES+=usr/include/clang/2.0/xmmintrin.h +OLD_DIRS+=usr/include/clang/2.0 # 20100706: removed pc-sysinstall's detect-vmware.sh OLD_FILES+=usr/share/pc-sysinstall/backend-query/detect-vmware.sh # 20100701: [powerpc] removed Modified: head/contrib/llvm/CMakeLists.txt ============================================================================== --- head/contrib/llvm/CMakeLists.txt Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/CMakeLists.txt Tue Jul 20 17:16:57 2010 (r210299) @@ -4,7 +4,7 @@ project(LLVM) cmake_minimum_required(VERSION 2.6.1) set(PACKAGE_NAME llvm) -set(PACKAGE_VERSION 2.7svn) +set(PACKAGE_VERSION 2.8svn) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu") Modified: head/contrib/llvm/Makefile ============================================================================== --- head/contrib/llvm/Makefile Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/Makefile Tue Jul 20 17:16:57 2010 (r210299) @@ -64,7 +64,7 @@ endif ifeq ($(MAKECMDGOALS),install-clang) DIRS := tools/clang/tools/driver tools/clang/lib/Headers \ - tools/clang/lib/Runtime tools/clang/docs + tools/clang/runtime tools/clang/docs OPTIONAL_DIRS := NO_INSTALL = 1 endif @@ -180,8 +180,8 @@ $(FilesToConfigPATH) : $(LLVM_OBJ_ROOT)/ # that it gets executed last. ifneq ($(BUILD_DIRS_ONLY),1) all:: - $(Echo) '*****' Completed $(BuildMode)$(AssertMode) Build -ifeq ($(BuildMode),Debug) + $(Echo) '*****' Completed $(BuildMode) Build +ifneq ($(ENABLE_OPTIMIZED),1) $(Echo) '*****' Note: Debug build can be 10 times slower than an $(Echo) '*****' optimized build. Use 'make ENABLE_OPTIMIZED=1' to $(Echo) '*****' make an optimized build. Alternatively you can Modified: head/contrib/llvm/Makefile.config.in ============================================================================== --- head/contrib/llvm/Makefile.config.in Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/Makefile.config.in Tue Jul 20 17:16:57 2010 (r210299) @@ -222,8 +222,8 @@ RDYNAMIC := @RDYNAMIC@ # When ENABLE_PROFILING is enabled, profile instrumentation is done # and output is put into the "+Profile" directories, where -# is either Debug or Release depending on how other builkd -# flags are set.. Otherwise, output is put in the +# is either Debug or Release depending on how other build +# flags are set. Otherwise, output is put in the # directories. #ENABLE_PROFILING = 1 @ENABLE_PROFILING@ @@ -320,12 +320,6 @@ endif # Location of the plugin header file for gold. BINUTILS_INCDIR := @BINUTILS_INCDIR@ -C_INCLUDE_DIRS := @C_INCLUDE_DIRS@ -CXX_INCLUDE_ROOT := @CXX_INCLUDE_ROOT@ -CXX_INCLUDE_ARCH := @CXX_INCLUDE_ARCH@ -CXX_INCLUDE_32BIT_DIR = @CXX_INCLUDE_32BIT_DIR@ -CXX_INCLUDE_64BIT_DIR = @CXX_INCLUDE_64BIT_DIR@ - # When ENABLE_LLVMC_DYNAMIC is enabled, LLVMC will link libCompilerDriver # dynamically. This is needed to make dynamic plugins work on some targets # (Windows). @@ -344,5 +338,5 @@ NO_MISSING_FIELD_INITIALIZERS = @NO_MISS NO_VARIADIC_MACROS = @NO_VARIADIC_MACROS@ # Flags supported by the linker. -# bfd ld / gold -retain-symbols-file file -HAVE_LINK_RETAIN_SYMBOLS_FILE = @HAVE_LINK_RETAIN_SYMBOLS_FILE@ +# bfd ld / gold --version-script=file +HAVE_LINK_VERSION_SCRIPT = @HAVE_LINK_VERSION_SCRIPT@ Modified: head/contrib/llvm/Makefile.rules ============================================================================== --- head/contrib/llvm/Makefile.rules Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/Makefile.rules Tue Jul 20 17:16:57 2010 (r210299) @@ -42,7 +42,7 @@ VPATH=$(PROJ_SRC_DIR) # Reset the list of suffixes we know how to build. #-------------------------------------------------------------------- .SUFFIXES: -.SUFFIXES: .c .cpp .cc .h .hpp .o .a .bc .td .ps .dot .ll +.SUFFIXES: .c .cpp .cc .h .hpp .o .a .bc .td .ps .dot .ll .m .mm .SUFFIXES: $(SHLIBEXT) $(SUFFIXES) #-------------------------------------------------------------------- @@ -398,12 +398,11 @@ endif # If DISABLE_ASSERTIONS=1 is specified (make command line or configured), # then disable assertions by defining the appropriate preprocessor symbols. -ifdef DISABLE_ASSERTIONS - # Indicate that assertions are turned off using a minus sign - BuildMode := $(BuildMode)-Asserts - CPP.Defines += -DNDEBUG -else +ifndef DISABLE_ASSERTIONS + BuildMode := $(BuildMode)+Asserts CPP.Defines += -D_DEBUG +else + CPP.Defines += -DNDEBUG endif # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or @@ -633,7 +632,12 @@ ifdef TOOLNAME endif endif endif +else +ifneq ($(DARWIN_MAJVERS),4) + LD.Flags += $(RPATH) -Wl,@executable_path/../lib endif +endif + #---------------------------------------------------------- # Options To Invoke Tools @@ -807,7 +811,8 @@ SubDirs += $(DIRS) ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) $(RecursiveTargets):: $(Verb) for dir in $(DIRS); do \ - if [ ! -f $$dir/Makefile ]; then \ + if ([ ! -f $$dir/Makefile ] || \ + command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \ $(MKDIR) $$dir; \ $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ fi; \ @@ -829,7 +834,8 @@ endif ifdef EXPERIMENTAL_DIRS $(RecursiveTargets):: $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \ - if [ ! -f $$dir/Makefile ]; then \ + if ([ ! -f $$dir/Makefile ] || \ + command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \ $(MKDIR) $$dir; \ $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ fi; \ @@ -863,7 +869,9 @@ unitcheck:: $(addsuffix /.makeunitcheck, ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T)) $(ParallelTargets) : - $(Verb) if [ ! -f $(@D)/Makefile ]; then \ + $(Verb) if ([ ! -f $(@D)/Makefile ] || \ + command test $(@D)/Makefile -ot \ + $(PROJ_SRC_DIR)/$(@D)/Makefile ); then \ $(MKDIR) $(@D); \ $(CP) $(PROJ_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \ fi; \ @@ -882,7 +890,8 @@ ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT) $(RecursiveTargets):: $(Verb) for dir in $(OPTIONAL_DIRS); do \ if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\ - if [ ! -f $$dir/Makefile ]; then \ + if ([ ! -f $$dir/Makefile ] || \ + command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \ $(MKDIR) $$dir; \ $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ fi; \ @@ -930,7 +939,7 @@ endif endif ############################################################################### -# Set up variables for building libararies +# Set up variables for building libraries ############################################################################### #--------------------------------------------------------- @@ -986,12 +995,25 @@ ifeq ($(HOST_OS),Darwin) # Darwin convention prefixes symbols with underscores. NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir - $(Verb) sed -e 's/[[:<:]]/_/' < $< > $@ + $(Verb) sed -e 's/^/_/' < $< > $@ +clean-local:: + -$(Verb) $(RM) -f $(NativeExportsFile) +else +ifeq ($(HAVE_LINK_VERSION_SCRIPT),1) +# Gold and BFD ld require a version script rather than a plain list. +NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map +$(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir + $(Verb) echo "{" > $@ + $(Verb) grep -q "\<" $< && echo " global:" >> $@ || : + $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@ + $(Verb) echo " local: *;" >> $@ + $(Verb) echo "};" >> $@ clean-local:: -$(Verb) $(RM) -f $(NativeExportsFile) else NativeExportsFile := $(EXPORTED_SYMBOL_FILE) endif +endif # Now add the linker command-line options to use the native export file. @@ -1000,8 +1022,8 @@ LLVMLibsOptions += -Wl,-exported_symbols endif # gold, bfd ld, etc. -ifeq ($(HAVE_LINK_RETAIN_SYMBOLS_FILE),1) -LLVMLibsOptions += -Wl,-retain-symbols-file,$(NativeExportsFile) +ifeq ($(HAVE_LINK_VERSION_SCRIPT),1) +LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile) endif endif @@ -1113,7 +1135,7 @@ $(LibName.SO): $(ObjectsO) $(ProjLibsPat $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS) else $(LibName.SO): $(ObjectsO) $(LibDir)/.dir - $(Echo) Linking $(BuildMode) Shared Library $(LIBRARYNAME)$(SHLIBEXT) + $(Echo) Linking $(BuildMode) Shared Library $(basename $@) $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) endif @@ -1425,6 +1447,11 @@ $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BU $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \ $(DEPEND_MOVEFILE) +$(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_SRC_DIR)/Makefile + $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG) + $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \ + $(DEPEND_MOVEFILE) + $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_SRC_DIR)/Makefile $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG) $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \ @@ -1435,6 +1462,11 @@ $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUIL $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \ $(DEPEND_MOVEFILE) +$(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_SRC_DIR)/Makefile + $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG) + $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \ + $(DEPEND_MOVEFILE) + #--------------------------------------------------------- # Create .bc files in the ObjDir directory from .cpp .cc and .c files... #--------------------------------------------------------- @@ -1453,6 +1485,12 @@ $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(B $< -o $(ObjDir)/$*.ll -S -emit-llvm ; \ $(BC_DEPEND_MOVEFILE) +$(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX) + $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)" + $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \ + $< -o $(ObjDir)/$*.ll -S -emit-llvm ; \ + $(BC_DEPEND_MOVEFILE) + $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX) $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)" $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \ @@ -1465,6 +1503,12 @@ $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUI $< -o $(ObjDir)/$*.ll -S -emit-llvm ; \ $(BC_DEPEND_MOVEFILE) +$(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC) + $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)" + $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \ + $< -o $(ObjDir)/$*.ll -S -emit-llvm ; \ + $(BC_DEPEND_MOVEFILE) + # Provide alternate rule sets if dependencies are disabled else @@ -1472,6 +1516,10 @@ $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BU $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG) $(Compile.CXX) $< -o $@ +$(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) + $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG) + $(Compile.CXX) $< -o $@ + $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG) $(Compile.CXX) $< -o $@ @@ -1480,10 +1528,18 @@ $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUIL $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG) $(Compile.C) $< -o $@ +$(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) + $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG) + $(Compile.C) $< -o $@ + $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX) $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)" $(BCCompile.CXX) $< -o $@ -S -emit-llvm +$(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX) + $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)" + $(BCCompile.CXX) $< -o $@ -S -emit-llvm + $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX) $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)" $(BCCompile.CXX) $< -o $@ -S -emit-llvm @@ -1492,6 +1548,10 @@ $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUI $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)" $(BCCompile.C) $< -o $@ -S -emit-llvm +$(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC) + $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)" + $(BCCompile.C) $< -o $@ -S -emit-llvm + endif @@ -1500,6 +1560,10 @@ $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file" $(Verb) $(Preprocess.CXX) $< -o $@ +$(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) + $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file" + $(Verb) $(Preprocess.CXX) $< -o $@ + $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file" $(Verb) $(Preprocess.CXX) $< -o $@ @@ -1508,11 +1572,19 @@ $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(B $(Echo) "Compiling $*.c for $(BuildMode) build to .i file" $(Verb) $(Preprocess.C) $< -o $@ +$(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES) + $(Echo) "Compiling $*.m for $(BuildMode) build to .i file" + $(Verb) $(Preprocess.C) $< -o $@ + $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG) $(Compile.CXX) $< -o $@ -S +$(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) + $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG) + $(Compile.CXX) $< -o $@ -S + $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG) $(Compile.CXX) $< -o $@ -S @@ -1521,6 +1593,10 @@ $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUIL $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG) $(Compile.C) $< -o $@ -S +$(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES) + $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG) + $(Compile.C) $< -o $@ -S + # make the C and C++ compilers strip debug info out of bytecode libraries. ifdef DEBUG_RUNTIME @@ -1733,7 +1809,7 @@ ifndef DISABLE_AUTO_DEPENDENCIES ifndef IS_CLEANING_TARGET # Get the list of dependency files -DependSourceFiles := $(basename $(filter %.cpp %.c %.cc, $(Sources))) +DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources))) DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d) # Include bitcode dependency files if using bitcode libraries Modified: head/contrib/llvm/autoconf/configure.ac ============================================================================== --- head/contrib/llvm/autoconf/configure.ac Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/autoconf/configure.ac Tue Jul 20 17:16:57 2010 (r210299) @@ -1039,8 +1039,8 @@ AC_LINK_USE_R dnl Determine whether the linker supports the -export-dynamic option. AC_LINK_EXPORT_DYNAMIC -dnl Determine whether the linker supports the -retain-symbols-file option. -AC_LINK_RETAIN_SYMBOLS_FILE +dnl Determine whether the linker supports the --version-script option. +AC_LINK_VERSION_SCRIPT dnl Check for libtool and the library that has dlopen function (which must come dnl before the AC_PROG_LIBTOOL check in order to enable dlopening libraries with @@ -1284,6 +1284,9 @@ if test "$llvm_cv_enable_libffi" = "yes" AC_CHECK_HEADERS([ffi.h ffi/ffi.h]) fi +dnl Try to find Darwin specific crash reporting library. +AC_CHECK_HEADERS([CrashReporterClient.h]) + dnl===-----------------------------------------------------------------------=== dnl=== dnl=== SECTION 7: Check for types and structures Modified: head/contrib/llvm/autoconf/m4/link_options.m4 ============================================================================== --- head/contrib/llvm/autoconf/m4/link_options.m4 Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/autoconf/m4/link_options.m4 Tue Jul 20 17:16:57 2010 (r210299) @@ -40,14 +40,14 @@ if test "$llvm_cv_link_use_export_dynami ]) # -# Determine if the system can handle the -retain-symbols-file option being +# Determine if the system can handle the --version-script option being # passed to the linker. # # This macro is specific to LLVM. # -AC_DEFUN([AC_LINK_RETAIN_SYMBOLS_FILE], -[AC_CACHE_CHECK([for compiler -Wl,-retain-symbols-file option], - [llvm_cv_link_use_retain_symbols_file], +AC_DEFUN([AC_LINK_VERSION_SCRIPT], +[AC_CACHE_CHECK([for compiler -Wl,--version-script option], + [llvm_cv_link_use_version_script], [ AC_LANG_PUSH([C]) oldcflags="$CFLAGS" @@ -67,18 +67,21 @@ AC_DEFUN([AC_LINK_RETAIN_SYMBOLS_FILE], (umask 077 && mkdir "$tmp") } || exit $? - echo "main" > "$tmp/exports" + echo "{" > "$tmp/export.map" + echo " global: main;" >> "$tmp/export.map" + echo " local: *;" >> "$tmp/export.map" + echo "};" >> "$tmp/export.map" - CFLAGS="$CFLAGS -Wl,-retain-symbols-file=$tmp/exports" + CFLAGS="$CFLAGS -Wl,--version-script=$tmp/export.map" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])], - [llvm_cv_link_use_retain_symbols_file=yes],[llvm_cv_link_use_retain_symbols_file=no]) - rm "$tmp/exports" + [llvm_cv_link_use_version_script=yes],[llvm_cv_link_use_version_script=no]) + rm "$tmp/export.map" rmdir "$tmp" CFLAGS="$oldcflags" AC_LANG_POP([C]) ]) -if test "$llvm_cv_link_use_retain_symbols_file" = yes ; then - AC_SUBST(HAVE_LINK_RETAIN_SYMBOLS_FILE,1) +if test "$llvm_cv_link_use_version_script" = yes ; then + AC_SUBST(HAVE_LINK_VERSION_SCRIPT,1) fi ]) Modified: head/contrib/llvm/bindings/ada/llvm/llvm.ads ============================================================================== --- head/contrib/llvm/bindings/ada/llvm/llvm.ads Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/bindings/ada/llvm/llvm.ads Tue Jul 20 17:16:57 2010 (r210299) @@ -316,7 +316,8 @@ package llvm is LLVMExternalWeakLinkage, LLVMGhostLinkage, LLVMCommonLinkage, - LLVMLinkerPrivateLinkage); + LLVMLinkerPrivateLinkage, + LLVMLinkerPrivateWeakLinkage); for LLVMLinkage use (LLVMExternalLinkage => 0, @@ -333,7 +334,8 @@ package llvm is LLVMExternalWeakLinkage => 11, LLVMGhostLinkage => 12, LLVMCommonLinkage => 13, - LLVMLinkerPrivateLinkage => 14); + LLVMLinkerPrivateLinkage => 14, + LLVMLinkerPrivateWeakLinkage => 15); pragma Convention (C, LLVMLinkage); Modified: head/contrib/llvm/configure ============================================================================== --- head/contrib/llvm/configure Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/configure Tue Jul 20 17:16:57 2010 (r210299) @@ -752,7 +752,7 @@ OCAMLOPT OCAMLDEP OCAMLDOC GAS -HAVE_LINK_RETAIN_SYMBOLS_FILE +HAVE_LINK_VERSION_SCRIPT INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE @@ -8905,9 +8905,9 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for compiler -Wl,-retain-symbols-file option" >&5 -echo $ECHO_N "checking for compiler -Wl,-retain-symbols-file option... $ECHO_C" >&6; } -if test "${llvm_cv_link_use_retain_symbols_file+set}" = set; then +{ echo "$as_me:$LINENO: checking for compiler -Wl,--version-script option" >&5 +echo $ECHO_N "checking for compiler -Wl,--version-script option... $ECHO_C" >&6; } +if test "${llvm_cv_link_use_version_script+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c @@ -8934,9 +8934,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu (umask 077 && mkdir "$tmp") } || exit $? - echo "main" > "$tmp/exports" + echo "{" > "$tmp/export.map" + echo " global: main;" >> "$tmp/export.map" + echo " local: *;" >> "$tmp/export.map" + echo "};" >> "$tmp/export.map" - CFLAGS="$CFLAGS -Wl,-retain-symbols-file=$tmp/exports" + CFLAGS="$CFLAGS -Wl,--version-script=$tmp/export.map" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8986,17 +8989,17 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - llvm_cv_link_use_retain_symbols_file=yes + llvm_cv_link_use_version_script=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - llvm_cv_link_use_retain_symbols_file=no + llvm_cv_link_use_version_script=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - rm "$tmp/exports" + rm "$tmp/export.map" rmdir "$tmp" CFLAGS="$oldcflags" ac_ext=c @@ -9007,10 +9010,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $llvm_cv_link_use_retain_symbols_file" >&5 -echo "${ECHO_T}$llvm_cv_link_use_retain_symbols_file" >&6; } -if test "$llvm_cv_link_use_retain_symbols_file" = yes ; then - HAVE_LINK_RETAIN_SYMBOLS_FILE=1 +{ echo "$as_me:$LINENO: result: $llvm_cv_link_use_version_script" >&5 +echo "${ECHO_T}$llvm_cv_link_use_version_script" >&6; } +if test "$llvm_cv_link_use_version_script" = yes ; then + HAVE_LINK_VERSION_SCRIPT=1 fi @@ -11384,7 +11387,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to llvmbugs@cs.uiuc.edu ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + { echo "$as_me:$LINENO: checking for HUGE_VAL sanity" >&5 @@ -21297,7 +21470,7 @@ OCAMLOPT!$OCAMLOPT$ac_delim OCAMLDEP!$OCAMLDEP$ac_delim OCAMLDOC!$OCAMLDOC$ac_delim GAS!$GAS$ac_delim -HAVE_LINK_RETAIN_SYMBOLS_FILE!$HAVE_LINK_RETAIN_SYMBOLS_FILE$ac_delim +HAVE_LINK_VERSION_SCRIPT!$HAVE_LINK_VERSION_SCRIPT$ac_delim INSTALL_LTDL_TRUE!$INSTALL_LTDL_TRUE$ac_delim INSTALL_LTDL_FALSE!$INSTALL_LTDL_FALSE$ac_delim CONVENIENCE_LTDL_TRUE!$CONVENIENCE_LTDL_TRUE$ac_delim Modified: head/contrib/llvm/include/llvm-c/Core.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Core.h Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/include/llvm-c/Core.h Tue Jul 20 17:16:57 2010 (r210299) @@ -226,7 +226,8 @@ typedef enum { LLVMExternalWeakLinkage,/**< ExternalWeak linkage description */ LLVMGhostLinkage, /**< Obsolete */ LLVMCommonLinkage, /**< Tentative definitions */ - LLVMLinkerPrivateLinkage /**< Like Private, but linker removes. */ + LLVMLinkerPrivateLinkage, /**< Like Private, but linker removes. */ + LLVMLinkerPrivateWeakLinkage /**< Like LinkerPrivate, but is weak. */ } LLVMLinkage; typedef enum { Modified: head/contrib/llvm/include/llvm-c/Target.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Target.h Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/include/llvm-c/Target.h Tue Jul 20 17:16:57 2010 (r210299) @@ -32,7 +32,8 @@ typedef struct LLVMOpaqueTargetData *LLV typedef struct LLVMStructLayout *LLVMStructLayoutRef; /* Declare all of the target-initialization functions that are available. */ -#define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##TargetInfo(void); +#define LLVM_TARGET(TargetName) \ + void LLVMInitialize##TargetName##TargetInfo(void); #include "llvm/Config/Targets.def" #undef LLVM_TARGET /* Explicit undef to make SWIG happier */ Modified: head/contrib/llvm/include/llvm-c/lto.h ============================================================================== --- head/contrib/llvm/include/llvm-c/lto.h Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/include/llvm-c/lto.h Tue Jul 20 17:16:57 2010 (r210299) @@ -102,7 +102,7 @@ lto_module_is_object_file_in_memory(cons */ extern bool lto_module_is_object_file_in_memory_for_target(const void* mem, size_t length, - const char* target_triple_prefix); + const char* target_triple_prefix); /** Modified: head/contrib/llvm/include/llvm/ADT/APFloat.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/APFloat.h Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/include/llvm/ADT/APFloat.h Tue Jul 20 17:16:57 2010 (r210299) @@ -179,7 +179,7 @@ namespace llvm { // Constructors. APFloat(const fltSemantics &); // Default construct to 0.0 - APFloat(const fltSemantics &, const StringRef &); + APFloat(const fltSemantics &, StringRef); APFloat(const fltSemantics &, integerPart); APFloat(const fltSemantics &, fltCategory, bool negative); APFloat(const fltSemantics &, uninitializedTag); @@ -282,7 +282,7 @@ namespace llvm { bool, roundingMode); opStatus convertFromZeroExtendedInteger(const integerPart *, unsigned int, bool, roundingMode); - opStatus convertFromString(const StringRef&, roundingMode); + opStatus convertFromString(StringRef, roundingMode); APInt bitcastToAPInt() const; double convertToDouble() const; float convertToFloat() const; @@ -386,8 +386,8 @@ namespace llvm { roundingMode, bool *) const; opStatus convertFromUnsignedParts(const integerPart *, unsigned int, roundingMode); - opStatus convertFromHexadecimalString(const StringRef&, roundingMode); - opStatus convertFromDecimalString (const StringRef&, roundingMode); + opStatus convertFromHexadecimalString(StringRef, roundingMode); + opStatus convertFromDecimalString(StringRef, roundingMode); char *convertNormalToHexString(char *, unsigned int, bool, roundingMode) const; opStatus roundSignificandWithExponent(const integerPart *, unsigned int, Modified: head/contrib/llvm/include/llvm/ADT/APInt.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/APInt.h Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/include/llvm/ADT/APInt.h Tue Jul 20 17:16:57 2010 (r210299) @@ -162,7 +162,7 @@ class APInt { /// /// @param radix 2, 8, 10, or 16 /// @brief Convert a char array into an APInt - void fromString(unsigned numBits, const StringRef &str, uint8_t radix); + void fromString(unsigned numBits, StringRef str, uint8_t radix); /// This is used by the toString method to divide by the radix. It simply /// provides a more convenient form of divide for internal use since KnuthDiv @@ -248,7 +248,7 @@ public: /// @param str the string to be interpreted /// @param radix the radix to use for the conversion /// @brief Construct an APInt from a string representation. - APInt(unsigned numBits, const StringRef &str, uint8_t radix); + APInt(unsigned numBits, StringRef str, uint8_t radix); /// Simply makes *this a copy of that. /// @brief Copy Constructor. @@ -1153,7 +1153,7 @@ public: /// This method determines how many bits are required to hold the APInt /// equivalent of the string given by \arg str. /// @brief Get bits required for string value. - static unsigned getBitsNeeded(const StringRef& str, uint8_t radix); + static unsigned getBitsNeeded(StringRef str, uint8_t radix); /// countLeadingZeros - This function is an APInt version of the /// countLeadingZeros_{32,64} functions in MathExtras.h. It counts the number Copied: head/contrib/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h (from r210288, vendor/llvm/dist/include/llvm/ADT/DAGDeltaAlgorithm.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h Tue Jul 20 17:16:57 2010 (r210299, copy of r210288, vendor/llvm/dist/include/llvm/ADT/DAGDeltaAlgorithm.h) @@ -0,0 +1,75 @@ +//===--- DAGDeltaAlgorithm.h - A DAG Minimization Algorithm ----*- C++ -*--===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ADT_DAGDELTAALGORITHM_H +#define LLVM_ADT_DAGDELTAALGORITHM_H + +#include +#include + +namespace llvm { + +/// DAGDeltaAlgorithm - Implements a "delta debugging" algorithm for minimizing +/// directed acyclic graphs using a predicate function. +/// +/// The result of the algorithm is a subset of the input change set which is +/// guaranteed to satisfy the predicate, assuming that the input set did. For +/// well formed predicates, the result set is guaranteed to be such that +/// removing any single element not required by the dependencies on the other +/// elements would falsify the predicate. +/// +/// The DAG should be used to represent dependencies in the changes which are +/// likely to hold across the predicate function. That is, for a particular +/// changeset S and predicate P: +/// +/// P(S) => P(S union pred(S)) +/// +/// The minization algorithm uses this dependency information to attempt to +/// eagerly prune large subsets of changes. As with \see DeltaAlgorithm, the DAG +/// is not required to satisfy this property, but the algorithm will run +/// substantially fewer tests with appropriate dependencies. \see DeltaAlgorithm +/// for more information on the properties which the predicate function itself +/// should satisfy. +class DAGDeltaAlgorithm { +public: + typedef unsigned change_ty; + typedef std::pair edge_ty; + + // FIXME: Use a decent data structure. + typedef std::set changeset_ty; + typedef std::vector changesetlist_ty; + +public: + virtual ~DAGDeltaAlgorithm() {} + + /// Run - Minimize the DAG formed by the \arg Changes vertices and the \arg + /// Dependencies edges by executing \see ExecuteOneTest() on subsets of + /// changes and returning the smallest set which still satisfies the test + /// predicate and the input \arg Dependencies. + /// + /// \param Changes The list of changes. + /// + /// \param Dependencies The list of dependencies amongst changes. For each + /// (x,y) in \arg Dependencies, both x and y must be in \arg Changes. The + /// minimization algorithm guarantees that for each tested changed set S, x + /// \in S implies y \in S. It is an error to have cyclic dependencies. + changeset_ty Run(const changeset_ty &Changes, + const std::vector &Dependencies); + + /// UpdatedSearchState - Callback used when the search state changes. + virtual void UpdatedSearchState(const changeset_ty &Changes, + const changesetlist_ty &Sets, + const changeset_ty &Required) {} + + /// ExecuteOneTest - Execute a single test predicate on the change set \arg S. + virtual bool ExecuteOneTest(const changeset_ty &S) = 0; +}; + +} // end namespace llvm + +#endif Modified: head/contrib/llvm/include/llvm/ADT/DenseMap.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/DenseMap.h Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/include/llvm/ADT/DenseMap.h Tue Jul 20 17:16:57 2010 (r210299) @@ -22,6 +22,7 @@ #include #include #include +#include #include namespace llvm { Modified: head/contrib/llvm/include/llvm/ADT/EquivalenceClasses.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/EquivalenceClasses.h Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/include/llvm/ADT/EquivalenceClasses.h Tue Jul 20 17:16:57 2010 (r210299) @@ -169,7 +169,7 @@ public: /// getOrInsertLeaderValue - Return the leader for the specified value that is /// in the set. If the member is not in the set, it is inserted, then /// returned. - const ElemTy &getOrInsertLeaderValue(const ElemTy &V) const { + const ElemTy &getOrInsertLeaderValue(const ElemTy &V) { member_iterator MI = findLeader(insert(V)); assert(MI != member_end() && "Value is not in the set!"); return *MI; Modified: head/contrib/llvm/include/llvm/ADT/FoldingSet.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/FoldingSet.h Tue Jul 20 15:48:29 2010 (r210298) +++ head/contrib/llvm/include/llvm/ADT/FoldingSet.h Tue Jul 20 17:16:57 2010 (r210299) @@ -166,6 +166,14 @@ public: /// FindNodeOrInsertPos. void InsertNode(Node *N, void *InsertPos); + /// InsertNode - Insert the specified node into the folding set, knowing that + /// it is not already in the folding set. + void InsertNode(Node *N) { + Node *Inserted = GetOrInsertNode(N); + (void)Inserted; + assert(Inserted == N && "Node already inserted!"); + } + /// size - Returns the number of nodes in the folding set. unsigned size() const { return NumNodes; } @@ -196,6 +204,10 @@ protected: template struct FoldingSetTrait { static inline void Profile(const T& X, FoldingSetNodeID& ID) { X.Profile(ID);} static inline void Profile(T& X, FoldingSetNodeID& ID) { X.Profile(ID); } + template + static inline void Profile(T &X, FoldingSetNodeID &ID, Ctx Context) { + X.Profile(ID, Context); + } }; //===--------------------------------------------------------------------===// @@ -322,6 +334,77 @@ public: }; //===----------------------------------------------------------------------===// +/// ContextualFoldingSet - This template class is a further refinement +/// of FoldingSet which provides a context argument when calling +/// Profile on its nodes. Currently, that argument is fixed at +/// initialization time. +/// +/// T must be a subclass of FoldingSetNode and implement a Profile +/// function with signature +/// void Profile(llvm::FoldingSetNodeID &, Ctx); +template +class ContextualFoldingSet : public FoldingSetImpl { + // Unfortunately, this can't derive from FoldingSet because the + // construction vtable for FoldingSet requires + // FoldingSet::GetNodeProfile to be instantiated, which in turn + // requires a single-argument T::Profile(). + +private: + Ctx Context; + + /// GetNodeProfile - Each instantiatation of the FoldingSet needs to provide a + /// way to convert nodes into a unique specifier. + virtual void GetNodeProfile(FoldingSetNodeID &ID, + FoldingSetImpl::Node *N) const { + T *TN = static_cast(N); + + // We must use explicit template arguments in case Ctx is a + // reference type. + FoldingSetTrait::template Profile(*TN, ID, Context); + } + +public: + explicit ContextualFoldingSet(Ctx Context, unsigned Log2InitSize = 6) + : FoldingSetImpl(Log2InitSize), Context(Context) + {} + + Ctx getContext() const { return Context; } + + + typedef FoldingSetIterator iterator; + iterator begin() { return iterator(Buckets); } + iterator end() { return iterator(Buckets+NumBuckets); } + + typedef FoldingSetIterator const_iterator; + const_iterator begin() const { return const_iterator(Buckets); } + const_iterator end() const { return const_iterator(Buckets+NumBuckets); } + + typedef FoldingSetBucketIterator bucket_iterator; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 17:42:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 746EB106567B; Tue, 20 Jul 2010 17:42:13 +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 6365E8FC21; Tue, 20 Jul 2010 17:42:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KHgDTR063253; Tue, 20 Jul 2010 17:42:13 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KHgDa2063251; Tue, 20 Jul 2010 17:42:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201007201742.o6KHgDa2063251@svn.freebsd.org> From: Xin LI Date: Tue, 20 Jul 2010 17:42: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: r210300 - head/usr.sbin/watchdogd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Jul 2010 17:42:13 -0000 Author: delphij Date: Tue Jul 20 17:42:13 2010 New Revision: 210300 URL: http://svn.freebsd.org/changeset/base/210300 Log: Staticify local variables. While I'm there also add a 'static' keyword for a function to make it consistent with prototype. Reviewed by: phk MFC after: 3 months Modified: head/usr.sbin/watchdogd/watchdogd.c Modified: head/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.c Tue Jul 20 17:16:57 2010 (r210299) +++ head/usr.sbin/watchdogd/watchdogd.c Tue Jul 20 17:42:13 2010 (r210300) @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 2003-2004 Sean M. Kelly * All rights reserved. * @@ -58,17 +58,15 @@ static int watchdog_onoff(int onoff); static int watchdog_patpat(u_int timeout); static void usage(void); -int debugging = 0; -int end_program = 0; -const char *pidfile = _PATH_VARRUN "watchdogd.pid"; -int reset_mib[3]; -size_t reset_miblen = 3; -u_int timeout = WD_TO_16SEC; -u_int passive = 0; -int is_daemon = 0; -int fd = -1; -int nap = 1; -char *test_cmd = NULL; +static int debugging = 0; +static int end_program = 0; +static const char *pidfile = _PATH_VARRUN "watchdogd.pid"; +static u_int timeout = WD_TO_16SEC; +static u_int passive = 0; +static int is_daemon = 0; +static int fd = -1; +static int nap = 1; +static char *test_cmd = NULL; /* * Periodically pat the watchdog, preventing it from firing. @@ -195,7 +193,7 @@ watchdog_loop(void) * Reset the watchdog timer. This function must be called periodically * to keep the watchdog from firing. */ -int +static int watchdog_patpat(u_int t) { From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 19:25:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78B58106566C; Tue, 20 Jul 2010 19:25:12 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 642C28FC18; Tue, 20 Jul 2010 19:25:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KJPCcp087051; Tue, 20 Jul 2010 19:25:12 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KJPCOC087019; Tue, 20 Jul 2010 19:25:12 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201007201925.o6KJPCOC087019@svn.freebsd.org> From: Juli Mallett Date: Tue, 20 Jul 2010 19:25: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: r210311 - in head/sys: conf contrib/octeon-sdk mips/cavium mips/cavium/dev mips/cavium/octe mips/conf mips/include 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: Tue, 20 Jul 2010 19:25:12 -0000 Author: jmallett Date: Tue Jul 20 19:25:11 2010 New Revision: 210311 URL: http://svn.freebsd.org/changeset/base/210311 Log: Update the port of FreeBSD to Cavium Octeon to use the Cavium Simple Executive library: o) Increase inline unit / large function growth limits for MIPS to accommodate the needs of the Simple Executive, which uses a shocking amount of inlining. o) Remove TARGET_OCTEON and use CPU_CNMIPS to do things required by cnMIPS and the Octeon SoC. o) Add OCTEON_VENDOR_LANNER to use Lanner's allocation of vendor-specific board numbers, specifically to support the MR320. o) Add OCTEON_BOARD_CAPK_0100ND to hard-wire configuration for the CAPK-0100nd, which improperly uses an evaluation board's board number and breaks board detection at runtime. This board is sold by Portwell as the CAM-0100. o) Add support for the RTC available on some Octeon boards. o) Add support for the Octeon PCI bus. Note that rman_[sg]et_virtual for IO ports can not work unless building for n64. o) Clean up the CompactFlash driver to use Simple Executive macros and structures where possible (it would be advisable to use the Simple Executive API to set the PIO mode, too, but that is not done presently.) Also use structures from FreeBSD's ATA layer rather than structures copied from Linux. o) Print available Octeon SoC features on boot. o) Add support for the Octeon timecounter. o) Use the Simple Executive's routines rather than local copies for doing reads and writes to 64-bit addresses and use its macros for various device addresses rather than using local copies. o) Rename octeon_board_real to octeon_is_simulation to reduce differences with Cavium-provided code originally written for Linux. Also make it use the same simplified test that the Simple Executive and Linux both use rather than our complex one. o) Add support for the Octeon CIU, which is the main interrupt unit, as a bus to use normal interrupt allocation and setup routines. o) Use the Simple Executive's bootmem facility to allocate physical memory for the kernel, rather than assuming we know which addresses we can steal. NB: This may reduce the amount of RAM the kernel reports you as having if you are leaving large temporary allocations made by U-Boot allocated when starting FreeBSD. o) Add a port of the Cavium-provided Ethernet driver for Linux. This changes Ethernet interface naming from rgmxN to octeN. The new driver has vast improvements over the old one, both in performance and functionality, but does still have some features which have not been ported entirely and there may be unimplemented code that can be hit in everyday use. I will make every effort to correct those as they are reported. o) Support loading the kernel on non-contiguous cores. o) Add very conservative support for harvesting randomness from the Octeon random number device. o) Turn SMP on by default. o) Clean up the style of the Octeon kernel configurations a little and make them compile with -march=octeon. o) Add support for the Lanner MR320 and the CAPK-0100nd to the Simple Executive. o) Modify the Simple Executive to build on FreeBSD and to build without executive-config.h or cvmx-config.h. In the future we may want to revert part of these changes and supply executive-config.h and cvmx-config.h and access to the options contained in those files via kernel configuration files. o) Modify the Simple Executive USB routines to support getting and setting of the USB PID. Added: head/sys/mips/cavium/ciu.c (contents, props changed) head/sys/mips/cavium/cvmx_config.h (contents, props changed) head/sys/mips/cavium/octe/ head/sys/mips/cavium/octe/cavium-ethernet.h (contents, props changed) head/sys/mips/cavium/octe/ethernet-common.c (contents, props changed) head/sys/mips/cavium/octe/ethernet-common.h (contents, props changed) head/sys/mips/cavium/octe/ethernet-defines.h (contents, props changed) head/sys/mips/cavium/octe/ethernet-headers.h (contents, props changed) head/sys/mips/cavium/octe/ethernet-mdio.c (contents, props changed) head/sys/mips/cavium/octe/ethernet-mdio.h (contents, props changed) head/sys/mips/cavium/octe/ethernet-mem.c (contents, props changed) head/sys/mips/cavium/octe/ethernet-mem.h (contents, props changed) head/sys/mips/cavium/octe/ethernet-rgmii.c (contents, props changed) head/sys/mips/cavium/octe/ethernet-rx.c (contents, props changed) head/sys/mips/cavium/octe/ethernet-rx.h (contents, props changed) head/sys/mips/cavium/octe/ethernet-sgmii.c (contents, props changed) head/sys/mips/cavium/octe/ethernet-spi.c (contents, props changed) head/sys/mips/cavium/octe/ethernet-tx.c (contents, props changed) head/sys/mips/cavium/octe/ethernet-tx.h (contents, props changed) head/sys/mips/cavium/octe/ethernet-util.h (contents, props changed) head/sys/mips/cavium/octe/ethernet-xaui.c (contents, props changed) head/sys/mips/cavium/octe/ethernet.c (contents, props changed) head/sys/mips/cavium/octe/octe.c (contents, props changed) head/sys/mips/cavium/octe/octebus.c (contents, props changed) head/sys/mips/cavium/octe/octebusvar.h (contents, props changed) head/sys/mips/cavium/octe/wrapper-cvmx-includes.h (contents, props changed) head/sys/mips/cavium/octeon_ds1337.c (contents, props changed) head/sys/mips/cavium/octeon_rnd.c (contents, props changed) head/sys/mips/cavium/octeon_rtc.c (contents, props changed) head/sys/mips/cavium/octopci.c (contents, props changed) head/sys/mips/cavium/octopci_bus_space.c (contents, props changed) head/sys/mips/cavium/octopcireg.h (contents, props changed) head/sys/mips/cavium/octopcivar.h (contents, props changed) Deleted: head/sys/contrib/octeon-sdk/perfzilla_screen.png head/sys/mips/cavium/dev/ head/sys/mips/cavium/driveid.h head/sys/mips/cavium/octeon_ebt3000_cf.h Modified: head/sys/conf/kern.pre.mk head/sys/conf/options.mips head/sys/contrib/octeon-sdk/cvmx-access-native.h head/sys/contrib/octeon-sdk/cvmx-app-init.h head/sys/contrib/octeon-sdk/cvmx-asm.h head/sys/contrib/octeon-sdk/cvmx-cmd-queue.c head/sys/contrib/octeon-sdk/cvmx-cmd-queue.h head/sys/contrib/octeon-sdk/cvmx-fpa.c head/sys/contrib/octeon-sdk/cvmx-helper-board.c head/sys/contrib/octeon-sdk/cvmx-helper-errata.c head/sys/contrib/octeon-sdk/cvmx-helper-fpa.c head/sys/contrib/octeon-sdk/cvmx-helper-loop.c head/sys/contrib/octeon-sdk/cvmx-helper-npi.c head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c head/sys/contrib/octeon-sdk/cvmx-helper-sgmii.c head/sys/contrib/octeon-sdk/cvmx-helper-spi.c head/sys/contrib/octeon-sdk/cvmx-helper-util.c head/sys/contrib/octeon-sdk/cvmx-helper-util.h head/sys/contrib/octeon-sdk/cvmx-helper-xaui.c head/sys/contrib/octeon-sdk/cvmx-helper.c head/sys/contrib/octeon-sdk/cvmx-helper.h head/sys/contrib/octeon-sdk/cvmx-pko.c head/sys/contrib/octeon-sdk/cvmx-platform.h head/sys/contrib/octeon-sdk/cvmx-rtc.h head/sys/contrib/octeon-sdk/cvmx-spi.c head/sys/contrib/octeon-sdk/cvmx-thunder.c head/sys/contrib/octeon-sdk/cvmx-usb.c head/sys/contrib/octeon-sdk/cvmx-usb.h head/sys/contrib/octeon-sdk/octeon-model.h head/sys/mips/cavium/files.octeon1 head/sys/mips/cavium/obio.c head/sys/mips/cavium/octeon_ebt3000_cf.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/cavium/octeon_mp.c head/sys/mips/cavium/octeon_pcmap_regs.h head/sys/mips/cavium/std.octeon1 head/sys/mips/cavium/uart_bus_octeonusart.c head/sys/mips/cavium/uart_cpu_octeonusart.c head/sys/mips/cavium/uart_dev_oct16550.c head/sys/mips/conf/OCTEON1 head/sys/mips/conf/OCTEON1-32 head/sys/mips/conf/OCTEON1.hints head/sys/mips/include/_bus.h head/sys/mips/include/cache_mipsNN.h head/sys/mips/include/cpufunc.h head/sys/mips/include/cpuregs.h head/sys/mips/mips/bus_space_generic.c head/sys/mips/mips/cache.c head/sys/mips/mips/cache_mipsNN.c head/sys/mips/mips/cpu.c head/sys/mips/mips/exception.S head/sys/mips/mips/locore.S head/sys/mips/mips/machdep.c head/sys/mips/mips/mainbus.c head/sys/mips/mips/mpboot.S head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/support.S head/sys/mips/mips/vm_machdep.c Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/conf/kern.pre.mk Tue Jul 20 19:25:11 2010 (r210311) @@ -94,8 +94,14 @@ CFLAGS= ${COPTFLAGS} ${C_DIALECT} ${DEBU CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h .if ${CC} != "icc" CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT} +.if ${MACHINE_CPUARCH} != "mips" CFLAGS+= --param inline-unit-growth=100 CFLAGS+= --param large-function-growth=1000 +.else +# XXX Actually a gross hack just for Octeon because of the Simple Executive. +CFLAGS+= --param inline-unit-growth=1000 +CFLAGS+= --param large-function-growth=100000 +.endif WERROR?= -Werror .endif Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/conf/options.mips Tue Jul 20 19:25:11 2010 (r210311) @@ -50,7 +50,6 @@ CFE_ENV opt_global.h CFE_ENV_SIZE opt_global.h NOFPU opt_global.h -TARGET_OCTEON opt_global.h TARGET_EMULATOR opt_ddb.h TARGET_XLR_XLS opt_global.h @@ -61,3 +60,9 @@ TICK_USE_MALTA_RTC opt_global.h # The highest memory address that can be used by the kernel in units of KB. # MAXMEM opt_global.h + +# +# Options that control the Cavium Simple Executive. +# +OCTEON_VENDOR_LANNER opt_cvmx.h +OCTEON_BOARD_CAPK_0100ND opt_cvmx.h Modified: head/sys/contrib/octeon-sdk/cvmx-access-native.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-access-native.h Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-access-native.h Tue Jul 20 19:25:11 2010 (r210311) @@ -122,6 +122,8 @@ static inline uint64_t cvmx_ptr_to_phys( return address + 0x400000000ull; /* 256MB-512MB is a virtual mapping for the 2nd 256MB */ else return address; /* Looks to be a 1:1 mapped userspace pointer */ +#elif defined(__FreeBSD__) && defined(_KERNEL) + return (pmap_kextract((vm_offset_t)ptr)); #else #if CVMX_USE_1_TO_1_TLB_MAPPINGS /* We are assumung we're running the Simple Executive standalone. In this @@ -201,6 +203,15 @@ static inline void *cvmx_phys_to_ptr(uin return CASTPTR(void, physical_address - 0x400000000ull); else return CASTPTR(void, physical_address); +#elif defined(__FreeBSD__) && defined(_KERNEL) +#if defined(__mips_n64) + return CASTPTR(void, CVMX_ADD_SEG(CVMX_MIPS_SPACE_XKPHYS, physical_address)); +#else + if (physical_address < 0x20000000) + return CASTPTR(void, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, physical_address)); + else + panic("%s: mapping high address (%#jx) not yet supported.\n", __func__, (uintmax_t)physical_address); +#endif #else #if CVMX_USE_1_TO_1_TLB_MAPPINGS Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-app-init.h Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Tue Jul 20 19:25:11 2010 (r210311) @@ -194,6 +194,9 @@ enum cvmx_board_types_enum { /* Set aside a range for customer private use. The SDK won't ** use any numbers in this range. */ CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, +#if defined(OCTEON_VENDOR_LANNER) + CVMX_BOARD_TYPE_CUST_LANNER_MR320= 20002, +#endif CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000, /* The remaining range is reserved for future use. */ @@ -265,6 +268,9 @@ static inline const char *cvmx_board_typ /* Customer private range */ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) +#if defined(OCTEON_VENDOR_LANNER) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR320) +#endif ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX) } return "Unsupported Board"; Modified: head/sys/contrib/octeon-sdk/cvmx-asm.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-asm.h Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-asm.h Tue Jul 20 19:25:11 2010 (r210311) @@ -225,12 +225,12 @@ extern "C" { unsigned long _v; \ ASM_STMT ("rdhwr\t%0,$31\n" \ "\tsll\t%0,%0,0" : "=d"(_v)); \ - result = (typeof(result))_v; \ + result = (__typeof(result))_v; \ } \ } else { \ unsigned long _v; \ ASM_STMT ("rdhwr\t%0,$" CVMX_TMP_STR(regstr) : "=d"(_v)); \ - result = (typeof(result))_v; \ + result = (__typeof(result))_v; \ }}) Modified: head/sys/contrib/octeon-sdk/cvmx-cmd-queue.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-cmd-queue.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-cmd-queue.c Tue Jul 20 19:25:11 2010 (r210311) @@ -49,7 +49,6 @@ * *
$Revision: 42150 $
*/ -#include "cvmx-config.h" #include "cvmx.h" #include "cvmx-fpa.h" #include "cvmx-cmd-queue.h" Modified: head/sys/contrib/octeon-sdk/cvmx-cmd-queue.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-cmd-queue.h Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-cmd-queue.h Tue Jul 20 19:25:11 2010 (r210311) @@ -92,8 +92,10 @@ #ifndef __CVMX_CMD_QUEUE_H__ #define __CVMX_CMD_QUEUE_H__ +#ifndef CVMX_DONT_INCLUDE_CONFIG #include "executive-config.h" #include "cvmx-config.h" +#endif #include "cvmx-fpa.h" #ifdef __cplusplus @@ -168,6 +170,8 @@ typedef struct __cvmx_cmd_queue_state_t state[(CVMX_CMD_QUEUE_END>>16) * 256]; } __cvmx_cmd_queue_all_state_t; +extern CVMX_SHARED __cvmx_cmd_queue_all_state_t *__cvmx_cmd_queue_state_ptr; + /** * Initialize a command queue for use. The initial FPA buffer is * allocated and the hardware unit is configured to point to the @@ -246,7 +250,6 @@ static inline int __cvmx_cmd_queue_get_i */ static inline void __cvmx_cmd_queue_lock(cvmx_cmd_queue_id_t queue_id, __cvmx_cmd_queue_state_t *qptr) { - extern CVMX_SHARED __cvmx_cmd_queue_all_state_t *__cvmx_cmd_queue_state_ptr; int tmp; int my_ticket; CVMX_PREFETCH(qptr, 0); @@ -304,7 +307,6 @@ static inline void __cvmx_cmd_queue_unlo */ static inline __cvmx_cmd_queue_state_t *__cvmx_cmd_queue_get_state(cvmx_cmd_queue_id_t queue_id) { - extern CVMX_SHARED __cvmx_cmd_queue_all_state_t *__cvmx_cmd_queue_state_ptr; if (CVMX_ENABLE_PARAMETER_CHECKING) { if (cvmx_unlikely(queue_id >= CVMX_CMD_QUEUE_END)) Modified: head/sys/contrib/octeon-sdk/cvmx-fpa.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-fpa.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-fpa.c Tue Jul 20 19:25:11 2010 (r210311) @@ -50,7 +50,6 @@ * */ -#include "cvmx-config.h" #include "cvmx.h" #include "cvmx-fpa.h" #include "cvmx-ipd.h" Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Tue Jul 20 19:25:11 2010 (r210311) @@ -85,6 +85,26 @@ CVMX_SHARED cvmx_helper_link_info_t (*cv */ int cvmx_helper_board_get_mii_address(int ipd_port) { + /* + * Board types we have to know at compile-time. + */ +#ifdef OCTEON_BOARD_CAPK_0100ND + switch (ipd_port) { + case 0: + return 2; + case 1: + return 3; + case 2: + /* XXX Switch PHY? */ + return -1; + default: + return -1; + } +#endif + + /* + * For board types we can determine at runtime. + */ switch (cvmx_sysinfo_get()->board_type) { case CVMX_BOARD_TYPE_SIM: @@ -154,6 +174,22 @@ int cvmx_helper_board_get_mii_address(in return -1; case CVMX_BOARD_TYPE_BBGW_REF: return -1; /* No PHYs are connected to Octeon, everything is through switch */ + + /* Private vendor-defined boards. */ +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + switch (ipd_port) { + case 0: + /* XXX Switch PHY? */ + return -1; + case 1: + return 1; + case 2: + return 2; + default: + return -1; + } +#endif } /* Some unknown board. Somebody forgot to update this function... */ @@ -195,6 +231,7 @@ cvmx_helper_link_info_t __cvmx_helper_bo /* Unless we fix it later, all links are defaulted to down */ result.u64 = 0; +#if !defined(OCTEON_BOARD_CAPK_0100ND) /* This switch statement should handle all ports that either don't use Marvell PHYS, or don't support in-band status */ switch (cvmx_sysinfo_get()->board_type) @@ -248,7 +285,21 @@ cvmx_helper_link_info_t __cvmx_helper_bo return result; } break; + /* Private vendor-defined boards. */ +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + /* Port 0 connects to the switch */ + if (ipd_port == 0) + { + result.s.link_up = 1; + result.s.full_duplex = 1; + result.s.speed = 1000; + return result; + } + break; +#endif } +#endif phy_addr = cvmx_helper_board_get_mii_address(ipd_port); if (phy_addr != -1) @@ -322,7 +373,11 @@ cvmx_helper_link_info_t __cvmx_helper_bo and set the resolved bit (bit 11) */ if (phy_status & (1<<11)) { +#if defined(OCTEON_BOARD_CAPK_0100ND) + result.s.link_up = (phy_status>>10)&1; +#else result.s.link_up = 1; +#endif result.s.full_duplex = ((phy_status>>13)&1); switch ((phy_status>>14)&3) { @@ -635,6 +690,9 @@ cvmx_helper_board_usb_clock_types_t __cv { switch (cvmx_sysinfo_get()->board_type) { case CVMX_BOARD_TYPE_BBGW_REF: +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR320: +#endif return USB_CLOCK_TYPE_CRYSTAL_12; } return USB_CLOCK_TYPE_REF_48; Modified: head/sys/contrib/octeon-sdk/cvmx-helper-errata.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-errata.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-helper-errata.c Tue Jul 20 19:25:11 2010 (r210311) @@ -51,9 +51,6 @@ * *
$Revision: 42150 $
*/ -#include "executive-config.h" -#include "cvmx-config.h" - #include "cvmx.h" #include "cvmx-fpa.h" #include "cvmx-pip.h" Modified: head/sys/contrib/octeon-sdk/cvmx-helper-fpa.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-fpa.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-helper-fpa.c Tue Jul 20 19:25:11 2010 (r210311) @@ -48,8 +48,6 @@ * *
$Revision: 41586 $
*/ -#include "executive-config.h" -#include "cvmx-config.h" #include "cvmx.h" #include "cvmx-bootmem.h" #include "cvmx-fpa.h" Modified: head/sys/contrib/octeon-sdk/cvmx-helper-loop.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-loop.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-helper-loop.c Tue Jul 20 19:25:11 2010 (r210311) @@ -49,14 +49,11 @@ * *
$Revision: 41586 $
*/ -#include "executive-config.h" -#include "cvmx-config.h" -#ifdef CVMX_ENABLE_PKO_FUNCTIONS - #include "cvmx.h" #include "cvmx-helper.h" +#ifdef CVMX_ENABLE_PKO_FUNCTIONS /** * @INTERNAL * Probe a LOOP interface and determine the number of ports Modified: head/sys/contrib/octeon-sdk/cvmx-helper-npi.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-npi.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-helper-npi.c Tue Jul 20 19:25:11 2010 (r210311) @@ -49,14 +49,10 @@ * *
$Revision: 41586 $
*/ -#include "executive-config.h" -#include "cvmx-config.h" -#ifdef CVMX_ENABLE_PKO_FUNCTIONS - #include "cvmx.h" #include "cvmx-helper.h" - +#ifdef CVMX_ENABLE_PKO_FUNCTIONS /** * @INTERNAL * Probe a NPI interface and determine the number of ports Modified: head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c Tue Jul 20 19:25:11 2010 (r210311) @@ -49,10 +49,6 @@ * *
$Revision: 42417 $
*/ -#include "executive-config.h" -#include "cvmx-config.h" -#ifdef CVMX_ENABLE_PKO_FUNCTIONS - #include "cvmx.h" #include "cvmx-sysinfo.h" #include "cvmx-mdio.h" @@ -60,6 +56,7 @@ #include "cvmx-helper.h" #include "cvmx-helper-board.h" +#ifdef CVMX_ENABLE_PKO_FUNCTIONS /** * @INTERNAL * Probe RGMII ports and determine the number present @@ -202,6 +199,31 @@ int __cvmx_helper_rgmii_enable(int inter cvmx_write_csr(CVMX_GMXX_TXX_PAUSE_PKT_TIME(port, interface), 20000); cvmx_write_csr(CVMX_GMXX_TXX_PAUSE_PKT_INTERVAL(port, interface), 19000); + /* + * Board types we have to know at compile-time. + */ +#if defined(OCTEON_BOARD_CAPK_0100ND) + cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(port, interface), 26); + cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(port, interface), 26); +#else + /* + * Vendor-defined board types. + */ +#if defined(OCTEON_VENDOR_LANNER) + switch (cvmx_sysinfo_get()->board_type) { + case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + if (port == 0) { + cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(port, interface), 4); + } else { + cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(port, interface), 7); + } + cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(port, interface), 0); + break; + } +#else + /* + * For board types we can determine at runtime. + */ if (OCTEON_IS_MODEL(OCTEON_CN50XX)) { cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(port, interface), 16); @@ -212,6 +234,8 @@ int __cvmx_helper_rgmii_enable(int inter cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(port, interface), 24); cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(port, interface), 24); } +#endif +#endif } __cvmx_helper_setup_gmx(interface, num_ports); Modified: head/sys/contrib/octeon-sdk/cvmx-helper-sgmii.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-sgmii.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-helper-sgmii.c Tue Jul 20 19:25:11 2010 (r210311) @@ -49,17 +49,13 @@ * *
$Revision: 42417 $
*/ -#include "executive-config.h" -#include "cvmx-config.h" -#ifdef CVMX_ENABLE_PKO_FUNCTIONS - #include "cvmx.h" #include "cvmx-sysinfo.h" #include "cvmx-mdio.h" #include "cvmx-helper.h" #include "cvmx-helper-board.h" - +#ifdef CVMX_ENABLE_PKO_FUNCTIONS /** * @INTERNAL * Perform initialization required only once for an SGMII port. Modified: head/sys/contrib/octeon-sdk/cvmx-helper-spi.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-spi.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-helper-spi.c Tue Jul 20 19:25:11 2010 (r210311) @@ -49,15 +49,12 @@ * *
$Revision: 42417 $
*/ -#include "executive-config.h" -#include "cvmx-config.h" -#ifdef CVMX_ENABLE_PKO_FUNCTIONS - #include "cvmx.h" #include "cvmx-spi.h" #include "cvmx-sysinfo.h" #include "cvmx-helper.h" +#ifdef CVMX_ENABLE_PKO_FUNCTIONS /* CVMX_HELPER_SPI_TIMEOUT is used to determine how long the SPI initialization routines wait for SPI training. You can override the value using executive-config.h if necessary */ Modified: head/sys/contrib/octeon-sdk/cvmx-helper-util.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-util.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-helper-util.c Tue Jul 20 19:25:11 2010 (r210311) @@ -48,8 +48,6 @@ * *
$Revision: 42493 $
*/ -#include "executive-config.h" -#include "cvmx-config.h" #include "cvmx.h" #include "cvmx-bootmem.h" #include "cvmx-fpa.h" Modified: head/sys/contrib/octeon-sdk/cvmx-helper-util.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-util.h Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-helper-util.h Tue Jul 20 19:25:11 2010 (r210311) @@ -157,8 +157,6 @@ static inline int cvmx_helper_get_first_ */ static inline int cvmx_helper_get_last_ipd_port (int interface) { - extern int cvmx_helper_ports_on_interface (int interface); - return (cvmx_helper_get_first_ipd_port (interface) + cvmx_helper_ports_on_interface (interface) - 1); } Modified: head/sys/contrib/octeon-sdk/cvmx-helper-xaui.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-xaui.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-helper-xaui.c Tue Jul 20 19:25:11 2010 (r210311) @@ -49,14 +49,10 @@ * *
$Revision: 42417 $
*/ -#include "executive-config.h" -#include "cvmx-config.h" -#ifdef CVMX_ENABLE_PKO_FUNCTIONS - #include "cvmx.h" #include "cvmx-helper.h" - +#ifdef CVMX_ENABLE_PKO_FUNCTIONS /** * @INTERNAL * Probe a XAUI interface and determine the number of ports Modified: head/sys/contrib/octeon-sdk/cvmx-helper.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-helper.c Tue Jul 20 19:25:11 2010 (r210311) @@ -48,8 +48,6 @@ * *
$Revision: 42150 $
*/ -#include "executive-config.h" -#include "cvmx-config.h" #include "cvmx.h" #include "cvmx-bootmem.h" #include "cvmx-fpa.h" Modified: head/sys/contrib/octeon-sdk/cvmx-helper.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper.h Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-helper.h Tue Jul 20 19:25:11 2010 (r210311) @@ -52,8 +52,10 @@ #ifndef __CVMX_HELPER_H__ #define __CVMX_HELPER_H__ +#ifndef CVMX_DONT_INCLUDE_CONFIG #include "executive-config.h" #include "cvmx-config.h" +#endif #include "cvmx-fpa.h" #include "cvmx-wqe.h" @@ -97,7 +99,6 @@ typedef union #include "cvmx-helper-rgmii.h" #include "cvmx-helper-sgmii.h" #include "cvmx-helper-spi.h" -#include "cvmx-helper-util.h" #include "cvmx-helper-xaui.h" /** @@ -250,6 +251,8 @@ extern int cvmx_helper_interface_probe(i */ extern int cvmx_helper_configure_loopback(int ipd_port, int enable_internal, int enable_external); +#include "cvmx-helper-util.h" + #endif /* CVMX_ENABLE_PKO_FUNCTIONS */ #ifdef __cplusplus Modified: head/sys/contrib/octeon-sdk/cvmx-pko.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-pko.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-pko.c Tue Jul 20 19:25:11 2010 (r210311) @@ -48,8 +48,6 @@ * *
$Revision: 42150 $
*/ -#include "executive-config.h" -#include "cvmx-config.h" #include "cvmx.h" #include "cvmx-pko.h" #include "cvmx-sysinfo.h" Modified: head/sys/contrib/octeon-sdk/cvmx-platform.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-platform.h Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-platform.h Tue Jul 20 19:25:11 2010 (r210311) @@ -103,6 +103,8 @@ /* To build the simple exec toolchain runtime (newlib) library. We should only use features available on all Octeon models. */ #define CVMX_BUILD_FOR_TOOLCHAIN +#elif defined(__FreeBSD__) && defined(_KERNEL) + #define CVMX_BUILD_FOR_FREEBSD #else /* We are building a simple exec standalone image for Octeon */ #define CVMX_BUILD_FOR_STANDALONE @@ -117,7 +119,11 @@ * This is for data structures use by software ONLY, * as it is not 1-1 VA-PA mapped. */ +#if defined(CVMX_BUILD_FOR_FREEBSD) +#define CVMX_SHARED +#else #define CVMX_SHARED __attribute__ ((cvmx_shared)) +#endif #if defined(CVMX_BUILD_FOR_UBOOT) @@ -187,6 +193,10 @@ #include #include +#elif defined(CVMX_BUILD_FOR_FREEBSD) + + #include + #else #error Unexpected CVMX_BUILD_FOR_* macro Modified: head/sys/contrib/octeon-sdk/cvmx-rtc.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-rtc.h Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-rtc.h Tue Jul 20 19:25:11 2010 (r210311) @@ -74,7 +74,7 @@ typedef enum * * @return Supported options, or 0 if RTC is not supported */ -static inline cvmx_rtc_options_t cvmx_rtc_supported() +static inline cvmx_rtc_options_t cvmx_rtc_supported(void) { static int supported = -1; Modified: head/sys/contrib/octeon-sdk/cvmx-spi.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-spi.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-spi.c Tue Jul 20 19:25:11 2010 (r210311) @@ -48,7 +48,6 @@ * *
$Revision: 41586 $
*/ -#include "cvmx-config.h" #include "cvmx.h" #include "cvmx-mio.h" #include "cvmx-pko.h" Modified: head/sys/contrib/octeon-sdk/cvmx-thunder.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-thunder.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-thunder.c Tue Jul 20 19:25:11 2010 (r210311) @@ -50,7 +50,6 @@ * */ -#include "cvmx-config.h" #include "cvmx.h" #include "cvmx-sysinfo.h" #include "cvmx-thunder.h" @@ -121,7 +120,7 @@ int cvmx_rtc_ds1374_write(uint32_t time) return (rc ? -1 : 0); } -int cvmx_rtc_ds1374_alarm_config(int WD, int WDSTR, int AIE) +static int cvmx_rtc_ds1374_alarm_config(int WD, int WDSTR, int AIE) { int val; @@ -134,7 +133,7 @@ int cvmx_rtc_ds1374_alarm_config(int WD, return 0; } -int cvmx_rtc_ds1374_alarm_set(int alarm_on) +static int cvmx_rtc_ds1374_alarm_set(int alarm_on) { uint8_t val; @@ -152,7 +151,7 @@ int cvmx_rtc_ds1374_alarm_set(int alarm_ } -int cvmx_rtc_ds1374_alarm_counter_set(uint32_t interval) +static int cvmx_rtc_ds1374_alarm_counter_set(uint32_t interval) { int i; int rc = 0; @@ -165,7 +164,8 @@ int cvmx_rtc_ds1374_alarm_counter_set(ui return rc; } -uint32_t cvmx_rtc_ds1374_alarm_counter_get(void) +#if 0 /* XXX unused */ +static uint32_t cvmx_rtc_ds1374_alarm_counter_get(void) { int i; uint32_t interval = 0; @@ -176,6 +176,7 @@ uint32_t cvmx_rtc_ds1374_alarm_counter_g } return interval; } +#endif #ifdef CVMX_RTC_DEBUG Modified: head/sys/contrib/octeon-sdk/cvmx-usb.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-usb.c Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-usb.c Tue Jul 20 19:25:11 2010 (r210311) @@ -194,7 +194,7 @@ typedef struct /* This macro logs out when a function returns a value */ #define CVMX_USB_RETURN(v) \ do { \ - typeof(v) r = v; \ + __typeof(v) r = v; \ if (cvmx_unlikely(usb->init_flags & CVMX_USB_INITIALIZE_FLAGS_DEBUG_CALLS)) \ cvmx_dprintf("%*s%s: returned %s(%d)\n", 2*--usb->indent, "", __FUNCTION__, #v, r); \ return r; \ @@ -3648,3 +3648,20 @@ cvmx_usb_status_t cvmx_usb_device_disabl CVMX_USB_RETURN(CVMX_USB_SUCCESS); } +extern void cvmx_usb_set_toggle(cvmx_usb_state_t *state, int endpoint_num, int toggle) +{ + cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t*)state; + cvmx_usb_pipe_t *pipe = usb->pipe + endpoint_num; + + pipe->pid_toggle = !!toggle; +} + +extern int cvmx_usb_get_toggle(cvmx_usb_state_t *state, int endpoint_num) +{ + cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t*)state; + cvmx_usb_pipe_t *pipe = usb->pipe + endpoint_num; + + if (pipe->pid_toggle) + return (1); + return (0); +} Modified: head/sys/contrib/octeon-sdk/cvmx-usb.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-usb.h Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/cvmx-usb.h Tue Jul 20 19:25:11 2010 (r210311) @@ -1122,6 +1122,13 @@ extern cvmx_usb_status_t cvmx_usb_device extern cvmx_usb_status_t cvmx_usb_device_disable_endpoint(cvmx_usb_state_t *state, int endpoint_num); +/* + * The FreeBSD host driver uses these functions to manipulate the toggle to deal + * more easily with endpoint management. + */ +extern void cvmx_usb_set_toggle(cvmx_usb_state_t *state, int endpoint_num, int toggle); +extern int cvmx_usb_get_toggle(cvmx_usb_state_t *state, int endpoint_num); + #ifdef __cplusplus } #endif Modified: head/sys/contrib/octeon-sdk/octeon-model.h ============================================================================== --- head/sys/contrib/octeon-sdk/octeon-model.h Tue Jul 20 19:13:31 2010 (r210310) +++ head/sys/contrib/octeon-sdk/octeon-model.h Tue Jul 20 19:25:11 2010 (r210311) @@ -254,7 +254,7 @@ extern "C" { && (((chip_model) & OCTEON_58XX_MODEL_MASK) < ((arg_model) & OCTEON_58XX_MODEL_MASK))) \ ))) -#if defined(USE_RUNTIME_MODEL_CHECKS) || defined(__U_BOOT__) || (defined(__linux__) && defined(__KERNEL__)) +#if defined(USE_RUNTIME_MODEL_CHECKS) || defined(__U_BOOT__) || (defined(__linux__) && defined(__KERNEL__)) || (defined(__FreeBSD__) && defined(_KERNEL)) /* NOTE: This for internal use only!!!!! */ static inline int __octeon_is_model_runtime__(uint32_t model) Added: head/sys/mips/cavium/ciu.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/ciu.c Tue Jul 20 19:25:11 2010 (r210311) @@ -0,0 +1,359 @@ +/*- + * Copyright (c) 2010 Juli Mallett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +/* + * This bus sits between devices/buses and nexus and handles CIU interrupts + * and passes everything else through. It should really be a nexus subclass + * or something, but for now this will be sufficient. + */ + +#define CIU_IRQ_HARD (0) + +#define CIU_IRQ_EN0_BEGIN CVMX_IRQ_WORKQ0 +#define CIU_IRQ_EN0_END CVMX_IRQ_BOOTDMA +#define CIU_IRQ_EN0_COUNT ((CIU_IRQ_EN0_END - CIU_IRQ_EN0_BEGIN) + 1) + +#define CIU_IRQ_EN1_BEGIN CVMX_IRQ_WDOG0 +#define CIU_IRQ_EN1_END CVMX_IRQ_WDOG15 +#define CIU_IRQ_EN1_COUNT ((CIU_IRQ_EN1_END - CIU_IRQ_EN1_BEGIN) + 1) + +struct ciu_softc { + struct rman irq_rman; + struct resource *ciu_irq; +}; + +static mips_intrcnt_t ciu_en0_intrcnt[CIU_IRQ_EN0_COUNT]; +static mips_intrcnt_t ciu_en1_intrcnt[CIU_IRQ_EN1_COUNT]; + +static struct intr_event *ciu_en0_intr_events[CIU_IRQ_EN0_COUNT]; +static struct intr_event *ciu_en1_intr_events[CIU_IRQ_EN1_COUNT]; + +static int ciu_probe(device_t); +static int ciu_attach(device_t); +static struct resource *ciu_alloc_resource(device_t, device_t, int, int *, + u_long, u_long, u_long, u_int); +static int ciu_setup_intr(device_t, device_t, struct resource *, + int, driver_filter_t *, driver_intr_t *, + void *, void **); +static void ciu_hinted_child(device_t, const char *, int); + +static void ciu_en0_intr_mask(void *); +static void ciu_en0_intr_unmask(void *); + +static void ciu_en1_intr_mask(void *); +static void ciu_en1_intr_unmask(void *); + +static int ciu_intr(void *); + +static int +ciu_probe(device_t dev) +{ + if (device_get_unit(dev) != 0) + return (ENXIO); + + device_set_desc(dev, "Cavium Octeon Central Interrupt Unit"); + return (0); +} + +static int +ciu_attach(device_t dev) +{ + char name[MAXCOMLEN + 1]; + struct ciu_softc *sc; + unsigned i; + int error; + int rid; + + sc = device_get_softc(dev); + + rid = 0; + sc->ciu_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, CIU_IRQ_HARD, + CIU_IRQ_HARD, 1, RF_ACTIVE); + if (sc->ciu_irq == NULL) { + device_printf(dev, "could not allocate irq%d\n", CIU_IRQ_HARD); + return (ENXIO); + } + + error = bus_setup_intr(dev, sc->ciu_irq, INTR_TYPE_MISC, ciu_intr, + NULL, sc, NULL); + if (error != 0) { + device_printf(dev, "bus_setup_intr failed: %d\n", error); + return (error); + } + + sc->irq_rman.rm_type = RMAN_ARRAY; + sc->irq_rman.rm_descr = "CIU IRQ"; + + error = rman_init(&sc->irq_rman); + if (error != 0) + return (error); + + /* + * We have two contiguous IRQ regions, use a single rman. + */ + error = rman_manage_region(&sc->irq_rman, CIU_IRQ_EN0_BEGIN, + CIU_IRQ_EN1_END); + if (error != 0) + return (error); + + for (i = 0; i < CIU_IRQ_EN0_COUNT; i++) { + snprintf(name, sizeof name, "int%d:", i + CIU_IRQ_EN0_BEGIN); + ciu_en0_intrcnt[i] = mips_intrcnt_create(name); + } + + for (i = 0; i < CIU_IRQ_EN1_COUNT; i++) { + snprintf(name, sizeof name, "int%d:", i + CIU_IRQ_EN1_BEGIN); + ciu_en1_intrcnt[i] = mips_intrcnt_create(name); + } + + bus_generic_probe(dev); + bus_generic_attach(dev); + + return (0); +} + +static struct resource * +ciu_alloc_resource(device_t bus, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct resource *res; + struct ciu_softc *sc; + + sc = device_get_softc(bus); + + switch (type) { + case SYS_RES_IRQ: + break; + default: + return (bus_alloc_resource(device_get_parent(bus), type, rid, + start, end, count, flags)); + } + + /* + * One interrupt at a time for now. + */ + if (start != end) + return (NULL); + + res = rman_reserve_resource(&sc->irq_rman, start, end, count, flags, + child); + if (res != NULL) + return (res); + + return (NULL); +} + +static int +ciu_setup_intr(device_t bus, device_t child, struct resource *res, int flags, + driver_filter_t *filter, driver_intr_t *intr, void *arg, + void **cookiep) +{ + struct intr_event *event, **eventp; + void (*mask_func)(void *); + void (*unmask_func)(void *); + mips_intrcnt_t intrcnt; + int error; + int irq; + + irq = rman_get_start(res); + if (irq <= CIU_IRQ_EN0_END) { + eventp = &ciu_en0_intr_events[irq - CIU_IRQ_EN0_BEGIN]; + intrcnt = ciu_en0_intrcnt[irq - CIU_IRQ_EN0_BEGIN]; + mask_func = ciu_en0_intr_mask; + unmask_func = ciu_en0_intr_unmask; + } else { + eventp = &ciu_en1_intr_events[irq - CIU_IRQ_EN1_BEGIN]; + intrcnt = ciu_en1_intrcnt[irq - CIU_IRQ_EN1_BEGIN]; + mask_func = ciu_en1_intr_mask; + unmask_func = ciu_en1_intr_unmask; + } + + if ((event = *eventp) == NULL) { + error = intr_event_create(eventp, (void *)(uintptr_t)irq, 0, + irq, mask_func, unmask_func, NULL, NULL, "int%d", irq); + if (error != 0) + return (error); + + event = *eventp; + + unmask_func((void *)(uintptr_t)irq); + } + + intr_event_add_handler(event, device_get_nameunit(child), + filter, intr, arg, intr_priority(flags), flags, cookiep); + + mips_intrcnt_setname(intrcnt, event->ie_fullname); + + return (0); +} + +static void +ciu_hinted_child(device_t bus, const char *dname, int dunit) +{ + BUS_ADD_CHILD(bus, 0, dname, dunit); +} + +static void +ciu_en0_intr_mask(void *arg) +{ + uint64_t mask; + int irq; + + irq = (uintptr_t)arg; + mask = cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2)); + mask &= ~(1ull << (irq - CIU_IRQ_EN0_BEGIN)); + cvmx_write_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2), mask); +} + +static void +ciu_en0_intr_unmask(void *arg) +{ + uint64_t mask; + int irq; + + irq = (uintptr_t)arg; + mask = cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2)); + mask |= 1ull << (irq - CIU_IRQ_EN0_BEGIN); + cvmx_write_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2), mask); +} + +static void +ciu_en1_intr_mask(void *arg) +{ + uint64_t mask; + int irq; + + irq = (uintptr_t)arg; + mask = cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num()*2)); + mask &= ~(1ull << (irq - CIU_IRQ_EN1_BEGIN)); + cvmx_write_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num()*2), mask); +} + +static void +ciu_en1_intr_unmask(void *arg) +{ + uint64_t mask; + int irq; + + irq = (uintptr_t)arg; + mask = cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num()*2)); + mask |= 1ull << (irq - CIU_IRQ_EN1_BEGIN); + cvmx_write_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num()*2), mask); +} + +static int +ciu_intr(void *arg) +{ + struct ciu_softc *sc; + uint64_t en0_sum, en1_sum; + uint64_t en0_mask, en1_mask; + int irq_index; + int error; + + sc = arg; + (void)sc; + + en0_sum = cvmx_read_csr(CVMX_CIU_INTX_SUM0(cvmx_get_core_num()*2)); + en1_sum = cvmx_read_csr(CVMX_CIU_INT_SUM1); + + en0_mask = cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2)); + en1_mask = cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num()*2)); + + en0_sum &= en0_mask; + en1_sum &= en1_mask; + + if (en0_sum == 0 && en1_sum == 0) + return (FILTER_STRAY); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 19:32:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF3B01065689; Tue, 20 Jul 2010 19:32:25 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC7CE8FC16; Tue, 20 Jul 2010 19:32:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KJWPx3088749; Tue, 20 Jul 2010 19:32:25 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KJWPP5088746; Tue, 20 Jul 2010 19:32:25 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201007201932.o6KJWPP5088746@svn.freebsd.org> From: Juli Mallett Date: Tue, 20 Jul 2010 19:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210312 - in head/sys/mips/cavium: . cryptocteon usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 19:32:26 -0000 Author: jmallett Date: Tue Jul 20 19:32:25 2010 New Revision: 210312 URL: http://svn.freebsd.org/changeset/base/210312 Log: o) Add the "octusb" controller which supports the first port of the Octeon on-board USB controller. It is not currently enabled because there are known problems with device communication and until those are fixed I am not certain that it won't destabilize the system. [1] o) Add the "cryptocteon" opencrypto device based on the OCF device written by David McCullough. It is not currently enabled because until support for saving/restoring coprocessor 2 state on context switch is available, it runs with interrupts disabled, which tends to pessimize performance over using a software crypto facility. Tests using this driver which are not negatively affected by it running with interrupts disabled show it to be substantially faster than software for large blocks. Submitted by: hps [1] Added: head/sys/mips/cavium/cryptocteon/ head/sys/mips/cavium/cryptocteon/cavium_crypto.c (contents, props changed) head/sys/mips/cavium/cryptocteon/cryptocteon.c (contents, props changed) head/sys/mips/cavium/cryptocteon/cryptocteonvar.h (contents, props changed) head/sys/mips/cavium/usb/ head/sys/mips/cavium/usb/octusb.c (contents, props changed) head/sys/mips/cavium/usb/octusb.h (contents, props changed) head/sys/mips/cavium/usb/octusb_octeon.c (contents, props changed) Modified: head/sys/mips/cavium/files.octeon1 Added: head/sys/mips/cavium/cryptocteon/cavium_crypto.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/cryptocteon/cavium_crypto.c Tue Jul 20 19:32:25 2010 (r210312) @@ -0,0 +1,2222 @@ +/* + * vim:sw=4 ts=8 + */ +/* + * Copyright (c) 2009 David McCullough + * + * Copyright (c) 2003-2007 Cavium Networks (support@cavium.com). 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Cavium Networks + * 4. Cavium Networks' name may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * This Software, including technical data, may be subject to U.S. export + * control laws, including the U.S. Export Administration Act and its + * associated regulations, and may be subject to export or import regulations + * in other countries. You warrant that You will comply strictly in all + * respects with all such regulations and acknowledge that you have the + * responsibility to obtain licenses to export, re-export or import the + * Software. + * + * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" AND + * WITH ALL FAULTS AND CAVIUM MAKES NO PROMISES, REPRESENTATIONS OR WARRANTIES, + * EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO THE + * SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR + * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM + * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, + * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF + * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR + * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR + * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. +*/ +/****************************************************************************/ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +/****************************************************************************/ + +#define IOV_INIT(iov, ptr, idx, len) \ + do { \ + (idx) = 0; \ + (ptr) = (iov)[(idx)].iov_base; \ + (len) = (iov)[(idx)].iov_len; \ + } while (0) + +/* + * XXX + * It would be better if this were an IOV_READ/IOV_WRITE macro instead so + * that we could detect overflow before it happens rather than right after, + * which is especially bad since there is usually no IOV_CONSUME after the + * final read or write. + */ +#define IOV_CONSUME(iov, ptr, idx, len) \ + do { \ + if ((len) > sizeof *(ptr)) { \ + (len) -= sizeof *(ptr); \ + (ptr)++; \ + } else { \ + if ((len) != sizeof *(ptr)) \ + panic("%s: went past end of iovec.", __func__); \ + (idx)++; \ + (ptr) = (iov)[(idx)].iov_base; \ + (len) = (iov)[(idx)].iov_len; \ + } \ + } while (0) + +static inline unsigned long octeon_crypto_enable(void) +{ + register_t s; + + s = intr_disable(); + mips_wr_status(mips_rd_status() | MIPS_SR_COP_2_BIT); + + return (s); +} + +static inline void octeon_crypto_disable(register_t s) +{ + mips_wr_status(mips_rd_status() & ~MIPS_SR_COP_2_BIT); + intr_restore(s); +} + +#define ESP_HEADER_LENGTH 8 +#define DES_CBC_IV_LENGTH 8 +#define AES_CBC_IV_LENGTH 16 +#define ESP_HMAC_LEN 12 + +#define ESP_HEADER_LENGTH 8 +#define DES_CBC_IV_LENGTH 8 + +/****************************************************************************/ + +#define CVM_LOAD_SHA_UNIT(dat, next) { \ + if (next == 0) { \ + next = 1; \ + CVMX_MT_HSH_DAT (dat, 0); \ + } else if (next == 1) { \ + next = 2; \ + CVMX_MT_HSH_DAT (dat, 1); \ + } else if (next == 2) { \ + next = 3; \ + CVMX_MT_HSH_DAT (dat, 2); \ + } else if (next == 3) { \ + next = 4; \ + CVMX_MT_HSH_DAT (dat, 3); \ + } else if (next == 4) { \ + next = 5; \ + CVMX_MT_HSH_DAT (dat, 4); \ + } else if (next == 5) { \ + next = 6; \ + CVMX_MT_HSH_DAT (dat, 5); \ + } else if (next == 6) { \ + next = 7; \ + CVMX_MT_HSH_DAT (dat, 6); \ + } else { \ + CVMX_MT_HSH_STARTSHA (dat); \ + next = 0; \ + } \ +} + +#define CVM_LOAD2_SHA_UNIT(dat1, dat2, next) { \ + if (next == 0) { \ + CVMX_MT_HSH_DAT (dat1, 0); \ + CVMX_MT_HSH_DAT (dat2, 1); \ + next = 2; \ + } else if (next == 1) { \ + CVMX_MT_HSH_DAT (dat1, 1); \ + CVMX_MT_HSH_DAT (dat2, 2); \ + next = 3; \ + } else if (next == 2) { \ + CVMX_MT_HSH_DAT (dat1, 2); \ + CVMX_MT_HSH_DAT (dat2, 3); \ + next = 4; \ + } else if (next == 3) { \ + CVMX_MT_HSH_DAT (dat1, 3); \ + CVMX_MT_HSH_DAT (dat2, 4); \ + next = 5; \ + } else if (next == 4) { \ + CVMX_MT_HSH_DAT (dat1, 4); \ + CVMX_MT_HSH_DAT (dat2, 5); \ + next = 6; \ + } else if (next == 5) { \ + CVMX_MT_HSH_DAT (dat1, 5); \ + CVMX_MT_HSH_DAT (dat2, 6); \ + next = 7; \ + } else if (next == 6) { \ + CVMX_MT_HSH_DAT (dat1, 6); \ + CVMX_MT_HSH_STARTSHA (dat2); \ + next = 0; \ + } else { \ + CVMX_MT_HSH_STARTSHA (dat1); \ + CVMX_MT_HSH_DAT (dat2, 0); \ + next = 1; \ + } \ +} + +/****************************************************************************/ + +#define CVM_LOAD_MD5_UNIT(dat, next) { \ + if (next == 0) { \ + next = 1; \ + CVMX_MT_HSH_DAT (dat, 0); \ + } else if (next == 1) { \ + next = 2; \ + CVMX_MT_HSH_DAT (dat, 1); \ + } else if (next == 2) { \ + next = 3; \ + CVMX_MT_HSH_DAT (dat, 2); \ + } else if (next == 3) { \ + next = 4; \ + CVMX_MT_HSH_DAT (dat, 3); \ + } else if (next == 4) { \ + next = 5; \ + CVMX_MT_HSH_DAT (dat, 4); \ + } else if (next == 5) { \ + next = 6; \ + CVMX_MT_HSH_DAT (dat, 5); \ + } else if (next == 6) { \ + next = 7; \ + CVMX_MT_HSH_DAT (dat, 6); \ + } else { \ + CVMX_MT_HSH_STARTMD5 (dat); \ + next = 0; \ + } \ +} + +#define CVM_LOAD2_MD5_UNIT(dat1, dat2, next) { \ + if (next == 0) { \ + CVMX_MT_HSH_DAT (dat1, 0); \ + CVMX_MT_HSH_DAT (dat2, 1); \ + next = 2; \ + } else if (next == 1) { \ + CVMX_MT_HSH_DAT (dat1, 1); \ + CVMX_MT_HSH_DAT (dat2, 2); \ + next = 3; \ + } else if (next == 2) { \ + CVMX_MT_HSH_DAT (dat1, 2); \ + CVMX_MT_HSH_DAT (dat2, 3); \ + next = 4; \ + } else if (next == 3) { \ + CVMX_MT_HSH_DAT (dat1, 3); \ + CVMX_MT_HSH_DAT (dat2, 4); \ + next = 5; \ + } else if (next == 4) { \ + CVMX_MT_HSH_DAT (dat1, 4); \ + CVMX_MT_HSH_DAT (dat2, 5); \ + next = 6; \ + } else if (next == 5) { \ + CVMX_MT_HSH_DAT (dat1, 5); \ + CVMX_MT_HSH_DAT (dat2, 6); \ + next = 7; \ + } else if (next == 6) { \ + CVMX_MT_HSH_DAT (dat1, 6); \ + CVMX_MT_HSH_STARTMD5 (dat2); \ + next = 0; \ + } else { \ + CVMX_MT_HSH_STARTMD5 (dat1); \ + CVMX_MT_HSH_DAT (dat2, 0); \ + next = 1; \ + } \ +} + +/****************************************************************************/ + +void +octo_calc_hash(uint8_t auth, unsigned char *key, uint64_t *inner, uint64_t *outer) +{ + uint8_t hash_key[64]; + uint64_t *key1; + register uint64_t xor1 = 0x3636363636363636ULL; + register uint64_t xor2 = 0x5c5c5c5c5c5c5c5cULL; + register_t s; + + dprintf("%s()\n", __func__); + + memset(hash_key, 0, sizeof(hash_key)); + memcpy(hash_key, (uint8_t *) key, (auth ? 20 : 16)); + key1 = (uint64_t *) hash_key; + s = octeon_crypto_enable(); + if (auth) { + CVMX_MT_HSH_IV(0x67452301EFCDAB89ULL, 0); + CVMX_MT_HSH_IV(0x98BADCFE10325476ULL, 1); + CVMX_MT_HSH_IV(0xC3D2E1F000000000ULL, 2); + } else { + CVMX_MT_HSH_IV(0x0123456789ABCDEFULL, 0); + CVMX_MT_HSH_IV(0xFEDCBA9876543210ULL, 1); + } + + CVMX_MT_HSH_DAT((*key1 ^ xor1), 0); + key1++; + CVMX_MT_HSH_DAT((*key1 ^ xor1), 1); + key1++; + CVMX_MT_HSH_DAT((*key1 ^ xor1), 2); + key1++; + CVMX_MT_HSH_DAT((*key1 ^ xor1), 3); + key1++; + CVMX_MT_HSH_DAT((*key1 ^ xor1), 4); + key1++; + CVMX_MT_HSH_DAT((*key1 ^ xor1), 5); + key1++; + CVMX_MT_HSH_DAT((*key1 ^ xor1), 6); + key1++; + if (auth) + CVMX_MT_HSH_STARTSHA((*key1 ^ xor1)); + else + CVMX_MT_HSH_STARTMD5((*key1 ^ xor1)); + + CVMX_MF_HSH_IV(inner[0], 0); + CVMX_MF_HSH_IV(inner[1], 1); + if (auth) { + inner[2] = 0; + CVMX_MF_HSH_IV(((uint64_t *) inner)[2], 2); + } + + memset(hash_key, 0, sizeof(hash_key)); + memcpy(hash_key, (uint8_t *) key, (auth ? 20 : 16)); + key1 = (uint64_t *) hash_key; + if (auth) { + CVMX_MT_HSH_IV(0x67452301EFCDAB89ULL, 0); + CVMX_MT_HSH_IV(0x98BADCFE10325476ULL, 1); + CVMX_MT_HSH_IV(0xC3D2E1F000000000ULL, 2); + } else { + CVMX_MT_HSH_IV(0x0123456789ABCDEFULL, 0); + CVMX_MT_HSH_IV(0xFEDCBA9876543210ULL, 1); + } + + CVMX_MT_HSH_DAT((*key1 ^ xor2), 0); + key1++; + CVMX_MT_HSH_DAT((*key1 ^ xor2), 1); + key1++; + CVMX_MT_HSH_DAT((*key1 ^ xor2), 2); + key1++; + CVMX_MT_HSH_DAT((*key1 ^ xor2), 3); + key1++; + CVMX_MT_HSH_DAT((*key1 ^ xor2), 4); + key1++; + CVMX_MT_HSH_DAT((*key1 ^ xor2), 5); + key1++; + CVMX_MT_HSH_DAT((*key1 ^ xor2), 6); + key1++; + if (auth) + CVMX_MT_HSH_STARTSHA((*key1 ^ xor2)); + else + CVMX_MT_HSH_STARTMD5((*key1 ^ xor2)); + + CVMX_MF_HSH_IV(outer[0], 0); + CVMX_MF_HSH_IV(outer[1], 1); + if (auth) { + outer[2] = 0; + CVMX_MF_HSH_IV(outer[2], 2); + } + octeon_crypto_disable(s); + return; +} + +/****************************************************************************/ +/* DES functions */ + +int +octo_des_cbc_encrypt( + struct octo_sess *od, + struct iovec *iov, size_t iovcnt, size_t iovlen, + int auth_off, int auth_len, + int crypt_off, int crypt_len, + int icv_off, uint8_t *ivp) +{ + uint64_t *data; + int data_i, data_l; + register_t s; + + dprintf("%s()\n", __func__); + + if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || + (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " + "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, + auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); + return -EINVAL; + } + + IOV_INIT(iov, data, data_i, data_l); + + CVMX_PREFETCH0(ivp); + CVMX_PREFETCH0(od->octo_enckey); + + s = octeon_crypto_enable(); + + /* load 3DES Key */ + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); + if (od->octo_encklen == 24) { + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); + } else if (od->octo_encklen == 8) { + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); + } else { + octeon_crypto_disable(s); + dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); + return -EINVAL; + } + + CVMX_MT_3DES_IV(* (uint64_t *) ivp); + + while (crypt_off > 0) { + IOV_CONSUME(iov, data, data_i, data_l); + crypt_off -= 8; + } + + while (crypt_len > 0) { + CVMX_MT_3DES_ENC_CBC(*data); + CVMX_MF_3DES_RESULT(*data); + IOV_CONSUME(iov, data, data_i, data_l); + crypt_len -= 8; + } + + octeon_crypto_disable(s); + return 0; +} + + +int +octo_des_cbc_decrypt( + struct octo_sess *od, + struct iovec *iov, size_t iovcnt, size_t iovlen, + int auth_off, int auth_len, + int crypt_off, int crypt_len, + int icv_off, uint8_t *ivp) +{ + uint64_t *data; + int data_i, data_l; + register_t s; + + dprintf("%s()\n", __func__); + + if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || + (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " + "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, + auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); + return -EINVAL; + } + + IOV_INIT(iov, data, data_i, data_l); + + CVMX_PREFETCH0(ivp); + CVMX_PREFETCH0(od->octo_enckey); + + s = octeon_crypto_enable(); + + /* load 3DES Key */ + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); + if (od->octo_encklen == 24) { + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); + } else if (od->octo_encklen == 8) { + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); + } else { + octeon_crypto_disable(s); + dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); + return -EINVAL; + } + + CVMX_MT_3DES_IV(* (uint64_t *) ivp); + + while (crypt_off > 0) { + IOV_CONSUME(iov, data, data_i, data_l); + crypt_off -= 8; + } + + while (crypt_len > 0) { + CVMX_MT_3DES_DEC_CBC(*data); + CVMX_MF_3DES_RESULT(*data); + IOV_CONSUME(iov, data, data_i, data_l); + crypt_len -= 8; + } + + octeon_crypto_disable(s); + return 0; +} + +/****************************************************************************/ +/* AES functions */ + +int +octo_aes_cbc_encrypt( + struct octo_sess *od, + struct iovec *iov, size_t iovcnt, size_t iovlen, + int auth_off, int auth_len, + int crypt_off, int crypt_len, + int icv_off, uint8_t *ivp) +{ + uint64_t *data, *pdata; + int data_i, data_l; + register_t s; + + dprintf("%s()\n", __func__); + + if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || + (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " + "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, + auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); + return -EINVAL; + } + + IOV_INIT(iov, data, data_i, data_l); + + CVMX_PREFETCH0(ivp); + CVMX_PREFETCH0(od->octo_enckey); + + s = octeon_crypto_enable(); + + /* load AES Key */ + CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[0], 0); + CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[1], 1); + + if (od->octo_encklen == 16) { + CVMX_MT_AES_KEY(0x0, 2); + CVMX_MT_AES_KEY(0x0, 3); + } else if (od->octo_encklen == 24) { + CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); + CVMX_MT_AES_KEY(0x0, 3); + } else if (od->octo_encklen == 32) { + CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); + CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[3], 3); + } else { + octeon_crypto_disable(s); + dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); + return -EINVAL; + } + CVMX_MT_AES_KEYLENGTH(od->octo_encklen / 8 - 1); + + CVMX_MT_AES_IV(((uint64_t *) ivp)[0], 0); + CVMX_MT_AES_IV(((uint64_t *) ivp)[1], 1); + + while (crypt_off > 0) { + IOV_CONSUME(iov, data, data_i, data_l); + crypt_off -= 8; + } + + while (crypt_len > 0) { + pdata = data; + CVMX_MT_AES_ENC_CBC0(*data); + IOV_CONSUME(iov, data, data_i, data_l); + CVMX_MT_AES_ENC_CBC1(*data); + CVMX_MF_AES_RESULT(*pdata, 0); + CVMX_MF_AES_RESULT(*data, 1); + IOV_CONSUME(iov, data, data_i, data_l); + crypt_len -= 16; + } + + octeon_crypto_disable(s); + return 0; +} + + +int +octo_aes_cbc_decrypt( + struct octo_sess *od, + struct iovec *iov, size_t iovcnt, size_t iovlen, + int auth_off, int auth_len, + int crypt_off, int crypt_len, + int icv_off, uint8_t *ivp) +{ + uint64_t *data, *pdata; + int data_i, data_l; + register_t s; + + dprintf("%s()\n", __func__); + + if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || + (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " + "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, + auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); + return -EINVAL; + } + + IOV_INIT(iov, data, data_i, data_l); + + CVMX_PREFETCH0(ivp); + CVMX_PREFETCH0(od->octo_enckey); + + s = octeon_crypto_enable(); + + /* load AES Key */ + CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[0], 0); + CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[1], 1); + + if (od->octo_encklen == 16) { + CVMX_MT_AES_KEY(0x0, 2); + CVMX_MT_AES_KEY(0x0, 3); + } else if (od->octo_encklen == 24) { + CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); + CVMX_MT_AES_KEY(0x0, 3); + } else if (od->octo_encklen == 32) { + CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); + CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[3], 3); + } else { + octeon_crypto_disable(s); + dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); + return -EINVAL; + } + CVMX_MT_AES_KEYLENGTH(od->octo_encklen / 8 - 1); + + CVMX_MT_AES_IV(((uint64_t *) ivp)[0], 0); + CVMX_MT_AES_IV(((uint64_t *) ivp)[1], 1); + + while (crypt_off > 0) { + IOV_CONSUME(iov, data, data_i, data_l); + crypt_off -= 8; + } + + while (crypt_len > 0) { + pdata = data; + CVMX_MT_AES_DEC_CBC0(*data); + IOV_CONSUME(iov, data, data_i, data_l); + CVMX_MT_AES_DEC_CBC1(*data); + CVMX_MF_AES_RESULT(*pdata, 0); + CVMX_MF_AES_RESULT(*data, 1); + IOV_CONSUME(iov, data, data_i, data_l); + crypt_len -= 16; + } + + octeon_crypto_disable(s); + return 0; +} + +/****************************************************************************/ +/* MD5 */ + +int +octo_null_md5_encrypt( + struct octo_sess *od, + struct iovec *iov, size_t iovcnt, size_t iovlen, + int auth_off, int auth_len, + int crypt_off, int crypt_len, + int icv_off, uint8_t *ivp) +{ + register int next = 0; + uint64_t *data; + uint64_t tmp1, tmp2; + int data_i, data_l, alen = auth_len; + register_t s; + + dprintf("%s()\n", __func__); + + if (__predict_false(od == NULL || iov==NULL || iovlen==0 || + (auth_off & 0x7) || (auth_off + auth_len > iovlen))) { + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " + "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, + auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); + return -EINVAL; + } + + IOV_INIT(iov, data, data_i, data_l); + + s = octeon_crypto_enable(); + + /* Load MD5 IV */ + CVMX_MT_HSH_IV(od->octo_hminner[0], 0); + CVMX_MT_HSH_IV(od->octo_hminner[1], 1); + + while (auth_off > 0) { + IOV_CONSUME(iov, data, data_i, data_l); + auth_off -= 8; + } + + while (auth_len > 0) { + CVM_LOAD_MD5_UNIT(*data, next); + auth_len -= 8; + IOV_CONSUME(iov, data, data_i, data_l); + } + + /* finish the hash */ + CVMX_PREFETCH0(od->octo_hmouter); +#if 0 + if (__predict_false(inplen)) { + uint64_t tmp = 0; + uint8_t *p = (uint8_t *) & tmp; + p[inplen] = 0x80; + do { + inplen--; + p[inplen] = ((uint8_t *) data)[inplen]; + } while (inplen); + CVM_LOAD_MD5_UNIT(tmp, next); + } else { + CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); + } +#else + CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); +#endif + + /* Finish Inner hash */ + while (next != 7) { + CVM_LOAD_MD5_UNIT(((uint64_t) 0x0ULL), next); + } + CVMX_ES64(tmp1, ((alen + 64) << 3)); + CVM_LOAD_MD5_UNIT(tmp1, next); + + /* Get the inner hash of HMAC */ + CVMX_MF_HSH_IV(tmp1, 0); + CVMX_MF_HSH_IV(tmp2, 1); + + /* Initialize hash unit */ + CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); + CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); + + CVMX_MT_HSH_DAT(tmp1, 0); + CVMX_MT_HSH_DAT(tmp2, 1); + CVMX_MT_HSH_DAT(0x8000000000000000ULL, 2); + CVMX_MT_HSH_DATZ(3); + CVMX_MT_HSH_DATZ(4); + CVMX_MT_HSH_DATZ(5); + CVMX_MT_HSH_DATZ(6); + CVMX_ES64(tmp1, ((64 + 16) << 3)); + CVMX_MT_HSH_STARTMD5(tmp1); + + /* save the HMAC */ + IOV_INIT(iov, data, data_i, data_l); + while (icv_off > 0) { + IOV_CONSUME(iov, data, data_i, data_l); + icv_off -= 8; + } + CVMX_MF_HSH_IV(*data, 0); + IOV_CONSUME(iov, data, data_i, data_l); + CVMX_MF_HSH_IV(tmp1, 1); + *(uint32_t *)data = (uint32_t) (tmp1 >> 32); + + octeon_crypto_disable(s); + return 0; +} + +/****************************************************************************/ +/* SHA1 */ + +int +octo_null_sha1_encrypt( + struct octo_sess *od, + struct iovec *iov, size_t iovcnt, size_t iovlen, + int auth_off, int auth_len, + int crypt_off, int crypt_len, + int icv_off, uint8_t *ivp) +{ + register int next = 0; + uint64_t *data; + uint64_t tmp1, tmp2, tmp3; + int data_i, data_l, alen = auth_len; + register_t s; + + dprintf("%s()\n", __func__); + + if (__predict_false(od == NULL || iov==NULL || iovlen==0 || + (auth_off & 0x7) || (auth_off + auth_len > iovlen))) { + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " + "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, + auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); + return -EINVAL; + } + + IOV_INIT(iov, data, data_i, data_l); + + s = octeon_crypto_enable(); + + /* Load SHA1 IV */ + CVMX_MT_HSH_IV(od->octo_hminner[0], 0); + CVMX_MT_HSH_IV(od->octo_hminner[1], 1); + CVMX_MT_HSH_IV(od->octo_hminner[2], 2); + + while (auth_off > 0) { + IOV_CONSUME(iov, data, data_i, data_l); + auth_off -= 8; + } + + while (auth_len > 0) { + CVM_LOAD_SHA_UNIT(*data, next); + auth_len -= 8; + IOV_CONSUME(iov, data, data_i, data_l); + } + + /* finish the hash */ + CVMX_PREFETCH0(od->octo_hmouter); +#if 0 + if (__predict_false(inplen)) { + uint64_t tmp = 0; + uint8_t *p = (uint8_t *) & tmp; + p[inplen] = 0x80; + do { + inplen--; + p[inplen] = ((uint8_t *) data)[inplen]; + } while (inplen); + CVM_LOAD_MD5_UNIT(tmp, next); + } else { + CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); + } +#else + CVM_LOAD_SHA_UNIT(0x8000000000000000ULL, next); +#endif + + /* Finish Inner hash */ + while (next != 7) { + CVM_LOAD_SHA_UNIT(((uint64_t) 0x0ULL), next); + } + CVM_LOAD_SHA_UNIT((uint64_t) ((alen + 64) << 3), next); + + /* Get the inner hash of HMAC */ + CVMX_MF_HSH_IV(tmp1, 0); + CVMX_MF_HSH_IV(tmp2, 1); + tmp3 = 0; + CVMX_MF_HSH_IV(tmp3, 2); + + /* Initialize hash unit */ + CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); + CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); + CVMX_MT_HSH_IV(od->octo_hmouter[2], 2); + + CVMX_MT_HSH_DAT(tmp1, 0); + CVMX_MT_HSH_DAT(tmp2, 1); + tmp3 |= 0x0000000080000000; + CVMX_MT_HSH_DAT(tmp3, 2); + CVMX_MT_HSH_DATZ(3); + CVMX_MT_HSH_DATZ(4); + CVMX_MT_HSH_DATZ(5); + CVMX_MT_HSH_DATZ(6); + CVMX_MT_HSH_STARTSHA((uint64_t) ((64 + 20) << 3)); + + /* save the HMAC */ + IOV_INIT(iov, data, data_i, data_l); + while (icv_off > 0) { + IOV_CONSUME(iov, data, data_i, data_l); + icv_off -= 8; + } + CVMX_MF_HSH_IV(*data, 0); + IOV_CONSUME(iov, data, data_i, data_l); + CVMX_MF_HSH_IV(tmp1, 1); + *(uint32_t *)data = (uint32_t) (tmp1 >> 32); + + octeon_crypto_disable(s); + return 0; +} + +/****************************************************************************/ +/* DES MD5 */ + +int +octo_des_cbc_md5_encrypt( + struct octo_sess *od, + struct iovec *iov, size_t iovcnt, size_t iovlen, + int auth_off, int auth_len, + int crypt_off, int crypt_len, + int icv_off, uint8_t *ivp) +{ + register int next = 0; + union { + uint32_t data32[2]; + uint64_t data64[1]; + } mydata; + uint64_t *data = &mydata.data64[0]; + uint32_t *data32; + uint64_t tmp1, tmp2; + int data_i, data_l, alen = auth_len; + register_t s; + + dprintf("%s()\n", __func__); + + if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || + (crypt_off & 0x3) || (crypt_off + crypt_len > iovlen) || + (crypt_len & 0x7) || + (auth_len & 0x7) || + (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " + "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, + auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); + return -EINVAL; + } + + IOV_INIT(iov, data32, data_i, data_l); + + CVMX_PREFETCH0(ivp); + CVMX_PREFETCH0(od->octo_enckey); + + s = octeon_crypto_enable(); + + /* load 3DES Key */ + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); + if (od->octo_encklen == 24) { + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); + } else if (od->octo_encklen == 8) { + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); + CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); + } else { + octeon_crypto_disable(s); + dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); + return -EINVAL; + } + + CVMX_MT_3DES_IV(* (uint64_t *) ivp); + + /* Load MD5 IV */ + CVMX_MT_HSH_IV(od->octo_hminner[0], 0); + CVMX_MT_HSH_IV(od->octo_hminner[1], 1); + + while (crypt_off > 0 && auth_off > 0) { + IOV_CONSUME(iov, data32, data_i, data_l); + crypt_off -= 4; + auth_off -= 4; + } + + while (crypt_len > 0 || auth_len > 0) { + uint32_t *first = data32; + mydata.data32[0] = *first; + IOV_CONSUME(iov, data32, data_i, data_l); + mydata.data32[1] = *data32; + if (crypt_off <= 0) { + if (crypt_len > 0) { + CVMX_MT_3DES_ENC_CBC(*data); + CVMX_MF_3DES_RESULT(*data); + crypt_len -= 8; + } + } else + crypt_off -= 8; + if (auth_off <= 0) { + if (auth_len > 0) { + CVM_LOAD_MD5_UNIT(*data, next); + auth_len -= 8; + } + } else + auth_off -= 8; + *first = mydata.data32[0]; + *data32 = mydata.data32[1]; + IOV_CONSUME(iov, data32, data_i, data_l); + } + + /* finish the hash */ + CVMX_PREFETCH0(od->octo_hmouter); +#if 0 + if (__predict_false(inplen)) { + uint64_t tmp = 0; + uint8_t *p = (uint8_t *) & tmp; + p[inplen] = 0x80; + do { + inplen--; + p[inplen] = ((uint8_t *) data)[inplen]; + } while (inplen); + CVM_LOAD_MD5_UNIT(tmp, next); + } else { + CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); + } +#else + CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); +#endif + + /* Finish Inner hash */ + while (next != 7) { + CVM_LOAD_MD5_UNIT(((uint64_t) 0x0ULL), next); + } + CVMX_ES64(tmp1, ((alen + 64) << 3)); + CVM_LOAD_MD5_UNIT(tmp1, next); + + /* Get the inner hash of HMAC */ + CVMX_MF_HSH_IV(tmp1, 0); + CVMX_MF_HSH_IV(tmp2, 1); + + /* Initialize hash unit */ + CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); + CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); + + CVMX_MT_HSH_DAT(tmp1, 0); + CVMX_MT_HSH_DAT(tmp2, 1); + CVMX_MT_HSH_DAT(0x8000000000000000ULL, 2); + CVMX_MT_HSH_DATZ(3); + CVMX_MT_HSH_DATZ(4); + CVMX_MT_HSH_DATZ(5); + CVMX_MT_HSH_DATZ(6); + CVMX_ES64(tmp1, ((64 + 16) << 3)); + CVMX_MT_HSH_STARTMD5(tmp1); + + /* save the HMAC */ + IOV_INIT(iov, data32, data_i, data_l); + while (icv_off > 0) { + IOV_CONSUME(iov, data32, data_i, data_l); + icv_off -= 4; + } + CVMX_MF_HSH_IV(tmp1, 0); + *data32 = (uint32_t) (tmp1 >> 32); + IOV_CONSUME(iov, data32, data_i, data_l); + *data32 = (uint32_t) tmp1; + IOV_CONSUME(iov, data32, data_i, data_l); + CVMX_MF_HSH_IV(tmp1, 1); + *data32 = (uint32_t) (tmp1 >> 32); + + octeon_crypto_disable(s); + return 0; +} + +int +octo_des_cbc_md5_decrypt( + struct octo_sess *od, + struct iovec *iov, size_t iovcnt, size_t iovlen, + int auth_off, int auth_len, + int crypt_off, int crypt_len, + int icv_off, uint8_t *ivp) +{ + register int next = 0; + union { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Jul 20 21:17:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9761F106566C; Tue, 20 Jul 2010 21:17:33 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DB588FC0A; Tue, 20 Jul 2010 21:17:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KLHXbF012572; Tue, 20 Jul 2010 21:17:33 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KLHX5j012571; Tue, 20 Jul 2010 21:17:33 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201007202117.o6KLHX5j012571@svn.freebsd.org> From: Juli Mallett Date: Tue, 20 Jul 2010 21:17: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: r210317 - 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: Tue, 20 Jul 2010 21:17:33 -0000 Author: jmallett Date: Tue Jul 20 21:17:33 2010 New Revision: 210317 URL: http://svn.freebsd.org/changeset/base/210317 Log: Remove unused file. Replaced by tlb.c. Deleted: head/sys/mips/mips/tlb.S From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 04:18:18 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B94FD1065675; Wed, 21 Jul 2010 04:18:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 4CA0D8FC21; Wed, 21 Jul 2010 04:18:17 +0000 (UTC) Received: from c122-106-145-25.carlnfd1.nsw.optusnet.com.au (c122-106-145-25.carlnfd1.nsw.optusnet.com.au [122.106.145.25]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o6L4IDCG026215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Jul 2010 14:18:14 +1000 Date: Wed, 21 Jul 2010 14:18:13 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: John Baldwin In-Reply-To: <201007190829.21995.jhb@freebsd.org> Message-ID: <20100721134319.E7228@delplex.bde.org> References: <201007181015.o6IAFXvK018739@svn.freebsd.org> <201007190829.21995.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ivan Voras Subject: Re: svn commit: r210217 - 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, 21 Jul 2010 04:18:18 -0000 On Mon, 19 Jul 2010, John Baldwin wrote: >> Log: >> In keeping with the Age-of-the-fruitbat theme, scale up hirunningspace on >> machines which can clearly afford the memory. >> >> This is a somewhat conservative version of the patch - more fine tuning may be >> necessary. >> >> Idea from: Thread on hackers@ >> Discussed with: alc Sorry I didn't look at the thread, but I wonder if you should increase lorunningspace similarly. The vfs_bio sysctls are not easy to tune. The only time I tried changing them much was in connection with nfs. Congestion caused i/o to not stream. IIRC the problem was mostly that too many nfsiods ran and they got in each others way, and increasing hirunningspace only helped by making the problem more obvious -- it allowed longer bursts of the network part of the i/o but longer idle periods too. There is a possibly related problem with writing through file systems to high-latency disk devices like dvds. getblk() often takes many seconds, and occasionally takes a couple of _minutes_. dvd's aren't quite that slow, and can easily write hirunningspace = 1MB in 1 second, except possibly if the file system is not designed for high-latency devices (like most including cd9660 and udf are :-() so it does lots of random i/o). The above is mostly for 1 active file system... >> >> Modified: >> head/sys/kern/vfs_bio.c >> >> Modified: head/sys/kern/vfs_bio.c >> ============================================================================== >> --- head/sys/kern/vfs_bio.c Sun Jul 18 08:54:31 2010 (r210216) >> +++ head/sys/kern/vfs_bio.c Sun Jul 18 10:15:33 2010 (r210217) >> @@ -621,7 +621,9 @@ bufinit(void) >> lobufspace = hibufspace - MAXBSIZE; >> >> lorunningspace = 512 * 1024; >> - hirunningspace = 1024 * 1024; >> + hirunningspace = lmin(roundup(hibufspace/64, MAXBSIZE), 16*1024*1024); >> + if (hirunningspace < 1024 * 1024) >> + hirunningspace = 1024 * 1024; ... dvds are plenty slow enough to take many seconds to write hirunningspace = 16MB, even for purely sequential writes. Floppy disks are slower and would take 16*33 seconds :-). So although faster disks and multiple disks need a larger hirunningspace, a large hirunningspace is not good while it is global (it should probably be per-active-disk). If there is just one active-for-writes slow disk in the system, writes to it alone are almost sure to build up (since writes to the faster disks will complete faster), so that soon all of hirunningspace is allocated to the slow disk. Something like this happens in my dvd example. > Presumably you could use 'lmax(lmin(..., 16 * 1024 * 1024), 1024 * 1024))'? Better. > Also, the common style throughout the kernel is to provide spaces around > operators like '/' and '*'. The Normal style is still used in adjacent lines. Normal formatting is sometimes broken to avoid lines longer than 80 characters. This works here. I don't like this. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 08:27:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB444106566B; Wed, 21 Jul 2010 08:27:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AEF28FC08; Wed, 21 Jul 2010 08:27:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6L8RuqF061158; Wed, 21 Jul 2010 08:27:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6L8RucS061157; Wed, 21 Jul 2010 08:27:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201007210827.o6L8RucS061157@svn.freebsd.org> From: Ed Schouten Date: Wed, 21 Jul 2010 08:27: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: r210320 - head/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: Wed, 21 Jul 2010 08:27:56 -0000 Author: ed Date: Wed Jul 21 08:27:56 2010 New Revision: 210320 URL: http://svn.freebsd.org/changeset/base/210320 Log: Chase LLVM version bump to 2.8. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 21 06:52:13 2010 (r210319) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 21 08:27:56 2010 (r210320) @@ -630,12 +630,12 @@ OLD_FILES+=usr/share/man/man8/zpool.8.gz OLD_FILES+=usr/bin/clang OLD_FILES+=usr/bin/clang++ OLD_FILES+=usr/bin/tblgen -OLD_FILES+=usr/include/clang/2.0/emmintrin.h -OLD_FILES+=usr/include/clang/2.0/mm_malloc.h -OLD_FILES+=usr/include/clang/2.0/mmintrin.h -OLD_FILES+=usr/include/clang/2.0/pmmintrin.h -OLD_FILES+=usr/include/clang/2.0/tmmintrin.h -OLD_FILES+=usr/include/clang/2.0/xmmintrin.h +OLD_FILES+=usr/include/clang/2.8/emmintrin.h +OLD_FILES+=usr/include/clang/2.8/mm_malloc.h +OLD_FILES+=usr/include/clang/2.8/mmintrin.h +OLD_FILES+=usr/include/clang/2.8/pmmintrin.h +OLD_FILES+=usr/include/clang/2.8/tmmintrin.h +OLD_FILES+=usr/include/clang/2.8/xmmintrin.h .endif .if ${MK_CPP} == no From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 08:43:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D84BD1065674; Wed, 21 Jul 2010 08:43:48 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C83938FC08; Wed, 21 Jul 2010 08:43:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6L8hmEN064624; Wed, 21 Jul 2010 08:43:48 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6L8hmo5064622; Wed, 21 Jul 2010 08:43:48 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007210843.o6L8hmo5064622@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 08:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210321 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 08:43:48 -0000 Author: kaiw Date: Wed Jul 21 08:43:48 2010 New Revision: 210321 URL: http://svn.freebsd.org/changeset/base/210321 Log: Remove a superfluous comment. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/elf_update.c Modified: head/lib/libelf/elf_update.c ============================================================================== --- head/lib/libelf/elf_update.c Wed Jul 21 08:27:56 2010 (r210320) +++ head/lib/libelf/elf_update.c Wed Jul 21 08:43:48 2010 (r210321) @@ -297,7 +297,6 @@ _libelf_resync_sections(Elf *e, off_t rc else sh_type = s->s_shdr.s_shdr64.sh_type; - /* XXX Do we need the 'size' field of an SHT_NOBITS section */ if (sh_type == SHT_NOBITS || sh_type == SHT_NULL) continue; From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 08:51:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9391106566B; Wed, 21 Jul 2010 08:51:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98CD68FC14; Wed, 21 Jul 2010 08:51:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6L8pcba066506; Wed, 21 Jul 2010 08:51:38 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6L8pcgw066504; Wed, 21 Jul 2010 08:51:38 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201007210851.o6L8pcgw066504@svn.freebsd.org> From: Ed Schouten Date: Wed, 21 Jul 2010 08:51: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: r210323 - 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: Wed, 21 Jul 2010 08:51:38 -0000 Author: ed Date: Wed Jul 21 08:51:38 2010 New Revision: 210323 URL: http://svn.freebsd.org/changeset/base/210323 Log: Also link getutxent.3 to utmpx.3. If you run `man utmpx', you expect to get some info on it. Modified: head/lib/libc/gen/Makefile.inc Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Wed Jul 21 08:48:45 2010 (r210322) +++ head/lib/libc/gen/Makefile.inc Wed Jul 21 08:51:38 2010 (r210323) @@ -129,7 +129,7 @@ MLINKS+=getusershell.3 endusershell.3 ge MLINKS+=getutxent.3 endutxent.3 getutxent.3 getutxid.3 \ getutxent.3 getutxline.3 getutxent.3 getutxuser.3 \ getutxent.3 pututxline.3 getutxent.3 setutxdb.3 \ - getutxent.3 setutxent.3 + getutxent.3 setutxent.3 getutxent.3 utmpx.3 MLINKS+=glob.3 globfree.3 MLINKS+=isgreater.3 isgreaterequal.3 isgreater.3 isless.3 \ isgreater.3 islessequal.3 isgreater.3 islessgreater.3 \ From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 08:54:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0A401065677; Wed, 21 Jul 2010 08:54:46 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF8028FC0A; Wed, 21 Jul 2010 08:54:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6L8sklV067230; Wed, 21 Jul 2010 08:54:46 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6L8skIl067227; Wed, 21 Jul 2010 08:54:46 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007210854.o6L8skIl067227@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 08:54: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: r210324 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 08:54:46 -0000 Author: kaiw Date: Wed Jul 21 08:54:46 2010 New Revision: 210324 URL: http://svn.freebsd.org/changeset/base/210324 Log: - Correctly handle sections of type SHT_NOBITS. For these sections: - elf_getdata() and elf_rawdata() should return an "Elf_Data" structure that has its "d_buf" member set to NULL and "d_size" member set to the nominal 'size' of the section. [1] - Update the manual page for these functions. - Fix a memory leak in an error handling path inside elf_getdata(). - Use _libelf_allocate_data() in elf_newdata() for consistency. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/elf_data.c head/lib/libelf/elf_getdata.3 Modified: head/lib/libelf/elf_data.c ============================================================================== --- head/lib/libelf/elf_data.c Wed Jul 21 08:51:38 2010 (r210323) +++ head/lib/libelf/elf_data.c Wed Jul 21 08:54:46 2010 (r210324) @@ -39,7 +39,6 @@ Elf_Data * elf_getdata(Elf_Scn *s, Elf_Data *d) { Elf *e; - char *dst; size_t fsz, msz, count; int elfclass, elftype; unsigned int sh_type; @@ -79,20 +78,22 @@ elf_getdata(Elf_Scn *s, Elf_Data *d) sh_align = s->s_shdr.s_shdr64.sh_addralign; } + if (sh_type == SHT_NULL) + return (NULL); + if ((elftype = _libelf_xlate_shtype(sh_type)) < ELF_T_FIRST || - elftype > ELF_T_LAST || - sh_offset + sh_size > (uint64_t) e->e_rawsize) { + elftype > ELF_T_LAST || (sh_type != SHT_NOBITS && + sh_offset + sh_size > (uint64_t) e->e_rawsize)) { LIBELF_SET_ERROR(SECTION, 0); return (NULL); } - if ((fsz = (elfclass == ELFCLASS32 ? elf32_fsize : elf64_fsize)(elftype, - (size_t) 1, e->e_version)) == 0) { + if ((fsz = (elfclass == ELFCLASS32 ? elf32_fsize : elf64_fsize) + (elftype, (size_t) 1, e->e_version)) == 0) { LIBELF_SET_ERROR(UNIMPL, 0); return (NULL); } - if (sh_size % fsz) { LIBELF_SET_ERROR(SECTION, 0); return (NULL); @@ -104,21 +105,25 @@ elf_getdata(Elf_Scn *s, Elf_Data *d) assert(msz > 0); - if ((dst = malloc(msz*count)) == NULL) { - LIBELF_SET_ERROR(RESOURCE, 0); - return (NULL); - } - if ((d = _libelf_allocate_data(s)) == NULL) return (NULL); - d->d_buf = dst; + d->d_buf = NULL; d->d_off = 0; d->d_align = sh_align; d->d_size = msz * count; d->d_type = elftype; d->d_version = e->e_version; + if (sh_type == SHT_NOBITS) + return (d); + + if ((d->d_buf = malloc(msz*count)) == NULL) { + (void) _libelf_release_data(d); + LIBELF_SET_ERROR(RESOURCE, 0); + return (NULL); + } + d->d_flags |= LIBELF_F_MALLOCED; STAILQ_INSERT_TAIL(&s->s_data, d, d_next); @@ -149,14 +154,10 @@ elf_newdata(Elf_Scn *s) if (elf_getdata(s, NULL) == NULL) return (NULL); - if ((d = malloc(sizeof(Elf_Data))) == NULL) { - LIBELF_SET_ERROR(RESOURCE, errno); + if ((d = _libelf_allocate_data(s)) == NULL) return (NULL); - } STAILQ_INSERT_TAIL(&s->s_data, d, d_next); - d->d_flags = 0; - d->d_scn = s; d->d_align = 1; d->d_buf = NULL; @@ -180,6 +181,7 @@ elf_rawdata(Elf_Scn *s, Elf_Data *d) { Elf *e; int elf_class; + uint32_t sh_type; uint64_t sh_align, sh_offset, sh_size; if (s == NULL || (e = s->s_elf) == NULL || @@ -199,19 +201,24 @@ elf_rawdata(Elf_Scn *s, Elf_Data *d) assert(elf_class == ELFCLASS32 || elf_class == ELFCLASS64); if (elf_class == ELFCLASS32) { + sh_type = s->s_shdr.s_shdr32.sh_type; sh_offset = (uint64_t) s->s_shdr.s_shdr32.sh_offset; sh_size = (uint64_t) s->s_shdr.s_shdr32.sh_size; sh_align = (uint64_t) s->s_shdr.s_shdr32.sh_addralign; } else { + sh_type = s->s_shdr.s_shdr64.sh_type; sh_offset = s->s_shdr.s_shdr64.sh_offset; sh_size = s->s_shdr.s_shdr64.sh_size; sh_align = s->s_shdr.s_shdr64.sh_addralign; } + if (sh_type == SHT_NULL) + return (NULL); + if ((d = _libelf_allocate_data(s)) == NULL) return (NULL); - d->d_buf = e->e_rawfile + sh_offset; + d->d_buf = sh_type == SHT_NOBITS ? NULL : e->e_rawfile + sh_offset; d->d_off = 0; d->d_align = sh_align; d->d_size = sh_size; Modified: head/lib/libelf/elf_getdata.3 ============================================================================== --- head/lib/libelf/elf_getdata.3 Wed Jul 21 08:51:38 2010 (r210323) +++ head/lib/libelf/elf_getdata.3 Wed Jul 21 08:54:46 2010 (r210324) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006 Joseph Koshy. All rights reserved. +.\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -142,6 +142,32 @@ always returns .Vt Elf_Data structures of type .Dv ELF_T_BYTE . +.Ss Special handling of SHT_NOBITS sections +For sections of type +.Dv SHT_NOBITS , +the functions +.Fn elf_getdata +and +.Fn elf_rawdata +return a pointer to a valid +.Vt Elf_Data +structure that has its +.Va d_buf +member set to NULL and its +.Va d_size +member set to the size of the section. +.Pp +If an application wishes to create a section of type +.Dv SHT_NOBITS , +it should add a data buffer to the section using function +.Fn elf_newdata . +It should then set the +.Va d_buf +and +.Va d_size +members of the returned +.Vt Elf_Data +structure to NULL and the desired size of the section respectively. .Sh RETURN VALUES These functions return a valid pointer to a data descriptor if successful, or NULL if an error occurs. From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 08:56:08 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABE3E1065675; Wed, 21 Jul 2010 08:56:08 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 61E728FC15; Wed, 21 Jul 2010 08:56:07 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id EB20D9CB083; Wed, 21 Jul 2010 10:51:17 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T0Jv-YfS2A9x; Wed, 21 Jul 2010 10:51:17 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 7EF8A9CB28F; Wed, 21 Jul 2010 10:51:17 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id o6L8pHY9028778; Wed, 21 Jul 2010 10:51:17 +0200 (CEST) (envelope-from rdivacky) Date: Wed, 21 Jul 2010 10:51:17 +0200 From: Roman Divacky To: Kai Wang Message-ID: <20100721085117.GA28722@freebsd.org> References: <201007210854.o6L8skIl067227@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201007210854.o6L8skIl067227@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: r210324 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 08:56:08 -0000 On Wed, Jul 21, 2010 at 08:54:46AM +0000, Kai Wang wrote: > Author: kaiw > Date: Wed Jul 21 08:54:46 2010 > New Revision: 210324 > URL: http://svn.freebsd.org/changeset/base/210324 > > Log: > - Correctly handle sections of type SHT_NOBITS. For these sections: > - elf_getdata() and elf_rawdata() should return an "Elf_Data" structure > that has its "d_buf" member set to NULL and "d_size" member set to > the nominal 'size' of the section. [1] > - Update the manual page for these functions. > - Fix a memory leak in an error handling path inside elf_getdata(). > - Use _libelf_allocate_data() in elf_newdata() for consistency. this is the fix that fixes -flto with gcc45? From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 08:58:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CD1A106566C; Wed, 21 Jul 2010 08:58:52 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52FCB8FC14; Wed, 21 Jul 2010 08:58:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6L8wqQP068182; Wed, 21 Jul 2010 08:58:52 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6L8wqHe068178; Wed, 21 Jul 2010 08:58:52 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007210858.o6L8wqHe068178@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 08: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: r210325 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 08:58:52 -0000 Author: kaiw Date: Wed Jul 21 08:58:52 2010 New Revision: 210325 URL: http://svn.freebsd.org/changeset/base/210325 Log: Bug fix: when updating headers using the gelf_update_*() functions, the appropriate `dirty' bit needs to be set for both the Elf32 and Elf64 case. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/gelf_ehdr.c head/lib/libelf/gelf_phdr.c head/lib/libelf/gelf_shdr.c Modified: head/lib/libelf/gelf_ehdr.c ============================================================================== --- head/lib/libelf/gelf_ehdr.c Wed Jul 21 08:54:46 2010 (r210324) +++ head/lib/libelf/gelf_ehdr.c Wed Jul 21 08:58:52 2010 (r210325) @@ -137,6 +137,8 @@ gelf_update_ehdr(Elf *e, GElf_Ehdr *s) if ((ehdr = _libelf_ehdr(e, ec, 0)) == NULL) return (0); + (void) elf_flagehdr(e, ELF_C_SET, ELF_F_DIRTY); + if (ec == ELFCLASS64) { eh64 = (Elf64_Ehdr *) ehdr; *eh64 = *s; @@ -161,7 +163,5 @@ gelf_update_ehdr(Elf *e, GElf_Ehdr *s) eh32->e_shnum = s->e_shnum; eh32->e_shstrndx = s->e_shstrndx; - (void) elf_flagehdr(e, ELF_C_SET, ELF_F_DIRTY); - return (1); } Modified: head/lib/libelf/gelf_phdr.c ============================================================================== --- head/lib/libelf/gelf_phdr.c Wed Jul 21 08:54:46 2010 (r210324) +++ head/lib/libelf/gelf_phdr.c Wed Jul 21 08:58:52 2010 (r210325) @@ -155,6 +155,8 @@ gelf_update_phdr(Elf *e, int ndx, GElf_P return (0); } + (void) elf_flagphdr(e, ELF_C_SET, ELF_F_DIRTY); + if (ec == ELFCLASS64) { ph64 = e->e_u.e_elf.e_phdr.e_phdr64 + ndx; *ph64 = *s; @@ -172,7 +174,5 @@ gelf_update_phdr(Elf *e, int ndx, GElf_P LIBELF_COPY_U32(ph32, s, p_memsz); LIBELF_COPY_U32(ph32, s, p_align); - (void) elf_flagphdr(e, ELF_C_SET, ELF_F_DIRTY); - return (1); } Modified: head/lib/libelf/gelf_shdr.c ============================================================================== --- head/lib/libelf/gelf_shdr.c Wed Jul 21 08:54:46 2010 (r210324) +++ head/lib/libelf/gelf_shdr.c Wed Jul 21 08:58:52 2010 (r210325) @@ -107,6 +107,8 @@ gelf_update_shdr(Elf_Scn *scn, GElf_Shdr return (0); } + (void) elf_flagscn(scn, ELF_C_SET, ELF_F_DIRTY); + if (ec == ELFCLASS64) { scn->s_shdr.s_shdr64 = *s; return (1); @@ -125,7 +127,5 @@ gelf_update_shdr(Elf_Scn *scn, GElf_Shdr LIBELF_COPY_U32(sh32, s, sh_addralign); LIBELF_COPY_U32(sh32, s, sh_entsize); - (void) elf_flagscn(scn, ELF_C_SET, ELF_F_DIRTY); - return (1); } From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:04:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3761A1065675; Wed, 21 Jul 2010 09:04:59 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ww0-f51.google.com (mail-ww0-f51.google.com [74.125.82.51]) by mx1.freebsd.org (Postfix) with ESMTP id 46A348FC1C; Wed, 21 Jul 2010 09:04:57 +0000 (UTC) Received: by wwb22 with SMTP id 22so613483wwb.8 for ; Wed, 21 Jul 2010 02:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=NKF26/icjuF+uinYRejPl7MeooPmpOfk2+SJ3hsJLLs=; b=AtIf8rxm2CsvWt8TwUqkW8swuJvBicP465sQ6RTnVVwgCBMWGzHGG8Ni1crxEsGQbv 8WhdzFhONr8d0CfdRXBHPsMdFJnGKg4yqv46nGZ+zhz5Vy7Ee/ikQHxO8V8WxMCcLtWP q/7iNKs9Pk5iQqhCDZOT77TBG8utifWp1/pEQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=NrOD+5QCb8WJSz/lbs/QdcmVd7XWeScleFL8Cu4qEErKOVbYGHKJLbed2TeXkS+Uwo haLCM7bI3rabunCf6EakoSukIhxmYu5GPY51h/6QGhPB2/ZgEVc73zGffDynAFvKgMs0 jp4r/hbnjMF4C2FjLExB8yAPUyVd5LsF3kiQ8= Received: by 10.216.145.99 with SMTP id o77mr6443268wej.113.1279703097118; Wed, 21 Jul 2010 02:04:57 -0700 (PDT) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.216.87.206 with HTTP; Wed, 21 Jul 2010 02:04:37 -0700 (PDT) In-Reply-To: <20100721134319.E7228@delplex.bde.org> References: <201007181015.o6IAFXvK018739@svn.freebsd.org> <201007190829.21995.jhb@freebsd.org> <20100721134319.E7228@delplex.bde.org> From: Ivan Voras Date: Wed, 21 Jul 2010 11:04:37 +0200 X-Google-Sender-Auth: GxH2EOCxwPk7RNzTKM0rjVjrFHM Message-ID: To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r210217 - 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, 21 Jul 2010 09:04:59 -0000 On 21 July 2010 06:18, Bruce Evans wrote: > On Mon, 19 Jul 2010, John Baldwin wrote: > >>> Log: >>> =C2=A0In keeping with the Age-of-the-fruitbat theme, scale up hirunning= space >>> on >>> =C2=A0machines which can clearly afford the memory. >>> >>> =C2=A0This is a somewhat conservative version of the patch - more fine = tuning >>> may be >>> =C2=A0necessary. >>> >>> =C2=A0Idea from: Thread on hackers@ >>> =C2=A0Discussed with: alc > > Sorry I didn't look at the thread, but I wonder if you should increase > lorunningspace similarly. The previous ratio of lorunningspace to hirunningspace was 1/2 - is this still a good target? > There is a possibly related problem with writing through file systems to > high-latency disk devices like dvds. =C2=A0getblk() often takes many seco= nds, > and occasionally takes a couple of _minutes_. =C2=A0dvd's aren't quite th= at > slow, and can easily write hirunningspace =3D 1MB in 1 second, except > possibly if the file system is not designed for high-latency devices > (like most including cd9660 and udf are :-() so it does lots of random > i/o). > > The above is mostly for 1 active file system... It does seem like there would be more benefitial to hang these variables per mount-point or something similar but I'm content that they are tunable and that the new values help high-end machines, probably in cooperation with tagged (NCQ-like) IO. >> Presumably you could use 'lmax(lmin(..., 16 * 1024 * 1024), 1024 * >> 1024))'? > > Better. > Normal formatting is sometimes broken to avoid lines longer than 80 > characters. =C2=A0This works here. =C2=A0I don't like this. Yes, this was the reason for the original patch's formatting :) From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:05:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64989106564A; Wed, 21 Jul 2010 09:05:52 +0000 (UTC) (envelope-from kaiwang27@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5F2A68FC25; Wed, 21 Jul 2010 09:05:51 +0000 (UTC) Received: by eyh6 with SMTP id 6so1780638eyh.13 for ; Wed, 21 Jul 2010 02:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received :x-authentication-warning:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=5VSiORzxeNTua39ZGUjvq7fecBmQbmtuXgBk9gX/hos=; b=dxciV3IKBByPbdRlkT5NUcq5bborEhoHb/qoU7JOtfYUgHj+H4P4Yo7lINuEMiUDwa zldMEO5InQdOGLoVVi6uZ7sRY0HdQ1CiSsA7Nqp2dx5bgRKUkn7MWscZS0Us3q2Bc1GT JXdGnawP4bpOML8izh1fRbPl61o3cgUzc2hwo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=x-authentication-warning:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; b=UO9KerSCi9alCYHbZQ+DQHpxGcxpE1rLiBi7QQFgvTnz7grRid7JYvk4cwv/JvubIg M0g1CDCAYFwGW9SF1/OFTPJR4P5hyOhSyFWe4j12PFWUvKFWMQAaDwBY5mj8JkqWQBTT WKmMVf6FrjiHX/05IOqNux4Tr+Ebt0YMkQkJs= Received: by 10.213.17.7 with SMTP id q7mr5850035eba.2.1279703150200; Wed, 21 Jul 2010 02:05:50 -0700 (PDT) Received: from localhost (81-233-38-26-no36.tbcn.telia.com [81.233.38.26]) by mx.google.com with ESMTPS id v8sm53053416eeh.8.2010.07.21.02.05.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Jul 2010 02:05:49 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=localhost.my.domain) by localhost with esmtp (Exim 4.71 (FreeBSD)) (envelope-from ) id 1ObVFL-00014b-RU; Wed, 21 Jul 2010 11:05:47 +0200 Received: (from kaiw@localhost) by localhost.my.domain (8.14.3/8.14.3/Submit) id o6L95lYI004128; Wed, 21 Jul 2010 11:05:47 +0200 (CEST) (envelope-from kaiwang27@gmail.com) X-Authentication-Warning: localhost.my.domain: kaiw set sender to kaiwang27@gmail.com using -f Date: Wed, 21 Jul 2010 11:05:47 +0200 From: Kai Wang To: Roman Divacky Message-ID: <20100721090547.GA2532@viskning> References: <201007210854.o6L8skIl067227@svn.freebsd.org> <20100721085117.GA28722@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20100721085117.GA28722@freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r210324 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 09:05:52 -0000 On Wed, Jul 21, 2010 at 10:51:17AM +0200, Roman Divacky wrote: > On Wed, Jul 21, 2010 at 08:54:46AM +0000, Kai Wang wrote: > > Author: kaiw > > Date: Wed Jul 21 08:54:46 2010 > > New Revision: 210324 > > URL: http://svn.freebsd.org/changeset/base/210324 > > > > Log: > > - Correctly handle sections of type SHT_NOBITS. For these sections: > > - elf_getdata() and elf_rawdata() should return an "Elf_Data" structure > > that has its "d_buf" member set to NULL and "d_size" member set to > > the nominal 'size' of the section. [1] > > - Update the manual page for these functions. > > - Fix a memory leak in an error handling path inside elf_getdata(). > > - Use _libelf_allocate_data() in elf_newdata() for consistency. > > this is the fix that fixes -flto with gcc45? No. This fixes is irrelevant to gcc LTO. Actually, this partially fixed the empty section problem reported by kan@. I'll write you and kan@ a private mail about kan@'s patch later. Kai From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:06:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id E2FFF1065674; Wed, 21 Jul 2010 09:06:23 +0000 (UTC) Date: Wed, 21 Jul 2010 09:06:23 +0000 From: Alexey Dokuchaev To: Kai Wang Message-ID: <20100721090623.GA21607@FreeBSD.org> References: <201007210843.o6L8hmo5064622@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201007210843.o6L8hmo5064622@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r210321 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 09:06:24 -0000 On Wed, Jul 21, 2010 at 08:43:48AM +0000, Kai Wang wrote: > Author: kaiw > Date: Wed Jul 21 08:43:48 2010 > New Revision: 210321 > URL: http://svn.freebsd.org/changeset/base/210321 > > Log: > Remove a superfluous comment. > > Obtained from: elftoolchain > MFC after: 1 month (Just picking random of the similar commits): guys, please, try to uniformly align commit meta tags: Obtained from: somewhere MFC after: sometime Foo bar: baz qux ... Broken alignment considerably pessimizes commit log grasping, as it requires more post-processing work after reading it off. Thanks. ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:12:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A84F106566C; Wed, 21 Jul 2010 09:12:10 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (unknown [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 030228FC1B; Wed, 21 Jul 2010 09:12:10 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id D685B2A2A8D6; Wed, 21 Jul 2010 11:12:08 +0200 (CEST) Date: Wed, 21 Jul 2010 11:12:08 +0200 From: Ed Schouten To: Alexey Dokuchaev Message-ID: <20100721091208.GG1742@hoeg.nl> References: <201007210843.o6L8hmo5064622@svn.freebsd.org> <20100721090623.GA21607@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gi8aKAu241S2WqNd" Content-Disposition: inline In-Reply-To: <20100721090623.GA21607@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kai Wang Subject: Re: svn commit: r210321 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 09:12:10 -0000 --gi8aKAu241S2WqNd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Alexey Dokuchaev wrote: > (Just picking random of the similar commits): guys, please, try to > uniformly align commit meta tags: I guess it was aligned properly using tabs, but the whitespace added to the beginning of the line causes it to jump one tab forward. --=20 Ed Schouten WWW: http://80386.nl/ --gi8aKAu241S2WqNd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (FreeBSD) iEYEARECAAYFAkxGuegACgkQ52SDGA2eCwXiAACfSNA2LLmzhITka9Wjihh3Hpmy Wq8AnjYvB/yI5MhOieVDp/51SDeluA/K =UrdG -----END PGP SIGNATURE----- --gi8aKAu241S2WqNd-- From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:14:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94BDD1065676; Wed, 21 Jul 2010 09:14:37 +0000 (UTC) (envelope-from kaiwang27@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9824D8FC1B; Wed, 21 Jul 2010 09:14:36 +0000 (UTC) Received: by eyh6 with SMTP id 6so1782797eyh.13 for ; Wed, 21 Jul 2010 02:14:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received :x-authentication-warning:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=M18prd2HYoyMRPzPry5r6p3u336YhbglLxxYEtz+8Ik=; b=dsE/XI5G1dBFxWuhrwlgxHpi6rfziH1V/jSvZCgrmpTBvvc47eNGWqPLG7l1prT7iG 5NyRorDfLGgP9JsYkWjDK9/rPsG1PXPUn4hG77M1BAj1CK0S/1rGaAdFXoNd86lZynX9 UL7g2OYdIk/8OKXR3mNoar0Wsjrr9KrbmJboU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=x-authentication-warning:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; b=TCXyKH0wiaJWyv7Ni7bTmF3dnzZrfz1Z4DKvAUh4DR0OjqmAnTujV0EB67P83u5L5a Ku74ArHeOYr44w7Ujy4Pmfo8QnUwvnACw734HA1ARMLWfMLhX0dXZki+tHTKvYsKKZCU CsHxhrxoybDneEIUAI6LXB9fUEVqtZ7lVbx/8= Received: by 10.213.30.15 with SMTP id s15mr5919746ebc.56.1279703675664; Wed, 21 Jul 2010 02:14:35 -0700 (PDT) Received: from localhost (81-233-38-26-no36.tbcn.telia.com [81.233.38.26]) by mx.google.com with ESMTPS id v8sm53092295eeh.2.2010.07.21.02.14.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Jul 2010 02:14:34 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=localhost.my.domain) by localhost with esmtp (Exim 4.71 (FreeBSD)) (envelope-from ) id 1ObVNp-00015I-Jx; Wed, 21 Jul 2010 11:14:33 +0200 Received: (from kaiw@localhost) by localhost.my.domain (8.14.3/8.14.3/Submit) id o6L9EXa7004171; Wed, 21 Jul 2010 11:14:33 +0200 (CEST) (envelope-from kaiwang27@gmail.com) X-Authentication-Warning: localhost.my.domain: kaiw set sender to kaiwang27@gmail.com using -f Date: Wed, 21 Jul 2010 11:14:33 +0200 From: Kai Wang To: Alexey Dokuchaev Message-ID: <20100721091433.GB2532@viskning> References: <201007210843.o6L8hmo5064622@svn.freebsd.org> <20100721090623.GA21607@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20100721090623.GA21607@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r210321 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 09:14:37 -0000 On Wed, Jul 21, 2010 at 09:06:23AM +0000, Alexey Dokuchaev wrote: > On Wed, Jul 21, 2010 at 08:43:48AM +0000, Kai Wang wrote: > > Author: kaiw > > Date: Wed Jul 21 08:43:48 2010 > > New Revision: 210321 > > URL: http://svn.freebsd.org/changeset/base/210321 > > > > Log: > > Remove a superfluous comment. > > > > Obtained from: elftoolchain > > MFC after: 1 month > > (Just picking random of the similar commits): guys, please, try to > uniformly align commit meta tags: > > Obtained from: somewhere > MFC after: sometime > Foo bar: baz qux ... > > Broken alignment considerably pessimizes commit log grasping, as it > requires more post-processing work after reading it off. My bad for this one... I actually aligned it in editor at first. However, since I was using hard tabs and commit log prepends two spaces for each line, the resulted commit log became unaligned... Kai From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:20:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AE321065674; Wed, 21 Jul 2010 09:20:41 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A72B8FC18; Wed, 21 Jul 2010 09:20:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6L9Ketc073153; Wed, 21 Jul 2010 09:20:40 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6L9KeQ1073151; Wed, 21 Jul 2010 09:20:40 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007210920.o6L9KeQ1073151@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 09:20: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: r210326 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 09:20:41 -0000 Author: kaiw Date: Wed Jul 21 09:20:40 2010 New Revision: 210326 URL: http://svn.freebsd.org/changeset/base/210326 Log: Improve compatibility with other implementations of the ELF(3) API: when an output file has no program headers, set the 'e_phentsize' field of the ELF executable header to zero. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/elf_update.c Modified: head/lib/libelf/elf_update.c ============================================================================== --- head/lib/libelf/elf_update.c Wed Jul 21 08:58:52 2010 (r210325) +++ head/lib/libelf/elf_update.c Wed Jul 21 09:20:40 2010 (r210326) @@ -422,8 +422,8 @@ _libelf_resync_elf(Elf *e) (E)->e_ident[EI_VERSION] = (V); \ (E)->e_ehsize = _libelf_fsize(ELF_T_EHDR, (EC), (V), \ (size_t) 1); \ - (E)->e_phentsize = _libelf_fsize(ELF_T_PHDR, (EC), (V), \ - (size_t) 1); \ + (E)->e_phentsize = (phnum == 0) ? 0 : _libelf_fsize( \ + ELF_T_PHDR, (EC), (V), (size_t) 1); \ (E)->e_shentsize = _libelf_fsize(ELF_T_SHDR, (EC), (V), \ (size_t) 1); \ } while (0) From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:27:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F61B106566C; Wed, 21 Jul 2010 09:27:00 +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 8CE598FC15; Wed, 21 Jul 2010 09:27:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6L9R0Zo074585; Wed, 21 Jul 2010 09:27:00 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6L9R07L074578; Wed, 21 Jul 2010 09:27:00 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201007210927.o6L9R07L074578@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 21 Jul 2010 09:27: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: r210327 - in head/sys: mips/include mips/mips vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2010 09:27:00 -0000 Author: jchandra Date: Wed Jul 21 09:27:00 2010 New Revision: 210327 URL: http://svn.freebsd.org/changeset/base/210327 Log: Redo the page table page allocation on MIPS, as suggested by alc@. The UMA zone based allocation is replaced by a scheme that creates a new free page list for the KSEG0 region, and a new function in sys/vm that allocates pages from a specific free page list. This also fixes a race condition introduced by the UMA based page table page allocation code. Dropping the page queue and pmap locks before the call to uma_zfree, and re-acquiring them afterwards will introduce a race condtion(noted by alc@). The changes are : - Revert the earlier changes in MIPS pmap.c that added UMA zone for page table pages. - Add a new freelist VM_FREELIST_HIGHMEM to MIPS vmparam.h for memory that is not directly mapped (in 32bit kernel). Normal page allocations will first try the HIGHMEM freelist and then the default(direct mapped) freelist. - Add a new function 'vm_page_t vm_page_alloc_freelist(int flind, int order, int req)' to vm/vm_page.c to allocate a page from a specified freelist. The MIPS page table pages will be allocated using this function from the freelist containing direct mapped pages. - Move the page initialization code from vm_phys_alloc_contig() to a new function vm_page_alloc_init(), and use this function to initialize pages in vm_page_alloc_freelist() too. - Split the function vm_phys_alloc_pages(int pool, int order) to create vm_phys_alloc_freelist_pages(int flind, int pool, int order), and use this function from both vm_page_alloc_freelist() and vm_phys_alloc_pages(). Reviewed by: alc Modified: head/sys/mips/include/vmparam.h head/sys/mips/mips/pmap.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h Modified: head/sys/mips/include/vmparam.h ============================================================================== --- head/sys/mips/include/vmparam.h Wed Jul 21 09:20:40 2010 (r210326) +++ head/sys/mips/include/vmparam.h Wed Jul 21 09:27:00 2010 (r210327) @@ -125,7 +125,6 @@ #define VM_NRESERVLEVEL 0 #endif - /* virtual sizes (bytes) for various kernel submaps */ #ifndef VM_KMEM_SIZE #define VM_KMEM_SIZE (12 * 1024 * 1024) @@ -174,13 +173,24 @@ #define VM_FREEPOOL_DIRECT 1 /* - * we support 1 free list: + * we support 2 free lists: * - * - DEFAULT for all systems + * - DEFAULT for direct mapped (KSEG0) pages. + * Note: This usage of DEFAULT may be misleading because we use + * DEFAULT for allocating direct mapped pages. The normal page + * allocations use HIGHMEM if available, and then DEFAULT. + * - HIGHMEM for other pages */ - +#ifdef __mips_n64 #define VM_NFREELIST 1 #define VM_FREELIST_DEFAULT 0 +#else +#define VM_NFREELIST 2 +#define VM_FREELIST_DEFAULT 1 +#define VM_FREELIST_HIGHMEM 0 +#define VM_FREELIST_DIRECT VM_FREELIST_DEFAULT +#define VM_HIGHMEM_ADDRESS ((vm_paddr_t)0x20000000) +#endif /* * The largest allocation size is 1MB. Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Wed Jul 21 09:20:40 2010 (r210326) +++ head/sys/mips/mips/pmap.c Wed Jul 21 09:27:00 2010 (r210327) @@ -187,8 +187,8 @@ static vm_page_t pmap_allocpte(pmap_t pm static vm_page_t _pmap_allocpte(pmap_t pmap, unsigned ptepindex, int flags); static int pmap_unuse_pt(pmap_t, vm_offset_t, vm_page_t); static int init_pte_prot(vm_offset_t va, vm_page_t m, vm_prot_t prot); -static vm_page_t pmap_alloc_pte_page(pmap_t, unsigned int, int, vm_offset_t *); -static void pmap_release_pte_page(vm_page_t); +static vm_page_t pmap_alloc_pte_page(unsigned int index, int req); +static void pmap_grow_pte_page_cache(void); #ifdef SMP static void pmap_invalidate_page_action(void *arg); @@ -196,10 +196,6 @@ static void pmap_invalidate_all_action(v static void pmap_update_page_action(void *arg); #endif -static void pmap_ptpgzone_dtor(void *mem, int size, void *arg); -static void *pmap_ptpgzone_allocf(uma_zone_t, int, u_int8_t *, int); -static uma_zone_t ptpgzone; - #if !defined(__mips_n64) struct local_sysmaps { vm_offset_t base; @@ -539,10 +535,6 @@ pmap_init(void) pv_entry_max = PMAP_SHPGPERPROC * maxproc + cnt.v_page_count; pv_entry_high_water = 9 * (pv_entry_max / 10); uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max); - - ptpgzone = uma_zcreate("PT ENTRY", PAGE_SIZE, NULL, pmap_ptpgzone_dtor, - NULL, NULL, PAGE_SIZE - 1, UMA_ZONE_NOFREE | UMA_ZONE_ZINIT); - uma_zone_set_allocf(ptpgzone, pmap_ptpgzone_allocf); } /*************************************************** @@ -882,12 +874,8 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_pa /* * If the page is finally unwired, simply free it. */ + vm_page_free_zero(m); atomic_subtract_int(&cnt.v_wire_count, 1); - PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); - pmap_release_pte_page(m); - vm_page_lock_queues(); - PMAP_LOCK(pmap); return (1); } @@ -947,95 +935,30 @@ pmap_pinit0(pmap_t pmap) } static void -pmap_ptpgzone_dtor(void *mem, int size, void *arg) +pmap_grow_pte_page_cache() { -#ifdef INVARIANTS - static char zeropage[PAGE_SIZE]; - KASSERT(size == PAGE_SIZE, - ("pmap_ptpgzone_dtor: invalid size %d", size)); - KASSERT(bcmp(mem, zeropage, PAGE_SIZE) == 0, - ("pmap_ptpgzone_dtor: freeing a non-zeroed page")); -#endif + vm_contig_grow_cache(3, 0, MIPS_KSEG0_LARGEST_PHYS); } -static void * -pmap_ptpgzone_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) -{ - vm_page_t m; - vm_paddr_t paddr; - int tries; - - KASSERT(bytes == PAGE_SIZE, - ("pmap_ptpgzone_allocf: invalid allocation size %d", bytes)); - - *flags = UMA_SLAB_PRIV; - tries = 0; -retry: - m = vm_phys_alloc_contig(1, 0, MIPS_KSEG0_LARGEST_PHYS, - PAGE_SIZE, PAGE_SIZE); - if (m == NULL) { - if (tries < ((wait & M_NOWAIT) != 0 ? 1 : 3)) { - vm_contig_grow_cache(tries, 0, MIPS_KSEG0_LARGEST_PHYS); - tries++; - goto retry; - } else - return (NULL); - } - - paddr = VM_PAGE_TO_PHYS(m); - return ((void *)MIPS_PHYS_TO_KSEG0(paddr)); -} - static vm_page_t -pmap_alloc_pte_page(pmap_t pmap, unsigned int index, int wait, vm_offset_t *vap) +pmap_alloc_pte_page(unsigned int index, int req) { - vm_paddr_t paddr; - void *va; vm_page_t m; - int locked; - locked = mtx_owned(&pmap->pm_mtx); - if (locked) { - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); - } - va = uma_zalloc(ptpgzone, wait); - if (locked) { - vm_page_lock_queues(); - PMAP_LOCK(pmap); - } - if (va == NULL) + m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, 0, req); + if (m == NULL) return (NULL); - paddr = MIPS_KSEG0_TO_PHYS(va); - m = PHYS_TO_VM_PAGE(paddr); - - if (!locked) - vm_page_lock_queues(); - m->pindex = index; - m->valid = VM_PAGE_BITS_ALL; - m->wire_count = 1; - if (!locked) - vm_page_unlock_queues(); + if ((m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + m->pindex = index; atomic_add_int(&cnt.v_wire_count, 1); - *vap = (vm_offset_t)va; + m->wire_count = 1; return (m); } -static void -pmap_release_pte_page(vm_page_t m) -{ - void *va; - vm_paddr_t paddr; - - paddr = VM_PAGE_TO_PHYS(m); - va = (void *)MIPS_PHYS_TO_KSEG0(paddr); - uma_zfree(ptpgzone, va); -} - /* * Initialize a preallocated and zeroed pmap structure, * such as one in a vmspace structure. @@ -1052,10 +975,10 @@ pmap_pinit(pmap_t pmap) /* * allocate the page directory page */ - ptdpg = pmap_alloc_pte_page(pmap, NUSERPGTBLS, M_WAITOK, &ptdva); - if (ptdpg == NULL) - return (0); + while ((ptdpg = pmap_alloc_pte_page(NUSERPGTBLS, VM_ALLOC_NORMAL)) == NULL) + pmap_grow_pte_page_cache(); + ptdva = MIPS_PHYS_TO_KSEG0(VM_PAGE_TO_PHYS(ptdpg)); pmap->pm_segtab = (pd_entry_t *)ptdva; pmap->pm_active = 0; pmap->pm_ptphint = NULL; @@ -1086,15 +1009,28 @@ _pmap_allocpte(pmap_t pmap, unsigned pte /* * Find or fabricate a new pagetable page */ - m = pmap_alloc_pte_page(pmap, ptepindex, flags, &pteva); - if (m == NULL) + if ((m = pmap_alloc_pte_page(ptepindex, VM_ALLOC_NORMAL)) == NULL) { + if (flags & M_WAITOK) { + PMAP_UNLOCK(pmap); + vm_page_unlock_queues(); + pmap_grow_pte_page_cache(); + vm_page_lock_queues(); + PMAP_LOCK(pmap); + } + + /* + * Indicate the need to retry. While waiting, the page + * table page may have been allocated. + */ return (NULL); + } /* * Map the pagetable page into the process address space, if it * isn't already there. */ + pteva = MIPS_PHYS_TO_KSEG0(VM_PAGE_TO_PHYS(m)); pmap->pm_stats.resident_count++; pmap->pm_segtab[ptepindex] = (pd_entry_t)pteva; @@ -1190,7 +1126,7 @@ pmap_release(pmap_t pmap) ptdpg->wire_count--; atomic_subtract_int(&cnt.v_wire_count, 1); - pmap_release_pte_page(ptdpg); + vm_page_free_zero(ptdpg); PMAP_LOCK_DESTROY(pmap); } @@ -1200,7 +1136,6 @@ pmap_release(pmap_t pmap) void pmap_growkernel(vm_offset_t addr) { - vm_offset_t pageva; vm_page_t nkpg; pt_entry_t *pte; int i; @@ -1235,14 +1170,13 @@ pmap_growkernel(vm_offset_t addr) /* * This index is bogus, but out of the way */ - nkpg = pmap_alloc_pte_page(kernel_pmap, nkpt, M_NOWAIT, &pageva); - + nkpg = pmap_alloc_pte_page(nkpt, VM_ALLOC_INTERRUPT); if (!nkpg) panic("pmap_growkernel: no memory to grow kernel"); nkpt++; - pte = (pt_entry_t *)pageva; - segtab_pde(kernel_segmap, kernel_vm_end) = pte; + pte = (pt_entry_t *)MIPS_PHYS_TO_KSEG0(VM_PAGE_TO_PHYS(nkpg)); + segtab_pde(kernel_segmap, kernel_vm_end) = (pd_entry_t)pte; /* * The R[4-7]?00 stores only one copy of the Global bit in Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Jul 21 09:20:40 2010 (r210326) +++ head/sys/vm/vm_page.c Wed Jul 21 09:27:00 2010 (r210327) @@ -1355,6 +1355,95 @@ vm_page_alloc(vm_object_t object, vm_pin } /* + * Initialize a page that has been freshly dequeued from a freelist. + * The caller has to drop the vnode returned, if it is not NULL. + * + * To be called with vm_page_queue_free_mtx held. + */ +struct vnode * +vm_page_alloc_init(vm_page_t m) +{ + struct vnode *drop; + vm_object_t m_object; + + KASSERT(m->queue == PQ_NONE, + ("vm_page_alloc_init: page %p has unexpected queue %d", + m, m->queue)); + KASSERT(m->wire_count == 0, + ("vm_page_alloc_init: page %p is wired", m)); + KASSERT(m->hold_count == 0, + ("vm_page_alloc_init: page %p is held", m)); + KASSERT(m->busy == 0, + ("vm_page_alloc_init: page %p is busy", m)); + KASSERT(m->dirty == 0, + ("vm_page_alloc_init: page %p is dirty", m)); + KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, + ("vm_page_alloc_init: page %p has unexpected memattr %d", + m, pmap_page_get_memattr(m))); + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); + drop = NULL; + if ((m->flags & PG_CACHED) != 0) { + m->valid = 0; + m_object = m->object; + vm_page_cache_remove(m); + if (m_object->type == OBJT_VNODE && + m_object->cache == NULL) + drop = m_object->handle; + } else { + KASSERT(VM_PAGE_IS_FREE(m), + ("vm_page_alloc_init: page %p is not free", m)); + KASSERT(m->valid == 0, + ("vm_page_alloc_init: free page %p is valid", m)); + cnt.v_free_count--; + } + if (m->flags & PG_ZERO) + vm_page_zero_count--; + /* Don't clear the PG_ZERO flag; we'll need it later. */ + m->flags = PG_UNMANAGED | (m->flags & PG_ZERO); + m->oflags = 0; + /* Unmanaged pages don't use "act_count". */ + return (drop); +} + +/* + * vm_page_alloc_freelist: + * + * Allocate a page from the specified freelist with specified order. + * Only the ALLOC_CLASS values in req are honored, other request flags + * are ignored. + */ +vm_page_t +vm_page_alloc_freelist(int flind, int order, int req) +{ + struct vnode *drop; + vm_page_t m; + int page_req; + + m = NULL; + page_req = req & VM_ALLOC_CLASS_MASK; + mtx_lock(&vm_page_queue_free_mtx); + /* + * Do not allocate reserved pages unless the req has asked for it. + */ + if (cnt.v_free_count + cnt.v_cache_count > cnt.v_free_reserved || + (page_req == VM_ALLOC_SYSTEM && + cnt.v_free_count + cnt.v_cache_count > cnt.v_interrupt_free_min) || + (page_req == VM_ALLOC_INTERRUPT && + cnt.v_free_count + cnt.v_cache_count > 0)) { + m = vm_phys_alloc_freelist_pages(flind, VM_FREEPOOL_DIRECT, order); + } + if (m == NULL) { + mtx_unlock(&vm_page_queue_free_mtx); + return (NULL); + } + drop = vm_page_alloc_init(m); + mtx_unlock(&vm_page_queue_free_mtx); + if (drop) + vdrop(drop); + return (m); +} + +/* * vm_wait: (also see VM_WAIT macro) * * Block until free pages are available for allocation Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Jul 21 09:20:40 2010 (r210326) +++ head/sys/vm/vm_page.h Wed Jul 21 09:27:00 2010 (r210327) @@ -262,6 +262,7 @@ extern struct vpglocks pa_lock[]; * */ +struct vnode; extern int vm_page_zero_count; extern vm_page_t vm_page_array; /* First resident page in table */ @@ -339,6 +340,8 @@ void vm_pageq_remove(vm_page_t m); void vm_page_activate (vm_page_t); vm_page_t vm_page_alloc (vm_object_t, vm_pindex_t, int); +vm_page_t vm_page_alloc_freelist(int, int, int); +struct vnode *vm_page_alloc_init(vm_page_t); vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); void vm_page_cache(vm_page_t); void vm_page_cache_free(vm_object_t, vm_pindex_t, vm_pindex_t); Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Wed Jul 21 09:20:40 2010 (r210326) +++ head/sys/vm/vm_phys.c Wed Jul 21 09:27:00 2010 (r210327) @@ -301,49 +301,67 @@ vm_phys_add_page(vm_paddr_t pa) vm_page_t vm_phys_alloc_pages(int pool, int order) { + vm_page_t m; + int flind; + + for (flind = 0; flind < vm_nfreelists; flind++) { + m = vm_phys_alloc_freelist_pages(flind, pool, order); + if (m != NULL) + return (m); + } + return (NULL); +} + +/* + * Find and dequeue a free page on the given free list, with the + * specified pool and order + */ +vm_page_t +vm_phys_alloc_freelist_pages(int flind, int pool, int order) +{ struct vm_freelist *fl; struct vm_freelist *alt; - int flind, oind, pind; + int oind, pind; vm_page_t m; + KASSERT(flind < VM_NFREELIST, + ("vm_phys_alloc_freelist_pages: freelist %d is out of range", flind)); KASSERT(pool < VM_NFREEPOOL, - ("vm_phys_alloc_pages: pool %d is out of range", pool)); + ("vm_phys_alloc_freelist_pages: pool %d is out of range", pool)); KASSERT(order < VM_NFREEORDER, - ("vm_phys_alloc_pages: order %d is out of range", order)); + ("vm_phys_alloc_freelist_pages: order %d is out of range", order)); mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); - for (flind = 0; flind < vm_nfreelists; flind++) { - fl = vm_phys_free_queues[flind][pool]; - for (oind = order; oind < VM_NFREEORDER; oind++) { - m = TAILQ_FIRST(&fl[oind].pl); + fl = vm_phys_free_queues[flind][pool]; + for (oind = order; oind < VM_NFREEORDER; oind++) { + m = TAILQ_FIRST(&fl[oind].pl); + if (m != NULL) { + TAILQ_REMOVE(&fl[oind].pl, m, pageq); + fl[oind].lcnt--; + m->order = VM_NFREEORDER; + vm_phys_split_pages(m, oind, fl, order); + return (m); + } + } + + /* + * The given pool was empty. Find the largest + * contiguous, power-of-two-sized set of pages in any + * pool. Transfer these pages to the given pool, and + * use them to satisfy the allocation. + */ + for (oind = VM_NFREEORDER - 1; oind >= order; oind--) { + for (pind = 0; pind < VM_NFREEPOOL; pind++) { + alt = vm_phys_free_queues[flind][pind]; + m = TAILQ_FIRST(&alt[oind].pl); if (m != NULL) { - TAILQ_REMOVE(&fl[oind].pl, m, pageq); - fl[oind].lcnt--; + TAILQ_REMOVE(&alt[oind].pl, m, pageq); + alt[oind].lcnt--; m->order = VM_NFREEORDER; + vm_phys_set_pool(pool, m, oind); vm_phys_split_pages(m, oind, fl, order); return (m); } } - - /* - * The given pool was empty. Find the largest - * contiguous, power-of-two-sized set of pages in any - * pool. Transfer these pages to the given pool, and - * use them to satisfy the allocation. - */ - for (oind = VM_NFREEORDER - 1; oind >= order; oind--) { - for (pind = 0; pind < VM_NFREEPOOL; pind++) { - alt = vm_phys_free_queues[flind][pind]; - m = TAILQ_FIRST(&alt[oind].pl); - if (m != NULL) { - TAILQ_REMOVE(&alt[oind].pl, m, pageq); - alt[oind].lcnt--; - m->order = VM_NFREEORDER; - vm_phys_set_pool(pool, m, oind); - vm_phys_split_pages(m, oind, fl, order); - return (m); - } - } - } } return (NULL); } @@ -592,7 +610,7 @@ vm_phys_alloc_contig(unsigned long npage { struct vm_freelist *fl; struct vm_phys_seg *seg; - vm_object_t m_object; + struct vnode *vp; vm_paddr_t pa, pa_last, size; vm_page_t deferred_vdrop_list, m, m_ret; int flind, i, oind, order, pind; @@ -687,50 +705,19 @@ done: vm_phys_split_pages(m_ret, oind, fl, order); for (i = 0; i < npages; i++) { m = &m_ret[i]; - KASSERT(m->queue == PQ_NONE, - ("vm_phys_alloc_contig: page %p has unexpected queue %d", - m, m->queue)); - KASSERT(m->wire_count == 0, - ("vm_phys_alloc_contig: page %p is wired", m)); - KASSERT(m->hold_count == 0, - ("vm_phys_alloc_contig: page %p is held", m)); - KASSERT(m->busy == 0, - ("vm_phys_alloc_contig: page %p is busy", m)); - KASSERT(m->dirty == 0, - ("vm_phys_alloc_contig: page %p is dirty", m)); - KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, - ("vm_phys_alloc_contig: page %p has unexpected memattr %d", - m, pmap_page_get_memattr(m))); - if ((m->flags & PG_CACHED) != 0) { - m->valid = 0; - m_object = m->object; - vm_page_cache_remove(m); - if (m_object->type == OBJT_VNODE && - m_object->cache == NULL) { - /* - * Enqueue the vnode for deferred vdrop(). - * - * Unmanaged pages don't use "pageq", so it - * can be safely abused to construct a short- - * lived queue of vnodes. - */ - m->pageq.tqe_prev = m_object->handle; - m->pageq.tqe_next = deferred_vdrop_list; - deferred_vdrop_list = m; - } - } else { - KASSERT(VM_PAGE_IS_FREE(m), - ("vm_phys_alloc_contig: page %p is not free", m)); - KASSERT(m->valid == 0, - ("vm_phys_alloc_contig: free page %p is valid", m)); - cnt.v_free_count--; + vp = vm_page_alloc_init(m); + if (vp != NULL) { + /* + * Enqueue the vnode for deferred vdrop(). + * + * Unmanaged pages don't use "pageq", so it + * can be safely abused to construct a short- + * lived queue of vnodes. + */ + m->pageq.tqe_prev = (void *)vp; + m->pageq.tqe_next = deferred_vdrop_list; + deferred_vdrop_list = m; } - if (m->flags & PG_ZERO) - vm_page_zero_count--; - /* Don't clear the PG_ZERO flag; we'll need it later. */ - m->flags = PG_UNMANAGED | (m->flags & PG_ZERO); - m->oflags = 0; - /* Unmanaged pages don't use "act_count". */ } for (; i < roundup2(npages, 1 << imin(oind, order)); i++) { m = &m_ret[i]; Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Wed Jul 21 09:20:40 2010 (r210326) +++ head/sys/vm/vm_phys.h Wed Jul 21 09:27:00 2010 (r210327) @@ -44,6 +44,7 @@ void vm_phys_add_page(vm_paddr_t pa); vm_page_t vm_phys_alloc_contig(unsigned long npages, vm_paddr_t low, vm_paddr_t high, unsigned long alignment, unsigned long boundary); +vm_page_t vm_phys_alloc_freelist_pages(int flind, int pool, int order); vm_page_t vm_phys_alloc_pages(int pool, int order); vm_paddr_t vm_phys_bootstrap_alloc(vm_size_t size, unsigned long alignment); void vm_phys_free_pages(vm_page_t m, int order); From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:27:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 381DA1065676; Wed, 21 Jul 2010 09:27:17 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 274FE8FC1F; Wed, 21 Jul 2010 09:27:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6L9RHjI074692; Wed, 21 Jul 2010 09:27:17 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6L9RHp0074690; Wed, 21 Jul 2010 09:27:17 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007210927.o6L9RHp0074690@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 09:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210328 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 09:27:17 -0000 Author: kaiw Date: Wed Jul 21 09:27:16 2010 New Revision: 210328 URL: http://svn.freebsd.org/changeset/base/210328 Log: Bug fix: permit the creation of zero-sized sections. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/elf_update.c Modified: head/lib/libelf/elf_update.c ============================================================================== --- head/lib/libelf/elf_update.c Wed Jul 21 09:27:00 2010 (r210327) +++ head/lib/libelf/elf_update.c Wed Jul 21 09:27:16 2010 (r210328) @@ -534,22 +534,24 @@ _libelf_write_scn(Elf *e, char *nf, Elf_ int ec; size_t fsz, msz, nobjects; uint32_t sh_type; - uint64_t sh_off; + uint64_t sh_off, sh_size; int elftype; Elf_Data *d, dst; - if ((ec = e->e_class) == ELFCLASS32) + if ((ec = e->e_class) == ELFCLASS32) { sh_type = s->s_shdr.s_shdr32.sh_type; - else + sh_size = (uint64_t) s->s_shdr.s_shdr32.sh_size; + } else { sh_type = s->s_shdr.s_shdr64.sh_type; + sh_size = s->s_shdr.s_shdr64.sh_size; + } /* * Ignore sections that do not allocate space in the file. */ - if (sh_type == SHT_NOBITS || sh_type == SHT_NULL) + if (sh_type == SHT_NOBITS || sh_type == SHT_NULL || sh_size == 0) return (rc); - elftype = _libelf_xlate_shtype(sh_type); assert(elftype >= ELF_T_FIRST && elftype <= ELF_T_LAST); From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:33:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B17CE1065673; Wed, 21 Jul 2010 09:33:45 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A144E8FC13; Wed, 21 Jul 2010 09:33:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6L9XjAv076186; Wed, 21 Jul 2010 09:33:45 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6L9Xj6b076184; Wed, 21 Jul 2010 09:33:45 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007210933.o6L9Xj6b076184@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 09:33: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: r210329 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 09:33:45 -0000 Author: kaiw Date: Wed Jul 21 09:33:45 2010 New Revision: 210329 URL: http://svn.freebsd.org/changeset/base/210329 Log: Use to declare the prototype for ftruncate(). Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/elf_begin.c Modified: head/lib/libelf/elf_begin.c ============================================================================== --- head/lib/libelf/elf_begin.c Wed Jul 21 09:27:16 2010 (r210328) +++ head/lib/libelf/elf_begin.c Wed Jul 21 09:33:45 2010 (r210329) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "_libelf.h" From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:44:21 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BC471065677; Wed, 21 Jul 2010 09:44:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 2BD8B8FC21; Wed, 21 Jul 2010 09:44:20 +0000 (UTC) Received: from c122-106-145-25.carlnfd1.nsw.optusnet.com.au (c122-106-145-25.carlnfd1.nsw.optusnet.com.au [122.106.145.25]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o6L9iHBW015493 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Jul 2010 19:44:18 +1000 Date: Wed, 21 Jul 2010 19:44:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Ivan Voras In-Reply-To: Message-ID: <20100721193900.L7531@delplex.bde.org> References: <201007181015.o6IAFXvK018739@svn.freebsd.org> <201007190829.21995.jhb@freebsd.org> <20100721134319.E7228@delplex.bde.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1262108218-1279705457=:7531" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin , Bruce Evans Subject: Re: svn commit: r210217 - 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, 21 Jul 2010 09:44:21 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1262108218-1279705457=:7531 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 21 Jul 2010, Ivan Voras wrote: > On 21 July 2010 06:18, Bruce Evans wrote: >> On Mon, 19 Jul 2010, John Baldwin wrote: >> >>>> Log: >>>> =C2=A0In keeping with the Age-of-the-fruitbat theme, scale up hirunnin= gspace >>>> on >>>> =C2=A0machines which can clearly afford the memory. >>>> >>>> =C2=A0This is a somewhat conservative version of the patch - more fine= tuning >>>> may be >>>> =C2=A0necessary. >>>> >>>> =C2=A0Idea from: Thread on hackers@ >>>> =C2=A0Discussed with: alc >> >> Sorry I didn't look at the thread, but I wonder if you should increase >> lorunningspace similarly. > > The previous ratio of lorunningspace to hirunningspace was 1/2 - is > this still a good target? I don't know if the ratio is more important than difference. Maybe neither is very important once the difference is not very small. > It does seem like there would be more benefitial to hang these > variables per mount-point or something similar but I'm content that > they are tunable and that the new values help high-end machines, > probably in cooperation with tagged (NCQ-like) IO. So the high end machine owners are less capable of tuning? :-) This might be the case even if they also have higher end money and support, since the higher end is bleeding edge. Bruce --0-1262108218-1279705457=:7531-- From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:47:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 335021065692; Wed, 21 Jul 2010 09:47:15 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 090728FC16; Wed, 21 Jul 2010 09:47:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6L9lEfi079238; Wed, 21 Jul 2010 09:47:14 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6L9lELb079234; Wed, 21 Jul 2010 09:47:14 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007210947.o6L9lELb079234@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 09:47: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: r210330 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 09:47:15 -0000 Author: kaiw Date: Wed Jul 21 09:47:14 2010 New Revision: 210330 URL: http://svn.freebsd.org/changeset/base/210330 Log: Allow an application that updates only the ELF Ehdr to work. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/_libelf.h head/lib/libelf/elf_scn.c head/lib/libelf/elf_update.c Modified: head/lib/libelf/_libelf.h ============================================================================== --- head/lib/libelf/_libelf.h Wed Jul 21 09:33:45 2010 (r210329) +++ head/lib/libelf/_libelf.h Wed Jul 21 09:47:14 2010 (r210330) @@ -176,6 +176,7 @@ void (*_libelf_get_translator(Elf_Type _ void *_libelf_getphdr(Elf *_e, int _elfclass); void *_libelf_getshdr(Elf_Scn *_scn, int _elfclass); void _libelf_init_elf(Elf *_e, Elf_Kind _kind); +int _libelf_load_scn(Elf *e, void *ehdr); int _libelf_malign(Elf_Type _t, int _elfclass); size_t _libelf_msize(Elf_Type _t, int _elfclass, unsigned int _version); void *_libelf_newphdr(Elf *_e, int _elfclass, size_t _count); Modified: head/lib/libelf/elf_scn.c ============================================================================== --- head/lib/libelf/elf_scn.c Wed Jul 21 09:33:45 2010 (r210329) +++ head/lib/libelf/elf_scn.c Wed Jul 21 09:47:14 2010 (r210330) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); /* * Load an ELF section table and create a list of Elf_Scn structures. */ -static int +int _libelf_load_scn(Elf *e, void *ehdr) { int ec, swapbytes; Modified: head/lib/libelf/elf_update.c ============================================================================== --- head/lib/libelf/elf_update.c Wed Jul 21 09:33:45 2010 (r210329) +++ head/lib/libelf/elf_update.c Wed Jul 21 09:47:14 2010 (r210330) @@ -472,6 +472,11 @@ _libelf_resync_elf(Elf *e) * file. */ + if (e->e_cmd != ELF_C_WRITE && + (e->e_flags & LIBELF_F_SHDRS_LOADED) == 0 && + _libelf_load_scn(e, ehdr) == 0) + return ((off_t) -1); + if ((rc = _libelf_resync_sections(e, rc)) < 0) return ((off_t) -1); @@ -726,14 +731,9 @@ _libelf_write_elf(Elf *e, off_t newsize) assert(phoff % _libelf_falign(ELF_T_PHDR, ec) == 0); assert(fsz > 0); + src.d_buf = _libelf_getphdr(e, ec); src.d_version = dst.d_version = e->e_version; src.d_type = ELF_T_PHDR; - - if (ec == ELFCLASS32) - src.d_buf = e->e_u.e_elf.e_phdr.e_phdr32; - else - src.d_buf = e->e_u.e_elf.e_phdr.e_phdr64; - src.d_size = phnum * _libelf_msize(ELF_T_PHDR, ec, e->e_version); From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:51:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32CAC1065670; Wed, 21 Jul 2010 09:51:25 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 223D58FC0C; Wed, 21 Jul 2010 09:51:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6L9pPFb080187; Wed, 21 Jul 2010 09:51:25 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6L9pPG8080185; Wed, 21 Jul 2010 09:51:25 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007210951.o6L9pPG8080185@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 09:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210331 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 09:51:25 -0000 Author: kaiw Date: Wed Jul 21 09:51:24 2010 New Revision: 210331 URL: http://svn.freebsd.org/changeset/base/210331 Log: Add a new ELF type denoting GNU style hash tables. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/libelf.h Modified: head/lib/libelf/libelf.h ============================================================================== --- head/lib/libelf/libelf.h Wed Jul 21 09:47:14 2010 (r210330) +++ head/lib/libelf/libelf.h Wed Jul 21 09:51:24 2010 (r210331) @@ -75,6 +75,7 @@ typedef enum { ELF_T_VNEED, ELF_T_WORD, ELF_T_XWORD, + ELF_T_GNUHASH, /* GNU style hash tables. */ ELF_T_NUM } Elf_Type; From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:51:53 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B8C91065675; Wed, 21 Jul 2010 09:51:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id B9AA68FC12; Wed, 21 Jul 2010 09:51:52 +0000 (UTC) Received: from c122-106-145-25.carlnfd1.nsw.optusnet.com.au (c122-106-145-25.carlnfd1.nsw.optusnet.com.au [122.106.145.25]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o6L9pncg027535 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Jul 2010 19:51:50 +1000 Date: Wed, 21 Jul 2010 19:51:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Alexey Dokuchaev In-Reply-To: <20100721090623.GA21607@FreeBSD.org> Message-ID: <20100721194659.L7533@delplex.bde.org> References: <201007210843.o6L8hmo5064622@svn.freebsd.org> <20100721090623.GA21607@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Kai Wang Subject: Re: svn commit: r210321 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 09:51:53 -0000 On Wed, 21 Jul 2010, Alexey Dokuchaev wrote: > On Wed, Jul 21, 2010 at 08:43:48AM +0000, Kai Wang wrote: >> Log: >> Remove a superfluous comment. >> >> Obtained from: elftoolchain >> MFC after: 1 month > > (Just picking random of the similar commits): guys, please, try to > uniformly align commit meta tags: It is perfectly aligned with tabs (and no 2-char commit mail indentation, and no N-char mailer quoting). > Obtained from: somewhere > MFC after: sometime > Foo bar: baz qux ... > > Broken alignment considerably pessimizes commit log grasping, as it > requires more post-processing work after reading it off. Do you mean for human grasping and automated post-processing? The automation should have no problems with the whitespace but might with the mailer quoting. "tags" should mean the part before the ":". Aligning those by making them all of the same length would help. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 09:56:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84A2A1065676; Wed, 21 Jul 2010 09:56:42 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A9858FC0A; Wed, 21 Jul 2010 09:56:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6L9ugbE081422; Wed, 21 Jul 2010 09:56:42 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6L9ugTM081418; Wed, 21 Jul 2010 09:56:42 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007210956.o6L9ugTM081418@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 09:56: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: r210332 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 09:56:42 -0000 Author: kaiw Date: Wed Jul 21 09:56:42 2010 New Revision: 210332 URL: http://svn.freebsd.org/changeset/base/210332 Log: Changes for supporting GNU Hash sections. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/libelf_align.c head/lib/libelf/libelf_fsize.m4 head/lib/libelf/libelf_msize.m4 Modified: head/lib/libelf/libelf_align.c ============================================================================== --- head/lib/libelf/libelf_align.c Wed Jul 21 09:51:24 2010 (r210331) +++ head/lib/libelf/libelf_align.c Wed Jul 21 09:56:42 2010 (r210332) @@ -51,6 +51,10 @@ struct align { .a32 = 0, \ .a64 = __alignof__(Elf64_##V) \ } +#define MALIGN_WORD() { \ + .a32 = __alignof__(int32_t), \ + .a64 = __alignof__(int64_t) \ + } #else #error Need the __alignof__ builtin. #endif @@ -92,7 +96,10 @@ static struct align malign[ELF_T_NUM] = [ELF_T_VNEED] = MALIGN(Verneed), #endif [ELF_T_WORD] = MALIGN(Word), - [ELF_T_XWORD] = MALIGN64(Xword) + [ELF_T_XWORD] = MALIGN64(Xword), +#if __FreeBSD_version >= 800062 + [ELF_T_GNUHASH] = MALIGN_WORD() +#endif }; int @@ -140,7 +147,10 @@ static struct align falign[ELF_T_NUM] = [ELF_T_VNEED] = FALIGN(4,4), #endif [ELF_T_WORD] = FALIGN(4,4), - [ELF_T_XWORD] = FALIGN(0,8) + [ELF_T_XWORD] = FALIGN(0,8), +#if __FreeBSD_version >= 800062 + [ELF_T_GNUHASH] = FALIGN(4,8) +#endif }; int Modified: head/lib/libelf/libelf_fsize.m4 ============================================================================== --- head/lib/libelf/libelf_fsize.m4 Wed Jul 21 09:51:24 2010 (r210331) +++ head/lib/libelf/libelf_fsize.m4 Wed Jul 21 09:56:42 2010 (r210332) @@ -45,6 +45,7 @@ include(SRCDIR`/elf_types.m4') /* `Basic' types */ define(`BYTE_SIZE', 1) +define(`GNUHASH_SIZE', 1) /* Elf_GNU_Hash_Header structures vary in length. */ define(`IDENT_SIZE', `EI_NIDENT') define(`NOTE_SIZE', 1) /* Elf_Note structures have variable length. */ Modified: head/lib/libelf/libelf_msize.m4 ============================================================================== --- head/lib/libelf/libelf_msize.m4 Wed Jul 21 09:51:24 2010 (r210331) +++ head/lib/libelf/libelf_msize.m4 Wed Jul 21 09:56:42 2010 (r210332) @@ -49,6 +49,7 @@ divert(-1) include(SRCDIR`/elf_types.m4') define(BYTE_SIZE, 1) +define(GNUHASH_SIZE, 1) define(NOTE_SIZE, 1) /* From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 10:02:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD41F1065673; Wed, 21 Jul 2010 10:02:59 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCD138FC1A; Wed, 21 Jul 2010 10:02:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LA2xR9082887; Wed, 21 Jul 2010 10:02:59 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LA2xpe082885; Wed, 21 Jul 2010 10:02:59 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211002.o6LA2xpe082885@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 10:02: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: r210333 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 10:02:59 -0000 Author: kaiw Date: Wed Jul 21 10:02:59 2010 New Revision: 210333 URL: http://svn.freebsd.org/changeset/base/210333 Log: Note that the *_fsize() functions are only defined for ELF types that have a fixed size. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/gelf_fsize.3 Modified: head/lib/libelf/gelf_fsize.3 ============================================================================== --- head/lib/libelf/gelf_fsize.3 Wed Jul 21 09:56:42 2010 (r210332) +++ head/lib/libelf/gelf_fsize.3 Wed Jul 21 10:02:59 2010 (r210333) @@ -47,6 +47,9 @@ These functions return the size in bytes .Ar count numbers of objects of ELF type .Ar type . +Argument +.Ar type +must be one that has a fixed size file representation. .Pp Functions .Fn elf32_fsize @@ -80,6 +83,10 @@ had an unknown ELF class. Argument .Ar type contained an illegal value. +.It Bq Er ELF_E_ARGUMENT +Argument +.Ar type +denoted an ELF type with variable size. .It Bq Er ELF_E_UNIMPL Support for ELF type .Ar type From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 10:05:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71A90106566C; Wed, 21 Jul 2010 10:05:08 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EBBA8FC1C; Wed, 21 Jul 2010 10:05:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LA58cT083444; Wed, 21 Jul 2010 10:05:08 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LA58rT083435; Wed, 21 Jul 2010 10:05:08 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201007211005.o6LA58rT083435@svn.freebsd.org> From: Attilio Rao Date: Wed, 21 Jul 2010 10:05: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: r210334 - in head/sys: dev/cas dev/gem dev/hme sparc64/include sparc64/sparc64 sun4v/include 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, 21 Jul 2010 10:05:08 -0000 Author: attilio Date: Wed Jul 21 10:05:07 2010 New Revision: 210334 URL: http://svn.freebsd.org/changeset/base/210334 Log: KTR_CTx are long time aliased by existing classes so they can't serve their purpose anymore. Axe them out. Sponsored by: Sandvine Incorporated Discussed with: jhb, emaste Possible MFC: TBD Modified: head/sys/dev/cas/if_cas.c head/sys/dev/gem/if_gem.c head/sys/dev/hme/if_hme.c head/sys/sparc64/include/bus.h head/sys/sparc64/sparc64/pmap.c head/sys/sparc64/sparc64/tsb.c head/sys/sun4v/include/bus.h head/sys/sys/ktr.h Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Wed Jul 21 10:02:59 2010 (r210333) +++ head/sys/dev/cas/if_cas.c Wed Jul 21 10:05:07 2010 (r210334) @@ -176,7 +176,7 @@ MODULE_DEPEND(cas, miibus, 1, 1, 1); #ifdef CAS_DEBUG #include -#define KTR_CAS KTR_CT2 +#define KTR_CAS KTR_SPARE2 #endif static int Modified: head/sys/dev/gem/if_gem.c ============================================================================== --- head/sys/dev/gem/if_gem.c Wed Jul 21 10:02:59 2010 (r210333) +++ head/sys/dev/gem/if_gem.c Wed Jul 21 10:05:07 2010 (r210334) @@ -136,7 +136,7 @@ MODULE_DEPEND(gem, miibus, 1, 1, 1); #ifdef GEM_DEBUG #include -#define KTR_GEM KTR_CT2 +#define KTR_GEM KTR_SPARE2 #endif #define GEM_BANK1_BITWAIT(sc, r, clr, set) \ Modified: head/sys/dev/hme/if_hme.c ============================================================================== --- head/sys/dev/hme/if_hme.c Wed Jul 21 10:02:59 2010 (r210333) +++ head/sys/dev/hme/if_hme.c Wed Jul 21 10:05:07 2010 (r210334) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #if 0 #define HMEDEBUG #endif -#define KTR_HME KTR_CT2 /* XXX */ +#define KTR_HME KTR_SPARE2 /* XXX */ #include #include Modified: head/sys/sparc64/include/bus.h ============================================================================== --- head/sys/sparc64/include/bus.h Wed Jul 21 10:02:59 2010 (r210333) +++ head/sys/sparc64/include/bus.h Wed Jul 21 10:05:07 2010 (r210334) @@ -194,7 +194,7 @@ bus_space_subregion(bus_space_tag_t t, b #define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */ #ifdef BUS_SPACE_DEBUG -#define KTR_BUS KTR_CT2 +#define KTR_BUS KTR_SPARE2 #define __BUS_DEBUG_ACCESS(h, o, desc, sz) do { \ CTR4(KTR_BUS, "bus space: %s %d: handle %#lx, offset %#lx", \ (desc), (sz), (h), (o)); \ Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Wed Jul 21 10:02:59 2010 (r210333) +++ head/sys/sparc64/sparc64/pmap.c Wed Jul 21 10:05:07 2010 (r210334) @@ -899,7 +899,7 @@ pmap_kenter(vm_offset_t va, vm_page_t m) CTR4(KTR_PMAP, "pmap_kenter: va=%#lx pa=%#lx tp=%p data=%#lx", va, VM_PAGE_TO_PHYS(m), tp, tp->tte_data); if (DCACHE_COLOR(VM_PAGE_TO_PHYS(m)) != DCACHE_COLOR(va)) { - CTR5(KTR_CT2, + CTR5(KTR_SPARE2, "pmap_kenter: off colour va=%#lx pa=%#lx o=%p ot=%d pi=%#lx", va, VM_PAGE_TO_PHYS(m), m->object, m->object ? m->object->type : -1, Modified: head/sys/sparc64/sparc64/tsb.c ============================================================================== --- head/sys/sparc64/sparc64/tsb.c Wed Jul 21 10:02:59 2010 (r210333) +++ head/sys/sparc64/sparc64/tsb.c Wed Jul 21 10:05:07 2010 (r210334) @@ -118,7 +118,7 @@ tsb_tte_enter(pmap_t pm, vm_page_t m, vm int i; if (DCACHE_COLOR(VM_PAGE_TO_PHYS(m)) != DCACHE_COLOR(va)) { - CTR5(KTR_CT2, + CTR5(KTR_SPARE2, "tsb_tte_enter: off colour va=%#lx pa=%#lx o=%p ot=%d pi=%#lx", va, VM_PAGE_TO_PHYS(m), m->object, m->object ? m->object->type : -1, Modified: head/sys/sun4v/include/bus.h ============================================================================== --- head/sys/sun4v/include/bus.h Wed Jul 21 10:02:59 2010 (r210333) +++ head/sys/sun4v/include/bus.h Wed Jul 21 10:05:07 2010 (r210334) @@ -194,7 +194,7 @@ bus_space_subregion(bus_space_tag_t t, b #define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */ #ifdef BUS_SPACE_DEBUG -#define KTR_BUS KTR_CT2 +#define KTR_BUS KTR_SPARE2 #define __BUS_DEBUG_ACCESS(h, o, desc, sz) do { \ CTR4(KTR_BUS, "bus space: %s %d: handle %#lx, offset %#lx", \ (desc), (sz), (h), (o)); \ Modified: head/sys/sys/ktr.h ============================================================================== --- head/sys/sys/ktr.h Wed Jul 21 10:02:59 2010 (r210333) +++ head/sys/sys/ktr.h Wed Jul 21 10:05:07 2010 (r210334) @@ -77,19 +77,6 @@ #define KTR_BUF 0x40000000 /* Buffer cache */ #define KTR_ALL 0x7fffffff -/* - * Trace classes which can be assigned to particular use at compile time - * These must remain in high 22 as some assembly code counts on it - */ -#define KTR_CT1 0x01000000 -#define KTR_CT2 0x02000000 -#define KTR_CT3 0x04000000 -#define KTR_CT4 0x08000000 -#define KTR_CT5 0x10000000 -#define KTR_CT6 0x20000000 -#define KTR_CT7 0x40000000 -#define KTR_CT8 0x80000000 - /* Trace classes to compile in */ #ifdef KTR #ifndef KTR_COMPILE From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 10:08:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D690106566C; Wed, 21 Jul 2010 10:08:26 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CD7A8FC13; Wed, 21 Jul 2010 10:08:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LA8Pd7084181; Wed, 21 Jul 2010 10:08:25 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LA8PgG084179; Wed, 21 Jul 2010 10:08:25 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211008.o6LA8PgG084179@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 10:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210335 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 10:08:26 -0000 Author: kaiw Date: Wed Jul 21 10:08:25 2010 New Revision: 210335 URL: http://svn.freebsd.org/changeset/base/210335 Log: - Return zero for file sizes of ELF types that have a variable size. - Neaten a few comments. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/libelf_fsize.m4 Modified: head/lib/libelf/libelf_fsize.m4 ============================================================================== --- head/lib/libelf/libelf_fsize.m4 Wed Jul 21 10:05:07 2010 (r210334) +++ head/lib/libelf/libelf_fsize.m4 Wed Jul 21 10:08:25 2010 (r210335) @@ -43,16 +43,18 @@ include(SRCDIR`/elf_types.m4') * representations. */ -/* `Basic' types */ +/* `Basic' types. */ define(`BYTE_SIZE', 1) -define(`GNUHASH_SIZE', 1) /* Elf_GNU_Hash_Header structures vary in length. */ define(`IDENT_SIZE', `EI_NIDENT') -define(`NOTE_SIZE', 1) /* Elf_Note structures have variable length. */ -/* Currently unimplemented types */ +/* Types that have variable length. */ +define(`GNUHASH_SIZE', 0) /* Elf_GNU_Hash_Header structures vary in length. */ +define(`NOTE_SIZE', 0) /* Elf_Note structures have variable length. */ + +/* Currently unimplemented types. */ define(`MOVEP_SIZE', 0) -/* Overrides for 32 bit types that do not exist */ +/* Overrides for 32 bit types that do not exist. */ define(`XWORD_SIZE32', 0) define(`SXWORD_SIZE32', 0) @@ -143,7 +145,8 @@ _libelf_fsize(Elf_Type t, int ec, unsign sz = 0; if (v != EV_CURRENT) LIBELF_SET_ERROR(VERSION, 0); - else if ((int) t < ELF_T_FIRST || t > ELF_T_LAST) + else if ((int) t < ELF_T_FIRST || t > ELF_T_LAST || + t == ELF_T_NOTE || t == ELF_T_GNUHASH) LIBELF_SET_ERROR(ARGUMENT, 0); else { sz = ec == ELFCLASS64 ? fsize[t].fsz64 : fsize[t].fsz32; From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 10:11:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97B4B1065677; Wed, 21 Jul 2010 10:11:46 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 874948FC1C; Wed, 21 Jul 2010 10:11:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LABkRZ084990; Wed, 21 Jul 2010 10:11:46 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LABk0I084988; Wed, 21 Jul 2010 10:11:46 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211011.o6LABk0I084988@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 10:11: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: r210336 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 10:11:46 -0000 Author: kaiw Date: Wed Jul 21 10:11:46 2010 New Revision: 210336 URL: http://svn.freebsd.org/changeset/base/210336 Log: Reduce verbosity. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/libelf_fsize.m4 Modified: head/lib/libelf/libelf_fsize.m4 ============================================================================== --- head/lib/libelf/libelf_fsize.m4 Wed Jul 21 10:08:25 2010 (r210335) +++ head/lib/libelf/libelf_fsize.m4 Wed Jul 21 10:11:46 2010 (r210336) @@ -48,8 +48,8 @@ define(`BYTE_SIZE', 1) define(`IDENT_SIZE', `EI_NIDENT') /* Types that have variable length. */ -define(`GNUHASH_SIZE', 0) /* Elf_GNU_Hash_Header structures vary in length. */ -define(`NOTE_SIZE', 0) /* Elf_Note structures have variable length. */ +define(`GNUHASH_SIZE', 0) +define(`NOTE_SIZE', 0) /* Currently unimplemented types. */ define(`MOVEP_SIZE', 0) From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 10:14:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C28E1065670; Wed, 21 Jul 2010 10:14:06 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 072DF8FC19; Wed, 21 Jul 2010 10:14:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LAE4Ai085530; Wed, 21 Jul 2010 10:14:04 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LAE4QR085528; Wed, 21 Jul 2010 10:14:04 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201007211014.o6LAE4QR085528@svn.freebsd.org> From: Attilio Rao Date: Wed, 21 Jul 2010 10:14: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: r210337 - 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, 21 Jul 2010 10:14:06 -0000 Author: attilio Date: Wed Jul 21 10:14:04 2010 New Revision: 210337 URL: http://svn.freebsd.org/changeset/base/210337 Log: Probabilly defaulting to KTR_GEN is not the right decision when KTR_MASK is not defined at all because KTR_GEN is still a valid class and some traces may fit in. Default to 0, instead, and block any tracing. As long as this is a POLA violation (some thirdy-part code, even if that may be a questionable choice, could be rely on that feature) a MFC possibility might be carefully evaluated. Sponsored by: Sandvine Incorporated Modified: head/sys/kern/kern_ktr.c Modified: head/sys/kern/kern_ktr.c ============================================================================== --- head/sys/kern/kern_ktr.c Wed Jul 21 10:11:46 2010 (r210336) +++ head/sys/kern/kern_ktr.c Wed Jul 21 10:14:04 2010 (r210337) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); #endif #ifndef KTR_MASK -#define KTR_MASK (KTR_GEN) +#define KTR_MASK (0) #endif #ifndef KTR_CPUMASK From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 10:25:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8586B1065678; Wed, 21 Jul 2010 10:25:02 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 735198FC18; Wed, 21 Jul 2010 10:25:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LAP21v088035; Wed, 21 Jul 2010 10:25:02 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LAP2S9088027; Wed, 21 Jul 2010 10:25:02 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211025.o6LAP2S9088027@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 10:25: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: r210338 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 10:25:02 -0000 Author: kaiw Date: Wed Jul 21 10:25:02 2010 New Revision: 210338 URL: http://svn.freebsd.org/changeset/base/210338 Log: Perform additional checks when translating between file and memory representations of ELF types. The ELF(3) API allows applications to request a conversion that is `in-place', i.e., with source and destinations data buffers being the same. However, the file and memory sizes of ELF sections that have additional internal structure, such as those of type `Elf_Note', or `Elf_GNU_Hash_Header', can be determined only known after the type-specific headers that comprise the first few words in these sections are read and translated. Pass in the size of destination buffer to type translation routines in "libelf_convert.m4" and have these routines return an error code if the translated data would not fit inside the destination buffer. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/_libelf.h head/lib/libelf/elf_data.c head/lib/libelf/elf_scn.c head/lib/libelf/libelf_convert.m4 head/lib/libelf/libelf_ehdr.c head/lib/libelf/libelf_phdr.c head/lib/libelf/libelf_xlate.c Modified: head/lib/libelf/_libelf.h ============================================================================== --- head/lib/libelf/_libelf.h Wed Jul 21 10:14:04 2010 (r210337) +++ head/lib/libelf/_libelf.h Wed Jul 21 10:25:02 2010 (r210338) @@ -171,8 +171,8 @@ void *_libelf_ehdr(Elf *_e, int _elfclas int _libelf_falign(Elf_Type _t, int _elfclass); size_t _libelf_fsize(Elf_Type _t, int _elfclass, unsigned int _version, size_t count); -void (*_libelf_get_translator(Elf_Type _t, int _direction, int _elfclass)) - (char *_dst, char *_src, size_t _cnt, int _byteswap); +int (*_libelf_get_translator(Elf_Type _t, int _direction, int _elfclass)) + (char *_dst, size_t dsz, char *_src, size_t _cnt, int _byteswap); void *_libelf_getphdr(Elf *_e, int _elfclass); void *_libelf_getshdr(Elf_Scn *_scn, int _elfclass); void _libelf_init_elf(Elf *_e, Elf_Kind _kind); Modified: head/lib/libelf/elf_data.c ============================================================================== --- head/lib/libelf/elf_data.c Wed Jul 21 10:14:04 2010 (r210337) +++ head/lib/libelf/elf_data.c Wed Jul 21 10:25:02 2010 (r210338) @@ -43,7 +43,7 @@ elf_getdata(Elf_Scn *s, Elf_Data *d) int elfclass, elftype; unsigned int sh_type; uint64_t sh_align, sh_offset, sh_size; - void (*xlate)(char *_d, char *_s, size_t _c, int _swap); + int (*xlate)(char *_d, size_t _dsz, char *_s, size_t _c, int _swap); if (s == NULL || (e = s->s_elf) == NULL || e->e_kind != ELF_K_ELF || (d != NULL && s != d->d_scn)) { @@ -125,11 +125,16 @@ elf_getdata(Elf_Scn *s, Elf_Data *d) } d->d_flags |= LIBELF_F_MALLOCED; - STAILQ_INSERT_TAIL(&s->s_data, d, d_next); xlate = _libelf_get_translator(elftype, ELF_TOMEMORY, elfclass); - (*xlate)(d->d_buf, e->e_rawfile + sh_offset, count, e->e_byteorder != - LIBELF_PRIVATE(byteorder)); + if (!(*xlate)(d->d_buf, d->d_size, e->e_rawfile + sh_offset, count, + e->e_byteorder != LIBELF_PRIVATE(byteorder))) { + _libelf_release_data(d); + LIBELF_SET_ERROR(DATA, 0); + return (NULL); + } + + STAILQ_INSERT_TAIL(&s->s_data, d, d_next); return (d); } Modified: head/lib/libelf/elf_scn.c ============================================================================== --- head/lib/libelf/elf_scn.c Wed Jul 21 10:14:04 2010 (r210337) +++ head/lib/libelf/elf_scn.c Wed Jul 21 10:25:02 2010 (r210338) @@ -48,7 +48,7 @@ _libelf_load_scn(Elf *e, void *ehdr) Elf32_Ehdr *eh32; Elf64_Ehdr *eh64; Elf_Scn *scn; - void (*xlator)(char *_d, char *_s, size_t _c, int _swap); + int (*xlator)(char *_d, size_t _dsz, char *_s, size_t _c, int _swap); assert(e != NULL); assert(ehdr != NULL); @@ -101,7 +101,8 @@ _libelf_load_scn(Elf *e, void *ehdr) if ((scn = _libelf_allocate_scn(e, i)) == NULL) return (0); - (*xlator)((char *) &scn->s_shdr, src, (size_t) 1, swapbytes); + (*xlator)((char *) &scn->s_shdr, sizeof(scn->s_shdr), src, + (size_t) 1, swapbytes); if (ec == ELFCLASS32) { scn->s_offset = scn->s_rawoff = Modified: head/lib/libelf/libelf_convert.m4 ============================================================================== --- head/lib/libelf/libelf_convert.m4 Wed Jul 21 10:14:04 2010 (r210337) +++ head/lib/libelf/libelf_convert.m4 Wed Jul 21 10:25:02 2010 (r210338) @@ -236,6 +236,7 @@ IGNORE(MOVEP) IGNORE(NOTE) define(IGNORE_BYTE, 1) /* 'lator, leave 'em bytes alone */ +define(IGNORE_GNUHASH, 1) define(IGNORE_NOTE, 1) define(IGNORE_SXWORD32, 1) define(IGNORE_XWORD32, 1) @@ -274,18 +275,18 @@ define(`SIZEDEP_OFF', 1) * `$4': ELF class specifier for types, one of [`32', `64'] */ define(`MAKEPRIM_TO_F',` -static void -libelf_cvt_$1$3_tof(char *dst, char *src, size_t count, int byteswap) +static int +libelf_cvt_$1$3_tof(char *dst, size_t dsz, char *src, size_t count, + int byteswap) { Elf$4_$2 t, *s = (Elf$4_$2 *) (uintptr_t) src; size_t c; - if (dst == src && !byteswap) - return; + (void) dsz; if (!byteswap) { (void) memcpy(dst, src, count * sizeof(*s)); - return; + return (1); } for (c = 0; c < count; c++) { @@ -293,22 +294,25 @@ libelf_cvt_$1$3_tof(char *dst, char *src SWAP_$1$3(t); WRITE_$1$3(dst,t); } + + return (1); } ') define(`MAKEPRIM_TO_M',` -static void -libelf_cvt_$1$3_tom(char *dst, char *src, size_t count, int byteswap) +static int +libelf_cvt_$1$3_tom(char *dst, size_t dsz, char *src, size_t count, + int byteswap) { Elf$4_$2 t, *d = (Elf$4_$2 *) (uintptr_t) dst; size_t c; - if (dst == src && !byteswap) - return; + if (dsz < count * sizeof(Elf$4_$2)) + return (0); if (!byteswap) { (void) memcpy(dst, src, count * sizeof(*d)); - return; + return (1); } for (c = 0; c < count; c++) { @@ -316,6 +320,8 @@ libelf_cvt_$1$3_tom(char *dst, char *src SWAP_$1$3(t); *d++ = t; } + + return (1); } ') @@ -392,12 +398,15 @@ define(`READ_STRUCT', define(`MAKE_TO_F', `ifdef(`IGNORE_'$1$3,`',` -static void -libelf_cvt$3_$1_tof(char *dst, char *src, size_t count, int byteswap) +static int +libelf_cvt$3_$1_tof(char *dst, size_t dsz, char *src, size_t count, + int byteswap) { Elf$3_$2 t, *s; size_t c; + (void) dsz; + s = (Elf$3_$2 *) (uintptr_t) src; for (c = 0; c < count; c++) { t = *s++; @@ -406,13 +415,16 @@ libelf_cvt$3_$1_tof(char *dst, char *src } WRITE_STRUCT($2,$3) } + + return (1); } ')') define(`MAKE_TO_M', `ifdef(`IGNORE_'$1$3,`',` -static void -libelf_cvt$3_$1_tom(char *dst, char *src, size_t count, int byteswap) +static int +libelf_cvt$3_$1_tom(char *dst, size_t dsz, char *src, size_t count, + int byteswap) { Elf$3_$2 t, *d; unsigned char *s,*s0; @@ -422,6 +434,9 @@ libelf_cvt$3_$1_tom(char *dst, char *src d = ((Elf$3_$2 *) (uintptr_t) dst) + (count - 1); s0 = (unsigned char *) src + (count - 1) * fsz; + if (dsz < count * sizeof(Elf$3_$2)) + return (0); + while (count--) { s = s0; READ_STRUCT($2,$3) @@ -430,6 +445,8 @@ libelf_cvt$3_$1_tom(char *dst, char *src } *d-- = t; s0 -= fsz; } + + return (1); } ')') @@ -475,12 +492,16 @@ divert(0) * simple memcpy suffices for both directions of conversion. */ -static void -libelf_cvt_BYTE_tox(char *dst, char *src, size_t count, int byteswap) +static int +libelf_cvt_BYTE_tox(char *dst, size_t dsz, char *src, size_t count, + int byteswap) { (void) byteswap; + if (dsz < count) + return (0); if (dst != src) (void) memcpy(dst, src, count); + return (1); } /* @@ -490,69 +511,81 @@ libelf_cvt_BYTE_tox(char *dst, char *src * * Argument `count' denotes the total number of bytes to be converted. */ -static void -libelf_cvt_NOTE_tom(char *dst, char *src, size_t count, int byteswap) +static int +libelf_cvt_NOTE_tom(char *dst, size_t dsz, char *src, size_t count, + int byteswap) { uint32_t namesz, descsz, type; Elf_Note *en; - size_t sz; + size_t sz, hdrsz; + + if (dsz < count) /* Destination buffer is too small. */ + return (0); - if (dst == src && !byteswap) - return; + hdrsz = 3 * sizeof(uint32_t); + if (count < hdrsz) /* Source too small. */ + return (0); if (!byteswap) { (void) memcpy(dst, src, count); - return; + return (1); } - while (count > sizeof(Elf_Note)) { - + /* Process all notes in the section. */ + while (count > hdrsz) { + /* Read the note header. */ READ_WORD(src, namesz); READ_WORD(src, descsz); READ_WORD(src, type); - if (byteswap) { - SWAP_WORD(namesz); - SWAP_WORD(descsz); - SWAP_WORD(type); - } + /* Translate. */ + SWAP_WORD(namesz); + SWAP_WORD(descsz); + SWAP_WORD(type); + /* Copy out the translated note header. */ en = (Elf_Note *) (uintptr_t) dst; en->n_namesz = namesz; en->n_descsz = descsz; en->n_type = type; + dsz -= sizeof(Elf_Note); dst += sizeof(Elf_Note); + count -= hdrsz; ROUNDUP2(namesz, 4); ROUNDUP2(descsz, 4); sz = namesz + descsz; - if (count < sz) - sz = count; + if (count < sz || dsz < sz) /* Buffers are too small. */ + return (0); (void) memcpy(dst, src, sz); src += sz; dst += sz; + count -= sz; } + + return (1); } -static void -libelf_cvt_NOTE_tof(char *dst, char *src, size_t count, int byteswap) +static int +libelf_cvt_NOTE_tof(char *dst, size_t dsz, char *src, size_t count, + int byteswap) { uint32_t namesz, descsz, type; Elf_Note *en; size_t sz; - if (dst == src && !byteswap) - return; + if (dsz < count) + return (0); if (!byteswap) { (void) memcpy(dst, src, count); - return; + return (1); } while (count > sizeof(Elf_Note)) { @@ -562,12 +595,9 @@ libelf_cvt_NOTE_tof(char *dst, char *src descsz = en->n_descsz; type = en->n_type; - if (byteswap) { - SWAP_WORD(namesz); - SWAP_WORD(descsz); - SWAP_WORD(type); - } - + SWAP_WORD(namesz); + SWAP_WORD(descsz); + SWAP_WORD(type); WRITE_WORD(dst, namesz); WRITE_WORD(dst, descsz); @@ -589,15 +619,21 @@ libelf_cvt_NOTE_tof(char *dst, char *src dst += sz; count -= sz; } + + return (1); } MAKE_TYPE_CONVERTERS(ELF_TYPE_LIST) struct converters { - void (*tof32)(char *dst, char *src, size_t cnt, int byteswap); - void (*tom32)(char *dst, char *src, size_t cnt, int byteswap); - void (*tof64)(char *dst, char *src, size_t cnt, int byteswap); - void (*tom64)(char *dst, char *src, size_t cnt, int byteswap); + int (*tof32)(char *dst, size_t dsz, char *src, size_t cnt, + int byteswap); + int (*tom32)(char *dst, size_t dsz, char *src, size_t cnt, + int byteswap); + int (*tof64)(char *dst, size_t dsz, char *src, size_t cnt, + int byteswap); + int (*tom64)(char *dst, size_t dsz, char *src, size_t cnt, + int byteswap); }; divert(-1) @@ -647,8 +683,8 @@ CONVERTER_NAMES(ELF_TYPE_LIST) } }; -void (*_libelf_get_translator(Elf_Type t, int direction, int elfclass)) - (char *_dst, char *_src, size_t _cnt, int _byteswap) +int (*_libelf_get_translator(Elf_Type t, int direction, int elfclass)) + (char *_dst, size_t dsz, char *_src, size_t _cnt, int _byteswap) { assert(elfclass == ELFCLASS32 || elfclass == ELFCLASS64); assert(direction == ELF_TOFILE || direction == ELF_TOMEMORY); Modified: head/lib/libelf/libelf_ehdr.c ============================================================================== --- head/lib/libelf/libelf_ehdr.c Wed Jul 21 10:14:04 2010 (r210337) +++ head/lib/libelf/libelf_ehdr.c Wed Jul 21 10:25:02 2010 (r210338) @@ -46,7 +46,7 @@ _libelf_load_extended(Elf *e, int ec, ui { Elf_Scn *scn; size_t fsz; - void (*xlator)(char *_d, char *_s, size_t _c, int _swap); + int (*xlator)(char *_d, size_t _dsz, char *_s, size_t _c, int _swap); uint32_t shtype; assert(STAILQ_EMPTY(&e->e_u.e_elf.e_scn)); @@ -63,7 +63,8 @@ _libelf_load_extended(Elf *e, int ec, ui return (0); xlator = _libelf_get_translator(ELF_T_SHDR, ELF_TOMEMORY, ec); - (*xlator)((char *) &scn->s_shdr, e->e_rawfile + shoff, (size_t) 1, + (*xlator)((char *) &scn->s_shdr, sizeof(scn->s_shdr), + e->e_rawfile + shoff, (size_t) 1, e->e_byteorder != LIBELF_PRIVATE(byteorder)); #define GET_SHDR_MEMBER(M) ((ec == ELFCLASS32) ? scn->s_shdr.s_shdr32.M : \ @@ -105,7 +106,7 @@ _libelf_ehdr(Elf *e, int ec, int allocat size_t fsz, msz; uint16_t phnum, shnum, strndx; uint64_t shoff; - void (*xlator)(char *_d, char *_s, size_t _c, int _swap); + int (*xlator)(char *_d, size_t _dsz, char *_s, size_t _c, int _swap); assert(ec == ELFCLASS32 || ec == ELFCLASS64); @@ -167,7 +168,7 @@ _libelf_ehdr(Elf *e, int ec, int allocat return (ehdr); xlator = _libelf_get_translator(ELF_T_EHDR, ELF_TOMEMORY, ec); - (*xlator)(ehdr, e->e_rawfile, (size_t) 1, + (*xlator)(ehdr, msz, e->e_rawfile, (size_t) 1, e->e_byteorder != LIBELF_PRIVATE(byteorder)); /* Modified: head/lib/libelf/libelf_phdr.c ============================================================================== --- head/lib/libelf/libelf_phdr.c Wed Jul 21 10:14:04 2010 (r210337) +++ head/lib/libelf/libelf_phdr.c Wed Jul 21 10:25:02 2010 (r210338) @@ -45,7 +45,7 @@ _libelf_getphdr(Elf *e, int ec) Elf32_Ehdr *eh32; Elf64_Ehdr *eh64; void *ehdr, *phdr; - void (*xlator)(char *_d, char *_s, size_t _c, int _swap); + int (*xlator)(char *_d, size_t _dsz, char *_s, size_t _c, int _swap); assert(ec == ELFCLASS32 || ec == ELFCLASS64); @@ -103,7 +103,7 @@ _libelf_getphdr(Elf *e, int ec) xlator = _libelf_get_translator(ELF_T_PHDR, ELF_TOMEMORY, ec); - (*xlator)(phdr, e->e_rawfile + phoff, phnum, + (*xlator)(phdr, phnum * msz, e->e_rawfile + phoff, phnum, e->e_byteorder != LIBELF_PRIVATE(byteorder)); return (phdr); Modified: head/lib/libelf/libelf_xlate.c ============================================================================== --- head/lib/libelf/libelf_xlate.c Wed Jul 21 10:14:04 2010 (r210337) +++ head/lib/libelf/libelf_xlate.c Wed Jul 21 10:25:02 2010 (r210338) @@ -48,6 +48,7 @@ Elf_Data * _libelf_xlate(Elf_Data *dst, const Elf_Data *src, unsigned int encoding, int elfclass, int direction) { + int byteswap; size_t cnt, dsz, fsz, msz; uintptr_t sb, se, db, de; @@ -132,12 +133,17 @@ _libelf_xlate(Elf_Data *dst, const Elf_D dst->d_type = src->d_type; dst->d_size = dsz; + byteswap = encoding != LIBELF_PRIVATE(byteorder); + if (src->d_size == 0 || - (db == sb && encoding == LIBELF_PRIVATE(byteorder) && fsz == msz)) + (db == sb && !byteswap && fsz == msz)) return (dst); /* nothing more to do */ - (_libelf_get_translator(src->d_type, direction, elfclass))(dst->d_buf, - src->d_buf, cnt, encoding != LIBELF_PRIVATE(byteorder)); + if (!(_libelf_get_translator(src->d_type, direction, elfclass)) + (dst->d_buf, dsz, src->d_buf, cnt, byteswap)) { + LIBELF_SET_ERROR(DATA, 0); + return (NULL); + } return (dst); } From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 10:34:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C84151065674; Wed, 21 Jul 2010 10:34:03 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 7BB318FC27; Wed, 21 Jul 2010 10:34:03 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 7D45E1FFC34; Wed, 21 Jul 2010 10:34:02 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 58BB884513; Wed, 21 Jul 2010 12:34:02 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Alexey Dokuchaev References: <201007210843.o6L8hmo5064622@svn.freebsd.org> <20100721090623.GA21607@FreeBSD.org> Date: Wed, 21 Jul 2010 12:34:01 +0200 In-Reply-To: <20100721090623.GA21607@FreeBSD.org> (Alexey Dokuchaev's message of "Wed, 21 Jul 2010 09:06:23 +0000") Message-ID: <86sk3dqg2u.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kai Wang Subject: Re: svn commit: r210321 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 10:34:03 -0000 Alexey Dokuchaev writes: > Obtained from: somewhere > MFC after: sometime > Foo bar: baz qux ... > > Broken alignment considerably pessimizes commit log grasping, as it > requires more post-processing work after reading it off. my ($tag, $value) =3D split(/:\s*/); but perhaps it's complicated in inferior programming languages? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 10:39:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAB50106567D; Wed, 21 Jul 2010 10:39:29 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F08D8FC08; Wed, 21 Jul 2010 10:39:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LAdTZR091324; Wed, 21 Jul 2010 10:39:29 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LAdTxY091319; Wed, 21 Jul 2010 10:39:29 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211039.o6LAdTxY091319@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 10:39: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: r210340 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 10:39:29 -0000 Author: kaiw Date: Wed Jul 21 10:39:29 2010 New Revision: 210340 URL: http://svn.freebsd.org/changeset/base/210340 Log: - Document that the *fsize() functions return a size of 1 for Elf types that don't have a fixed size. - The *fsize() functions should return a size of 1, for variable length types. - Redefine symbol ELF_T_LAST to match the current end of the list. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/gelf_fsize.3 head/lib/libelf/libelf.h head/lib/libelf/libelf_data.c head/lib/libelf/libelf_fsize.m4 Modified: head/lib/libelf/gelf_fsize.3 ============================================================================== --- head/lib/libelf/gelf_fsize.3 Wed Jul 21 10:36:27 2010 (r210339) +++ head/lib/libelf/gelf_fsize.3 Wed Jul 21 10:39:29 2010 (r210340) @@ -47,9 +47,8 @@ These functions return the size in bytes .Ar count numbers of objects of ELF type .Ar type . -Argument -.Ar type -must be one that has a fixed size file representation. +For ELF types that are of variable length, these functions return a +size of one byte. .Pp Functions .Fn elf32_fsize @@ -83,10 +82,6 @@ had an unknown ELF class. Argument .Ar type contained an illegal value. -.It Bq Er ELF_E_ARGUMENT -Argument -.Ar type -denoted an ELF type with variable size. .It Bq Er ELF_E_UNIMPL Support for ELF type .Ar type Modified: head/lib/libelf/libelf.h ============================================================================== --- head/lib/libelf/libelf.h Wed Jul 21 10:36:27 2010 (r210339) +++ head/lib/libelf/libelf.h Wed Jul 21 10:39:29 2010 (r210340) @@ -80,7 +80,7 @@ typedef enum { } Elf_Type; #define ELF_T_FIRST ELF_T_ADDR -#define ELF_T_LAST ELF_T_XWORD +#define ELF_T_LAST ELF_T_GNUHASH /* Commands */ typedef enum { Modified: head/lib/libelf/libelf_data.c ============================================================================== --- head/lib/libelf/libelf_data.c Wed Jul 21 10:36:27 2010 (r210339) +++ head/lib/libelf/libelf_data.c Wed Jul 21 10:39:29 2010 (r210340) @@ -42,6 +42,10 @@ _libelf_xlate_shtype(uint32_t sht) return (ELF_T_SYM); case SHT_FINI_ARRAY: return (ELF_T_ADDR); +#if __FreeBSD_version >= 800062 + case SHT_GNU_HASH: + return (ELF_T_GNUHASH); +#endif case SHT_GROUP: return (ELF_T_WORD); case SHT_HASH: Modified: head/lib/libelf/libelf_fsize.m4 ============================================================================== --- head/lib/libelf/libelf_fsize.m4 Wed Jul 21 10:36:27 2010 (r210339) +++ head/lib/libelf/libelf_fsize.m4 Wed Jul 21 10:39:29 2010 (r210340) @@ -48,8 +48,8 @@ define(`BYTE_SIZE', 1) define(`IDENT_SIZE', `EI_NIDENT') /* Types that have variable length. */ -define(`GNUHASH_SIZE', 0) -define(`NOTE_SIZE', 0) +define(`GNUHASH_SIZE', 1) +define(`NOTE_SIZE', 1) /* Currently unimplemented types. */ define(`MOVEP_SIZE', 0) @@ -145,8 +145,7 @@ _libelf_fsize(Elf_Type t, int ec, unsign sz = 0; if (v != EV_CURRENT) LIBELF_SET_ERROR(VERSION, 0); - else if ((int) t < ELF_T_FIRST || t > ELF_T_LAST || - t == ELF_T_NOTE || t == ELF_T_GNUHASH) + else if ((int) t < ELF_T_FIRST || t > ELF_T_LAST) LIBELF_SET_ERROR(ARGUMENT, 0); else { sz = ec == ELFCLASS64 ? fsize[t].fsz64 : fsize[t].fsz32; From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 10:57:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 176F41065677; Wed, 21 Jul 2010 10:57:23 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05E378FC12; Wed, 21 Jul 2010 10:57:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LAvMkr095389; Wed, 21 Jul 2010 10:57:22 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LAvMCf095386; Wed, 21 Jul 2010 10:57:22 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211057.o6LAvMCf095386@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 10:57: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: r210341 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 10:57:23 -0000 Author: kaiw Date: Wed Jul 21 10:57:22 2010 New Revision: 210341 URL: http://svn.freebsd.org/changeset/base/210341 Log: Add support for translating sections of type ELF_T_GNUHASH. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/elf_types.m4 head/lib/libelf/libelf_convert.m4 Modified: head/lib/libelf/elf_types.m4 ============================================================================== --- head/lib/libelf/elf_types.m4 Wed Jul 21 10:39:29 2010 (r210340) +++ head/lib/libelf/elf_types.m4 Wed Jul 21 10:57:22 2010 (r210341) @@ -46,6 +46,7 @@ define(`ELF_TYPE_LIST', `CAP, Cap, 700025', `DYN, Dyn, 600102', `EHDR, Ehdr, 600102', + `GNUHASH, -, 800062', `HALF, Half, 600102', `LWORD, Lword, 700025', `MOVE, Move, 700025', Modified: head/lib/libelf/libelf_convert.m4 ============================================================================== --- head/lib/libelf/libelf_convert.m4 Wed Jul 21 10:39:29 2010 (r210340) +++ head/lib/libelf/libelf_convert.m4 Wed Jul 21 10:57:22 2010 (r210341) @@ -234,6 +234,7 @@ define(`IGNORE', IGNORE(MOVEP) IGNORE(NOTE) +IGNORE(GNUHASH) define(IGNORE_BYTE, 1) /* 'lator, leave 'em bytes alone */ define(IGNORE_GNUHASH, 1) @@ -504,12 +505,209 @@ libelf_cvt_BYTE_tox(char *dst, size_t ds return (1); } +MAKE_TYPE_CONVERTERS(ELF_TYPE_LIST) + +/* + * Sections of type ELF_T_GNUHASH start with a header containing 4 32-bit + * words. Bloom filter data comes next, followed by hash buckets and the + * hash chain. + * + * Bloom filter words are 64 bit wide on ELFCLASS64 objects and are 32 bit + * wide on ELFCLASS32 objects. The other objects in this section are 32 + * bits wide. + * + * Argument `srcsz' denotes the number of bytes to be converted. In the + * 32-bit case we need to translate `srcsz' to a count of 32-bit words. + */ + +static int +libelf_cvt32_GNUHASH_tom(char *dst, size_t dsz, char *src, size_t srcsz, + int byteswap) +{ + return (libelf_cvt_WORD_tom(dst, dsz, src, srcsz / sizeof(uint32_t), + byteswap)); +} + +static int +libelf_cvt32_GNUHASH_tof(char *dst, size_t dsz, char *src, size_t srcsz, + int byteswap) +{ + return (libelf_cvt_WORD_tof(dst, dsz, src, srcsz / sizeof(uint32_t), + byteswap)); +} + +static int +libelf_cvt64_GNUHASH_tom(char *dst, size_t dsz, char *src, size_t srcsz, + int byteswap) +{ + size_t sz; + uint64_t t64, *bloom64; + Elf_GNU_Hash_Header *gh; + uint32_t n, nbuckets, nchains, maskwords, shift2, symndx, t32; + uint32_t *buckets, *chains; + + sz = 4 * sizeof(uint32_t); /* File header is 4 words long. */ + if (dsz < sizeof(Elf_GNU_Hash_Header) || srcsz < sz) + return (0); + + /* Read in the section header and byteswap if needed. */ + READ_WORD(src, nbuckets); + READ_WORD(src, symndx); + READ_WORD(src, maskwords); + READ_WORD(src, shift2); + + srcsz -= sz; + + if (byteswap) { + SWAP_WORD(nbuckets); + SWAP_WORD(symndx); + SWAP_WORD(maskwords); + SWAP_WORD(shift2); + } + + /* Check source buffer and destination buffer sizes. */ + sz = nbuckets * sizeof(uint32_t) + maskwords * sizeof(uint64_t); + if (srcsz < sz || dsz < sz + sizeof(Elf_GNU_Hash_Header)) + return (0); + + gh = (Elf_GNU_Hash_Header *) (uintptr_t) dst; + gh->gh_nbuckets = nbuckets; + gh->gh_symndx = symndx; + gh->gh_maskwords = maskwords; + gh->gh_shift2 = shift2; + + dsz -= sizeof(Elf_GNU_Hash_Header); + dst += sizeof(Elf_GNU_Hash_Header); + + bloom64 = (uint64_t *) (uintptr_t) dst; + + /* Copy bloom filter data. */ + for (n = 0; n < maskwords; n++) { + READ_XWORD(src, t64); + if (byteswap) + SWAP_XWORD(t64); + bloom64[n] = t64; + } + + /* The hash buckets follows the bloom filter. */ + dst += maskwords * sizeof(uint64_t); + buckets = (uint32_t *) (uintptr_t) dst; + + for (n = 0; n < nbuckets; n++) { + READ_WORD(src, t32); + if (byteswap) + SWAP_WORD(t32); + buckets[n] = t32; + } + + dst += nbuckets * sizeof(uint32_t); + + /* The hash chain follows the hash buckets. */ + dsz -= sz; + srcsz -= sz; + + if (dsz < srcsz) /* Destination lacks space. */ + return (0); + + nchains = srcsz / sizeof(uint32_t); + chains = (uint32_t *) (uintptr_t) dst; + + for (n = 0; n < nchains; n++) { + READ_WORD(src, t32); + if (byteswap) + SWAP_WORD(t32); + *chains++ = t32; + } + + return (1); +} + +static int +libelf_cvt64_GNUHASH_tof(char *dst, size_t dsz, char *src, size_t srcsz, + int byteswap) +{ + uint32_t *s32; + size_t sz, hdrsz; + uint64_t *s64, t64; + Elf_GNU_Hash_Header *gh; + uint32_t maskwords, n, nbuckets, nchains, t0, t1, t2, t3, t32; + + hdrsz = 4 * sizeof(uint32_t); /* Header is 4x32 bits. */ + if (dsz < hdrsz || srcsz < sizeof(Elf_GNU_Hash_Header)) + return (0); + + gh = (Elf_GNU_Hash_Header *) (uintptr_t) src; + + t0 = nbuckets = gh->gh_nbuckets; + t1 = gh->gh_symndx; + t2 = maskwords = gh->gh_maskwords; + t3 = gh->gh_shift2; + + src += sizeof(Elf_GNU_Hash_Header); + srcsz -= sizeof(Elf_GNU_Hash_Header); + dsz -= hdrsz; + + sz = gh->gh_nbuckets * sizeof(uint32_t) + gh->gh_maskwords * + sizeof(uint64_t); + + if (srcsz < sz || dsz < sz) + return (0); + + /* Write out the header. */ + if (byteswap) { + SWAP_WORD(t0); + SWAP_WORD(t1); + SWAP_WORD(t2); + SWAP_WORD(t3); + } + + WRITE_WORD(dst, t0); + WRITE_WORD(dst, t1); + WRITE_WORD(dst, t2); + WRITE_WORD(dst, t3); + + /* Copy the bloom filter and the hash table. */ + s64 = (uint64_t *) (uintptr_t) src; + for (n = 0; n < maskwords; n++) { + t64 = *s64++; + if (byteswap) + SWAP_XWORD(t64); + WRITE_WORD64(dst, t64); + } + + s32 = (uint32_t *) s64; + for (n = 0; n < nbuckets; n++) { + t32 = *s32++; + if (byteswap) + SWAP_WORD(t32); + WRITE_WORD(dst, t32); + } + + srcsz -= sz; + dsz -= sz; + + /* Copy out the hash chains. */ + if (dsz < srcsz) + return (0); + + nchains = srcsz / sizeof(uint32_t); + for (n = 0; n < nchains; n++) { + t32 = *s32++; + if (byteswap) + SWAP_WORD(t32); + WRITE_WORD(dst, t32); + } + + return (1); +} + /* * Elf_Note structures comprise a fixed size header followed by variable * length strings. The fixed size header needs to be byte swapped, but * not the strings. * * Argument `count' denotes the total number of bytes to be converted. + * The destination buffer needs to be at least `count' bytes in size. */ static int libelf_cvt_NOTE_tom(char *dst, size_t dsz, char *src, size_t count, @@ -567,6 +765,7 @@ libelf_cvt_NOTE_tom(char *dst, size_t ds dst += sz; count -= sz; + dsz -= sz; } return (1); @@ -623,8 +822,6 @@ libelf_cvt_NOTE_tof(char *dst, size_t ds return (1); } -MAKE_TYPE_CONVERTERS(ELF_TYPE_LIST) - struct converters { int (*tof32)(char *dst, size_t dsz, char *src, size_t cnt, int byteswap); @@ -675,6 +872,14 @@ CONVERTER_NAMES(ELF_TYPE_LIST) .tof64 = libelf_cvt_BYTE_tox, .tom64 = libelf_cvt_BYTE_tox }, + + [ELF_T_GNUHASH] = { + .tof32 = libelf_cvt32_GNUHASH_tof, + .tom32 = libelf_cvt32_GNUHASH_tom, + .tof64 = libelf_cvt64_GNUHASH_tof, + .tom64 = libelf_cvt64_GNUHASH_tom + }, + [ELF_T_NOTE] = { .tof32 = libelf_cvt_NOTE_tof, .tom32 = libelf_cvt_NOTE_tom, From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 11:26:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD08E106564A; Wed, 21 Jul 2010 11:26:18 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F0FA8FC21; Wed, 21 Jul 2010 11:26:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LBQI90003052; Wed, 21 Jul 2010 11:26:18 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LBQIpE003050; Wed, 21 Jul 2010 11:26:18 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211126.o6LBQIpE003050@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 11:26: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: r210344 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 11:26:19 -0000 Author: kaiw Date: Wed Jul 21 11:26:18 2010 New Revision: 210344 URL: http://svn.freebsd.org/changeset/base/210344 Log: Avoid switching between "unsigned char" and "char" in the C code generated from "libelf_convert.m4". Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/libelf_convert.m4 Modified: head/lib/libelf/libelf_convert.m4 ============================================================================== --- head/lib/libelf/libelf_convert.m4 Wed Jul 21 11:01:40 2010 (r210343) +++ head/lib/libelf/libelf_convert.m4 Wed Jul 21 11:26:18 2010 (r210344) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006,2007 Joseph Koshy + * Copyright (c) 2006-2008 Joseph Koshy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -85,22 +85,22 @@ __FBSDID("$FreeBSD$"); * destination pointer is incremented after the write. */ #define WRITE_BYTE(P,X) do { \ - unsigned char *const _p = (unsigned char *) (P); \ - _p[0] = (unsigned char) (X); \ + char *const _p = (char *) (P); \ + _p[0] = (char) (X); \ (P) = _p + 1; \ } while (0) #define WRITE_HALF(P,X) do { \ uint16_t _t = (X); \ - unsigned char *const _p = (unsigned char *) (P); \ - unsigned const char *const _q = (unsigned char *) &_t; \ + char *const _p = (char *) (P); \ + const char *const _q = (char *) &_t; \ _p[0] = _q[0]; \ _p[1] = _q[1]; \ (P) = _p + 2; \ } while (0) #define WRITE_WORD(P,X) do { \ uint32_t _t = (X); \ - unsigned char *const _p = (unsigned char *) (P); \ - unsigned const char *const _q = (unsigned char *) &_t; \ + char *const _p = (char *) (P); \ + const char *const _q = (char *) &_t; \ _p[0] = _q[0]; \ _p[1] = _q[1]; \ _p[2] = _q[2]; \ @@ -112,8 +112,8 @@ __FBSDID("$FreeBSD$"); #define WRITE_SWORD(P,X) WRITE_WORD(P,X) #define WRITE_WORD64(P,X) do { \ uint64_t _t = (X); \ - unsigned char *const _p = (unsigned char *) (P); \ - unsigned const char *const _q = (unsigned char *) &_t; \ + char *const _p = (char *) (P); \ + const char *const _q = (char *) &_t; \ _p[0] = _q[0]; \ _p[1] = _q[1]; \ _p[2] = _q[2]; \ @@ -141,16 +141,16 @@ __FBSDID("$FreeBSD$"); */ #define READ_BYTE(P,X) do { \ - const unsigned char *const _p = \ - (const unsigned char *) (P); \ + const char *const _p = \ + (const char *) (P); \ (X) = _p[0]; \ (P) = (P) + 1; \ } while (0) #define READ_HALF(P,X) do { \ uint16_t _t; \ - unsigned char *const _q = (unsigned char *) &_t; \ - const unsigned char *const _p = \ - (const unsigned char *) (P); \ + char *const _q = (char *) &_t; \ + const char *const _p = \ + (const char *) (P); \ _q[0] = _p[0]; \ _q[1] = _p[1]; \ (P) = (P) + 2; \ @@ -158,9 +158,9 @@ __FBSDID("$FreeBSD$"); } while (0) #define READ_WORD(P,X) do { \ uint32_t _t; \ - unsigned char *const _q = (unsigned char *) &_t; \ - const unsigned char *const _p = \ - (const unsigned char *) (P); \ + char *const _q = (char *) &_t; \ + const char *const _p = \ + (const char *) (P); \ _q[0] = _p[0]; \ _q[1] = _p[1]; \ _q[2] = _p[2]; \ @@ -173,9 +173,9 @@ __FBSDID("$FreeBSD$"); #define READ_SWORD(P,X) READ_WORD(P,X) #define READ_WORD64(P,X) do { \ uint64_t _t; \ - unsigned char *const _q = (unsigned char *) &_t; \ - const unsigned char *const _p = \ - (const unsigned char *) (P); \ + char *const _q = (char *) &_t; \ + const char *const _p = \ + (const char *) (P); \ _q[0] = _p[0]; \ _q[1] = _p[1]; \ _q[2] = _p[2]; \ @@ -428,12 +428,12 @@ libelf_cvt$3_$1_tom(char *dst, size_t ds int byteswap) { Elf$3_$2 t, *d; - unsigned char *s,*s0; + char *s,*s0; size_t fsz; fsz = elf$3_fsize(ELF_T_$1, (size_t) 1, EV_CURRENT); d = ((Elf$3_$2 *) (uintptr_t) dst) + (count - 1); - s0 = (unsigned char *) src + (count - 1) * fsz; + s0 = (char *) src + (count - 1) * fsz; if (dsz < count * sizeof(Elf$3_$2)) return (0); From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 11:29:38 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 9F104106567D; Wed, 21 Jul 2010 11:29:38 +0000 (UTC) Date: Wed, 21 Jul 2010 11:29:38 +0000 From: Alexey Dokuchaev To: Bruce Evans Message-ID: <20100721112938.GA55937@FreeBSD.org> References: <201007210843.o6L8hmo5064622@svn.freebsd.org> <20100721090623.GA21607@FreeBSD.org> <20100721194659.L7533@delplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20100721194659.L7533@delplex.bde.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Kai Wang Subject: Re: svn commit: r210321 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 11:29:38 -0000 On Wed, Jul 21, 2010 at 07:51:49PM +1000, Bruce Evans wrote: > On Wed, 21 Jul 2010, Alexey Dokuchaev wrote: > >On Wed, Jul 21, 2010 at 08:43:48AM +0000, Kai Wang wrote: > >>Log: > >> Remove a superfluous comment. > >> > >> Obtained from: elftoolchain > >> MFC after: 1 month > > > >(Just picking random of the similar commits): guys, please, try to > >uniformly align commit meta tags: > > It is perfectly aligned with tabs (and no 2-char commit mail indentation, > and no N-char mailer quoting). Right, I miscalculated spaces (by hand). Sorry for false alarm (other cases still stand though). > >Obtained from: somewhere > >MFC after: sometime > >Foo bar: baz qux ... > > > >Broken alignment considerably pessimizes commit log grasping, as it > >requires more post-processing work after reading it off. > > Do you mean for human grasping and automated post-processing? Human grasping. > "tags" should mean the part before the ":". Aligning those by making them > all of the same length would help. That's what I usually mean by tags. I should have probably explicitly said that tags' "values" are often misaligned. Thanks for straightening this out Bruce. ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 11:42:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A9801065676; Wed, 21 Jul 2010 11:42:13 +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 20B068FC14; Wed, 21 Jul 2010 11:42:13 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 3752235A852; Wed, 21 Jul 2010 13:42:12 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 2D95E171FA; Wed, 21 Jul 2010 13:42:12 +0200 (CEST) Date: Wed, 21 Jul 2010 13:42:12 +0200 From: Jilles Tjoelker To: Alex Kozlov Message-ID: <20100721114212.GA30431@stack.nl> References: <20100720170333.GA51595@ravenloft.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100720170333.GA51595@ravenloft.kiev.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, Gabor Kovesdan Subject: Re: svn commit: r210254 - in head/etc: defaults periodic/security X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 11:42:13 -0000 On Tue, Jul 20, 2010 at 08:03:33PM +0300, Alex Kozlov wrote: > On Tue, Jul 20, 2010 at 05:25:05PM +0300, Alex Kozlov wrote: > > > > + echo ${name}: ${one} > > > > > > This handles pathnames with spaces incorrectly. Consider reading lines > > > with > > > IFS= read -r line > > > This also collapses the nested case statements to one, for > > > 'Information for'*, Mismatched*, '' and /*. > > > > > > The variables in the echo commands should be quoted to avoid word > > > splitting and pathname generation. > > It's makes parser stateful and overly complex, I will think about most > > simple way to do this. Fortunately, at the moment very few, if any, ports > > have files with space in names. > It's seems I was wrong, We have more that 10k files with spaces in ports. > What do think about this solution? > Index: etc/periodic/security/460.chkportsum > @@ -26,8 +26,10 @@ > ;; > Mismatched|'') ;; > *) > - if [ -n ${name} ]; then > - echo ${name}: ${one} > + if [ -n "${name}" ]; then > + #handle filenames with spaces > + file="${one} ${two} ${three}" > + echo "${name}: ${file%% fails the original MD5 checksum}" > fi > ;; > esac This works but collapses sequences of multiple spaces (or even tabs) to a single space. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 12:14:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 186B91065675; Wed, 21 Jul 2010 12:14:51 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04CF38FC25; Wed, 21 Jul 2010 12:14:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LCEp34013847; Wed, 21 Jul 2010 12:14:51 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LCEo8q013834; Wed, 21 Jul 2010 12:14:50 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211214.o6LCEo8q013834@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 12:14: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: r210345 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 12:14:51 -0000 Author: kaiw Date: Wed Jul 21 12:14:50 2010 New Revision: 210345 URL: http://svn.freebsd.org/changeset/base/210345 Log: * Deprecate `elf_getshnum()`, `elf_getphnum()` and `elf_getshstrndx()` in favour of `elf_getshdrnum()`, `elf_getphdrnum()` and `elf_getshdrstrndx()` respectively. * Add new manual pages for `elf_getshdrstrndx()`, `elf_getphdrnum()` and `elf_getshdrnum()`. * Add a deprecation warning for `elf_getshstrndx()`, `elf_getphnum()` and `elf_getshnum()`. Obtained from: elftoolchain MFC after: 1 month Added: head/lib/libelf/elf_getphdrnum.3 (contents, props changed) head/lib/libelf/elf_getshdrnum.3 (contents, props changed) head/lib/libelf/elf_getshdrstrndx.3 (contents, props changed) Modified: head/lib/libelf/Makefile head/lib/libelf/Version.map head/lib/libelf/elf_getphnum.3 head/lib/libelf/elf_getshnum.3 head/lib/libelf/elf_getshstrndx.3 head/lib/libelf/elf_phnum.c head/lib/libelf/elf_shnum.c head/lib/libelf/elf_shstrndx.c head/lib/libelf/libelf.h Modified: head/lib/libelf/Makefile ============================================================================== --- head/lib/libelf/Makefile Wed Jul 21 11:26:18 2010 (r210344) +++ head/lib/libelf/Makefile Wed Jul 21 12:14:50 2010 (r210345) @@ -63,7 +63,8 @@ SHLIB_MAJOR= 1 MAN= elf.3 \ elf_begin.3 \ elf_cntl.3 \ - elf_end.3 elf_errmsg.3 \ + elf_end.3 \ + elf_errmsg.3 \ elf_fill.3 \ elf_flagdata.3 \ elf_getarhdr.3 \ @@ -72,8 +73,11 @@ MAN= elf.3 \ elf_getdata.3 \ elf_getident.3 \ elf_getscn.3 \ + elf_getphdrnum.3 \ elf_getphnum.3 \ + elf_getshdrnum.3 \ elf_getshnum.3 \ + elf_getshdrstrndx.3 \ elf_getshstrndx.3 \ elf_hash.3 \ elf_kind.3 \ Modified: head/lib/libelf/Version.map ============================================================================== --- head/lib/libelf/Version.map Wed Jul 21 11:26:18 2010 (r210344) +++ head/lib/libelf/Version.map Wed Jul 21 12:14:50 2010 (r210345) @@ -39,8 +39,11 @@ global: elf_getdata; elf_getident; elf_getscn; + elf_getphdrnum; elf_getphnum; + elf_getshdrnum; elf_getshnum; + elf_getshdrstrndx; elf_getshstrndx; elf_hash; elf_kind; Added: head/lib/libelf/elf_getphdrnum.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libelf/elf_getphdrnum.3 Wed Jul 21 12:14:50 2010 (r210345) @@ -0,0 +1,86 @@ +.\" Copyright (c) 2006,2008 Joseph Koshy. 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 Joseph Koshy ``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 Joseph Koshy 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 5, 2009 +.Os +.Dt ELF_GETPHDRNUM 3 +.Sh NAME +.Nm elf_getphdrnum +.Nd return the number of program headers in an ELF file +.Sh LIBRARY +.Lb libelf +.Sh SYNOPSIS +.In libelf.h +.Ft int +.Fn elf_getphdrnum "Elf *elf" "size_t *phnum" +.Sh DESCRIPTION +Function +.Fn elf_getphdrnum +retrieves the number of ELF program headers associated with descriptor +.Ar elf +and stores it into the location pointed to by argument +.Ar phnum . +.Pp +This routine allows applications to uniformly process both normal ELF +objects and ELF objects that use extended numbering. +.Pp +.Sh RETURN VALUES +Function +.Fn elf_getphdrnum +returns a zero value if successful, or -1 in case of an error. +.Sh ERRORS +Function +.Fn elf_getphnum +can fail with the following errors: +.Bl -tag -width "[ELF_E_RESOURCE]" +.It Bq Er ELF_E_ARGUMENT +A NULL value was passed in for argument +.Ar elf . +.It Bq Er ELF_E_ARGUMENT +Argument +.Ar elf +was not for an ELF file. +.It Bq Er ELF_E_ARGUMENT +Argument +.Ar elf +lacks an ELF Executable Header. +.It Bq Er ELF_E_HEADER +The ELF Executable Header associated with argument +.Ar elf +was corrupt. +.It Bq Er ELF_E_SECTION +The section header at index +.Dv SHN_UNDEF +was corrupt. +.El +.Sh SEE ALSO +.Xr elf 3 , +.Xr elf32_getehdr 3 , +.Xr elf64_getehdr 3 , +.Xr elf_getident 3 , +.Xr elf_getshdrnum 3 , +.Xr elf_getshdrstrndx 3 , +.Xr gelf 3 , +.Xr gelf_getehdr 3 Modified: head/lib/libelf/elf_getphnum.3 ============================================================================== --- head/lib/libelf/elf_getphnum.3 Wed Jul 21 11:26:18 2010 (r210344) +++ head/lib/libelf/elf_getphnum.3 Wed Jul 21 12:14:50 2010 (r210345) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 16, 2006 +.Dd August 5, 2009 .Dt ELF_GETPHNUM 3 .Os .Sh NAME @@ -36,6 +36,11 @@ .Ft int .Fn elf_getphnum "Elf *elf" "size_t *phnum" .Sh DESCRIPTION +This function is deprecated. +Please use function +.Xr elf_getphdrnum 3 +instead. +.Pp Function .Fn elf_getphnum retrieves the number of ELF program headers associated with descriptor @@ -81,7 +86,8 @@ was corrupt. .Xr elf32_getehdr 3 , .Xr elf64_getehdr 3 , .Xr elf_getident 3 , -.Xr elf_getshnum 3 , -.Xr elf_getshstrndx 3 , +.Xr elf_getphdrnum 3 , +.Xr elf_getshdrnum 3 , +.Xr elf_getshdrstrndx 3 , .Xr gelf 3 , .Xr gelf_getehdr 3 Added: head/lib/libelf/elf_getshdrnum.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libelf/elf_getshdrnum.3 Wed Jul 21 12:14:50 2010 (r210345) @@ -0,0 +1,78 @@ +.\" Copyright (c) 2006,2008 Joseph Koshy. 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 Joseph Koshy ``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 Joseph Koshy 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 4, 2009 +.Os +.Dt ELF_GETSHDRNUM 3 +.Sh NAME +.Nm elf_getshdrnum +.Nd return the number of sections in an ELF file +.Sh LIBRARY +.Lb libelf +.Sh SYNOPSIS +.In libelf.h +.Ft int +.Fn elf_getshdrnum "Elf *elf" "size_t *shnum" +.Sh DESCRIPTION +Function +.Fn elf_getshdrnum +retrieves the number of ELF sections associated with descriptor +.Ar elf +and stores it into the location pointed to by argument +.Ar shnum . +.Pp +This routine allows applications to uniformly process both normal ELF +objects, and ELF objects that use extended section numbering. +.Pp +.Sh RETURN VALUES +Function +.Fn elf_getshdrnum +returns zero value if successful, or -1 in case of an error. +.Sh ERRORS +Function +.Fn elf_getshdrnum +can fail with the following errors: +.Bl -tag -width "[ELF_E_RESOURCE]" +.It Bq Er ELF_E_ARGUMENT +A NULL value was passed in for argument +.Ar elf . +.It Bq Er ELF_E_ARGUMENT +Argument +.Ar elf +was not for an ELF file. +.It Bq Er ELF_E_ARGUMENT +Argument +.Ar elf +lacks an ELF Executable header. +.El +.Sh SEE ALSO +.Xr elf 3 , +.Xr elf32_getehdr 3 , +.Xr elf64_getehdr 3 , +.Xr elf_getident 3 , +.Xr elf_getphdrnum 3 , +.Xr elf_getshdrstrndx 3 , +.Xr gelf 3 , +.Xr gelf_getehdr 3 Added: head/lib/libelf/elf_getshdrstrndx.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libelf/elf_getshdrstrndx.3 Wed Jul 21 12:14:50 2010 (r210345) @@ -0,0 +1,79 @@ +.\" Copyright (c) 2006,2008 Joseph Koshy. 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 Joseph Koshy ``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 Joseph Koshy 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 5, 2009 +.Os +.Dt ELF_GETSHDRSTRNDX 3 +.Sh NAME +.Nm elf_getshdrstrndx +.Nd retrieve the index of the section name string table +.Sh LIBRARY +.Lb libelf +.Sh SYNOPSIS +.In libelf.h +.Ft int +.Fn elf_getshdrstrndx "Elf *elf" "size_t *ndxptr" +.Sh DESCRIPTION +Function +.Fn elf_getshdrstrndx +retrieves the section index of the string table containing section +names from descriptor +.Ar elf +and stores it into the location pointed to by argument +.Ar ndxptr . +.Pp +This function allow applications to process both normal ELF +objects and ELF objects that use extended section numbering uniformly. +.Pp +.Sh RETURN VALUES +These functions return zero if successful, or -1 in case of an error. +.Sh ERRORS +These functions can fail with the following errors: +.Bl -tag -width "[ELF_E_RESOURCE]" +.It Bq Er ELF_E_ARGUMENT +A NULL value was passed in for argument +.Ar elf . +.It Bq Er ELF_E_ARGUMENT +Argument +.Ar elf +was not for an ELF file. +.It Bq Er ELF_E_ARGUMENT +Argument +.Ar elf +lacks an ELF Executable header. +.It Bq Er ELF_E_ARGUMENT +Argument +.Ar ndx +contained a value in the reserved range of section indices. +.El +.Sh SEE ALSO +.Xr elf 3 , +.Xr elf32_getehdr 3 , +.Xr elf64_getehdr 3 , +.Xr elf_getident 3 , +.Xr elf_getphdrnum 3 , +.Xr elf_getshdrnum 3 , +.Xr gelf 3 , +.Xr gelf_getehdr 3 Modified: head/lib/libelf/elf_getshnum.3 ============================================================================== --- head/lib/libelf/elf_getshnum.3 Wed Jul 21 11:26:18 2010 (r210344) +++ head/lib/libelf/elf_getshnum.3 Wed Jul 21 12:14:50 2010 (r210345) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2006 +.Dd August 5, 2009 .Dt ELF_GETSHNUM 3 .Os .Sh NAME @@ -36,6 +36,11 @@ .Ft int .Fn elf_getshnum "Elf *elf" "size_t *shnum" .Sh DESCRIPTION +This function is deprecated. +Please use +.Xr elf_getshdrnum 3 +instead. +.Pp Function .Fn elf_getshnum retrieves the number of ELF sections associated with descriptor @@ -73,6 +78,7 @@ lacks an ELF Executable header. .Xr elf32_getehdr 3 , .Xr elf64_getehdr 3 , .Xr elf_getident 3 , -.Xr elf_getshstrndx 3 , +.Xr elf_getphdrnum 3 , +.Xr elf_getshdrstrndx 3 , .Xr gelf 3 , .Xr gelf_getehdr 3 Modified: head/lib/libelf/elf_getshstrndx.3 ============================================================================== --- head/lib/libelf/elf_getshstrndx.3 Wed Jul 21 11:26:18 2010 (r210344) +++ head/lib/libelf/elf_getshstrndx.3 Wed Jul 21 12:14:50 2010 (r210345) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2006 +.Dd August 5, 2009 .Dt ELF_GETSHSTRNDX 3 .Os .Sh NAME @@ -46,6 +46,12 @@ names from descriptor .Ar elf and stores it into the location pointed to by argument .Ar ndxptr . +Function +.Fn elf_getshstrndx +is deprecated. +Please use +.Xr elf_getshdrstrndx 3 +instead. .Pp Function .Fn elf_setshstrndx @@ -82,6 +88,7 @@ contained a value in the reserved range .Xr elf32_getehdr 3 , .Xr elf64_getehdr 3 , .Xr elf_getident 3 , -.Xr elf_getshnum 3 , +.Xr elf_getphdrnum 3 , +.Xr elf_getshdrnum 3 , .Xr gelf 3 , .Xr gelf_getehdr 3 Modified: head/lib/libelf/elf_phnum.c ============================================================================== --- head/lib/libelf/elf_phnum.c Wed Jul 21 11:26:18 2010 (r210344) +++ head/lib/libelf/elf_phnum.c Wed Jul 21 12:14:50 2010 (r210345) @@ -32,8 +32,8 @@ __FBSDID("$FreeBSD$"); #include "_libelf.h" -int -elf_getphnum(Elf *e, size_t *phnum) +static int +_libelf_getphdrnum(Elf *e, size_t *phnum) { void *eh; int ec; @@ -41,13 +41,26 @@ elf_getphnum(Elf *e, size_t *phnum) if (e == NULL || e->e_kind != ELF_K_ELF || ((ec = e->e_class) != ELFCLASS32 && ec != ELFCLASS64)) { LIBELF_SET_ERROR(ARGUMENT, 0); - return (0); + return (-1); } if ((eh = _libelf_ehdr(e, ec, 0)) == NULL) - return (0); + return (-1); *phnum = e->e_u.e_elf.e_nphdr; - return (1); + return (0); +} + +int +elf_getphdrnum(Elf *e, size_t *phnum) +{ + return (_libelf_getphdrnum(e, phnum)); +} + +/* Deprecated API */ +int +elf_getphnum(Elf *e, size_t *phnum) +{ + return (_libelf_getphdrnum(e, phnum) >= 0); } Modified: head/lib/libelf/elf_shnum.c ============================================================================== --- head/lib/libelf/elf_shnum.c Wed Jul 21 11:26:18 2010 (r210344) +++ head/lib/libelf/elf_shnum.c Wed Jul 21 12:14:50 2010 (r210345) @@ -32,8 +32,8 @@ __FBSDID("$FreeBSD$"); #include "_libelf.h" -int -elf_getshnum(Elf *e, size_t *shnum) +static int +_libelf_getshdrnum(Elf *e, size_t *shnum) { void *eh; int ec; @@ -41,13 +41,26 @@ elf_getshnum(Elf *e, size_t *shnum) if (e == NULL || e->e_kind != ELF_K_ELF || ((ec = e->e_class) != ELFCLASS32 && ec != ELFCLASS64)) { LIBELF_SET_ERROR(ARGUMENT, 0); - return (0); + return (-1); } if ((eh = _libelf_ehdr(e, ec, 0)) == NULL) - return (0); + return (-1); *shnum = e->e_u.e_elf.e_nscn; - return (1); + return (0); +} + +int +elf_getshdrnum(Elf *e, size_t *shnum) +{ + return (_libelf_getshdrnum(e, shnum)); +} + +/* Deprecated API. */ +int +elf_getshnum(Elf *e, size_t *shnum) +{ + return (_libelf_getshdrnum(e, shnum) >= 0); } Modified: head/lib/libelf/elf_shstrndx.c ============================================================================== --- head/lib/libelf/elf_shstrndx.c Wed Jul 21 11:26:18 2010 (r210344) +++ head/lib/libelf/elf_shstrndx.c Wed Jul 21 12:14:50 2010 (r210345) @@ -32,8 +32,8 @@ __FBSDID("$FreeBSD$"); #include "_libelf.h" -int -elf_getshstrndx(Elf *e, size_t *strndx) +static int +_libelf_getshdrstrndx(Elf *e, size_t *strndx) { void *eh; int ec; @@ -41,15 +41,27 @@ elf_getshstrndx(Elf *e, size_t *strndx) if (e == NULL || e->e_kind != ELF_K_ELF || ((ec = e->e_class) != ELFCLASS32 && ec != ELFCLASS64)) { LIBELF_SET_ERROR(ARGUMENT, 0); - return (0); + return (-1); } if ((eh = _libelf_ehdr(e, ec, 0)) == NULL) - return (0); + return (-1); *strndx = e->e_u.e_elf.e_strndx; - return (1); + return (0); +} + +int +elf_getshdrstrndx(Elf *e, size_t *strndx) +{ + return (_libelf_getshdrstrndx(e, strndx)); +} + +int +elf_getshstrndx(Elf *e, size_t *strndx) /* Deprecated API. */ +{ + return (_libelf_getshdrstrndx(e, strndx) >= 0); } int Modified: head/lib/libelf/libelf.h ============================================================================== --- head/lib/libelf/libelf.h Wed Jul 21 11:26:18 2010 (r210344) +++ head/lib/libelf/libelf.h Wed Jul 21 12:14:50 2010 (r210345) @@ -193,10 +193,13 @@ Elf_Arsym *elf_getarsym(Elf *_elf, size_ off_t elf_getbase(Elf *_elf); Elf_Data *elf_getdata(Elf_Scn *, Elf_Data *); char *elf_getident(Elf *_elf, size_t *_ptr); -int elf_getphnum(Elf *_elf, size_t *_dst); +int elf_getphdrnum(Elf *_elf, size_t *_dst); +int elf_getphnum(Elf *_elf, size_t *_dst); /* Deprecated */ Elf_Scn *elf_getscn(Elf *_elf, size_t _index); -int elf_getshnum(Elf *_elf, size_t *_dst); -int elf_getshstrndx(Elf *_elf, size_t *_dst); +int elf_getshdrnum(Elf *_elf, size_t *_dst); +int elf_getshnum(Elf *_elf, size_t *_dst); /* Deprecated */ +int elf_getshdrstrndx(Elf *_elf, size_t *_dst); +int elf_getshstrndx(Elf *_elf, size_t *_dst); /* Deprecated */ unsigned long elf_hash(const char *_name); Elf_Kind elf_kind(Elf *_elf); Elf *elf_memory(char *_image, size_t _size); From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 12:23:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39BEA1065674; Wed, 21 Jul 2010 12:23:50 +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 28C288FC17; Wed, 21 Jul 2010 12:23:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LCNoOP015983; Wed, 21 Jul 2010 12:23:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LCNorp015981; Wed, 21 Jul 2010 12:23:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201007211223.o6LCNorp015981@svn.freebsd.org> From: Alexander Motin Date: Wed, 21 Jul 2010 12:23: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: r210346 - 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, 21 Jul 2010 12:23:50 -0000 Author: mav Date: Wed Jul 21 12:23:49 2010 New Revision: 210346 URL: http://svn.freebsd.org/changeset/base/210346 Log: Use proper sysctl type (quad) for et_frequency. It fixes output on sparc64. Modified: head/sys/kern/kern_et.c Modified: head/sys/kern/kern_et.c ============================================================================== --- head/sys/kern/kern_et.c Wed Jul 21 12:14:50 2010 (r210345) +++ head/sys/kern/kern_et.c Wed Jul 21 12:23:49 2010 (r210346) @@ -62,8 +62,8 @@ et_register(struct eventtimer *et) SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(et->et_sysctl), OID_AUTO, "flags", CTLFLAG_RD, &(et->et_flags), 0, "Event timer capabilities"); - SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(et->et_sysctl), OID_AUTO, - "frequency", CTLFLAG_RD, &(et->et_frequency), 0, + SYSCTL_ADD_QUAD(NULL, SYSCTL_CHILDREN(et->et_sysctl), OID_AUTO, + "frequency", CTLFLAG_RD, &(et->et_frequency), "Event timer base frequency"); SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(et->et_sysctl), OID_AUTO, "quality", CTLFLAG_RD, &(et->et_quality), 0, From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 12:30:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 543AC106566B; Wed, 21 Jul 2010 12:30:58 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4315E8FC19; Wed, 21 Jul 2010 12:30:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LCUwTO017606; Wed, 21 Jul 2010 12:30:58 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LCUwLI017604; Wed, 21 Jul 2010 12:30:58 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211230.o6LCUwLI017604@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 12:30: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: r210347 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 12:30:58 -0000 Author: kaiw Date: Wed Jul 21 12:30:58 2010 New Revision: 210347 URL: http://svn.freebsd.org/changeset/base/210347 Log: Fix a memory leak. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/elf_update.c Modified: head/lib/libelf/elf_update.c ============================================================================== --- head/lib/libelf/elf_update.c Wed Jul 21 12:23:49 2010 (r210346) +++ head/lib/libelf/elf_update.c Wed Jul 21 12:30:58 2010 (r210347) @@ -855,11 +855,13 @@ _libelf_write_elf(Elf *e, off_t newsize) e->e_u.e_elf.e_phdr.e_phdr64 = NULL; } + free(newfile); + return (rc); error: - if (newfile) - free(newfile); + free(newfile); + return ((off_t) -1); } From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 12:54:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A12A2106566B; Wed, 21 Jul 2010 12:54:34 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8ECCD8FC15; Wed, 21 Jul 2010 12:54:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LCsYFf022887; Wed, 21 Jul 2010 12:54:34 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LCsYT6022852; Wed, 21 Jul 2010 12:54:34 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211254.o6LCsYT6022852@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 12:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210348 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 12:54:34 -0000 Author: kaiw Date: Wed Jul 21 12:54:34 2010 New Revision: 210348 URL: http://svn.freebsd.org/changeset/base/210348 Log: Move helper functions `_libelf_ar_get_{name,number,string}()` and `_libelf_ar_open()` to a new compilation unit "libelf_ar_util.c" to break the circular dependency between "elf_memory.o" and "libelf_ar.o". Obtained from: elftoolchain MFC after: 1 month Added: head/lib/libelf/libelf_ar_util.c (contents, props changed) Modified: head/lib/libelf/Makefile head/lib/libelf/_libelf.h head/lib/libelf/libelf_ar.c Modified: head/lib/libelf/Makefile ============================================================================== --- head/lib/libelf/Makefile Wed Jul 21 12:30:58 2010 (r210347) +++ head/lib/libelf/Makefile Wed Jul 21 12:54:34 2010 (r210348) @@ -44,6 +44,7 @@ SRCS= elf_begin.c \ libelf_align.c \ libelf_allocate.c \ libelf_ar.c \ + libelf_ar_util.c \ libelf_checksum.c \ libelf_data.c \ libelf_ehdr.c \ Modified: head/lib/libelf/_libelf.h ============================================================================== --- head/lib/libelf/_libelf.h Wed Jul 21 12:30:58 2010 (r210347) +++ head/lib/libelf/_libelf.h Wed Jul 21 12:54:34 2010 (r210348) @@ -165,6 +165,10 @@ Elf_Scn *_libelf_allocate_scn(Elf *_e, s Elf_Arhdr *_libelf_ar_gethdr(Elf *_e); Elf *_libelf_ar_open(Elf *_e); Elf *_libelf_ar_open_member(int _fd, Elf_Cmd _c, Elf *_ar); +int _libelf_ar_get_member(char *_s, size_t _sz, int _base, size_t *_ret); +char *_libelf_ar_get_string(const char *_buf, size_t _sz, int _rawname); +char *_libelf_ar_get_name(char *_buf, size_t _sz, Elf *_e); +int _libelf_ar_get_number(char *_buf, size_t _sz, int _base, size_t *_ret); Elf_Arsym *_libelf_ar_process_symtab(Elf *_ar, size_t *_dst); unsigned long _libelf_checksum(Elf *_e, int _elfclass); void *_libelf_ehdr(Elf *_e, int _elfclass, int _allocate); Modified: head/lib/libelf/libelf_ar.c ============================================================================== --- head/lib/libelf/libelf_ar.c Wed Jul 21 12:30:58 2010 (r210347) +++ head/lib/libelf/libelf_ar.c Wed Jul 21 12:54:34 2010 (r210348) @@ -72,145 +72,6 @@ __FBSDID("$FreeBSD$"); * they must be the very first objects and in that order. */ -/* - * Convert a string bounded by `start' and `start+sz' (exclusive) to a - * number in the specified base. - */ -static int -_libelf_ar_get_number(char *s, size_t sz, int base, size_t *ret) -{ - int c, v; - size_t r; - char *e; - - assert(base <= 10); - - e = s + sz; - - /* skip leading blanks */ - for (;s < e && (c = *s) == ' '; s++) - ; - - r = 0L; - for (;s < e; s++) { - if ((c = *s) == ' ') - break; - if (c < '0' || c > '9') - return (0); - v = c - '0'; - if (v >= base) /* Illegal digit. */ - break; - r *= base; - r += v; - } - - *ret = r; - - return (1); -} - -/* - * Retrieve a string from a name field. If `rawname' is set, leave - * ar(1) control characters in. - */ -static char * -_libelf_ar_get_string(const char *buf, size_t bufsize, int rawname) -{ - const char *q; - char *r; - size_t sz; - - if (rawname) - sz = bufsize + 1; - else { - /* Skip back over trailing blanks. */ - for (q = buf + bufsize - 1; q >= buf && *q == ' '; --q) - ; - - if (q < buf) { - /* - * If the input buffer only had blanks in it, - * return a zero-length string. - */ - buf = ""; - sz = 1; - } else { - /* - * Remove the trailing '/' character, but only - * if the name isn't one of the special names - * "/" and "//". - */ - if (q > buf + 1 || - (q == (buf + 1) && *buf != '/')) - q--; - - sz = q - buf + 2; /* Space for a trailing NUL. */ - } - } - - if ((r = malloc(sz)) == NULL) { - LIBELF_SET_ERROR(RESOURCE, 0); - return (NULL); - } - - (void) strncpy(r, buf, sz); - r[sz - 1] = '\0'; - - return (r); -} - -/* - * Retrieve the full name of the archive member. - */ -static char * -_libelf_ar_get_name(char *buf, size_t bufsize, Elf *e) -{ - char c, *q, *r, *s; - size_t len; - size_t offset; - - assert(e->e_kind == ELF_K_AR); - - if (buf[0] == '/' && (c = buf[1]) >= '0' && c <= '9') { - /* - * The value in field ar_name is a decimal offset into - * the archive string table where the actual name - * resides. - */ - if (_libelf_ar_get_number(buf + 1, bufsize - 1, 10, - &offset) == 0) { - LIBELF_SET_ERROR(ARCHIVE, 0); - return (NULL); - } - - if (offset > e->e_u.e_ar.e_rawstrtabsz) { - LIBELF_SET_ERROR(ARCHIVE, 0); - return (NULL); - } - - s = q = e->e_u.e_ar.e_rawstrtab + offset; - r = e->e_u.e_ar.e_rawstrtab + e->e_u.e_ar.e_rawstrtabsz; - - for (s = q; s < r && *s != '/'; s++) - ; - len = s - q + 1; /* space for the trailing NUL */ - - if ((s = malloc(len)) == NULL) { - LIBELF_SET_ERROR(RESOURCE, 0); - return (NULL); - } - - (void) strncpy(s, q, len); - s[len - 1] = '\0'; - - return (s); - } - - /* - * Normal 'name' - */ - return (_libelf_ar_get_string(buf, bufsize, 0)); -} Elf_Arhdr * @@ -323,79 +184,6 @@ _libelf_ar_open_member(int fd, Elf_Cmd c return (e); } -Elf * -_libelf_ar_open(Elf *e) -{ - int i; - char *s, *end; - size_t sz; - struct ar_hdr arh; - - e->e_kind = ELF_K_AR; - e->e_u.e_ar.e_nchildren = 0; - e->e_u.e_ar.e_next = (off_t) -1; - - /* - * Look for special members. - */ - - s = e->e_rawfile + SARMAG; - end = e->e_rawfile + e->e_rawsize; - - assert(e->e_rawsize > 0); - - /* - * Look for magic names "/ " and "// " in the first two entries - * of the archive. - */ - for (i = 0; i < 2; i++) { - - if (s + sizeof(arh) > end) { - LIBELF_SET_ERROR(ARCHIVE, 0); - return (NULL); - } - - (void) memcpy(&arh, s, sizeof(arh)); - - if (arh.ar_fmag[0] != '`' || arh.ar_fmag[1] != '\n') { - LIBELF_SET_ERROR(ARCHIVE, 0); - return (NULL); - } - - if (arh.ar_name[0] != '/') /* not a special symbol */ - break; - - if (_libelf_ar_get_number(arh.ar_size, sizeof(arh.ar_size), 10, &sz) == 0) { - LIBELF_SET_ERROR(ARCHIVE, 0); - return (NULL); - } - - assert(sz > 0); - - s += sizeof(arh); - - if (arh.ar_name[1] == ' ') { /* "/ " => symbol table */ - - e->e_u.e_ar.e_rawsymtab = s; - e->e_u.e_ar.e_rawsymtabsz = sz; - - } else if (arh.ar_name[1] == '/' && arh.ar_name[2] == ' ') { - - /* "// " => string table for long file names */ - e->e_u.e_ar.e_rawstrtab = s; - e->e_u.e_ar.e_rawstrtabsz = sz; - } - - sz = LIBELF_ADJUST_AR_SIZE(sz); - - s += sz; - } - - e->e_u.e_ar.e_next = (off_t) (s - e->e_rawfile); - - return (e); -} - /* * An ar(1) symbol table has the following layout: * Added: head/lib/libelf/libelf_ar_util.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libelf/libelf_ar_util.c Wed Jul 21 12:54:34 2010 (r210348) @@ -0,0 +1,253 @@ +/*- + * Copyright (c) 2006,2009 Joseph Koshy + * 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 "_libelf.h" + +/* + * Convert a string bounded by `start' and `start+sz' (exclusive) to a + * number in the specified base. + */ +int +_libelf_ar_get_number(char *s, size_t sz, int base, size_t *ret) +{ + int c, v; + size_t r; + char *e; + + assert(base <= 10); + + e = s + sz; + + /* skip leading blanks */ + for (;s < e && (c = *s) == ' '; s++) + ; + + r = 0L; + for (;s < e; s++) { + if ((c = *s) == ' ') + break; + if (c < '0' || c > '9') + return (0); + v = c - '0'; + if (v >= base) /* Illegal digit. */ + break; + r *= base; + r += v; + } + + *ret = r; + + return (1); +} + +/* + * Retrieve a string from a name field. If `rawname' is set, leave + * ar(1) control characters in. + */ +char * +_libelf_ar_get_string(const char *buf, size_t bufsize, int rawname) +{ + const char *q; + char *r; + size_t sz; + + if (rawname) + sz = bufsize + 1; + else { + /* Skip back over trailing blanks. */ + for (q = buf + bufsize - 1; q >= buf && *q == ' '; --q) + ; + + if (q < buf) { + /* + * If the input buffer only had blanks in it, + * return a zero-length string. + */ + buf = ""; + sz = 1; + } else { + /* + * Remove the trailing '/' character, but only + * if the name isn't one of the special names + * "/" and "//". + */ + if (q > buf + 1 || + (q == (buf + 1) && *buf != '/')) + q--; + + sz = q - buf + 2; /* Space for a trailing NUL. */ + } + } + + if ((r = malloc(sz)) == NULL) { + LIBELF_SET_ERROR(RESOURCE, 0); + return (NULL); + } + + (void) strncpy(r, buf, sz); + r[sz - 1] = '\0'; + + return (r); +} + +/* + * Retrieve the full name of the archive member. + */ +char * +_libelf_ar_get_name(char *buf, size_t bufsize, Elf *e) +{ + char c, *q, *r, *s; + size_t len; + size_t offset; + + assert(e->e_kind == ELF_K_AR); + + if (buf[0] == '/' && (c = buf[1]) >= '0' && c <= '9') { + /* + * The value in field ar_name is a decimal offset into + * the archive string table where the actual name + * resides. + */ + if (_libelf_ar_get_number(buf + 1, bufsize - 1, 10, + &offset) == 0) { + LIBELF_SET_ERROR(ARCHIVE, 0); + return (NULL); + } + + if (offset > e->e_u.e_ar.e_rawstrtabsz) { + LIBELF_SET_ERROR(ARCHIVE, 0); + return (NULL); + } + + s = q = e->e_u.e_ar.e_rawstrtab + offset; + r = e->e_u.e_ar.e_rawstrtab + e->e_u.e_ar.e_rawstrtabsz; + + for (s = q; s < r && *s != '/'; s++) + ; + len = s - q + 1; /* space for the trailing NUL */ + + if ((s = malloc(len)) == NULL) { + LIBELF_SET_ERROR(RESOURCE, 0); + return (NULL); + } + + (void) strncpy(s, q, len); + s[len - 1] = '\0'; + + return (s); + } + + /* + * Normal 'name' + */ + return (_libelf_ar_get_string(buf, bufsize, 0)); +} + +/* + * Open an 'ar' archive. + */ +Elf * +_libelf_ar_open(Elf *e) +{ + int i; + char *s, *end; + size_t sz; + struct ar_hdr arh; + + e->e_kind = ELF_K_AR; + e->e_u.e_ar.e_nchildren = 0; + e->e_u.e_ar.e_next = (off_t) -1; + + /* + * Look for special members. + */ + + s = e->e_rawfile + SARMAG; + end = e->e_rawfile + e->e_rawsize; + + assert(e->e_rawsize > 0); + + /* + * Look for magic names "/ " and "// " in the first two entries + * of the archive. + */ + for (i = 0; i < 2; i++) { + + if (s + sizeof(arh) > end) { + LIBELF_SET_ERROR(ARCHIVE, 0); + return (NULL); + } + + (void) memcpy(&arh, s, sizeof(arh)); + + if (arh.ar_fmag[0] != '`' || arh.ar_fmag[1] != '\n') { + LIBELF_SET_ERROR(ARCHIVE, 0); + return (NULL); + } + + if (arh.ar_name[0] != '/') /* not a special symbol */ + break; + + if (_libelf_ar_get_number(arh.ar_size, sizeof(arh.ar_size), + 10, &sz) == 0) { + LIBELF_SET_ERROR(ARCHIVE, 0); + return (NULL); + } + + assert(sz > 0); + + s += sizeof(arh); + + if (arh.ar_name[1] == ' ') { /* "/ " => symbol table */ + + e->e_u.e_ar.e_rawsymtab = s; + e->e_u.e_ar.e_rawsymtabsz = sz; + + } else if (arh.ar_name[1] == '/' && arh.ar_name[2] == ' ') { + + /* "// " => string table for long file names */ + e->e_u.e_ar.e_rawstrtab = s; + e->e_u.e_ar.e_rawstrtabsz = sz; + } + + sz = LIBELF_ADJUST_AR_SIZE(sz); + + s += sz; + } + + e->e_u.e_ar.e_next = (off_t) (s - e->e_rawfile); + + return (e); +} From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 13:00:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 325E2106564A; Wed, 21 Jul 2010 13:00:02 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D52A8FC12; Wed, 21 Jul 2010 13:00:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LD02eP024144; Wed, 21 Jul 2010 13:00:02 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LD01el024143; Wed, 21 Jul 2010 13:00:02 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211300.o6LD01el024143@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 13:00: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: r210349 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 13:00:02 -0000 Author: kaiw Date: Wed Jul 21 13:00:01 2010 New Revision: 210349 URL: http://svn.freebsd.org/changeset/base/210349 Log: Remove a redundant word. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/elf.3 Modified: head/lib/libelf/elf.3 ============================================================================== --- head/lib/libelf/elf.3 Wed Jul 21 12:54:34 2010 (r210348) +++ head/lib/libelf/elf.3 Wed Jul 21 13:00:01 2010 (r210349) @@ -36,8 +36,8 @@ .Sh DESCRIPTION The .Lb libelf -library provides functions that allow an application to read and -manipulate ELF object files, and to read +provides functions that allow an application to read and manipulate +ELF object files, and to read .Xr ar 1 archives. The library allows the manipulation of ELF objects in a byte ordering From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 13:01:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A421065679; Wed, 21 Jul 2010 13:01:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A88D88FC1B; Wed, 21 Jul 2010 13:01:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LD1L7V024482; Wed, 21 Jul 2010 13:01:21 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LD1LOd024480; Wed, 21 Jul 2010 13:01:21 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201007211301.o6LD1LOd024480@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 21 Jul 2010 13:01: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: r210350 - 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: Wed, 21 Jul 2010 13:01:21 -0000 Author: bz Date: Wed Jul 21 13:01:21 2010 New Revision: 210350 URL: http://svn.freebsd.org/changeset/base/210350 Log: Since r186119 IP6 input counters for octets and packets were not working anymore. In addition more checks and operations were missing. In case lla_lookup results in a match, get the ifaddr to update the statistics counters, and check that the address is neither tentative, duplicate or otherwise invalid before accepting the packet. If ok, record the address information in the mbuf. [ as is done in case lla_lookup does not return a result and we go through the FIB ]. Reported by: remko Tested by: remko MFC after: 2 weeks Modified: head/sys/netinet6/ip6_input.c Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Wed Jul 21 13:00:01 2010 (r210349) +++ head/sys/netinet6/ip6_input.c Wed Jul 21 13:01:21 2010 (r210350) @@ -514,10 +514,54 @@ passin: (struct sockaddr *)&dst6); IF_AFDATA_UNLOCK(ifp); if ((lle != NULL) && (lle->la_flags & LLE_IFADDR)) { - ours = 1; - deliverifp = ifp; + struct ifaddr *ifa; + struct in6_ifaddr *ia6; + int bad; + + bad = 1; +#define sa_equal(a1, a2) \ + (bcmp((a1), (a2), ((a1))->sin6_len) == 0) + IF_ADDR_LOCK(ifp); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != dst6.sin6_family) + continue; + if (sa_equal(&dst6, ifa->ifa_addr)) + break; + } + KASSERT(ifa != NULL, ("%s: ifa not found for lle %p", + __func__, lle)); +#undef sa_equal + + ia6 = (struct in6_ifaddr *)ifa; + if (!(ia6->ia6_flags & IN6_IFF_NOTREADY)) { + /* Count the packet in the ip address stats */ + ia6->ia_ifa.if_ipackets++; + ia6->ia_ifa.if_ibytes += m->m_pkthdr.len; + + /* + * record address information into m_tag. + */ + (void)ip6_setdstifaddr(m, ia6); + + bad = 0; + } else { + char ip6bufs[INET6_ADDRSTRLEN]; + char ip6bufd[INET6_ADDRSTRLEN]; + /* address is not ready, so discard the packet. */ + nd6log((LOG_INFO, + "ip6_input: packet to an unready address %s->%s\n", + ip6_sprintf(ip6bufs, &ip6->ip6_src), + ip6_sprintf(ip6bufd, &ip6->ip6_dst))); + } + IF_ADDR_UNLOCK(ifp); LLE_RUNLOCK(lle); - goto hbhcheck; + if (bad) + goto bad; + else { + ours = 1; + deliverifp = ifp; + goto hbhcheck; + } } if (lle != NULL) LLE_RUNLOCK(lle); From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 13:18:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25D0B1065672; Wed, 21 Jul 2010 13:18:58 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF7AD8FC12; Wed, 21 Jul 2010 13:18:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LDIvFu028398; Wed, 21 Jul 2010 13:18:57 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LDIvbJ028395; Wed, 21 Jul 2010 13:18:57 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211318.o6LDIvbJ028395@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 13:18: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: r210351 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 13:18:58 -0000 Author: kaiw Date: Wed Jul 21 13:18:57 2010 New Revision: 210351 URL: http://svn.freebsd.org/changeset/base/210351 Log: * Note that ar(1) archives may also be opened using `elf_memory(3)`. * Ignore the passed in value of the `fd` argument for ar(1) archives opened with elf_memory(3). Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/elf_begin.3 head/lib/libelf/elf_begin.c Modified: head/lib/libelf/elf_begin.3 ============================================================================== --- head/lib/libelf/elf_begin.3 Wed Jul 21 13:01:21 2010 (r210350) +++ head/lib/libelf/elf_begin.3 Wed Jul 21 13:18:57 2010 (r210351) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 21, 2006 +.Dd April 11, 2010 .Dt ELF_BEGIN 3 .Os .Sh NAME @@ -163,7 +163,9 @@ archive may be opened in read mode (with set to .Dv ELF_C_READ ) using -.Fn elf_begin . +.Fn elf_begin +or +.Fn elf_memory . The returned ELF descriptor can be passed into to subsequent calls to .Fn elf_begin Modified: head/lib/libelf/elf_begin.c ============================================================================== --- head/lib/libelf/elf_begin.c Wed Jul 21 13:01:21 2010 (r210350) +++ head/lib/libelf/elf_begin.c Wed Jul 21 13:18:57 2010 (r210351) @@ -131,13 +131,15 @@ elf_begin(int fd, Elf_Cmd c, Elf *a) case ELF_C_READ: /* * Descriptor `a' could be for a regular ELF file, or - * for an ar(1) archive. + * for an ar(1) archive. If descriptor `a' was opened + * using a valid file descriptor, we need to check if + * the passed in `fd' value matches the original one. */ - if (a && (a->e_fd != fd || c != a->e_cmd)) { + if (a && + ((a->e_fd != -1 && a->e_fd != fd) || c != a->e_cmd)) { LIBELF_SET_ERROR(ARGUMENT, 0); return (NULL); } - break; default: @@ -149,7 +151,7 @@ elf_begin(int fd, Elf_Cmd c, Elf *a) if (a == NULL) e = _libelf_open_object(fd, c); else if (a->e_kind == ELF_K_AR) - e = _libelf_ar_open_member(fd, c, a); + e = _libelf_ar_open_member(a->e_fd, c, a); else (e = a)->e_activations++; From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 13:23:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 294C11065670; Wed, 21 Jul 2010 13:23:08 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 187B88FC13; Wed, 21 Jul 2010 13:23:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LDN8LA029354; Wed, 21 Jul 2010 13:23:08 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LDN7uq029352; Wed, 21 Jul 2010 13:23:07 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211323.o6LDN7uq029352@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 13:23: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: r210352 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 13:23:08 -0000 Author: kaiw Date: Wed Jul 21 13:23:07 2010 New Revision: 210352 URL: http://svn.freebsd.org/changeset/base/210352 Log: Add a cross-reference to `elf_rawfile(3)`. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/elf_getdata.3 Modified: head/lib/libelf/elf_getdata.3 ============================================================================== --- head/lib/libelf/elf_getdata.3 Wed Jul 21 13:18:57 2010 (r210351) +++ head/lib/libelf/elf_getdata.3 Wed Jul 21 13:23:07 2010 (r210352) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006,2008 Joseph Koshy. All rights reserved. +.\" Copyright (c) 2006,2008,2010 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 26, 2006 +.Dd April 30, 2010 .Dt ELF_GETDATA 3 .Os .Sh NAME @@ -193,6 +193,7 @@ An out of memory condition was detected. .Xr elf_getscn 3 , .Xr elf_getshdr 3 , .Xr elf_newscn 3 , +.Xr elf_rawfile 3 , .Xr elf_update 3 , .Xr elf_version 3 , .Xr gelf 3 From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 13:29:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8970C106564A; Wed, 21 Jul 2010 13:29:00 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7861C8FC16; Wed, 21 Jul 2010 13:29:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LDT0j7030693; Wed, 21 Jul 2010 13:29:00 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LDT0J3030691; Wed, 21 Jul 2010 13:29:00 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201007211329.o6LDT0J3030691@svn.freebsd.org> From: Kai Wang Date: Wed, 21 Jul 2010 13:29: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: r210353 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 13:29:00 -0000 Author: kaiw Date: Wed Jul 21 13:29:00 2010 New Revision: 210353 URL: http://svn.freebsd.org/changeset/base/210353 Log: * Remove a superfluous error description. * Document an additional error that may be returned: `ELF_E_ARCHIVE`. Obtained from: elftoolchain MFC after: 1 month Modified: head/lib/libelf/elf_begin.3 Modified: head/lib/libelf/elf_begin.3 ============================================================================== --- head/lib/libelf/elf_begin.3 Wed Jul 21 13:23:07 2010 (r210352) +++ head/lib/libelf/elf_begin.3 Wed Jul 21 13:29:00 2010 (r210353) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 11, 2010 +.Dd June 20, 2010 .Dt ELF_BEGIN 3 .Os .Sh NAME @@ -224,6 +224,10 @@ Function can fail with the following errors: .Pp .Bl -tag -width "[ELF_E_RESOURCE]" +.It Bq Er ELF_E_ARCHIVE +The archive denoted by argument +.Ar elf +could not be parsed. .It Bq Er ELF_E_ARGUMENT An unrecognized value was specified in argument .Ar cmd . @@ -247,12 +251,6 @@ differs from the value specified when EL .Ar elf was created. .It Bq Er ELF_E_ARGUMENT -Argument -.Ar elf -was not a descriptor for an -.Xr ar 1 -archive. -.It Bq Er ELF_E_ARGUMENT An .Xr ar 1 archive was opened with with From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 16:19:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 885131065673; Wed, 21 Jul 2010 16:19:02 +0000 (UTC) (envelope-from remko@elvandar.org) Received: from mailgate.jr-hosting.nl (unknown [IPv6:2a01:4f8:63:1281::3]) by mx1.freebsd.org (Postfix) with ESMTP id 1F6768FC1E; Wed, 21 Jul 2010 16:19:02 +0000 (UTC) Received: from websrv01.jr-hosting.nl (unknown [IPv6:2a01:4f8:63:1281::4]) by mailgate.jr-hosting.nl (Postfix) with ESMTP id 261091CC34; Wed, 21 Jul 2010 18:19:01 +0200 (CEST) Received: from a83-163-38-147.adsl.xs4all.nl ([83.163.38.147] helo=axantucar.elvandar.int) by websrv01.jr-hosting.nl with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.72 (FreeBSD)) (envelope-from ) id 1Obc0b-000CeJ-2o; Wed, 21 Jul 2010 18:19:01 +0200 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Remko Lodder In-Reply-To: <201007211301.o6LD1LOd024480@svn.freebsd.org> Date: Wed, 21 Jul 2010 18:19:00 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <201007211301.o6LD1LOd024480@svn.freebsd.org> To: Bjoern A. Zeeb X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r210350 - 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: Wed, 21 Jul 2010 16:19:02 -0000 On Jul 21, 2010, at 3:01 PM, Bjoern A. Zeeb wrote: > Author: bz > Date: Wed Jul 21 13:01:21 2010 > New Revision: 210350 > URL: http://svn.freebsd.org/changeset/base/210350 > > Log: > Since r186119 IP6 input counters for octets and packets were not > working anymore. In addition more checks and operations were missing. > > In case lla_lookup results in a match, get the ifaddr to update the > statistics counters, and check that the address is neither tentative, > duplicate or otherwise invalid before accepting the packet. If ok, > record the address information in the mbuf. [ as is done in case > lla_lookup does not return a result and we go through the FIB ]. > > Reported by: remko > Tested by: remko > MFC after: 2 weeks Merci Beaucoup, now my daily reports are nice and cute again :-) Cheers Remko -- /"\ Best regards, | remko@FreeBSD.org \ / Remko Lodder | remko@EFnet X http://www.evilcoder.org/ | / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 16:58:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC95B106564A; Wed, 21 Jul 2010 16:58:50 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (unknown [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 8452B8FC08; Wed, 21 Jul 2010 16:58:50 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id B40252A2A8D6; Wed, 21 Jul 2010 18:58:49 +0200 (CEST) Date: Wed, 21 Jul 2010 18:58:49 +0200 From: Ed Schouten To: Alexey Dokuchaev Message-ID: <20100721165849.GH1742@hoeg.nl> References: <201007210843.o6L8hmo5064622@svn.freebsd.org> <20100721090623.GA21607@FreeBSD.org> <20100721091208.GG1742@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6xASvDhwei36Ydys" Content-Disposition: inline In-Reply-To: <20100721091208.GG1742@hoeg.nl> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kai Wang Subject: Re: svn commit: r210321 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 16:58:51 -0000 --6xASvDhwei36Ydys Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten wrote: > * Alexey Dokuchaev wrote: > > (Just picking random of the similar commits): guys, please, try to > > uniformly align commit meta tags: >=20 > I guess it was aligned properly using tabs, but the whitespace added to > the beginning of the line causes it to jump one tab forward. It would be nice if the SVN commit hook would convert tabs to spaces before adding the leading whitespace. This can be done easily, because the script is written in Python. Just calling .expandtabs() on the string should be sufficient. Any objections against this? If not, I'll poke Simon. ;-) --=20 Ed Schouten WWW: http://80386.nl/ --6xASvDhwei36Ydys Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkxHJ0kACgkQ52SDGA2eCwUPTQCeOI8FiCMbnL8iEcJP4kcUh8GB IZoAn1Wy44POjQpZ4tGi1GdpgOTrR3Pz =Z2P4 -----END PGP SIGNATURE----- --6xASvDhwei36Ydys-- From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 17:26:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 736BF1065672; Wed, 21 Jul 2010 17:26:20 +0000 (UTC) Date: Wed, 21 Jul 2010 17:26:20 +0000 From: Alexey Dokuchaev To: Ed Schouten Message-ID: <20100721172620.GA21742@FreeBSD.org> References: <201007210843.o6L8hmo5064622@svn.freebsd.org> <20100721090623.GA21607@FreeBSD.org> <20100721091208.GG1742@hoeg.nl> <20100721165849.GH1742@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20100721165849.GH1742@hoeg.nl> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kai Wang Subject: Re: svn commit: r210321 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 17:26:20 -0000 On Wed, Jul 21, 2010 at 06:58:49PM +0200, Ed Schouten wrote: > * Ed Schouten wrote: > > * Alexey Dokuchaev wrote: > > > (Just picking random of the similar commits): guys, please, try to > > > uniformly align commit meta tags: > > > > I guess it was aligned properly using tabs, but the whitespace added to > > the beginning of the line causes it to jump one tab forward. > > It would be nice if the SVN commit hook would convert tabs to spaces > before adding the leading whitespace. I believe this is not the right thing to do. First, my original complaint towards kaiw@ was a mistake on my behalf: I miscalculated characters and fell under impression alignment was wrong regardless of email two-space padding (bde@ corrected me on this). Second, I think blindly converting tabs to spaces would bring even more mess to alignment than we happen to have now. I guess that the best we can do here is to take this occasion for chance to remind all of us that tags values should be aligned properly... using tabs. ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 17:34:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C72BD1065677; Wed, 21 Jul 2010 17:34:36 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (unknown [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 877A58FC1C; Wed, 21 Jul 2010 17:34:36 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id E836B2A2A8D6; Wed, 21 Jul 2010 19:34:35 +0200 (CEST) Date: Wed, 21 Jul 2010 19:34:35 +0200 From: Ed Schouten To: Alexey Dokuchaev Message-ID: <20100721173435.GI1742@hoeg.nl> References: <201007210843.o6L8hmo5064622@svn.freebsd.org> <20100721090623.GA21607@FreeBSD.org> <20100721091208.GG1742@hoeg.nl> <20100721165849.GH1742@hoeg.nl> <20100721172620.GA21742@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CykseNgfyvuYXqns" Content-Disposition: inline In-Reply-To: <20100721172620.GA21742@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Kai Wang Subject: Re: svn commit: r210321 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 17:34:36 -0000 --CykseNgfyvuYXqns Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Alexey Dokuchaev wrote: > Second, I think > blindly converting tabs to spaces would bring even more mess to > alignment than we happen to have now. In what kind of way? --=20 Ed Schouten WWW: http://80386.nl/ --CykseNgfyvuYXqns Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkxHL6sACgkQ52SDGA2eCwUewACbBLmjsApeERRaJDXmL8oXCRna +jAAn3FvxZJ/1lrOkJVLMWjNbsx2chy1 =DgUO -----END PGP SIGNATURE----- --CykseNgfyvuYXqns-- From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 18:47:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6B96106566B; Wed, 21 Jul 2010 18:47:52 +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 B667C8FC0A; Wed, 21 Jul 2010 18:47:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LIlqdI007335; Wed, 21 Jul 2010 18:47:52 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LIlq8k007333; Wed, 21 Jul 2010 18:47:52 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201007211847.o6LIlq8k007333@svn.freebsd.org> From: Rui Paulo Date: Wed, 21 Jul 2010 18:47: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: r210357 - head/sys/i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2010 18:47:52 -0000 Author: rpaulo Date: Wed Jul 21 18:47:52 2010 New Revision: 210357 URL: http://svn.freebsd.org/changeset/base/210357 Log: MFamd64: Add USD_GETBASE(), USD_SETBASE(), USD_GETLIMIT() and USD_SETLIMIT(). Modified: head/sys/i386/include/segments.h Modified: head/sys/i386/include/segments.h ============================================================================== --- head/sys/i386/include/segments.h Wed Jul 21 18:27:32 2010 (r210356) +++ head/sys/i386/include/segments.h Wed Jul 21 18:47:52 2010 (r210357) @@ -75,6 +75,13 @@ struct segment_descriptor { unsigned sd_hibase:8 ; /* segment base address (msb) */ } ; +#define USD_GETBASE(sd) (((sd)->sd_lobase) | (sd)->sd_hibase << 24) +#define USD_SETBASE(sd, b) (sd)->sd_lobase = (b); \ + (sd)->sd_hibase = ((b) >> 24); +#define USD_GETLIMIT(sd) (((sd)->sd_lolimit) | (sd)->sd_hilimit << 16) +#define USD_SETLIMIT(sd, l) (sd)->sd_lolimit = (l); \ + (sd)->sd_hilimit = ((l) >> 16); + /* * Gate descriptors (e.g. indirect descriptors) */ From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 18:50:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BCB11065678; Wed, 21 Jul 2010 18:50:24 +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 4A5FA8FC27; Wed, 21 Jul 2010 18:50:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LIoO4b007941; Wed, 21 Jul 2010 18:50:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LIoON6007938; Wed, 21 Jul 2010 18:50:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201007211850.o6LIoON6007938@svn.freebsd.org> From: Xin LI Date: Wed, 21 Jul 2010 18:50: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: r210358 - head/sys/dev/arcmsr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Jul 2010 18:50:24 -0000 Author: delphij Date: Wed Jul 21 18:50:24 2010 New Revision: 210358 URL: http://svn.freebsd.org/changeset/base/210358 Log: Apply vendor version 1.20.00.17. This version adds support for ARC1880; additionally this version fixed an issue where all devices on a SAS port gets offlined when any device failed on the port [1]. Many thanks to Areca for continuing to support FreeBSD. PR: kern/148502 [1] Submitted by: Ching-Lung Huang Obtained from: Areca Tested by: Rich Ercolani [1] MFC after: 2 weeks Modified: head/sys/dev/arcmsr/arcmsr.c head/sys/dev/arcmsr/arcmsr.h Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Wed Jul 21 18:47:52 2010 (r210357) +++ head/sys/dev/arcmsr/arcmsr.c Wed Jul 21 18:50:24 2010 (r210358) @@ -2,15 +2,15 @@ ***************************************************************************************** ** O.S : FreeBSD ** FILE NAME : arcmsr.c -** BY : Erich Chen +** BY : Erich Chen, Ching Huang ** Description: SCSI RAID Device Driver for -** ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX) SATA/SAS RAID HOST Adapter +** ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x) SATA/SAS RAID HOST Adapter ** ARCMSR RAID Host adapter ** [RAID controller:INTEL 331(PCI-X) 341(PCI-EXPRESS) chip set] ****************************************************************************************** ************************************************************************ ** -** Copyright (c) 2004-2006 ARECA Co. Ltd. +** Copyright (c) 2004-2010 ARECA Co. Ltd. ** Erich Chen, Taipei Taiwan All rights reserved. ** ** Redistribution and use in source and binary forms, with or without @@ -57,6 +57,10 @@ ** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x ** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x ** bus_dmamem_alloc() with BUS_DMA_ZERO +** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 +** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, +** prevent cam_periph_error removing all LUN devices of one Target id +** for any one LUN device failed ****************************************************************************************** * $FreeBSD$ */ @@ -90,6 +94,8 @@ #include #include #include +#include +#include #include #include #include @@ -165,6 +171,8 @@ static void arcmsr_build_srb(struct Comm static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, union ccb * pccb); static int arcmsr_resume(device_t dev); static int arcmsr_suspend(device_t dev); +static void arcmsr_rescanLun_cb(struct cam_periph *periph, union ccb *ccb); +static void arcmsr_polling_devmap(void* arg); /* ************************************************************************** ************************************************************************** @@ -191,7 +199,6 @@ static device_method_t arcmsr_methods[]= DEVMETHOD(device_shutdown, arcmsr_shutdown), DEVMETHOD(device_suspend, arcmsr_suspend), DEVMETHOD(device_resume, arcmsr_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_driver_added, bus_generic_driver_added), { 0, 0 } @@ -215,7 +222,7 @@ MODULE_DEPEND(arcmsr, cam, 1, 1, 1); #ifndef D_VERSION #define D_VERSION 0x20011966 #endif - static struct cdevsw arcmsr_cdevsw={ +static struct cdevsw arcmsr_cdevsw={ #if __FreeBSD_version > 502010 .d_version = D_VERSION, #endif @@ -228,7 +235,7 @@ MODULE_DEPEND(arcmsr, cam, 1, 1, 1); #else #define ARCMSR_CDEV_MAJOR 180 - static struct cdevsw arcmsr_cdevsw = { +static struct cdevsw arcmsr_cdevsw = { arcmsr_open, /* open */ arcmsr_close, /* close */ noread, /* read */ @@ -244,7 +251,10 @@ MODULE_DEPEND(arcmsr, cam, 1, 1, 1); 0 /* flags */ }; #endif - +/* +************************************************************************** +************************************************************************** +*/ #if __FreeBSD_version < 500005 static int arcmsr_open(dev_t dev, int flags, int fmt, struct proc *proc) #else @@ -328,18 +338,21 @@ static u_int32_t arcmsr_disable_allintr( switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { /* disable all outbound interrupt */ - intmask_org=CHIP_REG_READ32(HBA_MessageUnit, - 0, outbound_intmask)|ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE; /* disable outbound message0 int */ - CHIP_REG_WRITE32(HBA_MessageUnit, - 0, outbound_intmask, intmask_org|ARCMSR_MU_OUTBOUND_ALL_INTMASKENABLE); + intmask_org=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intmask); /* disable outbound message0 int */ + CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intmask, intmask_org|ARCMSR_MU_OUTBOUND_ALL_INTMASKENABLE); } break; case ACB_ADAPTER_TYPE_B: { /* disable all outbound interrupt */ intmask_org=CHIP_REG_READ32(HBB_DOORBELL, 0, iop2drv_doorbell_mask) & (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); /* disable outbound message0 int */ - CHIP_REG_WRITE32(HBB_DOORBELL, - 0, iop2drv_doorbell_mask, 0); /* disable all interrupt */ + CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell_mask, 0); /* disable all interrupt */ + } + break; + case ACB_ADAPTER_TYPE_C: { + /* disable all outbound interrupt */ + intmask_org=CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_mask) ; /* disable outbound message0 int */ + CHIP_REG_WRITE32(HBC_MessageUnit, 0, host_int_mask, intmask_org|ARCMSR_HBCMU_ALL_INTMASKENABLE); } break; } @@ -356,19 +369,25 @@ static void arcmsr_enable_allintr( struc switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { /* enable outbound Post Queue, outbound doorbell Interrupt */ - mask=~(ARCMSR_MU_OUTBOUND_POSTQUEUE_INTMASKENABLE|ARCMSR_MU_OUTBOUND_DOORBELL_INTMASKENABLE); + mask=~(ARCMSR_MU_OUTBOUND_POSTQUEUE_INTMASKENABLE|ARCMSR_MU_OUTBOUND_DOORBELL_INTMASKENABLE|ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE); CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intmask, intmask_org & mask); acb->outbound_int_enable = ~(intmask_org & mask) & 0x000000ff; } break; case ACB_ADAPTER_TYPE_B: { - /* disable ARCMSR_IOP2DRV_MESSAGE_CMD_DONE */ - mask=(ARCMSR_IOP2DRV_DATA_WRITE_OK|ARCMSR_IOP2DRV_DATA_READ_OK|ARCMSR_IOP2DRV_CDB_DONE); - CHIP_REG_WRITE32(HBB_DOORBELL, - 0, iop2drv_doorbell_mask, intmask_org | mask); /*1=interrupt enable, 0=interrupt disable*/ + /* enable ARCMSR_IOP2DRV_MESSAGE_CMD_DONE */ + mask=(ARCMSR_IOP2DRV_DATA_WRITE_OK|ARCMSR_IOP2DRV_DATA_READ_OK|ARCMSR_IOP2DRV_CDB_DONE|ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); + CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell_mask, intmask_org | mask); /*1=interrupt enable, 0=interrupt disable*/ acb->outbound_int_enable = (intmask_org | mask) & 0x0000000f; } break; + case ACB_ADAPTER_TYPE_C: { + /* enable outbound Post Queue, outbound doorbell Interrupt */ + mask=~(ARCMSR_HBCMU_UTILITY_A_ISR_MASK | ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR_MASK | ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR_MASK); + CHIP_REG_WRITE32(HBC_MessageUnit, 0, host_int_mask, intmask_org & mask); + acb->outbound_int_enable= ~(intmask_org & mask) & 0x0000000f; + } + break; } return; } @@ -383,10 +402,8 @@ static u_int8_t arcmsr_hba_wait_msgint_r do { for(Index=0; Index < 100; Index++) { - if(CHIP_REG_READ32(HBA_MessageUnit, - 0, outbound_intstatus) & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { - CHIP_REG_WRITE32(HBA_MessageUnit, - 0, outbound_intstatus, ARCMSR_MU_OUTBOUND_MESSAGE0_INT);/*clear interrupt*/ + if(CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { + CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, ARCMSR_MU_OUTBOUND_MESSAGE0_INT);/*clear interrupt*/ return TRUE; } UDELAY(10000); @@ -405,12 +422,29 @@ static u_int8_t arcmsr_hbb_wait_msgint_r do { for(Index=0; Index < 100; Index++) { - if(CHIP_REG_READ32(HBB_DOORBELL, - 0, iop2drv_doorbell) & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) { - CHIP_REG_WRITE32(HBB_DOORBELL, - 0, iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt*/ - CHIP_REG_WRITE32(HBB_DOORBELL, - 0, drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT); + if(CHIP_REG_READ32(HBB_DOORBELL, 0, iop2drv_doorbell) & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) { + CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt*/ + CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT); + return TRUE; + } + UDELAY(10000); + }/*max 1 seconds*/ + }while(Retries++ < 20);/*max 20 sec*/ + return FALSE; +} +/* +********************************************************************** +********************************************************************** +*/ +static u_int8_t arcmsr_hbc_wait_msgint_ready(struct AdapterControlBlock *acb) +{ + u_int32_t Index; + u_int8_t Retries=0x00; + + do { + for(Index=0; Index < 100; Index++) { + if(CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { + CHIP_REG_WRITE32(HBC_MessageUnit, 0, outbound_doorbell_clear, ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE_DOORBELL_CLEAR);/*clear interrupt*/ return TRUE; } UDELAY(10000); @@ -426,8 +460,7 @@ static void arcmsr_flush_hba_cache(struc { int retry_count=30;/* enlarge wait flush adapter cache time: 10 minute */ - CHIP_REG_WRITE32(HBA_MessageUnit, - 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE); + CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE); do { if(arcmsr_hba_wait_msgint_ready(acb)) { break; @@ -460,6 +493,25 @@ static void arcmsr_flush_hbb_cache(struc ************************************************************************ ************************************************************************ */ +static void arcmsr_flush_hbc_cache(struct AdapterControlBlock *acb) +{ + int retry_count=30;/* enlarge wait flush adapter cache time: 10 minute */ + + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE); + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE); + do { + if(arcmsr_hbc_wait_msgint_ready(acb)) { + break; + } else { + retry_count--; + } + }while(retry_count!=0); + return; +} +/* +************************************************************************ +************************************************************************ +*/ static void arcmsr_flush_adapter_cache(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { @@ -471,6 +523,10 @@ static void arcmsr_flush_adapter_cache(s arcmsr_flush_hbb_cache(acb); } break; + case ACB_ADAPTER_TYPE_C: { + arcmsr_flush_hbc_cache(acb); + } + break; } return; } @@ -482,10 +538,10 @@ static int arcmsr_suspend(device_t dev) { struct AdapterControlBlock *acb = device_get_softc(dev); - /* disable all outbound interrupt */ - arcmsr_disable_allintr(acb); /* flush controller */ arcmsr_iop_parking(acb); + /* disable all outbound interrupt */ + arcmsr_disable_allintr(acb); return(0); } /* @@ -515,12 +571,10 @@ static void arcmsr_async(void *cb_arg, u case AC_LOST_DEVICE: target_id=xpt_path_target_id(path); target_lun=xpt_path_lun_id(path); - if((target_id > ARCMSR_MAX_TARGETID) - || (target_lun > ARCMSR_MAX_TARGETLUN)) { + if((target_id > ARCMSR_MAX_TARGETID) || (target_lun > ARCMSR_MAX_TARGETLUN)) { break; } - printf("%s:scsi id%d lun%d device lost \n" - , device_get_name(acb->pci_dev), target_id, target_lun); + printf("%s:scsi id=%d lun=%d device lost \n", device_get_name(acb->pci_dev), target_id, target_lun); break; default: break; @@ -589,8 +643,7 @@ static void arcmsr_abort_hba_allcmd(stru { CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_ABORT_CMD); if(!arcmsr_hba_wait_msgint_ready(acb)) { - printf("arcmsr%d: wait 'abort all outstanding command' timeout \n" - , acb->pci_unit); + printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } return; } @@ -602,8 +655,20 @@ static void arcmsr_abort_hbb_allcmd(stru { CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_MESSAGE_ABORT_CMD); if(!arcmsr_hbb_wait_msgint_ready(acb)) { - printf("arcmsr%d: wait 'abort all outstanding command' timeout \n" - , acb->pci_unit); + printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); + } + return; +} +/* +********************************************************************* +********************************************************************* +*/ +static void arcmsr_abort_hbc_allcmd(struct AdapterControlBlock *acb) +{ + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_ABORT_CMD); + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE); + if(!arcmsr_hbc_wait_msgint_ready(acb)) { + printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } return; } @@ -622,6 +687,10 @@ static void arcmsr_abort_allcmd(struct A arcmsr_abort_hbb_allcmd(acb); } break; + case ACB_ADAPTER_TYPE_C: { + arcmsr_abort_hbc_allcmd(acb); + } + break; } return; } @@ -629,14 +698,13 @@ static void arcmsr_abort_allcmd(struct A ************************************************************************** ************************************************************************** */ -static void arcmsr_report_srb_state(struct AdapterControlBlock *acb, - struct CommandControlBlock *srb, u_int32_t flag_srb) +static void arcmsr_report_srb_state(struct AdapterControlBlock *acb, struct CommandControlBlock *srb, u_int16_t error) { int target, lun; target=srb->pccb->ccb_h.target_id; lun=srb->pccb->ccb_h.target_lun; - if((flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR)==0) { + if(error == FALSE) { if(acb->devstate[target][lun]==ARECA_RAID_GONE) { acb->devstate[target][lun]=ARECA_RAID_GOOD; } @@ -646,12 +714,10 @@ static void arcmsr_report_srb_state(stru switch(srb->arcmsr_cdb.DeviceStatus) { case ARCMSR_DEV_SELECT_TIMEOUT: { if(acb->devstate[target][lun]==ARECA_RAID_GOOD) { - printf( "arcmsr%d: select timeout" - ", raid volume was kicked out \n" - , acb->pci_unit); + printf( "arcmsr%d: Target=%x, Lun=%x, selection timeout, raid volume was lost\n", acb->pci_unit, target, lun); } acb->devstate[target][lun]=ARECA_RAID_GONE; - srb->pccb->ccb_h.status |= CAM_SEL_TIMEOUT; + srb->pccb->ccb_h.status |= CAM_DEV_NOT_THERE; arcmsr_srb_complete(srb, 1); } break; @@ -669,11 +735,8 @@ static void arcmsr_report_srb_state(stru } break; default: - printf("arcmsr%d: scsi id=%d lun=%d" - "isr get command error done," - "but got unknow DeviceStatus=0x%x \n" - , acb->pci_unit, target, lun - ,srb->arcmsr_cdb.DeviceStatus); + printf("arcmsr%d: scsi id=%d lun=%d isr got command error done,but got unknow DeviceStatus=0x%x \n" + , acb->pci_unit, target, lun ,srb->arcmsr_cdb.DeviceStatus); acb->devstate[target][lun]=ARECA_RAID_GONE; srb->pccb->ccb_h.status |= CAM_UNCOR_PARITY; /*unknow error or crc error just for retry*/ @@ -687,29 +750,34 @@ static void arcmsr_report_srb_state(stru ************************************************************************** ************************************************************************** */ -static void arcmsr_drain_donequeue(struct AdapterControlBlock *acb, u_int32_t flag_srb) +static void arcmsr_drain_donequeue(struct AdapterControlBlock *acb, u_int32_t flag_srb, u_int16_t error) { struct CommandControlBlock *srb; /* check if command done with no error*/ - srb=(struct CommandControlBlock *) - (acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/ + switch (acb->adapter_type) { + case ACB_ADAPTER_TYPE_C: + srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFF0));/*frame must be 32 bytes aligned*/ + break; + case ACB_ADAPTER_TYPE_A: + case ACB_ADAPTER_TYPE_B: + default: + srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/ + break; + } if((srb->acb!=acb) || (srb->startdone!=ARCMSR_SRB_START)) { if(srb->startdone==ARCMSR_SRB_ABORTED) { - printf("arcmsr%d: srb='%p' isr got aborted command \n" - , acb->pci_unit, srb); + printf("arcmsr%d: srb='%p' isr got aborted command \n", acb->pci_unit, srb); srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); return; } printf("arcmsr%d: isr get an illegal srb command done" - "acb='%p' srb='%p' srbacb='%p' startdone=0x%x" - "srboutstandingcount=%d \n", - acb->pci_unit, acb, srb, srb->acb, - srb->startdone, acb->srboutstandingcount); + "acb='%p' srb='%p' srbacb='%p' startdone=0x%xsrboutstandingcount=%d \n", + acb->pci_unit, acb, srb, srb->acb,srb->startdone, acb->srboutstandingcount); return; } - arcmsr_report_srb_state(acb, srb, flag_srb); + arcmsr_report_srb_state(acb, srb, error); return; } /* @@ -720,20 +788,18 @@ static void arcmsr_done4abort_postqueue( { int i=0; u_int32_t flag_srb; + u_int16_t error; switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { u_int32_t outbound_intstatus; /*clear and abort all outbound posted Q*/ - outbound_intstatus=CHIP_REG_READ32(HBA_MessageUnit, - 0, outbound_intstatus) & acb->outbound_int_enable; - CHIP_REG_WRITE32(HBA_MessageUnit, - 0, outbound_intstatus, outbound_intstatus);/*clear interrupt*/ - while(((flag_srb=CHIP_REG_READ32(HBA_MessageUnit, - 0, outbound_queueport)) != 0xFFFFFFFF) - && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { - arcmsr_drain_donequeue(acb, flag_srb); + outbound_intstatus=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable; + CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, outbound_intstatus);/*clear interrupt*/ + while(((flag_srb=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_queueport)) != 0xFFFFFFFF) && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { + error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; + arcmsr_drain_donequeue(acb, flag_srb, error); } } break; @@ -741,13 +807,12 @@ static void arcmsr_done4abort_postqueue( struct HBB_MessageUnit *phbbmu=(struct HBB_MessageUnit *)acb->pmu; /*clear all outbound posted Q*/ - CHIP_REG_WRITE32(HBB_DOORBELL, - 0, iop2drv_doorbell, - ARCMSR_DOORBELL_INT_CLEAR_PATTERN); /* clear doorbell interrupt */ + CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_DOORBELL_INT_CLEAR_PATTERN); /* clear doorbell interrupt */ for(i=0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) { if((flag_srb=phbbmu->done_qbuffer[i])!=0) { phbbmu->done_qbuffer[i]=0; - arcmsr_drain_donequeue(acb, flag_srb); + error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; + arcmsr_drain_donequeue(acb, flag_srb, error); } phbbmu->post_qbuffer[i]=0; }/*drain reply FIFO*/ @@ -755,6 +820,15 @@ static void arcmsr_done4abort_postqueue( phbbmu->postq_index=0; } break; + case ACB_ADAPTER_TYPE_C: { + + while((CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { + flag_srb=CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); + error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; + arcmsr_drain_donequeue(acb, flag_srb, error); + } + } + break; } return; } @@ -873,7 +947,10 @@ static void arcmsr_build_srb(struct Comm if( arccdbsize > 256) { arcmsr_cdb->Flags|=ARCMSR_CDB_FLAG_SGL_BSIZE; } + } else { + arcmsr_cdb->DataLength = 0; } + srb->arc_cdb_size=arccdbsize; return; } /* @@ -885,19 +962,16 @@ static void arcmsr_post_srb(struct Adapt u_int32_t cdb_shifted_phyaddr=(u_int32_t) srb->cdb_shifted_phyaddr; struct ARCMSR_CDB * arcmsr_cdb=(struct ARCMSR_CDB *)&srb->arcmsr_cdb; - bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, - (srb->srb_flags & SRB_FLAG_WRITE) ? BUS_DMASYNC_POSTWRITE:BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, (srb->srb_flags & SRB_FLAG_WRITE) ? BUS_DMASYNC_POSTWRITE:BUS_DMASYNC_POSTREAD); atomic_add_int(&acb->srboutstandingcount, 1); srb->startdone=ARCMSR_SRB_START; + switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { if(arcmsr_cdb->Flags & ARCMSR_CDB_FLAG_SGL_BSIZE) { - CHIP_REG_WRITE32(HBA_MessageUnit, - 0, inbound_queueport, - cdb_shifted_phyaddr|ARCMSR_SRBPOST_FLAG_SGL_BSIZE); + CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_queueport, cdb_shifted_phyaddr|ARCMSR_SRBPOST_FLAG_SGL_BSIZE); } else { - CHIP_REG_WRITE32(HBA_MessageUnit, - 0, inbound_queueport, cdb_shifted_phyaddr); + CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_queueport, cdb_shifted_phyaddr); } } break; @@ -909,17 +983,32 @@ static void arcmsr_post_srb(struct Adapt ending_index=((index+1)%ARCMSR_MAX_HBB_POSTQUEUE); phbbmu->post_qbuffer[ending_index]=0; if(arcmsr_cdb->Flags & ARCMSR_CDB_FLAG_SGL_BSIZE) { - phbbmu->post_qbuffer[index]= - cdb_shifted_phyaddr|ARCMSR_SRBPOST_FLAG_SGL_BSIZE; + phbbmu->post_qbuffer[index]= cdb_shifted_phyaddr|ARCMSR_SRBPOST_FLAG_SGL_BSIZE; } else { - phbbmu->post_qbuffer[index]= - cdb_shifted_phyaddr; + phbbmu->post_qbuffer[index]= cdb_shifted_phyaddr; } index++; index %= ARCMSR_MAX_HBB_POSTQUEUE; /*if last index number set it to 0 */ phbbmu->postq_index=index; - CHIP_REG_WRITE32(HBB_DOORBELL, - 0, drv2iop_doorbell, ARCMSR_DRV2IOP_CDB_POSTED); + CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_CDB_POSTED); + } + break; + case ACB_ADAPTER_TYPE_C: + { + u_int32_t ccb_post_stamp, arc_cdb_size, cdb_phyaddr_hi32; + + arc_cdb_size=(srb->arc_cdb_size>0x300)?0x300:srb->arc_cdb_size; + ccb_post_stamp=(cdb_shifted_phyaddr | ((arc_cdb_size-1) >> 6) | 1); + cdb_phyaddr_hi32 = acb->srb_phyaddr.B.phyadd_high; + if(cdb_phyaddr_hi32) + { + CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_high, cdb_phyaddr_hi32); + CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp); + } + else + { + CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp); + } } break; } @@ -946,6 +1035,12 @@ static struct QBUFFER * arcmsr_get_iop_r qbuffer=(struct QBUFFER *)&phbbmu->hbb_rwbuffer->message_rbuffer; } break; + case ACB_ADAPTER_TYPE_C: { + struct HBC_MessageUnit *phbcmu=(struct HBC_MessageUnit *)acb->pmu; + + qbuffer=(struct QBUFFER *)&phbcmu->message_rbuffer; + } + break; } return(qbuffer); } @@ -970,6 +1065,12 @@ static struct QBUFFER * arcmsr_get_iop_w qbuffer=(struct QBUFFER *)&phbbmu->hbb_rwbuffer->message_wbuffer; } break; + case ACB_ADAPTER_TYPE_C: { + struct HBC_MessageUnit *phbcmu=(struct HBC_MessageUnit *)acb->pmu; + + qbuffer=(struct QBUFFER *)&phbcmu->message_wbuffer; + } + break; } return(qbuffer); } @@ -982,16 +1083,18 @@ static void arcmsr_iop_message_read(stru switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { /* let IOP know data has been read */ - CHIP_REG_WRITE32(HBA_MessageUnit, - 0, inbound_doorbell, ARCMSR_INBOUND_DRIVER_DATA_READ_OK); + CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_doorbell, ARCMSR_INBOUND_DRIVER_DATA_READ_OK); } break; case ACB_ADAPTER_TYPE_B: { /* let IOP know data has been read */ - CHIP_REG_WRITE32(HBB_DOORBELL, - 0, drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_READ_OK); + CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_READ_OK); } break; + case ACB_ADAPTER_TYPE_C: { + /* let IOP know data has been read */ + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_DATA_READ_OK); + } } return; } @@ -1007,8 +1110,7 @@ static void arcmsr_iop_message_wrote(str ** push inbound doorbell tell iop, driver data write ok ** and wait reply on next hwinterrupt for next Qbuffer post */ - CHIP_REG_WRITE32(HBA_MessageUnit, - 0, inbound_doorbell, ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK); + CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_doorbell, ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK); } break; case ACB_ADAPTER_TYPE_B: { @@ -1016,8 +1118,15 @@ static void arcmsr_iop_message_wrote(str ** push inbound doorbell tell iop, driver data write ok ** and wait reply on next hwinterrupt for next Qbuffer post */ - CHIP_REG_WRITE32(HBB_DOORBELL, - 0, drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_WRITE_OK); + CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_WRITE_OK); + } + break; + case ACB_ADAPTER_TYPE_C: { + /* + ** push inbound doorbell tell iop, driver data write ok + ** and wait reply on next hwinterrupt for next Qbuffer post + */ + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_DATA_WRITE_OK); } break; } @@ -1064,7 +1173,7 @@ static void arcmsr_stop_hba_bgrb(struct CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_STOP_BGRB); if(!arcmsr_hba_wait_msgint_ready(acb)) { - printf("arcmsr%d: wait 'stop adapter rebulid' timeout \n" + printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); } return; @@ -1079,7 +1188,7 @@ static void arcmsr_stop_hbb_bgrb(struct CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_MESSAGE_STOP_BGRB); if(!arcmsr_hbb_wait_msgint_ready(acb)) { - printf( "arcmsr%d: wait 'stop adapter rebulid' timeout \n" + printf( "arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); } return; @@ -1088,6 +1197,20 @@ static void arcmsr_stop_hbb_bgrb(struct ************************************************************************ ************************************************************************ */ +static void arcmsr_stop_hbc_bgrb(struct AdapterControlBlock *acb) +{ + acb->acb_flags &=~ACB_F_MSG_START_BGRB; + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_STOP_BGRB); + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE); + if(!arcmsr_hbc_wait_msgint_ready(acb)) { + printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n", acb->pci_unit); + } + return; +} +/* +************************************************************************ +************************************************************************ +*/ static void arcmsr_stop_adapter_bgrb(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { @@ -1099,6 +1222,10 @@ static void arcmsr_stop_adapter_bgrb(str arcmsr_stop_hbb_bgrb(acb); } break; + case ACB_ADAPTER_TYPE_C: { + arcmsr_stop_hbc_bgrb(acb); + } + break; } return; } @@ -1121,18 +1248,6 @@ static void arcmsr_poll(struct cam_sim * return; } /* -********************************************************************** -********************************************************************** -*/ -static void arcmsr_intr_handler(void *arg) -{ - struct AdapterControlBlock *acb=(struct AdapterControlBlock *)arg; - - ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock); - arcmsr_interrupt(acb); - ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); -} -/* ************************************************************************** ************************************************************************** */ @@ -1210,6 +1325,187 @@ static void arcmsr_iop2drv_data_read_han } return; } + +static void arcmsr_rescanLun_cb(struct cam_periph *periph, union ccb *ccb) +{ +/* + if (ccb->ccb_h.status != CAM_REQ_CMP) + printf("arcmsr_rescanLun_cb: Rescan Target=%x, lun=%x, failure status=%x\n",ccb->ccb_h.target_id,ccb->ccb_h.target_lun,ccb->ccb_h.status); + else + printf("arcmsr_rescanLun_cb: Rescan lun successfully!\n"); +*/ + xpt_free_path(ccb->ccb_h.path); + xpt_free_ccb(ccb); +} + +static void arcmsr_rescan_lun(struct AdapterControlBlock *acb, int target, int lun) +{ + struct cam_path *path; + union ccb *ccb; + + if ((ccb = (union ccb *)xpt_alloc_ccb_nowait()) == NULL) + return; + if (xpt_create_path(&path, xpt_periph, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP) + { + xpt_free_ccb(ccb); + return; + } +/* printf("arcmsr_rescan_lun: Rescan Target=%x, Lun=%x\n", target, lun); */ + bzero(ccb, sizeof(union ccb)); + xpt_setup_ccb(&ccb->ccb_h, path, 5); + ccb->ccb_h.func_code = XPT_SCAN_LUN; + ccb->ccb_h.cbfcnp = arcmsr_rescanLun_cb; + ccb->crcn.flags = CAM_FLAG_NONE; + xpt_action(ccb); + return; +} + + +static void arcmsr_abort_dr_ccbs(struct AdapterControlBlock *acb, int target, int lun) +{ + struct CommandControlBlock *srb; + u_int32_t intmask_org; + int i; + + ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock); + /* disable all outbound interrupts */ + intmask_org = arcmsr_disable_allintr(acb); + for (i = 0; i < ARCMSR_MAX_FREESRB_NUM; i++) + { + srb = acb->psrb_pool[i]; + if (srb->startdone == ARCMSR_SRB_START) + { + if((target == srb->pccb->ccb_h.target_id) && (lun == srb->pccb->ccb_h.target_lun)) + { + srb->startdone = ARCMSR_SRB_ABORTED; + srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; + arcmsr_srb_complete(srb, 1); + } + } + } + /* enable outbound Post Queue, outbound doorbell Interrupt */ + arcmsr_enable_allintr(acb, intmask_org); + ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock); +} + + +/* +************************************************************************** +************************************************************************** +*/ +static void arcmsr_dr_handle(struct AdapterControlBlock *acb) { + u_int32_t devicemap; + u_int32_t target, lun; + u_int32_t deviceMapCurrent[4]={0}; + u_int8_t *pDevMap; + + switch (acb->adapter_type) { + case ACB_ADAPTER_TYPE_A: + devicemap = offsetof(struct HBA_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + for (target= 0; target < 4; target++) + { + deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); + devicemap += 4; + } + break; + + case ACB_ADAPTER_TYPE_B: + devicemap = offsetof(struct HBB_RWBUFFER, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + for (target= 0; target < 4; target++) + { + deviceMapCurrent[target]=bus_space_read_4(acb->btag[1], acb->bhandle[1], devicemap); + devicemap += 4; + } + break; + + case ACB_ADAPTER_TYPE_C: + devicemap = offsetof(struct HBC_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + for (target= 0; target < 4; target++) + { + deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); + devicemap += 4; + } + break; + } + if(acb->acb_flags & ACB_F_BUS_HANG_ON) + { + acb->acb_flags &= ~ACB_F_BUS_HANG_ON; + } + /* + ** adapter posted CONFIG message + ** copy the new map, note if there are differences with the current map + */ + pDevMap = (u_int8_t *)&deviceMapCurrent[0]; + for (target= 0; target < ARCMSR_MAX_TARGETID - 1; target++) + { + if (*pDevMap != acb->device_map[target]) + { + u_int8_t difference, bit_check; + + difference= *pDevMap ^ acb->device_map[target]; + for(lun=0; lun < ARCMSR_MAX_TARGETLUN; lun++) + { + bit_check=(1 << lun); /*check bit from 0....31*/ + if(difference & bit_check) + { + if(acb->device_map[target] & bit_check) + {/* unit departed */ + printf("arcmsr_dr_handle: Target=%x, lun=%x, GONE!!!\n",target,lun); + arcmsr_abort_dr_ccbs(acb, target, lun); + arcmsr_rescan_lun(acb, target, lun); + acb->devstate[target][lun] = ARECA_RAID_GONE; + } + else + {/* unit arrived */ + printf("arcmsr_dr_handle: Target=%x, lun=%x, ARRIVING!!!\n",target,lun); + arcmsr_rescan_lun(acb, target, lun); + acb->devstate[target][lun] = ARECA_RAID_GOOD; + } + } + } +/* printf("arcmsr_dr_handle: acb->device_map[%x]=0x%x, deviceMapCurrent[%x]=%x\n",target,acb->device_map[target],target,*pDevMap); */ + acb->device_map[target]= *pDevMap; + } + pDevMap++; + } +} +/* +************************************************************************** +************************************************************************** +*/ +static void arcmsr_hba_message_isr(struct AdapterControlBlock *acb) { + u_int32_t outbound_message; + + CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, ARCMSR_MU_OUTBOUND_MESSAGE0_INT); + outbound_message = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[0]); + if (outbound_message == ARCMSR_SIGNATURE_GET_CONFIG) + arcmsr_dr_handle( acb ); +} +/* +************************************************************************** +************************************************************************** +*/ +static void arcmsr_hbb_message_isr(struct AdapterControlBlock *acb) { + u_int32_t outbound_message; + + /* clear interrupts */ + CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN); + outbound_message = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[0]); + if (outbound_message == ARCMSR_SIGNATURE_GET_CONFIG) + arcmsr_dr_handle( acb ); +} +/* +************************************************************************** +************************************************************************** +*/ +static void arcmsr_hbc_message_isr(struct AdapterControlBlock *acb) { + u_int32_t outbound_message; + + CHIP_REG_WRITE32(HBC_MessageUnit, 0, outbound_doorbell_clear, ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE_DOORBELL_CLEAR); + outbound_message = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[0]); + if (outbound_message == ARCMSR_SIGNATURE_GET_CONFIG) + arcmsr_dr_handle( acb ); +} /* ************************************************************************** ************************************************************************** @@ -1241,9 +1537,38 @@ static void arcmsr_hba_doorbell_isr(stru ************************************************************************** ************************************************************************** */ +static void arcmsr_hbc_doorbell_isr(struct AdapterControlBlock *acb) +{ + u_int32_t outbound_doorbell; + + /* + ******************************************************************* + ** Maybe here we need to check wrqbuffer_lock is lock or not + ** DOORBELL: din! don! + ** check if there are any mail need to pack from firmware + ******************************************************************* + */ + outbound_doorbell=CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_doorbell); + CHIP_REG_WRITE32(HBC_MessageUnit, 0, outbound_doorbell_clear, outbound_doorbell); /* clear doorbell interrupt */ + if(outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK) { + arcmsr_iop2drv_data_wrote_handle(acb); + } + if(outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK) { + arcmsr_iop2drv_data_read_handle(acb); + } + if(outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { + arcmsr_hbc_message_isr(acb); /* messenger of "driver to iop commands" */ + } + return; +} +/* +************************************************************************** +************************************************************************** +*/ static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb) { u_int32_t flag_srb; + u_int16_t error; /* ***************************************************************************** @@ -1255,7 +1580,8 @@ static void arcmsr_hba_postqueue_isr(str while((flag_srb=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_queueport)) != 0xFFFFFFFF) { /* check if command done with no error*/ - arcmsr_drain_donequeue(acb, flag_srb); + error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; + arcmsr_drain_donequeue(acb, flag_srb, error); } /*drain reply FIFO*/ return; } @@ -1268,6 +1594,7 @@ static void arcmsr_hbb_postqueue_isr(str struct HBB_MessageUnit *phbbmu=(struct HBB_MessageUnit *)acb->pmu; u_int32_t flag_srb; int index; + u_int16_t error; /* ***************************************************************************** @@ -1283,7 +1610,38 @@ static void arcmsr_hbb_postqueue_isr(str index %= ARCMSR_MAX_HBB_POSTQUEUE; /*if last index number set it to 0 */ phbbmu->doneq_index=index; /* check if command done with no error*/ - arcmsr_drain_donequeue(acb, flag_srb); + error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; + arcmsr_drain_donequeue(acb, flag_srb, error); + } /*drain reply FIFO*/ + return; +} +/* +************************************************************************** +************************************************************************** +*/ +static void arcmsr_hbc_postqueue_isr(struct AdapterControlBlock *acb) +{ + u_int32_t flag_srb,throttling=0; + u_int16_t error; + + /* + ***************************************************************************** + ** areca cdb command done + ***************************************************************************** + */ + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); + + while(CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { + + flag_srb=CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); + /* check if command done with no error*/ + error=(flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; + arcmsr_drain_donequeue(acb, flag_srb, error); + if(throttling==ARCMSR_HBC_ISR_THROTTLING_LEVEL) { + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); + break; + } + throttling++; } /*drain reply FIFO*/ return; } @@ -1299,14 +1657,12 @@ static void arcmsr_handle_hba_isr( struc ** check outbound intstatus ********************************************* */ - outbound_intstatus=CHIP_REG_READ32(HBA_MessageUnit, - 0, outbound_intstatus) & acb->outbound_int_enable; + outbound_intstatus=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable; if(!outbound_intstatus) { /*it must be share irq*/ return; } - CHIP_REG_WRITE32(HBA_MessageUnit, - 0, outbound_intstatus, outbound_intstatus);/*clear interrupt*/ + CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, outbound_intstatus);/*clear interrupt*/ /* MU doorbell interrupts*/ if(outbound_intstatus & ARCMSR_MU_OUTBOUND_DOORBELL_INT) { arcmsr_hba_doorbell_isr(acb); @@ -1315,6 +1671,9 @@ static void arcmsr_handle_hba_isr( struc if(outbound_intstatus & ARCMSR_MU_OUTBOUND_POSTQUEUE_INT) { arcmsr_hba_postqueue_isr(acb); } + if(outbound_intstatus & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { + arcmsr_hba_message_isr(acb); + } return; } /* @@ -1348,6 +1707,36 @@ static void arcmsr_handle_hbb_isr( struc if(outbound_doorbell & ARCMSR_IOP2DRV_CDB_DONE) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Jul 21 21:23:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 343DD106564A; Wed, 21 Jul 2010 21:23:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2390F8FC13; Wed, 21 Jul 2010 21:23:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6LLNOKE042086; Wed, 21 Jul 2010 21:23:24 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6LLNONb042084; Wed, 21 Jul 2010 21:23:24 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201007212123.o6LLNONb042084@svn.freebsd.org> From: Andrew Turner Date: Wed, 21 Jul 2010 21:23: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: r210361 - 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: Wed, 21 Jul 2010 21:23:24 -0000 Author: andrew Date: Wed Jul 21 21:23:23 2010 New Revision: 210361 URL: http://svn.freebsd.org/changeset/base/210361 Log: - Add myself to committers-src.dot Approved by: imp (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Jul 21 20:38:45 2010 (r210360) +++ head/share/misc/committers-src.dot Wed Jul 21 21:23:23 2010 (r210361) @@ -58,6 +58,7 @@ akiyama [label="Shunsuke Akiyama\nakiyam ambrisko [label="Doug Ambrisko\nambrisko@FreeBSD.org\n2001/12/19"] anchie [label="Ana Kukec\nanchie@FreeBSD.org\n2010/04/14"] andre [label="Andre Oppermann\nandre@FreeBSD.org\n2003/11/12"] +andrew [label="Andrew Turner\nandrew@FreeBSD.org\n2010/07/19"] anholt [label="Eric Anholt\nanholt@FreeBSD.org\n2002/04/22"] antoine [label="Antoine Brodin\nantoine@FreeBSD.org\n2008/02/03"] ariff [label="Ariff Abdullah\nariff@FreeBSD.org\n2005/11/14"] From owner-svn-src-head@FreeBSD.ORG Thu Jul 22 05:42:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B608106566C; Thu, 22 Jul 2010 05:42:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30C488FC08; Thu, 22 Jul 2010 05:42:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6M5gUtK053424; Thu, 22 Jul 2010 05:42:30 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6M5gUia053418; Thu, 22 Jul 2010 05:42:30 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201007220542.o6M5gUia053418@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 22 Jul 2010 05:42: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: r210365 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2010 05:42:30 -0000 Author: trasz Date: Thu Jul 22 05:42:29 2010 New Revision: 210365 URL: http://svn.freebsd.org/changeset/base/210365 Log: Remove spurious '/*-' marks and fix some other style problems. Submitted by: bde@ Modified: head/sys/kern/init_main.c head/sys/kern/uipc_usrreq.c head/sys/sys/disk.h head/sys/sys/kthread.h head/sys/sys/signal.h head/sys/sys/types.h Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Thu Jul 22 01:23:39 2010 (r210364) +++ head/sys/kern/init_main.c Thu Jul 22 05:42:29 2010 (r210365) @@ -539,10 +539,9 @@ proc0_init(void *dummy __unused) vm_map_init(&vmspace0.vm_map, vmspace_pmap(&vmspace0), p->p_sysent->sv_minuser, p->p_sysent->sv_maxuser); - /*- - * call the init and ctor for the new thread and proc - * we wait to do this until all other structures - * are fairly sane. + /* + * Call the init and ctor for the new thread and proc. We wait + * to do this until all other structures are fairly sane. */ EVENTHANDLER_INVOKE(process_init, p); EVENTHANDLER_INVOKE(thread_init, td); Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu Jul 22 01:23:39 2010 (r210364) +++ head/sys/kern/uipc_usrreq.c Thu Jul 22 05:42:29 2010 (r210365) @@ -165,7 +165,7 @@ SYSCTL_ULONG(_net_local_seqpacket, OID_A SYSCTL_INT(_net_local, OID_AUTO, inflight, CTLFLAG_RD, &unp_rights, 0, "File descriptors in flight."); -/*- +/* * Locking and synchronization: * * Three types of locks exit in the local domain socket implementation: a Modified: head/sys/sys/disk.h ============================================================================== --- head/sys/sys/disk.h Thu Jul 22 01:23:39 2010 (r210364) +++ head/sys/sys/disk.h Thu Jul 22 05:42:29 2010 (r210365) @@ -25,41 +25,41 @@ void disk_err(struct bio *bp, const char #endif -#define DIOCGSECTORSIZE _IOR('d', 128, u_int) - /*- - * Get the sectorsize of the device in bytes. The sectorsize is the - * smallest unit of data which can be transfered from this device. - * Usually this is a power of two but it may not be. (ie: CDROM audio) +#define DIOCGSECTORSIZE _IOR('d', 128, u_int) + /* + * Get the sector size of the device in bytes. The sector size is the + * smallest unit of data which can be transferred from this device. + * Usually this is a power of 2 but it might not be (i.e. CDROM audio). */ -#define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */ - /*- +#define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */ + /* * Get the size of the entire device in bytes. This should be a - * multiple of the sectorsize. + * multiple of the sector size. */ -#define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware sectorcount */ - /*- - * Get the firmwares notion of number of sectors per track. This +#define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware's sectorcount */ + /* + * Get the firmware's notion of number of sectors per track. This * value is mostly used for compatibility with various ill designed * disk label formats. Don't use it unless you have to. */ -#define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware headcount */ - /*- +#define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware's headcount */ + /* * Get the firmwares notion of number of heads per cylinder. This * value is mostly used for compatibility with various ill designed * disk label formats. Don't use it unless you have to. */ -#define DIOCSKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */ - /*- +#define DIOCSKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */ + /* * Enable/Disable (the argument is boolean) the device for kernel * core dumps. */ -#define DIOCGFRONTSTUFF _IOR('d', 134, off_t) - /*- +#define DIOCGFRONTSTUFF _IOR('d', 134, off_t) + /* * Many disk formats have some amount of space reserved at the * start of the disk to hold bootblocks, various disklabels and * similar stuff. This ioctl returns the number of such bytes @@ -67,12 +67,12 @@ void disk_err(struct bio *bp, const char */ #define DIOCGFLUSH _IO('d', 135) /* Flush write cache */ - /*- + /* * Flush write cache of the device. */ #define DIOCGDELETE _IOW('d', 136, off_t[2]) /* Delete data */ - /*- + /* * Mark data on the device as unused. */ @@ -98,22 +98,22 @@ void disk_err(struct bio *bp, const char * - ident is optional and applications can't relay on its presence. */ -#define DIOCGPROVIDERNAME _IOR('d', 138, char[MAXPATHLEN]) - /*- +#define DIOCGPROVIDERNAME _IOR('d', 138, char[MAXPATHLEN]) + /* * Store the provider name, given a device path, in a buffer. The buffer * must be at least MAXPATHLEN bytes long. */ -#define DIOCGSTRIPESIZE _IOR('d', 139, off_t) /* Get stripe size in bytes */ - /*- +#define DIOCGSTRIPESIZE _IOR('d', 139, off_t) /* Get stripe size in bytes */ + /* * Get the size of the device's optimal access block in bytes. - * This should be a multiple of the sectorsize. + * This should be a multiple of the sector size. */ -#define DIOCGSTRIPEOFFSET _IOR('d', 140, off_t) /* Get stripe offset in bytes */ - /*- +#define DIOCGSTRIPEOFFSET _IOR('d', 140, off_t) /* Get stripe offset in bytes */ + /* * Get the offset of the first device's optimal access block in bytes. - * This should be a multiple of the sectorsize. + * This should be a multiple of the sector size. */ #endif /* _SYS_DISK_H_ */ Modified: head/sys/sys/kthread.h ============================================================================== --- head/sys/sys/kthread.h Thu Jul 22 01:23:39 2010 (r210364) +++ head/sys/sys/kthread.h Thu Jul 22 05:42:29 2010 (r210365) @@ -31,7 +31,7 @@ #include -/*- +/* * A kernel process descriptor; used to start "internal" daemons. * * Note: global_procpp may be NULL for no global save area. Modified: head/sys/sys/signal.h ============================================================================== --- head/sys/sys/signal.h Thu Jul 22 01:23:39 2010 (r210364) +++ head/sys/sys/signal.h Thu Jul 22 05:42:29 2010 (r210365) @@ -122,7 +122,7 @@ /* #define SIG_CATCH ((__sighandler_t *)2) See signalvar.h */ #define SIG_HOLD ((__sighandler_t *)3) -/*- +/* * Type of a signal handling function. * * Language spec sez signal handlers take exactly one arg, even though we Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Thu Jul 22 01:23:39 2010 (r210364) +++ head/sys/sys/types.h Thu Jul 22 05:42:29 2010 (r210365) @@ -287,12 +287,14 @@ typedef int boolean_t; typedef struct device *device_t; typedef __intfptr_t intfptr_t; -/*- +/* * XXX this is fixed width for historical reasons. It should have had type * __int_fast32_t. Fixed-width types should not be used unless binary * compatibility is essential. Least-width types should be used even less * since they provide smaller benefits. + * * XXX should be MD. + * * XXX this is bogus in -current, but still used for spl*(). */ typedef __uint32_t intrmask_t; /* Interrupt mask (spl, xxx_imask...) */ From owner-svn-src-head@FreeBSD.ORG Thu Jul 22 08:30:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F1FB1065674; Thu, 22 Jul 2010 08:30:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E5D38FC14; Thu, 22 Jul 2010 08:30:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6M8UFGe090580; Thu, 22 Jul 2010 08:30:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6M8UFYo090578; Thu, 22 Jul 2010 08:30:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201007220830.o6M8UFYo090578@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 22 Jul 2010 08:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210368 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2010 08:30:15 -0000 Author: pjd Date: Thu Jul 22 08:30:14 2010 New Revision: 210368 URL: http://svn.freebsd.org/changeset/base/210368 Log: Actually, only the fullsync mode is implemented, not memsync mode. Correct manual page. MFC after: 3 days Modified: head/sbin/hastd/hast.conf.5 Modified: head/sbin/hastd/hast.conf.5 ============================================================================== --- head/sbin/hastd/hast.conf.5 Thu Jul 22 07:47:50 2010 (r210367) +++ head/sbin/hastd/hast.conf.5 Thu Jul 22 08:30:14 2010 (r210368) @@ -175,8 +175,10 @@ Before secondary node returns, primary n When the secondary node comes back to life it becomes the new primary. Unfortunately some small amount of data which was confirmed to be stored to the application was lost. -The risk of such a situation is very small, which is the reason for this -mode to be the default. +The risk of such a situation is very small. +The +.Ic memsync +replication mode is currently not implemented. .It Ic fullsync .Pp Mark the write operation as completed when local as well as remote @@ -184,7 +186,7 @@ write completes. This is the safest and the slowest replication mode. The .Ic fullsync -replication mode is currently not implemented. +replication mode is the default. .It Ic async .Pp The write operation is reported as complete right after the local write From owner-svn-src-head@FreeBSD.ORG Thu Jul 22 09:13:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 140C0106566B; Thu, 22 Jul 2010 09:13:50 +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 EBB5B8FC12; Thu, 22 Jul 2010 09:13:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6M9DnSe000351; Thu, 22 Jul 2010 09:13:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6M9Dnm9000347; Thu, 22 Jul 2010 09:13:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007220913.o6M9Dnm9000347@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Jul 2010 09:13: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: r210369 - in head/sys: amd64/amd64 amd64/include ia64/include kern powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2010 09:13:50 -0000 Author: kib Date: Thu Jul 22 09:13:49 2010 New Revision: 210369 URL: http://svn.freebsd.org/changeset/base/210369 Log: When compat32 binary asks for the value of hw.machine_arch, report the name of 32bit sibling architecture instead of the host one. Do the same for hw.machine on amd64. Add a safety belt debug.adaptive_machine_arch sysctl, to turn the substitution off. Reviewed by: jhb, nwhitehorn MFC after: 2 weeks Modified: head/sys/amd64/amd64/identcpu.c head/sys/amd64/include/param.h head/sys/ia64/include/param.h head/sys/kern/kern_mib.c head/sys/powerpc/include/param.h Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Thu Jul 22 08:30:14 2010 (r210368) +++ head/sys/amd64/amd64/identcpu.c Thu Jul 22 09:13:49 2010 (r210369) @@ -76,8 +76,30 @@ static void print_via_padlock_info(void) int cpu_class; char machine[] = "amd64"; -SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, - machine, 0, "Machine class"); + +#ifdef SCTL_MASK32 +extern int adaptive_machine_arch; +#endif + +static int +sysctl_hw_machine(SYSCTL_HANDLER_ARGS) +{ +#ifdef SCTL_MASK32 + static const char machine32[] = "i386"; +#endif + int error; + +#ifdef SCTL_MASK32 + if ((req->flags & SCTL_MASK32) != 0 && adaptive_machine_arch) + error = SYSCTL_OUT(req, machine32, sizeof(machine32)); + else +#endif + error = SYSCTL_OUT(req, machine, sizeof(machine)); + return (error); + +} +SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD, + NULL, 0, sysctl_hw_machine, "A", "Machine class"); static char cpu_model[128]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, Modified: head/sys/amd64/include/param.h ============================================================================== --- head/sys/amd64/include/param.h Thu Jul 22 08:30:14 2010 (r210368) +++ head/sys/amd64/include/param.h Thu Jul 22 09:13:49 2010 (r210369) @@ -59,6 +59,9 @@ #ifndef MACHINE_ARCH #define MACHINE_ARCH "amd64" #endif +#ifndef MACHINE_ARCH32 +#define MACHINE_ARCH32 "i386" +#endif #if defined(SMP) || defined(KLD_MODULE) #define MAXCPU 32 Modified: head/sys/ia64/include/param.h ============================================================================== --- head/sys/ia64/include/param.h Thu Jul 22 08:30:14 2010 (r210368) +++ head/sys/ia64/include/param.h Thu Jul 22 09:13:49 2010 (r210369) @@ -57,6 +57,9 @@ #ifndef MACHINE_ARCH #define MACHINE_ARCH "ia64" #endif +#ifndef MACHINE_ARCH32 +#define MACHINE_ARCH32 "i386" +#endif #if defined(SMP) || defined(KLD_MODULE) #define MAXCPU 32 Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Thu Jul 22 08:30:14 2010 (r210368) +++ head/sys/kern/kern_mib.c Thu Jul 22 09:13:49 2010 (r210369) @@ -232,9 +232,31 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_hw, OID_AUTO, pagesizes, CTLTYPE_ULONG | CTLFLAG_RD, NULL, 0, sysctl_hw_pagesizes, "LU", "Supported page sizes"); -static char machine_arch[] = MACHINE_ARCH; -SYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD, - machine_arch, 0, "System architecture"); +#ifdef SCTL_MASK32 +int adaptive_machine_arch = 1; +SYSCTL_INT(_debug, OID_AUTO, adaptive_machine_arch, CTLFLAG_RW, + &adaptive_machine_arch, 1, + "Adapt reported machine architecture to the ABI of the binary"); +#endif + +static int +sysctl_hw_machine_arch(SYSCTL_HANDLER_ARGS) +{ + int error; + static const char machine_arch[] = MACHINE_ARCH; +#ifdef SCTL_MASK32 + static const char machine_arch32[] = MACHINE_ARCH32; + + if ((req->flags & SCTL_MASK32) != 0 && adaptive_machine_arch) + error = SYSCTL_OUT(req, machine_arch32, sizeof(machine_arch32)); + else +#endif + error = SYSCTL_OUT(req, machine_arch, sizeof(machine_arch)); + return (error); + +} +SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD, + NULL, 0, sysctl_hw_machine_arch, "A", "System architecture"); static int sysctl_hostname(SYSCTL_HANDLER_ARGS) Modified: head/sys/powerpc/include/param.h ============================================================================== --- head/sys/powerpc/include/param.h Thu Jul 22 08:30:14 2010 (r210368) +++ head/sys/powerpc/include/param.h Thu Jul 22 09:13:49 2010 (r210369) @@ -61,6 +61,11 @@ #endif #endif #define MID_MACHINE MID_POWERPC +#ifdef __powerpc64__ +#ifndef MACHINE_ARCH32 +#define MACHINE_ARCH32 "powerpc" +#endif +#endif #if defined(SMP) || defined(KLD_MODULE) #define MAXCPU 2 From owner-svn-src-head@FreeBSD.ORG Thu Jul 22 09:14:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DDA2106566B; Thu, 22 Jul 2010 09:14:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 131D58FC14; Thu, 22 Jul 2010 09:14:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6M9EIjJ000487; Thu, 22 Jul 2010 09:14:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6M9EIDN000485; Thu, 22 Jul 2010 09:14:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007220914.o6M9EIDN000485@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Jul 2010 09:14: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: r210370 - head/lib/libc/compat-43 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jul 2010 09:14:19 -0000 Author: kib Date: Thu Jul 22 09:14:18 2010 New Revision: 210370 URL: http://svn.freebsd.org/changeset/base/210370 Log: Verify return value of the sigset manipulation functions to catch invalid signal numbers [1]. Use consistent style of not assigning the return value to a local variable. Reported by: Garrett Cooper [1] MFC after: 1 week Modified: head/lib/libc/compat-43/sigcompat.c Modified: head/lib/libc/compat-43/sigcompat.c ============================================================================== --- head/lib/libc/compat-43/sigcompat.c Thu Jul 22 09:13:49 2010 (r210369) +++ head/lib/libc/compat-43/sigcompat.c Thu Jul 22 09:14:18 2010 (r210370) @@ -112,16 +112,11 @@ int xsi_sigpause(int sig) { sigset_t set; - int error; - if (!_SIG_VALID(sig)) { - errno = EINVAL; + if (_sigprocmask(SIG_BLOCK, NULL, &set) == -1) + return (-1); + if (sigdelset(&set, sig) == -1) return (-1); - } - error = _sigprocmask(SIG_BLOCK, NULL, &set); - if (error != 0) - return (error); - sigdelset(&set, sig); return (_sigsuspend(&set)); } @@ -131,7 +126,8 @@ sighold(int sig) sigset_t set; sigemptyset(&set); - sigaddset(&set, sig); + if (sigaddset(&set, sig) == -1) + return (-1); return (_sigprocmask(SIG_BLOCK, &set, NULL)); } @@ -151,7 +147,8 @@ sigrelse(int sig) sigset_t set; sigemptyset(&set); - sigaddset(&set, sig); + if (sigaddset(&set, sig) == -1) + return (-1); return (_sigprocmask(SIG_UNBLOCK, &set, NULL)); } @@ -160,35 +157,30 @@ void { sigset_t set, pset; struct sigaction sa, psa; - int error; sigemptyset(&set); - sigaddset(&set, sig); - error = _sigprocmask(SIG_BLOCK, NULL, &pset); - if (error == -1) + if (sigaddset(&set, sig) == -1) + return (SIG_ERR); + if (_sigprocmask(SIG_BLOCK, NULL, &pset) == -1) return (SIG_ERR); if ((__sighandler_t *)disp == SIG_HOLD) { - error = _sigprocmask(SIG_BLOCK, &set, &pset); - if (error == -1) + if (_sigprocmask(SIG_BLOCK, &set, &pset) == -1) return (SIG_ERR); if (sigismember(&pset, sig)) return (SIG_HOLD); else { - error = _sigaction(sig, NULL, &psa); - if (error == -1) + if (_sigaction(sig, NULL, &psa) == -1) return (SIG_ERR); return (psa.sa_handler); } } else { - error = _sigprocmask(SIG_UNBLOCK, &set, &pset); - if (error == -1) + if (_sigprocmask(SIG_UNBLOCK, &set, &pset) == -1) return (SIG_ERR); } bzero(&sa, sizeof(sa)); sa.sa_handler = disp; - error = _sigaction(sig, &sa, &psa); - if (error == -1) + if (_sigaction(sig, &sa, &psa) == -1) return (SIG_ERR); if (sigismember(&pset, sig)) return (SIG_HOLD); From owner-svn-src-head@FreeBSD.ORG Thu Jul 22 10:24:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0E481065676; Thu, 22 Jul 2010 10:24:28 +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 A67648FC17; Thu, 22 Jul 2010 10:24:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6MAOSub016474; Thu, 22 Jul 2010 10:24:28 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6MAOSsr016472; Thu, 22 Jul 2010 10:24:28 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201007221024.o6MAOSsr016472@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 22 Jul 2010 10:24: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: r210371 - head/sys/dev/md X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jul 2010 10:24:28 -0000 Author: jh Date: Thu Jul 22 10:24:28 2010 New Revision: 210371 URL: http://svn.freebsd.org/changeset/base/210371 Log: Convert md(4) to use alloc_unr(9) and alloc_unr_specific(9) for unit number allocation. The old approach had some problems such as it allowed an overflow to occur in the unit number calculation. PR: kern/122288 Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Thu Jul 22 09:14:18 2010 (r210370) +++ head/sys/dev/md/md.c Thu Jul 22 10:24:28 2010 (r210371) @@ -130,6 +130,7 @@ static void g_md_dumpconf(struct sbuf *s static int mdunits; static struct cdev *status_dev = 0; static struct sx md_sx; +static struct unrhdr *md_uh; static d_ioctl_t mdctlioctl; @@ -748,20 +749,20 @@ mdfind(int unit) static struct md_s * mdnew(int unit, int *errp, enum md_types type) { - struct md_s *sc, *sc2; - int error, max = -1; + struct md_s *sc; + int error; *errp = 0; - LIST_FOREACH(sc2, &md_softc_list, list) { - if (unit == sc2->unit) { - *errp = EBUSY; - return (NULL); - } - if (unit == -1 && sc2->unit > max) - max = sc2->unit; - } if (unit == -1) - unit = max + 1; + unit = alloc_unr(md_uh); + else + unit = alloc_unr_specific(md_uh, unit); + + if (unit == -1) { + *errp = EBUSY; + return (NULL); + } + sc = (struct md_s *)malloc(sizeof *sc, M_MD, M_WAITOK | M_ZERO); sc->type = type; bioq_init(&sc->bio_queue); @@ -774,6 +775,7 @@ mdnew(int unit, int *errp, enum md_types return (sc); LIST_REMOVE(sc, list); mtx_destroy(&sc->queue_mtx); + free_unr(md_uh, sc->unit); free(sc, M_MD); *errp = error; return (NULL); @@ -1012,6 +1014,7 @@ mddestroy(struct md_s *sc, struct thread uma_zdestroy(sc->uma); LIST_REMOVE(sc, list); + free_unr(md_uh, sc->unit); free(sc, M_MD); return (0); } @@ -1097,8 +1100,11 @@ xmdctlioctl(struct cdev *dev, u_long cmd } if (mdio->md_options & MD_AUTOUNIT) sc = mdnew(-1, &error, mdio->md_type); - else + else { + if (mdio->md_unit > INT_MAX) + return (EINVAL); sc = mdnew(mdio->md_unit, &error, mdio->md_type); + } if (sc == NULL) return (error); if (mdio->md_options & MD_AUTOUNIT) @@ -1226,6 +1232,7 @@ g_md_init(struct g_class *mp __unused) mod = NULL; sx_init(&md_sx, "MD config lock"); g_topology_unlock(); + md_uh = new_unrhdr(0, INT_MAX, NULL); #ifdef MD_ROOT_SIZE sx_xlock(&md_sx); md_preloaded(mfs_root.start, sizeof(mfs_root.start)); @@ -1322,4 +1329,5 @@ g_md_fini(struct g_class *mp __unused) sx_destroy(&md_sx); if (status_dev != NULL) destroy_dev(status_dev); + delete_unrhdr(md_uh); } From owner-svn-src-head@FreeBSD.ORG Thu Jul 22 11:23:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A60D0106564A; Thu, 22 Jul 2010 11:23:18 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AF4B8FC17; Thu, 22 Jul 2010 11:23:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6MBNIsJ030866; Thu, 22 Jul 2010 11:23:18 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6MBNIl8030833; Thu, 22 Jul 2010 11:23:18 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201007221123.o6MBNIl8030833@svn.freebsd.org> From: "Simon L. Nielsen" Date: Thu, 22 Jul 2010 11:23: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: r210372 - head/usr.sbin/newsyslog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Jul 2010 11:23:18 -0000 Author: simon Date: Thu Jul 22 11:23:18 2010 New Revision: 210372 URL: http://svn.freebsd.org/changeset/base/210372 Log: Add support for creating the archived log filenames using a time-stamp instead of the traditional simple counter. Using the time-stamp based file-names, once a log file is archived, it will not change name until it is deleted. This means that many backup systems will only perform one backup of the archived log file, instead for performing a new backup of the logfile upon each logfile rotation. This implementation is separate from the patches in the mentioned PR, as I wasn't aware of the existence of the PR until after I had implemented the same functionality as the patches in the PR provide. Unlike the PR, this new code does honor the 'log count' in newsyslog.conf so old logfiles are deleted. This new code does not currently support never deleting the archived logfiles. PR: bin/29363 MFC after: 3 weeks Modified: head/usr.sbin/newsyslog/newsyslog.8 head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.8 Thu Jul 22 10:24:28 2010 (r210371) +++ head/usr.sbin/newsyslog/newsyslog.8 Thu Jul 22 11:23:18 2010 (r210372) @@ -30,6 +30,7 @@ .Op Fl a Ar directory .Op Fl d Ar directory .Op Fl f Ar config_file +.Op Fl t Ar timefmt .Op Ar .Sh DESCRIPTION The @@ -50,6 +51,11 @@ the last period's logs in it, has the next to last period's logs in it, and so on, up to a user-specified number of archived logs. +It is also possible to let archived log filenames be created using the +time the log file was archived instead of the sequential number using +the +.Fl t +option. Optionally the archived logs can be compressed to save space. .Pp @@ -141,6 +147,31 @@ However, this option is most likely to b with the .Fl R option, and in that case the compression will be done. +.It Fl t Ar timefmt +If specified +.Nm +will create the +.Dq rotated +logfiles using the specified time format instead of the default +sequential filenames. +The time format is described in the +.Xr strftime 3 +manual page. +If the +.Ar timefmt +argument is set to an empty string or the string +.Dq DEFAULT , +the default built in time format +is used. +If the +.Ar timefmt +string is changed the old files created using the previous time format +will not be be automatically removed (unless the new format is very +similar to the old format). +This is also the case when changing from sequential filenames to time +based file names, and the other way around. +The time format should contain at least year, month, day, and hour to +make sure rotating of old logfiles can select the correct logfiles. .It Fl C If specified once, then .Nm Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Thu Jul 22 10:24:28 2010 (r210371) +++ head/usr.sbin/newsyslog/newsyslog.c Thu Jul 22 11:23:18 2010 (r210372) @@ -69,9 +69,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include #include @@ -80,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -112,6 +115,9 @@ __FBSDID("$FreeBSD$"); #define DEFAULT_MARKER "" #define DEBUG_MARKER "" #define INCLUDE_MARKER "" +#define DEFAULT_TIMEFNAME_FMT "%Y%m%dT%H%M%S" + +#define MAX_OLDLOGS 65536 /* Default maximum number of old logfiles */ struct conf_entry { STAILQ_ENTRY(conf_entry) cf_nextp; @@ -155,6 +161,11 @@ struct include_entry { const char *file; /* Name of file to process */ }; +struct oldlog_entry { + char *fname; /* Filename of the log file */ + time_t t; /* Parses timestamp of the logfile */ +}; + typedef enum { FREE_ENT, KEEP_ENT } fk_entry; @@ -182,6 +193,7 @@ int rotatereq = 0; /* -R = Always rotat /* that a list of files *are* given on */ /* the run command). */ char *requestor; /* The name given on a -R request */ +char *timefnamefmt = NULL; /* Use time based filenames instead of .0 etc */ char *archdirname; /* Directory path to old logfiles archive */ char *destdir = NULL; /* Directory to treat at root for logs */ const char *conf; /* Configuration file to use */ @@ -585,7 +597,7 @@ parse_args(int argc, char **argv) *p = '\0'; /* Parse command line options. */ - while ((ch = getopt(argc, argv, "a:d:f:nrsvCD:FNPR:")) != -1) + while ((ch = getopt(argc, argv, "a:d:f:nrst:vCD:FNPR:")) != -1) switch (ch) { case 'a': archtodir++; @@ -606,6 +618,13 @@ parse_args(int argc, char **argv) case 's': nosignal = 1; break; + case 't': + if (optarg[0] == '\0' || + strcmp(optarg, "DEFAULT") == 0) + timefnamefmt = strdup(DEFAULT_TIMEFNAME_FMT); + else + timefnamefmt = strdup(optarg); + break; case 'v': verbose++; break; @@ -728,7 +747,7 @@ usage(void) fprintf(stderr, "usage: newsyslog [-CFNnrsv] [-a directory] [-d directory] [-f config-file]\n" - " [ [-R requestor] filename ... ]\n"); + " [-t timefmt ] [ [-R requestor] filename ... ]\n"); exit(1); } @@ -1365,6 +1384,177 @@ missing_field(char *p, char *errline) } /* + * In our sort we return it in the reverse of what qsort normally + * would do, as we want the newest files first. If we have two + * entries with the same time we don't really care about order. + * + * Support function for qsort() in delete_oldest_timelog(). + */ +static int +oldlog_entry_compare(const void *a, const void *b) +{ + const struct oldlog_entry *ola = a, *olb = b; + + if (ola->t > olb->t) + return (-1); + else if (ola->t < olb->t) + return (1); + else + return (0); +} + +/* + * Delete the oldest logfiles, when using time based filenames. + */ +static void +delete_oldest_timelog(const struct conf_entry *ent, const char *archive_dir) +{ + char *logfname, *s, *dir, errbuf[80]; + int logcnt, max_logcnt, dirfd, i; + struct oldlog_entry *oldlogs; + size_t logfname_len; + struct dirent *dp; + const char *cdir; + struct tm tm; + DIR *dirp; + + oldlogs = malloc(MAX_OLDLOGS * sizeof(struct oldlog_entry)); + max_logcnt = MAX_OLDLOGS; + logcnt = 0; + + if (archive_dir != NULL && archive_dir[0] != '\0') + cdir = archive_dir; + else + if ((cdir = dirname(ent->log)) == NULL) + err(1, "dirname()"); + if ((dir = strdup(cdir)) == NULL) + err(1, "strdup()"); + + if ((s = basename(ent->log)) == NULL) + err(1, "basename()"); + if ((logfname = strdup(s)) == NULL) + err(1, "strdup()"); + logfname_len = strlen(logfname); + if (strcmp(logfname, "/") == 0) + errx(1, "Invalid log filename - became '/'"); + + if (verbose > 2) + printf("Searching for old logs in %s\n", dir); + + /* First we create a 'list' of all archived logfiles */ + if ((dirp = opendir(dir)) == NULL) + err(1, "Cannot open log directory '%s'", dir); + dirfd = dirfd(dirp); + while ((dp = readdir(dirp)) != NULL) { + if (dp->d_type != DT_REG) + continue; + + /* Ignore everything but files with our logfile prefix */ + if (strncmp(dp->d_name, logfname, logfname_len) != 0) + continue; + /* Ignore the actual non-rotated logfile */ + if (dp->d_namlen == logfname_len) + continue; + /* + * Make sure we created have found a logfile, so the + * postfix is valid, IE format is: '.