From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 01:13: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 080281065670; Sun, 13 Jun 2010 01:13:37 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAE958FC15; Sun, 13 Jun 2010 01: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 o5D1DaCi067451; Sun, 13 Jun 2010 01:13:36 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5D1Da1b067449; Sun, 13 Jun 2010 01:13:36 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201006130113.o5D1Da1b067449@svn.freebsd.org> From: Colin Percival Date: Sun, 13 Jun 2010 01: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: r209117 - head/lib/libc/stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Jun 2010 01:13:37 -0000 Author: cperciva Date: Sun Jun 13 01:13:36 2010 New Revision: 209117 URL: http://svn.freebsd.org/changeset/base/209117 Log: In threaded processes, destroy the mutex atexit_mutex when we've finished using it. This allows the mutex's allocated memory to be freed. This is one sense a rather silly change, since at this point we're less than a microsecond away from calling _exit; but fixing this memory leak is likely to make life easier for anyone trying to track down other memory leaks. Modified: head/lib/libc/stdlib/atexit.c Modified: head/lib/libc/stdlib/atexit.c ============================================================================== --- head/lib/libc/stdlib/atexit.c Sat Jun 12 22:33:04 2010 (r209116) +++ head/lib/libc/stdlib/atexit.c Sun Jun 13 01:13:36 2010 (r209117) @@ -54,6 +54,7 @@ static pthread_mutex_t atexit_mutex = PT #define _MUTEX_LOCK(x) if (__isthreaded) _pthread_mutex_lock(x) #define _MUTEX_UNLOCK(x) if (__isthreaded) _pthread_mutex_unlock(x) +#define _MUTEX_DESTROY(x) if (__isthreaded) _pthread_mutex_destroy(x) struct atexit { struct atexit *next; /* next in list */ @@ -182,4 +183,6 @@ __cxa_finalize(void *dso) } } _MUTEX_UNLOCK(&atexit_mutex); + if (dso == NULL) + _MUTEX_DESTROY(&atexit_mutex); } From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 01:27: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 63C47106566B; Sun, 13 Jun 2010 01:27:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 517A78FC1A; Sun, 13 Jun 2010 01:27: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 o5D1RUnu070495; Sun, 13 Jun 2010 01:27:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5D1RUIp070486; Sun, 13 Jun 2010 01:27:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006130127.o5D1RUIp070486@svn.freebsd.org> From: Warner Losh Date: Sun, 13 Jun 2010 01:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209118 - in head/lib/libkse: . arch/amd64 arch/arm arch/i386 arch/ia64 arch/powerpc arch/sparc64 support X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Jun 2010 01:27:30 -0000 Author: imp Date: Sun Jun 13 01:27:29 2010 New Revision: 209118 URL: http://svn.freebsd.org/changeset/base/209118 Log: Merge from tbemd: Convert from using MACHINE_ARCH to MACHINE_CPUARCH. Hoist path statement up into the top Makefile rather than repeating it on every arch Makefile. Modified: head/lib/libkse/Makefile head/lib/libkse/arch/amd64/Makefile.inc head/lib/libkse/arch/arm/Makefile.inc head/lib/libkse/arch/i386/Makefile.inc head/lib/libkse/arch/ia64/Makefile.inc head/lib/libkse/arch/powerpc/Makefile.inc head/lib/libkse/arch/sparc64/Makefile.inc head/lib/libkse/support/Makefile.inc Modified: head/lib/libkse/Makefile ============================================================================== --- head/lib/libkse/Makefile Sun Jun 13 01:13:36 2010 (r209117) +++ head/lib/libkse/Makefile Sun Jun 13 01:27:29 2010 (r209118) @@ -15,10 +15,10 @@ SHLIB_MAJOR= 4 CFLAGS+=-DPTHREAD_KERNEL CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \ -I${.CURDIR}/../../include -CFLAGS+=-I${.CURDIR}/arch/${MACHINE_ARCH}/include +CFLAGS+=-I${.CURDIR}/arch/${MACHINE_CPUARCH}/include CFLAGS+=-I${.CURDIR}/sys CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf -CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_ARCH} +CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH} CFLAGS+=-fno-builtin # Uncomment this if you want libkse to contain debug information for @@ -38,7 +38,9 @@ SYMBOL_MAPS=${.CURDIR}/kse.map PRECIOUSLIB= -.include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc" +.path: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH} + +.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc" .include "${.CURDIR}/support/Makefile.inc" .include "${.CURDIR}/sys/Makefile.inc" .include "${.CURDIR}/thread/Makefile.inc" Modified: head/lib/libkse/arch/amd64/Makefile.inc ============================================================================== --- head/lib/libkse/arch/amd64/Makefile.inc Sun Jun 13 01:13:36 2010 (r209117) +++ head/lib/libkse/arch/amd64/Makefile.inc Sun Jun 13 01:27:29 2010 (r209118) @@ -1,5 +1,3 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} - SRCS+= context.S enter_uts.S pthread_md.c Modified: head/lib/libkse/arch/arm/Makefile.inc ============================================================================== --- head/lib/libkse/arch/arm/Makefile.inc Sun Jun 13 01:13:36 2010 (r209117) +++ head/lib/libkse/arch/arm/Makefile.inc Sun Jun 13 01:27:29 2010 (r209118) @@ -1,7 +1,5 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} - CFLAGS+=-DSYSTEM_SCOPE_ONLY SRCS+= pthread_md.c context.S Modified: head/lib/libkse/arch/i386/Makefile.inc ============================================================================== --- head/lib/libkse/arch/i386/Makefile.inc Sun Jun 13 01:13:36 2010 (r209117) +++ head/lib/libkse/arch/i386/Makefile.inc Sun Jun 13 01:27:29 2010 (r209118) @@ -1,5 +1,3 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} - SRCS+= thr_enter_uts.S thr_getcontext.S pthread_md.c Modified: head/lib/libkse/arch/ia64/Makefile.inc ============================================================================== --- head/lib/libkse/arch/ia64/Makefile.inc Sun Jun 13 01:13:36 2010 (r209117) +++ head/lib/libkse/arch/ia64/Makefile.inc Sun Jun 13 01:27:29 2010 (r209118) @@ -1,5 +1,3 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} - SRCS+= context.S enter_uts.S pthread_md.c Modified: head/lib/libkse/arch/powerpc/Makefile.inc ============================================================================== --- head/lib/libkse/arch/powerpc/Makefile.inc Sun Jun 13 01:13:36 2010 (r209117) +++ head/lib/libkse/arch/powerpc/Makefile.inc Sun Jun 13 01:27:29 2010 (r209118) @@ -3,6 +3,4 @@ # XXX temporary CFLAGS+=-DSYSTEM_SCOPE_ONLY -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} - SRCS+= enter_uts.S context.S pthread_md.c Modified: head/lib/libkse/arch/sparc64/Makefile.inc ============================================================================== --- head/lib/libkse/arch/sparc64/Makefile.inc Sun Jun 13 01:13:36 2010 (r209117) +++ head/lib/libkse/arch/sparc64/Makefile.inc Sun Jun 13 01:27:29 2010 (r209118) @@ -1,5 +1,3 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} - SRCS+= pthread_md.c thr_getcontext.S Modified: head/lib/libkse/support/Makefile.inc ============================================================================== --- head/lib/libkse/support/Makefile.inc Sun Jun 13 01:13:36 2010 (r209117) +++ head/lib/libkse/support/Makefile.inc Sun Jun 13 01:27:29 2010 (r209118) @@ -1,9 +1,9 @@ # $FreeBSD$ .PATH: ${.CURDIR}/support ${.CURDIR}/../libc/gen ${.CURDIR}/../libc/string -.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys +.PATH: ${.CURDIR}/../libc/${MACHINE_CPUARCH}/sys -CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_ARCH} +CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_CPUARCH} SYSCALLS= clock_gettime \ kse_create \ From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 02:39: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 37BF11065672; Sun, 13 Jun 2010 02:39:56 +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 271F28FC1B; Sun, 13 Jun 2010 02:39: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 o5D2duvh086333; Sun, 13 Jun 2010 02:39:56 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5D2du3m086332; Sun, 13 Jun 2010 02:39:56 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201006130239.o5D2du3m086332@svn.freebsd.org> From: Lawrence Stewart Date: Sun, 13 Jun 2010 02:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209119 - 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, 13 Jun 2010 02:39:56 -0000 Author: lstewart Date: Sun Jun 13 02:39:55 2010 New Revision: 209119 URL: http://svn.freebsd.org/changeset/base/209119 Log: Add a utility macro to simplify calculating an aggregate sum from a DPCPU counter variable. Sponsored by: FreeBSD Foundation Reviewed by: jhb, rpaulo, rwatson (previous version of patch) MFC after: 1 week Modified: head/sys/sys/pcpu.h Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010 (r209118) +++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 (r209119) @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[]; #define DPCPU_ID_GET(i, n) (*DPCPU_ID_PTR(i, n)) #define DPCPU_ID_SET(i, n, v) (*DPCPU_ID_PTR(i, n) = v) +/* + * Utility macros. + */ +#define DPCPU_SUM(n, var, sum) \ +do { \ + (sum) = 0; \ + u_int i; \ + CPU_FOREACH(i) \ + (sum) += (DPCPU_ID_PTR(i, n))->var; \ +} while (0) + /* * XXXUPS remove as soon as we have per cpu variable * linker sets and can define rm_queue in _rm_lock.h From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 05:03: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 3176F1065674; Sun, 13 Jun 2010 05:03:19 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id E33F08FC0C; Sun, 13 Jun 2010 05:03:18 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 2CDB67E871; Sun, 13 Jun 2010 15:03:17 +1000 (EST) Message-ID: <4C146694.3000508@freebsd.org> Date: Sun, 13 Jun 2010 15:03:16 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Navdeep Parhar References: <201006122233.o5CMX4Fc032367@svn.freebsd.org> In-Reply-To: <201006122233.o5CMX4Fc032367@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209116 - head/sys/dev/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2010 05:03:19 -0000 Hi Navdeep, On 06/13/10 08:33, Navdeep Parhar wrote: > Log: > cxgb(4): add knob to get packet timestamps from the hardware. > > The T3 ASIC can provide an incoming packet's timestamp instead of its RSS hash. > The timestamp is just a counter running off the card's clock. With a 175MHz > clock an increment represents ~5.7ns and the 32 bit value wraps around in ~25s. > > # sysctl -d dev.cxgbc.0.pkt_timestamp > dev.cxgbc.0.pkt_timestamp: provide packet timestamp instead of connection hash > > # sysctl -d dev.cxgbc.0.core_clock > dev.cxgbc.0.core_clock: core clock frequency (in KHz) > # sysctl dev.cxgbc.0.core_clock > dev.cxgbc.0.core_clock: 175000 Is this really a "one or the other" feature, or is it technically possible to support both simultaneously at some point in the future if additional work was done? Just curious... Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 05:24:27 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 BBA6E1065672; Sun, 13 Jun 2010 05:24:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9F738FC16; Sun, 13 Jun 2010 05:24:27 +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 o5D5ORTT022723; Sun, 13 Jun 2010 05:24:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5D5ORE6022713; Sun, 13 Jun 2010 05:24:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006130524.o5D5ORE6022713@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 13 Jun 2010 05:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209120 - in head/sys: fs/nfsclient fs/nfsserver 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, 13 Jun 2010 05:24:27 -0000 Author: kib Date: Sun Jun 13 05:24:27 2010 New Revision: 209120 URL: http://svn.freebsd.org/changeset/base/209120 Log: In NFS clients, instead of inconsistently using #ifdef DIAGNOSTIC and #ifndef DIAGNOSTIC for debug assertions, prefer KASSERT(). Also change one #ifdef DIAGNOSTIC in the new nfs server. Submitted by: Mikolaj Golub MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clsubs.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdsocket.c head/sys/nfsclient/nfs_bio.c head/sys/nfsclient/nfs_subs.c head/sys/nfsclient/nfs_vnops.c Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Sun Jun 13 02:39:55 2010 (r209119) +++ head/sys/fs/nfsclient/nfs_clbio.c Sun Jun 13 05:24:27 2010 (r209120) @@ -453,10 +453,7 @@ ncl_bioread(struct vnode *vp, struct uio int seqcount; int nra, error = 0, n = 0, on = 0; -#ifdef DIAGNOSTIC - if (uio->uio_rw != UIO_READ) - panic("ncl_read mode"); -#endif + KASSERT(uio->uio_rw == UIO_READ, ("ncl_read mode")); if (uio->uio_resid == 0) return (0); if (uio->uio_offset < 0) /* XXX VDIR cookies can be negative */ @@ -881,12 +878,9 @@ ncl_write(struct vop_write_args *ap) int bcount; int n, on, error = 0; -#ifdef DIAGNOSTIC - if (uio->uio_rw != UIO_WRITE) - panic("ncl_write mode"); - if (uio->uio_segflg == UIO_USERSPACE && uio->uio_td != curthread) - panic("ncl_write proc"); -#endif + KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode")); + KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, + ("ncl_write proc")); if (vp->v_type != VREG) return (EIO); mtx_lock(&np->n_mtx); Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Sun Jun 13 02:39:55 2010 (r209119) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Sun Jun 13 05:24:27 2010 (r209120) @@ -194,10 +194,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, int uiosiz, clflg, rem; char *cp, *tcp; -#ifdef DIAGNOSTIC - if (uiop->uio_iovcnt != 1) - panic("nfsm_uiotombuf: iovcnt != 1"); -#endif + KASSERT(uiop->uio_iovcnt == 1, ("nfsm_uiotombuf: iovcnt != 1")); if (siz > ncl_mbuf_mlen) /* or should it >= MCLBYTES ?? */ clflg = 1; @@ -346,10 +343,7 @@ nfscl_getcookie(struct nfsnode *np, off_ pos = off / NFS_DIRBLKSIZ; if (pos == 0) { -#ifdef DIAGNOSTIC - if (add) - panic("nfs getcookie add at 0"); -#endif + KASSERT(!add, ("nfs getcookie add at 0")); return (&nfs_nullcookie); } pos--; Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Sun Jun 13 02:39:55 2010 (r209119) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sun Jun 13 05:24:27 2010 (r209120) @@ -1445,10 +1445,7 @@ nfsrpc_writerpc(vnode_t vp, struct uio * struct nfsrv_descript *nd = &nfsd; nfsattrbit_t attrbits; -#ifdef DIAGNOSTIC - if (uiop->uio_iovcnt != 1) - panic("nfs: writerpc iovcnt > 1"); -#endif + KASSERT(uiop->uio_iovcnt == 1, ("nfs: writerpc iovcnt > 1")); *attrflagp = 0; tsiz = uio_uio_resid(uiop); NFSLOCKMNT(nmp); @@ -2501,10 +2498,9 @@ nfsrpc_readdir(vnode_t vp, struct uio *u u_int32_t *tl2 = NULL; size_t tresid; -#ifdef DIAGNOSTIC - if (uiop->uio_iovcnt != 1 || (uio_uio_resid(uiop) & (DIRBLKSIZ - 1))) - panic("nfs readdirrpc bad uio"); -#endif + KASSERT(uiop->uio_iovcnt == 1 && + (uio_uio_resid(uiop) & (DIRBLKSIZ - 1)) == 0, + ("nfs readdirrpc bad uio")); /* * There is no point in reading a lot more than uio_resid, however @@ -2939,10 +2935,9 @@ nfsrpc_readdirplus(vnode_t vp, struct ui size_t tresid; u_int32_t *tl2 = NULL, fakefileno = 0xffffffff, rderr; -#ifdef DIAGNOSTIC - if (uiop->uio_iovcnt != 1 || (uio_uio_resid(uiop) & (DIRBLKSIZ - 1))) - panic("nfs readdirplusrpc bad uio"); -#endif + KASSERT(uiop->uio_iovcnt == 1 && + (uio_uio_resid(uiop) & (DIRBLKSIZ - 1)) == 0, + ("nfs readdirplusrpc bad uio")); *attrflagp = 0; if (eofp != NULL) *eofp = 0; Modified: head/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clsubs.c Sun Jun 13 02:39:55 2010 (r209119) +++ head/sys/fs/nfsclient/nfs_clsubs.c Sun Jun 13 05:24:27 2010 (r209120) @@ -282,10 +282,7 @@ ncl_getcookie(struct nfsnode *np, off_t pos = (uoff_t)off / NFS_DIRBLKSIZ; if (pos == 0 || off < 0) { -#ifdef DIAGNOSTIC - if (add) - panic("nfs getcookie add at <= 0"); -#endif + KASSERT(!add, ("nfs getcookie add at <= 0")); return (&nfs_nullcookie); } pos--; @@ -336,10 +333,7 @@ ncl_invaldir(struct vnode *vp) { struct nfsnode *np = VTONFS(vp); -#ifdef DIAGNOSTIC - if (vp->v_type != VDIR) - panic("nfs: invaldir not dir"); -#endif + KASSERT(vp->v_type == VDIR, ("nfs: invaldir not dir")); ncl_dircookie_lock(np); np->n_direofoffset = 0; np->n_cookieverf.nfsuquad[0] = 0; Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 13 02:39:55 2010 (r209119) +++ head/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 13 05:24:27 2010 (r209120) @@ -1564,12 +1564,8 @@ nfs_remove(struct vop_remove_args *ap) int error = 0; struct vattr vattr; -#ifndef DIAGNOSTIC - if ((cnp->cn_flags & HASBUF) == 0) - panic("nfs_remove: no name"); - if (vrefcnt(vp) < 1) - panic("nfs_remove: bad v_usecount"); -#endif + KASSERT((cnp->cn_flags & HASBUF) != 0, ("nfs_remove: no name")); + KASSERT(vrefcnt(vp) > 0, ("nfs_remove: bad v_usecount")); if (vp->v_type == VDIR) error = EPERM; else if (vrefcnt(vp) == 1 || (np->n_sillyrename && @@ -1676,11 +1672,8 @@ nfs_rename(struct vop_rename_args *ap) struct nfsv4node *newv4 = NULL; int error; -#ifndef DIAGNOSTIC - if ((tcnp->cn_flags & HASBUF) == 0 || - (fcnp->cn_flags & HASBUF) == 0) - panic("nfs_rename: no name"); -#endif + KASSERT((tcnp->cn_flags & HASBUF) != 0 && + (fcnp->cn_flags & HASBUF) != 0, ("nfs_rename: no name")); /* Check for cross-device rename */ if ((fvp->v_mount != tdvp->v_mount) || (tvp && (fvp->v_mount != tvp->v_mount))) { @@ -2137,11 +2130,10 @@ ncl_readdirrpc(struct vnode *vp, struct struct nfsmount *nmp = VFSTONFS(vp->v_mount); int error = 0, eof, attrflag; -#ifndef DIAGNOSTIC - if (uiop->uio_iovcnt != 1 || (uiop->uio_offset & (DIRBLKSIZ - 1)) || - (uiop->uio_resid & (DIRBLKSIZ - 1))) - panic("nfs readdirrpc bad uio"); -#endif + KASSERT(uiop->uio_iovcnt == 1 && + (uiop->uio_offset & (DIRBLKSIZ - 1)) == 0 && + (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, + ("nfs readdirrpc bad uio")); /* * If there is no cookie, assume directory was stale. @@ -2198,11 +2190,10 @@ ncl_readdirplusrpc(struct vnode *vp, str struct nfsmount *nmp = VFSTONFS(vp->v_mount); int error = 0, attrflag, eof; -#ifndef DIAGNOSTIC - if (uiop->uio_iovcnt != 1 || (uiop->uio_offset & (DIRBLKSIZ - 1)) || - (uiop->uio_resid & (DIRBLKSIZ - 1))) - panic("nfs readdirplusrpc bad uio"); -#endif + KASSERT(uiop->uio_iovcnt == 1 && + (uiop->uio_offset & (DIRBLKSIZ - 1)) == 0 && + (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, + ("nfs readdirplusrpc bad uio")); /* * If there is no cookie, assume directory was stale. @@ -2264,10 +2255,7 @@ nfs_sillyrename(struct vnode *dvp, struc cache_purge(dvp); np = VTONFS(vp); -#ifndef DIAGNOSTIC - if (vp->v_type == VDIR) - panic("nfs: sillyrename dir"); -#endif + KASSERT(vp->v_type != VDIR, ("nfs: sillyrename dir")); MALLOC(sp, struct sillyrename *, sizeof (struct sillyrename), M_NEWNFSREQ, M_WAITOK); sp->s_cred = crhold(cnp->cn_cred); Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Jun 13 02:39:55 2010 (r209119) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Sun Jun 13 05:24:27 2010 (r209120) @@ -364,10 +364,7 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, * Get a locked vnode for the first file handle */ if (!(nd->nd_flag & ND_NFSV4)) { -#ifdef DIAGNOSTIC - if (nd->nd_repstat) - panic("nfsrvd_dorpc"); -#endif + KASSERT(nd->nd_repstat == 0, ("nfsrvd_dorpc")); /* * For NFSv3, if the malloc/mget allocation is near limits, * return NFSERR_DELAY. Modified: head/sys/nfsclient/nfs_bio.c ============================================================================== --- head/sys/nfsclient/nfs_bio.c Sun Jun 13 02:39:55 2010 (r209119) +++ head/sys/nfsclient/nfs_bio.c Sun Jun 13 05:24:27 2010 (r209120) @@ -453,10 +453,7 @@ nfs_bioread(struct vnode *vp, struct uio int seqcount; int nra, error = 0, n = 0, on = 0; -#ifdef DIAGNOSTIC - if (uio->uio_rw != UIO_READ) - panic("nfs_read mode"); -#endif + KASSERT(uio->uio_rw == UIO_READ, ("nfs_read mode")); if (uio->uio_resid == 0) return (0); if (uio->uio_offset < 0) /* XXX VDIR cookies can be negative */ @@ -875,12 +872,9 @@ nfs_write(struct vop_write_args *ap) int bcount; int n, on, error = 0; -#ifdef DIAGNOSTIC - if (uio->uio_rw != UIO_WRITE) - panic("nfs_write mode"); - if (uio->uio_segflg == UIO_USERSPACE && uio->uio_td != curthread) - panic("nfs_write proc"); -#endif + KASSERT(uio->uio_rw == UIO_WRITE, ("nfs_write mode")); + KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, + ("nfs_write proc")); if (vp->v_type != VREG) return (EIO); mtx_lock(&np->n_mtx); Modified: head/sys/nfsclient/nfs_subs.c ============================================================================== --- head/sys/nfsclient/nfs_subs.c Sun Jun 13 02:39:55 2010 (r209119) +++ head/sys/nfsclient/nfs_subs.c Sun Jun 13 05:24:27 2010 (r209120) @@ -199,10 +199,7 @@ nfsm_uiotombuf(struct uio *uiop, struct int uiosiz, clflg, rem; char *cp; -#ifdef DIAGNOSTIC - if (uiop->uio_iovcnt != 1) - panic("nfsm_uiotombuf: iovcnt != 1"); -#endif + KASSERT(uiop->uio_iovcnt == 1, ("nfsm_uiotombuf: iovcnt != 1")); if (siz > MLEN) /* or should it >= MCLBYTES ?? */ clflg = 1; @@ -789,10 +786,7 @@ nfs_getcookie(struct nfsnode *np, off_t pos = (uoff_t)off / NFS_DIRBLKSIZ; if (pos == 0 || off < 0) { -#ifdef DIAGNOSTIC - if (add) - panic("nfs getcookie add at <= 0"); -#endif + KASSERT(!add, ("nfs getcookie add at <= 0")); return (&nfs_nullcookie); } pos--; @@ -843,10 +837,7 @@ nfs_invaldir(struct vnode *vp) { struct nfsnode *np = VTONFS(vp); -#ifdef DIAGNOSTIC - if (vp->v_type != VDIR) - panic("nfs: invaldir not dir"); -#endif + KASSERT(vp->v_type == VDIR, ("nfs: invaldir not dir")); nfs_dircookie_lock(np); np->n_direofoffset = 0; np->n_cookieverf.nfsuquad[0] = 0; Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Sun Jun 13 02:39:55 2010 (r209119) +++ head/sys/nfsclient/nfs_vnops.c Sun Jun 13 05:24:27 2010 (r209120) @@ -1348,10 +1348,7 @@ nfs_writerpc(struct vnode *vp, struct ui int v3 = NFS_ISV3(vp), committed = NFSV3WRITE_FILESYNC; int wsize; -#ifndef DIAGNOSTIC - if (uiop->uio_iovcnt != 1) - panic("nfs: writerpc iovcnt > 1"); -#endif + KASSERT(uiop->uio_iovcnt == 1, ("nfs: writerpc iovcnt > 1")); *must_commit = 0; tsiz = uiop->uio_resid; mtx_lock(&nmp->nm_mtx); @@ -1708,12 +1705,8 @@ nfs_remove(struct vop_remove_args *ap) int error = 0; struct vattr vattr; -#ifndef DIAGNOSTIC - if ((cnp->cn_flags & HASBUF) == 0) - panic("nfs_remove: no name"); - if (vrefcnt(vp) < 1) - panic("nfs_remove: bad v_usecount"); -#endif + KASSERT((cnp->cn_flags & HASBUF) != 0, ("nfs_remove: no name")); + KASSERT(vrefcnt(vp) > 0, ("nfs_remove: bad v_usecount")); if (vp->v_type == VDIR) error = EPERM; else if (vrefcnt(vp) == 1 || (np->n_sillyrename && @@ -1814,11 +1807,8 @@ nfs_rename(struct vop_rename_args *ap) struct componentname *fcnp = ap->a_fcnp; int error; -#ifndef DIAGNOSTIC - if ((tcnp->cn_flags & HASBUF) == 0 || - (fcnp->cn_flags & HASBUF) == 0) - panic("nfs_rename: no name"); -#endif + KASSERT((tcnp->cn_flags & HASBUF) != 0 && + (fcnp->cn_flags & HASBUF) != 0, ("nfs_rename: no name")); /* Check for cross-device rename */ if ((fvp->v_mount != tdvp->v_mount) || (tvp && (fvp->v_mount != tvp->v_mount))) { @@ -2277,11 +2267,10 @@ nfs_readdirrpc(struct vnode *vp, struct int attrflag; int v3 = NFS_ISV3(vp); -#ifndef DIAGNOSTIC - if (uiop->uio_iovcnt != 1 || (uiop->uio_offset & (DIRBLKSIZ - 1)) || - (uiop->uio_resid & (DIRBLKSIZ - 1))) - panic("nfs readdirrpc bad uio"); -#endif + KASSERT(uiop->uio_iovcnt == 1 && + (uiop->uio_offset & (DIRBLKSIZ - 1)) == 0 && + (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, + ("nfs readdirrpc bad uio")); /* * If there is no cookie, assume directory was stale. @@ -2482,11 +2471,10 @@ nfs_readdirplusrpc(struct vnode *vp, str #ifndef nolint dp = NULL; #endif -#ifndef DIAGNOSTIC - if (uiop->uio_iovcnt != 1 || (uiop->uio_offset & (DIRBLKSIZ - 1)) || - (uiop->uio_resid & (DIRBLKSIZ - 1))) - panic("nfs readdirplusrpc bad uio"); -#endif + KASSERT(uiop->uio_iovcnt == 1 && + (uiop->uio_offset & (DIRBLKSIZ - 1)) == 0 && + (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, + ("nfs readdirplusrpc bad uio")); ndp->ni_dvp = vp; newvp = NULLVP; @@ -2752,10 +2740,7 @@ nfs_sillyrename(struct vnode *dvp, struc cache_purge(dvp); np = VTONFS(vp); -#ifndef DIAGNOSTIC - if (vp->v_type == VDIR) - panic("nfs: sillyrename dir"); -#endif + KASSERT(vp->v_type != VDIR, ("nfs: sillyrename dir")); sp = malloc(sizeof (struct sillyrename), M_NFSREQ, M_WAITOK); sp->s_cred = crhold(cnp->cn_cred); From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 07:50:50 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1205) id 103D31065677; Sun, 13 Jun 2010 07:50:50 +0000 (UTC) Date: Sun, 13 Jun 2010 07:50:50 +0000 From: Navdeep Parhar To: Lawrence Stewart Message-ID: <20100613075049.GA76297@hub.freebsd.org> Mail-Followup-To: Lawrence Stewart , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201006122233.o5CMX4Fc032367@svn.freebsd.org> <4C146694.3000508@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C146694.3000508@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: r209116 - head/sys/dev/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2010 07:50:50 -0000 On Sun, Jun 13, 2010 at 03:03:16PM +1000, Lawrence Stewart wrote: > Hi Navdeep, > > On 06/13/10 08:33, Navdeep Parhar wrote: > >Log: > > cxgb(4): add knob to get packet timestamps from the hardware. > > > > The T3 ASIC can provide an incoming packet's timestamp instead of its > > RSS hash. > > The timestamp is just a counter running off the card's clock. With a > > 175MHz > > clock an increment represents ~5.7ns and the 32 bit value wraps around > > in ~25s. > > > > # sysctl -d dev.cxgbc.0.pkt_timestamp > > dev.cxgbc.0.pkt_timestamp: provide packet timestamp instead of > > connection hash > > > > # sysctl -d dev.cxgbc.0.core_clock > > dev.cxgbc.0.core_clock: core clock frequency (in KHz) > > # sysctl dev.cxgbc.0.core_clock > > dev.cxgbc.0.core_clock: 175000 > > Is this really a "one or the other" feature, or is it technically > possible to support both simultaneously at some point in the future if > additional work was done? > > Just curious... Both hash+timestamp will be supported in the future. If the kernel is going to grow the ability to let a NIC driver pass up a timestamp it should allow both simultaneously. This "one or the other" just happens to be the way this particular generation of this particular chip does it. By the way, the packet is still hashed so RSS based load distribution works even with timestamping enabled, just that the hash itself is not provided. Regards, Navdeep From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 10:10: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 641E4106567C; Sun, 13 Jun 2010 10:10:48 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 9139A8FC0C; Sun, 13 Jun 2010 10:10:47 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 0657F45CA0; Sun, 13 Jun 2010 12:10:46 +0200 (CEST) Received: from localhost (gate.wheel.pl [10.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 3F0B545C9C; Sun, 13 Jun 2010 12:10:38 +0200 (CEST) Date: Sun, 13 Jun 2010 12:10:25 +0200 From: Pawel Jakub Dawidek To: Lawrence Stewart Message-ID: <20100613101025.GD1320@garage.freebsd.pl> References: <201006130239.o5D2du3m086332@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="maH1Gajj2nflutpK" Content-Disposition: inline In-Reply-To: <201006130239.o5D2du3m086332@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209119 - 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, 13 Jun 2010 10:10:48 -0000 --maH1Gajj2nflutpK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 13, 2010 at 02:39:55AM +0000, Lawrence Stewart wrote: > Author: lstewart > Date: Sun Jun 13 02:39:55 2010 > New Revision: 209119 > URL: http://svn.freebsd.org/changeset/base/209119 >=20 > Log: > Add a utility macro to simplify calculating an aggregate sum from a DPC= PU > counter variable. > =20 > Sponsored by: FreeBSD Foundation > Reviewed by: jhb, rpaulo, rwatson (previous version of patch) > MFC after: 1 week >=20 > Modified: > head/sys/sys/pcpu.h >=20 > Modified: head/sys/sys/pcpu.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010 (r209118) > +++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 (r209119) > @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[]; > #define DPCPU_ID_GET(i, n) (*DPCPU_ID_PTR(i, n)) > #define DPCPU_ID_SET(i, n, v) (*DPCPU_ID_PTR(i, n) =3D v) > =20 > +/* > + * Utility macros. > + */ > +#define DPCPU_SUM(n, var, sum) \ > +do { \ > + (sum) =3D 0; \ > + u_int i; \ > + CPU_FOREACH(i) \ > + (sum) +=3D (DPCPU_ID_PTR(i, n))->var; \ > +} while (0) I'd suggest first swapping variable declaration and '(sum) =3D 0;'. Also using 'i' as a counter in macro can easly lead to name collision. If you need to do it, I'd suggest '_i' or something. Maybe it would be better to make it an inline function rather than macro? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --maH1Gajj2nflutpK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwUrpEACgkQForvXbEpPzQNbACgtDcalgrjF5GBlPfRSqb/+tLS B54AoIK1ff4fyjN56XUlJuYIAxtzRbEK =CVoE -----END PGP SIGNATURE----- --maH1Gajj2nflutpK-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 10:20:39 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 425FD1065672; Sun, 13 Jun 2010 10:20:39 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id E4FC98FC19; Sun, 13 Jun 2010 10:20:38 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 29EFF14DBAB1; Sun, 13 Jun 2010 12:20:36 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7ejdJwOXgujm; Sun, 13 Jun 2010 12:20:33 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id B444714DBAA2; Sun, 13 Jun 2010 12:20:33 +0200 (CEST) Message-ID: <4C14B0EA.8090500@FreeBSD.org> Date: Sun, 13 Jun 2010 12:20:26 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; es-ES; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Lawrence Stewart References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> In-Reply-To: <20100613101025.GD1320@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209119 - 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, 13 Jun 2010 10:20:39 -0000 >> >> +/* >> + * Utility macros. >> + */ >> +#define DPCPU_SUM(n, var, sum) \ >> +do { \ >> + (sum) = 0; \ >> + u_int i; \ >> + CPU_FOREACH(i) \ >> + (sum) += (DPCPU_ID_PTR(i, n))->var; \ >> +} while (0) >> > I'd suggest first swapping variable declaration and '(sum) = 0;'. > Also using 'i' as a counter in macro can easly lead to name collision. > If you need to do it, I'd suggest '_i' or something. > Maybe it would be better to make it an inline function rather than macro? > And why using old BSD-stlye u_int? style(9) also suggest using ISO C types. -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 10: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 E3FF71065673; Sun, 13 Jun 2010 10:58:50 +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 B8D718FC08; Sun, 13 Jun 2010 10:58: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 o5DAwoQa004989; Sun, 13 Jun 2010 10:58:50 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DAwo4b004987; Sun, 13 Jun 2010 10:58:50 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201006131058.o5DAwo4b004987@svn.freebsd.org> From: Kai Wang Date: Sun, 13 Jun 2010 10:58: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: r209122 - 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: Sun, 13 Jun 2010 10:58:51 -0000 Author: kaiw Date: Sun Jun 13 10:58:50 2010 New Revision: 209122 URL: http://svn.freebsd.org/changeset/base/209122 Log: * Improve compatibility with existing application code by permitting the use of `elf_getbase()` on non-archive members. This change is needed for gcc LTO (-flto) to work properly. * Style fix: paranthesize returned values. * Document the current behaviour of `elf_getbase()`. Tested by: gerald, Steve Kargl (original patch) Obtained from: elftoolchain MFC after: 3 days Modified: head/lib/libelf/elf_getbase.3 head/lib/libelf/elf_getbase.c Modified: head/lib/libelf/elf_getbase.3 ============================================================================== --- head/lib/libelf/elf_getbase.3 Sun Jun 13 07:30:51 2010 (r209121) +++ head/lib/libelf/elf_getbase.3 Sun Jun 13 10:58:50 2010 (r209122) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006 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 June 11, 2006 +.Dd June 6, 2010 .Dt ELF_GETBASE 3 .Os .Sh NAME @@ -38,17 +38,21 @@ .Sh DESCRIPTION Function .Fn elf_getbase -returns the file offset in the containing archive of the first byte of -the file referenced by ELF descriptor +returns the file offset to the first byte of the object referenced by ELF +descriptor .Ar elf . +.Pp +For descriptors referencing members of archives, the returned offset is +the file offset of the member in its containing archive. +For descriptors to regular objects, the returned offset is (vacuously) +zero. .Sh RETURN VALUES Function .Fn elf_getbase -returns a valid file offset into the containing archive if successful. -It returns -1 if argument -.Ar elf -is NULL or is not a member of an -archive. +returns a valid file offset if successful, or +.Pq Vt off_t +.Li -1 +in case of an error. .Sh ERRORS Function .Fn elf_getbase @@ -57,7 +61,7 @@ may fail with the following errors: .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -is not an ELF descriptor for an archive member. +was NULL. .El .Sh SEE ALSO .Xr elf 3 , Modified: head/lib/libelf/elf_getbase.c ============================================================================== --- head/lib/libelf/elf_getbase.c Sun Jun 13 07:30:51 2010 (r209121) +++ head/lib/libelf/elf_getbase.c Sun Jun 13 10:58:50 2010 (r209122) @@ -34,12 +34,14 @@ __FBSDID("$FreeBSD$"); off_t elf_getbase(Elf *e) { - if (e == NULL || - e->e_parent == NULL) { + if (e == NULL) { LIBELF_SET_ERROR(ARGUMENT, 0); - return (off_t) -1; + return ((off_t) -1); } + if (e->e_parent == NULL) + return ((off_t) 0); + return ((off_t) ((uintptr_t) e->e_rawfile - (uintptr_t) e->e_parent->e_rawfile)); } From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 11:27: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 55EDE1065672; Sun, 13 Jun 2010 11:27:45 +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 44BD48FC16; Sun, 13 Jun 2010 11:27: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 o5DBRj3Z011309; Sun, 13 Jun 2010 11:27:45 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DBRjuJ011307; Sun, 13 Jun 2010 11:27:45 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006131127.o5DBRjuJ011307@svn.freebsd.org> From: Ed Schouten Date: Sun, 13 Jun 2010 11:27: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: r209123 - 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: Sun, 13 Jun 2010 11:27:45 -0000 Author: ed Date: Sun Jun 13 11:27:44 2010 New Revision: 209123 URL: http://svn.freebsd.org/changeset/base/209123 Log: Unbreak the build on less common architectures. Submitted by: Andreas Tobler Modified: head/usr.sbin/sysinstall/install.c Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Sun Jun 13 10:58:50 2010 (r209122) +++ head/usr.sbin/sysinstall/install.c Sun Jun 13 11:27:44 2010 (r209123) @@ -628,8 +628,11 @@ installExpress(dialogMenuItem *self) int installStandard(dialogMenuItem *self) { - int i, tries = 0; + int i; +#ifdef WITH_SLICES + int tries = 0; Device **devs; +#endif variable_set2(SYSTEM_STATE, "standard", 0); dialog_clear_norefresh(); @@ -874,7 +877,9 @@ installConfigure(void) int installFixupBase(dialogMenuItem *self) { +#if defined(__i386__) || defined(__amd64__) FILE *fp; +#endif #ifdef __ia64__ const char *efi_mntpt; #endif From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 12:39: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 C1E101065678; Sun, 13 Jun 2010 12:39:22 +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 AD2FC8FC16; Sun, 13 Jun 2010 12:39: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 o5DCdM58026978; Sun, 13 Jun 2010 12:39:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DCdMOE026977; Sun, 13 Jun 2010 12:39:22 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006131239.o5DCdMOE026977@svn.freebsd.org> From: Ed Schouten Date: Sun, 13 Jun 2010 12:39: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: r209124 - in head/lib/clang: . include/llvm/Config X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Jun 2010 12:39:22 -0000 Author: ed Date: Sun Jun 13 12:39:22 2010 New Revision: 209124 URL: http://svn.freebsd.org/changeset/base/209124 Log: Disable usage of posix_spawn() inside LLVM. Even though it's nice to use posix_spawn() instead of manually using fork()/exec(), it's better to disable this. FreeBSD 7 doesn't support this interface. When enabled, we can't build tblgen, which prevents us from building FreeBSD 9 on 7. Tested by: raj Modified: head/lib/clang/clang.build.mk head/lib/clang/include/llvm/Config/config.h Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Sun Jun 13 11:27:44 2010 (r209123) +++ head/lib/clang/clang.build.mk Sun Jun 13 12:39:22 2010 (r209124) @@ -12,7 +12,7 @@ TARGET_ARCH?= ${MACHINE_ARCH} # XXX: 8.0, to keep __FreeBSD_cc_version happy CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH}-undermydesk-freebsd9.0\" \ -DCLANG_VENDOR=\"FreeBSD\ \" -DSVN_REVISION=\"104832\" \ - -DCLANG_VENDOR_SUFFIX=\"\ 20100612\" + -DCLANG_VENDOR_SUFFIX=\"\ 20100613\" .PATH: ${LLVM_SRCS}/${SRCDIR} Modified: head/lib/clang/include/llvm/Config/config.h ============================================================================== --- head/lib/clang/include/llvm/Config/config.h Sun Jun 13 11:27:44 2010 (r209123) +++ head/lib/clang/include/llvm/Config/config.h Sun Jun 13 12:39:22 2010 (r209124) @@ -270,7 +270,7 @@ #define HAVE_OPENDIR 1 /* Define to 1 if you have the `posix_spawn' function. */ -#define HAVE_POSIX_SPAWN 1 +/* #undef HAVE_POSIX_SPAWN */ /* Define to 1 if you have the `powf' function. */ #define HAVE_POWF 1 From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 12:46: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 92B88106566C; Sun, 13 Jun 2010 12:46:32 +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 688558FC1F; Sun, 13 Jun 2010 12:46: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 o5DCkWjs028614; Sun, 13 Jun 2010 12:46:32 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DCkWna028610; Sun, 13 Jun 2010 12:46:32 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201006131246.o5DCkWna028610@svn.freebsd.org> From: Rafal Jaworowski Date: Sun, 13 Jun 2010 12:46: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: r209125 - in head/sys/boot: arm/uboot powerpc/uboot uboot/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Jun 2010 12:46:32 -0000 Author: raj Date: Sun Jun 13 12:46:32 2010 New Revision: 209125 URL: http://svn.freebsd.org/changeset/base/209125 Log: Fix conditional FDT support in loader(8). Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Sun Jun 13 12:39:22 2010 (r209124) +++ head/sys/boot/arm/uboot/Makefile Sun Jun 13 12:46:32 2010 (r209125) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} BINDIR?= /boot @@ -18,7 +20,7 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -.if defined(WITH_FDT) +.if ${MK_FDT} != "no" LOADER_FDT_SUPPORT= yes .else LOADER_FDT_SUPPORT= no Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Sun Jun 13 12:39:22 2010 (r209124) +++ head/sys/boot/powerpc/uboot/Makefile Sun Jun 13 12:46:32 2010 (r209125) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} BINDIR?= /boot @@ -18,7 +20,7 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -.if defined(WITH_FDT) +.if ${MK_FDT} != "no" LOADER_FDT_SUPPORT= yes .else LOADER_FDT_SUPPORT= no Modified: head/sys/boot/uboot/common/metadata.c ============================================================================== --- head/sys/boot/uboot/common/metadata.c Sun Jun 13 12:39:22 2010 (r209124) +++ head/sys/boot/uboot/common/metadata.c Sun Jun 13 12:46:32 2010 (r209125) @@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include +#if !defined(LOADER_FDT_SUPPORT) #include +#endif #include "api_public.h" #include "bootstrap.h" From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 12:53: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 2DC51106566C; Sun, 13 Jun 2010 12:53:45 +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 1D3478FC1A; Sun, 13 Jun 2010 12:53: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 o5DCrjph030230; Sun, 13 Jun 2010 12:53:45 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DCriko030228; Sun, 13 Jun 2010 12:53:45 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201006131253.o5DCriko030228@svn.freebsd.org> From: Rafal Jaworowski Date: Sun, 13 Jun 2010 12:53: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: r209126 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2010 12:53:45 -0000 Author: raj Date: Sun Jun 13 12:53:44 2010 New Revision: 209126 URL: http://svn.freebsd.org/changeset/base/209126 Log: Do not set WITH_FDT by default based on arch, as this does not work for a bootstrap stage tool. FDT-enabled platforms will have to specify WITH_FDT explicitly at buildworld time for now until TBEMD is complete, which is going to provide means for such arch based selection of build components. Discussed with: imp Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sun Jun 13 12:46:32 2010 (r209125) +++ head/share/mk/bsd.own.mk Sun Jun 13 12:53:44 2010 (r209126) @@ -278,15 +278,6 @@ WITH_HESIOD= WITH_IDEA= .endif -# Enable FDT by default for selected platforms. -.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "powerpc" -# XXX this is temporarily disabled until all FDT support code is in place. -#_fdt= FDT -_no_fdt= FDT -.else -_no_fdt= FDT -.endif - # # Default behaviour of MK_CLANG depends on the architecture. # @@ -335,7 +326,6 @@ _clang_no=CLANG DICT \ DYNAMICROOT \ EXAMPLES \ - ${_fdt} \ FLOPPY \ FORTH \ FP_LIBC \ @@ -431,7 +421,7 @@ MK_${var}:= yes BIND_SIGCHASE \ BIND_XML \ ${_clang_no} \ - ${_no_fdt} \ + FDT \ HESIOD \ IDEA .if defined(WITH_${var}) && defined(WITHOUT_${var}) From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 12:58: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 8C2791065676; Sun, 13 Jun 2010 12:58:31 +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 7BD808FC13; Sun, 13 Jun 2010 12:58: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 o5DCwV78031318; Sun, 13 Jun 2010 12:58:31 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DCwV9I031316; Sun, 13 Jun 2010 12:58:31 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201006131258.o5DCwV9I031316@svn.freebsd.org> From: Rafal Jaworowski Date: Sun, 13 Jun 2010 12:58: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: r209127 - head/sys/dev/fdt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2010 12:58:31 -0000 Author: raj Date: Sun Jun 13 12:58:31 2010 New Revision: 209127 URL: http://svn.freebsd.org/changeset/base/209127 Log: Provide identify method for the fdtbus(4). Reviewed by: imp Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/fdt/fdtbus.c Modified: head/sys/dev/fdt/fdtbus.c ============================================================================== --- head/sys/dev/fdt/fdtbus.c Sun Jun 13 12:53:44 2010 (r209126) +++ head/sys/dev/fdt/fdtbus.c Sun Jun 13 12:58:31 2010 (r209127) @@ -77,6 +77,7 @@ struct fdtbus_softc { /* * Prototypes. */ +static void fdtbus_identify(driver_t *, device_t); static int fdtbus_probe(device_t); static int fdtbus_attach(device_t); @@ -109,6 +110,7 @@ static void newbus_device_from_fdt_node( */ static device_method_t fdtbus_methods[] = { /* Device interface */ + DEVMETHOD(device_identify, fdtbus_identify), DEVMETHOD(device_probe, fdtbus_probe), DEVMETHOD(device_attach, fdtbus_attach), DEVMETHOD(device_detach, bus_generic_detach), @@ -144,6 +146,14 @@ devclass_t fdtbus_devclass; DRIVER_MODULE(fdtbus, nexus, fdtbus_driver, fdtbus_devclass, 0, 0); +static void +fdtbus_identify(driver_t *driver, device_t parent) +{ + + if (device_find_child(parent, "fdtbus", -1) == NULL) + BUS_ADD_CHILD(parent, 0, "fdtbus", -1); +} + static int fdtbus_probe(device_t dev) { From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 13:02: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 8E22D106566C; Sun, 13 Jun 2010 13:02:43 +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 7CE018FC0A; Sun, 13 Jun 2010 13:02: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 o5DD2hnh032303; Sun, 13 Jun 2010 13:02:43 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DD2hm6032298; Sun, 13 Jun 2010 13:02:43 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201006131302.o5DD2hm6032298@svn.freebsd.org> From: Rafal Jaworowski Date: Sun, 13 Jun 2010 13:02: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: r209128 - in head: . gnu/usr.bin sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2010 13:02:43 -0000 Author: raj Date: Sun Jun 13 13:02:43 2010 New Revision: 209128 URL: http://svn.freebsd.org/changeset/base/209128 Log: Connect FDT infrastructure to the build system. Reviewed by: imp Sponsored by: The FreeBSD Foundation Modified: head/Makefile head/Makefile.inc1 head/gnu/usr.bin/Makefile head/sys/conf/files Modified: head/Makefile ============================================================================== --- head/Makefile Sun Jun 13 12:58:31 2010 (r209127) +++ head/Makefile Sun Jun 13 13:02:43 2010 (r209128) @@ -89,7 +89,8 @@ TGTS= all all-man buildenv buildenvvars obj objlink regress rerelease showconfig tags toolchain update \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ _build-tools _cross-tools _includes _libraries _depend \ - build32 distribute32 install32 xdev xdev-build xdev-install + build32 builddtb distribute32 install32 xdev xdev-build xdev-install \ + TGTS+= ${SUBDIR_TARGETS} BITGTS= files includes Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jun 13 12:58:31 2010 (r209127) +++ head/Makefile.inc1 Sun Jun 13 13:02:43 2010 (r209128) @@ -968,6 +968,10 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge .endif +.if ${MK_FDT} != "no" +_dtc= gnu/usr.bin/dtc +.endif + bootstrap-tools: .for _tool in \ ${_clang_tblgen} \ @@ -976,6 +980,7 @@ bootstrap-tools: ${_gperf} \ ${_groff} \ ${_ar} \ + ${_dtc} \ usr.bin/lorder \ usr.bin/makewhatis \ ${_mklocale} \ @@ -1448,3 +1453,39 @@ _xi-links: ../../../../usr/bin/${XDDIR}${OSREL}-$$i; \ done .endif + +.if !empty(KRNLOBJDIR) && !empty(KERNCONF) +DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ + +.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) +FDT_DTS_FILE!= grep "^makeoptions[[:space:]]\+FDT_DTS_FILE" \ + ${KERNCONFDIR}/${KERNCONF} 2> /dev/null | cut -d= -f2 +.endif + +.endif + +.if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH}) +DTBOUTPUTPATH= ${.CURDIR} +.endif + +# +# Build 'standalone' Device Tree Blob +# +builddtb: + @if [ "${FDT_DTS_FILE}" = "" ]; then \ + echo "ERROR: FDT_DTS_FILE must be specified!"; \ + exit 1; \ + fi; \ + if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} ]; then \ + echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \ + exist!"; \ + exit 1; \ + fi; \ + if [ "${DTBOUTPUTPATH}" = "${.CURDIR}" ]; then \ + echo "WARNING: DTB will be placed in the current working \ + directory"; \ + fi + @PATH=${TMPPATH} \ + dtc -O dtb -o \ + ${DTBOUTPUTPATH}/`echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 \ + -p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Sun Jun 13 12:58:31 2010 (r209127) +++ head/gnu/usr.bin/Makefile Sun Jun 13 13:02:43 2010 (r209128) @@ -8,6 +8,7 @@ SUBDIR= ${_binutils} \ dialog \ diff \ diff3 \ + ${_dtc} \ ${_gdb} \ ${_gperf} \ ${_grep} \ @@ -31,6 +32,10 @@ _groff= groff _cvs= cvs .endif +.if ${MK_FDT} != "no" +_dtc= dtc +.endif + .if ${MK_GNU_GREP} != "no" _grep= grep .endif Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jun 13 12:58:31 2010 (r209127) +++ head/sys/conf/files Sun Jun 13 13:02:43 2010 (r209128) @@ -55,6 +55,18 @@ emu10k1-alsa%diked.h optional snd_emu10 compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h emu10k1-alsa%diked.h" \ no-obj no-implicit-rule before-depend \ clean "emu10k1-alsa%diked.h" +# +# The 'fdt_dtb_file' target covers an actual DTB file name, which is derived +# from the specified source (DTS) file: .dts -> .dtb +# +fdt_dtb_file optional fdt \ + compile-with "if [ -f $S/boot/fdt/dts/${FDT_DTS_FILE} ]; then dtc -O dtb -o `echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 -p 1024 $S/boot/fdt/dts/${FDT_DTS_FILE}; fi" \ + no-obj no-implicit-rule before-depend \ + clean "`echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb" +fdt_static_dtb.h optional fdt fdt_dtb_static \ + compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ." \ + no-obj no-implicit-rule before-depend \ + clean "fdt_static_dtb.h" p16v-alsa%diked.h optional snd_emu10kx pci \ dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h" \ compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h p16v-alsa%diked.h" \ @@ -302,6 +314,12 @@ contrib/ipfilter/netinet/ip_sync.c optio compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" +contrib/libfdt/fdt.c optional fdt +contrib/libfdt/fdt_ro.c optional fdt +contrib/libfdt/fdt_rw.c optional fdt +contrib/libfdt/fdt_strerror.c optional fdt +contrib/libfdt/fdt_sw.c optional fdt +contrib/libfdt/fdt_wip.c optional fdt contrib/ngatm/netnatm/api/cc_conn.c optional ngatm_ccatm \ compile-with "${NORMAL_C_NOWERROR} -I$S/contrib/ngatm" contrib/ngatm/netnatm/api/cc_data.c optional ngatm_ccatm \ @@ -961,6 +979,11 @@ dev/ex/if_ex_pccard.c optional ex pccar dev/exca/exca.c optional cbb dev/fatm/if_fatm.c optional fatm pci dev/fb/splash.c optional splash +dev/fdt/fdt_common.c optional fdt +dev/fdt/fdt_pci.c optional fdt pci +dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static +dev/fdt/fdtbus.c optional fdt +dev/fdt/simplebus.c optional fdt dev/fe/if_fe.c optional fe dev/fe/if_fe_pccard.c optional fe pccard dev/firewire/firewire.c optional firewire @@ -1659,6 +1682,7 @@ dev/txp/if_txp.c optional txp inet dev/uart/uart_bus_acpi.c optional uart acpi #dev/uart/uart_bus_cbus.c optional uart cbus dev/uart/uart_bus_ebus.c optional uart ebus +dev/uart/uart_bus_fdt.c optional uart fdt dev/uart/uart_bus_isa.c optional uart isa dev/uart/uart_bus_pccard.c optional uart pccard dev/uart/uart_bus_pci.c optional uart pci From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 13:08: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 2B35D106564A; Sun, 13 Jun 2010 13:08:24 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AEAE8FC0C; Sun, 13 Jun 2010 13:08: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 o5DD8NOu033566; Sun, 13 Jun 2010 13:08:24 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DD8NTA033564; Sun, 13 Jun 2010 13:08:23 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201006131308.o5DD8NTA033564@svn.freebsd.org> From: Rafal Jaworowski Date: Sun, 13 Jun 2010 13:08: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: r209129 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2010 13:08:25 -0000 Author: raj Date: Sun Jun 13 13:08:23 2010 New Revision: 209129 URL: http://svn.freebsd.org/changeset/base/209129 Log: Improve style. Modified: head/sys/arm/arm/nexus.c Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Sun Jun 13 13:02:43 2010 (r209128) +++ head/sys/arm/arm/nexus.c Sun Jun 13 13:08:23 2010 (r209129) @@ -107,6 +107,7 @@ static devclass_t nexus_devclass; static int nexus_probe(device_t dev) { + device_quiet(dev); /* suppress attach message for neatness */ mem_rman.rm_start = 0; @@ -116,7 +117,7 @@ nexus_probe(device_t dev) if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0u)) panic("nexus_probe mem_rman"); - return (0); + return (BUS_PROBE_DEFAULT); } static int From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 13:12: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 5F6981065674; Sun, 13 Jun 2010 13:12: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 4DC0B8FC0A; Sun, 13 Jun 2010 13:12: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 o5DDCqme034595; Sun, 13 Jun 2010 13:12:52 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DDCqhi034591; Sun, 13 Jun 2010 13:12:52 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201006131312.o5DDCqhi034591@svn.freebsd.org> From: Rafal Jaworowski Date: Sun, 13 Jun 2010 13:12: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: r209130 - in head/sys: arm/include 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: Sun, 13 Jun 2010 13:12:52 -0000 Author: raj Date: Sun Jun 13 13:12:52 2010 New Revision: 209130 URL: http://svn.freebsd.org/changeset/base/209130 Log: Initial FDT infrastructure elements for ARM. Reviewed by: imp Sponsored by: The FreeBSD Foundation Added: head/sys/arm/include/fdt.h (contents, props changed) head/sys/arm/include/ofw_machdep.h (contents, props changed) head/sys/dev/fdt/fdt_arm.c (contents, props changed) Added: head/sys/arm/include/fdt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/fdt.h Sun Jun 13 13:12:52 2010 (r209130) @@ -0,0 +1,68 @@ +/*- + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_FDT_H_ +#define _MACHINE_FDT_H_ + +#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 + +/* + * Bus space tag. XXX endianess info needs to be derived from the blob. + */ +extern bus_space_tag_t fdtbus_bs_tag; + +struct mem_region { + vm_offset_t mr_start; + vm_size_t mr_size; +}; + +int fdt_pci_devmap(phandle_t, struct pmap_devmap *devmap, vm_offset_t, + vm_offset_t); + +#endif /* _MACHINE_FDT_H_ */ Added: head/sys/arm/include/ofw_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/ofw_machdep.h Sun Jun 13 13:12:52 2010 (r209130) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2009 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_OFW_MACHDEP_H_ +#define _MACHINE_OFW_MACHDEP_H_ + +typedef uint32_t cell_t; + +#endif /* _MACHINE_OFW_MACHDEP_H_ */ Added: head/sys/dev/fdt/fdt_arm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/fdt/fdt_arm.c Sun Jun 13 13:12:52 2010 (r209130) @@ -0,0 +1,88 @@ +/*- + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "ofw_bus_if.h" + +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 +}; From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 13:24: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 BD072106566C; Sun, 13 Jun 2010 13:24:18 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 516598FC17; Sun, 13 Jun 2010 13:24:18 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id B428D7E871; Sun, 13 Jun 2010 23:24:16 +1000 (EST) Message-ID: <4C14DBFF.5050305@freebsd.org> Date: Sun, 13 Jun 2010 23:24:15 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Gabor Kovesdan References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C14B0EA.8090500@FreeBSD.org> In-Reply-To: <4C14B0EA.8090500@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209119 - 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, 13 Jun 2010 13:24:18 -0000 On 06/13/10 20:20, Gabor Kovesdan wrote: > >>> >>> +/* >>> + * Utility macros. >>> + */ >>> +#define DPCPU_SUM(n, var, sum) \ >>> +do { \ >>> + (sum) = 0; \ >>> + u_int i; \ >>> + CPU_FOREACH(i) \ >>> + (sum) += (DPCPU_ID_PTR(i, n))->var; \ >>> +} while (0) >> I'd suggest first swapping variable declaration and '(sum) = 0;'. >> Also using 'i' as a counter in macro can easly lead to name collision. >> If you need to do it, I'd suggest '_i' or something. >> Maybe it would be better to make it an inline function rather than macro? > And why using old BSD-stlye u_int? style(9) also suggest using ISO C types. From extern u_int mp_maxid; ... #define CPU_FOREACH(i) \ for ((i) = 0; (i) <= mp_maxid; (i)++) \ if (!CPU_ABSENT((i))) Made sense to keep the types for i and mp_maxid the same. Happy to change if you have a better suggestion. Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 13:28: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 CC37C106566B; Sun, 13 Jun 2010 13:28:53 +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 B8BFF8FC12; Sun, 13 Jun 2010 13:28:53 +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 o5DDSr24038132; Sun, 13 Jun 2010 13:28:53 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DDSrZ6038124; Sun, 13 Jun 2010 13:28:53 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201006131328.o5DDSrZ6038124@svn.freebsd.org> From: Rafal Jaworowski Date: Sun, 13 Jun 2010 13:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209131 - in head/sys: arm/conf arm/include arm/mv arm/mv/discovery arm/mv/kirkwood arm/mv/orion conf dev/mge dev/uart dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2010 13:28:53 -0000 Author: raj Date: Sun Jun 13 13:28:53 2010 New Revision: 209131 URL: http://svn.freebsd.org/changeset/base/209131 Log: Convert Marvell ARM platforms to FDT convention. The following systems are involved: - DB-88F5182 - DB-88F5281 - DB-88F6281 - DB-78100 - SheevaPlug This overhaul covers the following major changes: - All integrated peripherals drivers for Marvell ARM SoC, which are currently in the FreeBSD source tree are reworked and adjusted so they derive config data out of the device tree blob (instead of hard coded / tabelarized values). - Since the common FDT infrastrucutre (fdtbus, simplebus) is used we say good by to obio / mbus drivers and numerous hard-coded config data. Note that world needs to be built WITH_FDT for the affected platforms. Reviewed by: imp Sponsored by: The FreeBSD Foundation. Added: head/sys/dev/usb/controller/ehci_mv.c (contents, props changed) Deleted: head/sys/arm/include/bootinfo.h head/sys/arm/mv/discovery/db78xxx.c head/sys/arm/mv/kirkwood/db88f6xxx.c head/sys/arm/mv/kirkwood/files.db88f6xxx head/sys/arm/mv/obio.c head/sys/dev/uart/uart_bus_mbus.c head/sys/dev/uart/uart_cpu_mv.c head/sys/dev/usb/controller/ehci_mbus.c Modified: head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/SHEEVAPLUG head/sys/arm/include/metadata.h head/sys/arm/mv/bus_space.c head/sys/arm/mv/common.c head/sys/arm/mv/discovery/discovery.c head/sys/arm/mv/discovery/files.db78xxx head/sys/arm/mv/files.mv head/sys/arm/mv/gpio.c head/sys/arm/mv/ic.c head/sys/arm/mv/kirkwood/kirkwood.c head/sys/arm/mv/kirkwood/sheevaplug.c 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/mv_pci.c head/sys/arm/mv/mv_sata.c head/sys/arm/mv/mvreg.h head/sys/arm/mv/mvvar.h head/sys/arm/mv/mvwin.h head/sys/arm/mv/orion/db88f5xxx.c head/sys/arm/mv/orion/orion.c head/sys/arm/mv/rtc.c head/sys/arm/mv/timer.c head/sys/arm/mv/twsi.c head/sys/conf/Makefile.arm head/sys/conf/files.arm head/sys/conf/options.arm head/sys/dev/mge/if_mge.c head/sys/dev/mge/if_mgevar.h Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Sun Jun 13 13:12:52 2010 (r209130) +++ head/sys/arm/conf/DB-78XXX Sun Jun 13 13:28:53 2010 (r209131) @@ -83,3 +83,7 @@ device ds133x # SATA device ata device atadisk + +# Flattened Device Tree +options FDT +makeoptions FDT_DTS_FILE=db78100.dts Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Sun Jun 13 13:12:52 2010 (r209130) +++ head/sys/arm/conf/DB-88F5XXX Sun Jun 13 13:28:53 2010 (r209131) @@ -85,3 +85,7 @@ device da # SATA device ata device atadisk + +# Flattened Device Tree +options FDT +makeoptions FDT_DTS_FILE=db88f5281.dts Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Sun Jun 13 13:12:52 2010 (r209130) +++ head/sys/arm/conf/DB-88F6XXX Sun Jun 13 13:28:53 2010 (r209131) @@ -82,3 +82,7 @@ device iicbus # SATA device ata device atadisk + +# Flattened Device Tree +options FDT +makeoptions FDT_DTS_FILE=db88f6281.dts Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Sun Jun 13 13:12:52 2010 (r209130) +++ head/sys/arm/conf/SHEEVAPLUG Sun Jun 13 13:28:53 2010 (r209131) @@ -69,3 +69,7 @@ device scbus device pass device da +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=sheevaplug.dts Modified: head/sys/arm/include/metadata.h ============================================================================== --- head/sys/arm/include/metadata.h Sun Jun 13 13:12:52 2010 (r209130) +++ head/sys/arm/include/metadata.h Sun Jun 13 13:28:53 2010 (r209131) @@ -29,7 +29,6 @@ #ifndef _MACHINE_METADATA_H_ #define _MACHINE_METADATA_H_ -#define MODINFOMD_BOOTINFO 0x1001 -#define MODINFOMD_DTBP 0x1002 +#define MODINFOMD_DTBP 0x1001 #endif /* !_MACHINE_METADATA_H_ */ Modified: head/sys/arm/mv/bus_space.c ============================================================================== --- head/sys/arm/mv/bus_space.c Sun Jun 13 13:12:52 2010 (r209130) +++ head/sys/arm/mv/bus_space.c Sun Jun 13 13:28:53 2010 (r209131) @@ -49,7 +49,7 @@ bs_protos(generic); bs_protos(generic_armv4); /* - * The obio bus space tag. This is constant for all instances, so + * The bus space tag. This is constant for all instances, so * we never have to explicitly "create" it. */ static struct bus_space _base_tag = { @@ -159,4 +159,4 @@ static struct bus_space _base_tag = { NULL }; -bus_space_tag_t obio_tag = &_base_tag; +bus_space_tag_t fdtbus_bs_tag = &_base_tag; Modified: head/sys/arm/mv/common.c ============================================================================== --- head/sys/arm/mv/common.c Sun Jun 13 13:12:52 2010 (r209130) +++ head/sys/arm/mv/common.c Sun Jun 13 13:28:53 2010 (r209131) @@ -37,12 +37,34 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include +#include #include #include #include +#define MAX_CPU_WIN 5 + +#define DEBUG +#undef DEBUG + +#ifdef DEBUG +#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ + printf(fmt,##args); } while (0) +#else +#define debugf(fmt, args...) +#endif + +#ifdef DEBUG +#define MV_DUMP_WIN 1 +#else +#define MV_DUMP_WIN 0 +#endif + static int win_eth_can_remap(int i); static int decode_win_cpu_valid(void); @@ -51,18 +73,71 @@ static int decode_win_eth_valid(void); static int decode_win_pcie_valid(void); static int decode_win_sata_valid(void); static int decode_win_cesa_valid(void); +static int decode_win_idma_valid(void); +static int decode_win_xor_valid(void); static void decode_win_cpu_setup(void); -static void decode_win_usb_setup(void); -static void decode_win_eth_setup(uint32_t base); -static void decode_win_pcie_setup(uint32_t base); -static void decode_win_sata_setup(void); -static void decode_win_cesa_setup(void); +static void decode_win_usb_setup(u_long); +static void decode_win_eth_setup(u_long); +static void decode_win_pcie_setup(u_long); +static void decode_win_sata_setup(u_long); +static void decode_win_cesa_setup(u_long); +static void decode_win_idma_setup(u_long); +static void decode_win_xor_setup(u_long); + +static void decode_win_cesa_dump(u_long); +static void decode_win_usb_dump(u_long); +static void decode_win_eth_dump(u_long base); +static void decode_win_idma_dump(u_long base); +static void decode_win_xor_dump(u_long base); -static void decode_win_cesa_dump(void); -static void decode_win_usb_dump(void); +static int fdt_get_ranges(const char *, void *, int, int *, int *); + +static int win_cpu_from_dt(void); +static int fdt_win_setup(void); static uint32_t used_cpu_wins; +static uint32_t dev_mask = 0; +static int cpu_wins_no = 0; +static int eth_port = 0; +static int usb_port = 0; + +static struct decode_win cpu_win_tbl[MAX_CPU_WIN]; + +static const struct decode_win *cpu_wins = cpu_win_tbl; + +typedef void (*decode_win_setup_t)(u_long); +typedef void (*dump_win_t)(u_long); + +struct soc_node_spec { + const char *compat; + decode_win_setup_t decode_handler; + dump_win_t dump_handler; +}; + +static struct soc_node_spec soc_nodes[] = { + { "mrvl,cesa", &decode_win_cesa_setup, &decode_win_cesa_dump }, + { "mrvl,ge", &decode_win_eth_setup, &decode_win_eth_dump }, + { "mrvl,usb-ehci", &decode_win_usb_setup, &decode_win_usb_dump }, + { "mrvl,sata", &decode_win_sata_setup, NULL }, + { "mrvl,xor", &decode_win_xor_setup, &decode_win_xor_dump }, + { "mrvl,idma", &decode_win_idma_setup, &decode_win_idma_dump }, + { "mvrl,pcie", &decode_win_pcie_setup, NULL }, + { NULL, NULL, NULL }, +}; + +struct fdt_pm_mask_entry fdt_pm_mask_table[] = { + { "mrvl,ge", CPU_PM_CTRL_GE(0) }, + { "mrvl,ge", CPU_PM_CTRL_GE(1) }, + { "mrvl,usb-ehci", CPU_PM_CTRL_USB(0) }, + { "mrvl,usb-ehci", CPU_PM_CTRL_USB(1) }, + { "mrvl,usb-ehci", CPU_PM_CTRL_USB(2) }, + { "mrvl,cesa", CPU_PM_CTRL_CRYPTO }, + { "mrvl,xor", CPU_PM_CTRL_XOR }, + { "mrvl,sata", CPU_PM_CTRL_SATA }, + + { NULL, 0 } +}; static __inline int pm_is_disabled(uint32_t mask) @@ -71,18 +146,6 @@ pm_is_disabled(uint32_t mask) return (soc_power_ctrl_get(mask) == mask ? 0 : 1); } -static __inline uint32_t -obio_get_pm_mask(uint32_t base) -{ - struct obio_device *od; - - for (od = obio_devices; od->od_name != NULL; od++) - if (od->od_base == base) - return (od->od_pwr_mask); - - return (CPU_PM_CTRL_NONE); -} - /* * Disable device using power management register. * 1 - Device Power On @@ -134,18 +197,45 @@ pm_disable_device(int mask) #endif } +int +fdt_pm(phandle_t node) +{ + uint32_t cpu_pm_ctrl; + int i, ena, compat; + + ena = 1; + cpu_pm_ctrl = read_cpu_ctrl(CPU_PM_CTRL); + for (i = 0; fdt_pm_mask_table[i].compat != NULL; i++) { + if (dev_mask & (1 << i)) + continue; + + compat = fdt_is_compatible(node, fdt_pm_mask_table[i].compat); + + if (compat && (~cpu_pm_ctrl & fdt_pm_mask_table[i].mask)) { + dev_mask |= (1 << i); + ena = 0; + break; + } else if (compat) { + dev_mask |= (1 << i); + break; + } + } + + return (ena); +} + uint32_t read_cpu_ctrl(uint32_t reg) { - return (bus_space_read_4(obio_tag, MV_CPU_CONTROL_BASE, reg)); + return (bus_space_read_4(fdtbus_bs_tag, MV_CPU_CONTROL_BASE, reg)); } void write_cpu_ctrl(uint32_t reg, uint32_t val) { - bus_space_write_4(obio_tag, MV_CPU_CONTROL_BASE, reg, val); + bus_space_write_4(fdtbus_bs_tag, MV_CPU_CONTROL_BASE, reg, val); } void @@ -217,11 +307,11 @@ soc_id(uint32_t *dev, uint32_t *rev) * possible) after the internal registers range has been mapped in via * pmap_devmap_bootstrap(). */ - *dev = bus_space_read_4(obio_tag, MV_PCIE_BASE, 0) >> 16; - *rev = bus_space_read_4(obio_tag, MV_PCIE_BASE, 8) & 0xff; + *dev = bus_space_read_4(fdtbus_bs_tag, MV_PCIE_BASE, 0) >> 16; + *rev = bus_space_read_4(fdtbus_bs_tag, MV_PCIE_BASE, 8) & 0xff; } -void +static void soc_identify(void) { uint32_t d, r; @@ -283,11 +373,25 @@ soc_identify(void) /* TODO add info on currently set endianess */ } +static void +platform_identify(void *dummy) +{ + + soc_identify(); + + /* + * XXX Board identification e.g. read out from FPGA or similar should + * go here + */ +} +SYSINIT(platform_identify, SI_SUB_CPU, SI_ORDER_SECOND, platform_identify, + NULL); + int soc_decode_win(void) { uint32_t dev, rev; - int mask; + int mask, err; mask = 0; TUNABLE_INT_FETCH("hw.pm-disable-mask", &mask); @@ -295,41 +399,27 @@ soc_decode_win(void) if (mask != 0) pm_disable_device(mask); + /* Retrieve data about physical addresses from device tree. */ + if ((err = win_cpu_from_dt()) != 0) + return (err); + /* Retrieve our ID: some windows facilities vary between SoC models */ soc_id(&dev, &rev); - if (decode_win_cpu_valid() != 1 || decode_win_usb_valid() != 1 || - decode_win_eth_valid() != 1 || decode_win_idma_valid() != 1 || - decode_win_pcie_valid() != 1 || decode_win_sata_valid() != 1 || - decode_win_cesa_valid() != 1) - return(-1); + if (!decode_win_cpu_valid() || !decode_win_usb_valid() || + !decode_win_eth_valid() || !decode_win_idma_valid() || + !decode_win_pcie_valid() || !decode_win_sata_valid() || + !decode_win_cesa_valid() || !decode_win_xor_valid()) + return (EINVAL); decode_win_cpu_setup(); - decode_win_usb_setup(); - decode_win_eth_setup(MV_ETH0_BASE); - if (dev == MV_DEV_MV78100 || dev == MV_DEV_MV78100_Z0) - decode_win_eth_setup(MV_ETH1_BASE); - if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100 || - dev == MV_DEV_MV78100_Z0) - decode_win_cesa_setup(); - - decode_win_idma_setup(); - decode_win_xor_setup(); - - if (dev == MV_DEV_MV78100 || dev == MV_DEV_MV78100_Z0) { - decode_win_pcie_setup(MV_PCIE00_BASE); - decode_win_pcie_setup(MV_PCIE01_BASE); - decode_win_pcie_setup(MV_PCIE02_BASE); - decode_win_pcie_setup(MV_PCIE03_BASE); - decode_win_pcie_setup(MV_PCIE10_BASE); - decode_win_pcie_setup(MV_PCIE11_BASE); - decode_win_pcie_setup(MV_PCIE12_BASE); - decode_win_pcie_setup(MV_PCIE13_BASE); - } else - decode_win_pcie_setup(MV_PCIE_BASE); + if (MV_DUMP_WIN) + soc_dump_decode_win(); - if (dev != MV_DEV_88F5281) - decode_win_sata_setup(); + eth_port = 0; + usb_port = 0; + if ((err = fdt_win_setup()) != 0) + return (err); return (0); } @@ -349,15 +439,15 @@ WIN_REG_IDX_WR(win_cpu, remap_h, MV_WIN_ WIN_REG_IDX_RD(ddr, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE) WIN_REG_IDX_RD(ddr, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE) -WIN_REG_IDX_RD2(win_usb, cr, MV_WIN_USB_CTRL, MV_USB_AWR_BASE) -WIN_REG_IDX_RD2(win_usb, br, MV_WIN_USB_BASE, MV_USB_AWR_BASE) -WIN_REG_IDX_WR2(win_usb, cr, MV_WIN_USB_CTRL, MV_USB_AWR_BASE) -WIN_REG_IDX_WR2(win_usb, br, MV_WIN_USB_BASE, MV_USB_AWR_BASE) - -WIN_REG_IDX_RD(win_cesa, cr, MV_WIN_CESA_CTRL, MV_CESA_BASE) -WIN_REG_IDX_RD(win_cesa, br, MV_WIN_CESA_BASE, MV_CESA_BASE) -WIN_REG_IDX_WR(win_cesa, cr, MV_WIN_CESA_CTRL, MV_CESA_BASE) -WIN_REG_IDX_WR(win_cesa, br, MV_WIN_CESA_BASE, MV_CESA_BASE) +WIN_REG_BASE_IDX_RD(win_usb, cr, MV_WIN_USB_CTRL) +WIN_REG_BASE_IDX_RD(win_usb, br, MV_WIN_USB_BASE) +WIN_REG_BASE_IDX_WR(win_usb, cr, MV_WIN_USB_CTRL) +WIN_REG_BASE_IDX_WR(win_usb, br, MV_WIN_USB_BASE) + +WIN_REG_BASE_IDX_RD(win_cesa, cr, MV_WIN_CESA_CTRL) +WIN_REG_BASE_IDX_RD(win_cesa, br, MV_WIN_CESA_BASE) +WIN_REG_BASE_IDX_WR(win_cesa, cr, MV_WIN_CESA_CTRL) +WIN_REG_BASE_IDX_WR(win_cesa, br, MV_WIN_CESA_BASE) WIN_REG_BASE_IDX_RD(win_eth, br, MV_WIN_ETH_BASE) WIN_REG_BASE_IDX_RD(win_eth, sz, MV_WIN_ETH_SIZE) @@ -366,14 +456,14 @@ WIN_REG_BASE_IDX_WR(win_eth, br, MV_WIN_ WIN_REG_BASE_IDX_WR(win_eth, sz, MV_WIN_ETH_SIZE) WIN_REG_BASE_IDX_WR(win_eth, har, MV_WIN_ETH_REMAP) -WIN_REG_IDX_RD2(win_xor, br, MV_WIN_XOR_BASE, MV_XOR_BASE) -WIN_REG_IDX_RD2(win_xor, sz, MV_WIN_XOR_SIZE, MV_XOR_BASE) -WIN_REG_IDX_RD2(win_xor, har, MV_WIN_XOR_REMAP, MV_XOR_BASE) -WIN_REG_IDX_RD2(win_xor, ctrl, MV_WIN_XOR_CTRL, MV_XOR_BASE) -WIN_REG_IDX_WR2(win_xor, br, MV_WIN_XOR_BASE, MV_XOR_BASE) -WIN_REG_IDX_WR2(win_xor, sz, MV_WIN_XOR_SIZE, MV_XOR_BASE) -WIN_REG_IDX_WR2(win_xor, har, MV_WIN_XOR_REMAP, MV_XOR_BASE) -WIN_REG_IDX_WR2(win_xor, ctrl, MV_WIN_XOR_CTRL, MV_XOR_BASE) +WIN_REG_BASE_IDX_RD2(win_xor, br, MV_WIN_XOR_BASE) +WIN_REG_BASE_IDX_RD2(win_xor, sz, MV_WIN_XOR_SIZE) +WIN_REG_BASE_IDX_RD2(win_xor, har, MV_WIN_XOR_REMAP) +WIN_REG_BASE_IDX_RD2(win_xor, ctrl, MV_WIN_XOR_CTRL) +WIN_REG_BASE_IDX_WR2(win_xor, br, MV_WIN_XOR_BASE) +WIN_REG_BASE_IDX_WR2(win_xor, sz, MV_WIN_XOR_SIZE) +WIN_REG_BASE_IDX_WR2(win_xor, har, MV_WIN_XOR_REMAP) +WIN_REG_BASE_IDX_WR2(win_xor, ctrl, MV_WIN_XOR_CTRL) WIN_REG_BASE_RD(win_eth, bare, 0x290) WIN_REG_BASE_RD(win_eth, epap, 0x294) @@ -388,21 +478,21 @@ WIN_REG_BASE_IDX_WR(win_pcie, br, MV_WIN WIN_REG_BASE_IDX_WR(win_pcie, remap, MV_WIN_PCIE_REMAP); WIN_REG_BASE_IDX_WR(pcie, bar, MV_PCIE_BAR); -WIN_REG_IDX_RD(win_idma, br, MV_WIN_IDMA_BASE, MV_IDMA_BASE) -WIN_REG_IDX_RD(win_idma, sz, MV_WIN_IDMA_SIZE, MV_IDMA_BASE) -WIN_REG_IDX_RD(win_idma, har, MV_WIN_IDMA_REMAP, MV_IDMA_BASE) -WIN_REG_IDX_RD(win_idma, cap, MV_WIN_IDMA_CAP, MV_IDMA_BASE) -WIN_REG_IDX_WR(win_idma, br, MV_WIN_IDMA_BASE, MV_IDMA_BASE) -WIN_REG_IDX_WR(win_idma, sz, MV_WIN_IDMA_SIZE, MV_IDMA_BASE) -WIN_REG_IDX_WR(win_idma, har, MV_WIN_IDMA_REMAP, MV_IDMA_BASE) -WIN_REG_IDX_WR(win_idma, cap, MV_WIN_IDMA_CAP, MV_IDMA_BASE) -WIN_REG_RD(win_idma, bare, 0xa80, MV_IDMA_BASE) -WIN_REG_WR(win_idma, bare, 0xa80, MV_IDMA_BASE) - -WIN_REG_IDX_RD(win_sata, cr, MV_WIN_SATA_CTRL, MV_SATAHC_BASE); -WIN_REG_IDX_RD(win_sata, br, MV_WIN_SATA_BASE, MV_SATAHC_BASE); -WIN_REG_IDX_WR(win_sata, cr, MV_WIN_SATA_CTRL, MV_SATAHC_BASE); -WIN_REG_IDX_WR(win_sata, br, MV_WIN_SATA_BASE, MV_SATAHC_BASE); +WIN_REG_BASE_IDX_RD(win_idma, br, MV_WIN_IDMA_BASE) +WIN_REG_BASE_IDX_RD(win_idma, sz, MV_WIN_IDMA_SIZE) +WIN_REG_BASE_IDX_RD(win_idma, har, MV_WIN_IDMA_REMAP) +WIN_REG_BASE_IDX_RD(win_idma, cap, MV_WIN_IDMA_CAP) +WIN_REG_BASE_IDX_WR(win_idma, br, MV_WIN_IDMA_BASE) +WIN_REG_BASE_IDX_WR(win_idma, sz, MV_WIN_IDMA_SIZE) +WIN_REG_BASE_IDX_WR(win_idma, har, MV_WIN_IDMA_REMAP) +WIN_REG_BASE_IDX_WR(win_idma, cap, MV_WIN_IDMA_CAP) +WIN_REG_BASE_RD(win_idma, bare, 0xa80) +WIN_REG_BASE_WR(win_idma, bare, 0xa80) + +WIN_REG_BASE_IDX_RD(win_sata, cr, MV_WIN_SATA_CTRL); +WIN_REG_BASE_IDX_RD(win_sata, br, MV_WIN_SATA_BASE); +WIN_REG_BASE_IDX_WR(win_sata, cr, MV_WIN_SATA_CTRL); +WIN_REG_BASE_IDX_WR(win_sata, br, MV_WIN_SATA_BASE); /************************************************************************** * Decode windows helper routines @@ -428,31 +518,11 @@ soc_dump_decode_win(void) printf("\n"); } printf("Internal regs base: 0x%08x\n", - bus_space_read_4(obio_tag, MV_INTREGS_BASE, 0)); + bus_space_read_4(fdtbus_bs_tag, MV_INTREGS_BASE, 0)); for (i = 0; i < MV_WIN_DDR_MAX; i++) printf("DDR CS#%d: b 0x%08x, s 0x%08x\n", i, ddr_br_read(i), ddr_sz_read(i)); - - for (i = 0; i < MV_WIN_ETH_MAX; i++) { - printf("ETH window#%d: b 0x%08x, s 0x%08x", i, - win_eth_br_read(MV_ETH0_BASE, i), - win_eth_sz_read(MV_ETH0_BASE, i)); - - if (win_eth_can_remap(i)) - printf(", ha 0x%08x", - win_eth_har_read(MV_ETH0_BASE, i)); - - printf("\n"); - } - printf("ETH windows: bare 0x%08x, epap 0x%08x\n", - win_eth_bare_read(MV_ETH0_BASE), - win_eth_epap_read(MV_ETH0_BASE)); - - decode_win_idma_dump(); - decode_win_cesa_dump(); - decode_win_usb_dump(); - printf("\n"); } /************************************************************************** @@ -511,7 +581,7 @@ decode_win_cpu_valid(void) if (cpu_wins_no > MV_WIN_CPU_MAX) { printf("CPU windows: too many entries: %d\n", cpu_wins_no); - return (-1); + return (0); } rv = 1; @@ -564,7 +634,7 @@ decode_win_cpu_set(int target, int attr, int win; if (used_cpu_wins >= MV_WIN_CPU_MAX) - return (-1); + return (0); win = used_cpu_wins++; @@ -694,70 +764,59 @@ decode_win_usb_valid(void) return (decode_win_can_cover_ddr(MV_WIN_USB_MAX)); } -static __inline int -usb_max_ports(void) -{ - uint32_t dev, rev; - - soc_id(&dev, &rev); - return ((dev == MV_DEV_MV78100 || dev == MV_DEV_MV78100_Z0) ? 3 : 1); -} - static void -decode_win_usb_dump(void) +decode_win_usb_dump(u_long base) { - int i, p, m; + int i; - m = usb_max_ports(); - for (p = 0; p < m; p++) - for (i = 0; i < MV_WIN_USB_MAX; i++) - printf("USB window#%d: c 0x%08x, b 0x%08x\n", i, - win_usb_cr_read(i, p), win_usb_br_read(i, p)); + if (pm_is_disabled(CPU_PM_CTRL_USB(usb_port - 1))) + return; + + for (i = 0; i < MV_WIN_USB_MAX; i++) + printf("USB window#%d: c 0x%08x, b 0x%08x\n", i, + win_usb_cr_read(base, i), win_usb_br_read(base, i)); } /* * Set USB decode windows. */ static void -decode_win_usb_setup(void) +decode_win_usb_setup(u_long base) { uint32_t br, cr; - int i, j, p, m; + int i, j; - /* Disable and clear all USB windows for all ports */ - m = usb_max_ports(); - for (p = 0; p < m; p++) { + if (pm_is_disabled(CPU_PM_CTRL_USB(usb_port))) + return; - if (pm_is_disabled(CPU_PM_CTRL_USB(p))) - continue; + usb_port++; - for (i = 0; i < MV_WIN_USB_MAX; i++) { - win_usb_cr_write(i, p, 0); - win_usb_br_write(i, p, 0); - } - - /* Only access to active DRAM banks is required */ - for (i = 0; i < MV_WIN_DDR_MAX; i++) { - if (ddr_is_active(i)) { - br = ddr_base(i); - /* - * XXX for 6281 we should handle Mbus write - * burst limit field in the ctrl reg - */ - cr = (((ddr_size(i) - 1) & 0xffff0000) | - (ddr_attr(i) << 8) | - (ddr_target(i) << 4) | 1); - - /* Set the first free USB window */ - for (j = 0; j < MV_WIN_USB_MAX; j++) { - if (win_usb_cr_read(j, p) & 0x1) - continue; + for (i = 0; i < MV_WIN_USB_MAX; i++) { + win_usb_cr_write(base, i, 0); + win_usb_br_write(base, i, 0); + } - win_usb_br_write(j, p, br); - win_usb_cr_write(j, p, cr); - break; - } + /* Only access to active DRAM banks is required */ + for (i = 0; i < MV_WIN_DDR_MAX; i++) { + if (ddr_is_active(i)) { + br = ddr_base(i); + /* + * XXX for 6281 we should handle Mbus write + * burst limit field in the ctrl reg + */ + cr = (((ddr_size(i) - 1) & 0xffff0000) | + (ddr_attr(i) << 8) | + (ddr_target(i) << 4) | 1); + + /* Set the first free USB window */ + for (j = 0; j < MV_WIN_USB_MAX; j++) { + if (win_usb_cr_read(base, j) & 0x1) + continue; + + win_usb_br_write(base, j, br); + win_usb_cr_write(base, j, cr); + break; } } } @@ -812,14 +871,40 @@ eth_epap_write(uint32_t base, int i, int } static void -decode_win_eth_setup(uint32_t base) +decode_win_eth_dump(u_long base) +{ + int i; + + if (pm_is_disabled(CPU_PM_CTRL_GE(eth_port - 1))) + return; + + for (i = 0; i < MV_WIN_ETH_MAX; i++) { + printf("ETH window#%d: b 0x%08x, s 0x%08x", i, + win_eth_br_read(base, i), + win_eth_sz_read(base, i)); + + if (win_eth_can_remap(i)) + printf(", ha 0x%08x", + win_eth_har_read(base, i)); + + printf("\n"); + } + printf("ETH windows: bare 0x%08x, epap 0x%08x\n", + win_eth_bare_read(base), + win_eth_epap_read(base)); +} + +static void +decode_win_eth_setup(u_long base) { uint32_t br, sz; int i, j; - if (pm_is_disabled(obio_get_pm_mask(base))) + if (pm_is_disabled(CPU_PM_CTRL_GE(eth_port))) return; + eth_port++; + /* Disable, clear and revoke protection for all ETH windows */ for (i = 0; i < MV_WIN_ETH_MAX; i++) { @@ -870,7 +955,7 @@ decode_win_eth_valid(void) **************************************************************************/ static void -decode_win_pcie_setup(uint32_t base) +decode_win_pcie_setup(u_long base) { uint32_t size = 0; uint32_t cr, br; @@ -926,51 +1011,51 @@ decode_win_pcie_valid(void) **************************************************************************/ #if defined(SOC_MV_ORION) || defined(SOC_MV_DISCOVERY) static int -idma_bare_read(int i) +idma_bare_read(u_long base, int i) { uint32_t v; - v = win_idma_bare_read(); + v = win_idma_bare_read(base); v &= (1 << i); return (v >> i); } static void -idma_bare_write(int i, int val) +idma_bare_write(u_long base, int i, int val) { uint32_t v; - v = win_idma_bare_read(); + v = win_idma_bare_read(base); v &= ~(1 << i); v |= (val << i); - win_idma_bare_write(v); + win_idma_bare_write(base, v); } /* * Sets channel protection 'val' for window 'w' on channel 'c' */ static void -idma_cap_write(int c, int w, int val) +idma_cap_write(u_long base, int c, int w, int val) { uint32_t v; - v = win_idma_cap_read(c); + v = win_idma_cap_read(base, c); v &= ~(0x3 << (w * 2)); v |= (val << (w * 2)); - win_idma_cap_write(c, v); + win_idma_cap_write(base, c, v); } /* * Set protection 'val' on all channels for window 'w' */ static void -idma_set_prot(int w, int val) +idma_set_prot(u_long base, int w, int val) { int c; for (c = 0; c < MV_IDMA_CHAN_MAX; c++) - idma_cap_write(c, w, val); + idma_cap_write(base, c, w, val); } static int @@ -985,7 +1070,7 @@ win_idma_can_remap(int i) } void -decode_win_idma_setup(void) +decode_win_idma_setup(u_long base) { uint32_t br, sz; int i, j; @@ -997,14 +1082,14 @@ decode_win_idma_setup(void) */ for (i = 0; i < MV_WIN_IDMA_MAX; i++) { - idma_bare_write(i, 1); - win_idma_br_write(i, 0); - win_idma_sz_write(i, 0); + idma_bare_write(base, i, 1); + win_idma_br_write(base, i, 0); + win_idma_sz_write(base, i, 0); if (win_idma_can_remap(i) == 1) - win_idma_har_write(i, 0); + win_idma_har_write(base, i, 0); } for (i = 0; i < MV_IDMA_CHAN_MAX; i++) - win_idma_cap_write(i, 0); + win_idma_cap_write(base, i, 0); /* * Set up access to all active DRAM banks @@ -1017,17 +1102,17 @@ decode_win_idma_setup(void) /* Place DDR entries in non-remapped windows */ for (j = 0; j < MV_WIN_IDMA_MAX; j++) if (win_idma_can_remap(j) != 1 && - idma_bare_read(j) == 1) { + idma_bare_read(base, j) == 1) { /* Configure window */ - win_idma_br_write(j, br); - win_idma_sz_write(j, sz); + win_idma_br_write(base, j, br); + win_idma_sz_write(base, j, sz); /* Set protection RW on all channels */ - idma_set_prot(j, 0x3); + idma_set_prot(base, j, 0x3); /* Enable window */ - idma_bare_write(j, 0); + idma_bare_write(base, j, 0); break; } } @@ -1043,21 +1128,22 @@ decode_win_idma_setup(void) /* Set the first free IDMA window */ for (j = 0; j < MV_WIN_IDMA_MAX; j++) { - if (idma_bare_read(j) == 0) + if (idma_bare_read(base, j) == 0) continue; /* Configure window */ - win_idma_br_write(j, br); - win_idma_sz_write(j, sz); + win_idma_br_write(base, j, br); + win_idma_sz_write(base, j, sz); if (win_idma_can_remap(j) && idma_wins[j].remap >= 0) - win_idma_har_write(j, idma_wins[j].remap); + win_idma_har_write(base, j, + idma_wins[j].remap); /* Set protection RW on all channels */ - idma_set_prot(j, 0x3); + idma_set_prot(base, j, 0x3); /* Enable window */ - idma_bare_write(j, 0); + idma_bare_write(base, j, 0); break; } } @@ -1072,7 +1158,7 @@ decode_win_idma_valid(void) if (idma_wins_no > MV_WIN_IDMA_MAX) { printf("IDMA windows: too many entries: %d\n", idma_wins_no); - return (-1); + return (0); } for (i = 0, c = 0; i < MV_WIN_DDR_MAX; i++) if (ddr_is_active(i)) @@ -1081,7 +1167,7 @@ decode_win_idma_valid(void) if (idma_wins_no > (MV_WIN_IDMA_MAX - c)) { printf("IDMA windows: too many entries: %d, available: %d\n", idma_wins_no, MV_WIN_IDMA_MAX - c); - return (-1); + return (0); } wintab = idma_wins; @@ -1126,23 +1212,26 @@ decode_win_idma_valid(void) } void -decode_win_idma_dump(void) +decode_win_idma_dump(u_long base) { int i; + if (pm_is_disabled(CPU_PM_CTRL_IDMA)) + return; + for (i = 0; i < MV_WIN_IDMA_MAX; i++) { printf("IDMA window#%d: b 0x%08x, s 0x%08x", i, - win_idma_br_read(i), win_idma_sz_read(i)); + win_idma_br_read(base, i), win_idma_sz_read(base, i)); if (win_idma_can_remap(i)) - printf(", ha 0x%08x", win_idma_har_read(i)); + printf(", ha 0x%08x", win_idma_har_read(base, i)); printf("\n"); } for (i = 0; i < MV_IDMA_CHAN_MAX; i++) printf("IDMA channel#%d: ap 0x%08x\n", i, - win_idma_cap_read(i)); - printf("IDMA windows: bare 0x%08x\n", win_idma_bare_read()); + win_idma_cap_read(base, i)); + printf("IDMA windows: bare 0x%08x\n", win_idma_bare_read(base)); } #else @@ -1155,12 +1244,12 @@ decode_win_idma_valid(void) } void -decode_win_idma_setup(void) +decode_win_idma_setup(u_long base) { } void -decode_win_idma_dump(void) +decode_win_idma_dump(u_long base) { } #endif @@ -1170,24 +1259,24 @@ decode_win_idma_dump(void) **************************************************************************/ #if defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) static int -xor_ctrl_read(int i, int c, int e) +xor_ctrl_read(u_long base, int i, int c, int e) { uint32_t v; - v = win_xor_ctrl_read(c, e); + v = win_xor_ctrl_read(base, c, e); v &= (1 << i); return (v >> i); } static void -xor_ctrl_write(int i, int c, int e, int val) +xor_ctrl_write(u_long base, int i, int c, int e, int val) { uint32_t v; - v = win_xor_ctrl_read(c, e); + v = win_xor_ctrl_read(base, c, e); v &= ~(1 << i); v |= (val << i); - win_xor_ctrl_write(c, e, v); + win_xor_ctrl_write(base, c, e, v); } /* @@ -1195,26 +1284,26 @@ xor_ctrl_write(int i, int c, int e, int */ static void -xor_chan_write(int c, int e, int w, int val) +xor_chan_write(u_long base, int c, int e, int w, int val) { uint32_t v; - v = win_xor_ctrl_read(c, e); + v = win_xor_ctrl_read(base, c, e); v &= ~(0x3 << (w * 2 + 16)); v |= (val << (w * 2 + 16)); - win_xor_ctrl_write(c, e, v); + win_xor_ctrl_write(base, c, e, v); } /* * Set protection 'val' on all channels for window 'w' on engine 'e' */ static void -xor_set_prot(int w, int e, int val) +xor_set_prot(u_long base, int w, int e, int val) { int c; for (c = 0; c < MV_XOR_CHAN_MAX; c++) - xor_chan_write(c, e, w, val); + xor_chan_write(base, c, e, w, val); } static int @@ -1243,7 +1332,7 @@ xor_max_eng(void) } static void -xor_active_dram(int c, int e, int *window) +xor_active_dram(u_long base, int c, int e, int *window) { uint32_t br, sz; int i, m, w; @@ -1261,17 +1350,17 @@ xor_active_dram(int c, int e, int *windo /* Place DDR entries in non-remapped windows */ for (w = 0; w < MV_WIN_XOR_MAX; w++) if (win_xor_can_remap(w) != 1 && - (xor_ctrl_read(w, c, e) == 0) && + (xor_ctrl_read(base, w, c, e) == 0) && w > *window) { /* Configure window */ - win_xor_br_write(w, e, br); - win_xor_sz_write(w, e, sz); + win_xor_br_write(base, w, e, br); + win_xor_sz_write(base, w, e, sz); /* Set protection RW on all channels */ - xor_set_prot(w, e, 0x3); + xor_set_prot(base, w, e, 0x3); /* Enable window */ - xor_ctrl_write(w, c, e, 1); + xor_ctrl_write(base, w, c, e, 1); (*window)++; break; } @@ -1279,7 +1368,7 @@ xor_active_dram(int c, int e, int *windo } void -decode_win_xor_setup(void) +decode_win_xor_setup(u_long base) { uint32_t br, sz; int i, j, z, e = 1, m, window; @@ -1298,16 +1387,16 @@ decode_win_xor_setup(void) window = MV_XOR_NON_REMAP - 1; for (i = 0; i < MV_WIN_XOR_MAX; i++) { - win_xor_br_write(i, e, 0); - win_xor_sz_write(i, e, 0); + win_xor_br_write(base, i, e, 0); + win_xor_sz_write(base, i, e, 0); } if (win_xor_can_remap(i) == 1) - win_xor_har_write(i, e, 0); + win_xor_har_write(base, i, e, 0); for (i = 0; i < MV_XOR_CHAN_MAX; i++) { - win_xor_ctrl_write(i, e, 0); - xor_active_dram(i, e, &window); + win_xor_ctrl_write(base, i, e, 0); + xor_active_dram(base, i, e, &window); } /* @@ -1322,24 +1411,24 @@ decode_win_xor_setup(void) /* Set the first free XOR window */ for (z = 0; z < MV_WIN_XOR_MAX; z++) { - if (xor_ctrl_read(z, 0, e) && - xor_ctrl_read(z, 1, e)) + if (xor_ctrl_read(base, z, 0, e) && + xor_ctrl_read(base, z, 1, e)) continue; /* Configure window */ - win_xor_br_write(z, e, br); - win_xor_sz_write(z, e, sz); + win_xor_br_write(base, z, e, br); + win_xor_sz_write(base, z, e, sz); if (win_xor_can_remap(z) && xor_wins[z].remap >= 0) - win_xor_har_write(z, e, + win_xor_har_write(base, z, e, xor_wins[z].remap); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 13:30: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 575BE1065677; Sun, 13 Jun 2010 13:30:26 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 473828FC1A; Sun, 13 Jun 2010 13:30: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 o5DDUQPG038504; Sun, 13 Jun 2010 13:30:26 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DDUQ2N038502; Sun, 13 Jun 2010 13:30:26 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201006131330.o5DDUQ2N038502@svn.freebsd.org> From: Rafal Jaworowski Date: Sun, 13 Jun 2010 13:30: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: r209132 - 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: Sun, 13 Jun 2010 13:30:26 -0000 Author: raj Date: Sun Jun 13 13:30:26 2010 New Revision: 209132 URL: http://svn.freebsd.org/changeset/base/209132 Log: Enable ofwdump(8) on ARM as this is a useful tool to inspect a flattened device tree. Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sun Jun 13 13:28:53 2010 (r209131) +++ head/usr.sbin/Makefile Sun Jun 13 13:30:26 2010 (r209132) @@ -498,6 +498,10 @@ _spkrtest= spkrtest _zzz= zzz .endif +.if ${MACHINE_ARCH} == "arm" +_ofwdump= ofwdump +.endif + .if ${MACHINE_ARCH} == "ia64" .if ${MK_ACPI} != "no" _acpi= acpi From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 13:41: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 E10F61065670; Sun, 13 Jun 2010 13:41:40 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 747C78FC17; Sun, 13 Jun 2010 13:41:40 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 68BDA7E880; Sun, 13 Jun 2010 23:41:39 +1000 (EST) Message-ID: <4C14E012.7080902@freebsd.org> Date: Sun, 13 Jun 2010 23:41:38 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> In-Reply-To: <20100613101025.GD1320@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209119 - 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, 13 Jun 2010 13:41:41 -0000 On 06/13/10 20:10, Pawel Jakub Dawidek wrote: > On Sun, Jun 13, 2010 at 02:39:55AM +0000, Lawrence Stewart wrote: >> Author: lstewart >> Date: Sun Jun 13 02:39:55 2010 >> New Revision: 209119 >> URL: http://svn.freebsd.org/changeset/base/209119 >> >> Log: >> Add a utility macro to simplify calculating an aggregate sum from a DPCPU >> counter variable. >> >> Sponsored by: FreeBSD Foundation >> Reviewed by: jhb, rpaulo, rwatson (previous version of patch) >> MFC after: 1 week >> >> Modified: >> head/sys/sys/pcpu.h >> >> Modified: head/sys/sys/pcpu.h >> ============================================================================== >> --- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010 (r209118) >> +++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 (r209119) >> @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[]; >> #define DPCPU_ID_GET(i, n) (*DPCPU_ID_PTR(i, n)) >> #define DPCPU_ID_SET(i, n, v) (*DPCPU_ID_PTR(i, n) = v) >> >> +/* >> + * Utility macros. >> + */ >> +#define DPCPU_SUM(n, var, sum) \ >> +do { \ >> + (sum) = 0; \ >> + u_int i; \ >> + CPU_FOREACH(i) \ >> + (sum) += (DPCPU_ID_PTR(i, n))->var; \ >> +} while (0) > > I'd suggest first swapping variable declaration and '(sum) = 0;'. Can do (will wait until consensus on other issues is reached first before tweaking though). > Also using 'i' as a counter in macro can easly lead to name collision. I had a similar concern but after chatting with John on IRC felt it wasn't such a big deal in this case. > If you need to do it, I'd suggest '_i' or something. Could do... is it worth it? > Maybe it would be better to make it an inline function rather than macro? Inlining it could be annoying with respect to the types used in the function prototype, no? I suspect it would be more useful keeping it as a macro if possible. Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 14:30: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 64D3D106566C; Sun, 13 Jun 2010 14:30:06 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id D469E8FC16; Sun, 13 Jun 2010 14:30:05 +0000 (UTC) Received: by gxk27 with SMTP id 27so688612gxk.13 for ; Sun, 13 Jun 2010 07:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=g1mJ3wTOQCbU2sqbTmBDYgoDDtopHkCjBNZN9sa+k5c=; b=UHNPbP501htn4heVGDlP9vbyYwJdJsIB+dY2RV21dHKQpVZCHT1NrsO9a8zLIrL2RM 7jHJPb5IFusP3M9PHuiZN2YDcqacQ83jvZPT/IKFj2cl5i4x52hiMocfJddK+859FwuK TITP26Irc2v5FMvQ6evcjiTx4MYH6lzrpGr+c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=ep9V5BEWmo45k4j3KvfbH0octBKVTEvj0GJEfk1w52x6rpdzkX+7dfYQiCyKBS2og7 GCRxWBVh3HkWvOF2zxInpDWPVjItZtrKYypq4gH6Ofp+UoE+/nnoIKhXmFyKZuCaB4FK R1xalxK3mbgeAJkHtStwYe9T3vp2hJdMRRO4Y= MIME-Version: 1.0 Received: by 10.224.45.31 with SMTP id c31mr1459451qaf.223.1276437551509; Sun, 13 Jun 2010 06:59:11 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.224.28.79 with HTTP; Sun, 13 Jun 2010 06:59:11 -0700 (PDT) In-Reply-To: <20100613101025.GD1320@garage.freebsd.pl> References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> Date: Sun, 13 Jun 2010 13:59:11 +0000 X-Google-Sender-Auth: 7cKFxn_aOFZF4WfSmcgx1bm0HCg Message-ID: From: mdf@FreeBSD.org To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Lawrence Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209119 - 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, 13 Jun 2010 14:30:06 -0000 On Sun, Jun 13, 2010 at 10:10 AM, Pawel Jakub Dawidek wro= te: > On Sun, Jun 13, 2010 at 02:39:55AM +0000, Lawrence Stewart wrote: >> Author: lstewart >> Date: Sun Jun 13 02:39:55 2010 >> New Revision: 209119 >> URL: http://svn.freebsd.org/changeset/base/209119 >> >> Log: >> =A0 Add a utility macro to simplify calculating an aggregate sum from a = DPCPU >> =A0 counter variable. >> >> =A0 Sponsored by: =A0 =A0 =A0 FreeBSD Foundation >> =A0 Reviewed by: =A0 =A0 =A0 =A0jhb, rpaulo, rwatson (previous version o= f patch) >> =A0 MFC after: =A01 week >> >> Modified: >> =A0 head/sys/sys/pcpu.h >> >> Modified: head/sys/sys/pcpu.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/sys/pcpu.h =A0 =A0 =A0 Sun Jun 13 01:27:29 2010 =A0 =A0 =A0= =A0(r209118) >> +++ head/sys/sys/pcpu.h =A0 =A0 =A0 Sun Jun 13 02:39:55 2010 =A0 =A0 =A0= =A0(r209119) >> @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[]; >> =A0#define =A0 =A0 =A0DPCPU_ID_GET(i, n) =A0 =A0 =A0(*DPCPU_ID_PTR(i, n)= ) >> =A0#define =A0 =A0 =A0DPCPU_ID_SET(i, n, v) =A0 (*DPCPU_ID_PTR(i, n) =3D= v) >> >> +/* >> + * Utility macros. >> + */ >> +#define DPCPU_SUM(n, var, sum) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \ >> +do { =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \ >> + =A0 =A0 (sum) =3D 0; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\ >> + =A0 =A0 u_int i; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\ >> + =A0 =A0 CPU_FOREACH(i) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\ >> + =A0 =A0 =A0 =A0 =A0 =A0 (sum) +=3D (DPCPU_ID_PTR(i, n))->var; =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \ >> +} while (0) > > I'd suggest first swapping variable declaration and '(sum) =3D 0;'. > Also using 'i' as a counter in macro can easly lead to name collision. > If you need to do it, I'd suggest '_i' or something. > Maybe it would be better to make it an inline function rather than macro? (Relevant but almost a thread hijack): At Isilon we've run into a lot of problems with variable declarations in macros, especially with -Wshadow turned on. We ended up backporting __COUNTER__ from later versions of gcc and then using it to make unique variable names. - is the backport (or a fresh implementation) something that could be done within the scope of the GPL license? - is it something FreeBSD would be interested in? - is __COUNTER__ supported by clang? - if not, could it be? -Wshadow found several nasty bugs in our code, and apart from a few spurious warnings it has been handy to have when building our filesystem. Thanks, matthew From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 16:35: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 42B3F1065670; Sun, 13 Jun 2010 16:35:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 332B58FC14; Sun, 13 Jun 2010 16:35: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 o5DGZKNj085610; Sun, 13 Jun 2010 16:35:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DGZKpJ085608; Sun, 13 Jun 2010 16:35:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006131635.o5DGZKpJ085608@svn.freebsd.org> From: Warner Losh Date: Sun, 13 Jun 2010 16:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209134 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2010 16:35:21 -0000 Author: imp Date: Sun Jun 13 16:35:20 2010 New Revision: 209134 URL: http://svn.freebsd.org/changeset/base/209134 Log: Merge from tbemd, with minor tweaks: Search from most specific ($MACHINE) to least specific ($MACHINE_CPUARCH) when looking for the tty file to use. Also add an .error case if none exist. Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sun Jun 13 16:27:43 2010 (r209133) +++ head/etc/Makefile Sun Jun 13 16:35:20 2010 (r209134) @@ -22,8 +22,12 @@ BIN1= auth.conf \ .if exists(${.CURDIR}/etc.${MACHINE}/ttys) BIN1+= etc.${MACHINE}/ttys -.else +.elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys) BIN1+= etc.${MACHINE_ARCH}/ttys +.elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys) +BIN1+= etc.${MACHINE_CPUARCH}/ttys +.else +.error etc.MACHINE/ttys missing .endif OPENBSMDIR= ${.CURDIR}/../contrib/openbsm From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 16:37: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 4C2A0106564A; Sun, 13 Jun 2010 16:37:11 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id 2E5258FC23; Sun, 13 Jun 2010 16:37:11 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id o5DGbAAd062842; Sun, 13 Jun 2010 09:37:10 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id o5DGbA5a062841; Sun, 13 Jun 2010 09:37:10 -0700 (PDT) (envelope-from sgk) Date: Sun, 13 Jun 2010 09:37:10 -0700 From: Steve Kargl To: Kai Wang Message-ID: <20100613163710.GA62804@troutmask.apl.washington.edu> References: <201006131058.o5DAwo4b004987@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201006131058.o5DAwo4b004987@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: r209122 - 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: Sun, 13 Jun 2010 16:37:11 -0000 On Sun, Jun 13, 2010 at 10:58:50AM +0000, Kai Wang wrote: > Author: kaiw > Date: Sun Jun 13 10:58:50 2010 > New Revision: 209122 > URL: http://svn.freebsd.org/changeset/base/209122 > > Log: > * Improve compatibility with existing application code by permitting the > use of `elf_getbase()` on non-archive members. This change is needed > for gcc LTO (-flto) to work properly. > * Style fix: paranthesize returned values. > * Document the current behaviour of `elf_getbase()`. > > Tested by: gerald, Steve Kargl (original patch) > Obtained from: elftoolchain > MFC after: 3 days > > Modified: > head/lib/libelf/elf_getbase.3 > head/lib/libelf/elf_getbase.c Thanks. Unfortunately without the patch to elf_update.c, gcc LTO will not work (ie., 'gcc -flto -o z a.o b.o' will segfault). Any chance that the elf_update.c patch will be committed; possibly as a conditional compilation. -- Steve From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 16:54: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 A8F1E1065676; Sun, 13 Jun 2010 16:54:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 991B48FC17; Sun, 13 Jun 2010 16:54: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 o5DGsB6j089710; Sun, 13 Jun 2010 16:54:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DGsBU9089708; Sun, 13 Jun 2010 16:54:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006131654.o5DGsBU9089708@svn.freebsd.org> From: Warner Losh Date: Sun, 13 Jun 2010 16:54: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: r209135 - head/usr.sbin/config X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Jun 2010 16:54:11 -0000 Author: imp Date: Sun Jun 13 16:54:11 2010 New Revision: 209135 URL: http://svn.freebsd.org/changeset/base/209135 Log: style(9) fixes: o make cmd scoped to the whole do_rules function, since it really is scoped to the whole fucnion. Making it static was the wrong way to fix referencing it outside of the block in which it was declared (and conforms to the style of the rest of the file). o remove a couple of meaningless blank lines o properly wrap one line. Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Sun Jun 13 16:35:20 2010 (r209134) +++ head/usr.sbin/config/mkmakefile.c Sun Jun 13 16:54:11 2010 (r209135) @@ -683,6 +683,7 @@ do_rules(FILE *f) char *cp, *np, och; struct file_list *ftp; char *compilewith; + char cmd[128]; STAILQ_FOREACH(ftp, &ftab, f_next) { if (ftp->f_warn) @@ -720,25 +721,22 @@ do_rules(FILE *f) compilewith = ftp->f_compilewith; if (compilewith == 0) { const char *ftype = NULL; - static char cmd[128]; switch (ftp->f_type) { - case NORMAL: ftype = "NORMAL"; break; - case PROFILING: if (!profiling) continue; ftype = "PROFILE"; break; - default: printf("config: don't know rules for %s\n", np); break; } - snprintf(cmd, sizeof(cmd), "${%s_%c%s}\n\t@${NORMAL_CTFCONVERT}", ftype, + snprintf(cmd, sizeof(cmd), + "${%s_%c%s}\n\t@${NORMAL_CTFCONVERT}", ftype, toupper(och), ftp->f_flags & NOWERROR ? "_NOWERROR" : ""); compilewith = cmd; From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 17:04: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 42B54106567E; Sun, 13 Jun 2010 17:04:43 +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 2E6928FC23; Sun, 13 Jun 2010 17:04: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 o5DH4gj0092070; Sun, 13 Jun 2010 17:04:42 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DH4gaQ092065; Sun, 13 Jun 2010 17:04:42 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201006131704.o5DH4gaQ092065@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 13 Jun 2010 17:04: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: r209136 - in head: include lib/libedit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Jun 2010 17:04:43 -0000 Author: jilles Date: Sun Jun 13 17:04:42 2010 New Revision: 209136 URL: http://svn.freebsd.org/changeset/base/209136 Log: libedit: Add basic filename completion code from NetBSD. This will be used to provide filename completion in sh(1). Changes from the NetBSD code: * wide character support disabled, as in the rest of libedit * config.h and related portability stuff reduced/disabled, as in the rest of libedit Submitted by: Guy Yur Obtained from: NetBSD Added: head/lib/libedit/filecomplete.c (contents, props changed) head/lib/libedit/filecomplete.h (contents, props changed) Modified: head/include/histedit.h head/lib/libedit/Makefile Modified: head/include/histedit.h ============================================================================== --- head/include/histedit.h Sun Jun 13 16:54:11 2010 (r209135) +++ head/include/histedit.h Sun Jun 13 17:04:42 2010 (r209136) @@ -105,9 +105,7 @@ int el_parse(EditLine *, int, const ch */ int el_set(EditLine *, int, ...); int el_get(EditLine *, int, ...); -#if 0 unsigned char _el_fn_complete(EditLine *, int); -#endif /* * el_set/el_get parameters Modified: head/lib/libedit/Makefile ============================================================================== --- head/lib/libedit/Makefile Sun Jun 13 16:54:11 2010 (r209135) +++ head/lib/libedit/Makefile Sun Jun 13 17:04:42 2010 (r209136) @@ -6,7 +6,8 @@ LIB= edit SHLIB_MAJOR= 7 SHLIBDIR?= /lib -OSRCS= chared.c common.c el.c emacs.c fcns.c help.c hist.c key.c map.c \ +OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ + hist.c key.c map.c \ parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c DPADD= ${LIBNCURSES} Added: head/lib/libedit/filecomplete.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libedit/filecomplete.c Sun Jun 13 17:04:42 2010 (r209136) @@ -0,0 +1,541 @@ +/*- + * Copyright (c) 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jaromir Dolecek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $NetBSD: filecomplete.c,v 1.19 2010/06/01 18:20:26 christos Exp $ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "el.h" +#include "fcns.h" /* for EL_NUM_FCNS */ +#include "histedit.h" +#include "filecomplete.h" + +static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@', + '$', '>', '<', '=', ';', '|', '&', '{', '(', '\0' }; + + +/********************************/ +/* completion functions */ + +/* + * does tilde expansion of strings of type ``~user/foo'' + * if ``user'' isn't valid user name or ``txt'' doesn't start + * w/ '~', returns pointer to strdup()ed copy of ``txt'' + * + * it's callers's responsibility to free() returned string + */ +char * +fn_tilde_expand(const char *txt) +{ + struct passwd pwres, *pass; + char *temp; + size_t len = 0; + char pwbuf[1024]; + + if (txt[0] != '~') + return (strdup(txt)); + + temp = strchr(txt + 1, '/'); + if (temp == NULL) { + temp = strdup(txt + 1); + if (temp == NULL) + return NULL; + } else { + len = temp - txt + 1; /* text until string after slash */ + temp = malloc(len); + if (temp == NULL) + return NULL; + (void)strncpy(temp, txt + 1, len - 2); + temp[len - 2] = '\0'; + } + if (temp[0] == 0) { + if (getpwuid_r(getuid(), &pwres, pwbuf, sizeof(pwbuf), &pass) != 0) + pass = NULL; + } else { + if (getpwnam_r(temp, &pwres, pwbuf, sizeof(pwbuf), &pass) != 0) + pass = NULL; + } + free(temp); /* value no more needed */ + if (pass == NULL) + return (strdup(txt)); + + /* update pointer txt to point at string immediately following */ + /* first slash */ + txt += len; + + temp = malloc(strlen(pass->pw_dir) + 1 + strlen(txt) + 1); + if (temp == NULL) + return NULL; + (void)sprintf(temp, "%s/%s", pass->pw_dir, txt); + + return (temp); +} + + +/* + * return first found file name starting by the ``text'' or NULL if no + * such file can be found + * value of ``state'' is ignored + * + * it's caller's responsibility to free returned string + */ +char * +fn_filename_completion_function(const char *text, int state) +{ + static DIR *dir = NULL; + static char *filename = NULL, *dirname = NULL, *dirpath = NULL; + static size_t filename_len = 0; + struct dirent *entry; + char *temp; + size_t len; + + if (state == 0 || dir == NULL) { + temp = strrchr(text, '/'); + if (temp) { + char *nptr; + temp++; + nptr = realloc(filename, strlen(temp) + 1); + if (nptr == NULL) { + free(filename); + filename = NULL; + return NULL; + } + filename = nptr; + (void)strcpy(filename, temp); + len = temp - text; /* including last slash */ + + nptr = realloc(dirname, len + 1); + if (nptr == NULL) { + free(dirname); + dirname = NULL; + return NULL; + } + dirname = nptr; + (void)strncpy(dirname, text, len); + dirname[len] = '\0'; + } else { + free(filename); + if (*text == 0) + filename = NULL; + else { + filename = strdup(text); + if (filename == NULL) + return NULL; + } + free(dirname); + dirname = NULL; + } + + if (dir != NULL) { + (void)closedir(dir); + dir = NULL; + } + + /* support for ``~user'' syntax */ + + free(dirpath); + dirpath = NULL; + if (dirname == NULL) { + if ((dirname = strdup("")) == NULL) + return NULL; + dirpath = strdup("./"); + } else if (*dirname == '~') + dirpath = fn_tilde_expand(dirname); + else + dirpath = strdup(dirname); + + if (dirpath == NULL) + return NULL; + + dir = opendir(dirpath); + if (!dir) + return (NULL); /* cannot open the directory */ + + /* will be used in cycle */ + filename_len = filename ? strlen(filename) : 0; + } + + /* find the match */ + while ((entry = readdir(dir)) != NULL) { + /* skip . and .. */ + if (entry->d_name[0] == '.' && (!entry->d_name[1] + || (entry->d_name[1] == '.' && !entry->d_name[2]))) + continue; + if (filename_len == 0) + break; + /* otherwise, get first entry where first */ + /* filename_len characters are equal */ + if (entry->d_name[0] == filename[0] + && entry->d_namlen >= filename_len + && strncmp(entry->d_name, filename, + filename_len) == 0) + break; + } + + if (entry) { /* match found */ + len = entry->d_namlen; + + temp = malloc(strlen(dirname) + len + 1); + if (temp == NULL) + return NULL; + (void)sprintf(temp, "%s%s", dirname, entry->d_name); + } else { + (void)closedir(dir); + dir = NULL; + temp = NULL; + } + + return (temp); +} + + +static const char * +append_char_function(const char *name) +{ + struct stat stbuf; + char *expname = *name == '~' ? fn_tilde_expand(name) : NULL; + const char *rs = " "; + + if (stat(expname ? expname : name, &stbuf) == -1) + goto out; + if (S_ISDIR(stbuf.st_mode)) + rs = "/"; +out: + if (expname) + free(expname); + return rs; +} + + +/* + * returns list of completions for text given + * non-static for readline. + */ +char ** completion_matches(const char *, char *(*)(const char *, int)); +char ** +completion_matches(const char *text, char *(*genfunc)(const char *, int)) +{ + char **match_list = NULL, *retstr, *prevstr; + size_t match_list_len, max_equal, which, i; + size_t matches; + + matches = 0; + match_list_len = 1; + while ((retstr = (*genfunc) (text, (int)matches)) != NULL) { + /* allow for list terminator here */ + if (matches + 3 >= match_list_len) { + char **nmatch_list; + while (matches + 3 >= match_list_len) + match_list_len <<= 1; + nmatch_list = realloc(match_list, + match_list_len * sizeof(char *)); + if (nmatch_list == NULL) { + free(match_list); + return NULL; + } + match_list = nmatch_list; + + } + match_list[++matches] = retstr; + } + + if (!match_list) + return NULL; /* nothing found */ + + /* find least denominator and insert it to match_list[0] */ + which = 2; + prevstr = match_list[1]; + max_equal = strlen(prevstr); + for (; which <= matches; which++) { + for (i = 0; i < max_equal && + prevstr[i] == match_list[which][i]; i++) + continue; + max_equal = i; + } + + retstr = malloc(max_equal + 1); + if (retstr == NULL) { + free(match_list); + return NULL; + } + (void)strncpy(retstr, match_list[1], max_equal); + retstr[max_equal] = '\0'; + match_list[0] = retstr; + + /* add NULL as last pointer to the array */ + match_list[matches + 1] = (char *) NULL; + + return (match_list); +} + + +/* + * Sort function for qsort(). Just wrapper around strcasecmp(). + */ +static int +_fn_qsort_string_compare(const void *i1, const void *i2) +{ + const char *s1 = ((const char * const *)i1)[0]; + const char *s2 = ((const char * const *)i2)[0]; + + return strcasecmp(s1, s2); +} + + +/* + * Display list of strings in columnar format on readline's output stream. + * 'matches' is list of strings, 'len' is number of strings in 'matches', + * 'max' is maximum length of string in 'matches'. + */ +void +fn_display_match_list(EditLine *el, char **matches, size_t len, size_t max) +{ + size_t i, idx, limit, count; + int screenwidth = el->el_term.t_size.h; + + /* + * Find out how many entries can be put on one line, count + * with two spaces between strings. + */ + limit = screenwidth / (max + 2); + if (limit == 0) + limit = 1; + + /* how many lines of output */ + count = len / limit; + if (count * limit < len) + count++; + + /* Sort the items if they are not already sorted. */ + qsort(&matches[1], (size_t)(len - 1), sizeof(char *), + _fn_qsort_string_compare); + + idx = 1; + for(; count > 0; count--) { + int more = limit > 0 && matches[0]; + for(i = 0; more; i++, idx++) { + more = ++i < limit && matches[idx + 1]; + (void)fprintf(el->el_outfile, "%-*s%s", (int)max, + matches[idx], more ? " " : ""); + } + (void)fprintf(el->el_outfile, "\n"); + } +} + + +/* + * Complete the word at or before point, + * 'what_to_do' says what to do with the completion. + * \t means do standard completion. + * `?' means list the possible completions. + * `*' means insert all of the possible completions. + * `!' means to do standard completion, and list all possible completions if + * there is more than one. + * + * Note: '*' support is not implemented + * '!' could never be invoked + */ +int +fn_complete(EditLine *el, + char *(*complet_func)(const char *, int), + char **(*attempted_completion_function)(const char *, int, int), + const char *word_break, const char *special_prefixes, + const char *(*app_func)(const char *), size_t query_items, + int *completion_type, int *over, int *point, int *end) +{ + const LineInfo *li; + char *temp; + char **matches; + const char *ctemp; + size_t len; + int what_to_do = '\t'; + int retval = CC_NORM; + + if (el->el_state.lastcmd == el->el_state.thiscmd) + what_to_do = '?'; + + /* readline's rl_complete() has to be told what we did... */ + if (completion_type != NULL) + *completion_type = what_to_do; + + if (!complet_func) + complet_func = fn_filename_completion_function; + if (!app_func) + app_func = append_char_function; + + /* We now look backwards for the start of a filename/variable word */ + li = el_line(el); + ctemp = li->cursor; + while (ctemp > li->buffer + && !strchr(word_break, ctemp[-1]) + && (!special_prefixes || !strchr(special_prefixes, ctemp[-1]) ) ) + ctemp--; + + len = li->cursor - ctemp; +#if defined(__SSP__) || defined(__SSP_ALL__) + temp = malloc(sizeof(*temp) * (len + 1)); + if (temp == NULL) + return retval; +#else + temp = alloca(sizeof(*temp) * (len + 1)); +#endif + (void)strncpy(temp, ctemp, len); + temp[len] = '\0'; + + /* these can be used by function called in completion_matches() */ + /* or (*attempted_completion_function)() */ + if (point != 0) + *point = (int)(li->cursor - li->buffer); + if (end != NULL) + *end = (int)(li->lastchar - li->buffer); + + if (attempted_completion_function) { + int cur_off = (int)(li->cursor - li->buffer); + matches = (*attempted_completion_function) (temp, + (int)(cur_off - len), cur_off); + } else + matches = 0; + if (!attempted_completion_function || + (over != NULL && !*over && !matches)) + matches = completion_matches(temp, complet_func); + + if (over != NULL) + *over = 0; + + if (matches) { + int i; + size_t matches_num, maxlen, match_len, match_display=1; + + retval = CC_REFRESH; + /* + * Only replace the completed string with common part of + * possible matches if there is possible completion. + */ + if (matches[0][0] != '\0') { + el_deletestr(el, (int) len); + el_insertstr(el, matches[0]); + } + + if (what_to_do == '?') + goto display_matches; + + if (matches[2] == NULL && strcmp(matches[0], matches[1]) == 0) { + /* + * We found exact match. Add a space after + * it, unless we do filename completion and the + * object is a directory. + */ + el_insertstr(el, (*app_func)(matches[0])); + } else if (what_to_do == '!') { + display_matches: + /* + * More than one match and requested to list possible + * matches. + */ + + for(i = 1, maxlen = 0; matches[i]; i++) { + match_len = strlen(matches[i]); + if (match_len > maxlen) + maxlen = match_len; + } + matches_num = i - 1; + + /* newline to get on next line from command line */ + (void)fprintf(el->el_outfile, "\n"); + + /* + * If there are too many items, ask user for display + * confirmation. + */ + if (matches_num > query_items) { + (void)fprintf(el->el_outfile, + "Display all %zu possibilities? (y or n) ", + matches_num); + (void)fflush(el->el_outfile); + if (getc(stdin) != 'y') + match_display = 0; + (void)fprintf(el->el_outfile, "\n"); + } + + if (match_display) + fn_display_match_list(el, matches, matches_num, + maxlen); + retval = CC_REDISPLAY; + } else if (matches[0][0]) { + /* + * There was some common match, but the name was + * not complete enough. Next tab will print possible + * completions. + */ + el_beep(el); + } else { + /* lcd is not a valid object - further specification */ + /* is needed */ + el_beep(el); + retval = CC_NORM; + } + + /* free elements of array and the array itself */ + for (i = 0; matches[i]; i++) + free(matches[i]); + free(matches); + matches = NULL; + } +#if defined(__SSP__) || defined(__SSP_ALL__) + free(temp); +#endif + return retval; +} + + +/* + * el-compatible wrapper around rl_complete; needed for key binding + */ +/* ARGSUSED */ +unsigned char +_el_fn_complete(EditLine *el, int ch __attribute__((__unused__))) +{ + return (unsigned char)fn_complete(el, NULL, NULL, + break_chars, NULL, NULL, 100, + NULL, NULL, NULL, NULL); +} Added: head/lib/libedit/filecomplete.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libedit/filecomplete.h Sun Jun 13 17:04:42 2010 (r209136) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jaromir Dolecek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $NetBSD: filecomplete.h,v 1.9 2009/12/30 22:37:40 christos Exp $ + * $FreeBSD$ + */ +#ifndef _FILECOMPLETE_H_ +#define _FILECOMPLETE_H_ + +int fn_complete(EditLine *, + char *(*)(const char *, int), + char **(*)(const char *, int, int), + const char *, const char *, const char *(*)(const char *), size_t, + int *, int *, int *, int *); + +void fn_display_match_list(EditLine *, char **, size_t, size_t); +char *fn_tilde_expand(const char *); +char *fn_filename_completion_function(const char *, int); + +#endif From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 17:26: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 C6A171065670; Sun, 13 Jun 2010 17:26:23 +0000 (UTC) (envelope-from kaiwang27@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id E5DB08FC1C; Sun, 13 Jun 2010 17:26:22 +0000 (UTC) Received: by wyb33 with SMTP id 33so3649032wyb.13 for ; Sun, 13 Jun 2010 10:26:21 -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=RIHcAU+mxyyAWussD/gcYBK1AzUSQ/+NVp3vdHhWdkw=; b=t6GwZRfiKpWmU1CRRk1ja+kIn5Je8KzmRnBmGwlhpVOj4U4k/tcTuTSzh1JPATvCIQ 64BrXfY6PEY7VGAXe6EJnW/wgch02yr+JX6dRSnBh5ieOEIQY/FZ7GaaPwWAhSxi2sjb 86ngVP3PO2CIXtGVCDAlSTHAC63p62woilrdY= 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=aUPHwUmDxbA/URhtlHcrOjgQaVQHrPnblZw4uI+qp12xl/6Z76aE1LZV7URHf8oKza JXCXi4+h4xvf+O5glhweGa3sSm592JXUjLY/wVRrK0Jw6Nri00vwyCGhtXoNtGOHcd5r Uoj8kifMOyD1Jp2bLUgS+8E3sdqOSU4UTJcCY= Received: by 10.227.152.194 with SMTP id h2mr4606598wbw.196.1276448569998; Sun, 13 Jun 2010 10:02:49 -0700 (PDT) Received: from localhost (81-233-38-26-no36.tbcn.telia.com [81.233.38.26]) by mx.google.com with ESMTPS id p17sm21649762wbe.2.2010.06.13.10.02.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 13 Jun 2010 10:02:48 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=localhost.my.domain) by localhost with esmtp (Exim 4.71 (FreeBSD)) (envelope-from ) id 1ONqa6-0002bW-J6; Sun, 13 Jun 2010 19:02:46 +0200 Received: (from kaiw@localhost) by localhost.my.domain (8.14.3/8.14.3/Submit) id o5DH2kVY010013; Sun, 13 Jun 2010 19:02:46 +0200 (CEST) (envelope-from kaiwang27@gmail.com) X-Authentication-Warning: localhost.my.domain: kaiw set sender to kaiwang27@gmail.com using -f Date: Sun, 13 Jun 2010 19:02:46 +0200 From: Kai Wang To: Steve Kargl Message-ID: <20100613170246.GE2541@viskning> References: <201006131058.o5DAwo4b004987@svn.freebsd.org> <20100613163710.GA62804@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20100613163710.GA62804@troutmask.apl.washington.edu> 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: r209122 - 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: Sun, 13 Jun 2010 17:26:24 -0000 On Sun, Jun 13, 2010 at 09:37:10AM -0700, Steve Kargl wrote: > On Sun, Jun 13, 2010 at 10:58:50AM +0000, Kai Wang wrote: > > Author: kaiw > > Date: Sun Jun 13 10:58:50 2010 > > New Revision: 209122 > > URL: http://svn.freebsd.org/changeset/base/209122 > > > > Log: > > * Improve compatibility with existing application code by permitting the > > use of `elf_getbase()` on non-archive members. This change is needed > > for gcc LTO (-flto) to work properly. > > * Style fix: paranthesize returned values. > > * Document the current behaviour of `elf_getbase()`. > > > > Tested by: gerald, Steve Kargl (original patch) > > Obtained from: elftoolchain > > MFC after: 3 days > > > > Modified: > > head/lib/libelf/elf_getbase.3 > > head/lib/libelf/elf_getbase.c > > Thanks. Unfortunately without the patch to elf_update.c, > gcc LTO will not work (ie., 'gcc -flto -o z a.o b.o' will > segfault). Any chance that the elf_update.c patch will be > committed; possibly as a conditional compilation. The patch to elf_update.c needs some more work before it can be committed. We've concluded that our libelf is indeed overly strict about data alignment inside sections, so the problem will be fixed eventually. A ticket[1] has been created to track this issue. Thanks, Kai [1] http://sourceforge.net/apps/trac/elftoolchain/ticket/264 From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 18: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 E3C58106564A; Sun, 13 Jun 2010 18:48:02 +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 9313B8FC1B; Sun, 13 Jun 2010 18:48:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id E02E09CB0C1; Sun, 13 Jun 2010 20:44:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FXCMJNEAaZ0s; Sun, 13 Jun 2010 20:44:09 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id BEDA19CB102; Sun, 13 Jun 2010 20:44:09 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id o5DIi9LW052147; Sun, 13 Jun 2010 20:44:09 +0200 (CEST) (envelope-from rdivacky) Date: Sun, 13 Jun 2010 20:44:09 +0200 From: Roman Divacky To: mdf@FreeBSD.org Message-ID: <20100613184409.GA51992@freebsd.org> References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, Lawrence Stewart , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r209119 - 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, 13 Jun 2010 18:48:03 -0000 On Sun, Jun 13, 2010 at 01:59:11PM +0000, mdf@FreeBSD.org wrote: > On Sun, Jun 13, 2010 at 10:10 AM, Pawel Jakub Dawidek wrote: > > On Sun, Jun 13, 2010 at 02:39:55AM +0000, Lawrence Stewart wrote: > >> Author: lstewart > >> Date: Sun Jun 13 02:39:55 2010 > >> New Revision: 209119 > >> URL: http://svn.freebsd.org/changeset/base/209119 > >> > >> Log: > >> ? Add a utility macro to simplify calculating an aggregate sum from a DPCPU > >> ? counter variable. > >> > >> ? Sponsored by: ? ? ? FreeBSD Foundation > >> ? Reviewed by: ? ? ? ?jhb, rpaulo, rwatson (previous version of patch) > >> ? MFC after: ?1 week > >> > >> Modified: > >> ? head/sys/sys/pcpu.h > >> > >> Modified: head/sys/sys/pcpu.h > >> ============================================================================== > >> --- head/sys/sys/pcpu.h ? ? ? Sun Jun 13 01:27:29 2010 ? ? ? ?(r209118) > >> +++ head/sys/sys/pcpu.h ? ? ? Sun Jun 13 02:39:55 2010 ? ? ? ?(r209119) > >> @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[]; > >> ?#define ? ? ?DPCPU_ID_GET(i, n) ? ? ?(*DPCPU_ID_PTR(i, n)) > >> ?#define ? ? ?DPCPU_ID_SET(i, n, v) ? (*DPCPU_ID_PTR(i, n) = v) > >> > >> +/* > >> + * Utility macros. > >> + */ > >> +#define DPCPU_SUM(n, var, sum) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \ > >> +do { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \ > >> + ? ? (sum) = 0; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ > >> + ? ? u_int i; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ > >> + ? ? CPU_FOREACH(i) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ > >> + ? ? ? ? ? ? (sum) += (DPCPU_ID_PTR(i, n))->var; ? ? ? ? ? ? ? ? ? ? \ > >> +} while (0) > > > > I'd suggest first swapping variable declaration and '(sum) = 0;'. > > Also using 'i' as a counter in macro can easly lead to name collision. > > If you need to do it, I'd suggest '_i' or something. > > Maybe it would be better to make it an inline function rather than macro? > > (Relevant but almost a thread hijack): > > At Isilon we've run into a lot of problems with variable declarations > in macros, especially with -Wshadow turned on. We ended up > backporting __COUNTER__ from later versions of gcc and then using it > to make unique variable names. > > - is the backport (or a fresh implementation) something that could be > done within the scope of the GPL license? > - is it something FreeBSD would be interested in? > - is __COUNTER__ supported by clang? __COUNTER__ is supported by clang From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 20:16: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 88B5C106564A; Sun, 13 Jun 2010 20:16:42 +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 5EAE38FC1B; Sun, 13 Jun 2010 20:16: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 o5DKGgOT034225; Sun, 13 Jun 2010 20:16:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DKGfuK034224; Sun, 13 Jun 2010 20:16:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006132016.o5DKGfuK034224@svn.freebsd.org> From: Rui Paulo Date: Sun, 13 Jun 2010 20:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209137 - head/contrib/wpa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Jun 2010 20:16:42 -0000 Author: rpaulo Date: Sun Jun 13 20:16:41 2010 New Revision: 209137 URL: http://svn.freebsd.org/changeset/base/209137 Log: Bootstrap mergeinfo in preparation for import. Modified: Directory Properties: head/contrib/wpa/ (props changed) From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 20:29:55 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 8B9B3106567A; Sun, 13 Jun 2010 20:29:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AA168FC21; Sun, 13 Jun 2010 20:29:55 +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 o5DKTtMA037112; Sun, 13 Jun 2010 20:29:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DKTtUH037110; Sun, 13 Jun 2010 20:29:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201006132029.o5DKTtUH037110@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 Jun 2010 20:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209138 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 13 Jun 2010 20:29:55 -0000 Author: marius Date: Sun Jun 13 20:29:55 2010 New Revision: 209138 URL: http://svn.freebsd.org/changeset/base/209138 Log: Update a branch missed in r207537. MFC after: 3 days Modified: head/sys/sparc64/sparc64/mp_locore.S Modified: head/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- head/sys/sparc64/sparc64/mp_locore.S Sun Jun 13 20:16:41 2010 (r209137) +++ head/sys/sparc64/sparc64/mp_locore.S Sun Jun 13 20:29:55 2010 (r209138) @@ -207,7 +207,7 @@ ENTRY(mp_startup) bl %icc, 2f nop cmp %l1, CPU_IMPL_ULTRASPARCIII - bl %icc, 3f + bl %icc, 4f nop 2: mov CPU_STICKSYNC, %l2 membar #StoreLoad From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 20:53: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 951631065673; Sun, 13 Jun 2010 20:53:50 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep28.mx.upcmail.net (fep28.mx.upcmail.net [62.179.121.48]) by mx1.freebsd.org (Postfix) with ESMTP id 26CFD8FC0C; Sun, 13 Jun 2010 20:53:48 +0000 (UTC) Received: from edge03.upcmail.net ([192.168.13.238]) by viefep19-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20100613203527.UEQU17503.viefep19-int.chello.at@edge03.upcmail.net>; Sun, 13 Jun 2010 22:35:27 +0200 Received: from mole.fafoe.narf.at ([213.47.85.26]) by edge03.upcmail.net with edge id VYbS1e00s0a5KZh03YbTVf; Sun, 13 Jun 2010 22:35:27 +0200 X-SourceIP: 213.47.85.26 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id EEE8E6D41D; Sun, 13 Jun 2010 22:35:25 +0200 (CEST) Date: Sun, 13 Jun 2010 22:35:25 +0200 From: Stefan Farfeleder To: mdf@FreeBSD.org Message-ID: <20100613203524.GA1736@mole.fafoe.narf.at> References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Cloudmark-Analysis: v=1.1 cv=K3uBg944YaUT+Qsu6bWO0a0V3uPy4DQNslbdoMCD4tw= c=1 sm=0 a=zSU5qxubI3IA:10 a=ADBQPqJMlbwA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=Z6Coxr9PXiB70X_GTecA:9 a=JxUT8T1Ef6QpYZcEb5Bqr55P6XkA:4 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Cc: svn-src-head@freebsd.org, Lawrence Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r209119 - 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, 13 Jun 2010 20:53:50 -0000 On Sun, Jun 13, 2010 at 01:59:11PM +0000, mdf@FreeBSD.org wrote: > > (Relevant but almost a thread hijack): > > At Isilon we've run into a lot of problems with variable declarations > in macros, especially with -Wshadow turned on. We ended up > backporting __COUNTER__ from later versions of gcc and then using it > to make unique variable names. > > - is the backport (or a fresh implementation) something that could be > done within the scope of the GPL license? > - is it something FreeBSD would be interested in? > - is __COUNTER__ supported by clang? > - if not, could it be? > > -Wshadow found several nasty bugs in our code, and apart from a few > spurious warnings it has been handy to have when building our > filesystem. In my opinion using non-standard C features just to work around warnings is a bit questionable. A more useful feature would be an attribute that avoids -Wshadow warnings. Regards, Stefan From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 23:00: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 076091065676; Sun, 13 Jun 2010 23:00:56 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id B6CE78FC08; Sun, 13 Jun 2010 23:00:55 +0000 (UTC) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id BEFA0F8668; Sun, 13 Jun 2010 18:43:46 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 13 Jun 2010 18:43:46 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:cc:subject:message-id:in-reply-to:references:mime-version:content-type:content-transfer-encoding; s=smtpout; bh=x16+gDeVWr2D6oX7n9r0VslIjvs=; b=aq+5YcrRV6jmL7JPjT0RtWXHuVR5+Pv9l5E3V7y05x/MfY4rd7S8FdipkzeSpeYFRsSVXgLSw91ddtqfuZcx0m1MiPN+qX8rPQQJHbBzX00Sn9cKg3OiJt81x/NnfsZGgybODwK6+LkrhE+YgH4OdcqX6rw4gWr18bzsNdfTIxM= X-Sasl-enc: Jf4+atHnPMZkbIuZ1202o2TRxAGkHqMS53cz44gCQthY 1276469026 Received: from bender (unknown [202.6.116.238]) by mail.messagingengine.com (Postfix) with ESMTPA id 2403C63B0A; Sun, 13 Jun 2010 18:43:44 -0400 (EDT) Date: Mon, 14 Jun 2010 10:43:55 +1200 From: Andrew Turner To: Rafal Jaworowski Message-ID: <20100614104355.2d392cb8@bender> In-Reply-To: <201006131312.o5DDCqhi034591@svn.freebsd.org> References: <201006131312.o5DDCqhi034591@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.7; i386-portbld-freebsd8.0) X-Pirate: Arrrr 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: r209130 - in head/sys: arm/include 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: Sun, 13 Jun 2010 23:00:56 -0000 On Sun, 13 Jun 2010 13:12:52 +0000 (UTC) Rafal Jaworowski wrote: > Author: raj > Date: Sun Jun 13 13:12:52 2010 > New Revision: 209130 > URL: http://svn.freebsd.org/changeset/base/209130 > > Log: > Initial FDT infrastructure elements for ARM. > > Reviewed by: imp > Sponsored by: The FreeBSD Foundation > > Added: > head/sys/arm/include/fdt.h (contents, props changed) > head/sys/arm/include/ofw_machdep.h (contents, props changed) > head/sys/dev/fdt/fdt_arm.c (contents, props changed) > > Added: head/sys/arm/include/fdt.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is > newly added) > +++ head/sys/arm/include/fdt.h Sun Jun 13 > 13:12:52 2010 (r209130) > @@ -0,0 +1,68 @@ > +/*- > + * Copyright (c) 2010 The FreeBSD Foundation > + * All rights reserved. > + * > + * This software was developed by Semihalf under sponsorship from > + * the FreeBSD Foundation. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above > copyright > + * notice, this list of conditions and the following disclaimer > in the > + * documentation and/or other materials provided with the > distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS > IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, > THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A > PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE > LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE > GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN > ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _MACHINE_FDT_H_ > +#define _MACHINE_FDT_H_ > + > +#include > + > +#include > +#include > + > +#include > +#include > + > +#include > +#include Are the mv headders supposed to be here? They are including a soc specific file from an ARM header. Andrew From owner-svn-src-head@FreeBSD.ORG Sun Jun 13 23:37: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 97FC710656C3; Sun, 13 Jun 2010 23:37:17 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 331458FC0A; Sun, 13 Jun 2010 23:37: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 o5DNbHao078249; Sun, 13 Jun 2010 23:37:17 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5DNbHdB078246; Sun, 13 Jun 2010 23:37:17 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006132337.o5DNbHdB078246@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 13 Jun 2010 23:37: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: r209143 - 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: Sun, 13 Jun 2010 23:37:18 -0000 Author: marcel Date: Sun Jun 13 23:37:16 2010 New Revision: 209143 URL: http://svn.freebsd.org/changeset/base/209143 Log: Fix build breakages on ia64 introduced some commits ago. Modified: head/usr.sbin/sysinstall/disks.c head/usr.sbin/sysinstall/install.c Modified: head/usr.sbin/sysinstall/disks.c ============================================================================== --- head/usr.sbin/sysinstall/disks.c Sun Jun 13 21:04:09 2010 (r209142) +++ head/usr.sbin/sysinstall/disks.c Sun Jun 13 23:37:16 2010 (r209143) @@ -79,7 +79,6 @@ static struct chunk *chunk_info[CHUNK_IN static int current_chunk; static void diskPartitionNonInteractive(Device *dev); -static u_char * bootalloc(char *name, size_t *size); static void record_chunks(Disk *d) @@ -217,6 +216,41 @@ print_command_summary(void) move(0, 0); } +#if !defined(__ia64__) +static u_char * +bootalloc(char *name, size_t *size) +{ + char buf[FILENAME_MAX]; + struct stat sb; + + snprintf(buf, sizeof buf, "/boot/%s", name); + if (stat(buf, &sb) != -1) { + int fd; + + fd = open(buf, O_RDONLY); + if (fd != -1) { + u_char *cp; + + cp = malloc(sb.st_size); + if (read(fd, cp, sb.st_size) != sb.st_size) { + free(cp); + close(fd); + msgDebug("bootalloc: couldn't read %ld bytes from %s\n", (long)sb.st_size, buf); + return NULL; + } + close(fd); + if (size != NULL) + *size = sb.st_size; + return cp; + } + msgDebug("bootalloc: couldn't open %s\n", buf); + } + else + msgDebug("bootalloc: can't stat %s\n", buf); + return NULL; +} +#endif + #ifdef PC98 static void getBootMgr(char *dname, u_char **bootipl, size_t *bootipl_size, @@ -732,39 +766,6 @@ diskPartition(Device *dev) } #endif /* WITH_SLICES */ -static u_char * -bootalloc(char *name, size_t *size) -{ - char buf[FILENAME_MAX]; - struct stat sb; - - snprintf(buf, sizeof buf, "/boot/%s", name); - if (stat(buf, &sb) != -1) { - int fd; - - fd = open(buf, O_RDONLY); - if (fd != -1) { - u_char *cp; - - cp = malloc(sb.st_size); - if (read(fd, cp, sb.st_size) != sb.st_size) { - free(cp); - close(fd); - msgDebug("bootalloc: couldn't read %ld bytes from %s\n", (long)sb.st_size, buf); - return NULL; - } - close(fd); - if (size != NULL) - *size = sb.st_size; - return cp; - } - msgDebug("bootalloc: couldn't open %s\n", buf); - } - else - msgDebug("bootalloc: can't stat %s\n", buf); - return NULL; -} - #ifdef WITH_SLICES static int partitionHook(dialogMenuItem *selected) @@ -874,7 +875,9 @@ diskPartitionWrite(dialogMenuItem *self) msgDebug("diskPartitionWrite: Examining %d devices\n", deviceCount(devs)); for (i = 0; devs[i]; i++) { Disk *d = (Disk *)devs[i]->private; +#if !defined(__ia64__) static u_char *boot1; +#endif #if defined(__i386__) || defined(__amd64__) static u_char *boot2; #endif Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Sun Jun 13 21:04:09 2010 (r209142) +++ head/usr.sbin/sysinstall/install.c Sun Jun 13 23:37:16 2010 (r209143) @@ -1191,9 +1191,7 @@ installFilesystems(dialogMenuItem *self) } #if defined(__ia64__) else if (c1->type == efi && c1->private_data) { - char bootdir[FILENAME_MAX]; PartInfo *pi = (PartInfo *)c1->private_data; - char *p; sprintf(dname, "%s/dev/%s", RunningAsInit ? "/mnt" : "", c1->name); From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 00:40: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 1658E106567A; Mon, 14 Jun 2010 00:40:24 +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 04FA48FC08; Mon, 14 Jun 2010 00:40: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 o5E0eNTf092125; Mon, 14 Jun 2010 00:40:23 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5E0eNGq092122; Mon, 14 Jun 2010 00:40:23 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201006140040.o5E0eNGq092122@svn.freebsd.org> From: Andrew Thompson Date: Mon, 14 Jun 2010 00:40: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: r209144 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2010 00:40:24 -0000 Author: thompsa Date: Mon Jun 14 00:40:23 2010 New Revision: 209144 URL: http://svn.freebsd.org/changeset/base/209144 Log: - Because hostapd calls iv_key_set() before if_init(), make sure key_set callback function will be executed, and that the key won't be deleted during the init process. - txmic and rxmic are written into the chip the same place regardless of opmode. - Make the hardware generate 802.11 sequence numbers. Submitted by: Akinori Furukoshi Obtained from: git://gitorious.org/run/run.git Modified: head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runvar.h Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sun Jun 13 23:37:16 2010 (r209143) +++ head/sys/dev/usb/wlan/if_run.c Mon Jun 14 00:40:23 2010 (r209144) @@ -717,6 +717,10 @@ run_detach(device_t self) usbd_transfer_unsetup(sc->sc_xfer, RUN_N_XFER); RUN_LOCK(sc); + + sc->ratectl_run = RUN_RATECTL_OFF; + sc->cmdq_run = sc->cmdq_key_set = RUN_CMDQ_ABORT; + /* free TX list, if any */ for (i = 0; i != RUN_EP_QUEUES; i++) run_unsetup_tx_list(sc, &sc->sc_epq[i]); @@ -826,6 +830,9 @@ run_vap_create(struct ieee80211com *ic, if(sc->rvp_cnt++ == 0) ic->ic_opmode = opmode; + if(opmode == IEEE80211_M_HOSTAP) + sc->cmdq_run = RUN_CMDQ_GO; + DPRINTF("rvp_id=%d bmap=%x rvp_cnt=%d\n", rvp->rvp_id, sc->rvp_bmap, sc->rvp_cnt); @@ -1951,19 +1958,14 @@ run_key_set_cb(void *arg) struct ieee80211_node *ni; uint32_t attr; uint16_t base, associd; - uint8_t mode, wcid, txmic, rxmic, iv[8]; + uint8_t mode, wcid, iv[8]; RUN_LOCK_ASSERT(sc, MA_OWNED); - if(vap->iv_opmode == IEEE80211_M_HOSTAP){ + if(vap->iv_opmode == IEEE80211_M_HOSTAP) ni = ieee80211_find_vap_node(&ic->ic_sta, vap, cmdq->mac); - txmic = 24; - rxmic = 16; - } else { + else ni = vap->iv_bss; - txmic = 16; - rxmic = 24; - } associd = (ni != NULL) ? ni->ni_associd : 0; /* map net80211 cipher to RT2860 security mode */ @@ -2002,9 +2004,9 @@ run_key_set_cb(void *arg) if (k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP) { if(run_write_region_1(sc, base, k->wk_key, 16)) return; - if(run_write_region_1(sc, base + 16, &k->wk_key[txmic], 8)) /* wk_txmic */ + if(run_write_region_1(sc, base + 16, &k->wk_key[16], 8)) /* wk_txmic */ return; - if(run_write_region_1(sc, base + 24, &k->wk_key[rxmic], 8)) /* wk_rxmic */ + if(run_write_region_1(sc, base + 24, &k->wk_key[24], 8)) /* wk_rxmic */ return; } else { /* roundup len to 16-bit: XXX fix write_region_1() instead */ @@ -2085,6 +2087,16 @@ run_key_set(struct ieee80211vap *vap, st IEEE80211_ADDR_COPY(sc->cmdq[i].mac, mac); ieee80211_runtask(ic, &sc->cmdq_task); + /* + * To make sure key will be set when hostapd + * calls iv_key_set() before if_init(). + */ + if(vap->iv_opmode == IEEE80211_M_HOSTAP){ + RUN_LOCK(sc); + sc->cmdq_key_set = RUN_CMDQ_GO; + RUN_UNLOCK(sc); + } + return(1); } @@ -2895,6 +2907,9 @@ run_set_tx_desc(struct run_softc *sc, st txwi->txop |= RT2860_TX_TXOP_HT; else txwi->txop |= RT2860_TX_TXOP_BACKOFF; + + if(vap->iv_opmode != IEEE80211_M_STA && !IEEE80211_QOS_HAS_SEQ(wh)) + txwi->xflags |= RT2860_TX_NSEQ; } /* This function must be called locked */ @@ -2974,7 +2989,7 @@ run_tx(struct run_softc *sc, struct mbuf if (!IEEE80211_IS_MULTICAST(wh->i_addr1) && (!hasqos || (qos & IEEE80211_QOS_ACKPOLICY) != IEEE80211_QOS_ACKPOLICY_NOACK)) { - xflags = RT2860_TX_ACK; + xflags |= RT2860_TX_ACK; if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) dur = rt2860_rates[ctl_ridx].sp_ack_dur; else @@ -2996,8 +3011,8 @@ run_tx(struct run_softc *sc, struct mbuf txd->flags = qflags; txwi = (struct rt2860_txwi *)(txd + 1); txwi->xflags = xflags; - txwi->wcid = (type == IEEE80211_FC0_TYPE_DATA) ? - RUN_AID2WCID(ni->ni_associd) : 0xff; + txwi->wcid = IEEE80211_IS_MULTICAST(wh->i_addr1) ? + 0 : RUN_AID2WCID(ni->ni_associd); /* clear leftover garbage bits */ txwi->flags = 0; txwi->txop = 0; @@ -3920,6 +3935,7 @@ run_update_beacon_cb(void *arg) txwi.phy |= htole16(RT2860_PHY_OFDM); txwi.txop = RT2860_TX_TXOP_HT; txwi.flags = RT2860_TX_TS; + txwi.xflags = RT2860_TX_NSEQ; run_write_region_1(sc, RT2860_BCN_BASE(RUN_VAP(vap)->rvp_id), (uint8_t *)&txwi, sizeof txwi); @@ -4667,10 +4683,14 @@ run_init_locked(struct run_softc *sc) run_set_region_4(sc, RT2860_WCID_ENTRY(0), 0, 512); /* clear WCID attribute table */ run_set_region_4(sc, RT2860_WCID_ATTR(0), 0, 8 * 32); - /* clear shared key table */ - run_set_region_4(sc, RT2860_SKEY(0, 0), 0, 8 * 32); - /* clear shared key mode */ - run_set_region_4(sc, RT2860_SKEY_MODE_0_7, 0, 4); + + /* hostapd sets a key before init. So, don't clear it. */ + if(sc->cmdq_key_set != RUN_CMDQ_GO){ + /* clear shared key table */ + run_set_region_4(sc, RT2860_SKEY(0, 0), 0, 8 * 32); + /* clear shared key mode */ + run_set_region_4(sc, RT2860_SKEY_MODE_0_7, 0, 4); + } run_read(sc, RT2860_US_CYC_CNT, &tmp); tmp = (tmp & ~0xff) | 0x1e; @@ -4778,7 +4798,7 @@ run_stop(void *arg) ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->ratectl_run = RUN_RATECTL_OFF; - sc->cmdq_run = RUN_CMDQ_ABORT; + sc->cmdq_run = sc->cmdq_key_set; RUN_UNLOCK(sc); Modified: head/sys/dev/usb/wlan/if_runvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_runvar.h Sun Jun 13 23:37:16 2010 (r209143) +++ head/sys/dev/usb/wlan/if_runvar.h Mon Jun 14 00:40:23 2010 (r209144) @@ -218,6 +218,7 @@ struct run_softc { uint32_t cmdq_store; uint8_t cmdq_exec; uint8_t cmdq_run; + uint8_t cmdq_key_set; #define RUN_CMDQ_ABORT 0 #define RUN_CMDQ_GO 1 From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 01:54: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 6B3131065678; Mon, 14 Jun 2010 01:54:35 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id F2AEF8FC08; Mon, 14 Jun 2010 01:54:34 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id D45B07E871; Mon, 14 Jun 2010 11:54:09 +1000 (EST) Message-ID: <4C158B71.205@freebsd.org> Date: Mon, 14 Jun 2010 11:52:49 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> In-Reply-To: <20100613101025.GD1320@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209119 - 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: Mon, 14 Jun 2010 01:54:35 -0000 On 06/13/10 20:10, Pawel Jakub Dawidek wrote: > On Sun, Jun 13, 2010 at 02:39:55AM +0000, Lawrence Stewart wrote: [snip] >> >> Modified: head/sys/sys/pcpu.h >> ============================================================================== >> --- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010 (r209118) >> +++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 (r209119) >> @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[]; >> #define DPCPU_ID_GET(i, n) (*DPCPU_ID_PTR(i, n)) >> #define DPCPU_ID_SET(i, n, v) (*DPCPU_ID_PTR(i, n) = v) >> >> +/* >> + * Utility macros. >> + */ >> +#define DPCPU_SUM(n, var, sum) \ >> +do { \ >> + (sum) = 0; \ >> + u_int i; \ >> + CPU_FOREACH(i) \ >> + (sum) += (DPCPU_ID_PTR(i, n))->var; \ >> +} while (0) > > I'd suggest first swapping variable declaration and '(sum) = 0;'. > Also using 'i' as a counter in macro can easly lead to name collision. > If you need to do it, I'd suggest '_i' or something. Given that the DPCPU variable name space is flat and variable names have to be unique, perhaps something like the following would address the concerns raised? #define DPCPU_SUM(n, var, sum) \ do { \ u_int _##n##_i; \ (sum) = 0; \ CPU_FOREACH(_##n##_i) \ (sum) += (DPCPU_ID_PTR(_##n##_i, n))->var; \ } while (0) Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 02:26: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 AD3281065674; Mon, 14 Jun 2010 02:26:13 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BC378FC17; Mon, 14 Jun 2010 02:26: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 o5E2QDDH015338; Mon, 14 Jun 2010 02:26:13 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5E2QDa0015334; Mon, 14 Jun 2010 02:26:13 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201006140226.o5E2QDa0015334@svn.freebsd.org> From: Tim Kientzle Date: Mon, 14 Jun 2010 02:26: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: r209147 - head/lib/libc/posix1e X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2010 02:26:13 -0000 Author: kientzle Date: Mon Jun 14 02:26:13 2010 New Revision: 209147 URL: http://svn.freebsd.org/changeset/base/209147 Log: Separate _posix1e_acl_id_to_name() into a separate file, to break an unnecessary dependency on getpwuid() and getgrgid(). MFC after: 1 month Added: head/lib/libc/posix1e/acl_id_to_name.c (contents, props changed) Modified: head/lib/libc/posix1e/Makefile.inc head/lib/libc/posix1e/acl_support.c Modified: head/lib/libc/posix1e/Makefile.inc ============================================================================== --- head/lib/libc/posix1e/Makefile.inc Mon Jun 14 02:21:43 2010 (r209146) +++ head/lib/libc/posix1e/Makefile.inc Mon Jun 14 02:26:13 2010 (r209147) @@ -20,6 +20,7 @@ SRCS+= acl_branding.c \ acl_from_text.c \ acl_from_text_nfs4.c \ acl_get.c \ + acl_id_to_name.c \ acl_init.c \ acl_perm.c \ acl_set.c \ Added: head/lib/libc/posix1e/acl_id_to_name.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/posix1e/acl_id_to_name.c Mon Jun 14 02:26:13 2010 (r209147) @@ -0,0 +1,100 @@ +/*- + * Copyright (c) 1999-2001, 2008 Robert N. M. Watson + * 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. + */ +/* + * Support functionality for the POSIX.1e ACL interface + * These calls are intended only to be called within the library. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include "namespace.h" +#include +#include "un-namespace.h" +#include +#include +#include +#include +#include +#include +#include + +#include "acl_support.h" + +/* + * Given a uid/gid, return a username/groupname for the text form of an ACL. + * Note that we truncate user and group names, rather than error out, as + * this is consistent with other tools manipulating user and group names. + * XXX NOT THREAD SAFE, RELIES ON GETPWUID, GETGRGID + * XXX USES *PW* AND *GR* WHICH ARE STATEFUL AND THEREFORE THIS ROUTINE + * MAY HAVE SIDE-EFFECTS + */ +int +_posix1e_acl_id_to_name(acl_tag_t tag, uid_t id, ssize_t buf_len, char *buf, + int flags) +{ + struct group *g; + struct passwd *p; + int i; + + switch(tag) { + case ACL_USER: + if (flags & ACL_TEXT_NUMERIC_IDS) + p = NULL; + else + p = getpwuid(id); + if (!p) + i = snprintf(buf, buf_len, "%d", id); + else + i = snprintf(buf, buf_len, "%s", p->pw_name); + + if (i < 0) { + errno = ENOMEM; + return (-1); + } + return (0); + + case ACL_GROUP: + if (flags & ACL_TEXT_NUMERIC_IDS) + g = NULL; + else + g = getgrgid(id); + if (g == NULL) + i = snprintf(buf, buf_len, "%d", id); + else + i = snprintf(buf, buf_len, "%s", g->gr_name); + + if (i < 0) { + errno = ENOMEM; + return (-1); + } + return (0); + + default: + return (EINVAL); + } +} Modified: head/lib/libc/posix1e/acl_support.c ============================================================================== --- head/lib/libc/posix1e/acl_support.c Mon Jun 14 02:21:43 2010 (r209146) +++ head/lib/libc/posix1e/acl_support.c Mon Jun 14 02:26:13 2010 (r209147) @@ -269,61 +269,6 @@ _posix1e_acl_check(acl_t acl) return (0); } - -/* - * Given a uid/gid, return a username/groupname for the text form of an ACL. - * Note that we truncate user and group names, rather than error out, as - * this is consistent with other tools manipulating user and group names. - * XXX NOT THREAD SAFE, RELIES ON GETPWUID, GETGRGID - * XXX USES *PW* AND *GR* WHICH ARE STATEFUL AND THEREFORE THIS ROUTINE - * MAY HAVE SIDE-EFFECTS - */ -int -_posix1e_acl_id_to_name(acl_tag_t tag, uid_t id, ssize_t buf_len, char *buf, - int flags) -{ - struct group *g; - struct passwd *p; - int i; - - switch(tag) { - case ACL_USER: - if (flags & ACL_TEXT_NUMERIC_IDS) - p = NULL; - else - p = getpwuid(id); - if (!p) - i = snprintf(buf, buf_len, "%d", id); - else - i = snprintf(buf, buf_len, "%s", p->pw_name); - - if (i < 0) { - errno = ENOMEM; - return (-1); - } - return (0); - - case ACL_GROUP: - if (flags & ACL_TEXT_NUMERIC_IDS) - g = NULL; - else - g = getgrgid(id); - if (g == NULL) - i = snprintf(buf, buf_len, "%d", id); - else - i = snprintf(buf, buf_len, "%s", g->gr_name); - - if (i < 0) { - errno = ENOMEM; - return (-1); - } - return (0); - - default: - return (EINVAL); - } -} - /* * Given a right-shifted permission (i.e., direct ACL_PERM_* mask), fill * in a string describing the permissions. From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 02:56: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 E4A54106566B; Mon, 14 Jun 2010 02:56:45 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA7C98FC17; Mon, 14 Jun 2010 02:56: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 o5E2ujEU022353; Mon, 14 Jun 2010 02:56:45 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5E2ujXa022350; Mon, 14 Jun 2010 02:56:45 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201006140256.o5E2ujXa022350@svn.freebsd.org> From: Tim Kientzle Date: Mon, 14 Jun 2010 02:56: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: r209152 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 02:56:46 -0000 Author: kientzle Date: Mon Jun 14 02:56:45 2010 New Revision: 209152 URL: http://svn.freebsd.org/changeset/base/209152 Log: If the compressed data is larger than the uncompressed, report the compression ratio as 0% instead of displaying nonsense triggered by numeric overflow. This is common when dealing with uncompressed files when the I/O blocking causes there to be small transient differences in the accounting. Thanks to: Boris Samorodov Modified: head/usr.bin/tar/read.c head/usr.bin/tar/write.c Modified: head/usr.bin/tar/read.c ============================================================================== --- head/usr.bin/tar/read.c Mon Jun 14 02:31:53 2010 (r209151) +++ head/usr.bin/tar/read.c Mon Jun 14 02:56:45 2010 (r209152) @@ -103,6 +103,7 @@ progress_func(void *cookie) struct archive *a = progress_data->archive; struct archive_entry *entry = progress_data->entry; uint64_t comp, uncomp; + int compression; if (!need_report()) return; @@ -112,9 +113,13 @@ progress_func(void *cookie) if (a != NULL) { comp = archive_position_compressed(a); uncomp = archive_position_uncompressed(a); + if (comp > uncomp) + compression = 0; + else + compression = (int)((uncomp - comp) * 100 / uncomp); fprintf(stderr, "In: %s bytes, compression %d%%;", - tar_i64toa(comp), (int)((uncomp - comp) * 100 / uncomp)); + tar_i64toa(comp), compression); fprintf(stderr, " Out: %d files, %s bytes\n", archive_file_count(a), tar_i64toa(uncomp)); } Modified: head/usr.bin/tar/write.c ============================================================================== --- head/usr.bin/tar/write.c Mon Jun 14 02:31:53 2010 (r209151) +++ head/usr.bin/tar/write.c Mon Jun 14 02:56:45 2010 (r209152) @@ -965,15 +965,21 @@ report_write(struct bsdtar *bsdtar, stru struct archive_entry *entry, int64_t progress) { uint64_t comp, uncomp; + int compression; + if (bsdtar->verbose) fprintf(stderr, "\n"); comp = archive_position_compressed(a); uncomp = archive_position_uncompressed(a); fprintf(stderr, "In: %d files, %s bytes;", archive_file_count(a), tar_i64toa(uncomp)); + if (comp > uncomp) + compression = 0; + else + compression = (int)((uncomp - comp) * 100 / uncomp); fprintf(stderr, " Out: %s bytes, compression %d%%\n", - tar_i64toa(comp), (int)((uncomp - comp) * 100 / uncomp)); + tar_i64toa(comp), compression); /* Can't have two calls to tar_i64toa() pending, so split the output. */ safe_fprintf(stderr, "Current: %s (%s", archive_entry_pathname(entry), From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 06:23: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 46FF8106564A; Mon, 14 Jun 2010 06:23:48 +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 367BA8FC19; Mon, 14 Jun 2010 06:23: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 o5E6Nl5U067863; Mon, 14 Jun 2010 06:23:47 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5E6Nl4w067862; Mon, 14 Jun 2010 06:23:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006140623.o5E6Nl4w067862@svn.freebsd.org> From: Ed Schouten Date: Mon, 14 Jun 2010 06:23: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: r209153 - head/lib/clang X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 06:23:48 -0000 Author: ed Date: Mon Jun 14 06:23:47 2010 New Revision: 209153 URL: http://svn.freebsd.org/changeset/base/209153 Log: Unbreak Clang on PowerPC. It seems GCC 4.2.1 on PowerPC miscompiles Clang, causing it to crash when building even simple Hello World applications. Switch back to -O1 for this architecture. Submitted by: nwhitehorn Modified: head/lib/clang/clang.build.mk Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Mon Jun 14 02:56:45 2010 (r209152) +++ head/lib/clang/clang.build.mk Mon Jun 14 06:23:47 2010 (r209153) @@ -8,11 +8,16 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG +# Correct for gcc miscompilation when compiling on PPC with -O2 +.if ${MACHINE_ARCH} == "powerpc" +CFLAGS+= -O1 +.endif + TARGET_ARCH?= ${MACHINE_ARCH} # XXX: 8.0, to keep __FreeBSD_cc_version happy CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH}-undermydesk-freebsd9.0\" \ -DCLANG_VENDOR=\"FreeBSD\ \" -DSVN_REVISION=\"104832\" \ - -DCLANG_VENDOR_SUFFIX=\"\ 20100613\" + -DCLANG_VENDOR_SUFFIX=\"\ 20100614\" .PATH: ${LLVM_SRCS}/${SRCDIR} From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 07:10: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 E944A1065673; Mon, 14 Jun 2010 07:10:37 +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 D7CC28FC1B; Mon, 14 Jun 2010 07:10:37 +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 o5E7Abf8078168; Mon, 14 Jun 2010 07:10:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5E7AbtJ078163; Mon, 14 Jun 2010 07:10:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006140710.o5E7AbtJ078163@svn.freebsd.org> From: Alexander Motin Date: Mon, 14 Jun 2010 07:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209154 - in head/sys: dev/pci kern 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: Mon, 14 Jun 2010 07:10:38 -0000 Author: mav Date: Mon Jun 14 07:10:37 2010 New Revision: 209154 URL: http://svn.freebsd.org/changeset/base/209154 Log: Virtualize pci_remap_msi_irq() call from general MSI code. It allows MSI (FSB interrupts) to be used by non-PCI devices, such as HPET. Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pcivar.h head/sys/kern/bus_if.m head/sys/x86/x86/msi.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Jun 14 06:23:47 2010 (r209153) +++ head/sys/dev/pci/pci.c Mon Jun 14 07:10:37 2010 (r209154) @@ -118,6 +118,8 @@ static void pci_unmask_msix(device_t de static int pci_msi_blacklisted(void); static void pci_resume_msi(device_t dev); static void pci_resume_msix(device_t dev); +static int pci_remap_intr_method(device_t bus, device_t dev, + u_int irq); static device_method_t pci_methods[] = { /* Device interface */ @@ -147,6 +149,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource), DEVMETHOD(bus_child_pnpinfo_str, pci_child_pnpinfo_str_method), DEVMETHOD(bus_child_location_str, pci_child_location_str_method), + DEVMETHOD(bus_remap_intr, pci_remap_intr_method), /* PCI interface */ DEVMETHOD(pci_read_config, pci_read_config_method), @@ -1736,21 +1739,18 @@ pci_resume_msi(device_t dev) 2); } -int -pci_remap_msi_irq(device_t dev, u_int irq) +static int +pci_remap_intr_method(device_t bus, device_t dev, u_int irq) { struct pci_devinfo *dinfo = device_get_ivars(dev); pcicfgregs *cfg = &dinfo->cfg; struct resource_list_entry *rle; struct msix_table_entry *mte; struct msix_vector *mv; - device_t bus; uint64_t addr; uint32_t data; int error, i, j; - bus = device_get_parent(dev); - /* * Handle MSI first. We try to find this IRQ among our list * of MSI IRQs. If we find it, we request updated address and Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Mon Jun 14 06:23:47 2010 (r209153) +++ head/sys/dev/pci/pcivar.h Mon Jun 14 07:10:37 2010 (r209154) @@ -445,12 +445,6 @@ device_t pci_find_bsf(uint8_t, uint8_t, device_t pci_find_dbsf(uint32_t, uint8_t, uint8_t, uint8_t); device_t pci_find_device(uint16_t, uint16_t); -/* - * Can be used by MD code to request the PCI bus to re-map an MSI or - * MSI-X message. - */ -int pci_remap_msi_irq(device_t dev, u_int irq); - /* Can be used by drivers to manage the MSI-X table. */ int pci_pending_msix(device_t dev, u_int index); Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Mon Jun 14 06:23:47 2010 (r209153) +++ head/sys/kern/bus_if.m Mon Jun 14 07:10:37 2010 (r209154) @@ -47,6 +47,15 @@ CODE { { return (0); } + + static int + null_remap_intr(device_t bus, device_t dev, u_int irq) + { + + if (dev != NULL) + return (BUS_REMAP_INTR(dev, NULL, irq)); + return (ENXIO); + } }; /** @@ -600,3 +609,16 @@ METHOD void hint_device_unit { METHOD void new_pass { device_t _dev; } DEFAULT bus_generic_new_pass; + +/** + * @brief Notify a bus that specified child's IRQ should be remapped. + * + * @param _dev the bus device + * @param _child the child device + * @param _irq the irq number + */ +METHOD int remap_intr { + device_t _dev; + device_t _child; + u_int _irq; +} DEFAULT null_remap_intr; Modified: head/sys/x86/x86/msi.c ============================================================================== --- head/sys/x86/x86/msi.c Mon Jun 14 06:23:47 2010 (r209153) +++ head/sys/x86/x86/msi.c Mon Jun 14 07:10:37 2010 (r209154) @@ -247,7 +247,8 @@ msi_assign_cpu(struct intsrc *isrc, u_in "msi: Assigning MSI IRQ %d to local APIC %u vector %u\n", sib->msi_irq, sib->msi_cpu, sib->msi_vector); } - pci_remap_msi_irq(msi->msi_dev, msi->msi_irq); + BUS_REMAP_INTR(device_get_parent(msi->msi_dev), msi->msi_dev, + msi->msi_irq); /* * Free the old vector after the new one is established. This is done From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 07:38: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 B9D15106566B; Mon, 14 Jun 2010 07:38:53 +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 A89708FC1D; Mon, 14 Jun 2010 07:38:53 +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 o5E7crdP084394; Mon, 14 Jun 2010 07:38:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5E7crI3084391; Mon, 14 Jun 2010 07:38:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006140738.o5E7crI3084391@svn.freebsd.org> From: Alexander Motin Date: Mon, 14 Jun 2010 07:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209155 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 07:38:53 -0000 Author: mav Date: Mon Jun 14 07:38:53 2010 New Revision: 209155 URL: http://svn.freebsd.org/changeset/base/209155 Log: Fix bug introduced in SVN rev 194985. When calling pic_assign_cpu() for pre-bound IRQs during boot, submit there LAPIC ID, same as in other places, not CPU ID. Modified: head/sys/amd64/amd64/intr_machdep.c head/sys/i386/i386/intr_machdep.c Modified: head/sys/amd64/amd64/intr_machdep.c ============================================================================== --- head/sys/amd64/amd64/intr_machdep.c Mon Jun 14 07:10:37 2010 (r209154) +++ head/sys/amd64/amd64/intr_machdep.c Mon Jun 14 07:38:53 2010 (r209155) @@ -529,7 +529,7 @@ intr_shuffle_irqs(void *arg __unused) */ if (isrc->is_event->ie_cpu != NOCPU) (void)isrc->is_pic->pic_assign_cpu(isrc, - isrc->is_event->ie_cpu); + cpu_apic_ids[isrc->is_event->ie_cpu]); else if (isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[current_cpu]) == 0) (void)intr_next_cpu(); Modified: head/sys/i386/i386/intr_machdep.c ============================================================================== --- head/sys/i386/i386/intr_machdep.c Mon Jun 14 07:10:37 2010 (r209154) +++ head/sys/i386/i386/intr_machdep.c Mon Jun 14 07:38:53 2010 (r209155) @@ -502,7 +502,7 @@ intr_shuffle_irqs(void *arg __unused) */ if (isrc->is_event->ie_cpu != NOCPU) (void)isrc->is_pic->pic_assign_cpu(isrc, - isrc->is_event->ie_cpu); + cpu_apic_ids[isrc->is_event->ie_cpu]); else if (isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[current_cpu]) == 0) (void)intr_next_cpu(); From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 08:18:39 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 220AD10656C3; Mon, 14 Jun 2010 08:18:39 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 53C858FC08; Mon, 14 Jun 2010 08:18:37 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 368F945E94; Mon, 14 Jun 2010 10:18:36 +0200 (CEST) Received: from localhost (pdawidek.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 35C5A45E87; Mon, 14 Jun 2010 10:18:32 +0200 (CEST) Date: Mon, 14 Jun 2010 10:18:24 +0200 From: Pawel Jakub Dawidek To: Lawrence Stewart Message-ID: <20100614081824.GD1721@garage.freebsd.pl> References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C158B71.205@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IMjqdzrDRly81ofr" Content-Disposition: inline In-Reply-To: <4C158B71.205@freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209119 - 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: Mon, 14 Jun 2010 08:18:39 -0000 --IMjqdzrDRly81ofr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 14, 2010 at 11:52:49AM +1000, Lawrence Stewart wrote: > Given that the DPCPU variable name space is flat and variable names have= =20 > to be unique, perhaps something like the following would address the=20 > concerns raised? >=20 > #define DPCPU_SUM(n, var, sum) \ > do { \ > u_int _##n##_i; \ > (sum) =3D 0; \ > CPU_FOREACH(_##n##_i) \ > (sum) +=3D (DPCPU_ID_PTR(_##n##_i, n))->var; \ > } while (0) Looks ok to me. Thanks. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --IMjqdzrDRly81ofr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwV5dAACgkQForvXbEpPzRi8ACeOOvgs4zqQjgjGClp8ALd1+qc KyIAnilq2IcbhWN7CRwnIkvryaQuqNRv =3ps0 -----END PGP SIGNATURE----- --IMjqdzrDRly81ofr-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 08:24: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 9CB401065672; Mon, 14 Jun 2010 08:24:00 +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 824FA8FC0A; Mon, 14 Jun 2010 08:24: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 o5E8O0Cc094332; Mon, 14 Jun 2010 08:24:00 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5E8O0s5094330; Mon, 14 Jun 2010 08:24:00 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201006140824.o5E8O0s5094330@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 14 Jun 2010 08:24: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: r209156 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 08:24:00 -0000 Author: bschmidt Date: Mon Jun 14 08:24:00 2010 New Revision: 209156 URL: http://svn.freebsd.org/changeset/base/209156 Log: sc_lastrs is also used in case the sending station is not known, for example in a split IBSS scenario. Therefore always assign sc_lastrs. This removes a hack I committed in r206457. Approved by: rpaulo (mentor) Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Jun 14 07:38:53 2010 (r209155) +++ head/sys/dev/ath/if_ath.c Mon Jun 14 08:24:00 2010 (r209156) @@ -3654,14 +3654,8 @@ ath_recv_mgmt(struct ieee80211_node *ni, case IEEE80211_FC0_SUBTYPE_PROBE_RESP: if (vap->iv_opmode == IEEE80211_M_IBSS && vap->iv_state == IEEE80211_S_RUN) { - uint32_t rstamp; - uint64_t tsf; - - if (sc->sc_lastrs == NULL) - break; - - rstamp = sc->sc_lastrs->rs_tstamp; - tsf = ath_extend_tsf(rstamp, + uint32_t rstamp = sc->sc_lastrs->rs_tstamp; + uint64_t tsf = ath_extend_tsf(rstamp, ath_hal_gettsf64(sc->sc_ah)); /* * Handle ibss merge as needed; check the tsf on the @@ -4002,11 +3996,11 @@ rx_accept: mtod(m, const struct ieee80211_frame_min *), rs->rs_keyix == HAL_RXKEYIX_INVALID ? IEEE80211_KEYIX_NONE : rs->rs_keyix); + sc->sc_lastrs = rs; if (ni != NULL) { /* * Sending station is known, dispatch directly. */ - sc->sc_lastrs = rs; type = ieee80211_input(ni, m, rs->rs_rssi, nf); ieee80211_free_node(ni); /* From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 08:52: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 EA317106566B; Mon, 14 Jun 2010 08:52:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 62F0B8FC15; Mon, 14 Jun 2010 08:52:09 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o5E8q500010732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Jun 2010 11:52:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o5E8q5x8089057; Mon, 14 Jun 2010 11:52:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5E8q5Lu089056; Mon, 14 Jun 2010 11:52:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 14 Jun 2010 11:52:05 +0300 From: Kostik Belousov To: Lawrence Stewart Message-ID: <20100614085205.GD13238@deviant.kiev.zoral.com.ua> References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C158B71.205@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G/vVCphCGw+yuveY" Content-Disposition: inline In-Reply-To: <4C158B71.205@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r209119 - 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: Mon, 14 Jun 2010 08:52:11 -0000 --G/vVCphCGw+yuveY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 14, 2010 at 11:52:49AM +1000, Lawrence Stewart wrote: > On 06/13/10 20:10, Pawel Jakub Dawidek wrote: > >On Sun, Jun 13, 2010 at 02:39:55AM +0000, Lawrence Stewart wrote: > [snip] > >> > >>Modified: head/sys/sys/pcpu.h > >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >>--- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010 (r209118) > >>+++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 (r209119) > >>@@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[]; > >> #define DPCPU_ID_GET(i, n) (*DPCPU_ID_PTR(i, n)) > >> #define DPCPU_ID_SET(i, n, v) (*DPCPU_ID_PTR(i, n) =3D v) > >> > >>+/* > >>+ * Utility macros. > >>+ */ > >>+#define DPCPU_SUM(n, var, sum) \ > >>+do { \ > >>+ (sum) =3D 0; \ > >>+ u_int i; \ > >>+ CPU_FOREACH(i) \ > >>+ (sum) +=3D (DPCPU_ID_PTR(i, n))->var; \ > >>+} while (0) > > > >I'd suggest first swapping variable declaration and '(sum) =3D 0;'. > >Also using 'i' as a counter in macro can easly lead to name collision. > >If you need to do it, I'd suggest '_i' or something. >=20 > Given that the DPCPU variable name space is flat and variable names have= =20 > to be unique, perhaps something like the following would address the=20 > concerns raised? >=20 > #define DPCPU_SUM(n, var, sum) \ > do { \ > u_int _##n##_i; \ > (sum) =3D 0; \ > CPU_FOREACH(_##n##_i) \ > (sum) +=3D (DPCPU_ID_PTR(_##n##_i, n))->var; \ > } while (0) You do not have to jump through this. Mostly by convention, in our kernel sources, names with "_" prefix are reserved for the infrastructure (cannot say implementation). I think it is quite safe to use _i for the iteration variable. As an example of this, look at sys/sys/mount.h, implementation of VFS_NEEDGIANT, VFS_LOCK_GIANT etc macros. They do use gcc ({}) extension to provide function-like macros, but this is irrelevant. Or, look at the VFS_ASSERT_GIANT that is exactly like what you need. --G/vVCphCGw+yuveY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwV7bQACgkQC3+MBN1Mb4iMjACfeF3vcuEkv2MoW7zhQULyZrBi SjgAoPCy/3A3aegSBYjw4ht0YBFqX0o4 =NpwE -----END PGP SIGNATURE----- --G/vVCphCGw+yuveY-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 10:34:55 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 5D1CE106566B; Mon, 14 Jun 2010 10:34:55 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id C65568FC08; Mon, 14 Jun 2010 10:34:54 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 94AE97E84A; Mon, 14 Jun 2010 20:34:52 +1000 (EST) Message-ID: <4C1605A7.2000202@freebsd.org> Date: Mon, 14 Jun 2010 20:34:15 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Kostik Belousov References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C158B71.205@freebsd.org> <20100614085205.GD13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100614085205.GD13238@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r209119 - 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: Mon, 14 Jun 2010 10:34:55 -0000 On 06/14/10 18:52, Kostik Belousov wrote: > On Mon, Jun 14, 2010 at 11:52:49AM +1000, Lawrence Stewart wrote: >> On 06/13/10 20:10, Pawel Jakub Dawidek wrote: >>> On Sun, Jun 13, 2010 at 02:39:55AM +0000, Lawrence Stewart wrote: >> [snip] >>>> >>>> Modified: head/sys/sys/pcpu.h >>>> ============================================================================== >>>> --- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010 (r209118) >>>> +++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 (r209119) >>>> @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[]; >>>> #define DPCPU_ID_GET(i, n) (*DPCPU_ID_PTR(i, n)) >>>> #define DPCPU_ID_SET(i, n, v) (*DPCPU_ID_PTR(i, n) = v) >>>> >>>> +/* >>>> + * Utility macros. >>>> + */ >>>> +#define DPCPU_SUM(n, var, sum) \ >>>> +do { \ >>>> + (sum) = 0; \ >>>> + u_int i; \ >>>> + CPU_FOREACH(i) \ >>>> + (sum) += (DPCPU_ID_PTR(i, n))->var; \ >>>> +} while (0) >>> >>> I'd suggest first swapping variable declaration and '(sum) = 0;'. >>> Also using 'i' as a counter in macro can easly lead to name collision. >>> If you need to do it, I'd suggest '_i' or something. >> >> Given that the DPCPU variable name space is flat and variable names have >> to be unique, perhaps something like the following would address the >> concerns raised? >> >> #define DPCPU_SUM(n, var, sum) \ >> do { \ >> u_int _##n##_i; \ >> (sum) = 0; \ >> CPU_FOREACH(_##n##_i) \ >> (sum) += (DPCPU_ID_PTR(_##n##_i, n))->var; \ >> } while (0) > > You do not have to jump through this. Mostly by convention, in our kernel > sources, names with "_" prefix are reserved for the infrastructure (cannot > say implementation). I think it is quite safe to use _i for the iteration > variable. > > As an example of this, look at sys/sys/mount.h, implementation of > VFS_NEEDGIANT, VFS_LOCK_GIANT etc macros. They do use gcc ({}) extension > to provide function-like macros, but this is irrelevant. Or, look at > the VFS_ASSERT_GIANT that is exactly like what you need. Ok cool, thanks for the info and pointers (I didn't know about the ({}) extension or that "_" prefix was definitely reserved). I'm happy to use _i. Does the following diff against head look suitable to commit? --- a/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 +0000 +++ b/sys/sys/pcpu.h Mon Jun 14 20:12:27 2010 +1000 @@ -111,10 +111,10 @@ */ #define DPCPU_SUM(n, var, sum) \ do { \ + u_int _i; \ (sum) = 0; \ - u_int i; \ - CPU_FOREACH(i) \ - (sum) += (DPCPU_ID_PTR(i, n))->var; \ + CPU_FOREACH(_i) \ + (sum) += (DPCPU_ID_PTR(_i, n))->var; \ } while (0) /* Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 10:44: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 8FCAE1065670; Mon, 14 Jun 2010 10:44:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 25F768FC1C; Mon, 14 Jun 2010 10:44:41 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o5EAhntb020362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Jun 2010 13:43:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o5EAhnje007869; Mon, 14 Jun 2010 13:43:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5EAhnx3007868; Mon, 14 Jun 2010 13:43:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 14 Jun 2010 13:43:49 +0300 From: Kostik Belousov To: Lawrence Stewart Message-ID: <20100614104349.GF13238@deviant.kiev.zoral.com.ua> References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C158B71.205@freebsd.org> <20100614085205.GD13238@deviant.kiev.zoral.com.ua> <4C1605A7.2000202@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VuBTcNUPe5zwk2q6" Content-Disposition: inline In-Reply-To: <4C1605A7.2000202@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r209119 - 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: Mon, 14 Jun 2010 10:44:42 -0000 --VuBTcNUPe5zwk2q6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 14, 2010 at 08:34:15PM +1000, Lawrence Stewart wrote: > On 06/14/10 18:52, Kostik Belousov wrote: > >On Mon, Jun 14, 2010 at 11:52:49AM +1000, Lawrence Stewart wrote: > >>On 06/13/10 20:10, Pawel Jakub Dawidek wrote: > >>>On Sun, Jun 13, 2010 at 02:39:55AM +0000, Lawrence Stewart wrote: > >>[snip] > >>>> > >>>>Modified: head/sys/sys/pcpu.h > >>>>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >>>>--- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010 (r209118) > >>>>+++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 (r209119) > >>>>@@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[]; > >>>> #define DPCPU_ID_GET(i, n) (*DPCPU_ID_PTR(i, n)) > >>>> #define DPCPU_ID_SET(i, n, v) (*DPCPU_ID_PTR(i, n) =3D v) > >>>> > >>>>+/* > >>>>+ * Utility macros. > >>>>+ */ > >>>>+#define DPCPU_SUM(n, var, sum) \ > >>>>+do { \ > >>>>+ (sum) =3D 0; \ > >>>>+ u_int i; \ > >>>>+ CPU_FOREACH(i) \ > >>>>+ (sum) +=3D (DPCPU_ID_PTR(i, n))->var; \ > >>>>+} while (0) > >>> > >>>I'd suggest first swapping variable declaration and '(sum) =3D 0;'. > >>>Also using 'i' as a counter in macro can easly lead to name collision. > >>>If you need to do it, I'd suggest '_i' or something. > >> > >>Given that the DPCPU variable name space is flat and variable names have > >>to be unique, perhaps something like the following would address the > >>concerns raised? > >> > >>#define DPCPU_SUM(n, var, sum) \ > >>do { \ > >> u_int _##n##_i; = \ > >> (sum) =3D 0; = \ > >> CPU_FOREACH(_##n##_i) = \ > >> (sum) +=3D (DPCPU_ID_PTR(_##n##_i, n))->var; = \ > >>} while (0) > > > >You do not have to jump through this. Mostly by convention, in our kernel > >sources, names with "_" prefix are reserved for the infrastructure (cann= ot > >say implementation). I think it is quite safe to use _i for the iteration > >variable. > > > >As an example of this, look at sys/sys/mount.h, implementation of > >VFS_NEEDGIANT, VFS_LOCK_GIANT etc macros. They do use gcc ({}) extension > >to provide function-like macros, but this is irrelevant. Or, look at > >the VFS_ASSERT_GIANT that is exactly like what you need. >=20 > Ok cool, thanks for the info and pointers (I didn't know about the ({})= =20 > extension or that "_" prefix was definitely reserved). I'm happy to use= =20 > _i. Does the following diff against head look suitable to commit? >=20 > --- a/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 +0000 > +++ b/sys/sys/pcpu.h Mon Jun 14 20:12:27 2010 +1000 > @@ -111,10 +111,10 @@ > */ > #define DPCPU_SUM(n, var, sum) \ > do { \ > + u_int _i; \ > (sum) =3D 0; \ > - u_int i; \ > - CPU_FOREACH(i) \ > - (sum) +=3D (DPCPU_ID_PTR(i, n))->var; \ > + CPU_FOREACH(_i) \ > + (sum) +=3D (DPCPU_ID_PTR(_i, n))->var; \ > } while (0) You might want to introduce local accumulator to prevent several evaluations of sum, to avoid possible side-effects. Then, after, the loop, do single asignment to the the sum. Or, you could ditch the sum at all, indeed using ({}) and returning the result. __typeof is your friend to select proper type of accumulator. --VuBTcNUPe5zwk2q6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwWB+UACgkQC3+MBN1Mb4hroQCaAuxJCEfQ6P7UVv66i7jq3oiN YAgAn2ob8eHcCdmY6ed8XDf1j9hKHn15 =nJ7A -----END PGP SIGNATURE----- --VuBTcNUPe5zwk2q6-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 13:01: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 997211065670; Mon, 14 Jun 2010 13:01:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 1117B8FC08; Mon, 14 Jun 2010 13:01:57 +0000 (UTC) Received: from c122-106-175-69.carlnfd1.nsw.optusnet.com.au (c122-106-175-69.carlnfd1.nsw.optusnet.com.au [122.106.175.69]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o5ED1tox021971 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Jun 2010 23:01:56 +1000 Date: Mon, 14 Jun 2010 23:01:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Gabor Kovesdan In-Reply-To: <4C14B0EA.8090500@FreeBSD.org> Message-ID: <20100614225822.O37830@delplex.bde.org> References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C14B0EA.8090500@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Lawrence Stewart , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209119 - 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: Mon, 14 Jun 2010 13:01:58 -0000 On Sun, 13 Jun 2010, Gabor Kovesdan wrote: >>> +/* >>> + * Utility macros. >>> + */ >>> +#define DPCPU_SUM(n, var, sum) >>> \ >>> +do { >>> \ >>> + (sum) = 0; \ >>> + u_int i; \ >>> + CPU_FOREACH(i) \ >>> + (sum) += (DPCPU_ID_PTR(i, n))->var; \ >>> +} while (0) >>> >> I'd suggest first swapping variable declaration and '(sum) = 0;'. >> Also using 'i' as a counter in macro can easly lead to name collision. >> If you need to do it, I'd suggest '_i' or something. >> Maybe it would be better to make it an inline function rather than macro? >> > And why using old BSD-stlye u_int? style(9) also suggest using ISO C types. That is for fixed-width types (uintN_t instead of u_intN_t). KNF still uses the abbreviation u_int for `unsigned' or worse `unsigned int', except where namespace issues prevent use of u_nt. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 13:03: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 A8295106567B; Mon, 14 Jun 2010 13:03:25 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 984428FC1D; Mon, 14 Jun 2010 13:03: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 o5ED3P4L059453; Mon, 14 Jun 2010 13:03:25 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ED3PCO059450; Mon, 14 Jun 2010 13:03:25 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006141303.o5ED3PCO059450@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 14 Jun 2010 13:03: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: r209157 - head/games/random X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2010 13:03:25 -0000 Author: uqs Date: Mon Jun 14 13:03:25 2010 New Revision: 209157 URL: http://svn.freebsd.org/changeset/base/209157 Log: random(6): avoid dead assignments Found by: clang static analyzer Modified: head/games/random/random.c head/games/random/randomize_fd.c Modified: head/games/random/random.c ============================================================================== --- head/games/random/random.c Mon Jun 14 08:24:00 2010 (r209156) +++ head/games/random/random.c Mon Jun 14 13:03:25 2010 (r209157) @@ -73,7 +73,7 @@ main(int argc, char *argv[]) denom = 0; filename = "/dev/fd/0"; random_type = RANDOM_TYPE_UNSET; - random_exit = randomize_lines = random_type = unbuffer_output = 0; + random_exit = randomize_lines = unbuffer_output = 0; unique_output = 1; (void)setlocale(LC_CTYPE, ""); Modified: head/games/random/randomize_fd.c ============================================================================== --- head/games/random/randomize_fd.c Mon Jun 14 08:24:00 2010 (r209156) +++ head/games/random/randomize_fd.c Mon Jun 14 13:03:25 2010 (r209157) @@ -104,7 +104,7 @@ randomize_fd(int fd, int type, int uniqu rand_root = rand_tail = NULL; bufc = i = 0; - bufleft = eof = fndstr = numnode = ret = 0; + bufleft = eof = fndstr = numnode = 0; if (type == RANDOM_TYPE_UNSET) type = RANDOM_TYPE_LINES; From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 13:26: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 385871065673; Mon, 14 Jun 2010 13:26:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id C419B8FC18; Mon, 14 Jun 2010 13:26:17 +0000 (UTC) Received: from c122-106-175-69.carlnfd1.nsw.optusnet.com.au (c122-106-175-69.carlnfd1.nsw.optusnet.com.au [122.106.175.69]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o5EDQFmf013173 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Jun 2010 23:26:15 +1000 Date: Mon, 14 Jun 2010 23:26:14 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Lawrence Stewart In-Reply-To: <4C14E012.7080902@freebsd.org> Message-ID: <20100614230205.A37830@delplex.bde.org> References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C14E012.7080902@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, Pawel Jakub Dawidek Subject: Re: svn commit: r209119 - 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: Mon, 14 Jun 2010 13:26:18 -0000 On Sun, 13 Jun 2010, Lawrence Stewart wrote: > On 06/13/10 20:10, Pawel Jakub Dawidek wrote: >> On Sun, Jun 13, 2010 at 02:39:55AM +0000, Lawrence Stewart wrote: >>> Log: >>> Add a utility macro to simplify calculating an aggregate sum from a >>> DPCPU >>> counter variable. >>> >>> Sponsored by: FreeBSD Foundation >>> Reviewed by: jhb, rpaulo, rwatson (previous version of patch) >>> MFC after: 1 week >>> >>> Modified: >>> head/sys/sys/pcpu.h >>> >>> Modified: head/sys/sys/pcpu.h >>> ============================================================================== >>> --- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010 (r209118) >>> +++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 (r209119) >>> @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[]; >>> #define DPCPU_ID_GET(i, n) (*DPCPU_ID_PTR(i, n)) >>> #define DPCPU_ID_SET(i, n, v) (*DPCPU_ID_PTR(i, n) = v) >>> >>> +/* >>> + * Utility macros. >>> + */ >>> +#define DPCPU_SUM(n, var, sum) >>> \ >>> +do { >>> \ >>> + (sum) = 0; \ >>> + u_int i; \ >>> + CPU_FOREACH(i) \ >>> + (sum) += (DPCPU_ID_PTR(i, n))->var; \ >>> +} while (0) >> >> I'd suggest first swapping variable declaration and '(sum) = 0;'. Of course. Also fix the lexical style bugs: - space instead of tab after #define - "do {" at the beginning of a line (see queue.h for normal style) - missing blank line after declarations - missing braces around loop body (*). > > Can do (will wait until consensus on other issues is reached first before > tweaking though). > >> Also using 'i' as a counter in macro can easly lead to name collision. > > I had a similar concern but after chatting with John on IRC felt it wasn't > such a big deal in this case. > >> If you need to do it, I'd suggest '_i' or something. > > Could do... is it worth it? > >> Maybe it would be better to make it an inline function rather than macro? > > Inlining it could be annoying with respect to the types used in the function > prototype, no? I suspect it would be more useful keeping it as a macro if > possible. Inlining it is impossible for the same reason that parenthesizing all the macro args would be impossible -- `var' is a name and parenthesizing its use would give the syntax error foo->(var). Not sure about (n). It's a little surprising that parenthesizing works for lvalues like (sum) (it works because lvalues include certain expressions including parenthesized ones, but I wonder if it ever makes a difference). BTW, one reason I liked BSD code more than gnu code is that it didn't use so many macros. Macros should only exist when they are not just syntactic sugar, like DPCPU_SUM() and unlike CPU_FOREACH(). (*) style(9) recommends leaving out these unnecessary braces. However, mistakes like CPU_FOREACH() look less like syntax errors with the braces than without them; the braces at least confuse indent(1) into not making a mess. indent(1) already knows that it doesn't understand macros so it doesn't reformat them, so this doesn't quite apply here. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 13:48:27 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 1732E1065672; Mon, 14 Jun 2010 13:48:27 +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 DE3AA8FC22; Mon, 14 Jun 2010 13:48:26 +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 6D82546B1A; Mon, 14 Jun 2010 09:48:26 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A89318A03C; Mon, 14 Jun 2010 09:48:24 -0400 (EDT) From: John Baldwin To: Lawrence Stewart Date: Mon, 14 Jun 2010 08:25:47 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C14E012.7080902@freebsd.org> In-Reply-To: <4C14E012.7080902@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006140825.47375.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 14 Jun 2010 09:48:24 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham 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, Pawel Jakub Dawidek Subject: Re: svn commit: r209119 - 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: Mon, 14 Jun 2010 13:48:27 -0000 On Sunday 13 June 2010 9:41:38 am Lawrence Stewart wrote: > On 06/13/10 20:10, Pawel Jakub Dawidek wrote: > > On Sun, Jun 13, 2010 at 02:39:55AM +0000, Lawrence Stewart wrote: > >> Author: lstewart > >> Date: Sun Jun 13 02:39:55 2010 > >> New Revision: 209119 > >> URL: http://svn.freebsd.org/changeset/base/209119 > >> > >> Log: > >> Add a utility macro to simplify calculating an aggregate sum from a DPCPU > >> counter variable. > >> > >> Sponsored by: FreeBSD Foundation > >> Reviewed by: jhb, rpaulo, rwatson (previous version of patch) > >> MFC after: 1 week > >> > >> Modified: > >> head/sys/sys/pcpu.h > >> > >> Modified: head/sys/sys/pcpu.h > >> ============================================================================== > >> --- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010 (r209118) > >> +++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 (r209119) > >> @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[]; > >> #define DPCPU_ID_GET(i, n) (*DPCPU_ID_PTR(i, n)) > >> #define DPCPU_ID_SET(i, n, v) (*DPCPU_ID_PTR(i, n) = v) > >> > >> +/* > >> + * Utility macros. > >> + */ > >> +#define DPCPU_SUM(n, var, sum) \ > >> +do { \ > >> + (sum) = 0; \ > >> + u_int i; \ > >> + CPU_FOREACH(i) \ > >> + (sum) += (DPCPU_ID_PTR(i, n))->var; \ > >> +} while (0) > > > > I'd suggest first swapping variable declaration and '(sum) = 0;'. > > Can do (will wait until consensus on other issues is reached first > before tweaking though). > > > Also using 'i' as a counter in macro can easly lead to name collision. > > I had a similar concern but after chatting with John on IRC felt it > wasn't such a big deal in this case. Actually, I am a fan of using an inline function if possible to avoid the name collisions. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 13:50: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 A587310656CD; Mon, 14 Jun 2010 13:50:12 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-yw0-f182.google.com (mail-yw0-f182.google.com [209.85.211.182]) by mx1.freebsd.org (Postfix) with ESMTP id 03B958FC18; Mon, 14 Jun 2010 13:50:11 +0000 (UTC) Received: by ywh12 with SMTP id 12so2601595ywh.14 for ; Mon, 14 Jun 2010 06:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=L3uvvspge0IFS8nGIGoj8aWHzugrSPVXA9j10B50EpE=; b=I64YE3FNbq7zE3LlGS9S1nwM8709iGVijQOe0vp+wXPZctB5qXyKSNrfgzOoP6SYl3 +IJJmmHwz6n7XF3Z3C56LeSS+v/RJs4mVo8+10zZsgrb1TJH/Tj4RIq2nMlGq9SmfQOT mEZPQDPJzSuoVMqBZvmlbPTmqk48OkCOJ3I1E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Y4PHAorABMw/aM38Pk8EQkvdxedkDB0QumpymmBv3upuEJ67yCRjZyVx3yxpqP5Y5h DPlCr25zWRpRCOm+TKKrvVqiSWdW1FveXvKu1S9eFvHwFKq/EPMyXgR2Tr+LWGlmu5MF 4I7y/icI+cjSSY93N4Ul8Lc1yGfTjq61jmwqk= MIME-Version: 1.0 Received: by 10.224.79.22 with SMTP id n22mr2129056qak.258.1276523411065; Mon, 14 Jun 2010 06:50:11 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.224.28.79 with HTTP; Mon, 14 Jun 2010 06:50:10 -0700 (PDT) In-Reply-To: <20100614230205.A37830@delplex.bde.org> References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C14E012.7080902@freebsd.org> <20100614230205.A37830@delplex.bde.org> Date: Mon, 14 Jun 2010 13:50:10 +0000 X-Google-Sender-Auth: W_LsiG_Mt0W__pIUaXM9em9nYkA Message-ID: From: mdf@FreeBSD.org To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Lawrence Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r209119 - 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: Mon, 14 Jun 2010 13:50:12 -0000 > BTW, one reason I liked BSD code more than gnu code is that it didn't > use so many macros. =A0Macros should only exist when they are not just > syntactic sugar, like DPCPU_SUM() and unlike CPU_FOREACH(). As a style question, I do understand (generally) why too many macros make the code confusing. However, the *FOREACH macros all fit the same pattern and having a macro to iterate protects one against changes in the implementation -- there's a single location to change if e.g. we want to make CPU_FOREACH use a bitwise operator to determine the next non-zero bit, rather than testing each individually. So what I'm asking is, how do we balance the simplicity of the code (no "unnecessary" macros) versus the simplicity of making certain kinds of infrastructure changes simpler? Thanks, matthew From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 14:03: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 53BA31065670; Mon, 14 Jun 2010 14:03:08 +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 2339B8FC19; Mon, 14 Jun 2010 14:03:08 +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 CB9F746C18; Mon, 14 Jun 2010 10:03:07 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 11F438A03C; Mon, 14 Jun 2010 10:03:07 -0400 (EDT) From: John Baldwin To: mdf@freebsd.org Date: Mon, 14 Jun 2010 10:02:59 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100614230205.A37830@delplex.bde.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006141002.59464.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 14 Jun 2010 10:03:07 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, Lawrence Stewart Subject: Re: svn commit: r209119 - 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: Mon, 14 Jun 2010 14:03:08 -0000 On Monday 14 June 2010 9:50:10 am mdf@freebsd.org wrote: > > BTW, one reason I liked BSD code more than gnu code is that it didn't > > use so many macros. Macros should only exist when they are not just > > syntactic sugar, like DPCPU_SUM() and unlike CPU_FOREACH(). > > As a style question, I do understand (generally) why too many macros > make the code confusing. However, the *FOREACH macros all fit the > same pattern and having a macro to iterate protects one against > changes in the implementation -- there's a single location to change > if e.g. we want to make CPU_FOREACH use a bitwise operator to > determine the next non-zero bit, rather than testing each > individually. In the case of CPU_FOREACH() there is a very good chance that the implementation details will change when we switch from cpumask_t to cpuset_t, which is part of the reason I added it. I am less of a fan of macros that just wrap TAILQ_FOREACH() (note that there isn't a PCPU_FOREACH() since you can already do this via SLIST_FOREACH() now for example) such as FOREACH_PROC_IN_SYSTEM(). CPU_FOREACH() has additional logic in that it hides the CPU_ABSENT() stuff, so to me it doesn't quite fall in that class. (Some code was using pcpu_find() instead of CPU_ABSENT() to determine absent CPUs as well FWIW.) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 15:37: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 99CCF106564A; Mon, 14 Jun 2010 15:37:49 +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 84CAD8FC15; Mon, 14 Jun 2010 15:37: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 o5EFbn1J093871; Mon, 14 Jun 2010 15:37:49 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EFbnTD093866; Mon, 14 Jun 2010 15:37:49 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006141537.o5EFbnTD093866@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Jun 2010 15:37: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: r209158 - in head/contrib/wpa: hostapd hostapd/doc src/common src/crypto src/drivers src/eap_common src/eap_peer src/eap_server src/eapol_supp src/hlr_auc_gw src/l2_packet src/radius sr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2010 15:37:49 -0000 Author: rpaulo Date: Mon Jun 14 15:37:48 2010 New Revision: 209158 URL: http://svn.freebsd.org/changeset/base/209158 Log: MFV hostapd & wpa_supplicant 0.6.10. Added: head/contrib/wpa/hostapd/Makefile - copied unchanged from r209140, vendor/wpa/dist/hostapd/Makefile head/contrib/wpa/hostapd/driver_bsd.c - copied unchanged from r209140, vendor/wpa/dist/hostapd/driver_bsd.c head/contrib/wpa/hostapd/driver_hostap.c - copied unchanged from r209140, vendor/wpa/dist/hostapd/driver_hostap.c head/contrib/wpa/hostapd/driver_wired.c - copied unchanged from r209140, vendor/wpa/dist/hostapd/driver_wired.c head/contrib/wpa/hostapd/radiotap.c - copied unchanged from r209140, vendor/wpa/dist/hostapd/radiotap.c head/contrib/wpa/hostapd/radiotap.h - copied unchanged from r209140, vendor/wpa/dist/hostapd/radiotap.h head/contrib/wpa/hostapd/radiotap_iter.h - copied unchanged from r209140, vendor/wpa/dist/hostapd/radiotap_iter.h head/contrib/wpa/src/common/nl80211_copy.h - copied unchanged from r209140, vendor/wpa/dist/src/common/nl80211_copy.h head/contrib/wpa/src/common/wireless_copy.h - copied unchanged from r209140, vendor/wpa/dist/src/common/wireless_copy.h head/contrib/wpa/src/drivers/Apple80211.h - copied unchanged from r209140, vendor/wpa/dist/src/drivers/Apple80211.h head/contrib/wpa/src/drivers/Makefile - copied unchanged from r209140, vendor/wpa/dist/src/drivers/Makefile head/contrib/wpa/src/drivers/MobileApple80211.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/MobileApple80211.c head/contrib/wpa/src/drivers/MobileApple80211.h - copied unchanged from r209140, vendor/wpa/dist/src/drivers/MobileApple80211.h head/contrib/wpa/src/drivers/driver_atmel.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_atmel.c head/contrib/wpa/src/drivers/driver_broadcom.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_broadcom.c head/contrib/wpa/src/drivers/driver_bsd.c - copied, changed from r209140, vendor/wpa/dist/src/drivers/driver_bsd.c head/contrib/wpa/src/drivers/driver_hostap.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_hostap.c head/contrib/wpa/src/drivers/driver_hostap.h - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_hostap.h head/contrib/wpa/src/drivers/driver_iphone.m - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_iphone.m head/contrib/wpa/src/drivers/driver_ipw.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_ipw.c head/contrib/wpa/src/drivers/driver_madwifi.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_madwifi.c head/contrib/wpa/src/drivers/driver_ndis_.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_ndis_.c head/contrib/wpa/src/drivers/driver_ndiswrapper.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_ndiswrapper.c head/contrib/wpa/src/drivers/driver_nl80211.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_nl80211.c head/contrib/wpa/src/drivers/driver_osx.m - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_osx.m head/contrib/wpa/src/drivers/driver_prism54.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_prism54.c head/contrib/wpa/src/drivers/driver_privsep.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_privsep.c head/contrib/wpa/src/drivers/driver_ps3.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_ps3.c head/contrib/wpa/src/drivers/driver_ralink.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_ralink.c head/contrib/wpa/src/drivers/driver_ralink.h - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_ralink.h head/contrib/wpa/src/drivers/driver_roboswitch.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_roboswitch.c head/contrib/wpa/src/drivers/driver_test.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_test.c head/contrib/wpa/src/drivers/driver_wext.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_wext.c head/contrib/wpa/src/drivers/driver_wext.h - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_wext.h head/contrib/wpa/src/drivers/driver_wired.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/driver_wired.c head/contrib/wpa/src/drivers/ndis_events.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/ndis_events.c head/contrib/wpa/src/drivers/priv_netlink.h - copied unchanged from r209140, vendor/wpa/dist/src/drivers/priv_netlink.h head/contrib/wpa/src/drivers/radiotap.c - copied unchanged from r209140, vendor/wpa/dist/src/drivers/radiotap.c head/contrib/wpa/src/drivers/radiotap.h - copied unchanged from r209140, vendor/wpa/dist/src/drivers/radiotap.h head/contrib/wpa/src/drivers/radiotap_iter.h - copied unchanged from r209140, vendor/wpa/dist/src/drivers/radiotap_iter.h head/contrib/wpa/src/l2_packet/Makefile - copied unchanged from r209140, vendor/wpa/dist/src/l2_packet/Makefile head/contrib/wpa/src/l2_packet/l2_packet_freebsd.c - copied unchanged from r209140, vendor/wpa/dist/src/l2_packet/l2_packet_freebsd.c head/contrib/wpa/src/l2_packet/l2_packet_linux.c - copied unchanged from r209140, vendor/wpa/dist/src/l2_packet/l2_packet_linux.c head/contrib/wpa/src/l2_packet/l2_packet_ndis.c - copied unchanged from r209140, vendor/wpa/dist/src/l2_packet/l2_packet_ndis.c head/contrib/wpa/src/l2_packet/l2_packet_none.c - copied unchanged from r209140, vendor/wpa/dist/src/l2_packet/l2_packet_none.c head/contrib/wpa/src/l2_packet/l2_packet_pcap.c - copied unchanged from r209140, vendor/wpa/dist/src/l2_packet/l2_packet_pcap.c head/contrib/wpa/src/l2_packet/l2_packet_privsep.c - copied unchanged from r209140, vendor/wpa/dist/src/l2_packet/l2_packet_privsep.c head/contrib/wpa/src/l2_packet/l2_packet_winpcap.c - copied unchanged from r209140, vendor/wpa/dist/src/l2_packet/l2_packet_winpcap.c head/contrib/wpa/src/utils/eloop_none.c - copied unchanged from r209140, vendor/wpa/dist/src/utils/eloop_none.c head/contrib/wpa/src/utils/eloop_win.c - copied unchanged from r209140, vendor/wpa/dist/src/utils/eloop_win.c head/contrib/wpa/src/utils/os_none.c - copied unchanged from r209140, vendor/wpa/dist/src/utils/os_none.c head/contrib/wpa/src/utils/os_win32.c - copied unchanged from r209140, vendor/wpa/dist/src/utils/os_win32.c head/contrib/wpa/wpa_supplicant/Makefile - copied unchanged from r209140, vendor/wpa/dist/wpa_supplicant/Makefile head/contrib/wpa/wpa_supplicant/ctrl_iface_named_pipe.c - copied unchanged from r209140, vendor/wpa/dist/wpa_supplicant/ctrl_iface_named_pipe.c head/contrib/wpa/wpa_supplicant/main_none.c - copied unchanged from r209140, vendor/wpa/dist/wpa_supplicant/main_none.c head/contrib/wpa/wpa_supplicant/nmake.mak - copied unchanged from r209140, vendor/wpa/dist/wpa_supplicant/nmake.mak Deleted: head/contrib/wpa/hostapd/.gitignore head/contrib/wpa/hostapd/doc/.gitignore head/contrib/wpa/src/common/.gitignore head/contrib/wpa/src/crypto/.gitignore head/contrib/wpa/src/eap_common/.gitignore head/contrib/wpa/src/eap_peer/.gitignore head/contrib/wpa/src/eap_server/.gitignore head/contrib/wpa/src/eapol_supp/.gitignore head/contrib/wpa/src/hlr_auc_gw/.gitignore head/contrib/wpa/src/radius/.gitignore head/contrib/wpa/src/rsn_supp/.gitignore head/contrib/wpa/src/tls/.gitignore head/contrib/wpa/src/utils/.gitignore head/contrib/wpa/src/wps/.gitignore head/contrib/wpa/wpa_supplicant/.gitignore head/contrib/wpa/wpa_supplicant/doc/.gitignore head/contrib/wpa/wpa_supplicant/doc/docbook/.gitignore Modified: head/contrib/wpa/hostapd/ChangeLog head/contrib/wpa/hostapd/README-WPS head/contrib/wpa/hostapd/ap.h head/contrib/wpa/hostapd/beacon.c head/contrib/wpa/hostapd/config.c head/contrib/wpa/hostapd/config.h head/contrib/wpa/hostapd/ctrl_iface.c head/contrib/wpa/hostapd/drivers.c head/contrib/wpa/hostapd/hostapd.8 head/contrib/wpa/hostapd/hostapd.c head/contrib/wpa/hostapd/hostapd.conf head/contrib/wpa/hostapd/hostapd_cli.1 head/contrib/wpa/hostapd/hostapd_cli.c head/contrib/wpa/hostapd/hw_features.c head/contrib/wpa/hostapd/ieee802_11.c head/contrib/wpa/hostapd/ieee802_1x.c head/contrib/wpa/hostapd/preauth.c head/contrib/wpa/hostapd/wme.c head/contrib/wpa/hostapd/wme.h head/contrib/wpa/hostapd/wpa.c head/contrib/wpa/hostapd/wpa.h head/contrib/wpa/hostapd/wpa_auth_i.h head/contrib/wpa/hostapd/wpa_auth_ie.c head/contrib/wpa/hostapd/wpa_ft.c head/contrib/wpa/hostapd/wps_hostapd.c head/contrib/wpa/hostapd/wps_hostapd.h head/contrib/wpa/src/common/ieee802_11_common.c head/contrib/wpa/src/common/ieee802_11_common.h head/contrib/wpa/src/common/ieee802_11_defs.h head/contrib/wpa/src/common/version.h head/contrib/wpa/src/common/wpa_common.c head/contrib/wpa/src/crypto/crypto_cryptoapi.c head/contrib/wpa/src/crypto/crypto_gnutls.c head/contrib/wpa/src/crypto/crypto_internal.c head/contrib/wpa/src/crypto/dh_groups.c head/contrib/wpa/src/crypto/ms_funcs.c head/contrib/wpa/src/crypto/rc4.c head/contrib/wpa/src/crypto/rc4.h head/contrib/wpa/src/crypto/sha1.c head/contrib/wpa/src/crypto/sha256.c head/contrib/wpa/src/crypto/tls.h head/contrib/wpa/src/crypto/tls_gnutls.c head/contrib/wpa/src/crypto/tls_openssl.c head/contrib/wpa/src/drivers/driver.h head/contrib/wpa/src/drivers/driver_ndis.c head/contrib/wpa/src/eap_common/eap_defs.h head/contrib/wpa/src/eap_common/eap_fast_common.h head/contrib/wpa/src/eap_common/eap_tlv_common.h head/contrib/wpa/src/eap_peer/eap_fast.c head/contrib/wpa/src/eap_peer/eap_gpsk.c head/contrib/wpa/src/eap_peer/eap_methods.h head/contrib/wpa/src/eap_peer/eap_sim.c head/contrib/wpa/src/eap_peer/eap_tls_common.c head/contrib/wpa/src/eap_peer/eap_tnc.c head/contrib/wpa/src/eap_peer/eap_ttls.c head/contrib/wpa/src/eap_peer/eap_wsc.c head/contrib/wpa/src/eap_peer/tncc.c head/contrib/wpa/src/eap_server/eap.c head/contrib/wpa/src/eap_server/eap_fast.c head/contrib/wpa/src/eap_server/eap_gpsk.c head/contrib/wpa/src/eap_server/eap_i.h head/contrib/wpa/src/eap_server/eap_tls_common.c head/contrib/wpa/src/eap_server/eap_tnc.c head/contrib/wpa/src/eap_server/eap_ttls.c head/contrib/wpa/src/eapol_supp/eapol_supp_sm.c head/contrib/wpa/src/hlr_auc_gw/hlr_auc_gw.c head/contrib/wpa/src/radius/radius_client.c head/contrib/wpa/src/radius/radius_server.c head/contrib/wpa/src/rsn_supp/wpa.c head/contrib/wpa/src/rsn_supp/wpa_ft.c head/contrib/wpa/src/rsn_supp/wpa_i.h head/contrib/wpa/src/tls/rsa.c head/contrib/wpa/src/tls/tlsv1_client.c head/contrib/wpa/src/tls/tlsv1_server_read.c head/contrib/wpa/src/utils/base64.c head/contrib/wpa/src/utils/common.c head/contrib/wpa/src/utils/common.h head/contrib/wpa/src/utils/os_unix.c head/contrib/wpa/src/utils/wpa_debug.c head/contrib/wpa/src/utils/wpa_debug.h head/contrib/wpa/src/utils/wpabuf.c head/contrib/wpa/src/wps/httpread.c head/contrib/wpa/src/wps/wps.h head/contrib/wpa/src/wps/wps_attr_parse.c head/contrib/wpa/src/wps/wps_common.c head/contrib/wpa/src/wps/wps_enrollee.c head/contrib/wpa/src/wps/wps_i.h head/contrib/wpa/src/wps/wps_registrar.c head/contrib/wpa/src/wps/wps_upnp.c head/contrib/wpa/src/wps/wps_upnp_event.c head/contrib/wpa/src/wps/wps_upnp_i.h head/contrib/wpa/src/wps/wps_upnp_ssdp.c head/contrib/wpa/src/wps/wps_upnp_web.c head/contrib/wpa/wpa_supplicant/ChangeLog head/contrib/wpa/wpa_supplicant/README head/contrib/wpa/wpa_supplicant/README-WPS head/contrib/wpa/wpa_supplicant/ctrl_iface_dbus.c head/contrib/wpa/wpa_supplicant/ctrl_iface_dbus.h head/contrib/wpa/wpa_supplicant/ctrl_iface_dbus_handlers.c head/contrib/wpa/wpa_supplicant/ctrl_iface_dbus_handlers.h head/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c head/contrib/wpa/wpa_supplicant/defconfig head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_background.8 head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_cli.8 head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_gui.8 head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_passphrase.8 head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_priv.8 head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_supplicant.8 head/contrib/wpa/wpa_supplicant/doc/docbook/wpa_supplicant.conf.5 head/contrib/wpa/wpa_supplicant/doc/porting.doxygen head/contrib/wpa/wpa_supplicant/eapol_test.c head/contrib/wpa/wpa_supplicant/events.c head/contrib/wpa/wpa_supplicant/mlme.c head/contrib/wpa/wpa_supplicant/scan.c head/contrib/wpa/wpa_supplicant/wpa_priv.c head/contrib/wpa/wpa_supplicant/wpa_supplicant.c head/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h head/contrib/wpa/wpa_supplicant/wpas_glue.c head/contrib/wpa/wpa_supplicant/wps_supplicant.c Directory Properties: head/contrib/wpa/ (props changed) Modified: head/contrib/wpa/hostapd/ChangeLog ============================================================================== --- head/contrib/wpa/hostapd/ChangeLog Mon Jun 14 13:03:25 2010 (r209157) +++ head/contrib/wpa/hostapd/ChangeLog Mon Jun 14 15:37:48 2010 (r209158) @@ -1,5 +1,37 @@ ChangeLog for hostapd +2010-01-12 - v0.6.10 + * fixed SHA-256 based key derivation function to match with the + standard when using CCMP (for IEEE 802.11r and IEEE 802.11w) + (note: this breaks interoperability with previous version) [Bug 307] + * fixed WPS selected registrar expiration for internal PIN registrar + * disable PMTU discovery for RADIUS packets + * fixed WPS UPnP SSDP on 32-bit targets + * fixed WPS AP reconfiguration with drivers that do not use hostapd + MLME + * fixed RSN parameter setting for multi-BSS case + * added WPS workarounds for known interoperability issues with broken, + deployed implementation + * update IEEE 802.11w implementation to match with the published + standard + * fixed OpCode when proxying WSC_ACK or WSC_NACK from WPS ER + * fixed proxying of WSC_NACK to WPS ER + * fixed compilation with newer GnuTLS versions + * added support for defining timeout for WPS PINs + * fixed WPS Probe Request processing to handle missing required + attribute + * fixed PKCS#12 use with OpenSSL 1.0.0 + +2009-03-23 - v0.6.9 + * driver_nl80211: fixed STA accounting data collection (TX/RX bytes + reported correctly; TX/RX packets not yet available from kernel) + * fixed EAPOL/EAP reauthentication when using an external RADIUS + authentication server + * driver_prism54: fixed segmentation fault on initialization + * fixed TNC with EAP-TTLS + * fixed IEEE 802.11r key derivation function to match with the standard + (note: this breaks interoperability with previous version) [Bug 303] + 2009-02-15 - v0.6.8 * increased hostapd_cli ping interval to 5 seconds and made this configurable with a new command line options (-G) Copied: head/contrib/wpa/hostapd/Makefile (from r209140, vendor/wpa/dist/hostapd/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/wpa/hostapd/Makefile Mon Jun 14 15:37:48 2010 (r209158, copy of r209140, vendor/wpa/dist/hostapd/Makefile) @@ -0,0 +1,635 @@ +ifndef CC +CC=gcc +endif + +ifndef CFLAGS +CFLAGS = -MMD -O2 -Wall -g +endif + +# define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to +# a file (undefine it, if you want to save in binary size) +CFLAGS += -DHOSTAPD_DUMP_STATE + +CFLAGS += -I../src +CFLAGS += -I../src/crypto +CFLAGS += -I../src/utils +CFLAGS += -I../src/common + +# Uncomment following line and set the path to your kernel tree include +# directory if your C library does not include all header files. +# CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include + +-include .config + +ifndef CONFIG_OS +ifdef CONFIG_NATIVE_WINDOWS +CONFIG_OS=win32 +else +CONFIG_OS=unix +endif +endif + +ifeq ($(CONFIG_OS), internal) +CFLAGS += -DOS_NO_C_LIB_DEFINES +endif + +ifdef CONFIG_NATIVE_WINDOWS +CFLAGS += -DCONFIG_NATIVE_WINDOWS +LIBS += -lws2_32 +endif + +OBJS = hostapd.o ieee802_1x.o eapol_sm.o \ + ieee802_11.o config.o ieee802_11_auth.o accounting.o \ + sta_info.o wpa.o ctrl_iface.o \ + drivers.o preauth.o pmksa_cache.o beacon.o \ + hw_features.o wme.o ap_list.o \ + mlme.o vlan_init.o wpa_auth_ie.o + +OBJS += ../src/utils/eloop.o +OBJS += ../src/utils/common.o +OBJS += ../src/utils/wpa_debug.o +OBJS += ../src/utils/wpabuf.o +OBJS += ../src/utils/os_$(CONFIG_OS).o +OBJS += ../src/utils/ip_addr.o + +OBJS += ../src/common/ieee802_11_common.o +OBJS += ../src/common/wpa_common.o + +OBJS += ../src/radius/radius.o +OBJS += ../src/radius/radius_client.o + +OBJS += ../src/crypto/md5.o +OBJS += ../src/crypto/rc4.o +OBJS += ../src/crypto/md4.o +OBJS += ../src/crypto/sha1.o +OBJS += ../src/crypto/des.o +OBJS += ../src/crypto/aes_wrap.o +OBJS += ../src/crypto/aes.o + +HOBJS=../src/hlr_auc_gw/hlr_auc_gw.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).o ../src/hlr_auc_gw/milenage.o ../src/crypto/aes_wrap.o ../src/crypto/aes.o + +CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX + +ifdef CONFIG_IAPP +CFLAGS += -DCONFIG_IAPP +OBJS += iapp.o +endif + +ifdef CONFIG_RSN_PREAUTH +CFLAGS += -DCONFIG_RSN_PREAUTH +CONFIG_L2_PACKET=y +endif + +ifdef CONFIG_PEERKEY +CFLAGS += -DCONFIG_PEERKEY +OBJS += peerkey.o +endif + +ifdef CONFIG_IEEE80211W +CFLAGS += -DCONFIG_IEEE80211W +NEED_SHA256=y +endif + +ifdef CONFIG_IEEE80211R +CFLAGS += -DCONFIG_IEEE80211R +OBJS += wpa_ft.o +NEED_SHA256=y +endif + +ifdef CONFIG_IEEE80211N +CFLAGS += -DCONFIG_IEEE80211N +endif + +ifdef CONFIG_DRIVER_HOSTAP +CFLAGS += -DCONFIG_DRIVER_HOSTAP +OBJS += driver_hostap.o +endif + +ifdef CONFIG_DRIVER_WIRED +CFLAGS += -DCONFIG_DRIVER_WIRED +OBJS += driver_wired.o +endif + +ifdef CONFIG_DRIVER_MADWIFI +CFLAGS += -DCONFIG_DRIVER_MADWIFI +OBJS += driver_madwifi.o +CONFIG_L2_PACKET=y +endif + +ifdef CONFIG_DRIVER_ATHEROS +CFLAGS += -DCONFIG_DRIVER_ATHEROS +OBJS += driver_atheros.o +CONFIG_L2_PACKET=y +endif + +ifdef CONFIG_DRIVER_PRISM54 +CFLAGS += -DCONFIG_DRIVER_PRISM54 +OBJS += driver_prism54.o +endif + +ifdef CONFIG_DRIVER_NL80211 +CFLAGS += -DCONFIG_DRIVER_NL80211 +OBJS += driver_nl80211.o radiotap.o +LIBS += -lnl +ifdef CONFIG_LIBNL20 +LIBS += -lnl-genl +CFLAGS += -DCONFIG_LIBNL20 +endif +endif + +ifdef CONFIG_DRIVER_BSD +CFLAGS += -DCONFIG_DRIVER_BSD +OBJS += driver_bsd.o +CONFIG_L2_PACKET=y +CONFIG_DNET_PCAP=y +CONFIG_L2_FREEBSD=y +endif + +ifdef CONFIG_DRIVER_TEST +CFLAGS += -DCONFIG_DRIVER_TEST +OBJS += driver_test.o +endif + +ifdef CONFIG_DRIVER_NONE +CFLAGS += -DCONFIG_DRIVER_NONE +OBJS += driver_none.o +endif + +ifdef CONFIG_L2_PACKET +ifdef CONFIG_DNET_PCAP +ifdef CONFIG_L2_FREEBSD +LIBS += -lpcap +OBJS += ../src/l2_packet/l2_packet_freebsd.o +else +LIBS += -ldnet -lpcap +OBJS += ../src/l2_packet/l2_packet_pcap.o +endif +else +OBJS += ../src/l2_packet/l2_packet_linux.o +endif +else +OBJS += ../src/l2_packet/l2_packet_none.o +endif + + +ifdef CONFIG_EAP_MD5 +CFLAGS += -DEAP_MD5 +OBJS += ../src/eap_server/eap_md5.o +CHAP=y +endif + +ifdef CONFIG_EAP_TLS +CFLAGS += -DEAP_TLS +OBJS += ../src/eap_server/eap_tls.o +TLS_FUNCS=y +endif + +ifdef CONFIG_EAP_PEAP +CFLAGS += -DEAP_PEAP +OBJS += ../src/eap_server/eap_peap.o +OBJS += ../src/eap_common/eap_peap_common.o +TLS_FUNCS=y +CONFIG_EAP_MSCHAPV2=y +endif + +ifdef CONFIG_EAP_TTLS +CFLAGS += -DEAP_TTLS +OBJS += ../src/eap_server/eap_ttls.o +TLS_FUNCS=y +CHAP=y +endif + +ifdef CONFIG_EAP_MSCHAPV2 +CFLAGS += -DEAP_MSCHAPv2 +OBJS += ../src/eap_server/eap_mschapv2.o +MS_FUNCS=y +endif + +ifdef CONFIG_EAP_GTC +CFLAGS += -DEAP_GTC +OBJS += ../src/eap_server/eap_gtc.o +endif + +ifdef CONFIG_EAP_SIM +CFLAGS += -DEAP_SIM +OBJS += ../src/eap_server/eap_sim.o +CONFIG_EAP_SIM_COMMON=y +endif + +ifdef CONFIG_EAP_AKA +CFLAGS += -DEAP_AKA +OBJS += ../src/eap_server/eap_aka.o +CONFIG_EAP_SIM_COMMON=y +NEED_SHA256=y +endif + +ifdef CONFIG_EAP_AKA_PRIME +CFLAGS += -DEAP_AKA_PRIME +endif + +ifdef CONFIG_EAP_SIM_COMMON +OBJS += ../src/eap_common/eap_sim_common.o +# Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be +# replaced with another file implementating the interface specified in +# eap_sim_db.h. +OBJS += ../src/eap_server/eap_sim_db.o +NEED_FIPS186_2_PRF=y +endif + +ifdef CONFIG_EAP_PAX +CFLAGS += -DEAP_PAX +OBJS += ../src/eap_server/eap_pax.o ../src/eap_common/eap_pax_common.o +endif + +ifdef CONFIG_EAP_PSK +CFLAGS += -DEAP_PSK +OBJS += ../src/eap_server/eap_psk.o ../src/eap_common/eap_psk_common.o +endif + +ifdef CONFIG_EAP_SAKE +CFLAGS += -DEAP_SAKE +OBJS += ../src/eap_server/eap_sake.o ../src/eap_common/eap_sake_common.o +endif + +ifdef CONFIG_EAP_GPSK +CFLAGS += -DEAP_GPSK +OBJS += ../src/eap_server/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o +ifdef CONFIG_EAP_GPSK_SHA256 +CFLAGS += -DEAP_GPSK_SHA256 +endif +NEED_SHA256=y +endif + +ifdef CONFIG_EAP_VENDOR_TEST +CFLAGS += -DEAP_VENDOR_TEST +OBJS += ../src/eap_server/eap_vendor_test.o +endif + +ifdef CONFIG_EAP_FAST +CFLAGS += -DEAP_FAST +OBJS += ../src/eap_server/eap_fast.o +OBJS += ../src/eap_common/eap_fast_common.o +TLS_FUNCS=y +NEED_T_PRF=y +endif + +ifdef CONFIG_WPS +CFLAGS += -DCONFIG_WPS -DEAP_WSC +OBJS += ../src/utils/uuid.o +OBJS += wps_hostapd.o +OBJS += ../src/eap_server/eap_wsc.o ../src/eap_common/eap_wsc_common.o +OBJS += ../src/wps/wps.o +OBJS += ../src/wps/wps_common.o +OBJS += ../src/wps/wps_attr_parse.o +OBJS += ../src/wps/wps_attr_build.o +OBJS += ../src/wps/wps_attr_process.o +OBJS += ../src/wps/wps_dev_attr.o +OBJS += ../src/wps/wps_enrollee.o +OBJS += ../src/wps/wps_registrar.o +NEED_DH_GROUPS=y +NEED_SHA256=y +NEED_CRYPTO=y +NEED_BASE64=y + +ifdef CONFIG_WPS_UPNP +CFLAGS += -DCONFIG_WPS_UPNP +OBJS += ../src/wps/wps_upnp.o +OBJS += ../src/wps/wps_upnp_ssdp.o +OBJS += ../src/wps/wps_upnp_web.o +OBJS += ../src/wps/wps_upnp_event.o +OBJS += ../src/wps/httpread.o +endif + +endif + +ifdef CONFIG_EAP_IKEV2 +CFLAGS += -DEAP_IKEV2 +OBJS += ../src/eap_server/eap_ikev2.o ../src/eap_server/ikev2.o +OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o +NEED_DH_GROUPS=y +NEED_DH_GROUPS_ALL=y +endif + +ifdef CONFIG_EAP_TNC +CFLAGS += -DEAP_TNC +OBJS += ../src/eap_server/eap_tnc.o +OBJS += ../src/eap_server/tncs.o +NEED_BASE64=y +ifndef CONFIG_DRIVER_BSD +LIBS += -ldl +endif +endif + +# Basic EAP functionality is needed for EAPOL +OBJS += ../src/eap_server/eap.o +OBJS += ../src/eap_common/eap_common.o +OBJS += ../src/eap_server/eap_methods.o +OBJS += ../src/eap_server/eap_identity.o + +ifdef CONFIG_EAP +CFLAGS += -DEAP_SERVER +endif + +ifndef CONFIG_TLS +CONFIG_TLS=openssl +endif + +ifeq ($(CONFIG_TLS), internal) +ifndef CONFIG_CRYPTO +CONFIG_CRYPTO=internal +endif +endif +ifeq ($(CONFIG_CRYPTO), libtomcrypt) +CFLAGS += -DCONFIG_INTERNAL_X509 +endif +ifeq ($(CONFIG_CRYPTO), internal) +CFLAGS += -DCONFIG_INTERNAL_X509 +endif + + +ifdef TLS_FUNCS +# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS) +CFLAGS += -DEAP_TLS_FUNCS +OBJS += ../src/eap_server/eap_tls_common.o +NEED_TLS_PRF=y +ifeq ($(CONFIG_TLS), openssl) +OBJS += ../src/crypto/tls_openssl.o +LIBS += -lssl -lcrypto +LIBS_p += -lcrypto +LIBS_h += -lcrypto +endif +ifeq ($(CONFIG_TLS), gnutls) +OBJS += ../src/crypto/tls_gnutls.o +LIBS += -lgnutls -lgcrypt -lgpg-error +LIBS_p += -lgcrypt +LIBS_h += -lgcrypt +endif +ifdef CONFIG_GNUTLS_EXTRA +CFLAGS += -DCONFIG_GNUTLS_EXTRA +LIBS += -lgnutls-extra +endif +ifeq ($(CONFIG_TLS), internal) +OBJS += ../src/crypto/tls_internal.o +OBJS += ../src/tls/tlsv1_common.o ../src/tls/tlsv1_record.o +OBJS += ../src/tls/tlsv1_cred.o ../src/tls/tlsv1_server.o +OBJS += ../src/tls/tlsv1_server_write.o ../src/tls/tlsv1_server_read.o +OBJS += ../src/tls/asn1.o ../src/tls/x509v3.o +OBJS_p += ../src/tls/asn1.o +OBJS_p += ../src/crypto/rc4.o ../src/crypto/aes_wrap.o ../src/crypto/aes.o +NEED_BASE64=y +CFLAGS += -DCONFIG_TLS_INTERNAL +CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER +ifeq ($(CONFIG_CRYPTO), internal) +ifdef CONFIG_INTERNAL_LIBTOMMATH +CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH +else +LIBS += -ltommath +LIBS_p += -ltommath +endif +endif +ifeq ($(CONFIG_CRYPTO), libtomcrypt) +LIBS += -ltomcrypt -ltfm +LIBS_p += -ltomcrypt -ltfm +endif +endif +NEED_CRYPTO=y +else +OBJS += ../src/crypto/tls_none.o +endif + +ifdef CONFIG_PKCS12 +CFLAGS += -DPKCS12_FUNCS +endif + +ifdef MS_FUNCS +OBJS += ../src/crypto/ms_funcs.o +NEED_CRYPTO=y +endif + +ifdef CHAP +OBJS += ../src/eap_common/chap.o +endif + +ifdef NEED_CRYPTO +ifndef TLS_FUNCS +ifeq ($(CONFIG_TLS), openssl) +LIBS += -lcrypto +LIBS_p += -lcrypto +LIBS_h += -lcrypto +endif +ifeq ($(CONFIG_TLS), gnutls) +LIBS += -lgcrypt +LIBS_p += -lgcrypt +LIBS_h += -lgcrypt +endif +ifeq ($(CONFIG_TLS), internal) +ifeq ($(CONFIG_CRYPTO), libtomcrypt) +LIBS += -ltomcrypt -ltfm +LIBS_p += -ltomcrypt -ltfm +endif +endif +endif +ifeq ($(CONFIG_TLS), openssl) +OBJS += ../src/crypto/crypto_openssl.o +OBJS_p += ../src/crypto/crypto_openssl.o +HOBJS += ../src/crypto/crypto_openssl.o +CONFIG_INTERNAL_SHA256=y +endif +ifeq ($(CONFIG_TLS), gnutls) +OBJS += ../src/crypto/crypto_gnutls.o +OBJS_p += ../src/crypto/crypto_gnutls.o +HOBJS += ../src/crypto/crypto_gnutls.o +CONFIG_INTERNAL_SHA256=y +endif +ifeq ($(CONFIG_TLS), internal) +ifeq ($(CONFIG_CRYPTO), libtomcrypt) +OBJS += ../src/crypto/crypto_libtomcrypt.o +OBJS_p += ../src/crypto/crypto_libtomcrypt.o +CONFIG_INTERNAL_SHA256=y +endif +ifeq ($(CONFIG_CRYPTO), internal) +OBJS += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o +OBJS_p += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o +CFLAGS += -DCONFIG_CRYPTO_INTERNAL +ifdef CONFIG_INTERNAL_LIBTOMMATH +CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH +ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST +CFLAGS += -DLTM_FAST +endif +else +LIBS += -ltommath +LIBS_p += -ltommath +endif +CONFIG_INTERNAL_AES=y +CONFIG_INTERNAL_DES=y +CONFIG_INTERNAL_SHA1=y +CONFIG_INTERNAL_MD4=y +CONFIG_INTERNAL_MD5=y +CONFIG_INTERNAL_SHA256=y +endif +endif +else +CONFIG_INTERNAL_AES=y +CONFIG_INTERNAL_SHA1=y +CONFIG_INTERNAL_MD5=y +CONFIG_INTERNAL_SHA256=y +endif + +ifdef CONFIG_INTERNAL_AES +CFLAGS += -DINTERNAL_AES +endif +ifdef CONFIG_INTERNAL_SHA1 +CFLAGS += -DINTERNAL_SHA1 +endif +ifdef CONFIG_INTERNAL_SHA256 +CFLAGS += -DINTERNAL_SHA256 +endif +ifdef CONFIG_INTERNAL_MD5 +CFLAGS += -DINTERNAL_MD5 +endif +ifdef CONFIG_INTERNAL_MD4 +CFLAGS += -DINTERNAL_MD4 +endif +ifdef CONFIG_INTERNAL_DES +CFLAGS += -DINTERNAL_DES +endif + +ifdef NEED_SHA256 +OBJS += ../src/crypto/sha256.o +endif + +ifdef NEED_DH_GROUPS +OBJS += ../src/crypto/dh_groups.o +ifdef NEED_DH_GROUPS_ALL +CFLAGS += -DALL_DH_GROUPS +endif +endif + +ifndef NEED_FIPS186_2_PRF +CFLAGS += -DCONFIG_NO_FIPS186_2_PRF +endif + +ifndef NEED_T_PRF +CFLAGS += -DCONFIG_NO_T_PRF +endif + +ifndef NEED_TLS_PRF +CFLAGS += -DCONFIG_NO_TLS_PRF +endif + +ifdef CONFIG_RADIUS_SERVER +CFLAGS += -DRADIUS_SERVER +OBJS += ../src/radius/radius_server.o +endif + +ifdef CONFIG_IPV6 +CFLAGS += -DCONFIG_IPV6 +endif + +ifdef CONFIG_DRIVER_RADIUS_ACL +CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL +endif + +ifdef CONFIG_FULL_DYNAMIC_VLAN +# define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges +# and vlan interfaces for the vlan feature. +CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN +endif + +ifdef NEED_BASE64 +OBJS += ../src/utils/base64.o +endif + +ifdef CONFIG_NO_STDOUT_DEBUG +CFLAGS += -DCONFIG_NO_STDOUT_DEBUG +endif + +ifdef CONFIG_NO_AES_EXTRAS +CFLAGS += -DCONFIG_NO_AES_UNWRAP +CFLAGS += -DCONFIG_NO_AES_CTR -DCONFIG_NO_AES_OMAC1 +CFLAGS += -DCONFIG_NO_AES_EAX -DCONFIG_NO_AES_CBC +CFLAGS += -DCONFIG_NO_AES_DECRYPT +CFLAGS += -DCONFIG_NO_AES_ENCRYPT_BLOCK +endif + +ALL=hostapd hostapd_cli + +all: verify_config $(ALL) + +Q=@ +E=echo +ifeq ($(V), 1) +Q= +E=true +endif + +%.o: %.c + $(Q)$(CC) -c -o $@ $(CFLAGS) $< + @$(E) " CC " $< + +verify_config: + @if [ ! -r .config ]; then \ + echo 'Building hostapd requires a configuration file'; \ + echo '(.config). See README for more instructions. You can'; \ + echo 'run "cp defconfig .config" to create an example'; \ + echo 'configuration.'; \ + exit 1; \ + fi + +install: all + for i in $(ALL); do cp $$i /usr/local/bin/$$i; done + +hostapd: $(OBJS) + $(CC) -o hostapd $(OBJS) $(LIBS) + +OBJS_c = hostapd_cli.o ../src/common/wpa_ctrl.o ../src/utils/os_$(CONFIG_OS).o +hostapd_cli: $(OBJS_c) + $(CC) -o hostapd_cli $(OBJS_c) + +NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o ../src/crypto/sha1.o ../src/crypto/rc4.o ../src/crypto/md5.o +NOBJS += ../src/crypto/crypto_openssl.o ../src/utils/os_$(CONFIG_OS).o +ifdef TLS_FUNCS +LIBS_n += -lcrypto +endif + +nt_password_hash: $(NOBJS) + $(CC) -o nt_password_hash $(NOBJS) $(LIBS_n) + +hlr_auc_gw: $(HOBJS) + $(CC) -o hlr_auc_gw $(HOBJS) $(LIBS_h) + +clean: + $(MAKE) -C ../src clean + rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw + rm -f *.d + +%.eps: %.fig + fig2dev -L eps $*.fig $*.eps + +%.png: %.fig + fig2dev -L png -m 3 $*.fig | pngtopnm | pnmscale 0.4 | pnmtopng \ + > $*.png + +docs-pics: doc/hostapd.png doc/hostapd.eps + +docs: docs-pics + (cd ..; doxygen hostapd/doc/doxygen.full; cd hostapd) + $(MAKE) -C doc/latex + cp doc/latex/refman.pdf hostapd-devel.pdf + +docs-fast: docs-pics + (cd ..; doxygen hostapd/doc/doxygen.fast; cd hostapd) + +clean-docs: + rm -rf doc/latex doc/html + rm -f doc/hostapd.{eps,png} hostapd-devel.pdf + +TEST_SRC_MILENAGE = ../src/hlr_auc_gw/milenage.c ../src/crypto/aes_wrap.c ../src/crypto/aes.c ../src/utils/common.c ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).c +test-milenage: $(TEST_SRC_MILENAGE) + $(CC) -o test-milenage -Wall -Werror $(TEST_SRC_MILENAGE) \ + -DTEST_MAIN_MILENAGE -I. -DINTERNAL_AES \ + -I../src/crypto -I../src/utils + ./test-milenage + rm test-milenage + +-include $(OBJS:%.o=%.d) Modified: head/contrib/wpa/hostapd/README-WPS ============================================================================== --- head/contrib/wpa/hostapd/README-WPS Mon Jun 14 13:03:25 2010 (r209157) +++ head/contrib/wpa/hostapd/README-WPS Mon Jun 14 15:37:48 2010 (r209158) @@ -165,10 +165,17 @@ Example command to add a PIN (12345670) hostapd_cli wps_pin 53b63a98-d29e-4457-a2ed-094d7e6a669c 12345670 If the UUID-E is not available (e.g., Enrollee waits for the Registrar -to be selected before connecting), wildcard UUID may be used to allow the PIN to be used once with any UUID: +to be selected before connecting), wildcard UUID may be used to allow +the PIN to be used once with any UUID: hostapd_cli wps_pin any 12345670 +To reduce likelihood of PIN being used with other devices or of +forgetting an active PIN available for potential attackers, expiration +time can be set for the new PIN: + +hostapd_cli wps_pin any 12345670 300 + After this, the Enrollee can connect to the AP again and complete WPS negotiation. At that point, a new, random WPA PSK is generated for the Modified: head/contrib/wpa/hostapd/ap.h ============================================================================== --- head/contrib/wpa/hostapd/ap.h Mon Jun 14 13:03:25 2010 (r209157) +++ head/contrib/wpa/hostapd/ap.h Mon Jun 14 15:37:48 2010 (r209158) @@ -30,7 +30,7 @@ #define WLAN_STA_PENDING_POLL BIT(6) /* pending activity poll not ACKed */ #define WLAN_STA_SHORT_PREAMBLE BIT(7) #define WLAN_STA_PREAUTH BIT(8) -#define WLAN_STA_WME BIT(9) +#define WLAN_STA_WMM BIT(9) #define WLAN_STA_MFP BIT(10) #define WLAN_STA_HT BIT(11) #define WLAN_STA_WPS BIT(12) Modified: head/contrib/wpa/hostapd/beacon.c ============================================================================== --- head/contrib/wpa/hostapd/beacon.c Mon Jun 14 13:03:25 2010 (r209157) +++ head/contrib/wpa/hostapd/beacon.c Mon Jun 14 15:37:48 2010 (r209158) @@ -298,8 +298,8 @@ void handle_probe_req(struct hostapd_dat pos = hostapd_eid_wpa(hapd, pos, epos - pos, sta); - /* Wi-Fi Wireless Multimedia Extensions */ - pos = hostapd_eid_wme(hapd, pos); + /* Wi-Fi Alliance WMM */ + pos = hostapd_eid_wmm(hapd, pos); pos = hostapd_eid_ht_capabilities_info(hapd, pos); pos = hostapd_eid_ht_operation(hapd, pos); @@ -395,8 +395,8 @@ void ieee802_11_set_beacon(struct hostap tailpos = hostapd_eid_wpa(hapd, tailpos, tail + BEACON_TAIL_BUF_SIZE - tailpos, NULL); - /* Wi-Fi Wireless Multimedia Extensions */ - tailpos = hostapd_eid_wme(hapd, tailpos); + /* Wi-Fi Alliance WMM */ + tailpos = hostapd_eid_wmm(hapd, tailpos); #ifdef CONFIG_IEEE80211N if (hapd->iconf->ieee80211n) { Modified: head/contrib/wpa/hostapd/config.c ============================================================================== --- head/contrib/wpa/hostapd/config.c Mon Jun 14 13:03:25 2010 (r209157) +++ head/contrib/wpa/hostapd/config.c Mon Jun 14 15:37:48 2010 (r209158) @@ -201,15 +201,15 @@ static struct hostapd_config * hostapd_c struct hostapd_config *conf; struct hostapd_bss_config *bss; int i; - const int aCWmin = 15, aCWmax = 1024; - const struct hostapd_wme_ac_params ac_bk = + const int aCWmin = 4, aCWmax = 10; + const struct hostapd_wmm_ac_params ac_bk = { aCWmin, aCWmax, 7, 0, 0 }; /* background traffic */ - const struct hostapd_wme_ac_params ac_be = + const struct hostapd_wmm_ac_params ac_be = { aCWmin, aCWmax, 3, 0, 0 }; /* best effort traffic */ - const struct hostapd_wme_ac_params ac_vi = /* video traffic */ - { aCWmin >> 1, aCWmin, 2, 3000 / 32, 1 }; - const struct hostapd_wme_ac_params ac_vo = /* voice traffic */ - { aCWmin >> 2, aCWmin >> 1, 2, 1500 / 32, 1 }; + const struct hostapd_wmm_ac_params ac_vi = /* video traffic */ + { aCWmin - 1, aCWmin, 2, 3000 / 32, 1 }; + const struct hostapd_wmm_ac_params ac_vo = /* voice traffic */ + { aCWmin - 2, aCWmin - 1, 2, 1500 / 32, 1 }; conf = os_zalloc(sizeof(*conf)); bss = os_zalloc(sizeof(*bss)); @@ -251,10 +251,10 @@ static struct hostapd_config * hostapd_c for (i = 0; i < NUM_TX_QUEUES; i++) conf->tx_queue[i].aifs = -1; /* use hw default */ - conf->wme_ac_params[0] = ac_be; - conf->wme_ac_params[1] = ac_bk; - conf->wme_ac_params[2] = ac_vi; - conf->wme_ac_params[3] = ac_vo; + conf->wmm_ac_params[0] = ac_be; + conf->wmm_ac_params[1] = ac_bk; + conf->wmm_ac_params[2] = ac_vi; + conf->wmm_ac_params[3] = ac_vo; #ifdef CONFIG_IEEE80211N conf->ht_capab = HT_CAP_INFO_SMPS_DISABLED; @@ -1166,14 +1166,14 @@ static int hostapd_config_tx_queue(struc } -static int hostapd_config_wme_ac(struct hostapd_config *conf, char *name, - char *val) +static int hostapd_config_wmm_ac(struct hostapd_config *conf, char *name, + char *val) { int num, v; char *pos; - struct hostapd_wme_ac_params *ac; + struct hostapd_wmm_ac_params *ac; - /* skip 'wme_ac_' prefix */ + /* skip 'wme_ac_' or 'wmm_ac_' prefix */ pos = name + 7; if (os_strncmp(pos, "be_", 3) == 0) { num = 0; @@ -1188,11 +1188,11 @@ static int hostapd_config_wme_ac(struct num = 3; pos += 3; } else { - wpa_printf(MSG_ERROR, "Unknown wme name '%s'", pos); + wpa_printf(MSG_ERROR, "Unknown WMM name '%s'", pos); return -1; } - ac = &conf->wme_ac_params[num]; + ac = &conf->wmm_ac_params[num]; if (os_strcmp(pos, "aifs") == 0) { v = atoi(val); @@ -1221,7 +1221,7 @@ static int hostapd_config_wme_ac(struct wpa_printf(MSG_ERROR, "Invalid txop value %d", v); return -1; } - ac->txopLimit = v; + ac->txop_limit = v; } else if (os_strcmp(pos, "acm") == 0) { v = atoi(val); if (v < 0 || v > 1) { @@ -1230,7 +1230,7 @@ static int hostapd_config_wme_ac(struct } ac->admission_control_mandatory = v; } else { - wpa_printf(MSG_ERROR, "Unknown wme_ac_ field '%s'", pos); + wpa_printf(MSG_ERROR, "Unknown wmm_ac_ field '%s'", pos); return -1; } @@ -1452,13 +1452,13 @@ struct hostapd_config * hostapd_config_r } else if (os_strcmp(buf, "bridge") == 0) { os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); } else if (os_strcmp(buf, "driver") == 0) { - int i; + int j; /* clear to get error below if setting is invalid */ conf->driver = NULL; - for (i = 0; hostapd_drivers[i]; i++) { - if (os_strcmp(pos, hostapd_drivers[i]->name) == + for (j = 0; hostapd_drivers[j]; j++) { + if (os_strcmp(pos, hostapd_drivers[j]->name) == 0) { - conf->driver = hostapd_drivers[i]; + conf->driver = hostapd_drivers[j]; break; } } @@ -2070,11 +2070,13 @@ struct hostapd_config * hostapd_config_r "queue item", line); errors++; } - } else if (os_strcmp(buf, "wme_enabled") == 0) { - bss->wme_enabled = atoi(pos); - } else if (os_strncmp(buf, "wme_ac_", 7) == 0) { - if (hostapd_config_wme_ac(conf, buf, pos)) { - wpa_printf(MSG_ERROR, "Line %d: invalid wme " + } else if (os_strcmp(buf, "wme_enabled") == 0 || + os_strcmp(buf, "wmm_enabled") == 0) { + bss->wmm_enabled = atoi(pos); + } else if (os_strncmp(buf, "wme_ac_", 7) == 0 || + os_strncmp(buf, "wmm_ac_", 7) == 0) { + if (hostapd_config_wmm_ac(conf, buf, pos)) { + wpa_printf(MSG_ERROR, "Line %d: invalid WMM " "ac item", line); errors++; } @@ -2255,29 +2257,30 @@ struct hostapd_config * hostapd_config_r fclose(f); - if (bss->individual_wep_key_len == 0) { - /* individual keys are not use; can use key idx0 for broadcast - * keys */ - bss->broadcast_key_idx_min = 0; - } - - /* Select group cipher based on the enabled pairwise cipher suites */ - pairwise = 0; - if (bss->wpa & 1) - pairwise |= bss->wpa_pairwise; - if (bss->wpa & 2) { - if (bss->rsn_pairwise == 0) - bss->rsn_pairwise = bss->wpa_pairwise; - pairwise |= bss->rsn_pairwise; - } - if (pairwise & WPA_CIPHER_TKIP) - bss->wpa_group = WPA_CIPHER_TKIP; - else - bss->wpa_group = WPA_CIPHER_CCMP; - for (i = 0; i < conf->num_bss; i++) { bss = &conf->bss[i]; + if (bss->individual_wep_key_len == 0) { + /* individual keys are not use; can use key idx0 for + * broadcast keys */ + bss->broadcast_key_idx_min = 0; + } + + /* Select group cipher based on the enabled pairwise cipher + * suites */ + pairwise = 0; + if (bss->wpa & 1) + pairwise |= bss->wpa_pairwise; + if (bss->wpa & 2) { + if (bss->rsn_pairwise == 0) + bss->rsn_pairwise = bss->wpa_pairwise; + pairwise |= bss->rsn_pairwise; + } + if (pairwise & WPA_CIPHER_TKIP) + bss->wpa_group = WPA_CIPHER_TKIP; + else + bss->wpa_group = WPA_CIPHER_CCMP; + bss->radius->auth_server = bss->radius->auth_servers; bss->radius->acct_server = bss->radius->acct_servers; @@ -2476,6 +2479,8 @@ void hostapd_config_free(struct hostapd_ for (i = 0; i < conf->num_bss; i++) hostapd_config_free_bss(&conf->bss[i]); os_free(conf->bss); + os_free(conf->supported_rates); + os_free(conf->basic_rates); os_free(conf); } Modified: head/contrib/wpa/hostapd/config.h ============================================================================== --- head/contrib/wpa/hostapd/config.h Mon Jun 14 13:03:25 2010 (r209157) +++ head/contrib/wpa/hostapd/config.h Mon Jun 14 15:37:48 2010 (r209158) @@ -135,11 +135,11 @@ struct hostapd_tx_queue_params { int configured; }; -struct hostapd_wme_ac_params { +struct hostapd_wmm_ac_params { int cwmin; int cwmax; int aifs; - int txopLimit; /* in units of 32us */ + int txop_limit; /* in units of 32us */ int admission_control_mandatory; }; @@ -271,7 +271,7 @@ struct hostapd_bss_config { int ap_max_inactivity; int ignore_broadcast_ssid; - int wme_enabled; + int wmm_enabled; struct hostapd_vlan *vlan, *vlan_tail; @@ -371,13 +371,13 @@ struct hostapd_config { struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES]; /* - * WME AC parameters, in same order as 802.1D, i.e. + * WMM AC parameters, in same order as 802.1D, i.e. * 0 = BE (best effort) * 1 = BK (background) * 2 = VI (video) * 3 = VO (voice) */ - struct hostapd_wme_ac_params wme_ac_params[4]; + struct hostapd_wmm_ac_params wmm_ac_params[4]; enum { INTERNAL_BRIDGE_DO_NOT_CONTROL = -1, Modified: head/contrib/wpa/hostapd/ctrl_iface.c ============================================================================== --- head/contrib/wpa/hostapd/ctrl_iface.c Mon Jun 14 13:03:25 2010 (r209157) +++ head/contrib/wpa/hostapd/ctrl_iface.c Mon Jun 14 15:37:48 2010 (r209158) @@ -18,6 +18,7 @@ #include #include +#include #include "hostapd.h" #include "eloop.h" @@ -60,7 +61,8 @@ static int hostapd_ctrl_iface_attach(str dst->next = hapd->ctrl_dst; hapd->ctrl_dst = dst; wpa_hexdump(MSG_DEBUG, "CTRL_IFACE monitor attached", - (u8 *) from->sun_path, fromlen); + (u8 *) from->sun_path, + fromlen - offsetof(struct sockaddr_un, sun_path)); return 0; } @@ -74,15 +76,18 @@ static int hostapd_ctrl_iface_detach(str dst = hapd->ctrl_dst; while (dst) { if (fromlen == dst->addrlen && - os_memcmp(from->sun_path, dst->addr.sun_path, fromlen) == - 0) { + os_memcmp(from->sun_path, dst->addr.sun_path, + fromlen - offsetof(struct sockaddr_un, sun_path)) + == 0) { if (prev == NULL) hapd->ctrl_dst = dst->next; else prev->next = dst->next; os_free(dst); wpa_hexdump(MSG_DEBUG, "CTRL_IFACE monitor detached", - (u8 *) from->sun_path, fromlen); + (u8 *) from->sun_path, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 15:38: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 26B5610656C4; Mon, 14 Jun 2010 15:38:31 +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 16C608FC2C; Mon, 14 Jun 2010 15:38: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 o5EFcUIl094073; Mon, 14 Jun 2010 15:38:30 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EFcUtA094070; Mon, 14 Jun 2010 15:38:30 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006141538.o5EFcUtA094070@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Jun 2010 15:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209159 - in head/usr.sbin/wpa: . hostapd wpa_supplicant X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2010 15:38:31 -0000 Author: rpaulo Date: Mon Jun 14 15:38:30 2010 New Revision: 209159 URL: http://svn.freebsd.org/changeset/base/209159 Log: Update for hostapd & wpa_supplicant 0.6.10. Deleted: head/usr.sbin/wpa/l2_packet.c head/usr.sbin/wpa/wpa_supplicant/driver_wired.c Modified: head/usr.sbin/wpa/hostapd/Makefile head/usr.sbin/wpa/wpa_supplicant/Makefile Modified: head/usr.sbin/wpa/hostapd/Makefile ============================================================================== --- head/usr.sbin/wpa/hostapd/Makefile Mon Jun 14 15:37:48 2010 (r209158) +++ head/usr.sbin/wpa/hostapd/Makefile Mon Jun 14 15:38:30 2010 (r209159) @@ -14,7 +14,7 @@ SRCS= accounting.c aes.c aes_wrap.c ap_l ieee802_1x.c ip_addr.c md5.c mlme.c pmksa_cache.c radius.c \ radius_client.c rc4.c sha1.c sta_info.c vlan_init.c wme.c \ wpa.c wpa_auth_ie.c wpa_common.c wpa_debug.c wpabuf.c -SRCS+= l2_packet.c driver_freebsd.c os_unix.c +SRCS+= l2_packet_freebsd.c driver_freebsd.c os_unix.c MAN= hostapd.8 hostapd.conf.5 Modified: head/usr.sbin/wpa/wpa_supplicant/Makefile ============================================================================== --- head/usr.sbin/wpa/wpa_supplicant/Makefile Mon Jun 14 15:37:48 2010 (r209158) +++ head/usr.sbin/wpa/wpa_supplicant/Makefile Mon Jun 14 15:38:30 2010 (r209159) @@ -9,7 +9,7 @@ PROG= wpa_supplicant SRCS= aes.c aes_wrap.c blacklist.c common.c config.c ctrl_iface.c \ - ctrl_iface_unix.c drivers.c eloop.c events.c l2_packet.c main.c \ + ctrl_iface_unix.c drivers.c eloop.c events.c l2_packet_freebsd.c main.c\ md5.c preauth.c pmksa_cache.c rc4.c scan.c scan_helpers.c sha1.c \ wpa.c wpa_common.c wpa_debug.c wpa_ie.c wpa_supplicant.c \ wpabuf.c wpas_glue.c \ From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 15:42: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 E1C36106564A; Mon, 14 Jun 2010 15:42:14 +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 42E7F8FC16; Mon, 14 Jun 2010 15:42:14 +0000 (UTC) Received: from c122-106-175-69.carlnfd1.nsw.optusnet.com.au (c122-106-175-69.carlnfd1.nsw.optusnet.com.au [122.106.175.69]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o5EFgBBc026528 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Jun 2010 01:42:12 +1000 Date: Tue, 15 Jun 2010 01:42:10 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: John Baldwin In-Reply-To: <201006141002.59464.jhb@freebsd.org> Message-ID: <20100615011554.F37940@delplex.bde.org> References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100614230205.A37830@delplex.bde.org> <201006141002.59464.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: mdf@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, Lawrence Stewart Subject: Re: svn commit: r209119 - 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: Mon, 14 Jun 2010 15:42:15 -0000 On Mon, 14 Jun 2010, John Baldwin wrote: > On Monday 14 June 2010 9:50:10 am mdf@freebsd.org wrote: [bde wrote] >>> BTW, one reason I liked BSD code more than gnu code is that it didn't >>> use so many macros. Macros should only exist when they are not just >>> syntactic sugar, like DPCPU_SUM() and unlike CPU_FOREACH(). >> >> As a style question, I do understand (generally) why too many macros >> make the code confusing. However, the *FOREACH macros all fit the >> same pattern and having a macro to iterate protects one against >> changes in the implementation -- there's a single location to change >> if e.g. we want to make CPU_FOREACH use a bitwise operator to >> determine the next non-zero bit, rather than testing each >> individually. I usually prefer readability to making the implementation easier to change. Readability includes seeing all the details so that you can understand and debug them. Functions may also hide the details in an effectively similar way for reading (browsing) but not from debugging. > In the case of CPU_FOREACH() there is a very good chance that the > implementation details will change when we switch from cpumask_t to cpuset_t, > which is part of the reason I added it. I am less of a fan of macros that > just wrap TAILQ_FOREACH() (note that there isn't a PCPU_FOREACH() since you > can already do this via SLIST_FOREACH() now for example) such as > FOREACH_PROC_IN_SYSTEM(). I view the queue constructor and access macros as a necessary evil because they can't be written as inline functions (except in C++?). This doesn't apply to the iterator macros. > CPU_FOREACH() has additional logic in that it hides > the CPU_ABSENT() stuff, so to me it doesn't quite fall in that class. (Some > code was using pcpu_find() instead of CPU_ABSENT() to determine absent CPUs as > well FWIW.) Maybe it is the magic in them that I dislike most. I have yet to see a debugger that can even automatically print the literal macro definition when displaying lines near a macro, let alone prettyprint the context-dependent macro expansion and allow stepping through or over the expansion. gdb has problems in this area even with inline functions. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 15:52: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 B1C651065672; Mon, 14 Jun 2010 15:52:50 +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 A142C8FC19; Mon, 14 Jun 2010 15:52: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 o5EFqoFU097225; Mon, 14 Jun 2010 15:52:50 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EFqok5097224; Mon, 14 Jun 2010 15:52:50 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006141552.o5EFqok5097224@svn.freebsd.org> From: Rui Paulo Date: Mon, 14 Jun 2010 15:52: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: r209160 - in head/contrib/wpa/src: drivers l2_packet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2010 15:52:50 -0000 Author: rpaulo Date: Mon Jun 14 15:52:50 2010 New Revision: 209160 URL: http://svn.freebsd.org/changeset/base/209160 Log: Remove unused files. Deleted: head/contrib/wpa/src/drivers/Apple80211.h head/contrib/wpa/src/drivers/MobileApple80211.c head/contrib/wpa/src/drivers/MobileApple80211.h head/contrib/wpa/src/drivers/driver_atmel.c head/contrib/wpa/src/drivers/driver_broadcom.c head/contrib/wpa/src/drivers/driver_bsd.c head/contrib/wpa/src/drivers/driver_hostap.c head/contrib/wpa/src/drivers/driver_hostap.h head/contrib/wpa/src/drivers/driver_iphone.m head/contrib/wpa/src/drivers/driver_ipw.c head/contrib/wpa/src/drivers/driver_madwifi.c head/contrib/wpa/src/drivers/driver_nl80211.c head/contrib/wpa/src/drivers/driver_osx.m head/contrib/wpa/src/drivers/driver_prism54.c head/contrib/wpa/src/drivers/driver_privsep.c head/contrib/wpa/src/drivers/driver_ps3.c head/contrib/wpa/src/drivers/driver_ralink.c head/contrib/wpa/src/drivers/driver_ralink.h head/contrib/wpa/src/drivers/driver_roboswitch.c head/contrib/wpa/src/drivers/driver_test.c head/contrib/wpa/src/drivers/driver_wext.c head/contrib/wpa/src/drivers/driver_wext.h head/contrib/wpa/src/drivers/priv_netlink.h head/contrib/wpa/src/l2_packet/l2_packet_linux.c head/contrib/wpa/src/l2_packet/l2_packet_pcap.c head/contrib/wpa/src/l2_packet/l2_packet_privsep.c head/contrib/wpa/src/l2_packet/l2_packet_winpcap.c From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 16:05: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 BE91D106566B; Mon, 14 Jun 2010 16:05:22 +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 AE8F28FC1A; Mon, 14 Jun 2010 16:05: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 o5EG5M4W000225; Mon, 14 Jun 2010 16:05:22 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EG5ME4000224; Mon, 14 Jun 2010 16:05:22 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201006141605.o5EG5ME4000224@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 14 Jun 2010 16:05: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: r209161 - head/sys/arm/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 16:05:22 -0000 Author: raj Date: Mon Jun 14 16:05:21 2010 New Revision: 209161 URL: http://svn.freebsd.org/changeset/base/209161 Log: Temporarily bring back the ARM bootinfo (and make tinderbox happy). BI will be eliminated for good when powerpc transition to FDT is complete. Added: - copied unchanged from r209130, head/sys/arm/include/bootinfo.h Directory Properties: head/sys/arm/include/bootinfo.h (props changed) Modified: head/sys/arm/include/metadata.h Copied: head/sys/arm/include/bootinfo.h (from r209130, head/sys/arm/include/bootinfo.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/bootinfo.h Mon Jun 14 16:05:21 2010 (r209161, copy of r209130, head/sys/arm/include/bootinfo.h) @@ -0,0 +1,72 @@ +/*- + * Copyright (C) 2006-2008 Semihalf, Marian Balakowicz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_BOOTINFO_H_ +#define _MACHINE_BOOTINFO_H_ + +#if !defined(LOCORE) + +/* Platform hardware spec, received from loader(8) */ + +#define BI_VERSION 1 + +struct bi_mem_region { + vm_paddr_t mem_base; + vm_size_t mem_size; +}; + +struct bi_eth_addr { + u_int8_t mac_addr[6]; + u_int8_t padding[2]; +}; + +struct bootinfo { + u_int32_t bi_version; + vm_offset_t bi_bar_base; + u_int32_t bi_cpu_clk; + u_int32_t bi_bus_clk; + u_int8_t bi_mem_reg_no; + u_int8_t bi_eth_addr_no; + u_int8_t padding[2]; + + u_int8_t bi_data[1]; + /* + * The bi_data container is allocated in run time and has the + * following layout: + * + * - bi_mem_reg_no elements of struct bi_mem_region + * - bi_eth_addr_no elements of struct bi_eth_addr + */ +}; + +extern struct bootinfo *bootinfo; + +struct bi_mem_region *bootinfo_mr(void); +struct bi_eth_addr *bootinfo_eth(void); +#endif + +#endif /* _MACHINE_BOOTINFO_H_ */ Modified: head/sys/arm/include/metadata.h ============================================================================== --- head/sys/arm/include/metadata.h Mon Jun 14 15:52:50 2010 (r209160) +++ head/sys/arm/include/metadata.h Mon Jun 14 16:05:21 2010 (r209161) @@ -31,4 +31,10 @@ #define MODINFOMD_DTBP 0x1001 +/* + * XXX this is for tinderbox compilation sake only and will go away once the + * FDT transition is complete. + */ +#define MODINFOMD_BOOTINFO 0x2000 + #endif /* !_MACHINE_METADATA_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 17:02: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 2EEDD106564A; Mon, 14 Jun 2010 17:02:20 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F1D88FC1A; Mon, 14 Jun 2010 17:02: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 o5EH2JgW013381; Mon, 14 Jun 2010 17:02:19 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EH2JGP013379; Mon, 14 Jun 2010 17:02:19 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201006141702.o5EH2JGP013379@svn.freebsd.org> From: Roman Divacky Date: Mon, 14 Jun 2010 17:02: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: r209162 - head/sys/boot/i386/pxeldr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2010 17:02:20 -0000 Author: rdivacky Date: Mon Jun 14 17:02:19 2010 New Revision: 209162 URL: http://svn.freebsd.org/changeset/base/209162 Log: Pass the -N flag to linked via -Wl. Approved by: ed (mentor) Modified: head/sys/boot/i386/pxeldr/Makefile Modified: head/sys/boot/i386/pxeldr/Makefile ============================================================================== --- head/sys/boot/i386/pxeldr/Makefile Mon Jun 14 16:05:21 2010 (r209161) +++ head/sys/boot/i386/pxeldr/Makefile Mon Jun 14 17:02:19 2010 (r209162) @@ -32,7 +32,7 @@ ${BOOT}: ${LDR} ${LOADER} dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync rm ${.TARGET}.tmp -LDFLAGS+= -N -e start -Ttext ${ORG} -Wl,-S,--oformat,binary +LDFLAGS+=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary CLEANFILES+= ${LOADER} From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 17:26: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 961E71065673; Mon, 14 Jun 2010 17:26:10 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id 261958FC16; Mon, 14 Jun 2010 17:26:09 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id o5EHQ9K2052442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Jun 2010 19:26:09 +0200 (CEST) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1276536369; bh=1+g4/J/XkA+wRjrF1uobxdUhUeAOGv+ES7f1JVBQ3Yo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=k4bVqCoWvnWns6DAruDp4g5mL92Z1yhlQZXt4W5OFz0+TR45vxC+SWmOZp9Z1uDo2 /X1GpsOItcQPAfVPvuWjGLNtn/FD7wLPGx//xRyDdXnGluM8tavDGt9jHyAJwJIpH5 wiOm7/TTY3Hi7ZtYjXgzlM1RhAdEwZljGcvJr/5Q= Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o5EHQ9XB052441; Mon, 14 Jun 2010 19:26:09 +0200 (CEST) (envelope-from uqs@spoerlein.net) Date: Mon, 14 Jun 2010 19:26:09 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Ed Schouten Message-ID: <20100614172608.GD3632@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Ed Schouten , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201006140623.o5E6Nl4w067862@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201006140623.o5E6Nl4w067862@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: r209153 - head/lib/clang X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 17:26:10 -0000 On Mon, 14.06.2010 at 06:23:47 +0000, Ed Schouten wrote: > Author: ed > Date: Mon Jun 14 06:23:47 2010 > New Revision: 209153 > URL: http://svn.freebsd.org/changeset/base/209153 > > Log: > Unbreak Clang on PowerPC. > > It seems GCC 4.2.1 on PowerPC miscompiles Clang, causing it to crash > when building even simple Hello World applications. Switch back to -O1 > for this architecture. What about clang compiled using clang -O2? Ie., does clang bootstrap correctly on PPC and this is a genuine gcc 4.2.1 bug? Regards, Uli From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 17:31:47 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 1745E1065672; Mon, 14 Jun 2010 17:31:47 +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 E210D8FC18; Mon, 14 Jun 2010 17:31: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 o5EHVkBJ020143; Mon, 14 Jun 2010 17:31:46 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EHVkgS020140; Mon, 14 Jun 2010 17:31:46 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201006141731.o5EHVkgS020140@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 14 Jun 2010 17:31: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: r209168 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 17:31:47 -0000 Author: jh Date: Mon Jun 14 17:31:46 2010 New Revision: 209168 URL: http://svn.freebsd.org/changeset/base/209168 Log: Update vfs_busy(9) and vfs_unbusy(9) manual pages to better match the current behaviour of the functions. Discussed with: attilio Modified: head/share/man/man9/vfs_busy.9 head/share/man/man9/vfs_unbusy.9 Modified: head/share/man/man9/vfs_busy.9 ============================================================================== --- head/share/man/man9/vfs_busy.9 Mon Jun 14 17:28:32 2010 (r209167) +++ head/share/man/man9/vfs_busy.9 Mon Jun 14 17:31:46 2010 (r209168) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 2, 2008 +.Dd June 14, 2010 .Dt VFS_BUSY 9 .Os .Sh NAME @@ -40,9 +40,8 @@ .Sh DESCRIPTION The .Fn vfs_busy -function marks a mount point as busy. -The purpose of this -function is to synchronize access to a mount point. +function marks a mount point as busy by incrementing +the reference count of a mount point. It also delays unmounting by sleeping on .Fa mp if the @@ -50,7 +49,7 @@ if the flag is set in .Fa mp->mnt_kern_flag and the -.Dv LK_NOWAIT +.Dv MBF_NOWAIT flag is .Em not set. @@ -75,9 +74,9 @@ drop the mountlist_mtx in the critical p .Sh RETURN VALUES A 0 value is returned on success. If the mount point is being -unmounted +unmounted and MBF_NOWAIT flag is specified .Er ENOENT -will always be returned. +will be returned. .Sh ERRORS .Bl -tag -width Er .It Bq Er ENOENT Modified: head/share/man/man9/vfs_unbusy.9 ============================================================================== --- head/share/man/man9/vfs_unbusy.9 Mon Jun 14 17:28:32 2010 (r209167) +++ head/share/man/man9/vfs_unbusy.9 Mon Jun 14 17:31:46 2010 (r209168) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 29, 2008 +.Dd June 14, 2010 .Dt VFS_UNBUSY 9 .Os .Sh NAME @@ -40,23 +40,17 @@ .Sh DESCRIPTION The .Fn vfs_unbusy -function un-busies a mount point by unlocking -.Fa mp->mnt_lock . -The lock is typically acquired by calling +function un-busies a mount point by decrementing +the reference count of a mount point. +The reference count is typically incremented by calling .Xr vfs_busy 9 prior to this call. .Pp Its arguments are: .Bl -tag -width ".Fa mp" .It Fa mp -The mount point to unbusy (unlock). +The mount point to unbusy. .El -.Sh LOCKS -.Va mnt_lock -must be locked in -.Fa mp -prior to calling -this function, and it will be unlocked upon return. .Sh SEE ALSO .Xr vfs_busy 9 .Sh AUTHORS From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 17:31: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 EE7DA1065672; Mon, 14 Jun 2010 17:31:56 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2001:4dd0:ff41::b23f:aa]) by mx1.freebsd.org (Postfix) with ESMTP id AC9788FC19; Mon, 14 Jun 2010 17:31:56 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 016E32A290BF; Mon, 14 Jun 2010 19:31:54 +0200 (CEST) Date: Mon, 14 Jun 2010 19:31:53 +0200 From: Ed Schouten To: Ulrich =?iso-8859-1?Q?Sp=F6rlein?= , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <20100614173153.GL1797@hoeg.nl> References: <201006140623.o5E6Nl4w067862@svn.freebsd.org> <20100614172608.GD3632@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eWbcAUUbgrfSEG1c" Content-Disposition: inline In-Reply-To: <20100614172608.GD3632@acme.spoerlein.net> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: Re: svn commit: r209153 - head/lib/clang X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 17:31:57 -0000 --eWbcAUUbgrfSEG1c Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Ulrich, * Ulrich Sp=F6rlein wrote: > What about clang compiled using clang -O2? Ie., does clang bootstrap > correctly on PPC and this is a genuine gcc 4.2.1 bug? Well, Clang on PowerPC has some serious issues related to varargs, if I remember correctly. I don't think it's likely that a Clang binary built by Clang on PowerPC works correctly. Even if it would, we build it with -O1 right now. Bad luck. Greetings, --=20 Ed Schouten WWW: http://80386.nl/ --eWbcAUUbgrfSEG1c Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwWZ4kACgkQ52SDGA2eCwXtVwCfeI6CfJGRqxfCDdHo04cf7lmD QOcAninM7wfwtrIcgn1sP+iLd2kc3WA4 =FCMT -----END PGP SIGNATURE----- --eWbcAUUbgrfSEG1c-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 17:33: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 2D5CD1065673; Mon, 14 Jun 2010 17:33:53 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id F0CE98FC14; Mon, 14 Jun 2010 17:33:52 +0000 (UTC) MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0L4000500M4GR100@smtpauth1.wiscmail.wisc.edu>; Mon, 14 Jun 2010 12:33:52 -0500 (CDT) Received: from anacreon.physics.wisc.edu (anacreon.physics.wisc.edu [128.104.160.176]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0L4000HEVM4ET940@smtpauth1.wiscmail.wisc.edu>; Mon, 14 Jun 2010 12:33:51 -0500 (CDT) Date: Mon, 14 Jun 2010 12:33:50 -0500 From: Nathan Whitehorn In-reply-to: <20100614172608.GD3632@acme.spoerlein.net> To: Ulrich =?ISO-8859-1?Q?Sp=F6rlein?= Message-id: <20100614123350.68a8c78b@anacreon.physics.wisc.edu> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; powerpc64-portbld-freebsd9.0) Content-transfer-encoding: quoted-printable X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176 X-Spam-PmxInfo: Server=avs-9, Version=5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.6.14.172115, SenderIP=128.104.160.176 References: <201006140623.o5E6Nl4w067862@svn.freebsd.org> <20100614172608.GD3632@acme.spoerlein.net> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ed Schouten Subject: Re: svn commit: r209153 - head/lib/clang X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 17:33:53 -0000 On Mon, 14 Jun 2010 19:26:09 +0200 Ulrich Sp=C3=B6rlein wrote: > On Mon, 14.06.2010 at 06:23:47 +0000, Ed Schouten wrote: > > Author: ed > > Date: Mon Jun 14 06:23:47 2010 > > New Revision: 209153 > > URL: http://svn.freebsd.org/changeset/base/209153 > >=20 > > Log: > > Unbreak Clang on PowerPC. > > =20 > > It seems GCC 4.2.1 on PowerPC miscompiles Clang, causing it to > > crash when building even simple Hello World applications. Switch > > back to -O1 for this architecture. >=20 > What about clang compiled using clang -O2? Ie., does clang bootstrap > correctly on PPC and this is a genuine gcc 4.2.1 bug? >=20 > Regards, > Uli clang is not completely functional on PPC at the moment. It compiles simple programs fine, but has two nasty bugs (One is LLVM bug 7374 and relates to alignment of struct members, and the other is a missing implementation of va_arg for ELF systems), so is not capable of self-hosting. Given the amount of time involved in binary searching the 2D space of all of the LLVM libraries and the set of GCC optimizations added with -O2, I haven't tracked down the problem in detail. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 18:26: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 D823D10656C1; Mon, 14 Jun 2010 18:26:10 +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 C756C8FC08; Mon, 14 Jun 2010 18:26:10 +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 o5EIQAIo032350; Mon, 14 Jun 2010 18:26:10 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EIQA5o032348; Mon, 14 Jun 2010 18:26:10 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201006141826.o5EIQA5o032348@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 14 Jun 2010 18:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209169 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 18:26:10 -0000 Author: bschmidt Date: Mon Jun 14 18:26:10 2010 New Revision: 209169 URL: http://svn.freebsd.org/changeset/base/209169 Log: Fix TX retry rate handling. tx->linkq is an index to a rate table beginning with the highest available rate. Currently we always use 54m for the first retry no matter what AMRR has choosen. Fix this by setting the index to the next lower rate. Approved by: rpaulo (mentor) Tested by: Brandon Gooch MFC after: 2 weeks Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Jun 14 17:31:46 2010 (r209168) +++ head/sys/dev/iwn/if_iwn.c Mon Jun 14 18:26:10 2010 (r209169) @@ -3007,7 +3007,7 @@ iwn_tx_data(struct iwn_softc *sc, struct txant = IWN_LSB(sc->txchainmask); tx->rflags |= IWN_RFLAG_ANT(txant); } else { - tx->linkq = 0; + tx->linkq = IWN_RIDX_OFDM54 - ridx; flags |= IWN_TX_LINKQ; /* enable MRR */ } From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 19:10: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 B40D91065677; Mon, 14 Jun 2010 19:10:30 +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 A3BAF8FC1C; Mon, 14 Jun 2010 19:10: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 o5EJAUY1042373; Mon, 14 Jun 2010 19:10:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EJAUHe042371; Mon, 14 Jun 2010 19:10:30 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006141910.o5EJAUHe042371@svn.freebsd.org> From: Ed Schouten Date: Mon, 14 Jun 2010 19:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209171 - 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: Mon, 14 Jun 2010 19:10:30 -0000 Author: ed Date: Mon Jun 14 19:10:30 2010 New Revision: 209171 URL: http://svn.freebsd.org/changeset/base/209171 Log: Add Clang to OptionalObsoleteFiles.inc. This means you can now deinstall Clang by running make delete-old with WITHOUT_CLANG set. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jun 14 18:45:33 2010 (r209170) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jun 14 19:10:30 2010 (r209171) @@ -624,6 +624,18 @@ OLD_FILES+=usr/share/man/man8/zfs.8.gz OLD_FILES+=usr/share/man/man8/zpool.8.gz .endif +.if ${MK_CLANG} == no +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 +.endif + .if ${MK_CPP} == no OLD_FILES+=usr/bin/cpp OLD_FILES+=usr/share/man/man1/cpp.1.gz From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 19:39: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 AAA62106567C; Mon, 14 Jun 2010 19:39:20 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99ECB8FC1B; Mon, 14 Jun 2010 19:39: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 o5EJdKYO049800; Mon, 14 Jun 2010 19:39:20 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EJdKdk049798; Mon, 14 Jun 2010 19:39:20 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006141939.o5EJdKdk049798@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 14 Jun 2010 19:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209172 - 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, 14 Jun 2010 19:39:20 -0000 Author: marcel Date: Mon Jun 14 19:39:20 2010 New Revision: 209172 URL: http://svn.freebsd.org/changeset/base/209172 Log: Further unbreak powerpc & sparc64. Modified: head/usr.sbin/sysinstall/disks.c Modified: head/usr.sbin/sysinstall/disks.c ============================================================================== --- head/usr.sbin/sysinstall/disks.c Mon Jun 14 19:10:30 2010 (r209171) +++ head/usr.sbin/sysinstall/disks.c Mon Jun 14 19:39:20 2010 (r209172) @@ -215,6 +215,7 @@ print_command_summary(void) mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to select."); move(0, 0); } +#endif /* WITH_SLICES */ #if !defined(__ia64__) static u_char * @@ -249,8 +250,9 @@ bootalloc(char *name, size_t *size) msgDebug("bootalloc: can't stat %s\n", buf); return NULL; } -#endif +#endif /* !defined(__ia64__) */ +#ifdef WITH_SLICES #ifdef PC98 static void getBootMgr(char *dname, u_char **bootipl, size_t *bootipl_size, From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 19:54: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 C3DD9106567A; Mon, 14 Jun 2010 19:54:21 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AE4F8FC1C; Mon, 14 Jun 2010 19:54: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 o5EJsJUZ053898; Mon, 14 Jun 2010 19:54:19 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EJsJVb053895; Mon, 14 Jun 2010 19:54:19 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006141954.o5EJsJVb053895@svn.freebsd.org> From: Alan Cox Date: Mon, 14 Jun 2010 19:54: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: r209173 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 19:54:22 -0000 Author: alc Date: Mon Jun 14 19:54:19 2010 New Revision: 209173 URL: http://svn.freebsd.org/changeset/base/209173 Log: Eliminate checks for a page having a NULL object in vm_pageout_scan() and vm_pageout_page_stats(). These checks were recently introduced by the first page locking commit, r207410, but they are not needed. At the same time, eliminate some redundant accesses to the page's object field. (These accesses should have neen eliminated by r207410.) Make the assertion in vm_page_flag_set() stricter. Specifically, only managed pages should have PG_WRITEABLE set. Add a comment documenting an assertion to vm_page_flag_clear(). It has long been the case that fictitious pages have their wire count permanently set to one. Add comments to vm_page_wire() and vm_page_unwire() documenting this. Add assertions to these functions as well. Update the comment describing vm_page_unwire(). Much of the old comment had little to do with vm_page_unwire(), but a lot to do with _vm_page_deactivate(). Move relevant parts of the old comment to _vm_page_deactivate(). Only pages that belong to an object can be paged out. Therefore, it is pointless for vm_page_unwire() to acquire the page queues lock and enqueue such pages in one of the paging queues. Generally speaking, such pages are immediately freed after the call to vm_page_unwire(). Previously, it was the call to vm_page_free() that reacquired the page queues lock and removed these pages from the paging queues. Now, we will never acquire the page queues lock for this case. (It is also worth noting that since both vm_page_unwire() and vm_page_free() occurred with the page locked, the page daemon never saw the page with its object field set to NULL.) Change the panic with vm_page_unwire() to provide a more precise message. Reviewed by: kib@ Modified: head/sys/vm/vm_page.c head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Jun 14 19:39:20 2010 (r209172) +++ head/sys/vm/vm_page.c Mon Jun 14 19:54:19 2010 (r209173) @@ -487,13 +487,12 @@ vm_page_flag_set(vm_page_t m, unsigned s mtx_assert(&vm_page_queue_mtx, MA_OWNED); /* - * For a managed page, the PG_WRITEABLE flag can be set only if - * the page is VPO_BUSY. Currently this flag is only set by - * pmap_enter(). + * The PG_WRITEABLE flag can only be set if the page is managed and + * VPO_BUSY. Currently, this flag is only set by pmap_enter(). */ KASSERT((bits & PG_WRITEABLE) == 0 || - (m->flags & (PG_UNMANAGED | PG_FICTITIOUS)) != 0 || - (m->oflags & VPO_BUSY) != 0, ("PG_WRITEABLE and !VPO_BUSY")); + ((m->flags & (PG_UNMANAGED | PG_FICTITIOUS)) == 0 && + (m->oflags & VPO_BUSY) != 0), ("PG_WRITEABLE and !VPO_BUSY")); m->flags |= bits; } @@ -502,6 +501,10 @@ vm_page_flag_clear(vm_page_t m, unsigned { mtx_assert(&vm_page_queue_mtx, MA_OWNED); + /* + * The PG_REFERENCED flag can only be cleared if the object + * containing the page is locked. + */ KASSERT((bits & PG_REFERENCED) == 0 || VM_OBJECT_LOCKED(m->object), ("PG_REFERENCED and !VM_OBJECT_LOCKED")); m->flags &= ~bits; @@ -1582,6 +1585,8 @@ vm_page_free_toq(vm_page_t m) * another map, removing it from paging queues * as necessary. * + * If the page is fictitious, then its wire count must remain one. + * * The page must be locked. * This routine may not block. */ @@ -1595,8 +1600,12 @@ vm_page_wire(vm_page_t m) * it is already off the queues). */ vm_page_lock_assert(m, MA_OWNED); - if (m->flags & PG_FICTITIOUS) + if ((m->flags & PG_FICTITIOUS) != 0) { + KASSERT(m->wire_count == 1, + ("vm_page_wire: fictitious page %p's wire count isn't one", + m)); return; + } if (m->wire_count == 0) { if ((m->flags & PG_UNMANAGED) == 0) vm_pageq_remove(m); @@ -1607,32 +1616,20 @@ vm_page_wire(vm_page_t m) } /* - * vm_page_unwire: + * vm_page_unwire: * - * Release one wiring of this page, potentially - * enabling it to be paged again. + * Release one wiring of the specified page, potentially enabling it to be + * paged again. If paging is enabled, then the value of the parameter + * "activate" determines to which queue the page is added. If "activate" is + * non-zero, then the page is added to the active queue. Otherwise, it is + * added to the inactive queue. * - * Many pages placed on the inactive queue should actually go - * into the cache, but it is difficult to figure out which. What - * we do instead, if the inactive target is well met, is to put - * clean pages at the head of the inactive queue instead of the tail. - * This will cause them to be moved to the cache more quickly and - * if not actively re-referenced, freed more quickly. If we just - * stick these pages at the end of the inactive queue, heavy filesystem - * meta-data accesses can cause an unnecessary paging load on memory bound - * processes. This optimization causes one-time-use metadata to be - * reused more quickly. - * - * BUT, if we are in a low-memory situation we have no choice but to - * put clean pages on the cache queue. - * - * A number of routines use vm_page_unwire() to guarantee that the page - * will go into either the inactive or active queues, and will NEVER - * be placed in the cache - for example, just after dirtying a page. - * dirty pages in the cache are not allowed. + * However, unless the page belongs to an object, it is not enqueued because + * it cannot be paged out. * - * The page must be locked. - * This routine may not block. + * If a page is fictitious, then its wire count must alway be one. + * + * A managed page must be locked. */ void vm_page_unwire(vm_page_t m, int activate) @@ -1640,13 +1637,17 @@ vm_page_unwire(vm_page_t m, int activate if ((m->flags & PG_UNMANAGED) == 0) vm_page_lock_assert(m, MA_OWNED); - if (m->flags & PG_FICTITIOUS) + if ((m->flags & PG_FICTITIOUS) != 0) { + KASSERT(m->wire_count == 1, + ("vm_page_unwire: fictitious page %p's wire count isn't one", m)); return; + } if (m->wire_count > 0) { m->wire_count--; if (m->wire_count == 0) { atomic_subtract_int(&cnt.v_wire_count, 1); - if ((m->flags & PG_UNMANAGED) != 0) + if ((m->flags & PG_UNMANAGED) != 0 || + m->object == NULL) return; vm_page_lock_queues(); if (activate) @@ -1657,14 +1658,24 @@ vm_page_unwire(vm_page_t m, int activate } vm_page_unlock_queues(); } - } else { - panic("vm_page_unwire: invalid wire count: %d", m->wire_count); - } + } else + panic("vm_page_unwire: page %p's wire count is zero", m); } /* * Move the specified page to the inactive queue. * + * Many pages placed on the inactive queue should actually go + * into the cache, but it is difficult to figure out which. What + * we do instead, if the inactive target is well met, is to put + * clean pages at the head of the inactive queue instead of the tail. + * This will cause them to be moved to the cache more quickly and + * if not actively re-referenced, reclaimed more quickly. If we just + * stick these pages at the end of the inactive queue, heavy filesystem + * meta-data accesses can cause an unnecessary paging load on memory bound + * processes. This optimization causes one-time-use metadata to be + * reused more quickly. + * * Normally athead is 0 resulting in LRU operation. athead is set * to 1 if we want this page to be 'as if it were placed in the cache', * except without unmapping it from the process address space. Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Mon Jun 14 19:39:20 2010 (r209172) +++ head/sys/vm/vm_pageout.c Mon Jun 14 19:54:19 2010 (r209173) @@ -805,7 +805,7 @@ rescan0: /* * A held page may be undergoing I/O, so skip it. */ - if (m->hold_count || (object = m->object) == NULL) { + if (m->hold_count) { vm_page_unlock(m); vm_page_requeue(m); addl_page_shortage++; @@ -816,6 +816,7 @@ rescan0: * Don't mess with busy pages, keep in the front of the * queue, most likely are being paged out. */ + object = m->object; if (!VM_OBJECT_TRYLOCK(object) && (!vm_pageout_fallback_object_lock(m, &next) || m->hold_count != 0)) { @@ -1127,17 +1128,16 @@ unlock_and_continue: ("vm_pageout_scan: page %p isn't active", m)); next = TAILQ_NEXT(m, pageq); - object = m->object; if ((m->flags & PG_MARKER) != 0) { m = next; continue; } - if (!vm_pageout_page_lock(m, &next) || - (object = m->object) == NULL) { + if (!vm_pageout_page_lock(m, &next)) { vm_page_unlock(m); m = next; continue; } + object = m->object; if (!VM_OBJECT_TRYLOCK(object) && !vm_pageout_fallback_object_lock(m, &next)) { VM_OBJECT_UNLOCK(object); @@ -1397,12 +1397,12 @@ vm_pageout_page_stats() continue; } vm_page_lock_assert(m, MA_NOTOWNED); - if (!vm_pageout_page_lock(m, &next) || - (object = m->object) == NULL) { + if (!vm_pageout_page_lock(m, &next)) { vm_page_unlock(m); m = next; continue; } + object = m->object; if (!VM_OBJECT_TRYLOCK(object) && !vm_pageout_fallback_object_lock(m, &next)) { VM_OBJECT_UNLOCK(object); From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 20:08:27 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 52034106566C; Mon, 14 Jun 2010 20:08:27 +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 413358FC16; Mon, 14 Jun 2010 20:08:27 +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 o5EK8Rkd057261; Mon, 14 Jun 2010 20:08:27 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EK8RJ2057258; Mon, 14 Jun 2010 20:08:27 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201006142008.o5EK8RJ2057258@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 14 Jun 2010 20:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209174 - in head/sys/amd64: acpica amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 20:08:27 -0000 Author: jkim Date: Mon Jun 14 20:08:26 2010 New Revision: 209174 URL: http://svn.freebsd.org/changeset/base/209174 Log: Fix ACPI suspend/resume on amd64, which was broken since r208833. We need actual storage for FPU state to save and restore. Modified: head/sys/amd64/acpica/acpi_wakeup.c head/sys/amd64/amd64/mp_machdep.c Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Mon Jun 14 19:54:19 2010 (r209173) +++ head/sys/amd64/acpica/acpi_wakeup.c Mon Jun 14 20:08:26 2010 (r209174) @@ -245,7 +245,7 @@ acpi_sleep_machdep(struct acpi_softc *sc cr3 = rcr3(); load_cr3(KPML4phys); - stopfpu = stopxpcbs[0]->xpcb_pcb.pcb_save; + stopfpu = &stopxpcbs[0]->xpcb_pcb.pcb_user_save; if (acpi_savecpu(stopxpcbs[0])) { fpugetregs(curthread, stopfpu); Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon Jun 14 19:54:19 2010 (r209173) +++ head/sys/amd64/amd64/mp_machdep.c Mon Jun 14 20:08:26 2010 (r209174) @@ -1247,7 +1247,7 @@ cpususpend_handler(void) rf = intr_disable(); cr3 = rcr3(); - stopfpu = stopxpcbs[cpu]->xpcb_pcb.pcb_save; + stopfpu = &stopxpcbs[cpu]->xpcb_pcb.pcb_user_save; if (savectx2(stopxpcbs[cpu])) { fpugetregs(curthread, stopfpu); wbinvd(); From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 21:01: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 C63FF1065678; Mon, 14 Jun 2010 21:01:13 +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 B5C2B8FC08; Mon, 14 Jun 2010 21:01: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 o5EL1Dlf069302; Mon, 14 Jun 2010 21:01:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EL1DFO069300; Mon, 14 Jun 2010 21:01:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006142101.o5EL1DFO069300@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Jun 2010 21:01: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: r209175 - 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: Mon, 14 Jun 2010 21:01:13 -0000 Author: pjd Date: Mon Jun 14 21:01:13 2010 New Revision: 209175 URL: http://svn.freebsd.org/changeset/base/209175 Log: Eliminate dead code. Found by: Coverity Prevent CID: 5158 MFC after: 3 days Modified: head/sbin/hastd/hast_proto.c Modified: head/sbin/hastd/hast_proto.c ============================================================================== --- head/sbin/hastd/hast_proto.c Mon Jun 14 20:08:26 2010 (r209174) +++ head/sbin/hastd/hast_proto.c Mon Jun 14 21:01:13 2010 (r209175) @@ -329,9 +329,7 @@ hast_proto_recv_hdr(struct proto_conn *c *nvp = nv; return (0); fail: - if (nv != NULL) - nv_free(nv); - else if (eb != NULL) + if (eb != NULL) ebuf_free(eb); return (-1); } From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 21:18: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 4C6701065670; Mon, 14 Jun 2010 21:18:59 +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 223D98FC0C; Mon, 14 Jun 2010 21:18: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 o5ELIwIg073349; Mon, 14 Jun 2010 21:18:58 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ELIwnv073347; Mon, 14 Jun 2010 21:18:58 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006142118.o5ELIwnv073347@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Jun 2010 21:18: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: r209177 - 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: Mon, 14 Jun 2010 21:18:59 -0000 Author: pjd Date: Mon Jun 14 21:18:58 2010 New Revision: 209177 URL: http://svn.freebsd.org/changeset/base/209177 Log: Remove macros that are not really needed. The idea was to have them in case we grow more descriptors, but I'll reconsider readding them once we get there. Passing (a = b) expression to FD_ISSET() is bad idea, as FD_ISSET() evaluates its argument twice. Found by: Coverity Prevent CID: 5243 MFC after: 3 days Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Mon Jun 14 21:11:23 2010 (r209176) +++ head/sbin/hastd/hastd.c Mon Jun 14 21:18:58 2010 (r209177) @@ -400,7 +400,11 @@ static void main_loop(void) { fd_set rfds, wfds; - int fd, maxfd, ret; + int cfd, lfd, maxfd, ret; + + cfd = proto_descriptor(cfg->hc_controlconn); + lfd = proto_descriptor(cfg->hc_listenconn); + maxfd = cfd > lfd ? cfd : lfd; for (;;) { if (sigchld_received) { @@ -412,22 +416,13 @@ main_loop(void) hastd_reload(); } - maxfd = 0; + /* Setup descriptors for select(2). */ FD_ZERO(&rfds); + FD_SET(cfd, &rfds); + FD_SET(lfd, &rfds); FD_ZERO(&wfds); - - /* Setup descriptors for select(2). */ -#define SETUP_FD(conn) do { \ - fd = proto_descriptor(conn); \ - if (fd >= 0) { \ - maxfd = fd > maxfd ? fd : maxfd; \ - FD_SET(fd, &rfds); \ - FD_SET(fd, &wfds); \ - } \ -} while (0) - SETUP_FD(cfg->hc_controlconn); - SETUP_FD(cfg->hc_listenconn); -#undef SETUP_FD + FD_SET(cfd, &wfds); + FD_SET(lfd, &wfds); ret = select(maxfd + 1, &rfds, &wfds, NULL, NULL); if (ret == -1) { @@ -437,13 +432,10 @@ main_loop(void) pjdlog_exit(EX_OSERR, "select() failed"); } -#define ISSET_FD(conn) \ - (FD_ISSET((fd = proto_descriptor(conn)), &rfds) || FD_ISSET(fd, &wfds)) - if (ISSET_FD(cfg->hc_controlconn)) + if (FD_ISSET(cfd, &rfds) || FD_ISSET(cfd, &wfds)) control_handle(cfg); - if (ISSET_FD(cfg->hc_listenconn)) + if (FD_ISSET(lfd, &rfds) || FD_ISSET(lfd, &wfds)) listen_accept(); -#undef ISSET_FD } } From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 21:25: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 6F996106566C; Mon, 14 Jun 2010 21:25:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E8B38FC14; Mon, 14 Jun 2010 21:25: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 o5ELP7GJ074812; Mon, 14 Jun 2010 21:25:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ELP7aB074809; Mon, 14 Jun 2010 21:25:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201006142125.o5ELP7aB074809@svn.freebsd.org> From: Michael Tuexen Date: Mon, 14 Jun 2010 21:25: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: r209178 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 21:25:07 -0000 Author: tuexen Date: Mon Jun 14 21:25:07 2010 New Revision: 209178 URL: http://svn.freebsd.org/changeset/base/209178 Log: * Fix a bug where the length of the ASCONF-ACK was calculated wrong due to using an uninitialized variable. * Fix a bug where a NULL pointer was dereferenced when interfaces come and go at a high rate. * Fix a bug where inps where not deregistered from iterators. * Fix a race condition in freeing an association. * Fix a refcount problem related to the iterator. Each of the above bug results in a panic. It shows up when interfaces come and go at a high rate. Obtained from: rrs (partly) MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Mon Jun 14 21:18:58 2010 (r209177) +++ head/sys/netinet/sctp_asconf.c Mon Jun 14 21:25:07 2010 (r209178) @@ -826,6 +826,7 @@ send_reply: ack->serial_number = serial_num; ack->last_sent_to = NULL; ack->data = m_ack; + ack->len = 0; n = m_ack; while (n) { ack->len += SCTP_BUF_LEN(n); @@ -1025,7 +1026,8 @@ sctp_asconf_nets_cleanup(struct sctp_tcb * address. */ if (SCTP_ROUTE_HAS_VALID_IFN(&net->ro) && - SCTP_GET_IF_INDEX_FROM_ROUTE(&net->ro) != ifn->ifn_index) { + ((ifn == NULL) || + (SCTP_GET_IF_INDEX_FROM_ROUTE(&net->ro) != ifn->ifn_index))) { /* clear any cached route */ RTFREE(net->ro.ro_rt); net->ro.ro_rt = NULL; Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Jun 14 21:18:58 2010 (r209177) +++ head/sys/netinet/sctp_pcb.c Mon Jun 14 21:25:07 2010 (r209178) @@ -3074,6 +3074,9 @@ sctp_iterator_inp_being_freed(struct sct SCTP_FREE(it, SCTP_M_ITER); } else { it->inp = LIST_NEXT(it->inp, sctp_list); + if (it->inp) { + SCTP_INP_INCR_REF(it->inp); + } } /* * When its put in the refcnt is incremented so decr @@ -3114,17 +3117,10 @@ sctp_inpcb_free(struct sctp_inpcb *inp, #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 0); #endif - if (from == SCTP_CALLED_AFTER_CMPSET_OFCLOSE) { - /* - * Once we are in we can remove the flag from = 1 is only - * passed from the actual closing routines that are called - * via the sockets layer. - */ - SCTP_ITERATOR_LOCK(); - /* mark any iterators on the list or being processed */ - sctp_iterator_inp_being_freed(inp); - SCTP_ITERATOR_UNLOCK(); - } + SCTP_ITERATOR_LOCK(); + /* mark any iterators on the list or being processed */ + sctp_iterator_inp_being_freed(inp); + SCTP_ITERATOR_UNLOCK(); so = inp->sctp_socket; if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { /* been here before.. eeks.. get out of here */ @@ -4637,7 +4633,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); - SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(inp); SCTP_TCB_LOCK(stcb); @@ -4680,6 +4675,16 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (from_inpcbfree == SCTP_NORMAL_PROC) { atomic_add_int(&stcb->asoc.refcnt, -1); } + if (stcb->asoc.refcnt) { + stcb->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); + if (from_inpcbfree == SCTP_NORMAL_PROC) { + SCTP_INP_INFO_WUNLOCK(); + SCTP_INP_WUNLOCK(inp); + } + SCTP_TCB_UNLOCK(stcb); + return (0); + } asoc->state = 0; if (inp->sctp_tcbhash) { LIST_REMOVE(stcb, sctp_tcbhash); From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 21:25: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 A23E31065672; Mon, 14 Jun 2010 21:25:20 +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 91A318FC15; Mon, 14 Jun 2010 21:25: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 o5ELPKhh074887; Mon, 14 Jun 2010 21:25:20 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ELPK8H074885; Mon, 14 Jun 2010 21:25:20 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006142125.o5ELPK8H074885@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Jun 2010 21:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209179 - 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: Mon, 14 Jun 2010 21:25:20 -0000 Author: pjd Date: Mon Jun 14 21:25:20 2010 New Revision: 209179 URL: http://svn.freebsd.org/changeset/base/209179 Log: Plug memory leaks. Found by: Coverity Prevent CID: 7052, 7053, 7054, 7055 MFC after: 3 days Modified: head/sbin/hastd/metadata.c Modified: head/sbin/hastd/metadata.c ============================================================================== --- head/sbin/hastd/metadata.c Mon Jun 14 21:25:07 2010 (r209178) +++ head/sbin/hastd/metadata.c Mon Jun 14 21:25:20 2010 (r209179) @@ -96,6 +96,7 @@ metadata_read(struct hast_resource *res, rerrno = errno; pjdlog_errno(LOG_ERR, "Unable to allocate memory to read metadata"); + ebuf_free(eb); goto fail; } buf = ebuf_data(eb, NULL); @@ -154,6 +155,7 @@ metadata_read(struct hast_resource *res, nv_free(nv); goto fail; } + nv_free(nv); return (0); fail: if (opened_here) { @@ -172,6 +174,7 @@ metadata_write(struct hast_resource *res unsigned char *buf, *ptr; size_t size; ssize_t done; + int ret; buf = calloc(1, METADATA_SIZE); if (buf == NULL) { @@ -180,6 +183,8 @@ metadata_write(struct hast_resource *res return (-1); } + ret = -1; + nv = nv_alloc(); nv_add_string(nv, res->hr_name, "resource"); nv_add_uint64(nv, (uint64_t)res->hr_datasize, "datasize"); @@ -199,7 +204,7 @@ metadata_write(struct hast_resource *res nv_add_string(nv, role2str(res->hr_role), "prevrole"); if (nv_error(nv) != 0) { pjdlog_error("Unable to create metadata."); - goto fail; + goto end; } res->hr_previous_role = res->hr_role; eb = nv_hton(nv); @@ -211,12 +216,11 @@ metadata_write(struct hast_resource *res done = pwrite(res->hr_localfd, buf, METADATA_SIZE, 0); if (done < 0 || done != METADATA_SIZE) { pjdlog_errno(LOG_ERR, "Unable to write metadata"); - goto fail; + goto end; } - - return (0); -fail: + ret = 0; +end: free(buf); nv_free(nv); - return (-1); + return (ret); } From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 21:33: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 8D4D31065674; Mon, 14 Jun 2010 21:33:18 +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 7CCE88FC13; Mon, 14 Jun 2010 21:33: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 o5ELXIXC076748; Mon, 14 Jun 2010 21:33:18 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ELXIAf076746; Mon, 14 Jun 2010 21:33:18 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006142133.o5ELXIAf076746@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Jun 2010 21:33: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: r209180 - 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: Mon, 14 Jun 2010 21:33:18 -0000 Author: pjd Date: Mon Jun 14 21:33:18 2010 New Revision: 209180 URL: http://svn.freebsd.org/changeset/base/209180 Log: Plug memory leak. Found by: Coverity Prevent CID: 7051 MFC after: 3 days Modified: head/sbin/hastd/nv.c Modified: head/sbin/hastd/nv.c ============================================================================== --- head/sbin/hastd/nv.c Mon Jun 14 21:25:20 2010 (r209179) +++ head/sbin/hastd/nv.c Mon Jun 14 21:33:18 2010 (r209180) @@ -707,8 +707,10 @@ nv_add(struct nv *nv, const unsigned cha assert(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; + free(nvh); return; } + free(nvh); /* Add the actual data. */ if (ebuf_add_tail(nv->nv_ebuf, value, vsize) < 0) { assert(errno != 0); From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 21:37: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 B9D0F106564A; Mon, 14 Jun 2010 21:37:25 +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 A93058FC1C; Mon, 14 Jun 2010 21:37: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 o5ELbPBX077732; Mon, 14 Jun 2010 21:37:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ELbPlB077730; Mon, 14 Jun 2010 21:37:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006142137.o5ELbPlB077730@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Jun 2010 21:37: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: r209181 - 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: Mon, 14 Jun 2010 21:37:25 -0000 Author: pjd Date: Mon Jun 14 21:37:25 2010 New Revision: 209181 URL: http://svn.freebsd.org/changeset/base/209181 Log: Plug memory leak. Found by: Coverity Prevent CID: 7056 MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Mon Jun 14 21:33:18 2010 (r209180) +++ head/sbin/hastd/primary.c Mon Jun 14 21:37:25 2010 (r209181) @@ -447,6 +447,7 @@ init_local(struct hast_resource *res) primary_exit(EX_NOINPUT, "Unable to read activemap"); } activemap_copyin(res->hr_amp, buf, mapsize); + free(buf); if (res->hr_resuid != 0) return; /* From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 21:41: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 8AC4C106566B; Mon, 14 Jun 2010 21:41:22 +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 7A4C58FC17; Mon, 14 Jun 2010 21:41: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 o5ELfMHI078642; Mon, 14 Jun 2010 21:41:22 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ELfMwA078640; Mon, 14 Jun 2010 21:41:22 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006142141.o5ELfMwA078640@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Jun 2010 21:41: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: r209182 - 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: Mon, 14 Jun 2010 21:41:22 -0000 Author: pjd Date: Mon Jun 14 21:41:22 2010 New Revision: 209182 URL: http://svn.freebsd.org/changeset/base/209182 Log: Plug memory leak. Found by: Coverity Prevent CID: 7057 MFC after: 3 days Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Mon Jun 14 21:37:25 2010 (r209181) +++ head/sbin/hastd/secondary.c Mon Jun 14 21:41:22 2010 (r209182) @@ -295,6 +295,7 @@ init_remote(struct hast_resource *res, s nv_free(nvout); exit(EX_TEMPFAIL); } + nv_free(nvout); if (res->hr_secondary_localcnt > res->hr_primary_remotecnt && res->hr_primary_localcnt > res->hr_secondary_remotecnt) { /* Exit on split-brain. */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 21: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 7002A106567E; Mon, 14 Jun 2010 21:44:21 +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 5F8D08FC19; Mon, 14 Jun 2010 21:44: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 o5ELiLcg079377; Mon, 14 Jun 2010 21:44:21 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ELiLQ7079375; Mon, 14 Jun 2010 21:44:21 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006142144.o5ELiLQ7079375@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Jun 2010 21:44: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: r209183 - 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: Mon, 14 Jun 2010 21:44:21 -0000 Author: pjd Date: Mon Jun 14 21:44:20 2010 New Revision: 209183 URL: http://svn.freebsd.org/changeset/base/209183 Log: Initialize gctl_seq for synchronization requests. Reported by: hiroshi@soupacific.com Analysed by: Mikolaj Golub Tested by: hiroshi@soupacific.com, Mikolaj Golub MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Mon Jun 14 21:41:22 2010 (r209182) +++ head/sbin/hastd/primary.c Mon Jun 14 21:44:20 2010 (r209183) @@ -195,7 +195,10 @@ static pthread_mutex_t metadata_lock; mtx_unlock(&hio_##name##_list_lock); \ } while (0) -#define SYNCREQ(hio) do { (hio)->hio_ggio.gctl_unit = -1; } while (0) +#define SYNCREQ(hio) do { \ + (hio)->hio_ggio.gctl_unit = -1; \ + (hio)->hio_ggio.gctl_seq = 1; \ +} while (0) #define ISSYNCREQ(hio) ((hio)->hio_ggio.gctl_unit == -1) #define SYNCREQDONE(hio) do { (hio)->hio_ggio.gctl_unit = -2; } while (0) #define ISSYNCREQDONE(hio) ((hio)->hio_ggio.gctl_unit == -2) From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 21:44: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 9579A1065674; Mon, 14 Jun 2010 21:44:58 +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 6BA1E8FC21; Mon, 14 Jun 2010 21:44: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 o5ELiwqf079562; Mon, 14 Jun 2010 21:44:58 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ELiwYu079560; Mon, 14 Jun 2010 21:44:58 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006142144.o5ELiwYu079560@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Jun 2010 21:44: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: r209184 - 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: Mon, 14 Jun 2010 21:44:58 -0000 Author: pjd Date: Mon Jun 14 21:44:58 2010 New Revision: 209184 URL: http://svn.freebsd.org/changeset/base/209184 Log: Fix typos. MFC after: 3 days Modified: head/sbin/hastd/ebuf.c Modified: head/sbin/hastd/ebuf.c ============================================================================== --- head/sbin/hastd/ebuf.c Mon Jun 14 21:44:20 2010 (r209183) +++ head/sbin/hastd/ebuf.c Mon Jun 14 21:44:58 2010 (r209184) @@ -55,8 +55,8 @@ struct ebuf { size_t eb_size; }; -static int ebuf_head_extent(struct ebuf *eb, size_t size); -static int ebuf_tail_extent(struct ebuf *eb, size_t size); +static int ebuf_head_extend(struct ebuf *eb, size_t size); +static int ebuf_tail_extend(struct ebuf *eb, size_t size); struct ebuf * ebuf_alloc(size_t size) @@ -110,7 +110,7 @@ ebuf_add_head(struct ebuf *eb, const voi * We can't add more entries at the front, so we have to extend * our buffer. */ - if (ebuf_head_extent(eb, size) < 0) + if (ebuf_head_extend(eb, size) < 0) return (-1); } assert(size <= (size_t)(eb->eb_used - eb->eb_start)); @@ -137,13 +137,13 @@ ebuf_add_tail(struct ebuf *eb, const voi * We can't add more entries at the back, so we have to extend * our buffer. */ - if (ebuf_tail_extent(eb, size) < 0) + if (ebuf_tail_extend(eb, size) < 0) return (-1); } assert(size <= (size_t)(eb->eb_end - (eb->eb_used + eb->eb_size))); /* - * If data is NULL the caller just wants to reserve place. + * If data is NULL the caller just wants to reserve space. */ if (data != NULL) bcopy(data, eb->eb_used + eb->eb_size, size); @@ -203,7 +203,7 @@ ebuf_size(struct ebuf *eb) * Function adds size + (PAGE_SIZE / 4) bytes at the front of the buffer.. */ static int -ebuf_head_extent(struct ebuf *eb, size_t size) +ebuf_head_extend(struct ebuf *eb, size_t size) { unsigned char *newstart, *newused; size_t newsize; @@ -231,7 +231,7 @@ ebuf_head_extent(struct ebuf *eb, size_t * Function adds size + ((3 * PAGE_SIZE) / 4) bytes at the back. */ static int -ebuf_tail_extent(struct ebuf *eb, size_t size) +ebuf_tail_extend(struct ebuf *eb, size_t size) { unsigned char *newstart; size_t newsize; From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 21:46: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 A05C2106566B; Mon, 14 Jun 2010 21:46:48 +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 8FC6A8FC16; Mon, 14 Jun 2010 21:46: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 o5ELkmuh080021; Mon, 14 Jun 2010 21:46:48 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ELkm2Y080018; Mon, 14 Jun 2010 21:46:48 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006142146.o5ELkm2Y080018@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Jun 2010 21:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209185 - 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: Mon, 14 Jun 2010 21:46:48 -0000 Author: pjd Date: Mon Jun 14 21:46:48 2010 New Revision: 209185 URL: http://svn.freebsd.org/changeset/base/209185 Log: Correct various log messages. Submitted by: Mikolaj Golub MFC after: 3 days Modified: head/sbin/hastd/hastd.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Mon Jun 14 21:44:58 2010 (r209184) +++ head/sbin/hastd/hastd.c Mon Jun 14 21:46:48 2010 (r209185) @@ -200,7 +200,7 @@ listen_accept(void) proto_local_address(conn, laddr, sizeof(laddr)); proto_remote_address(conn, raddr, sizeof(raddr)); - pjdlog_info("Connection from %s to %s.", laddr, raddr); + pjdlog_info("Connection from %s to %s.", raddr, laddr); /* Error in setting timeout is not critical, but why should it fail? */ if (proto_timeout(conn, HAST_TIMEOUT) < 0) @@ -286,7 +286,7 @@ listen_accept(void) if (token != NULL && memcmp(token, res->hr_token, sizeof(res->hr_token)) != 0) { pjdlog_error("Token received from %s doesn't match.", raddr); - nv_add_stringf(nverr, "errmsg", "Toke doesn't match."); + nv_add_stringf(nverr, "errmsg", "Token doesn't match."); goto fail; } /* Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Mon Jun 14 21:44:58 2010 (r209184) +++ head/sbin/hastd/secondary.c Mon Jun 14 21:46:48 2010 (r209185) @@ -688,7 +688,7 @@ send_thread(void *arg) pjdlog_exit(EX_TEMPFAIL, "Unable to send reply."); } nv_free(nvout); - pjdlog_debug(2, "disk: (%p) Moving request to the free queue.", + pjdlog_debug(2, "send: (%p) Moving request to the free queue.", hio); nv_free(hio->hio_nv); hio->hio_error = 0; From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 21:56: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 91BE71065670; Mon, 14 Jun 2010 21:56:24 +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 812C08FC12; Mon, 14 Jun 2010 21:56: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 o5ELuObC082208; Mon, 14 Jun 2010 21:56:24 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ELuOLZ082206; Mon, 14 Jun 2010 21:56:24 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006142156.o5ELuOLZ082206@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Jun 2010 21:56: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: r209186 - head/sys/geom/gate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2010 21:56:24 -0000 Author: pjd Date: Mon Jun 14 21:56:24 2010 New Revision: 209186 URL: http://svn.freebsd.org/changeset/base/209186 Log: BIO_DELETE contains range we want to delete and doesn't provide any useful data, so there is no need to copy it to userland. MFC after: 3 days Modified: head/sys/geom/gate/g_gate.c Modified: head/sys/geom/gate/g_gate.c ============================================================================== --- head/sys/geom/gate/g_gate.c Mon Jun 14 21:46:48 2010 (r209185) +++ head/sys/geom/gate/g_gate.c Mon Jun 14 21:56:24 2010 (r209186) @@ -572,8 +572,8 @@ g_gate_ioctl(struct cdev *dev, u_long cm switch (bp->bio_cmd) { case BIO_READ: - break; case BIO_DELETE: + break; case BIO_WRITE: error = copyout(bp->bio_data, ggio->gctl_data, bp->bio_length); From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 21: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 0BD851065670; Mon, 14 Jun 2010 21:58:56 +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 EF37C8FC08; Mon, 14 Jun 2010 21:58:55 +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 o5ELwttG082786; Mon, 14 Jun 2010 21:58:55 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ELwtb1082784; Mon, 14 Jun 2010 21:58:55 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006142158.o5ELwtb1082784@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 14 Jun 2010 21:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209187 - head/sys/geom/gate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2010 21:58:56 -0000 Author: pjd Date: Mon Jun 14 21:58:55 2010 New Revision: 209187 URL: http://svn.freebsd.org/changeset/base/209187 Log: 'unit' can be negative, so use signed type for it. Found by: Coverity Prevent CID: 3731 MFC after: 3 days Modified: head/sys/geom/gate/g_gate.c Modified: head/sys/geom/gate/g_gate.c ============================================================================== --- head/sys/geom/gate/g_gate.c Mon Jun 14 21:56:24 2010 (r209186) +++ head/sys/geom/gate/g_gate.c Mon Jun 14 21:58:55 2010 (r209187) @@ -210,7 +210,7 @@ g_gate_start(struct bio *bp) } static struct g_gate_softc * -g_gate_hold(u_int unit, const char *name) +g_gate_hold(int unit, const char *name) { struct g_gate_softc *sc = NULL; From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 22:02: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 C09E71065675; Mon, 14 Jun 2010 22:02:18 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B00578FC0A; Mon, 14 Jun 2010 22:02: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 o5EM2I15083622; Mon, 14 Jun 2010 22:02:18 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EM2I1P083620; Mon, 14 Jun 2010 22:02:18 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201006142202.o5EM2I1P083620@svn.freebsd.org> From: "Kenneth D. Merry" Date: Mon, 14 Jun 2010 22:02: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: r209188 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 22:02:18 -0000 Author: ken Date: Mon Jun 14 22:02:18 2010 New Revision: 209188 URL: http://svn.freebsd.org/changeset/base/209188 Log: For the target port groups structures, don't allocate the initial element. This makes things easier for target implementations to calculate how many elements they need to allocate. Discussed with: mjacob, gibbs MFC after: 1 week Modified: head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Mon Jun 14 21:58:55 2010 (r209187) +++ head/sys/cam/scsi/scsi_all.h Mon Jun 14 22:02:18 2010 (r209188) @@ -902,6 +902,7 @@ struct scsi_target_group struct scsi_target_port_descriptor { uint8_t reserved[2]; uint8_t relative_target_port_identifier[2]; + uint8_t desc_list[]; }; struct scsi_target_port_group_descriptor { @@ -928,12 +929,12 @@ struct scsi_target_port_group_descriptor uint8_t status; uint8_t vendor_specific; uint8_t target_port_count; - struct scsi_target_port_descriptor descriptors[1]; + struct scsi_target_port_descriptor descriptors[]; }; struct scsi_target_group_data { uint8_t length[4]; /* length of returned data, in bytes */ - struct scsi_target_port_group_descriptor groups[1]; + struct scsi_target_port_group_descriptor groups[]; }; struct scsi_target_group_data_extended { @@ -941,7 +942,7 @@ struct scsi_target_group_data_extended { uint8_t format_type; /* STG_PDF_LENGTH or RPL_PDF_EXTENDED */ uint8_t implicit_transition_time; uint8_t reserved[2]; - struct scsi_target_port_group_descriptor groups[1]; + struct scsi_target_port_group_descriptor groups[]; }; From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 23:01: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 8F23C1065701; Mon, 14 Jun 2010 23:01:51 +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 7E3CE8FC15; Mon, 14 Jun 2010 23:01: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 o5EN1pON097150; Mon, 14 Jun 2010 23:01:51 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5EN1pnJ097146; Mon, 14 Jun 2010 23:01:51 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201006142301.o5EN1pnJ097146@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 14 Jun 2010 23:01: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: r209189 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2010 23:01:51 -0000 Author: jkim Date: Mon Jun 14 23:01:50 2010 New Revision: 209189 URL: http://svn.freebsd.org/changeset/base/209189 Log: Fix typos that broke duration calculations on protection frames. A similar fix was done for ral(4) long ago and it must be copy-and-paste bugs. Found by: clang Modified: head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_ural.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Jun 14 22:02:18 2010 (r209188) +++ head/sys/dev/usb/wlan/if_rum.c Mon Jun 14 23:01:50 2010 (r209189) @@ -1051,7 +1051,7 @@ rum_sendprot(struct rum_softc *sc, ackrate = ieee80211_ack_rate(ic->ic_rt, rate); isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; - dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort); + dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort) + ieee80211_ack_duration(ic->ic_rt, rate, isshort); flags = RT2573_TX_MORE_FRAG; if (prot == IEEE80211_PROT_RTSCTS) { Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Mon Jun 14 22:02:18 2010 (r209188) +++ head/sys/dev/usb/wlan/if_run.c Mon Jun 14 23:01:50 2010 (r209189) @@ -3179,7 +3179,7 @@ run_sendprot(struct run_softc *sc, ackrate = ieee80211_ack_rate(ic->ic_rt, rate); isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; - dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort); + dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort) + ieee80211_ack_duration(ic->ic_rt, rate, isshort); wflags = RT2860_TX_FRAG; Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Mon Jun 14 22:02:18 2010 (r209188) +++ head/sys/dev/usb/wlan/if_ural.c Mon Jun 14 23:01:50 2010 (r209189) @@ -1157,7 +1157,7 @@ ural_sendprot(struct ural_softc *sc, ackrate = ieee80211_ack_rate(ic->ic_rt, rate); isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; - dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort); + dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort) + ieee80211_ack_duration(ic->ic_rt, rate, isshort); flags = RAL_TX_RETRY(7); if (prot == IEEE80211_PROT_RTSCTS) { From owner-svn-src-head@FreeBSD.ORG Mon Jun 14 23:51: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 E8C1F1065670; Mon, 14 Jun 2010 23:51:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D81048FC08; Mon, 14 Jun 2010 23:51: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 o5ENpZE3008507; Mon, 14 Jun 2010 23:51:35 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ENpZv7008505; Mon, 14 Jun 2010 23:51:35 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201006142351.o5ENpZv7008505@svn.freebsd.org> From: Ed Maste Date: Mon, 14 Jun 2010 23:51: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: r209190 - 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, 14 Jun 2010 23:51:36 -0000 Author: emaste Date: Mon Jun 14 23:51:35 2010 New Revision: 209190 URL: http://svn.freebsd.org/changeset/base/209190 Log: Use literal format strings. Found by clang. Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Mon Jun 14 23:01:50 2010 (r209189) +++ head/usr.sbin/tzsetup/tzsetup.c Mon Jun 14 23:51:35 2010 (r209190) @@ -204,7 +204,7 @@ read_iso3166_table(void) fp = fopen(path_iso3166, "r"); if (!fp) - err(1, path_iso3166); + err(1, "%s", path_iso3166); lineno = 0; while ((s = fgetln(fp, &len)) != 0) { @@ -343,7 +343,7 @@ read_zones(void) fp = fopen(path_zonetab, "r"); if (!fp) - err(1, path_zonetab); + err(1, "%s", path_zonetab); lineno = 0; while ((line = fgetln(fp, &len)) != 0) { From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 00:25: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 7E2291065675; Tue, 15 Jun 2010 00:25:04 +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 6CF988FC1D; Tue, 15 Jun 2010 00:25: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 o5F0P42R016184; Tue, 15 Jun 2010 00:25:04 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5F0P47H016181; Tue, 15 Jun 2010 00:25:04 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201006150025.o5F0P47H016181@svn.freebsd.org> From: Rick Macklem Date: Tue, 15 Jun 2010 00:25: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: r209191 - in head/sys/fs: nfsclient nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 00:25:04 -0000 Author: rmacklem Date: Tue Jun 15 00:25:04 2010 New Revision: 209191 URL: http://svn.freebsd.org/changeset/base/209191 Log: Add MODULE_DEPEND() macros to the experimental NFS client and server so that the modules will load when kernels are built with none of the NFS* configuration options specified. I believe this resolves the problems reported by PR kern/144458 and the email on freebsd-stable@ posted by Dmitry Pryanishnikov on June 13. Tested by: kib PR: kern/144458 Reviewed by: kib MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Mon Jun 14 23:51:35 2010 (r209190) +++ head/sys/fs/nfsclient/nfs_clport.c Tue Jun 15 00:25:04 2010 (r209191) @@ -1275,4 +1275,6 @@ DECLARE_MODULE(nfscl, nfscl_mod, SI_SUB_ /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfscl, 1); MODULE_DEPEND(nfscl, nfscommon, 1, 1, 1); +MODULE_DEPEND(nfscl, krpc, 1, 1, 1); +MODULE_DEPEND(nfscl, nfssvc, 1, 1, 1); Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Mon Jun 14 23:51:35 2010 (r209190) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Tue Jun 15 00:25:04 2010 (r209191) @@ -3147,4 +3147,6 @@ DECLARE_MODULE(nfsd, nfsd_mod, SI_SUB_VF MODULE_VERSION(nfsd, 1); MODULE_DEPEND(nfsd, nfscommon, 1, 1, 1); MODULE_DEPEND(nfsd, nfslockd, 1, 1, 1); +MODULE_DEPEND(nfsd, krpc, 1, 1, 1); +MODULE_DEPEND(nfsd, nfssvc, 1, 1, 1); From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 04:47: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 8443D106567C; Tue, 15 Jun 2010 04:47:16 +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 73F988FC1A; Tue, 15 Jun 2010 04:47:16 +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 o5F4lGAY073699; Tue, 15 Jun 2010 04:47:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5F4lGrd073697; Tue, 15 Jun 2010 04:47:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006150447.o5F4lGrd073697@svn.freebsd.org> From: Ed Schouten Date: Tue, 15 Jun 2010 04:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209192 - head/usr.bin/wtmpcvt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 04:47:16 -0000 Author: ed Date: Tue Jun 15 04:47:16 2010 New Revision: 209192 URL: http://svn.freebsd.org/changeset/base/209192 Log: err() takes a printf format. Submitted by: Pawel Worach Spotted by: clang Modified: head/usr.bin/wtmpcvt/wtmpcvt.c Modified: head/usr.bin/wtmpcvt/wtmpcvt.c ============================================================================== --- head/usr.bin/wtmpcvt/wtmpcvt.c Tue Jun 15 00:25:04 2010 (r209191) +++ head/usr.bin/wtmpcvt/wtmpcvt.c Tue Jun 15 04:47:16 2010 (r209192) @@ -113,10 +113,10 @@ main(int argc, char *argv[]) /* Open files. */ in = fopen(argv[1], "r"); if (in == NULL) - err(1, argv[1]); + err(1, "%s", argv[1]); out = fopen(argv[2], "w"); if (out == NULL) - err(1, argv[2]); + err(1, "%s", argv[2]); /* Process entries. */ while (fread(&ui, sizeof ui, 1, in) == 1) { From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 07:06:55 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 3FF0B106566C; Tue, 15 Jun 2010 07:06:55 +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 15C7B8FC18; Tue, 15 Jun 2010 07:06:55 +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 o5F76soD004485; Tue, 15 Jun 2010 07:06:54 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5F76sLF004481; Tue, 15 Jun 2010 07:06:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006150706.o5F76sLF004481@svn.freebsd.org> From: Andriy Gapon Date: Tue, 15 Jun 2010 07:06: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: r209193 - head/sys/dev/sound/pcm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 07:06:55 -0000 Author: avg Date: Tue Jun 15 07:06:54 2010 New Revision: 209193 URL: http://svn.freebsd.org/changeset/base/209193 Log: sound/pcm: use non-const string as a value with SYSCTL_STRING Although the sysctls are marked with CTLFLAG_RD and the values will stay immutable, current sysctl implementation stores value pointer in void* type, which means that const qualifier is discarded anyway and some newer compilers complaint about that. We can't use de-const trick in sysctl implementation, because in that case we could miss an opposite situation where a const value is used with CTLFLAG_RW sysctl. Complaint from: gcc 4.4, clang MFC after: 2 weeks Modified: head/sys/dev/sound/pcm/feeder_eq.c head/sys/dev/sound/pcm/feeder_rate.c head/sys/dev/sound/pcm/sound.c Modified: head/sys/dev/sound/pcm/feeder_eq.c ============================================================================== --- head/sys/dev/sound/pcm/feeder_eq.c Tue Jun 15 04:47:16 2010 (r209192) +++ head/sys/dev/sound/pcm/feeder_eq.c Tue Jun 15 07:06:54 2010 (r209193) @@ -93,7 +93,7 @@ SND_DECLARE_FILE("$FreeBSD$"); static int feeder_eq_exact_rate = 0; #ifdef _KERNEL -static const char feeder_eq_presets[] = FEEDER_EQ_PRESETS; +static char feeder_eq_presets[] = FEEDER_EQ_PRESETS; SYSCTL_STRING(_hw_snd, OID_AUTO, feeder_eq_presets, CTLFLAG_RD, &feeder_eq_presets, 0, "compile-time eq presets"); Modified: head/sys/dev/sound/pcm/feeder_rate.c ============================================================================== --- head/sys/dev/sound/pcm/feeder_rate.c Tue Jun 15 04:47:16 2010 (r209192) +++ head/sys/dev/sound/pcm/feeder_rate.c Tue Jun 15 07:06:54 2010 (r209193) @@ -159,7 +159,7 @@ int feeder_rate_quality = Z_QUALITY_DEFA static int feeder_rate_polyphase_max = Z_POLYPHASE_MAX; #ifdef _KERNEL -static const char feeder_rate_presets[] = FEEDER_RATE_PRESETS; +static char feeder_rate_presets[] = FEEDER_RATE_PRESETS; SYSCTL_STRING(_hw_snd, OID_AUTO, feeder_rate_presets, CTLFLAG_RD, &feeder_rate_presets, 0, "compile-time rate presets"); Modified: head/sys/dev/sound/pcm/sound.c ============================================================================== --- head/sys/dev/sound/pcm/sound.c Tue Jun 15 04:47:16 2010 (r209192) +++ head/sys/dev/sound/pcm/sound.c Tue Jun 15 07:06:54 2010 (r209193) @@ -68,7 +68,7 @@ SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_ * XXX I've had enough with people not telling proper version/arch * while reporting problems, not after 387397913213th questions/requests. */ -static const char snd_driver_version[] = +static char snd_driver_version[] = __XSTRING(SND_DRV_VERSION)"/"MACHINE_ARCH; SYSCTL_STRING(_hw_snd, OID_AUTO, version, CTLFLAG_RD, &snd_driver_version, 0, "driver version/arch"); From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 08:03: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 7816C1065676; Tue, 15 Jun 2010 08:03:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id DD4AD8FC1E; Tue, 15 Jun 2010 08:03:14 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o5F839JD023780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Jun 2010 11:03:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o5F8392u001703; Tue, 15 Jun 2010 11:03:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5F8396T001702; Tue, 15 Jun 2010 11:03:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 15 Jun 2010 11:03:09 +0300 From: Kostik Belousov To: Andriy Gapon Message-ID: <20100615080309.GK13238@deviant.kiev.zoral.com.ua> References: <201006150706.o5F76sLF004481@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ys8nbMVQRzTucb0g" Content-Disposition: inline In-Reply-To: <201006150706.o5F76sLF004481@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209193 - head/sys/dev/sound/pcm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 08:03:15 -0000 --ys8nbMVQRzTucb0g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 15, 2010 at 07:06:54AM +0000, Andriy Gapon wrote: > Author: avg > Date: Tue Jun 15 07:06:54 2010 > New Revision: 209193 > URL: http://svn.freebsd.org/changeset/base/209193 >=20 > Log: > sound/pcm: use non-const string as a value with SYSCTL_STRING > =20 > Although the sysctls are marked with CTLFLAG_RD and the values will stay > immutable, current sysctl implementation stores value pointer in > void* type, which means that const qualifier is discarded anyway > and some newer compilers complaint about that. > We can't use de-const trick in sysctl implementation, because in that > case we could miss an opposite situation where a const value is used > with CTLFLAG_RW sysctl. > =20 > Complaint from: gcc 4.4, clang > MFC after: 2 weeks This is arguably the change for worse then better. You could add SYSCTL_STRING_CONST or the like instead. --ys8nbMVQRzTucb0g Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwXM70ACgkQC3+MBN1Mb4in3gCfR0ic4KJppz/g6mONIsP7gbLW uPUAn3k+dw9z5FOfujlyWf9M1xoaCeas =vn8Z -----END PGP SIGNATURE----- --ys8nbMVQRzTucb0g-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 08:10: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 579AC106567B; Tue, 15 Jun 2010 08:10:35 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1258FC29; Tue, 15 Jun 2010 08:10:33 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA18267; Tue, 15 Jun 2010 11:10:31 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OORE7-000Ckv-3i; Tue, 15 Jun 2010 11:10:31 +0300 Message-ID: <4C173575.1080003@freebsd.org> Date: Tue, 15 Jun 2010 11:10:29 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: Kostik Belousov References: <201006150706.o5F76sLF004481@svn.freebsd.org> <20100615080309.GK13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100615080309.GK13238@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209193 - head/sys/dev/sound/pcm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 08:10:35 -0000 on 15/06/2010 11:03 Kostik Belousov said the following: > On Tue, Jun 15, 2010 at 07:06:54AM +0000, Andriy Gapon wrote: >> Author: avg >> Date: Tue Jun 15 07:06:54 2010 >> New Revision: 209193 >> URL: http://svn.freebsd.org/changeset/base/209193 >> >> Log: >> sound/pcm: use non-const string as a value with SYSCTL_STRING >> >> Although the sysctls are marked with CTLFLAG_RD and the values will stay >> immutable, current sysctl implementation stores value pointer in >> void* type, which means that const qualifier is discarded anyway >> and some newer compilers complaint about that. >> We can't use de-const trick in sysctl implementation, because in that >> case we could miss an opposite situation where a const value is used >> with CTLFLAG_RW sysctl. >> >> Complaint from: gcc 4.4, clang >> MFC after: 2 weeks > This is arguably the change for worse then better. Arguably - yes, practically - I am not sure. See almost every other instance of SYSCTL_STRING usage, kern_mib.c most prominently. > You could add SYSCTL_STRING_CONST or the like instead. But we already have CTLFLAG_RD vs CTLFLAG_RW... Perhaps, we could have a union of void* and const void* and then assign value to the appropriate member based on the flags. But I am not sure if the benefit would be worth the effort. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 08:49:47 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 A18651065673; Tue, 15 Jun 2010 08:49:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id F324A8FC0A; Tue, 15 Jun 2010 08:49:46 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o5F8nepP027704 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Jun 2010 11:49:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o5F8neat003332; Tue, 15 Jun 2010 11:49:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5F8ndB2003331; Tue, 15 Jun 2010 11:49:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 15 Jun 2010 11:49:39 +0300 From: Kostik Belousov To: David Schultz Message-ID: <20100615084939.GL13238@deviant.kiev.zoral.com.ua> References: <201006121732.o5CHW5Cs065722@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HcLgruZUVNEEX12n" Content-Disposition: inline In-Reply-To: <201006121732.o5CHW5Cs065722@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 08:49:47 -0000 --HcLgruZUVNEEX12n Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 12, 2010 at 05:32:05PM +0000, David Schultz wrote: > Author: das > Date: Sat Jun 12 17:32:05 2010 > New Revision: 209110 > URL: http://svn.freebsd.org/changeset/base/209110 >=20 > Log: > Introduce __isnanf() as an alias for isnanf(), and make the isnan() > macro expand to __isnanf() instead of isnanf() for float arguments. > This change is needed because isnanf() isn't declared in strict POSIX > or C99 mode. > =20 > Compatibility note: Apps using isnan(float) that are compiled after > this change won't link against an older libm. > =20 > Reported by: Florian Forster May be, it makes sense to remove the default version for the isnan symbol ? diff --git a/lib/msun/Symbol.map b/lib/msun/Symbol.map index 429a76f..e39b39f 100644 --- a/lib/msun/Symbol.map +++ b/lib/msun/Symbol.map @@ -118,7 +118,6 @@ FBSD_1.0 { __isfinite; __isfinitef; __isfinitel; - isnanf; __isnanl; __isnormal; __isnormalf; diff --git a/lib/msun/src/s_isnan.c b/lib/msun/src/s_isnan.c index 0f544db..1fdbe96 100644 --- a/lib/msun/src/s_isnan.c +++ b/lib/msun/src/s_isnan.c @@ -61,4 +61,4 @@ __isnanl(long double e) return (u.bits.exp =3D=3D 32767 && (u.bits.manl !=3D 0 || u.bits.manh != =3D 0)); } =20 -__weak_reference(__isnanf, isnanf); +__sym_compat(isnanf, __isnanf, FBSD_1.0); --HcLgruZUVNEEX12n Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwXPqMACgkQC3+MBN1Mb4hkfgCdEXPrzD/WPEV0tjpIdYOIy7Tw iRQAn0QKK9aMZFg9i0JyHs+bwkJn7cn1 =okqS -----END PGP SIGNATURE----- --HcLgruZUVNEEX12n-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 08:53: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 068A61065677; Tue, 15 Jun 2010 08:53:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA5A68FC1E; Tue, 15 Jun 2010 08:53: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 o5F8rDnS027693; Tue, 15 Jun 2010 08:53:13 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5F8rDPI027691; Tue, 15 Jun 2010 08:53:13 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006150853.o5F8rDPI027691@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 15 Jun 2010 08:53: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: r209194 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2010 08:53:15 -0000 Author: ae Date: Tue Jun 15 08:53:13 2010 New Revision: 209194 URL: http://svn.freebsd.org/changeset/base/209194 Log: * Include sys/systm.h for KASSERT() * Remove unneeded includes and comment * Replace home made OFFSETOF() macro with standard offsetof() Pointed out by: bde Approved by: kib (mentor) Modified: head/sys/netgraph/ng_patch.c Modified: head/sys/netgraph/ng_patch.c ============================================================================== --- head/sys/netgraph/ng_patch.c Tue Jun 15 07:06:54 2010 (r209193) +++ head/sys/netgraph/ng_patch.c Tue Jun 15 08:53:13 2010 (r209194) @@ -29,10 +29,9 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include -#include /* be64toh(), htobe64() */ -#include +#include #include #include #include @@ -47,8 +46,6 @@ static ng_newhook_t ng_patch_newhook; static ng_rcvdata_t ng_patch_rcvdata; static ng_disconnect_t ng_patch_disconnect; -#define OFFSETOF(s, e) ((char *)&((s *)0)->e - (char *)((s *)0)) - static int ng_patch_config_getlen(const struct ng_parse_type *type, const u_char *start, const u_char *buf) @@ -56,7 +53,7 @@ ng_patch_config_getlen(const struct ng_p const struct ng_patch_config *p; p = (const struct ng_patch_config *)(buf - - OFFSETOF(struct ng_patch_config, ops)); + offsetof(struct ng_patch_config, ops)); return (p->count); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 08:58: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 74E2D1065676; Tue, 15 Jun 2010 08:58:17 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6350D8FC13; Tue, 15 Jun 2010 08:58: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 o5F8wHQh028869; Tue, 15 Jun 2010 08:58:17 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5F8wHJ8028866; Tue, 15 Jun 2010 08:58:17 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201006150858.o5F8wHJ8028866@svn.freebsd.org> From: Alexander Leidinger Date: Tue, 15 Jun 2010 08:58: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: r209195 - in head: etc/periodic/daily share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 08:58:17 -0000 Author: netchild Date: Tue Jun 15 08:58:16 2010 New Revision: 209195 URL: http://svn.freebsd.org/changeset/base/209195 Log: Add a periodic zfs scrub script. Features: - configurable amount of days between scrubs (default value or per pool) - do not scrub directly after pool creation (respects the configured number of days between scrubs) - do not scrub if a scrub is in progress - tells how to see the status of the scrub - tells how many days since the last scrub if it skips the scrubbing - warns if a non-existent pool is specified explicitely (default: no pools specified -> all currently imported pools are handled) - runs late in the periodic run to not slow down the other periodic daily scripts Discussed on: fs@ Added: head/etc/periodic/daily/800.scrub-zfs (contents, props changed) Modified: head/share/man/man5/periodic.conf.5 Added: head/etc/periodic/daily/800.scrub-zfs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/periodic/daily/800.scrub-zfs Tue Jun 15 08:58:16 2010 (r209195) @@ -0,0 +1,86 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + +: ${daily_scrub_zfs_default_threshold=30} + +case "$daily_scrub_zfs_enable" in + [Yy][Ee][Ss]) + echo + echo 'Scrubbing of zfs pools:' + + if [ -z "${daily_scrub_zfs_pools}" ]; then + daily_scrub_zfs_pools="$(zpool list -H -o name)" + fi + + for pool in ${daily_scrub_zfs_pools}; do + # sanity check + zpool list ${pool} >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo " WARNING: pool '${pool}' specified in" + echo " '/etc/periodic.conf:daily_scrub_zfs_pools'" + echo " does not exist" + continue + fi + + # successful only if there is at least one pool to scrub + rc=0 + + # determine how many days shall be between scrubs + eval _pool_threshold=\${daily_scrub_zfs_${pool}_threshold} + if [ -z "${_pool_threshold}" ];then + _pool_threshold=${daily_scrub_zfs_default_threshold} + fi + + _last_scrub=$(zpool history ${pool} | \ + egrep "^[0-9\.\:\-]{19} zpool scrub ${pool}\$" | tail -1 |\ + cut -d ' ' -f 1) + if [ -z "${_last_scrub}" ]; then + # creation time of the pool if no scrub was done + _last_scrub=$(zpool history ${pool} | \ + sed -ne '2s/ .*$//p') + fi + + # Now minus last scrub (both in seconds) converted to days. + _scrub_diff=$(expr -e \( $(date +%s) - \ + $(date -j -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24) + if [ ${_scrub_diff} -le ${_pool_threshold} ]; then + echo " skipping scrubbing of pool '${pool}':" + echo " last scrubbing is ${_scrub_diff} days ago, threshold is set to ${_pool_threshold} days" + continue + fi + + _status="$(zpool status ${pool} | grep scrub:)" + case "${_status}" in + *"scrub in progress"*) + echo " scrubbing of pool '${pool}' already in progress, skipping:" + ;; + *"none requested"*) + echo " starting first scrubbing (after reboot) of pool '${pool}':" + zpool scrub ${pool} + ;; + *) + echo " starting scrubbing of pool '${pool}':" + zpool scrub ${pool} + ;; + esac + + echo " consult 'zpool status ${pool}' for the result" + done + ;; + + *) + rc=0 + ;; +esac + +exit $rc Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Tue Jun 15 08:53:13 2010 (r209194) +++ head/share/man/man5/periodic.conf.5 Tue Jun 15 08:58:16 2010 (r209195) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 12, 2007 +.Dd June 15, 2010 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -611,6 +611,25 @@ when .Va daily_queuerun_enable is set to .Dq Li YES . +.It Va daily_scrub_zfs_enable +.Pq Vt bool +Set to +.Dq Li YES +if you want to run a zfs scrub periodically. +.It Va daily_scrub_zfs_pools +.Pq Vt str +A space separated list of names of zfs pools to scrub. +If the list is empty or not set, all zfs pools are scrubbed. +.It Va daily_scrub_zfs_default_threshold +.Pq Vt int +Number of days between a scrub if no pool-specific threshold is set. +The default value if no value is set is 30. +.It Va daily_scrub_zfs_ Ns Ao Ar poolname Ac Ns Va _threshold +.Pq Vt int +The same as +.Va daily_scrub_zfs_default_threshold +but specific to the pool +.Va Ns Ao Ar poolname Ac Ns . .It Va daily_local .Pq Vt str Set to a list of extra scripts that should be run after all other From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 09:12: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 23FD9106566C; Tue, 15 Jun 2010 09:12:32 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3B9C8FC08; Tue, 15 Jun 2010 09:12: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 o5F9CVaW032156; Tue, 15 Jun 2010 09:12:31 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5F9CVLD032155; Tue, 15 Jun 2010 09:12:31 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201006150912.o5F9CVLD032155@svn.freebsd.org> From: Fabien Thomas Date: Tue, 15 Jun 2010 09:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209196 - 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, 15 Jun 2010 09:12:32 -0000 Author: fabient Date: Tue Jun 15 09:12:31 2010 New Revision: 209196 URL: http://svn.freebsd.org/changeset/base/209196 Log: Set the comment at the right place for PMC uncore classes. Submitted by: rstone MFC after: 1 month Modified: head/sys/sys/pmc.h Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Tue Jun 15 08:58:16 2010 (r209195) +++ head/sys/sys/pmc.h Tue Jun 15 09:12:31 2010 (r209196) @@ -110,10 +110,10 @@ enum pmc_cputype { __PMC_CLASS(P6) /* Intel Pentium Pro counters */ \ __PMC_CLASS(P4) /* Intel Pentium-IV counters */ \ __PMC_CLASS(IAF) /* Intel Core2/Atom, fixed function */ \ - __PMC_CLASS(IAP) /* Intel Core...Atom, programmable */ \ - __PMC_CLASS(UCF) /* Intel Uncore programmable */ \ - __PMC_CLASS(UCP) /* Intel Uncore fixed function */ \ - __PMC_CLASS(XSCALE) /* Intel XScale counters */ \ + __PMC_CLASS(IAP) /* Intel Core...Atom, programmable */ \ + __PMC_CLASS(UCF) /* Intel Uncore fixed function */ \ + __PMC_CLASS(UCP) /* Intel Uncore programmable */ \ + __PMC_CLASS(XSCALE) /* Intel XScale counters */ \ __PMC_CLASS(MIPS24K) /* MIPS 24K */ enum pmc_class { From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 09:18:27 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 7982B106566C; Tue, 15 Jun 2010 09:18:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 699448FC23; Tue, 15 Jun 2010 09:18:27 +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 o5F9IR0l033508; Tue, 15 Jun 2010 09:18:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5F9IRcS033506; Tue, 15 Jun 2010 09:18:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006150918.o5F9IRcS033506@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 15 Jun 2010 09:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209197 - 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, 15 Jun 2010 09:18:27 -0000 Author: kib Date: Tue Jun 15 09:18:27 2010 New Revision: 209197 URL: http://svn.freebsd.org/changeset/base/209197 Log: Add assert to check that the (current) thread is in critical section. MFC after: 1 month Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue Jun 15 09:12:31 2010 (r209196) +++ head/sys/sys/proc.h Tue Jun 15 09:18:27 2010 (r209197) @@ -325,6 +325,9 @@ do { \ #define THREAD_LOCKPTR_ASSERT(td, lock) #endif +#define CRITSECT_ASSERT(td) \ + KASSERT((td)->td_critnest >= 1, ("Not in critical section")); + /* * Flags kept in td_flags: * To change these you MUST have the scheduler lock. From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 09:19: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 CE4D31065672; Tue, 15 Jun 2010 09:19:33 +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 BD49C8FC13; Tue, 15 Jun 2010 09:19: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 o5F9JXjX033779; Tue, 15 Jun 2010 09:19:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5F9JXSl033775; Tue, 15 Jun 2010 09:19:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006150919.o5F9JXSl033775@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 15 Jun 2010 09:19: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: r209198 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2010 09:19:33 -0000 Author: kib Date: Tue Jun 15 09:19:33 2010 New Revision: 209198 URL: http://svn.freebsd.org/changeset/base/209198 Log: Use critical sections instead of disabling local interrupts to ensure the consistency between PCPU fpcurthread and the state of the FPU. Explicitely assert that the calling conventions for fpudrop() are adhered too. In cpu_thread_exit(), add missed critical section entrance. Reviewed by: bde Tested by: pho MFC after: 1 month Modified: head/sys/amd64/amd64/fpu.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/vm_machdep.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Tue Jun 15 09:18:27 2010 (r209197) +++ head/sys/amd64/amd64/fpu.c Tue Jun 15 09:19:33 2010 (r209198) @@ -115,6 +115,9 @@ fpuinit(void) u_int mxcsr; u_short control; + /* + * It is too early for critical_enter() to work on AP. + */ savecrit = intr_disable(); stop_emulating(); fninit(); @@ -141,16 +144,15 @@ fpuinit(void) void fpuexit(struct thread *td) { - register_t savecrit; - savecrit = intr_disable(); + critical_enter(); if (curthread == PCPU_GET(fpcurthread)) { stop_emulating(); fxsave(PCPU_GET(curpcb)->pcb_save); start_emulating(); PCPU_SET(fpcurthread, 0); } - intr_restore(savecrit); + critical_exit(); } int @@ -351,10 +353,9 @@ static char fpetable[128] = { int fputrap() { - register_t savecrit; u_short control, status; - savecrit = intr_disable(); + critical_enter(); /* * Interrupt handling (for another interrupt) may have pushed the @@ -371,7 +372,7 @@ fputrap() if (PCPU_GET(fpcurthread) == curthread) fnclex(); - intr_restore(savecrit); + critical_exit(); return (fpetable[status & ((~control & 0x3f) | 0x40)]); } @@ -389,12 +390,13 @@ void fpudna(void) { struct pcb *pcb; - register_t s; + critical_enter(); if (PCPU_GET(fpcurthread) == curthread) { printf("fpudna: fpcurthread == curthread %d times\n", ++err_count); stop_emulating(); + critical_exit(); return; } if (PCPU_GET(fpcurthread) != NULL) { @@ -404,7 +406,6 @@ fpudna(void) curthread, curthread->td_proc->p_pid); panic("fpudna"); } - s = intr_disable(); stop_emulating(); /* * Record new context early in case frstor causes a trap. @@ -428,19 +429,17 @@ fpudna(void) pcb->pcb_flags |= PCB_USERFPUINITDONE; } else fxrstor(pcb->pcb_save); - intr_restore(s); + critical_exit(); } -/* - * This should be called with interrupts disabled and only when the owning - * FPU thread is non-null. - */ void fpudrop() { struct thread *td; td = PCPU_GET(fpcurthread); + KASSERT(td == curthread, ("fpudrop: fpcurthread != curthread")); + CRITSECT_ASSERT(td); PCPU_SET(fpcurthread, NULL); td->td_pcb->pcb_flags &= ~PCB_FPUINITDONE; start_emulating(); @@ -454,7 +453,6 @@ int fpugetuserregs(struct thread *td, struct savefpu *addr) { struct pcb *pcb; - register_t s; pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_USERFPUINITDONE) == 0) { @@ -462,13 +460,13 @@ fpugetuserregs(struct thread *td, struct addr->sv_env.en_cw = pcb->pcb_initial_fpucw; return (_MC_FPOWNED_NONE); } - s = intr_disable(); + critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { fxsave(addr); - intr_restore(s); + critical_exit(); return (_MC_FPOWNED_FPU); } else { - intr_restore(s); + critical_exit(); bcopy(&pcb->pcb_user_save, addr, sizeof(*addr)); return (_MC_FPOWNED_PCB); } @@ -478,7 +476,6 @@ int fpugetregs(struct thread *td, struct savefpu *addr) { struct pcb *pcb; - register_t s; pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) { @@ -486,13 +483,13 @@ fpugetregs(struct thread *td, struct sav addr->sv_env.en_cw = pcb->pcb_initial_fpucw; return (_MC_FPOWNED_NONE); } - s = intr_disable(); + critical_enter(); if (td == PCPU_GET(fpcurthread)) { fxsave(addr); - intr_restore(s); + critical_exit(); return (_MC_FPOWNED_FPU); } else { - intr_restore(s); + critical_exit(); bcopy(pcb->pcb_save, addr, sizeof(*addr)); return (_MC_FPOWNED_PCB); } @@ -505,16 +502,15 @@ void fpusetuserregs(struct thread *td, struct savefpu *addr) { struct pcb *pcb; - register_t s; pcb = td->td_pcb; - s = intr_disable(); + critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { fxrstor(addr); - intr_restore(s); + critical_exit(); pcb->pcb_flags |= PCB_FPUINITDONE | PCB_USERFPUINITDONE; } else { - intr_restore(s); + critical_exit(); bcopy(addr, &td->td_pcb->pcb_user_save, sizeof(*addr)); if (PCB_USER_FPU(pcb)) pcb->pcb_flags |= PCB_FPUINITDONE; @@ -526,15 +522,14 @@ void fpusetregs(struct thread *td, struct savefpu *addr) { struct pcb *pcb; - register_t s; pcb = td->td_pcb; - s = intr_disable(); + critical_enter(); if (td == PCPU_GET(fpcurthread)) { fxrstor(addr); - intr_restore(s); + critical_exit(); } else { - intr_restore(s); + critical_exit(); bcopy(addr, td->td_pcb->pcb_save, sizeof(*addr)); } if (PCB_USER_FPU(pcb)) @@ -652,13 +647,12 @@ int fpu_kern_leave(struct thread *td, struct fpu_kern_ctx *ctx) { struct pcb *pcb; - register_t savecrit; pcb = td->td_pcb; - savecrit = intr_disable(); + critical_enter(); if (curthread == PCPU_GET(fpcurthread)) fpudrop(); - intr_restore(savecrit); + critical_exit(); pcb->pcb_save = ctx->prev; if (pcb->pcb_save == &pcb->pcb_user_save) { if ((pcb->pcb_flags & PCB_USERFPUINITDONE) != 0) Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Jun 15 09:18:27 2010 (r209197) +++ head/sys/amd64/amd64/machdep.c Tue Jun 15 09:19:33 2010 (r209198) @@ -2119,10 +2119,9 @@ set_fpcontext(struct thread *td, const m void fpstate_drop(struct thread *td) { - register_t s; KASSERT(PCB_USER_FPU(td->td_pcb), ("fpstate_drop: kernel-owned fpu")); - s = intr_disable(); + critical_enter(); if (PCPU_GET(fpcurthread) == td) fpudrop(); /* @@ -2137,7 +2136,7 @@ fpstate_drop(struct thread *td) */ curthread->td_pcb->pcb_flags &= ~(PCB_FPUINITDONE | PCB_USERFPUINITDONE); - intr_restore(s); + critical_exit(); } int Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Tue Jun 15 09:18:27 2010 (r209197) +++ head/sys/amd64/amd64/vm_machdep.c Tue Jun 15 09:19:33 2010 (r209198) @@ -265,8 +265,10 @@ cpu_thread_exit(struct thread *td) { struct pcb *pcb; + critical_enter(); if (td == PCPU_GET(fpcurthread)) fpudrop(); + critical_exit(); pcb = td->td_pcb; From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 09:30: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 9A5D4106564A; Tue, 15 Jun 2010 09:30:36 +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 89D4D8FC26; Tue, 15 Jun 2010 09:30: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 o5F9Ua8c036220; Tue, 15 Jun 2010 09:30:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5F9Uagw036218; Tue, 15 Jun 2010 09:30:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006150930.o5F9Uagw036218@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 15 Jun 2010 09:30: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: r209199 - head/share/examples/kld/syscall/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2010 09:30:36 -0000 Author: kib Date: Tue Jun 15 09:30:36 2010 New Revision: 209199 URL: http://svn.freebsd.org/changeset/base/209199 Log: Fix the syscall module name after r205320. Submitted by: Vladislav Movchan MFC after: 1 week Modified: head/share/examples/kld/syscall/test/call.c Modified: head/share/examples/kld/syscall/test/call.c ============================================================================== --- head/share/examples/kld/syscall/test/call.c Tue Jun 15 09:19:33 2010 (r209198) +++ head/share/examples/kld/syscall/test/call.c Tue Jun 15 09:30:36 2010 (r209199) @@ -41,7 +41,7 @@ main(int argc __unused, char **argv __un struct module_stat stat; stat.version = sizeof(stat); - modstat(modfind("syscall"), &stat); + modstat(modfind("sys/syscall"), &stat); syscall_num = stat.data.intval; return syscall (syscall_num); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 10:01: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 098811065676; Tue, 15 Jun 2010 10:01:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3EF78FC27; Tue, 15 Jun 2010 10:01: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 o5FA1nYm043140; Tue, 15 Jun 2010 10:01:49 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FA1ng7043135; Tue, 15 Jun 2010 10:01:49 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006151001.o5FA1ng7043135@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 15 Jun 2010 10:01: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: r209200 - head/gnu/lib/libdialog/TESTS X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 10:01:50 -0000 Author: ae Date: Tue Jun 15 10:01:49 2010 New Revision: 209200 URL: http://svn.freebsd.org/changeset/base/209200 Log: Make all tests in libdialog compilable. Fix coredump in menu3.c. Approved by: kib (mentor) Modified: head/gnu/lib/libdialog/TESTS/check3.c head/gnu/lib/libdialog/TESTS/menu3.c head/gnu/lib/libdialog/TESTS/radio1.c head/gnu/lib/libdialog/TESTS/radio3.c Modified: head/gnu/lib/libdialog/TESTS/check3.c ============================================================================== --- head/gnu/lib/libdialog/TESTS/check3.c Tue Jun 15 09:30:36 2010 (r209199) +++ head/gnu/lib/libdialog/TESTS/check3.c Tue Jun 15 10:01:49 2010 (r209200) @@ -47,13 +47,13 @@ static int spending; static int check(dialogMenuItem *self) { - return ((int)self->data == spending); + return ((int)(intptr_t)self->data == spending); } static int spend(dialogMenuItem *self) { - spending = (int)self->data; + spending = (int)(intptr_t)self->data; return DITEM_SUCCESS | DITEM_REDRAW; } Modified: head/gnu/lib/libdialog/TESTS/menu3.c ============================================================================== --- head/gnu/lib/libdialog/TESTS/menu3.c Tue Jun 15 09:30:36 2010 (r209199) +++ head/gnu/lib/libdialog/TESTS/menu3.c Tue Jun 15 10:01:49 2010 (r209200) @@ -44,7 +44,7 @@ maybe(dialogMenuItem *self) static char *insurance[] = { "1,000,000", "Mondo insurance policy", "Off", "5,000,000", "Mega insurance policy", "Off", - "10,000,000", "Friend! Most Favored customer!" + "10,000,000", "Friend! Most Favored customer!", "On" }; static void Modified: head/gnu/lib/libdialog/TESTS/radio1.c ============================================================================== --- head/gnu/lib/libdialog/TESTS/radio1.c Tue Jun 15 09:30:36 2010 (r209199) +++ head/gnu/lib/libdialog/TESTS/radio1.c Tue Jun 15 10:01:49 2010 (r209200) @@ -31,13 +31,13 @@ static int spending; static int check(dialogMenuItem *self) { - return ((int)self->data == spending); + return ((int)(intptr_t)self->data == spending); } static int spend(dialogMenuItem *self) { - spending = (int)self->data; + spending = (int)(intptr_t)self->data; return DITEM_SUCCESS | DITEM_REDRAW; } Modified: head/gnu/lib/libdialog/TESTS/radio3.c ============================================================================== --- head/gnu/lib/libdialog/TESTS/radio3.c Tue Jun 15 09:30:36 2010 (r209199) +++ head/gnu/lib/libdialog/TESTS/radio3.c Tue Jun 15 10:01:49 2010 (r209200) @@ -31,13 +31,13 @@ static int spending; static int check(dialogMenuItem *self) { - return ((int)self->data == spending); + return ((int)(intptr_t)self->data == spending); } static int spend(dialogMenuItem *self) { - spending = (int)self->data; + spending = (int)(intptr_t)self->data; return DITEM_SUCCESS | DITEM_REDRAW; } From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 11:37: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 D7F9B1065678; Tue, 15 Jun 2010 11:37:33 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7BA88FC13; Tue, 15 Jun 2010 11:37: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 o5FBbXdD067018; Tue, 15 Jun 2010 11:37:33 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FBbXuM067017; Tue, 15 Jun 2010 11:37:33 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201006151137.o5FBbXuM067017@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 15 Jun 2010 11:37: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: r209201 - head/contrib/tzcode/zic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 11:37:33 -0000 Author: edwin Date: Tue Jun 15 11:37:33 2010 New Revision: 209201 URL: http://svn.freebsd.org/changeset/base/209201 Log: Make mandoc/mdocml happy. Submitted by: Uli(?) via gmane.comp.time.tz Modified: head/contrib/tzcode/zic/zic.8 Modified: head/contrib/tzcode/zic/zic.8 ============================================================================== --- head/contrib/tzcode/zic/zic.8 Tue Jun 15 10:01:49 2010 (r209200) +++ head/contrib/tzcode/zic/zic.8 Tue Jun 15 11:37:33 2010 (r209201) @@ -120,9 +120,9 @@ Non-blank lines are expected to be of on rule lines, zone lines, and link lines. .Pp A rule line has the form: -.Dl "Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +.Dl "Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S" For example: -.Dl "Rule US 1967 1973 \- Apr lastSun 2:00 1:00 D +.Dl "Rule US 1967 1973 \- Apr lastSun 2:00 1:00 D" .Pp The fields that make up a rule line are: .Bl -tag -width "LETTER/S" -offset indent @@ -262,7 +262,7 @@ the variable part is null. A zone line has the form: .Dl "Zone NAME GMTOFF RULES/SAVE FORMAT [UNTILYEAR [MONTH [DAY [TIME]]]]" For example: -.Dl "Zone Australia/Adelaide 9:30 Aus CST 1971 Oct 31 2:00 +.Dl "Zone Australia/Adelaide 9:30 Aus CST 1971 Oct 31 2:00" The fields that make up a zone line are: .Bl -tag -width indent .It NAME @@ -319,9 +319,9 @@ continuation. .El .Pp A link line has the form -.Dl "Link LINK-FROM LINK-TO +.Dl "Link LINK-FROM LINK-TO" For example: -.Dl "Link Europe/Istanbul Asia/Istanbul +.Dl "Link Europe/Istanbul Asia/Istanbul" The .Em LINK-FROM field should appear as the @@ -335,9 +335,9 @@ Except for continuation lines, lines may appear in any order in the input. .Pp Lines in the file that describes leap seconds have the following form: -.Dl "Leap YEAR MONTH DAY HH:MM:SS CORR R/S +.Dl "Leap YEAR MONTH DAY HH:MM:SS CORR R/S" For example: -.Dl "Leap 1974 Dec 31 23:59:60 + S +.Dl "Leap 1974 Dec 31 23:59:60 + S" The .Em YEAR , .Em MONTH , From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 13:14: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 20A5B1065673; Tue, 15 Jun 2010 13:14:45 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 818FC8FC16; Tue, 15 Jun 2010 13:14:44 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id o5FDEhNj093944; Tue, 15 Jun 2010 09:14:43 -0400 (EDT) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id o5FDEhEc093943; Tue, 15 Jun 2010 09:14:43 -0400 (EDT) (envelope-from das@freebsd.org) Date: Tue, 15 Jun 2010 09:14:43 -0400 From: David Schultz To: Kostik Belousov Message-ID: <20100615131443.GA93094@zim.MIT.EDU> Mail-Followup-To: Kostik Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201006121732.o5CHW5Cs065722@svn.freebsd.org> <20100615084939.GL13238@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100615084939.GL13238@deviant.kiev.zoral.com.ua> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 13:14:45 -0000 On Tue, Jun 15, 2010, Kostik Belousov wrote: > On Sat, Jun 12, 2010 at 05:32:05PM +0000, David Schultz wrote: > > Author: das > > Date: Sat Jun 12 17:32:05 2010 > > New Revision: 209110 > > URL: http://svn.freebsd.org/changeset/base/209110 > > > > Log: > > Introduce __isnanf() as an alias for isnanf(), and make the isnan() > > macro expand to __isnanf() instead of isnanf() for float arguments. > > This change is needed because isnanf() isn't declared in strict POSIX > > or C99 mode. > > > > Compatibility note: Apps using isnan(float) that are compiled after > > this change won't link against an older libm. > > > > Reported by: Florian Forster > > May be, it makes sense to remove the default version for the isnan symbol ? Wouldn't this mean apps that use isnanf() directly will no longer compile? isnanf() is a historical BSD interface, and although it's been deprecated for many years, it's still declared (if __BSD_VISIBLE). Oops, to complicate matters further, I just noticed that we already have isnanf and __isnanf symbols in libc, so maybe the new symbol isn't needed. (isnan() and isnanf() are in libc because that's where they were historically.) The second version in libm looks like a mistake (wrong scope of the #if 0 in s_isnan.c.) Perhaps we could just remove the duplicate symbols from libm. Better would be to remove the symbols from libc and have them in libm where they belong, but I'm not sure if that would break anything. Historically that was impractical due to the practice of bumping the version number of libc, but not libm, every major release: libm.so.2 had to be prepared to link against libc.so.4 for a 4.X application and libc.so.5 for a 5.X application. I also just noticed that there's no MLINK for isnanf, and there probably never has been... From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 14:06: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 2C13C1065670; Tue, 15 Jun 2010 14:06:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 8BE3C8FC17; Tue, 15 Jun 2010 14:06:55 +0000 (UTC) Received: from c122-106-175-69.carlnfd1.nsw.optusnet.com.au (c122-106-175-69.carlnfd1.nsw.optusnet.com.au [122.106.175.69]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o5FE6pYl014814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Jun 2010 00:06:52 +1000 Date: Wed, 16 Jun 2010 00:06:50 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Andriy Gapon In-Reply-To: <4C173575.1080003@freebsd.org> Message-ID: <20100615231528.A38864@delplex.bde.org> References: <201006150706.o5F76sLF004481@svn.freebsd.org> <20100615080309.GK13238@deviant.kiev.zoral.com.ua> <4C173575.1080003@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Kostik Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209193 - head/sys/dev/sound/pcm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 14:06:56 -0000 On Tue, 15 Jun 2010, Andriy Gapon wrote: > on 15/06/2010 11:03 Kostik Belousov said the following: >> On Tue, Jun 15, 2010 at 07:06:54AM +0000, Andriy Gapon wrote: >>> Log: >>> sound/pcm: use non-const string as a value with SYSCTL_STRING >>> >>> Although the sysctls are marked with CTLFLAG_RD and the values will stay >>> immutable, current sysctl implementation stores value pointer in >>> void* type, which means that const qualifier is discarded anyway >>> and some newer compilers complaint about that. >>> We can't use de-const trick in sysctl implementation, because in that >>> case we could miss an opposite situation where a const value is used >>> with CTLFLAG_RW sysctl. __DECONST() and __DEVOLATILE can almost never be used, because they just hide bugs like the above or API bugs in most cases, and I would complain about their use in all cases. >>> >>> Complaint from: gcc 4.4, clang >>> MFC after: 2 weeks >> This is arguably the change for worse then better. > > Arguably - yes, practically - I am not sure. > See almost every other instance of SYSCTL_STRING usage, kern_mib.c most prominently. > >> You could add SYSCTL_STRING_CONST or the like instead. > > But we already have CTLFLAG_RD vs CTLFLAG_RW... > Perhaps, we could have a union of void* and const void* and then assign value to > the appropriate member based on the flags. But I am not sure if the benefit > would be worth the effort. More importantly the "void *" causes many type mismatches to be missed. E.g., SYSCTL_INT() should only accept variables of type int, but the variable type decays to "void *" almost before it can be checked, and SYSCTL_INT() depends on this decay (for the assignment). I couldn't see a good way to fix this. A bad way might be to use an enormous union with all supported types and type qualifiers. SYSCTL_INT() can then assign to the unqualified int type. But this only fixes the easier cases where the macro is used. Many cases use a SYSCTL_PROC() with a sysctl_handle_foo() call. All these calls take args of SYSCTL_HANDLER_ARGS. This gives the same types for all the calls and one of the types is "void *" which defeats type safety in the same way as the assignment to the "void *" in the macros. We now have flags for some unsigned types (CTLTYPE_UQUAD is still missing), but we don't have sysctl_handle_uint() and depend on this decay for for sysctl_handle_int() to work on u_ints. But this type punning is a feature. At least the macro version can do a static type check by doing an assignment without a conversion, and then assign to a "void *" or a slightly more specialized type as now, to avoid replicating the handler functions. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 14:30: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 E393F106566C; Tue, 15 Jun 2010 14:30:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 5F9B48FC15; Tue, 15 Jun 2010 14:30:56 +0000 (UTC) Received: from c122-106-175-69.carlnfd1.nsw.optusnet.com.au (c122-106-175-69.carlnfd1.nsw.optusnet.com.au [122.106.175.69]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o5FEUrQ7005231 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Jun 2010 00:30:55 +1000 Date: Wed, 16 Jun 2010 00:30:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: David Schultz In-Reply-To: <20100615131443.GA93094@zim.MIT.EDU> Message-ID: <20100616001659.G38908@delplex.bde.org> References: <201006121732.o5CHW5Cs065722@svn.freebsd.org> <20100615084939.GL13238@deviant.kiev.zoral.com.ua> <20100615131443.GA93094@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Kostik Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 14:30:58 -0000 On Tue, 15 Jun 2010, David Schultz wrote: > Oops, to complicate matters further, I just noticed that we > already have isnanf and __isnanf symbols in libc, so maybe the new > symbol isn't needed. (isnan() and isnanf() are in libc because > that's where they were historically.) The second version in > libm looks like a mistake (wrong scope of the #if 0 in s_isnan.c.) > Perhaps we could just remove the duplicate symbols from libm. > > Better would be to remove the symbols from libc and have them in > libm where they belong, but I'm not sure if that would break anything. Better move Standard C symbols from libm to libc where they belong :-). Even Unix programmers should not be too surprised now if the Standard part of the libm namespace becomes more reserved. (It is already partly reserved -- gcc warns about use of cos() without including , and once you have included the whole compile-time libm namespace is reserved.) BTW, c89 is missing the -lm needed to make it a C compiler, and its man page doesn't say anything about this. Similarly for gcc (?, man page too large to check). Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 14:59: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 E9523106566B; Tue, 15 Jun 2010 14:59:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D80ED8FC13; Tue, 15 Jun 2010 14:59: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 o5FExZOg011610; Tue, 15 Jun 2010 14:59:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FExZIK011607; Tue, 15 Jun 2010 14:59:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006151459.o5FExZIK011607@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 15 Jun 2010 14:59: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: r209204 - in head/sys: amd64/amd64 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, 15 Jun 2010 14:59:36 -0000 Author: kib Date: Tue Jun 15 14:59:35 2010 New Revision: 209204 URL: http://svn.freebsd.org/changeset/base/209204 Log: Rename CRITSECT_ASSERT to CRITICAL_ASSERT. Suggested by: jhb MFC after: 1 month Modified: head/sys/amd64/amd64/fpu.c head/sys/sys/proc.h Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Tue Jun 15 13:13:12 2010 (r209203) +++ head/sys/amd64/amd64/fpu.c Tue Jun 15 14:59:35 2010 (r209204) @@ -439,7 +439,7 @@ fpudrop() td = PCPU_GET(fpcurthread); KASSERT(td == curthread, ("fpudrop: fpcurthread != curthread")); - CRITSECT_ASSERT(td); + CRITICAL_ASSERT(td); PCPU_SET(fpcurthread, NULL); td->td_pcb->pcb_flags &= ~PCB_FPUINITDONE; start_emulating(); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue Jun 15 13:13:12 2010 (r209203) +++ head/sys/sys/proc.h Tue Jun 15 14:59:35 2010 (r209204) @@ -325,7 +325,7 @@ do { \ #define THREAD_LOCKPTR_ASSERT(td, lock) #endif -#define CRITSECT_ASSERT(td) \ +#define CRITICAL_ASSERT(td) \ KASSERT((td)->td_critnest >= 1, ("Not in critical section")); /* From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 17:08: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 8FE7A1065670; Tue, 15 Jun 2010 17:08:04 +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 74D7D8FC14; Tue, 15 Jun 2010 17:08: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 o5FH84Q1040287; Tue, 15 Jun 2010 17:08:04 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FH84CA040276; Tue, 15 Jun 2010 17:08:04 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006151708.o5FH84CA040276@svn.freebsd.org> From: Ed Schouten Date: Tue, 15 Jun 2010 17:08: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: r209205 - in head/lib/clang: . libllvmanalysis libllvmbitreader libllvmbitwriter libllvmcodegen libllvmcore libllvmipo libllvmmc libllvmscalaropts libllvmsupport libllvmsystem libllvmta... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 17:08:04 -0000 Author: ed Date: Tue Jun 15 17:08:03 2010 New Revision: 209205 URL: http://svn.freebsd.org/changeset/base/209205 Log: Remove unneeded files from the build. I used the following command to determine which source files were unneeded: | for i in `find lib/clang -name '*.o'` | do | MATCHES="`(nm -g --defined-only $i; nm -g --defined-only \ | usr.bin/clang/clang/clang) | sed -e 's/.* //' | \ | sort | uniq -d | wc -l`" | [ $MATCHES -eq 0 ] && echo "$i: unneeded" | done This should slightly improve the build times. Modified: head/lib/clang/clang.build.mk head/lib/clang/libllvmanalysis/Makefile head/lib/clang/libllvmbitreader/Makefile head/lib/clang/libllvmbitwriter/Makefile head/lib/clang/libllvmcodegen/Makefile head/lib/clang/libllvmcore/Makefile head/lib/clang/libllvmipo/Makefile head/lib/clang/libllvmmc/Makefile head/lib/clang/libllvmscalaropts/Makefile head/lib/clang/libllvmsupport/Makefile head/lib/clang/libllvmsystem/Makefile head/lib/clang/libllvmtarget/Makefile Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Tue Jun 15 14:59:35 2010 (r209204) +++ head/lib/clang/clang.build.mk Tue Jun 15 17:08:03 2010 (r209205) @@ -17,7 +17,7 @@ TARGET_ARCH?= ${MACHINE_ARCH} # XXX: 8.0, to keep __FreeBSD_cc_version happy CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH}-undermydesk-freebsd9.0\" \ -DCLANG_VENDOR=\"FreeBSD\ \" -DSVN_REVISION=\"104832\" \ - -DCLANG_VENDOR_SUFFIX=\"\ 20100614\" + -DCLANG_VENDOR_SUFFIX=\"\ 20100615\" .PATH: ${LLVM_SRCS}/${SRCDIR} Modified: head/lib/clang/libllvmanalysis/Makefile ============================================================================== --- head/lib/clang/libllvmanalysis/Makefile Tue Jun 15 14:59:35 2010 (r209204) +++ head/lib/clang/libllvmanalysis/Makefile Tue Jun 15 17:08:03 2010 (r209205) @@ -10,15 +10,15 @@ SRCS= AliasAnalysis.cpp AliasAnalysisCou DbgInfoPrinter.cpp DebugInfo.cpp IVUsers.cpp InlineCost.cpp \ InstCount.cpp InstructionSimplify.cpp Interval.cpp \ IntervalPartition.cpp LazyValueInfo.cpp \ - LibCallAliasAnalysis.cpp LibCallSemantics.cpp Lint.cpp \ - LiveValues.cpp LoopDependenceAnalysis.cpp LoopInfo.cpp \ - LoopPass.cpp MemoryBuiltins.cpp MemoryDependenceAnalysis.cpp \ + LibCallAliasAnalysis.cpp Lint.cpp LiveValues.cpp \ + LoopDependenceAnalysis.cpp LoopInfo.cpp LoopPass.cpp \ + MemoryBuiltins.cpp MemoryDependenceAnalysis.cpp \ PHITransAddr.cpp PointerTracking.cpp PostDominators.cpp \ ProfileEstimatorPass.cpp ProfileInfo.cpp ProfileInfoLoader.cpp \ ProfileInfoLoaderPass.cpp ProfileVerifierPass.cpp \ ScalarEvolution.cpp ScalarEvolutionAliasAnalysis.cpp \ ScalarEvolutionExpander.cpp ScalarEvolutionNormalization.cpp \ - SparsePropagation.cpp Trace.cpp ValueTracking.cpp + SparsePropagation.cpp ValueTracking.cpp TGHDRS= Intrinsics Modified: head/lib/clang/libllvmbitreader/Makefile ============================================================================== --- head/lib/clang/libllvmbitreader/Makefile Tue Jun 15 14:59:35 2010 (r209204) +++ head/lib/clang/libllvmbitreader/Makefile Tue Jun 15 17:08:03 2010 (r209205) @@ -3,7 +3,7 @@ LIB= llvmbitreader SRCDIR= lib/Bitcode/Reader -SRCS= BitReader.cpp BitcodeReader.cpp +SRCS= BitcodeReader.cpp TGHDRS= Intrinsics Modified: head/lib/clang/libllvmbitwriter/Makefile ============================================================================== --- head/lib/clang/libllvmbitwriter/Makefile Tue Jun 15 14:59:35 2010 (r209204) +++ head/lib/clang/libllvmbitwriter/Makefile Tue Jun 15 17:08:03 2010 (r209205) @@ -3,7 +3,7 @@ LIB= llvmbitwriter SRCDIR= lib/Bitcode/Writer -SRCS= BitWriter.cpp BitcodeWriter.cpp BitcodeWriterPass.cpp \ +SRCS= BitcodeWriter.cpp BitcodeWriterPass.cpp \ ValueEnumerator.cpp .include "../clang.lib.mk" Modified: head/lib/clang/libllvmcodegen/Makefile ============================================================================== --- head/lib/clang/libllvmcodegen/Makefile Tue Jun 15 14:59:35 2010 (r209204) +++ head/lib/clang/libllvmcodegen/Makefile Tue Jun 15 17:08:03 2010 (r209205) @@ -7,21 +7,20 @@ SRCS= AggressiveAntiDepBreaker.cpp Analy CalcSpillWeights.cpp CodePlacementOpt.cpp \ CriticalAntiDepBreaker.cpp DeadMachineInstructionElim.cpp \ DwarfEHPrepare.cpp ELFCodeEmitter.cpp ELFWriter.cpp \ - ExactHazardRecognizer.cpp GCMetadata.cpp GCMetadataPrinter.cpp \ - GCStrategy.cpp IfConversion.cpp IntrinsicLowering.cpp \ - LLVMTargetMachine.cpp LatencyPriorityQueue.cpp \ - LiveInterval.cpp LiveIntervalAnalysis.cpp \ - LiveStackAnalysis.cpp LiveVariables.cpp LowerSubregs.cpp \ - MachineBasicBlock.cpp MachineCSE.cpp MachineDominators.cpp \ - MachineFunction.cpp MachineFunctionAnalysis.cpp \ - MachineFunctionPass.cpp MachineFunctionPrinterPass.cpp \ - MachineInstr.cpp MachineLICM.cpp MachineLoopInfo.cpp \ - MachineModuleInfo.cpp MachineModuleInfoImpls.cpp \ - MachinePassRegistry.cpp MachineRegisterInfo.cpp \ - MachineSSAUpdater.cpp MachineSink.cpp MachineVerifier.cpp \ - ObjectCodeEmitter.cpp OcamlGC.cpp OptimizeExts.cpp \ - OptimizePHIs.cpp PHIElimination.cpp Passes.cpp \ - PostRASchedulerList.cpp PreAllocSplitting.cpp \ + ExactHazardRecognizer.cpp GCMetadata.cpp GCStrategy.cpp \ + IfConversion.cpp IntrinsicLowering.cpp LLVMTargetMachine.cpp \ + LatencyPriorityQueue.cpp LiveInterval.cpp \ + LiveIntervalAnalysis.cpp LiveStackAnalysis.cpp \ + LiveVariables.cpp LowerSubregs.cpp MachineBasicBlock.cpp \ + MachineCSE.cpp MachineDominators.cpp MachineFunction.cpp \ + MachineFunctionAnalysis.cpp MachineFunctionPass.cpp \ + MachineFunctionPrinterPass.cpp MachineInstr.cpp \ + MachineLICM.cpp MachineLoopInfo.cpp MachineModuleInfo.cpp \ + MachineModuleInfoImpls.cpp MachinePassRegistry.cpp \ + MachineRegisterInfo.cpp MachineSSAUpdater.cpp MachineSink.cpp \ + MachineVerifier.cpp ObjectCodeEmitter.cpp OcamlGC.cpp \ + OptimizeExts.cpp OptimizePHIs.cpp PHIElimination.cpp \ + Passes.cpp PostRASchedulerList.cpp PreAllocSplitting.cpp \ ProcessImplicitDefs.cpp PrologEpilogInserter.cpp \ PseudoSourceValue.cpp RegAllocFast.cpp RegAllocLinearScan.cpp \ RegAllocLocal.cpp RegAllocPBQP.cpp RegisterCoalescer.cpp \ Modified: head/lib/clang/libllvmcore/Makefile ============================================================================== --- head/lib/clang/libllvmcore/Makefile Tue Jun 15 14:59:35 2010 (r209204) +++ head/lib/clang/libllvmcore/Makefile Tue Jun 15 17:08:03 2010 (r209205) @@ -5,8 +5,8 @@ LIB= llvmcore SRCDIR= lib/VMCore SRCS= AsmWriter.cpp Attributes.cpp AutoUpgrade.cpp BasicBlock.cpp \ ConstantFold.cpp Constants.cpp Core.cpp DebugLoc.cpp \ - Dominators.cpp Function.cpp GVMaterializer.cpp Globals.cpp \ - IRBuilder.cpp InlineAsm.cpp Instruction.cpp Instructions.cpp \ + Dominators.cpp Function.cpp Globals.cpp IRBuilder.cpp \ + InlineAsm.cpp Instruction.cpp Instructions.cpp \ IntrinsicInst.cpp LLVMContext.cpp LLVMContextImpl.cpp \ LeakDetector.cpp Metadata.cpp Module.cpp Pass.cpp \ PassManager.cpp PrintModulePass.cpp Type.cpp \ Modified: head/lib/clang/libllvmipo/Makefile ============================================================================== --- head/lib/clang/libllvmipo/Makefile Tue Jun 15 14:59:35 2010 (r209204) +++ head/lib/clang/libllvmipo/Makefile Tue Jun 15 17:08:03 2010 (r209205) @@ -6,11 +6,10 @@ SRCDIR= lib/Transforms/IPO SRCS= ArgumentPromotion.cpp ConstantMerge.cpp \ DeadArgumentElimination.cpp DeadTypeElimination.cpp \ ExtractGV.cpp FunctionAttrs.cpp GlobalDCE.cpp GlobalOpt.cpp \ - IPConstantPropagation.cpp IPO.cpp InlineAlways.cpp \ - InlineSimple.cpp Inliner.cpp Internalize.cpp LoopExtractor.cpp \ - LowerSetJmp.cpp MergeFunctions.cpp PartialSpecialization.cpp \ - PruneEH.cpp StripDeadPrototypes.cpp StripSymbols.cpp \ - StructRetPromotion.cpp + IPConstantPropagation.cpp InlineAlways.cpp InlineSimple.cpp \ + Inliner.cpp Internalize.cpp LoopExtractor.cpp LowerSetJmp.cpp \ + MergeFunctions.cpp PartialSpecialization.cpp PruneEH.cpp \ + StripDeadPrototypes.cpp StripSymbols.cpp StructRetPromotion.cpp TGHDRS= Intrinsics Modified: head/lib/clang/libllvmmc/Makefile ============================================================================== --- head/lib/clang/libllvmmc/Makefile Tue Jun 15 14:59:35 2010 (r209204) +++ head/lib/clang/libllvmmc/Makefile Tue Jun 15 17:08:03 2010 (r209205) @@ -5,11 +5,10 @@ LIB= llvmmc SRCDIR= lib/MC SRCS= MCAsmInfo.cpp MCAsmInfoCOFF.cpp MCAsmInfoDarwin.cpp \ MCAsmStreamer.cpp MCAssembler.cpp MCCodeEmitter.cpp \ - MCContext.cpp MCDisassembler.cpp MCExpr.cpp MCInst.cpp \ - MCInstPrinter.cpp MCLoggingStreamer.cpp MCMachOStreamer.cpp \ - MCNullStreamer.cpp MCObjectWriter.cpp MCSection.cpp \ - MCSectionCOFF.cpp MCSectionELF.cpp MCSectionMachO.cpp \ - MCStreamer.cpp MCSymbol.cpp MCValue.cpp MachObjectWriter.cpp \ - TargetAsmBackend.cpp + MCContext.cpp MCExpr.cpp MCInst.cpp MCInstPrinter.cpp \ + MCLoggingStreamer.cpp MCMachOStreamer.cpp MCNullStreamer.cpp \ + MCObjectWriter.cpp MCSection.cpp MCSectionCOFF.cpp \ + MCSectionELF.cpp MCSectionMachO.cpp MCStreamer.cpp \ + MCSymbol.cpp MachObjectWriter.cpp TargetAsmBackend.cpp .include "../clang.lib.mk" Modified: head/lib/clang/libllvmscalaropts/Makefile ============================================================================== --- head/lib/clang/libllvmscalaropts/Makefile Tue Jun 15 14:59:35 2010 (r209204) +++ head/lib/clang/libllvmscalaropts/Makefile Tue Jun 15 17:08:03 2010 (r209205) @@ -9,7 +9,7 @@ SRCS= ADCE.cpp BasicBlockPlacement.cpp C LICM.cpp LoopDeletion.cpp LoopIndexSplit.cpp LoopRotation.cpp \ LoopStrengthReduce.cpp LoopUnrollPass.cpp LoopUnswitch.cpp \ MemCpyOptimizer.cpp Reassociate.cpp Reg2Mem.cpp SCCP.cpp \ - Scalar.cpp ScalarReplAggregates.cpp SimplifyCFGPass.cpp \ + ScalarReplAggregates.cpp SimplifyCFGPass.cpp \ SimplifyHalfPowrLibCalls.cpp SimplifyLibCalls.cpp \ TailDuplication.cpp TailRecursionElimination.cpp Modified: head/lib/clang/libllvmsupport/Makefile ============================================================================== --- head/lib/clang/libllvmsupport/Makefile Tue Jun 15 14:59:35 2010 (r209204) +++ head/lib/clang/libllvmsupport/Makefile Tue Jun 15 17:08:03 2010 (r209205) @@ -6,14 +6,14 @@ SRCDIR= lib/Support SRCS= APFloat.cpp APInt.cpp APSInt.cpp Allocator.cpp CommandLine.cpp \ ConstantRange.cpp Debug.cpp DeltaAlgorithm.cpp Dwarf.cpp \ ErrorHandling.cpp FileUtilities.cpp FoldingSet.cpp \ - FormattedStream.cpp GraphWriter.cpp IsInf.cpp IsNAN.cpp \ - ManagedStatic.cpp MemoryBuffer.cpp MemoryObject.cpp \ - PluginLoader.cpp PrettyStackTrace.cpp Regex.cpp \ - SlowOperationInformer.cpp SmallPtrSet.cpp SmallVector.cpp \ - SourceMgr.cpp Statistic.cpp StringExtras.cpp StringMap.cpp \ - StringPool.cpp StringRef.cpp SystemUtils.cpp \ - TargetRegistry.cpp Timer.cpp Triple.cpp Twine.cpp \ - circular_raw_ostream.cpp raw_os_ostream.cpp raw_ostream.cpp \ - regcomp.c regerror.c regexec.c regfree.c regstrlcpy.c + FormattedStream.cpp GraphWriter.cpp ManagedStatic.cpp \ + MemoryBuffer.cpp MemoryObject.cpp PluginLoader.cpp \ + PrettyStackTrace.cpp Regex.cpp SlowOperationInformer.cpp \ + SmallPtrSet.cpp SmallVector.cpp SourceMgr.cpp Statistic.cpp \ + StringExtras.cpp StringMap.cpp StringPool.cpp StringRef.cpp \ + SystemUtils.cpp TargetRegistry.cpp Timer.cpp Triple.cpp \ + Twine.cpp circular_raw_ostream.cpp raw_os_ostream.cpp \ + raw_ostream.cpp regcomp.c regerror.c regexec.c regfree.c \ + regstrlcpy.c .include "../clang.lib.mk" Modified: head/lib/clang/libllvmsystem/Makefile ============================================================================== --- head/lib/clang/libllvmsystem/Makefile Tue Jun 15 14:59:35 2010 (r209204) +++ head/lib/clang/libllvmsystem/Makefile Tue Jun 15 17:08:03 2010 (r209205) @@ -3,9 +3,8 @@ LIB= llvmsystem SRCDIR= lib/System -SRCS= Alarm.cpp Atomic.cpp Disassembler.cpp DynamicLibrary.cpp \ - Errno.cpp Host.cpp IncludeFile.cpp Memory.cpp Mutex.cpp \ - Path.cpp Process.cpp Program.cpp RWMutex.cpp \ +SRCS= Atomic.cpp DynamicLibrary.cpp Errno.cpp Host.cpp Memory.cpp \ + Mutex.cpp Path.cpp Process.cpp Program.cpp RWMutex.cpp \ SearchForAddressOfSpecialSymbol.cpp Signals.cpp \ ThreadLocal.cpp Threading.cpp TimeValue.cpp Valgrind.cpp Modified: head/lib/clang/libllvmtarget/Makefile ============================================================================== --- head/lib/clang/libllvmtarget/Makefile Tue Jun 15 14:59:35 2010 (r209204) +++ head/lib/clang/libllvmtarget/Makefile Tue Jun 15 17:08:03 2010 (r209205) @@ -5,8 +5,7 @@ LIB= llvmtarget SRCDIR= lib/Target SRCS= Mangler.cpp SubtargetFeature.cpp Target.cpp TargetAsmLexer.cpp \ TargetData.cpp TargetELFWriterInfo.cpp TargetFrameInfo.cpp \ - TargetInstrInfo.cpp TargetIntrinsicInfo.cpp \ - TargetLoweringObjectFile.cpp TargetMachine.cpp \ - TargetRegisterInfo.cpp TargetSubtarget.cpp + TargetInstrInfo.cpp TargetLoweringObjectFile.cpp \ + TargetMachine.cpp TargetRegisterInfo.cpp TargetSubtarget.cpp .include "../clang.lib.mk" From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 17:28: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 979F71065675; Tue, 15 Jun 2010 17:28:16 +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 869BA8FC0C; Tue, 15 Jun 2010 17:28:16 +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 o5FHSG9n044770; Tue, 15 Jun 2010 17:28:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FHSGLb044768; Tue, 15 Jun 2010 17:28:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006151728.o5FHSGLb044768@svn.freebsd.org> From: Ed Schouten Date: Tue, 15 Jun 2010 17:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209206 - head/lib/clang/libllvmsupport X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 17:28:16 -0000 Author: ed Date: Tue Jun 15 17:28:16 2010 New Revision: 209206 URL: http://svn.freebsd.org/changeset/base/209206 Log: Remove even two more unneeded files from libllvmsupport. Modified: head/lib/clang/libllvmsupport/Makefile Modified: head/lib/clang/libllvmsupport/Makefile ============================================================================== --- head/lib/clang/libllvmsupport/Makefile Tue Jun 15 17:08:03 2010 (r209205) +++ head/lib/clang/libllvmsupport/Makefile Tue Jun 15 17:28:16 2010 (r209206) @@ -7,13 +7,12 @@ SRCS= APFloat.cpp APInt.cpp APSInt.cpp A ConstantRange.cpp Debug.cpp DeltaAlgorithm.cpp Dwarf.cpp \ ErrorHandling.cpp FileUtilities.cpp FoldingSet.cpp \ FormattedStream.cpp GraphWriter.cpp ManagedStatic.cpp \ - MemoryBuffer.cpp MemoryObject.cpp PluginLoader.cpp \ - PrettyStackTrace.cpp Regex.cpp SlowOperationInformer.cpp \ - SmallPtrSet.cpp SmallVector.cpp SourceMgr.cpp Statistic.cpp \ - StringExtras.cpp StringMap.cpp StringPool.cpp StringRef.cpp \ - SystemUtils.cpp TargetRegistry.cpp Timer.cpp Triple.cpp \ - Twine.cpp circular_raw_ostream.cpp raw_os_ostream.cpp \ - raw_ostream.cpp regcomp.c regerror.c regexec.c regfree.c \ - regstrlcpy.c + MemoryBuffer.cpp PluginLoader.cpp PrettyStackTrace.cpp \ + Regex.cpp SlowOperationInformer.cpp SmallPtrSet.cpp \ + SmallVector.cpp SourceMgr.cpp Statistic.cpp StringExtras.cpp \ + StringMap.cpp StringPool.cpp StringRef.cpp TargetRegistry.cpp \ + Timer.cpp Triple.cpp Twine.cpp circular_raw_ostream.cpp \ + raw_os_ostream.cpp raw_ostream.cpp regcomp.c regerror.c \ + regexec.c regfree.c regstrlcpy.c .include "../clang.lib.mk" From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 18:11: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 9AE561065694; Tue, 15 Jun 2010 18:11:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A39C8FC15; Tue, 15 Jun 2010 18:11:37 +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 o5FIBb8P054784; Tue, 15 Jun 2010 18:11:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FIBbjA054783; Tue, 15 Jun 2010 18:11:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006151811.o5FIBbjA054783@svn.freebsd.org> From: Warner Losh Date: Tue, 15 Jun 2010 18:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209207 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 18:11:37 -0000 Author: imp Date: Tue Jun 15 18:11:37 2010 New Revision: 209207 URL: http://svn.freebsd.org/changeset/base/209207 Log: make these convenience functions more convenient by accepting all args, not just the first. makes mechanical conversion of old style more forgiving. MFC after: 3 days Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Tue Jun 15 17:28:16 2010 (r209206) +++ head/tools/tools/nanobsd/nanobsd.sh Tue Jun 15 18:11:37 2010 (r209207) @@ -650,19 +650,19 @@ cust_pkg () ( ####################################################################### # Convenience function: -# Register $1 as customize function. +# Register all args as customize function. customize_cmd () { - NANO_CUSTOMIZE="$NANO_CUSTOMIZE $1" + NANO_CUSTOMIZE="$NANO_CUSTOMIZE $*" } ####################################################################### # Convenience function: -# Register $1 as late customize function to run just before +# Register all args as late customize function to run just before # image creation. late_customize_cmd () { - NANO_LATE_CUSTOMIZE="$NANO_LATE_CUSTOMIZE $1" + NANO_LATE_CUSTOMIZE="$NANO_LATE_CUSTOMIZE $*" } ####################################################################### From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 18:16: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 5CFA3106566C; Tue, 15 Jun 2010 18:16:05 +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 326F38FC14; Tue, 15 Jun 2010 18:16: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 o5FIG4j5055938; Tue, 15 Jun 2010 18:16:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FIG4wS055935; Tue, 15 Jun 2010 18:16:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006151816.o5FIG4wS055935@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 15 Jun 2010 18:16: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: r209208 - in head/sys/amd64: amd64 ia32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 18:16:05 -0000 Author: kib Date: Tue Jun 15 18:16:04 2010 New Revision: 209208 URL: http://svn.freebsd.org/changeset/base/209208 Log: Remove two obsoleted comments, add a note about 32bit compatibility. MFC after: 1 month Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/ia32/ia32_signal.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Jun 15 18:11:37 2010 (r209207) +++ head/sys/amd64/amd64/machdep.c Tue Jun 15 18:16:04 2010 (r209208) @@ -2103,11 +2103,6 @@ set_fpcontext(struct thread *td, const m fpstate_drop(td); else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { - /* - * XXX we violate the dubious requirement that fpusetregs() - * be called with interrupts disabled. - * XXX obsolete on trap-16 systems? - */ fpstate = (struct savefpu *)&mcp->mc_fpstate; fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; fpusetuserregs(td, fpstate); Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Tue Jun 15 18:11:37 2010 (r209207) +++ head/sys/amd64/ia32/ia32_signal.c Tue Jun 15 18:16:04 2010 (r209208) @@ -92,6 +92,12 @@ static void ia32_get_fpcontext(struct thread *td, struct ia32_mcontext *mcp) { + /* + * XXX Format of 64bit and 32bit FXSAVE areas differs. FXSAVE + * in 32bit mode saves %cs and %ds, while on 64bit it saves + * 64bit instruction and data pointers. Ignore the difference + * for now, it should be irrelevant for most applications. + */ mcp->mc_ownedfp = fpugetregs(td, (struct savefpu *)&mcp->mc_fpstate); mcp->mc_fpformat = fpuformat(); } @@ -109,10 +115,6 @@ ia32_set_fpcontext(struct thread *td, co fpstate_drop(td); else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { - /* - * XXX we violate the dubious requirement that fpusetregs() - * be called with interrupts disabled. - */ fpusetregs(td, (struct savefpu *)&mcp->mc_fpstate); } else return (EINVAL); From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 18:16: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 5F7B4106566C; Tue, 15 Jun 2010 18:16:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E1538FC1A; Tue, 15 Jun 2010 18:16: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 o5FIGjLM056115; Tue, 15 Jun 2010 18:16:45 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FIGjjR056113; Tue, 15 Jun 2010 18:16:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006151816.o5FIGjjR056113@svn.freebsd.org> From: Warner Losh Date: Tue, 15 Jun 2010 18:16: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: r209209 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 18:16:45 -0000 Author: imp Date: Tue Jun 15 18:16:45 2010 New Revision: 209209 URL: http://svn.freebsd.org/changeset/base/209209 Log: Create a make.conf. not needed for runtime, but some ports want to spam it at compile or install time. MFC after: 3 days Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Tue Jun 15 18:16:04 2010 (r209208) +++ head/tools/tools/nanobsd/nanobsd.sh Tue Jun 15 18:16:45 2010 (r209209) @@ -241,6 +241,9 @@ install_etc ( ) ( ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} distribution \ DESTDIR=${NANO_WORLDDIR} \ > ${NANO_OBJ}/_.etc 2>&1 + # make.conf doesn't get created by default, but some ports need it + # so they can spam it. + cp /dev/null ${NANO_WORLDDIR}/etc/make.conf ) install_kernel ( ) ( From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 18:18: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 B639E106566B; Tue, 15 Jun 2010 18:18:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5A538FC15; Tue, 15 Jun 2010 18:18: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 o5FIIVPh056575; Tue, 15 Jun 2010 18:18:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FIIVTU056573; Tue, 15 Jun 2010 18:18:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006151818.o5FIIVTU056573@svn.freebsd.org> From: Warner Losh Date: Tue, 15 Jun 2010 18:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209210 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 18:18:31 -0000 Author: imp Date: Tue Jun 15 18:18:31 2010 New Revision: 209210 URL: http://svn.freebsd.org/changeset/base/209210 Log: Allow population of /cfg and /data. Begin the move to making all slice creation overrideable too, but there's a few problems doing that for the duplicated partitions (s1 and s2), so just comment that it needs work. MFC after: 3 days Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Tue Jun 15 18:16:45 2010 (r209209) +++ head/tools/tools/nanobsd/nanobsd.sh Tue Jun 15 18:18:31 2010 (r209210) @@ -357,6 +357,30 @@ prune_usr() ( done ) +populate_slice ( ) ( + local dev dir mnt + dev=$1 + dir=$2 + mnt=$3 + test -z $2 && dir=/var/empty + test -d $d || dir=/var/empty + echo "Creating ${dev} with ${dir} (mounting on ${mnt})" + newfs ${NANO_NEWFS} ${dev} + mount ${dev} ${mnt} + cd ${dir} + find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} + df -i ${mnt} + umount ${mnt} +) + +populate_cfg_slice ( ) ( + populate_slice "$1" "$2" "$3" +) + +populate_data_slice ( ) ( + populate_slice "$1" "$2" "$3" +) + create_i386_diskimage ( ) ( pprint 2 "build diskimage" pprint 3 "log: ${NANO_OBJ}/_.di" @@ -456,6 +480,7 @@ create_i386_diskimage ( ) ( bsdlabel ${MD}s1 # Create first image + # XXX: should use populate_slice for easier override newfs ${NANO_NEWFS} /dev/${MD}s1a mount /dev/${MD}s1a ${MNT} df -i ${MNT} @@ -480,13 +505,11 @@ create_i386_diskimage ( ) ( fi # Create Config slice - newfs ${NANO_NEWFS} /dev/${MD}s3 - # XXX: fill from where ? + populate_cfg_slice /dev/${MD}s3 "${NANO_CFGDIR}" ${MNT} # Create Data slice, if any. if [ $NANO_DATASIZE -ne 0 ] ; then - newfs ${NANO_NEWFS} /dev/${MD}s4 - # XXX: fill from where ? + populate_data_slice /dev/${MD}s4 "${NANO_DATADIR}" ${MNT} fi if [ "${NANO_MD_BACKING}" = "swap" ] ; then From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 18:37: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 51ACA106567A; Tue, 15 Jun 2010 18:37:34 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 416BD8FC1D; Tue, 15 Jun 2010 18:37: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 o5FIbY9d060893; Tue, 15 Jun 2010 18:37:34 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FIbWaG060891; Tue, 15 Jun 2010 18:37:32 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006151837.o5FIbWaG060891@svn.freebsd.org> From: Alan Cox Date: Tue, 15 Jun 2010 18:37: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: r209211 - 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: Tue, 15 Jun 2010 18:37:34 -0000 Author: alc Date: Tue Jun 15 18:37:31 2010 New Revision: 209211 URL: http://svn.freebsd.org/changeset/base/209211 Log: Eliminate unnecessary page queues locking. Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Tue Jun 15 18:18:31 2010 (r209210) +++ head/sys/dev/md/md.c Tue Jun 15 18:37:31 2010 (r209211) @@ -666,12 +666,10 @@ mdstart_swap(struct md_s *sc, struct bio sched_unpin(); vm_page_wakeup(m); vm_page_lock(m); - vm_page_lock_queues(); vm_page_activate(m); + vm_page_unlock(m); if (bp->bio_cmd == BIO_WRITE) vm_page_dirty(m); - vm_page_unlock_queues(); - vm_page_unlock(m); /* Actions on further pages start at offset 0 */ p += PAGE_SIZE - offs; From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 18:51: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 4F45A106564A; Tue, 15 Jun 2010 18:51:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D0498FC20; Tue, 15 Jun 2010 18:51: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 o5FIpgxt064052; Tue, 15 Jun 2010 18:51:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FIpg3I064045; Tue, 15 Jun 2010 18:51:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006151851.o5FIpg3I064045@svn.freebsd.org> From: John Baldwin Date: Tue, 15 Jun 2010 18:51: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: r209212 - in head/sys: amd64/acpica amd64/amd64 amd64/include i386/acpica i386/include 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, 15 Jun 2010 18:51:42 -0000 Author: jhb Date: Tue Jun 15 18:51:41 2010 New Revision: 209212 URL: http://svn.freebsd.org/changeset/base/209212 Log: Restore the machine check register banks on resume. For banks being monitored via CMCI, reset the interrupt threshold to 1 on resume. Reviewed by: jkim MFC after: 2 weeks Modified: head/sys/amd64/acpica/acpi_wakeup.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/mca.h head/sys/i386/acpica/acpi_wakeup.c head/sys/i386/include/mca.h head/sys/x86/x86/mca.c Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Tue Jun 15 18:37:31 2010 (r209211) +++ head/sys/amd64/acpica/acpi_wakeup.c Tue Jun 15 18:51:41 2010 (r209212) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -300,6 +301,7 @@ out: #endif load_cr3(cr3); + mca_resume(); intr_resume(); intr_restore(rf); Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Tue Jun 15 18:37:31 2010 (r209211) +++ head/sys/amd64/amd64/mp_machdep.c Tue Jun 15 18:51:41 2010 (r209212) @@ -1264,6 +1264,7 @@ cpususpend_handler(void) /* Restore CR3 and enable interrupts */ load_cr3(cr3); + mca_resume(); lapic_setup(0); intr_restore(rf); } Modified: head/sys/amd64/include/mca.h ============================================================================== --- head/sys/amd64/include/mca.h Tue Jun 15 18:37:31 2010 (r209211) +++ head/sys/amd64/include/mca.h Tue Jun 15 18:51:41 2010 (r209212) @@ -49,6 +49,7 @@ struct mca_record { void cmc_intr(void); void mca_init(void); int mca_intr(void); +void mca_resume(void); #endif Modified: head/sys/i386/acpica/acpi_wakeup.c ============================================================================== --- head/sys/i386/acpica/acpi_wakeup.c Tue Jun 15 18:37:31 2010 (r209211) +++ head/sys/i386/acpica/acpi_wakeup.c Tue Jun 15 18:51:41 2010 (r209212) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -272,6 +273,7 @@ acpi_sleep_machdep(struct acpi_softc *sc for (;;) ; } else { /* Execute Wakeup */ + mca_resume(); intr_resume(); if (bootverbose) { Modified: head/sys/i386/include/mca.h ============================================================================== --- head/sys/i386/include/mca.h Tue Jun 15 18:37:31 2010 (r209211) +++ head/sys/i386/include/mca.h Tue Jun 15 18:51:41 2010 (r209212) @@ -49,6 +49,7 @@ struct mca_record { void cmc_intr(void); void mca_init(void); int mca_intr(void); +void mca_resume(void); #endif Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Tue Jun 15 18:37:31 2010 (r209211) +++ head/sys/x86/x86/mca.c Tue Jun 15 18:51:41 2010 (r209212) @@ -659,6 +659,15 @@ static void mca_setup(uint64_t mcg_cap) { + /* + * On AMD Family 10h processors, unless logging of level one TLB + * parity (L1TP) errors is disabled, enable the recommended workaround + * for Erratum 383. + */ + if (cpu_vendor_id == CPU_VENDOR_AMD && + CPUID_TO_FAMILY(cpu_id) == 0x10 && amd10h_L1TP) + workaround_erratum383 = 1; + mtx_init(&mca_lock, "mca", NULL, MTX_SPIN); STAILQ_INIT(&mca_records); TASK_INIT(&mca_task, 0x8000, mca_scan_cpus, NULL); @@ -727,38 +736,56 @@ cmci_monitor(int i) /* Mark this bank as monitored. */ PCPU_SET(cmci_mask, PCPU_GET(cmci_mask) | 1 << i); } + +/* + * For resume, reset the threshold for any banks we monitor back to + * one and throw away the timestamp of the last interrupt. + */ +static void +cmci_resume(int i) +{ + struct cmc_state *cc; + uint64_t ctl; + + KASSERT(i < cmc_banks, ("CPU %d has more MC banks", PCPU_GET(cpuid))); + + /* Ignore banks not monitored by this CPU. */ + if (!(PCPU_GET(cmci_mask) & 1 << i)) + return; + + cc = &cmc_state[PCPU_GET(cpuid)][i]; + cc->last_intr = -ticks; + ctl = rdmsr(MSR_MC_CTL2(i)); + ctl &= ~MC_CTL2_THRESHOLD; + ctl |= MC_CTL2_CMCI_EN | 1; + wrmsr(MSR_MC_CTL2(i), ctl); +} #endif -/* Must be executed on each CPU. */ -void -mca_init(void) +/* + * Initializes per-CPU machine check registers and enables corrected + * machine check interrupts. + */ +static void +_mca_init(int boot) { uint64_t mcg_cap; uint64_t ctl, mask; - int skip; - int i; + int i, skip; /* MCE is required. */ if (!mca_enabled || !(cpu_feature & CPUID_MCE)) return; - /* - * On AMD Family 10h processors, unless logging of level one TLB - * parity (L1TP) errors is disabled, enable the recommended workaround - * for Erratum 383. - */ - if (cpu_vendor_id == CPU_VENDOR_AMD && - CPUID_TO_FAMILY(cpu_id) == 0x10 && amd10h_L1TP) - workaround_erratum383 = 1; - if (cpu_feature & CPUID_MCA) { - PCPU_SET(cmci_mask, 0); + if (boot) + PCPU_SET(cmci_mask, 0); mcg_cap = rdmsr(MSR_MCG_CAP); if (mcg_cap & MCG_CAP_CTL_P) /* Enable MCA features. */ wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); - if (PCPU_GET(cpuid) == 0) + if (PCPU_GET(cpuid) == 0 && boot) mca_setup(mcg_cap); /* @@ -797,8 +824,12 @@ mca_init(void) wrmsr(MSR_MC_CTL(i), ctl); #ifdef DEV_APIC - if (mcg_cap & MCG_CAP_CMCI_P) - cmci_monitor(i); + if (mcg_cap & MCG_CAP_CMCI_P) { + if (boot) + cmci_monitor(i); + else + cmci_resume(i); + } #endif /* Clear all errors. */ @@ -806,7 +837,7 @@ mca_init(void) } #ifdef DEV_APIC - if (PCPU_GET(cmci_mask) != 0) + if (PCPU_GET(cmci_mask) != 0 && boot) lapic_enable_cmc(); #endif } @@ -814,6 +845,22 @@ mca_init(void) load_cr4(rcr4() | CR4_MCE); } +/* Must be executed on each CPU during boot. */ +void +mca_init(void) +{ + + _mca_init(1); +} + +/* Must be executed on each CPU during resume. */ +void +mca_resume(void) +{ + + _mca_init(0); +} + /* * The machine check registers for the BSP cannot be initialized until * the local APIC is initialized. This happens at SI_SUB_CPU, From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 19:14: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 50563106566B; Tue, 15 Jun 2010 19:14:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FDEE8FC12; Tue, 15 Jun 2010 19:14: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 o5FJEd8J069076; Tue, 15 Jun 2010 19:14:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FJEdWT069074; Tue, 15 Jun 2010 19:14:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006151914.o5FJEdWT069074@svn.freebsd.org> From: John Baldwin Date: Tue, 15 Jun 2010 19:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209213 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2010 19:14:40 -0000 Author: jhb Date: Tue Jun 15 19:14:39 2010 New Revision: 209213 URL: http://svn.freebsd.org/changeset/base/209213 Log: When updating individual CPU's lowest Cx state to use, never set it to a state lower than the lowest one supported by the current CPU. This closes some races with changes to the hw.acpi.cpu_cx_lowest sysctl while Cx states for individual CPUs were changing (e.g. unplugging the AC adapter of a laptop) that could result in panics. Submitted by: Giovanni Trematerra Tested by: David Demelier demelier dot david of gmail MFC after: 3 days Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Tue Jun 15 18:51:41 2010 (r209212) +++ head/sys/dev/acpica/acpi_cpu.c Tue Jun 15 19:14:39 2010 (r209213) @@ -1007,6 +1007,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no if (isc->cpu_cx_count > cpu_cx_count) cpu_cx_count = isc->cpu_cx_count; } + if (sc->cpu_cx_lowest < cpu_cx_lowest) + acpi_cpu_set_cx_lowest(sc, min(cpu_cx_lowest, sc->cpu_cx_count - 1)); ACPI_SERIAL_END(cpu); } @@ -1202,7 +1204,7 @@ acpi_cpu_global_cx_lowest_sysctl(SYSCTL_ ACPI_SERIAL_BEGIN(cpu); for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); - acpi_cpu_set_cx_lowest(sc, val); + acpi_cpu_set_cx_lowest(sc, min(val, sc->cpu_cx_count - 1)); } ACPI_SERIAL_END(cpu); From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 19:19: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 2491E106566C; Tue, 15 Jun 2010 19:19:05 +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 144C28FC1C; Tue, 15 Jun 2010 19:19: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 o5FJJ4kp070109; Tue, 15 Jun 2010 19:19:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FJJ4OP070107; Tue, 15 Jun 2010 19:19:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006151919.o5FJJ4OP070107@svn.freebsd.org> From: Alexander Motin Date: Tue, 15 Jun 2010 19:19: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: r209214 - head/usr.sbin/moused X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 19:19:05 -0000 Author: mav Date: Tue Jun 15 19:19:04 2010 New Revision: 209214 URL: http://svn.freebsd.org/changeset/base/209214 Log: When Emulate3Button is active, do not set select() timeout in states when it is not needed. No need to kick CPU every 20ms without a purpose. Reviewed by: philip@ Modified: head/usr.sbin/moused/moused.c Modified: head/usr.sbin/moused/moused.c ============================================================================== --- head/usr.sbin/moused/moused.c Tue Jun 15 19:14:39 2010 (r209213) +++ head/usr.sbin/moused/moused.c Tue Jun 15 19:19:04 2010 (r209214) @@ -1090,7 +1090,8 @@ moused(void) FD_SET(rodent.mremcfd, &fds); c = select(FD_SETSIZE, &fds, NULL, NULL, - (rodent.flags & Emulate3Button) ? &timeout : NULL); + ((rodent.flags & Emulate3Button) && + S_DELAYED(mouse_button_state)) ? &timeout : NULL); if (c < 0) { /* error */ logwarn("failed to read from mouse"); continue; From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 19:28: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 716BB1065676; Tue, 15 Jun 2010 19:28:38 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F7538FC08; Tue, 15 Jun 2010 19:28: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 o5FJSctB072227; Tue, 15 Jun 2010 19:28:38 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FJSbhT072218; Tue, 15 Jun 2010 19:28:37 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201006151928.o5FJSbhT072218@svn.freebsd.org> From: Sean Bruno Date: Tue, 15 Jun 2010 19:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209215 - in head: lib/libmemstat sys/vm usr.bin/vmstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 19:28:38 -0000 Author: sbruno Date: Tue Jun 15 19:28:37 2010 New Revision: 209215 URL: http://svn.freebsd.org/changeset/base/209215 Log: Add a new column to the output of vmstat -z to indicate the number of times the system was forced to sleep when requesting a new allocation. Expand the debugger hook, db_show_uma, to display these results as well. This has proven to be very useful in out of memory situations when it is not known why systems have become sluggish or fail in odd ways. Reviewed by: rwatson alc Approved by: scottl (mentor) peter Obtained from: Yahoo Inc. Modified: head/lib/libmemstat/memstat.c head/lib/libmemstat/memstat.h head/lib/libmemstat/memstat_internal.h head/lib/libmemstat/memstat_uma.c head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h head/usr.bin/vmstat/vmstat.c Modified: head/lib/libmemstat/memstat.c ============================================================================== --- head/lib/libmemstat/memstat.c Tue Jun 15 19:19:04 2010 (r209214) +++ head/lib/libmemstat/memstat.c Tue Jun 15 19:28:37 2010 (r209215) @@ -188,6 +188,7 @@ _memstat_mt_reset_stats(struct memory_ty mtp->mt_count = 0; mtp->mt_free = 0; mtp->mt_failures = 0; + mtp->mt_sleeps = 0; mtp->mt_zonefree = 0; mtp->mt_kegfree = 0; @@ -304,6 +305,13 @@ memstat_get_failures(const struct memory return (mtp->mt_failures); } +uint64_t +memstat_get_sleeps(const struct memory_type *mtp) +{ + + return (mtp->mt_sleeps); +} + void * memstat_get_caller_pointer(const struct memory_type *mtp, int index) { Modified: head/lib/libmemstat/memstat.h ============================================================================== --- head/lib/libmemstat/memstat.h Tue Jun 15 19:19:04 2010 (r209214) +++ head/lib/libmemstat/memstat.h Tue Jun 15 19:28:37 2010 (r209215) @@ -139,6 +139,7 @@ uint64_t memstat_get_bytes(const struct uint64_t memstat_get_count(const struct memory_type *mtp); uint64_t memstat_get_free(const struct memory_type *mtp); uint64_t memstat_get_failures(const struct memory_type *mtp); +uint64_t memstat_get_sleeps(const struct memory_type *mtp); void *memstat_get_caller_pointer(const struct memory_type *mtp, int index); void memstat_set_caller_pointer(struct memory_type *mtp, Modified: head/lib/libmemstat/memstat_internal.h ============================================================================== --- head/lib/libmemstat/memstat_internal.h Tue Jun 15 19:19:04 2010 (r209214) +++ head/lib/libmemstat/memstat_internal.h Tue Jun 15 19:28:37 2010 (r209215) @@ -65,6 +65,7 @@ struct memory_type { uint64_t mt_count; /* Number of current allocations. */ uint64_t mt_free; /* Number of cached free items. */ uint64_t mt_failures; /* Number of allocation failures. */ + uint64_t mt_sleeps; /* Number of allocation sleeps. */ /* * Caller-owned memory. Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Tue Jun 15 19:19:04 2010 (r209214) +++ head/lib/libmemstat/memstat_uma.c Tue Jun 15 19:28:37 2010 (r209215) @@ -208,6 +208,7 @@ retry: mtp->mt_numallocs = uthp->uth_allocs; mtp->mt_numfrees = uthp->uth_frees; mtp->mt_failures = uthp->uth_fails; + mtp->mt_sleeps = uthp->uth_sleeps; for (j = 0; j < maxcpus; j++) { upsp = (struct uma_percpu_stat *)p; @@ -402,6 +403,7 @@ memstat_kvm_uma(struct memory_type_list mtp->mt_numallocs = uz.uz_allocs; mtp->mt_numfrees = uz.uz_frees; mtp->mt_failures = uz.uz_fails; + mtp->mt_sleeps = uz.uz_sleeps; if (kz.uk_flags & UMA_ZFLAG_INTERNAL) goto skip_percpu; for (i = 0; i < mp_maxid + 1; i++) { Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Tue Jun 15 19:19:04 2010 (r209214) +++ head/sys/vm/uma.h Tue Jun 15 19:28:37 2010 (r209215) @@ -600,7 +600,8 @@ struct uma_type_header { u_int64_t uth_allocs; /* Zone: number of allocations. */ u_int64_t uth_frees; /* Zone: number of frees. */ u_int64_t uth_fails; /* Zone: number of alloc failures. */ - u_int64_t _uth_reserved1[3]; /* Reserved. */ + u_int64_t uth_sleeps; /* Zone: number of alloc sleeps. */ + u_int64_t _uth_reserved1[2]; /* Reserved. */ }; struct uma_percpu_stat { Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Jun 15 19:19:04 2010 (r209214) +++ head/sys/vm/uma_core.c Tue Jun 15 19:28:37 2010 (r209215) @@ -1396,6 +1396,7 @@ zone_ctor(void *mem, int size, void *uda zone->uz_allocs = 0; zone->uz_frees = 0; zone->uz_fails = 0; + zone->uz_sleeps = 0; zone->uz_fills = zone->uz_count = 0; zone->uz_flags = 0; keg = arg->keg; @@ -2283,6 +2284,7 @@ zone_fetch_slab_multi(uma_zone_t zone, u */ if (full && !empty) { zone->uz_flags |= UMA_ZFLAG_FULL; + zone->uz_sleeps++; msleep(zone, zone->uz_lock, PVM, "zonelimit", hz/100); zone->uz_flags &= ~UMA_ZFLAG_FULL; continue; @@ -3094,13 +3096,13 @@ uma_print_zone(uma_zone_t zone) */ static void uma_zone_sumstat(uma_zone_t z, int *cachefreep, u_int64_t *allocsp, - u_int64_t *freesp) + u_int64_t *freesp, u_int64_t *sleepsp) { uma_cache_t cache; - u_int64_t allocs, frees; + u_int64_t allocs, frees, sleeps; int cachefree, cpu; - allocs = frees = 0; + allocs = frees = sleeps = 0; cachefree = 0; CPU_FOREACH(cpu) { cache = &z->uz_cpu[cpu]; @@ -3113,12 +3115,15 @@ uma_zone_sumstat(uma_zone_t z, int *cach } allocs += z->uz_allocs; frees += z->uz_frees; + sleeps += z->uz_sleeps; if (cachefreep != NULL) *cachefreep = cachefree; if (allocsp != NULL) *allocsp = allocs; if (freesp != NULL) *freesp = frees; + if (sleepsp != NULL) + *sleepsp = sleeps; } #endif /* DDB */ @@ -3226,6 +3231,7 @@ restart: uth.uth_allocs = z->uz_allocs; uth.uth_frees = z->uz_frees; uth.uth_fails = z->uz_fails; + uth.uth_sleeps = z->uz_sleeps; if (sbuf_bcat(&sbuf, &uth, sizeof(uth)) < 0) { ZONE_UNLOCK(z); mtx_unlock(&uma_mtx); @@ -3277,32 +3283,33 @@ out: #ifdef DDB DB_SHOW_COMMAND(uma, db_show_uma) { - u_int64_t allocs, frees; + u_int64_t allocs, frees, sleeps; uma_bucket_t bucket; uma_keg_t kz; uma_zone_t z; int cachefree; - db_printf("%18s %8s %8s %8s %12s\n", "Zone", "Size", "Used", "Free", - "Requests"); + db_printf("%18s %8s %8s %8s %12s %8s\n", "Zone", "Size", "Used", "Free", + "Requests", "Sleeps"); LIST_FOREACH(kz, &uma_kegs, uk_link) { LIST_FOREACH(z, &kz->uk_zones, uz_link) { if (kz->uk_flags & UMA_ZFLAG_INTERNAL) { allocs = z->uz_allocs; frees = z->uz_frees; + sleeps = z->uz_sleeps; cachefree = 0; } else uma_zone_sumstat(z, &cachefree, &allocs, - &frees); + &frees, &sleeps); if (!((z->uz_flags & UMA_ZONE_SECONDARY) && (LIST_FIRST(&kz->uk_zones) != z))) cachefree += kz->uk_free; LIST_FOREACH(bucket, &z->uz_full_bucket, ub_link) cachefree += bucket->ub_cnt; - db_printf("%18s %8ju %8jd %8d %12ju\n", z->uz_name, + db_printf("%18s %8ju %8jd %8d %12ju %8ju\n", z->uz_name, (uintmax_t)kz->uk_size, (intmax_t)(allocs - frees), cachefree, - (uintmax_t)allocs); + (uintmax_t)allocs, sleeps); } } } Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Tue Jun 15 19:19:04 2010 (r209214) +++ head/sys/vm/uma_int.h Tue Jun 15 19:28:37 2010 (r209215) @@ -327,6 +327,7 @@ struct uma_zone { u_int64_t uz_allocs UMA_ALIGN; /* Total number of allocations */ u_int64_t uz_frees; /* Total number of frees */ u_int64_t uz_fails; /* Total number of alloc failures */ + u_int64_t uz_sleeps; /* Total number of alloc sleeps */ uint16_t uz_fills; /* Outstanding bucket fills */ uint16_t uz_count; /* Highest value ub_ptr can have */ Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Tue Jun 15 19:19:04 2010 (r209214) +++ head/usr.bin/vmstat/vmstat.c Tue Jun 15 19:28:37 2010 (r209215) @@ -1294,16 +1294,17 @@ domemstat_zone(void) memstat_strerror(error)); } } - printf("%-20s %8s %8s %8s %8s %8s %8s\n\n", "ITEM", "SIZE", - "LIMIT", "USED", "FREE", "REQUESTS", "FAILURES"); + printf("%-20s %6s %6s %8s %8s %8s %4s %4s\n\n", "ITEM", "SIZE", + "LIMIT", "USED", "FREE", "REQ", "FAIL", "SLEEP"); for (mtp = memstat_mtl_first(mtlp); mtp != NULL; mtp = memstat_mtl_next(mtp)) { strlcpy(name, memstat_get_name(mtp), MEMTYPE_MAXNAME); strcat(name, ":"); - printf("%-20s %8llu, %8llu, %8llu, %8llu, %8llu, %8llu\n", name, + printf("%-20s %6llu, %6llu,%8llu,%8llu,%8llu,%4llu,%4llu\n",name, memstat_get_size(mtp), memstat_get_countlimit(mtp), memstat_get_count(mtp), memstat_get_free(mtp), - memstat_get_numallocs(mtp), memstat_get_failures(mtp)); + memstat_get_numallocs(mtp), memstat_get_failures(mtp), + memstat_get_sleeps(mtp)); } memstat_mtl_free(mtlp); printf("\n"); From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 19:28: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 58162106576A; Tue, 15 Jun 2010 19:28:44 +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 9DE928FC13; Tue, 15 Jun 2010 19:28: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 o5FJSitG072302; Tue, 15 Jun 2010 19:28:44 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FJSiit072295; Tue, 15 Jun 2010 19:28:44 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201006151928.o5FJSiit072295@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 15 Jun 2010 19:28: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: r209216 - in head: share/man/man4 sys/kern sys/net 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, 15 Jun 2010 19:28:45 -0000 Author: jkim Date: Tue Jun 15 19:28:44 2010 New Revision: 209216 URL: http://svn.freebsd.org/changeset/base/209216 Log: Implement flexible BPF timestamping framework. - Allow setting format, resolution and accuracy of BPF time stamps per listener. Previously, we were only able to use microtime(9). Now we can set various resolutions and accuracies with ioctl(2) BIOCSTSTAMP command. Similarly, we can get the current resolution and accuracy with BIOCGTSTAMP command. Document all supported options in bpf(4) and their uses. - Introduce new time stamp 'struct bpf_ts' and header 'struct bpf_xhdr'. The new time stamp has both 64-bit second and fractional parts. bpf_xhdr has this time stamp instead of 'struct timeval' for bh_tstamp. The new structures let us use bh_tstamp of same size on both 32-bit and 64-bit platforms without adding additional shims for 32-bit binaries. On 64-bit platforms, size of BPF header does not change compared to bpf_hdr as its members are already all 64-bit long. On 32-bit platforms, the size may increase by 8 bytes. For backward compatibility, struct bpf_hdr with struct timeval is still the default header unless new time stamp format is explicitly requested. However, the behaviour may change in the future and all relevant code is wrapped around "#ifdef BURN_BRIDGES" for now. - Add experimental support for tagging mbufs with time stamps from a lower layer, e.g., device driver. Currently, mbuf_tags(9) is used to tag mbufs. The time stamps must be uptime in 'struct bintime' format as binuptime(9) and getbinuptime(9) do. Reviewed by: net@ Modified: head/share/man/man4/bpf.4 head/sys/kern/kern_tc.c head/sys/net/bpf.c head/sys/net/bpf.h head/sys/net/bpfdesc.h head/sys/sys/time.h Modified: head/share/man/man4/bpf.4 ============================================================================== --- head/share/man/man4/bpf.4 Tue Jun 15 19:28:37 2010 (r209215) +++ head/share/man/man4/bpf.4 Tue Jun 15 19:28:44 2010 (r209216) @@ -49,7 +49,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 26, 2007 +.Dd June 15, 2010 .Dt BPF 4 .Os .Sh NAME @@ -513,6 +513,64 @@ to see only outgoing packets on the inte This setting is initialized to .Dv BPF_D_INOUT by default. +.It Dv BIOCSTSTAMP +.It Dv BIOCGTSTAMP +.Pq Li u_int +Set or get format and resolution of the time stamps returned by BPF. +Set to +.Dv BPF_T_MICROTIME , +.Dv BPF_T_MICROTIME_FAST , +.Dv BPF_T_MICROTIME_MONOTONIC , +or +.Dv BPF_T_MICROTIME_MONOTONIC_FAST +to get time stamps in 64-bit +.Vt struct timeval +format. +Set to +.Dv BPF_T_NANOTIME , +.Dv BPF_T_NANOTIME_FAST , +.Dv BPF_T_NANOTIME_MONOTONIC , +or +.Dv BPF_T_NANOTIME_MONOTONIC_FAST +to get time stamps in 64-bit +.Vt struct timespec +format. +Set to +.Dv BPF_T_BINTIME , +.Dv BPF_T_BINTIME_FAST , +.Dv BPF_T_NANOTIME_MONOTONIC , +or +.Dv BPF_T_BINTIME_MONOTONIC_FAST +to get time stamps in 64-bit +.Vt struct bintime +format. +Set to +.Dv BPF_T_NONE +to ignore time stamp. +All 64-bit time stamp formats are wrapped in +.Vt struct bpf_ts . +The +.Dv BPF_T_MICROTIME_FAST , +.Dv BPF_T_NANOTIME_FAST , +.Dv BPF_T_BINTIME_FAST , +.Dv BPF_T_MICROTIME_MONOTONIC_FAST , +.Dv BPF_T_NANOTIME_MONOTONIC_FAST , +and +.Dv BPF_T_BINTIME_MONOTONIC_FAST +are analogs of corresponding formats without _FAST suffix but do not perform +a full time counter query, so their accuracy is one timer tick. +The +.Dv BPF_T_MICROTIME_MONOTONIC , +.Dv BPF_T_NANOTIME_MONOTONIC , +.Dv BPF_T_BINTIME_MONOTONIC , +.Dv BPF_T_MICROTIME_MONOTONIC_FAST , +.Dv BPF_T_NANOTIME_MONOTONIC_FAST , +and +.Dv BPF_T_BINTIME_MONOTONIC_FAST +store the time elapsed since kernel boot. +This setting is initialized to +.Dv BPF_T_MICROTIME +by default. .It Dv BIOCFEEDBACK .Pq Li u_int Set packet feedback mode. @@ -575,16 +633,24 @@ against .Vt bzh_user_gen . .El .Sh BPF HEADER -The following structure is prepended to each packet returned by +One of the following structures is prepended to each packet returned by .Xr read 2 or via a zero-copy buffer: .Bd -literal +struct bpf_xhdr { + struct bpf_ts bh_tstamp; /* time stamp */ + uint32_t bh_caplen; /* length of captured portion */ + uint32_t bh_datalen; /* original length of packet */ + u_short bh_hdrlen; /* length of bpf header (this struct + plus alignment padding */ +}; + struct bpf_hdr { - struct timeval bh_tstamp; /* time stamp */ - u_long bh_caplen; /* length of captured portion */ - u_long bh_datalen; /* original length of packet */ - u_short bh_hdrlen; /* length of bpf header (this struct - plus alignment padding */ + struct timeval bh_tstamp; /* time stamp */ + uint32_t bh_caplen; /* length of captured portion */ + uint32_t bh_datalen; /* original length of packet */ + u_short bh_hdrlen; /* length of bpf header (this struct + plus alignment padding */ }; .Ed .Pp @@ -605,6 +671,8 @@ The length of the .Nm header, which may not be equal to .\" XXX - not really a function call +.Fn sizeof "struct bpf_xhdr" +or .Fn sizeof "struct bpf_hdr" . .El .Pp @@ -616,9 +684,24 @@ The purpose here is to guarantee proper data structures, which is required on alignment sensitive architectures and improves performance on many other architectures. The packet filter insures that the -.Li bpf_hdr +.Vt bpf_xhdr , +.Vt bpf_hdr and the network layer header will be word aligned. +Currently, +.Vt bpf_hdr +is used when the time stamp is set to +.Dv BPF_T_MICROTIME , +.Dv BPF_T_MICROTIME_FAST , +.Dv BPF_T_MICROTIME_MONOTONIC , +.Dv BPF_T_MICROTIME_MONOTONIC_FAST , +or +.Dv BPF_T_NONE +for backward compatibility reasons. Otherwise, +.Vt bpf_xhdr +is used. However, +.Vt bpf_hdr +may be deprecated in the near future. Suitable precautions must be taken when accessing the link layer protocol fields on alignment restricted machines. Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Tue Jun 15 19:28:37 2010 (r209215) +++ head/sys/kern/kern_tc.c Tue Jun 15 19:28:44 2010 (r209216) @@ -90,7 +90,7 @@ static struct timecounter *timecounters time_t time_second = 1; time_t time_uptime = 1; -static struct bintime boottimebin; +struct bintime boottimebin; struct timeval boottime; static int sysctl_kern_boottime(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_kern, KERN_BOOTTIME, boottime, CTLTYPE_STRUCT|CTLFLAG_RD, Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Tue Jun 15 19:28:37 2010 (r209215) +++ head/sys/net/bpf.c Tue Jun 15 19:28:44 2010 (r209216) @@ -90,12 +90,16 @@ MALLOC_DEFINE(M_BPF, "BPF", "BPF data"); #define PRINET 26 /* interruptible */ +#define SIZEOF_BPF_HDR(type) \ + (offsetof(type, bh_hdrlen) + sizeof(((type *)0)->bh_hdrlen)) + #ifdef COMPAT_FREEBSD32 #include #include #define BPF_ALIGNMENT32 sizeof(int32_t) #define BPF_WORDALIGN32(x) (((x)+(BPF_ALIGNMENT32-1))&~(BPF_ALIGNMENT32-1)) +#ifndef BURN_BRIDGES /* * 32-bit version of structure prepended to each packet. We use this header * instead of the standard one for 32-bit streams. We mark the a stream as @@ -108,6 +112,7 @@ struct bpf_hdr32 { uint16_t bh_hdrlen; /* length of bpf header (this struct plus alignment padding) */ }; +#endif struct bpf_program32 { u_int bf_len; @@ -120,11 +125,11 @@ struct bpf_dltlist32 { }; #define BIOCSETF32 _IOW('B', 103, struct bpf_program32) -#define BIOCSRTIMEOUT32 _IOW('B',109, struct timeval32) -#define BIOCGRTIMEOUT32 _IOR('B',110, struct timeval32) -#define BIOCGDLTLIST32 _IOWR('B',121, struct bpf_dltlist32) -#define BIOCSETWF32 _IOW('B',123, struct bpf_program32) -#define BIOCSETFNR32 _IOW('B',130, struct bpf_program32) +#define BIOCSRTIMEOUT32 _IOW('B', 109, struct timeval32) +#define BIOCGRTIMEOUT32 _IOR('B', 110, struct timeval32) +#define BIOCGDLTLIST32 _IOWR('B', 121, struct bpf_dltlist32) +#define BIOCSETWF32 _IOW('B', 123, struct bpf_program32) +#define BIOCSETFNR32 _IOW('B', 130, struct bpf_program32) #endif /* @@ -148,7 +153,7 @@ static __inline void bpf_wakeup(struct bpf_d *); static void catchpacket(struct bpf_d *, u_char *, u_int, u_int, void (*)(struct bpf_d *, caddr_t, u_int, void *, u_int), - struct timeval *); + struct bintime *); static void reset_d(struct bpf_d *); static int bpf_setf(struct bpf_d *, struct bpf_program *, u_long cmd); static int bpf_getdltlist(struct bpf_d *, struct bpf_dltlist *); @@ -1007,6 +1012,8 @@ reset_d(struct bpf_d *d) * BIOCSHDRCMPLT Set "header already complete" flag * BIOCGDIRECTION Get packet direction flag * BIOCSDIRECTION Set packet direction flag + * BIOCGTSTAMP Get time stamp format and resolution. + * BIOCSTSTAMP Set time stamp format and resolution. * BIOCLOCK Set "locked" flag * BIOCFEEDBACK Set packet feedback mode. * BIOCSETZBUF Set current zero-copy buffer locations. @@ -1055,6 +1062,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c case BIOCVERSION: case BIOCGRSIG: case BIOCGHDRCMPLT: + case BIOCSTSTAMP: case BIOCFEEDBACK: case FIONREAD: case BIOCLOCK: @@ -1383,6 +1391,28 @@ bpfioctl(struct cdev *dev, u_long cmd, c } break; + /* + * Set packet timestamp format and resolution. + */ + case BIOCGTSTAMP: + *(u_int *)addr = d->bd_tstamp; + break; + + /* + * Set packet timestamp format and resolution. + */ + case BIOCSTSTAMP: + { + u_int func; + + func = *(u_int *)addr; + if (BPF_T_VALID(func)) + d->bd_tstamp = func; + else + error = EINVAL; + } + break; + case BIOCFEEDBACK: d->bd_feedback = *(u_int *)addr; break; @@ -1729,6 +1759,48 @@ filt_bpfread(struct knote *kn, long hint return (ready); } +#define BPF_TSTAMP_NONE 0 +#define BPF_TSTAMP_FAST 1 +#define BPF_TSTAMP_NORMAL 2 +#define BPF_TSTAMP_EXTERN 3 + +static int +bpf_ts_quality(int tstype) +{ + + if (tstype == BPF_T_NONE) + return (BPF_TSTAMP_NONE); + if ((tstype & BPF_T_FAST) != 0) + return (BPF_TSTAMP_FAST); + + return (BPF_TSTAMP_NORMAL); +} + +static int +bpf_gettime(struct bintime *bt, int tstype, struct mbuf *m) +{ + struct m_tag *tag; + int quality; + + quality = bpf_ts_quality(tstype); + if (quality == BPF_TSTAMP_NONE) + return (quality); + + if (m != NULL) { + tag = m_tag_locate(m, MTAG_BPF, MTAG_BPF_TIMESTAMP, NULL); + if (tag != NULL) { + *bt = *(struct bintime *)(tag + 1); + return (BPF_TSTAMP_EXTERN); + } + } + if (quality == BPF_TSTAMP_NORMAL) + binuptime(bt); + else + getbinuptime(bt); + + return (quality); +} + /* * Incoming linkage from device drivers. Process the packet pkt, of length * pktlen, which is stored in a contiguous buffer. The packet is parsed @@ -1738,15 +1810,15 @@ filt_bpfread(struct knote *kn, long hint void bpf_tap(struct bpf_if *bp, u_char *pkt, u_int pktlen) { + struct bintime bt; struct bpf_d *d; #ifdef BPF_JITTER bpf_jit_filter *bf; #endif u_int slen; int gottime; - struct timeval tv; - gottime = 0; + gottime = BPF_TSTAMP_NONE; BPFIF_LOCK(bp); LIST_FOREACH(d, &bp->bif_dlist, bd_next) { BPFD_LOCK(d); @@ -1766,15 +1838,13 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, slen = bpf_filter(d->bd_rfilter, pkt, pktlen, pktlen); if (slen != 0) { d->bd_fcount++; - if (!gottime) { - microtime(&tv); - gottime = 1; - } + if (gottime < bpf_ts_quality(d->bd_tstamp)) + gottime = bpf_gettime(&bt, d->bd_tstamp, NULL); #ifdef MAC if (mac_bpfdesc_check_receive(d, bp->bif_ifp) == 0) #endif catchpacket(d, pkt, pktlen, slen, - bpf_append_bytes, &tv); + bpf_append_bytes, &bt); } BPFD_UNLOCK(d); } @@ -1791,13 +1861,13 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, void bpf_mtap(struct bpf_if *bp, struct mbuf *m) { + struct bintime bt; struct bpf_d *d; #ifdef BPF_JITTER bpf_jit_filter *bf; #endif u_int pktlen, slen; int gottime; - struct timeval tv; /* Skip outgoing duplicate packets. */ if ((m->m_flags & M_PROMISC) != 0 && m->m_pkthdr.rcvif == NULL) { @@ -1805,10 +1875,9 @@ bpf_mtap(struct bpf_if *bp, struct mbuf return; } - gottime = 0; - pktlen = m_length(m, NULL); + gottime = BPF_TSTAMP_NONE; BPFIF_LOCK(bp); LIST_FOREACH(d, &bp->bif_dlist, bd_next) { if (BPF_CHECK_DIRECTION(d, m->m_pkthdr.rcvif, bp->bif_ifp)) @@ -1825,15 +1894,13 @@ bpf_mtap(struct bpf_if *bp, struct mbuf slen = bpf_filter(d->bd_rfilter, (u_char *)m, pktlen, 0); if (slen != 0) { d->bd_fcount++; - if (!gottime) { - microtime(&tv); - gottime = 1; - } + if (gottime < bpf_ts_quality(d->bd_tstamp)) + gottime = bpf_gettime(&bt, d->bd_tstamp, m); #ifdef MAC if (mac_bpfdesc_check_receive(d, bp->bif_ifp) == 0) #endif catchpacket(d, (u_char *)m, pktlen, slen, - bpf_append_mbuf, &tv); + bpf_append_mbuf, &bt); } BPFD_UNLOCK(d); } @@ -1847,11 +1914,11 @@ bpf_mtap(struct bpf_if *bp, struct mbuf void bpf_mtap2(struct bpf_if *bp, void *data, u_int dlen, struct mbuf *m) { + struct bintime bt; struct mbuf mb; struct bpf_d *d; u_int pktlen, slen; int gottime; - struct timeval tv; /* Skip outgoing duplicate packets. */ if ((m->m_flags & M_PROMISC) != 0 && m->m_pkthdr.rcvif == NULL) { @@ -1859,8 +1926,6 @@ bpf_mtap2(struct bpf_if *bp, void *data, return; } - gottime = 0; - pktlen = m_length(m, NULL); /* * Craft on-stack mbuf suitable for passing to bpf_filter. @@ -1872,6 +1937,7 @@ bpf_mtap2(struct bpf_if *bp, void *data, mb.m_len = dlen; pktlen += dlen; + gottime = BPF_TSTAMP_NONE; BPFIF_LOCK(bp); LIST_FOREACH(d, &bp->bif_dlist, bd_next) { if (BPF_CHECK_DIRECTION(d, m->m_pkthdr.rcvif, bp->bif_ifp)) @@ -1881,15 +1947,13 @@ bpf_mtap2(struct bpf_if *bp, void *data, slen = bpf_filter(d->bd_rfilter, (u_char *)&mb, pktlen, 0); if (slen != 0) { d->bd_fcount++; - if (!gottime) { - microtime(&tv); - gottime = 1; - } + if (gottime < bpf_ts_quality(d->bd_tstamp)) + gottime = bpf_gettime(&bt, d->bd_tstamp, m); #ifdef MAC if (mac_bpfdesc_check_receive(d, bp->bif_ifp) == 0) #endif catchpacket(d, (u_char *)&mb, pktlen, slen, - bpf_append_mbuf, &tv); + bpf_append_mbuf, &bt); } BPFD_UNLOCK(d); } @@ -1898,6 +1962,69 @@ bpf_mtap2(struct bpf_if *bp, void *data, #undef BPF_CHECK_DIRECTION +#undef BPF_TSTAMP_NONE +#undef BPF_TSTAMP_FAST +#undef BPF_TSTAMP_NORMAL +#undef BPF_TSTAMP_EXTERN + +static int +bpf_hdrlen(struct bpf_d *d) +{ + int hdrlen; + + hdrlen = d->bd_bif->bif_hdrlen; +#ifndef BURN_BRIDGES + if (d->bd_tstamp == BPF_T_NONE || + BPF_T_FORMAT(d->bd_tstamp) == BPF_T_MICROTIME) +#ifdef COMPAT_FREEBSD32 + if (d->bd_compat32) + hdrlen += SIZEOF_BPF_HDR(struct bpf_hdr32); + else +#endif + hdrlen += SIZEOF_BPF_HDR(struct bpf_hdr); + else +#endif + hdrlen += SIZEOF_BPF_HDR(struct bpf_xhdr); +#ifdef COMPAT_FREEBSD32 + if (d->bd_compat32) + hdrlen = BPF_WORDALIGN32(hdrlen); + else +#endif + hdrlen = BPF_WORDALIGN(hdrlen); + + return (hdrlen - d->bd_bif->bif_hdrlen); +} + +static void +bpf_bintime2ts(struct bintime *bt, struct bpf_ts *ts, int tstype) +{ + struct bintime bt2; + struct timeval tsm; + struct timespec tsn; + + if ((tstype & BPF_T_MONOTONIC) == 0) { + bt2 = *bt; + bintime_add(&bt2, &boottimebin); + bt = &bt2; + } + switch (BPF_T_FORMAT(tstype)) { + case BPF_T_MICROTIME: + bintime2timeval(bt, &tsm); + ts->bt_sec = tsm.tv_sec; + ts->bt_frac = tsm.tv_usec; + break; + case BPF_T_NANOTIME: + bintime2timespec(bt, &tsn); + ts->bt_sec = tsn.tv_sec; + ts->bt_frac = tsn.tv_nsec; + break; + case BPF_T_BINTIME: + ts->bt_sec = bt->sec; + ts->bt_frac = bt->frac; + break; + } +} + /* * Move the packet data from interface memory (pkt) into the * store buffer. "cpfn" is the routine called to do the actual data @@ -1908,15 +2035,19 @@ bpf_mtap2(struct bpf_if *bp, void *data, static void catchpacket(struct bpf_d *d, u_char *pkt, u_int pktlen, u_int snaplen, void (*cpfn)(struct bpf_d *, caddr_t, u_int, void *, u_int), - struct timeval *tv) + struct bintime *bt) { - struct bpf_hdr hdr; + struct bpf_xhdr hdr; +#ifndef BURN_BRIDGES + struct bpf_hdr hdr_old; #ifdef COMPAT_FREEBSD32 - struct bpf_hdr32 hdr32; + struct bpf_hdr32 hdr32_old; +#endif #endif - int totlen, curlen; - int hdrlen = d->bd_bif->bif_hdrlen; + int caplen, curlen, hdrlen, totlen; int do_wakeup = 0; + int do_timestamp; + int tstype; BPFD_LOCK_ASSERT(d); @@ -1940,6 +2071,7 @@ catchpacket(struct bpf_d *d, u_char *pkt * much. Otherwise, transfer the whole packet (unless * we hit the buffer size limit). */ + hdrlen = bpf_hdrlen(d); totlen = hdrlen + min(snaplen, pktlen); if (totlen > d->bd_bufsize) totlen = d->bd_bufsize; @@ -1979,19 +2111,39 @@ catchpacket(struct bpf_d *d, u_char *pkt * reader should be woken up. */ do_wakeup = 1; + caplen = totlen - hdrlen; + tstype = d->bd_tstamp; + do_timestamp = tstype != BPF_T_NONE; +#ifndef BURN_BRIDGES + if (tstype == BPF_T_NONE || BPF_T_FORMAT(tstype) == BPF_T_MICROTIME) { + struct bpf_ts ts; + if (do_timestamp) + bpf_bintime2ts(bt, &ts, tstype); #ifdef COMPAT_FREEBSD32 - /* - * If this is a 32-bit stream, then stick a 32-bit header at the - * front and copy the data into the buffer. - */ - if (d->bd_compat32) { - bzero(&hdr32, sizeof(hdr32)); - hdr32.bh_tstamp.tv_sec = tv->tv_sec; - hdr32.bh_tstamp.tv_usec = tv->tv_usec; - hdr32.bh_datalen = pktlen; - hdr32.bh_hdrlen = hdrlen; - hdr.bh_caplen = hdr32.bh_caplen = totlen - hdrlen; - bpf_append_bytes(d, d->bd_sbuf, curlen, &hdr32, sizeof(hdr32)); + if (d->bd_compat32) { + bzero(&hdr32_old, sizeof(hdr32_old)); + if (do_timestamp) { + hdr32_old.bh_tstamp.tv_sec = ts.bt_sec; + hdr32_old.bh_tstamp.tv_usec = ts.bt_frac; + } + hdr32_old.bh_datalen = pktlen; + hdr32_old.bh_hdrlen = hdrlen; + hdr32_old.bh_caplen = caplen; + bpf_append_bytes(d, d->bd_sbuf, curlen, &hdr32_old, + sizeof(hdr32_old)); + goto copy; + } +#endif + bzero(&hdr_old, sizeof(hdr_old)); + if (do_timestamp) { + hdr_old.bh_tstamp.tv_sec = ts.bt_sec; + hdr_old.bh_tstamp.tv_usec = ts.bt_frac; + } + hdr_old.bh_datalen = pktlen; + hdr_old.bh_hdrlen = hdrlen; + hdr_old.bh_caplen = caplen; + bpf_append_bytes(d, d->bd_sbuf, curlen, &hdr_old, + sizeof(hdr_old)); goto copy; } #endif @@ -2001,19 +2153,20 @@ catchpacket(struct bpf_d *d, u_char *pkt * move forward the length of the header plus padding. */ bzero(&hdr, sizeof(hdr)); - hdr.bh_tstamp = *tv; + if (do_timestamp) + bpf_bintime2ts(bt, &hdr.bh_tstamp, tstype); hdr.bh_datalen = pktlen; hdr.bh_hdrlen = hdrlen; - hdr.bh_caplen = totlen - hdrlen; + hdr.bh_caplen = caplen; bpf_append_bytes(d, d->bd_sbuf, curlen, &hdr, sizeof(hdr)); /* * Copy the packet data into the store buffer and update its length. */ -#ifdef COMPAT_FREEBSD32 - copy: +#ifndef BURN_BRIDGES +copy: #endif - (*cpfn)(d, d->bd_sbuf, curlen + hdrlen, pkt, hdr.bh_caplen); + (*cpfn)(d, d->bd_sbuf, curlen + hdrlen, pkt, caplen); d->bd_slen = curlen + totlen; if (do_wakeup) @@ -2083,13 +2236,7 @@ bpfattach2(struct ifnet *ifp, u_int dlt, LIST_INSERT_HEAD(&bpf_iflist, bp, bif_next); mtx_unlock(&bpf_mtx); - /* - * Compute the length of the bpf header. This is not necessarily - * equal to SIZEOF_BPF_HDR because we want to insert spacing such - * that the network layer header begins on a longword boundary (for - * performance reasons and to alleviate alignment restrictions). - */ - bp->bif_hdrlen = BPF_WORDALIGN(hdrlen + SIZEOF_BPF_HDR) - hdrlen; + bp->bif_hdrlen = hdrlen; if (bootverbose) if_printf(ifp, "bpf attached\n"); Modified: head/sys/net/bpf.h ============================================================================== --- head/sys/net/bpf.h Tue Jun 15 19:28:37 2010 (r209215) +++ head/sys/net/bpf.h Tue Jun 15 19:28:44 2010 (r209216) @@ -45,6 +45,8 @@ typedef int32_t bpf_int32; typedef u_int32_t bpf_u_int32; +typedef int64_t bpf_int64; +typedef u_int64_t bpf_u_int64; /* * Alignment macros. BPF_WORDALIGN rounds up to the next @@ -113,36 +115,38 @@ struct bpf_zbuf { size_t bz_buflen; /* Size of zero-copy buffers. */ }; -#define BIOCGBLEN _IOR('B',102, u_int) -#define BIOCSBLEN _IOWR('B',102, u_int) -#define BIOCSETF _IOW('B',103, struct bpf_program) -#define BIOCFLUSH _IO('B',104) -#define BIOCPROMISC _IO('B',105) -#define BIOCGDLT _IOR('B',106, u_int) -#define BIOCGETIF _IOR('B',107, struct ifreq) -#define BIOCSETIF _IOW('B',108, struct ifreq) -#define BIOCSRTIMEOUT _IOW('B',109, struct timeval) -#define BIOCGRTIMEOUT _IOR('B',110, struct timeval) -#define BIOCGSTATS _IOR('B',111, struct bpf_stat) -#define BIOCIMMEDIATE _IOW('B',112, u_int) -#define BIOCVERSION _IOR('B',113, struct bpf_version) -#define BIOCGRSIG _IOR('B',114, u_int) -#define BIOCSRSIG _IOW('B',115, u_int) -#define BIOCGHDRCMPLT _IOR('B',116, u_int) -#define BIOCSHDRCMPLT _IOW('B',117, u_int) -#define BIOCGDIRECTION _IOR('B',118, u_int) -#define BIOCSDIRECTION _IOW('B',119, u_int) -#define BIOCSDLT _IOW('B',120, u_int) -#define BIOCGDLTLIST _IOWR('B',121, struct bpf_dltlist) +#define BIOCGBLEN _IOR('B', 102, u_int) +#define BIOCSBLEN _IOWR('B', 102, u_int) +#define BIOCSETF _IOW('B', 103, struct bpf_program) +#define BIOCFLUSH _IO('B', 104) +#define BIOCPROMISC _IO('B', 105) +#define BIOCGDLT _IOR('B', 106, u_int) +#define BIOCGETIF _IOR('B', 107, struct ifreq) +#define BIOCSETIF _IOW('B', 108, struct ifreq) +#define BIOCSRTIMEOUT _IOW('B', 109, struct timeval) +#define BIOCGRTIMEOUT _IOR('B', 110, struct timeval) +#define BIOCGSTATS _IOR('B', 111, struct bpf_stat) +#define BIOCIMMEDIATE _IOW('B', 112, u_int) +#define BIOCVERSION _IOR('B', 113, struct bpf_version) +#define BIOCGRSIG _IOR('B', 114, u_int) +#define BIOCSRSIG _IOW('B', 115, u_int) +#define BIOCGHDRCMPLT _IOR('B', 116, u_int) +#define BIOCSHDRCMPLT _IOW('B', 117, u_int) +#define BIOCGDIRECTION _IOR('B', 118, u_int) +#define BIOCSDIRECTION _IOW('B', 119, u_int) +#define BIOCSDLT _IOW('B', 120, u_int) +#define BIOCGDLTLIST _IOWR('B', 121, struct bpf_dltlist) #define BIOCLOCK _IO('B', 122) -#define BIOCSETWF _IOW('B',123, struct bpf_program) -#define BIOCFEEDBACK _IOW('B',124, u_int) -#define BIOCGETBUFMODE _IOR('B',125, u_int) -#define BIOCSETBUFMODE _IOW('B',126, u_int) -#define BIOCGETZMAX _IOR('B',127, size_t) -#define BIOCROTZBUF _IOR('B',128, struct bpf_zbuf) -#define BIOCSETZBUF _IOW('B',129, struct bpf_zbuf) -#define BIOCSETFNR _IOW('B',130, struct bpf_program) +#define BIOCSETWF _IOW('B', 123, struct bpf_program) +#define BIOCFEEDBACK _IOW('B', 124, u_int) +#define BIOCGETBUFMODE _IOR('B', 125, u_int) +#define BIOCSETBUFMODE _IOW('B', 126, u_int) +#define BIOCGETZMAX _IOR('B', 127, size_t) +#define BIOCROTZBUF _IOR('B', 128, struct bpf_zbuf) +#define BIOCSETZBUF _IOW('B', 129, struct bpf_zbuf) +#define BIOCSETFNR _IOW('B', 130, struct bpf_program) +#define BIOCGTSTAMP _IOR('B', 131, u_int) +#define BIOCSTSTAMP _IOW('B', 132, u_int) /* Obsolete */ #define BIOCGSEESENT BIOCGDIRECTION @@ -155,9 +159,48 @@ enum bpf_direction { BPF_D_OUT /* See outgoing packets */ }; +/* Time stamping functions */ +#define BPF_T_MICROTIME 0x0000 +#define BPF_T_NANOTIME 0x0001 +#define BPF_T_BINTIME 0x0002 +#define BPF_T_NONE 0x0003 +#define BPF_T_FORMAT_MASK 0x0003 +#define BPF_T_NORMAL 0x0000 +#define BPF_T_FAST 0x0100 +#define BPF_T_MONOTONIC 0x0200 +#define BPF_T_MONOTONIC_FAST (BPF_T_FAST | BPF_T_MONOTONIC) +#define BPF_T_FLAG_MASK 0x0300 +#define BPF_T_FORMAT(t) ((t) & BPF_T_FORMAT_MASK) +#define BPF_T_FLAG(t) ((t) & BPF_T_FLAG_MASK) +#define BPF_T_VALID(t) \ + ((t) == BPF_T_NONE || (BPF_T_FORMAT(t) != BPF_T_NONE && \ + ((t) & ~(BPF_T_FORMAT_MASK | BPF_T_FLAG_MASK)) == 0)) + +#define BPF_T_MICROTIME_FAST (BPF_T_MICROTIME | BPF_T_FAST) +#define BPF_T_NANOTIME_FAST (BPF_T_NANOTIME | BPF_T_FAST) +#define BPF_T_BINTIME_FAST (BPF_T_BINTIME | BPF_T_FAST) +#define BPF_T_MICROTIME_MONOTONIC (BPF_T_MICROTIME | BPF_T_MONOTONIC) +#define BPF_T_NANOTIME_MONOTONIC (BPF_T_NANOTIME | BPF_T_MONOTONIC) +#define BPF_T_BINTIME_MONOTONIC (BPF_T_BINTIME | BPF_T_MONOTONIC) +#define BPF_T_MICROTIME_MONOTONIC_FAST (BPF_T_MICROTIME | BPF_T_MONOTONIC_FAST) +#define BPF_T_NANOTIME_MONOTONIC_FAST (BPF_T_NANOTIME | BPF_T_MONOTONIC_FAST) +#define BPF_T_BINTIME_MONOTONIC_FAST (BPF_T_BINTIME | BPF_T_MONOTONIC_FAST) + /* * Structure prepended to each packet. */ +struct bpf_ts { + bpf_int64 bt_sec; /* seconds */ + bpf_u_int64 bt_frac; /* fraction */ +}; +struct bpf_xhdr { + struct bpf_ts bh_tstamp; /* time stamp */ + bpf_u_int32 bh_caplen; /* length of captured portion */ + bpf_u_int32 bh_datalen; /* original length of packet */ + u_short bh_hdrlen; /* length of bpf header (this struct + plus alignment padding) */ +}; +/* Obsolete */ struct bpf_hdr { struct timeval bh_tstamp; /* time stamp */ bpf_u_int32 bh_caplen; /* length of captured portion */ @@ -165,14 +208,9 @@ struct bpf_hdr { u_short bh_hdrlen; /* length of bpf header (this struct plus alignment padding) */ }; -/* - * Because the structure above is not a multiple of 4 bytes, some compilers - * will insist on inserting padding; hence, sizeof(struct bpf_hdr) won't work. - * Only the kernel needs to know about it; applications use bh_hdrlen. - */ #ifdef _KERNEL -#define SIZEOF_BPF_HDR (sizeof(struct bpf_hdr) <= 20 ? 18 : \ - sizeof(struct bpf_hdr)) +#define MTAG_BPF 0x627066 +#define MTAG_BPF_TIMESTAMP 0 #endif /* @@ -922,7 +960,7 @@ struct bpf_if { LIST_ENTRY(bpf_if) bif_next; /* list of all interfaces */ LIST_HEAD(, bpf_d) bif_dlist; /* descriptor list */ u_int bif_dlt; /* link layer type */ - u_int bif_hdrlen; /* length of header (with padding) */ + u_int bif_hdrlen; /* length of link header */ struct ifnet *bif_ifp; /* corresponding interface */ struct mtx bif_mtx; /* mutex for interface */ }; Modified: head/sys/net/bpfdesc.h ============================================================================== --- head/sys/net/bpfdesc.h Tue Jun 15 19:28:37 2010 (r209215) +++ head/sys/net/bpfdesc.h Tue Jun 15 19:28:44 2010 (r209216) @@ -81,6 +81,7 @@ struct bpf_d { u_char bd_immediate; /* true to return on packet arrival */ int bd_hdrcmplt; /* false to fill in src lladdr automatically */ int bd_direction; /* select packet direction */ + int bd_tstamp; /* select time stamping function */ int bd_feedback; /* true to feed back sent packets */ int bd_async; /* non-zero if packet reception should generate signal */ int bd_sig; /* signal to send upon packet reception */ Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Tue Jun 15 19:28:37 2010 (r209215) +++ head/sys/sys/time.h Tue Jun 15 19:28:44 2010 (r209216) @@ -264,6 +264,7 @@ void resettodr(void); extern time_t time_second; extern time_t time_uptime; +extern struct bintime boottimebin; extern struct timeval boottime; /* From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 19:47: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 8AD731065686; Tue, 15 Jun 2010 19:47:26 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id E55B48FC12; Tue, 15 Jun 2010 19:47:25 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id C9F86C42DC; Tue, 15 Jun 2010 21:52:44 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id o6dpgimiDsqp; Tue, 15 Jun 2010 21:52:44 +0200 (CEST) Received: from [192.168.133.14] (nat3-133.ghnet.pl [91.150.222.133]) by smtp.semihalf.com (Postfix) with ESMTPSA id E16F3C42DB; Tue, 15 Jun 2010 21:52:43 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <20100614104355.2d392cb8@bender> Date: Tue, 15 Jun 2010 21:47:22 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <55190F2E-35CC-4B79-8551-A3F76EA4E0AE@semihalf.com> References: <201006131312.o5DDCqhi034591@svn.freebsd.org> <20100614104355.2d392cb8@bender> To: Andrew Turner X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209130 - in head/sys: arm/include 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: Tue, 15 Jun 2010 19:47:26 -0000 On 2010-06-14, at 00:43, Andrew Turner wrote: > On Sun, 13 Jun 2010 13:12:52 +0000 (UTC) > Rafal Jaworowski wrote: >=20 >> Author: raj >> Date: Sun Jun 13 13:12:52 2010 >> New Revision: 209130 >> URL: http://svn.freebsd.org/changeset/base/209130 >>=20 >> Log: >> Initial FDT infrastructure elements for ARM. >>=20 >> Reviewed by: imp >> Sponsored by: The FreeBSD Foundation >>=20 >> Added: >> head/sys/arm/include/fdt.h (contents, props changed) >> head/sys/arm/include/ofw_machdep.h (contents, props changed) >> head/sys/dev/fdt/fdt_arm.c (contents, props changed) >>=20 >> Added: head/sys/arm/include/fdt.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- /dev/null 00:00:00 1970 (empty, because file is >> newly added) >> +++ head/sys/arm/include/fdt.h Sun Jun 13 >> 13:12:52 2010 (r209130) >> @@ -0,0 +1,68 @@ >> +/*- >> + * Copyright (c) 2010 The FreeBSD Foundation >> + * All rights reserved. >> + * >> + * This software was developed by Semihalf under sponsorship from >> + * the FreeBSD Foundation. >> + * >> + * Redistribution and use in source and binary forms, with or = without >> + * modification, are permitted provided that the following = conditions >> + * are met: >> + * 1. Redistributions of source code must retain the above copyright >> + * notice, this list of conditions and the following disclaimer. >> + * 2. Redistributions in binary form must reproduce the above >> copyright >> + * notice, this list of conditions and the following disclaimer >> in the >> + * documentation and/or other materials provided with the >> distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS >> IS'' AND >> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >> THE >> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A >> PARTICULAR PURPOSE >> + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE >> LIABLE >> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >> CONSEQUENTIAL >> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE >> GOODS >> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >> INTERRUPTION) >> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >> CONTRACT, STRICT >> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN >> ANY WAY >> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE >> POSSIBILITY OF >> + * SUCH DAMAGE. >> + * >> + * $FreeBSD$ >> + */ >> + >> +#ifndef _MACHINE_FDT_H_ >> +#define _MACHINE_FDT_H_ >> + >> +#include >> + >> +#include >> +#include >> + >> +#include >> +#include >> + >> +#include >> +#include > Are the mv headders supposed to be here? They are including a soc > specific file from an ARM header. They are required for now, but will go away with another conversion of = ARM platform other than Marvell. We still need to factor out some = pieces, but they are really tiny. Rafal From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 19:49: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 8EE5910656CB; Tue, 15 Jun 2010 19:49:16 +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 639148FC18; Tue, 15 Jun 2010 19:49:16 +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 EEEB246B2A; Tue, 15 Jun 2010 15:49:15 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 23CDE8A04E; Tue, 15 Jun 2010 15:49:15 -0400 (EDT) From: John Baldwin To: Jack F Vogel Date: Tue, 15 Jun 2010 15:49:09 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006112054.o5BKsRk8087302@svn.freebsd.org> In-Reply-To: <201006112054.o5BKsRk8087302@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201006151549.09210.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 15 Jun 2010 15:49:15 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham 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: r209068 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 19:49:16 -0000 On Friday 11 June 2010 4:54:27 pm Jack F Vogel wrote: > Author: jfv > Date: Fri Jun 11 20:54:27 2010 > New Revision: 209068 > URL: http://svn.freebsd.org/changeset/base/209068 > > Log: > Add a couple fixes from Michael Tuexen. > Remove unneeded rxtx handler, make que handler generic. > Do not allocate header mbufs in rx ring if not doing hdr split. > Release the lock in rxeof call to stack. > > MFC for 8.1 asap This causes a panic with MSIX is disabled (boot with hw.pci.msix_enabled=0). The reason is that in the !MSIX case, the rxtx_task is queued to the adapter->tq queue, but in the MSIX case the task is queued to the per-queue que->tq queue. igb_handle_que() assumes the MSIX case, it is not generic. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 20:18: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 DC232106564A; Tue, 15 Jun 2010 20:18:50 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 337168FC08; Tue, 15 Jun 2010 20:18:49 +0000 (UTC) Received: by qyk11 with SMTP id 11so1015580qyk.13 for ; Tue, 15 Jun 2010 13:18:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=8m9XApBihncBZgP8qDSRjNhhVazwQ1aU4Nc+oxjfxZ0=; b=nQA7mVu9Uq+PFs6xyj5YXu2CRAQa+3z/Y5yN/ForcRNiwp/lLobDryhU/9x1if3x7m Ttc9/K/3TcBNJ01QaCJth3HmuoWriiFAlC/H14WOuVvj1/89tOFuKohX3DDq3rKnFoin i1Ja5lKg0Rj8BZsmArioOaoYUy4RSXuKavp6E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=XhGq7sAEpqgdzyE+GxRgsJx9Sfee4ac+dJNP0U268bre9cQYUDBLAJzR0CawjHdWDy QHxl8ztPBNLMlCGr54h6uPSz+u1zpgZOOSBSOeHQ8SFJaGa9XDdpxJEHBlyBWVdbwqDK sG9Gfr9khfIpgjNCFqgluvP7+SVuHA+QKaBSI= MIME-Version: 1.0 Received: by 10.224.66.206 with SMTP id o14mr3523053qai.264.1276633129283; Tue, 15 Jun 2010 13:18:49 -0700 (PDT) Received: by 10.229.246.65 with HTTP; Tue, 15 Jun 2010 13:18:49 -0700 (PDT) In-Reply-To: <201006151549.09210.jhb@freebsd.org> References: <201006112054.o5BKsRk8087302@svn.freebsd.org> <201006151549.09210.jhb@freebsd.org> Date: Tue, 15 Jun 2010 13:18:49 -0700 Message-ID: From: Jack Vogel To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209068 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 20:18:51 -0000 Ahhh, thanks for report John, will fix that asap. Jack On Tue, Jun 15, 2010 at 12:49 PM, John Baldwin wrote: > On Friday 11 June 2010 4:54:27 pm Jack F Vogel wrote: > > Author: jfv > > Date: Fri Jun 11 20:54:27 2010 > > New Revision: 209068 > > URL: http://svn.freebsd.org/changeset/base/209068 > > > > Log: > > Add a couple fixes from Michael Tuexen. > > Remove unneeded rxtx handler, make que handler generic. > > Do not allocate header mbufs in rx ring if not doing hdr split. > > Release the lock in rxeof call to stack. > > > > MFC for 8.1 asap > > This causes a panic with MSIX is disabled (boot with > hw.pci.msix_enabled=0). > The reason is that in the !MSIX case, the rxtx_task is queued to the > adapter->tq queue, but in the MSIX case the task is queued to the per-queue > que->tq queue. igb_handle_que() assumes the MSIX case, it is not generic. > > -- > John Baldwin > From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 20:40: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 B87BA1065672; Tue, 15 Jun 2010 20:40:49 +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 892628FC19; Tue, 15 Jun 2010 20:40:49 +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 305B946C32; Tue, 15 Jun 2010 16:40:49 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 646558A03C; Tue, 15 Jun 2010 16:40:48 -0400 (EDT) From: John Baldwin To: Jack Vogel Date: Tue, 15 Jun 2010 16:40:43 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006112054.o5BKsRk8087302@svn.freebsd.org> <201006151549.09210.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201006151640.43739.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 15 Jun 2010 16:40:48 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209068 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 20:40:49 -0000 On Tuesday 15 June 2010 4:18:49 pm Jack Vogel wrote: > Ahhh, thanks for report John, will fix that asap. I actually just tested a patch to make it use que->tq and que->task always instead of the rxtx_task. I have some other patches to cleanup some of the taskq stuff as well, I'll send it along once I've done some testing with em(4). > Jack > > > On Tue, Jun 15, 2010 at 12:49 PM, John Baldwin wrote: > > > On Friday 11 June 2010 4:54:27 pm Jack F Vogel wrote: > > > Author: jfv > > > Date: Fri Jun 11 20:54:27 2010 > > > New Revision: 209068 > > > URL: http://svn.freebsd.org/changeset/base/209068 > > > > > > Log: > > > Add a couple fixes from Michael Tuexen. > > > Remove unneeded rxtx handler, make que handler generic. > > > Do not allocate header mbufs in rx ring if not doing hdr split. > > > Release the lock in rxeof call to stack. > > > > > > MFC for 8.1 asap > > > > This causes a panic with MSIX is disabled (boot with > > hw.pci.msix_enabled=0). > > The reason is that in the !MSIX case, the rxtx_task is queued to the > > adapter->tq queue, but in the MSIX case the task is queued to the per- queue > > que->tq queue. igb_handle_que() assumes the MSIX case, it is not generic. > > > > -- > > John Baldwin > > > -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 21:00: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 1C8511065670; Tue, 15 Jun 2010 21:00:54 +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 0C7188FC20; Tue, 15 Jun 2010 21:00: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 o5FL0rBF092627; Tue, 15 Jun 2010 21:00:53 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FL0r06092626; Tue, 15 Jun 2010 21:00:53 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201006152100.o5FL0r06092626@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 15 Jun 2010 21:00:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209217 - head/lib/libedit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 21:00:54 -0000 Author: jilles Date: Tue Jun 15 21:00:53 2010 New Revision: 209217 URL: http://svn.freebsd.org/changeset/base/209217 Log: libedit: Fix a bug that could make completion listings incomplete. The element matches[0] is the common prefix and is not counted in len, so subtracting 1 is not needed. A counter for the number of matches per line was incremented twice. Submitted by: Guy Yur Modified: head/lib/libedit/filecomplete.c Modified: head/lib/libedit/filecomplete.c ============================================================================== --- head/lib/libedit/filecomplete.c Tue Jun 15 19:28:44 2010 (r209216) +++ head/lib/libedit/filecomplete.c Tue Jun 15 21:00:53 2010 (r209217) @@ -347,13 +347,12 @@ fn_display_match_list(EditLine *el, char count++; /* Sort the items if they are not already sorted. */ - qsort(&matches[1], (size_t)(len - 1), sizeof(char *), - _fn_qsort_string_compare); + qsort(&matches[1], len, sizeof(char *), _fn_qsort_string_compare); idx = 1; for(; count > 0; count--) { int more = limit > 0 && matches[0]; - for(i = 0; more; i++, idx++) { + for(i = 0; more; idx++) { more = ++i < limit && matches[idx + 1]; (void)fprintf(el->el_outfile, "%-*s%s", (int)max, matches[idx], more ? " " : ""); From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 21:11: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 80CEA106566C; Tue, 15 Jun 2010 21:11:51 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 667768FC0C; Tue, 15 Jun 2010 21:11: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 o5FLBp9E095038; Tue, 15 Jun 2010 21:11:51 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FLBpPa095035; Tue, 15 Jun 2010 21:11:51 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201006152111.o5FLBpPa095035@svn.freebsd.org> From: Jack F Vogel Date: Tue, 15 Jun 2010 21:11: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: r209218 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 21:11:51 -0000 Author: jfv Date: Tue Jun 15 21:11:51 2010 New Revision: 209218 URL: http://svn.freebsd.org/changeset/base/209218 Log: Change to have legacy interrupts use the same handler had a flaw, thanks to John Baldwin for finding it. Change which queue legacy tasks are enqueued on. MFC: soonest Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Tue Jun 15 21:00:53 2010 (r209217) +++ head/sys/dev/e1000/if_igb.c Tue Jun 15 21:11:51 2010 (r209218) @@ -1285,8 +1285,9 @@ igb_handle_link(void *context, int pendi static int igb_irq_fast(void *arg) { - struct adapter *adapter = arg; - uint32_t reg_icr; + struct adapter *adapter = arg; + struct igb_queue *que = adapter->queues; + u32 reg_icr; reg_icr = E1000_READ_REG(&adapter->hw, E1000_ICR); @@ -1308,11 +1309,11 @@ igb_irq_fast(void *arg) * MSI message reordering errata on certain systems. */ igb_disable_intr(adapter); - taskqueue_enqueue(adapter->tq, &adapter->rxtx_task); + taskqueue_enqueue(que->tq, &que->que_task); /* Link status change */ if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) - taskqueue_enqueue(adapter->tq, &adapter->link_task); + taskqueue_enqueue(que->tq, &adapter->link_task); if (reg_icr & E1000_ICR_RXO) adapter->rx_overruns++; @@ -1352,7 +1353,7 @@ igb_poll(struct ifnet *ifp, enum poll_cm reg_icr = E1000_READ_REG(&adapter->hw, E1000_ICR); /* Link status change */ if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) - taskqueue_enqueue(adapter->tq, &adapter->link_task); + taskqueue_enqueue(que->tq, &adapter->link_task); if (reg_icr & E1000_ICR_RXO) adapter->rx_overruns++; @@ -2116,20 +2117,20 @@ igb_allocate_legacy(struct adapter *adap * Try allocating a fast interrupt and the associated deferred * processing contexts. */ - TASK_INIT(&adapter->rxtx_task, 0, igb_handle_que, que); + TASK_INIT(&que->que_task, 0, igb_handle_que, que); /* Make tasklet for deferred link handling */ TASK_INIT(&adapter->link_task, 0, igb_handle_link, adapter); - adapter->tq = taskqueue_create_fast("igb_taskq", M_NOWAIT, - taskqueue_thread_enqueue, &adapter->tq); - taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s taskq", + que->tq = taskqueue_create_fast("igb_taskq", M_NOWAIT, + taskqueue_thread_enqueue, &que->tq); + taskqueue_start_threads(&que->tq, 1, PI_NET, "%s taskq", device_get_nameunit(adapter->dev)); if ((error = bus_setup_intr(dev, adapter->res, INTR_TYPE_NET | INTR_MPSAFE, igb_irq_fast, NULL, adapter, &adapter->tag)) != 0) { device_printf(dev, "Failed to register fast interrupt " "handler: %d\n", error); - taskqueue_free(adapter->tq); - adapter->tq = NULL; + taskqueue_free(que->tq); + que->tq = NULL; return (error); } Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Tue Jun 15 21:00:53 2010 (r209217) +++ head/sys/dev/e1000/if_igb.h Tue Jun 15 21:11:51 2010 (r209218) @@ -382,7 +382,6 @@ struct adapter { int min_frame_size; struct mtx core_mtx; int igb_insert_vlan_header; - struct task rxtx_task; struct taskqueue *tq; /* adapter task queue */ u16 num_queues; From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 21:19: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 19ADB106564A; Tue, 15 Jun 2010 21:19:46 +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 DF2898FC08; Tue, 15 Jun 2010 21:19:45 +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 8E4D746C32; Tue, 15 Jun 2010 17:19:45 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D13578A03C; Tue, 15 Jun 2010 17:19:44 -0400 (EDT) From: John Baldwin To: Jack F Vogel Date: Tue, 15 Jun 2010 17:19:39 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006152111.o5FLBpPa095035@svn.freebsd.org> In-Reply-To: <201006152111.o5FLBpPa095035@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201006151719.39275.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 15 Jun 2010 17:19:44 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham 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: r209218 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 21:19:46 -0000 On Tuesday 15 June 2010 5:11:51 pm Jack F Vogel wrote: > Author: jfv > Date: Tue Jun 15 21:11:51 2010 > New Revision: 209218 > URL: http://svn.freebsd.org/changeset/base/209218 > > Log: > Change to have legacy interrupts use the same > handler had a flaw, thanks to John Baldwin for > finding it. Change which queue legacy tasks are > enqueued on. > > MFC: soonest Thanks. > Modified: head/sys/dev/e1000/if_igb.h > ============================================================================== > --- head/sys/dev/e1000/if_igb.h Tue Jun 15 21:00:53 2010 (r209217) > +++ head/sys/dev/e1000/if_igb.h Tue Jun 15 21:11:51 2010 (r209218) > @@ -382,7 +382,6 @@ struct adapter { > int min_frame_size; > struct mtx core_mtx; > int igb_insert_vlan_header; > - struct task rxtx_task; > struct taskqueue *tq; /* adapter task queue */ > u16 num_queues; I think the 'tq' pointer here is unused now and can be dropped. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 21:34: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 E2299106566B; Tue, 15 Jun 2010 21:34:57 +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 D0DD48FC0A; Tue, 15 Jun 2010 21:34: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 o5FLYvvh000219; Tue, 15 Jun 2010 21:34:57 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FLYvTO000216; Tue, 15 Jun 2010 21:34:57 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201006152134.o5FLYvTO000216@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 15 Jun 2010 21:34: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: r209219 - in head: include lib/libedit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 21:34:58 -0000 Author: jilles Date: Tue Jun 15 21:34:57 2010 New Revision: 209219 URL: http://svn.freebsd.org/changeset/base/209219 Log: libedit: Allow simple quoting in filename completion. The completer recognizes characters escaped with backslashes as being literal parts of a word, and adds backslashes to avoid almost all misinterpretation. In particular, filenames containing spaces can be completed correctly. For bug compatibility with the NetBSD version, the improved completion function has a new name, _el_fn_sh_complete, and _el_fn_complete is unchanged. Submitted by: Guy Yur Modified: head/include/histedit.h head/lib/libedit/filecomplete.c head/lib/libedit/filecomplete.h Modified: head/include/histedit.h ============================================================================== --- head/include/histedit.h Tue Jun 15 21:11:51 2010 (r209218) +++ head/include/histedit.h Tue Jun 15 21:34:57 2010 (r209219) @@ -106,6 +106,7 @@ int el_parse(EditLine *, int, const ch int el_set(EditLine *, int, ...); int el_get(EditLine *, int, ...); unsigned char _el_fn_complete(EditLine *, int); +unsigned char _el_fn_sh_complete(EditLine *, int); /* * el_set/el_get parameters Modified: head/lib/libedit/filecomplete.c ============================================================================== --- head/lib/libedit/filecomplete.c Tue Jun 15 21:11:51 2010 (r209218) +++ head/lib/libedit/filecomplete.c Tue Jun 15 21:34:57 2010 (r209219) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@', '$', '>', '<', '=', ';', '|', '&', '{', '(', '\0' }; +/* Tilde is deliberately omitted here, we treat it specially. */ +static char extra_quote_chars[] = { ')', '}', '\0' }; /********************************/ @@ -380,10 +382,14 @@ fn_complete(EditLine *el, char **(*attempted_completion_function)(const char *, int, int), const char *word_break, const char *special_prefixes, const char *(*app_func)(const char *), size_t query_items, - int *completion_type, int *over, int *point, int *end) + int *completion_type, int *over, int *point, int *end, + const char *(*find_word_start_func)(const char *, const char *), + char *(*dequoting_func)(const char *), + char *(*quoting_func)(const char *)) { const LineInfo *li; char *temp; + char *dequoted_temp; char **matches; const char *ctemp; size_t len; @@ -404,11 +410,15 @@ fn_complete(EditLine *el, /* We now look backwards for the start of a filename/variable word */ li = el_line(el); - ctemp = li->cursor; - while (ctemp > li->buffer - && !strchr(word_break, ctemp[-1]) - && (!special_prefixes || !strchr(special_prefixes, ctemp[-1]) ) ) - ctemp--; + if (find_word_start_func) + ctemp = find_word_start_func(li->buffer, li->cursor); + else { + ctemp = li->cursor; + while (ctemp > li->buffer + && !strchr(word_break, ctemp[-1]) + && (!special_prefixes || !strchr(special_prefixes, ctemp[-1]) ) ) + ctemp--; + } len = li->cursor - ctemp; #if defined(__SSP__) || defined(__SSP_ALL__) @@ -421,6 +431,13 @@ fn_complete(EditLine *el, (void)strncpy(temp, ctemp, len); temp[len] = '\0'; + if (dequoting_func) { + dequoted_temp = dequoting_func(temp); + if (dequoted_temp == NULL) + return retval; + } else + dequoted_temp = NULL; + /* these can be used by function called in completion_matches() */ /* or (*attempted_completion_function)() */ if (point != 0) @@ -430,13 +447,13 @@ fn_complete(EditLine *el, if (attempted_completion_function) { int cur_off = (int)(li->cursor - li->buffer); - matches = (*attempted_completion_function) (temp, + matches = (*attempted_completion_function) (dequoted_temp ? dequoted_temp : temp, (int)(cur_off - len), cur_off); } else matches = 0; if (!attempted_completion_function || (over != NULL && !*over && !matches)) - matches = completion_matches(temp, complet_func); + matches = completion_matches(dequoted_temp ? dequoted_temp : temp, complet_func); if (over != NULL) *over = 0; @@ -451,8 +468,18 @@ fn_complete(EditLine *el, * possible matches if there is possible completion. */ if (matches[0][0] != '\0') { + char *quoted_match; + if (quoting_func) { + quoted_match = quoting_func(matches[0]); + if (quoted_match == NULL) + goto free_matches; + } else + quoted_match = NULL; + el_deletestr(el, (int) len); - el_insertstr(el, matches[0]); + el_insertstr(el, quoted_match ? quoted_match : matches[0]); + + free(quoted_match); } if (what_to_do == '?') @@ -514,12 +541,14 @@ fn_complete(EditLine *el, retval = CC_NORM; } +free_matches: /* free elements of array and the array itself */ for (i = 0; matches[i]; i++) free(matches[i]); free(matches); matches = NULL; } + free(dequoted_temp); #if defined(__SSP__) || defined(__SSP_ALL__) free(temp); #endif @@ -536,5 +565,99 @@ _el_fn_complete(EditLine *el, int ch __a { return (unsigned char)fn_complete(el, NULL, NULL, break_chars, NULL, NULL, 100, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, + NULL, NULL, NULL); +} + + +static const char * +sh_find_word_start(const char *buffer, const char *cursor) +{ + const char *word_start = buffer; + + while (buffer < cursor) { + if (*buffer == '\\') + buffer++; + else if (strchr(break_chars, *buffer)) + word_start = buffer + 1; + + buffer++; + } + + return word_start; +} + + +static char * +sh_quote(const char *str) +{ + const char *src; + int extra_len = 0; + char *quoted_str, *dst; + + for (src = str; *src != '\0'; src++) + if (strchr(break_chars, *src) || + strchr(extra_quote_chars, *src)) + extra_len++; + + quoted_str = malloc(sizeof(*quoted_str) * + (strlen(str) + extra_len + 1)); + if (quoted_str == NULL) + return NULL; + + dst = quoted_str; + for (src = str; *src != '\0'; src++) { + if (strchr(break_chars, *src) || + strchr(extra_quote_chars, *src)) + *dst++ = '\\'; + *dst++ = *src; + } + *dst = '\0'; + + return quoted_str; +} + + +static char * +sh_dequote(const char *str) +{ + char *dequoted_str, *dst; + + /* save extra space to replace \~ with ./~ */ + dequoted_str = malloc(sizeof(*dequoted_str) * (strlen(str) + 1 + 1)); + if (dequoted_str == NULL) + return NULL; + + dst = dequoted_str; + + /* dequote \~ at start as ./~ */ + if (*str == '\\' && str[1] == '~') { + str++; + *dst++ = '.'; + *dst++ = '/'; + } + + while (*str) { + if (*str == '\\') + str++; + if (*str) + *dst++ = *str++; + } + *dst = '\0'; + + return dequoted_str; +} + + +/* + * completion function using sh quoting rules; for key binding + */ +/* ARGSUSED */ +unsigned char +_el_fn_sh_complete(EditLine *el, int ch __attribute__((__unused__))) +{ + return (unsigned char)fn_complete(el, NULL, NULL, + break_chars, NULL, NULL, 100, + NULL, NULL, NULL, NULL, + sh_find_word_start, sh_dequote, sh_quote); } Modified: head/lib/libedit/filecomplete.h ============================================================================== --- head/lib/libedit/filecomplete.h Tue Jun 15 21:11:51 2010 (r209218) +++ head/lib/libedit/filecomplete.h Tue Jun 15 21:34:57 2010 (r209219) @@ -36,7 +36,10 @@ int fn_complete(EditLine *, char *(*)(const char *, int), char **(*)(const char *, int, int), const char *, const char *, const char *(*)(const char *), size_t, - int *, int *, int *, int *); + int *, int *, int *, int *, + const char *(*)(const char *, const char *), + char *(*)(const char *), + char *(*)(const char *)); void fn_display_match_list(EditLine *, char **, size_t, size_t); char *fn_tilde_expand(const char *); From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 21:58: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 D3A311065676; Tue, 15 Jun 2010 21:58:40 +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 C316F8FC1B; Tue, 15 Jun 2010 21:58: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 o5FLwepf005442; Tue, 15 Jun 2010 21:58:40 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FLwerZ005440; Tue, 15 Jun 2010 21:58:40 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201006152158.o5FLwerZ005440@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 15 Jun 2010 21:58: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: r209221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2010 21:58:40 -0000 Author: jilles Date: Tue Jun 15 21:58:40 2010 New Revision: 209221 URL: http://svn.freebsd.org/changeset/base/209221 Log: sh: Add filename completion. This uses the new libedit completion function with quoting support. Unlike NetBSD, there is no 'set +o tabcomplete' option to disable completion. I do not see any reason for such a special treatment, as completion is rather useful and it is possible to do bind ^I ed-insert to disable completion and insert a tab character instead. Submitted by: Guy Yur Modified: head/bin/sh/histedit.c Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Tue Jun 15 21:46:07 2010 (r209220) +++ head/bin/sh/histedit.c Tue Jun 15 21:58:40 2010 (r209221) @@ -119,6 +119,9 @@ histedit(void) if (hist) el_set(el, EL_HIST, history, hist); el_set(el, EL_PROMPT, getprompt); + el_set(el, EL_ADDFN, "sh-complete", + "Filename completion", + _el_fn_sh_complete); } else { bad: out2fmt_flush("sh: can't initialize editing\n"); @@ -135,6 +138,7 @@ bad: el_set(el, EL_EDITOR, "vi"); else if (Eflag) el_set(el, EL_EDITOR, "emacs"); + el_set(el, EL_BIND, "^I", "sh-complete", NULL); el_source(el, NULL); } } else { From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 22:01: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 61ED71065672; Tue, 15 Jun 2010 22:01:38 +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 5135D8FC17; Tue, 15 Jun 2010 22:01: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 o5FM1cs9006170; Tue, 15 Jun 2010 22:01:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FM1c8m006168; Tue, 15 Jun 2010 22:01:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006152201.o5FM1c8m006168@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 15 Jun 2010 22:01: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: r209222 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2010 22:01:38 -0000 Author: nwhitehorn Date: Tue Jun 15 22:01:38 2010 New Revision: 209222 URL: http://svn.freebsd.org/changeset/base/209222 Log: Modify the console mouse pointer drawing routine to use single-byte writes instead of 4-byte ones. Because the mouse pointer can start part way through a character cell, 4-byte memory operations are not necessarily aligned, triggering a fatal alignment exception when the console pointer was moved on PowerPC G5 systems. MFC after: 3 days Modified: head/sys/powerpc/ofw/ofw_syscons.c Modified: head/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- head/sys/powerpc/ofw/ofw_syscons.c Tue Jun 15 21:58:40 2010 (r209221) +++ head/sys/powerpc/ofw/ofw_syscons.c Tue Jun 15 22:01:38 2010 (r209222) @@ -856,16 +856,11 @@ ofwfb_putm8(video_adapter_t *adp, int x, { struct ofwfb_softc *sc; int i, j, k; - uint32_t *addr; + uint8_t *addr; u_char fg, bg; - union { - uint32_t l[2]; - uint8_t c[8]; - } ch; - sc = (struct ofwfb_softc *)adp; - addr = (u_int32_t *)((int)sc->sc_addr + addr = (u_int8_t *)((int)sc->sc_addr + (y + sc->sc_ymargin)*sc->sc_stride + x + sc->sc_xmargin); @@ -874,12 +869,6 @@ ofwfb_putm8(video_adapter_t *adp, int x, for (i = 0; i < size && i+y < sc->sc_height - 2*sc->sc_ymargin; i++) { /* - * Use the current values for the line - */ - ch.l[0] = addr[0]; - ch.l[1] = addr[1]; - - /* * Calculate 2 x 4-chars at a time, and then * write these out. */ @@ -888,12 +877,10 @@ ofwfb_putm8(video_adapter_t *adp, int x, continue; if (pixel_image[i] & (1 << k)) - ch.c[j] = (ch.c[j] == fg) ? bg : fg; + addr[j] = (addr[j] == fg) ? bg : fg; } - addr[0] = ch.l[0]; - addr[1] = ch.l[1]; - addr += (sc->sc_stride / sizeof(u_int32_t)); + addr += (sc->sc_stride / sizeof(u_int8_t)); } return (0); From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 22:10:13 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 1393E1065677 for ; Tue, 15 Jun 2010 22:10:13 +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 445C914EDAE for ; Tue, 15 Jun 2010 22:10:12 +0000 (UTC) Received: (qmail 30800 invoked from network); 15 Jun 2010 22:10:11 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 15 Jun 2010 22:10:11 -0000 Message-ID: <4C17FA43.4010100@freebsd.org> Date: Tue, 15 Jun 2010 15:10:11 -0700 From: Colin Percival User-Agent: Thunderbird 2.0.0.24 (X11/20100329) MIME-Version: 1.0 To: Jilles Tjoelker References: <201006152158.o5FLwerZ005440@svn.freebsd.org> In-Reply-To: <201006152158.o5FLwerZ005440@svn.freebsd.org> X-Enigmail-Version: 0.96.0 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: r209221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2010 22:10:13 -0000 Jilles Tjoelker wrote: > Unlike NetBSD, there is no 'set +o tabcomplete' option to disable > completion. I do not see any reason for such a special treatment, as > completion is rather useful and it is possible to do > bind ^I ed-insert > to disable completion and insert a tab character instead. For what it's worth, I find that having tab completion disabled is very useful when I paste pieces of shell script into consoles. If other people also do this, it might be an argument in favour of providing a more user-friendly way to disable tab completion. -- 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 Tue Jun 15 22:16: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 CEA1A1065679; Tue, 15 Jun 2010 22:16:02 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE2AA8FC15; Tue, 15 Jun 2010 22:16: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 o5FMG2GG009324; Tue, 15 Jun 2010 22:16:02 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FMG20A009322; Tue, 15 Jun 2010 22:16:02 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201006152216.o5FMG20A009322@svn.freebsd.org> From: Olivier Houchard Date: Tue, 15 Jun 2010 22:16: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: r209223 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2010 22:16:02 -0000 Author: cognet Date: Tue Jun 15 22:16:02 2010 New Revision: 209223 URL: http://svn.freebsd.org/changeset/base/209223 Log: Turn off cache if there's more than one kernel mapping, and one is writable. Submitted by: Mark Tinguely Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Tue Jun 15 22:01:38 2010 (r209222) +++ head/sys/arm/arm/pmap.c Tue Jun 15 22:16:02 2010 (r209223) @@ -1368,7 +1368,7 @@ pmap_fix_cache(struct vm_page *pg, pmap_ * check for kernel uncachable conditions * kernel writable or kernel readable with writable user entry */ - if ((kwritable && entries) || + if ((kwritable && (entries || kentries > 1)) || (kwritable > 1) || ((kwritable != writable) && kentries && (pv->pv_pmap == pmap_kernel() || From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 22:23: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 E715B1065677; Tue, 15 Jun 2010 22:23:21 +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 D63018FC08; Tue, 15 Jun 2010 22:23: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 o5FMNLR1011077; Tue, 15 Jun 2010 22:23:21 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FMNLTf011075; Tue, 15 Jun 2010 22:23:21 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201006152223.o5FMNLTf011075@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 15 Jun 2010 22:23: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: r209224 - head/lib/libedit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 22:23:22 -0000 Author: jilles Date: Tue Jun 15 22:23:21 2010 New Revision: 209224 URL: http://svn.freebsd.org/changeset/base/209224 Log: libedit: Reduce surprising behaviour with filename completion some more: * Quote '*', '?' and '['. While it may be more useful to expand them to matching pathnames, this at least matches with the completion we do. * '@' is a regular character for filenames. Some other shells do @ completion but we do not. * Prefix names starting with '-' and '+' with './' so they are not seen as options. Modified: head/lib/libedit/filecomplete.c Modified: head/lib/libedit/filecomplete.c ============================================================================== --- head/lib/libedit/filecomplete.c Tue Jun 15 22:16:02 2010 (r209223) +++ head/lib/libedit/filecomplete.c Tue Jun 15 22:23:21 2010 (r209224) @@ -50,10 +50,10 @@ __FBSDID("$FreeBSD$"); #include "histedit.h" #include "filecomplete.h" -static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@', - '$', '>', '<', '=', ';', '|', '&', '{', '(', '\0' }; +static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', + '>', '<', '=', ';', '|', '&', '{', '(', '\0' }; /* Tilde is deliberately omitted here, we treat it specially. */ -static char extra_quote_chars[] = { ')', '}', '\0' }; +static char extra_quote_chars[] = { ')', '}', '*', '?', '[', '$', '\0' }; /********************************/ @@ -595,6 +595,8 @@ sh_quote(const char *str) int extra_len = 0; char *quoted_str, *dst; + if (*str == '-' || *str == '+') + extra_len += 2; for (src = str; *src != '\0'; src++) if (strchr(break_chars, *src) || strchr(extra_quote_chars, *src)) @@ -606,6 +608,8 @@ sh_quote(const char *str) return NULL; dst = quoted_str; + if (*str == '-' || *str == '+') + *dst++ = '.', *dst++ = '/'; for (src = str; *src != '\0'; src++) { if (strchr(break_chars, *src) || strchr(extra_quote_chars, *src)) From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 22:28:47 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 600AE106566B; Tue, 15 Jun 2010 22:28:47 +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 24AB18FC1A; Tue, 15 Jun 2010 22:28:47 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 07C5D35A845; Wed, 16 Jun 2010 00:28:45 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id E72E817288; Wed, 16 Jun 2010 00:28:44 +0200 (CEST) Date: Wed, 16 Jun 2010 00:28:44 +0200 From: Jilles Tjoelker To: Colin Percival Message-ID: <20100615222844.GB16518@stack.nl> References: <201006152158.o5FLwerZ005440@svn.freebsd.org> <4C17FA43.4010100@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C17FA43.4010100@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: r209221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2010 22:28:47 -0000 On Tue, Jun 15, 2010 at 03:10:11PM -0700, Colin Percival wrote: > Jilles Tjoelker wrote: > > Unlike NetBSD, there is no 'set +o tabcomplete' option to disable > > completion. I do not see any reason for such a special treatment, as > > completion is rather useful and it is possible to do > > bind ^I ed-insert > > to disable completion and insert a tab character instead. > For what it's worth, I find that having tab completion disabled is very useful > when I paste pieces of shell script into consoles. If other people also do > this, it might be an argument in favour of providing a more user-friendly way > to disable tab completion. Hmm. zsh treats a tab on an empty line as a literal tab character, not completion. That allows most pasting but still allow normal access to completion. (Still a problem if you IFS='' though.) -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Tue Jun 15 23:55: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 8766D106566B; Tue, 15 Jun 2010 23:55:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7679F8FC0C; Tue, 15 Jun 2010 23:55: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 o5FNth6i031330; Tue, 15 Jun 2010 23:55:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5FNtgKo031329; Tue, 15 Jun 2010 23:55:42 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006152355.o5FNtgKo031329@svn.freebsd.org> From: Warner Losh Date: Tue, 15 Jun 2010 23:55: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: r209225 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2010 23:55:43 -0000 Author: imp Date: Tue Jun 15 23:55:42 2010 New Revision: 209225 URL: http://svn.freebsd.org/changeset/base/209225 Log: Allow boot.config to have different values than just -h. Submitted by: bsdrp by way of freenas and olivier cochard-labbe MFC after: 3 days Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Tue Jun 15 22:23:21 2010 (r209224) +++ head/tools/tools/nanobsd/nanobsd.sh Tue Jun 15 23:55:42 2010 (r209225) @@ -124,6 +124,10 @@ NANO_HEADS=16 NANO_BOOT0CFG="-o packet -s 1 -m 3" NANO_BOOTLOADER="boot/boot0sio" +# boot2 flags/options +# default force serial console +NANO_BOOT2CFG="-h" + # Backing type of md(4) device # Can be "file" or "swap" NANO_MD_BACKING="file" @@ -608,7 +612,7 @@ cust_comconsole () ( sed -i "" -e '/^ttyv[0-8]/s/ on/ off/' ${NANO_WORLDDIR}/etc/ttys # Tell loader to use serial console early. - echo " -h" > ${NANO_WORLDDIR}/boot.config + echo "${NANO_BOOT2CFG}" > ${NANO_WORLDDIR}/boot.config ) ####################################################################### From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 00:41: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 ED0CA1065673; Wed, 16 Jun 2010 00:41:21 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC4908FC17; Wed, 16 Jun 2010 00:41: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 o5G0fLce041273; Wed, 16 Jun 2010 00:41:21 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5G0fLvZ041271; Wed, 16 Jun 2010 00:41:21 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006160041.o5G0fLvZ041271@svn.freebsd.org> From: Alan Cox Date: Wed, 16 Jun 2010 00:41: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: r209226 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2010 00:41:22 -0000 Author: alc Date: Wed Jun 16 00:41:21 2010 New Revision: 209226 URL: http://svn.freebsd.org/changeset/base/209226 Log: Eliminate unnecessary page queues locking. Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Jun 15 23:55:42 2010 (r209225) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Jun 16 00:41:21 2010 (r209226) @@ -653,9 +653,7 @@ lookupvpg: goto lookupvpg; } vm_page_busy(vpg); - vm_page_lock_queues(); vm_page_undirty(vpg); - vm_page_unlock_queues(); VM_OBJECT_UNLOCK(vobj); error = uiomove_fromphys(&vpg, offset, tlen, uio); } else { @@ -690,15 +688,13 @@ nocache: out: if (vobj != NULL) VM_OBJECT_LOCK(vobj); - vm_page_lock(tpg); - vm_page_lock_queues(); if (error == 0) { KASSERT(tpg->valid == VM_PAGE_BITS_ALL, ("parts of tpg invalid")); vm_page_dirty(tpg); } + vm_page_lock(tpg); vm_page_unwire(tpg, TRUE); - vm_page_unlock_queues(); vm_page_unlock(tpg); vm_page_wakeup(tpg); if (vpg != NULL) From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 01:32: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 5A8D81065673; Wed, 16 Jun 2010 01:32:57 +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 17E1C8FC17; Wed, 16 Jun 2010 01:32:56 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 241FA1FFC33; Wed, 16 Jun 2010 01:32:56 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id C678D8444A; Wed, 16 Jun 2010 03:30:45 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Jilles Tjoelker References: <201006152158.o5FLwerZ005440@svn.freebsd.org> Date: Wed, 16 Jun 2010 03:30:45 +0200 In-Reply-To: <201006152158.o5FLwerZ005440@svn.freebsd.org> (Jilles Tjoelker's message of "Tue, 15 Jun 2010 21:58:40 +0000 (UTC)") Message-ID: <86ljafwypm.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2010 01:32:57 -0000 Jilles Tjoelker writes: > Log: > sh: Add filename completion. Wonderful! Now I'll never have to use csh again :) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 07:52: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 CC9A2106566C; Wed, 16 Jun 2010 07:52: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 BAF6E8FC08; Wed, 16 Jun 2010 07:52: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 o5G7qjmS035962; Wed, 16 Jun 2010 07:52:45 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5G7qjPB035961; Wed, 16 Jun 2010 07:52:45 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006160752.o5G7qjPB035961@svn.freebsd.org> From: Andriy Gapon Date: Wed, 16 Jun 2010 07:52: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: r209228 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2010 07:52:45 -0000 Author: avg Date: Wed Jun 16 07:52:44 2010 New Revision: 209228 URL: http://svn.freebsd.org/changeset/base/209228 Log: device.hints: do install when WITHOUT_BOOT is set Discussed with: imp MFC after: 2 weeks Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Jun 16 02:50:16 2010 (r209227) +++ head/etc/Makefile Wed Jun 16 07:52:44 2010 (r209228) @@ -253,11 +253,13 @@ distribution: ${DESTDIR}/var/crash cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${FREEBSD} ${DESTDIR}/ +.if ${MK_BOOT} != "no" .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints) ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \ ${DESTDIR}/boot/device.hints .endif +.endif distrib-dirs: mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 08:08: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 DB34F1065672; Wed, 16 Jun 2010 08:08:31 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B33758FC15; Wed, 16 Jun 2010 08:08:30 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA18262; Wed, 16 Jun 2010 11:08:29 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OOnfg-000GAv-TX; Wed, 16 Jun 2010 11:08:28 +0300 Message-ID: <4C18867C.7010700@freebsd.org> Date: Wed, 16 Jun 2010 11:08:28 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: src-committers@freebsd.org References: <201006160752.o5G7qjPB035961@svn.freebsd.org> In-Reply-To: <201006160752.o5G7qjPB035961@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r209228 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2010 08:08:32 -0000 on 16/06/2010 10:52 Andriy Gapon said the following: > Author: avg > Date: Wed Jun 16 07:52:44 2010 > New Revision: 209228 > URL: http://svn.freebsd.org/changeset/base/209228 > > Log: > device.hints: do install when WITHOUT_BOOT is set Oh, this should have been "do NOT install". > Discussed with: imp > MFC after: 2 weeks > > Modified: > head/etc/Makefile > > Modified: head/etc/Makefile > ============================================================================== > --- head/etc/Makefile Wed Jun 16 02:50:16 2010 (r209227) > +++ head/etc/Makefile Wed Jun 16 07:52:44 2010 (r209228) > @@ -253,11 +253,13 @@ distribution: > ${DESTDIR}/var/crash > cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ > ${FREEBSD} ${DESTDIR}/ > +.if ${MK_BOOT} != "no" > .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints) > ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ > ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \ > ${DESTDIR}/boot/device.hints > .endif > +.endif > > distrib-dirs: > mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 08:20: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 546C01065678; Wed, 16 Jun 2010 08:20:02 +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 E1D388FC14; Wed, 16 Jun 2010 08:20: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 o5G8K1hx041934; Wed, 16 Jun 2010 08:20:01 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5G8K1qs041933; Wed, 16 Jun 2010 08:20:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006160820.o5G8K1qs041933@svn.freebsd.org> From: Andriy Gapon Date: Wed, 16 Jun 2010 08:20: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: r209229 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2010 08:20:02 -0000 Author: avg Date: Wed Jun 16 08:20:01 2010 New Revision: 209229 URL: http://svn.freebsd.org/changeset/base/209229 Log: device.hints: do not install when WITHOUT_BOOT is set Forced commit to fix commit message in r209228. Discussed with: imp MFC after: 2 weeks Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 09:03: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 D92771065679; Wed, 16 Jun 2010 09:03:48 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 905D08FC21; Wed, 16 Jun 2010 09:03:48 +0000 (UTC) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 2C091F8759; Wed, 16 Jun 2010 05:03:34 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 16 Jun 2010 05:03:46 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:cc:subject:message-id:in-reply-to:references:mime-version:content-type; s=smtpout; bh=7yATF6i84G104IDbh+C+eYtGiMs=; b=C/kMaewezibrEp1SBOpAdsoWlhQwSOyISSH9obxq9N/Ju446yv57kVPIKrtP/l2+mpNoD0BvcyCrlF0DC8szZQyjasXJ21DRmVMU8/sBUPZ3QZwjG45Xt5w6/3vh7SqhUy+NG4+qYx+MuHLZUfsYJMr2lWaQHChQgiQv1gOie5Y= X-Sasl-enc: bA9nOPugCAMwTvIUfwtorOd9UaQ0uLn5uJQwddURe4en 1276679014 Received: from bender (219.250.69.111.dynamic.snap.net.nz [111.69.250.219]) by mail.messagingengine.com (Postfix) with ESMTPA id 0C6E855261; Wed, 16 Jun 2010 05:03:32 -0400 (EDT) Date: Wed, 16 Jun 2010 21:03:44 +1200 From: Andrew Turner To: Rafal Jaworowski Message-ID: <20100616210344.47209ff2@bender> In-Reply-To: <201006131308.o5DD8NTA033564@svn.freebsd.org> References: <201006131308.o5DD8NTA033564@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.7; i386-portbld-freebsd8.0) X-Pirate: Arrrr Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/C.+KRF8KSl6VNQrOYwcmbnS" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209129 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2010 09:03:49 -0000 --MP_/C.+KRF8KSl6VNQrOYwcmbnS Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sun, 13 Jun 2010 13:08:23 +0000 (UTC) Rafal Jaworowski wrote: > Author: raj > Date: Sun Jun 13 13:08:23 2010 > New Revision: 209129 > URL: http://svn.freebsd.org/changeset/base/209129 > > Log: > Improve style. > > Modified: > head/sys/arm/arm/nexus.c > > Modified: head/sys/arm/arm/nexus.c > ============================================================================== > --- head/sys/arm/arm/nexus.c Sun Jun 13 13:02:43 2010 > (r209128) +++ head/sys/arm/arm/nexus.c Sun Jun 13 13:08:23 > 2010 (r209129) @@ -107,6 +107,7 @@ static devclass_t > nexus_devclass; static int > nexus_probe(device_t dev) > { > + > device_quiet(dev); /* suppress attach message for > neatness */ > mem_rman.rm_start = 0; > @@ -116,7 +117,7 @@ nexus_probe(device_t dev) > if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, > ~0u)) panic("nexus_probe mem_rman"); > > - return (0); > + return (BUS_PROBE_DEFAULT); Changing the return value of nexus_probe from 0 to BUS_PROBE_DEFAULT causes the following panic for me when the s3c24x0 driver calls rman_init. The attached patch fixes it by moving the call to rman_init from nexus_probe to nexus_attach. Andrew KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2010 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 9.0-CURRENT #10 r209128M: Wed Jun 16 20:47:22 NZST 2010 andrew@bender:/usr/obj/arm/home/andrew/freebsd/svn/head/sys/LN2410SBC arm WARNING: WITNESS option enabled, expect reduced performance. CPU: ARM920T rev 0 (ARM9TDMI core) DC enabled IC enabled WB enabled LABT 16KB/32B 64-way Instruction cache 16KB/32B 64-way write-back-locking-A Data cache real memory = 67108864 (64 MB) avail memory = 56320000 (53 MB) s3c24x00 on motherboard s3c24x00: Found S3C2410A CPU (Chip ID: 0x32410002) s3c24x00: fclk 202 MHz hclk 101 MHz pclk 50 MHz panic: Bad tailq NEXT(0xc068eab8->tqh_last) != NULL KDB: enter: panic [ thread pid 0 tid 100000 ] Stopped at kdb_enter+0x44: ldrb r15, [r15, r15, ror r15]! db> reset --MP_/C.+KRF8KSl6VNQrOYwcmbnS Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=rman_panic.diff Index: sys/arm/arm/nexus.c =================================================================== --- sys/arm/arm/nexus.c (revision 209229) +++ sys/arm/arm/nexus.c (working copy) @@ -110,13 +110,6 @@ device_quiet(dev); /* suppress attach message for neatness */ - mem_rman.rm_start = 0; - mem_rman.rm_end = ~0u; - mem_rman.rm_type = RMAN_ARRAY; - mem_rman.rm_descr = "I/O memory addresses"; - if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0u)) - panic("nexus_probe mem_rman"); - return (BUS_PROBE_DEFAULT); } @@ -144,6 +137,13 @@ nexus_attach(device_t dev) { + mem_rman.rm_start = 0; + mem_rman.rm_end = ~0u; + mem_rman.rm_type = RMAN_ARRAY; + mem_rman.rm_descr = "I/O memory addresses"; + if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0u)) + panic("nexus_probe mem_rman"); + /* * First, deal with the children we know about already */ --MP_/C.+KRF8KSl6VNQrOYwcmbnS-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 10:02: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 7014D1065672; Wed, 16 Jun 2010 10:02:41 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2001:4dd0:ff41::b23f:aa]) by mx1.freebsd.org (Postfix) with ESMTP id 2C73A8FC23; Wed, 16 Jun 2010 10:02:41 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 7FCAF2A2921B; Wed, 16 Jun 2010 12:02:39 +0200 (CEST) Date: Wed, 16 Jun 2010 12:02:39 +0200 From: Ed Schouten To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20100616100239.GW1797@hoeg.nl> References: <201006152158.o5FLwerZ005440@svn.freebsd.org> <86ljafwypm.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yZxAaITavNk3ADw/" Content-Disposition: inline In-Reply-To: <86ljafwypm.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Jilles Tjoelker , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2010 10:02:41 -0000 --yZxAaITavNk3ADw/ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Dag-Erling Sm=F8rgrav wrote: > Jilles Tjoelker writes: > > Log: > > sh: Add filename completion. >=20 > Wonderful! Now I'll never have to use csh again :) Exactly. Thanks, Jilles! --=20 Ed Schouten WWW: http://80386.nl/ --yZxAaITavNk3ADw/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwYoT8ACgkQ52SDGA2eCwXMsgCcDgWiuK5Nc99BD8Luu87x6+hN 6ZcAnRJQ3c42Jq5Sbl90X81/mNt9vFBO =74AE -----END PGP SIGNATURE----- --yZxAaITavNk3ADw/-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 12:42: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 5706D106567B; Wed, 16 Jun 2010 12:42:21 +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 464468FC14; Wed, 16 Jun 2010 12:42: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 o5GCgLfd003142; Wed, 16 Jun 2010 12:42:21 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5GCgLKt003140; Wed, 16 Jun 2010 12:42:21 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006161242.o5GCgLKt003140@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 16 Jun 2010 12:42: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: r209230 - 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: Wed, 16 Jun 2010 12:42:21 -0000 Author: pjd Date: Wed Jun 16 12:42:20 2010 New Revision: 209230 URL: http://svn.freebsd.org/changeset/base/209230 Log: Remove redundant assignment. MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jun 16 08:20:01 2010 (r209229) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jun 16 12:42:20 2010 (r209230) @@ -1198,8 +1198,6 @@ zfs_checkexp(vfs_t *vfsp, struct sockadd * which we have to use here, because only this file system * has mnt_export configured. */ - vfsp = zfsvfs->z_parent->z_vfs; - return (vfs_stdcheckexp(zfsvfs->z_parent->z_vfs, nam, extflagsp, credanonp, numsecflavors, secflavors)); } From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 12:42: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 8E49D1065676 for ; Wed, 16 Jun 2010 12:42:41 +0000 (UTC) (envelope-from rbgarga@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1C2118FC17 for ; Wed, 16 Jun 2010 12:42:40 +0000 (UTC) Received: by wyb34 with SMTP id 34so2454643wyb.13 for ; Wed, 16 Jun 2010 05:42:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=dVh+gkWa5QtyNnwB+xmZDAQWxyY7TuQRy1hdJc2EYJU=; b=v1y0zK9NMo+ChZzdRFg1RPif9cvFvUKcD6oMhPlD8O/MDFiJ6g6pJyjYDy7akcU7HS 0+xrFsFqxYyBnNoPQLvzh2+/88kOye9LcHjWQzw0U62/EqX1BD9c5YsAp/60gWcxA205 IeYdPLk1pc9UxIkA6MPDJgtv/BbdR4R+oEgqk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=JCs4m10y6i+E1XkEp0FLd4hYpWBfcc38QCWeFj+SlgoRRThwlpnnMUGBMrMwlvwq3b 5uhhPIsRKzsswUvRPyorxUgkfy4wVEGLnfpxqQUyB6Nlc+3sCmezarfwNT/F/OWhUEoY cH69X20LGO/CaJCOBOQP/24BGACXMRo4fBHus= Received: by 10.216.174.21 with SMTP id w21mr628786wel.14.1276690616257; Wed, 16 Jun 2010 05:16:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.165.207 with HTTP; Wed, 16 Jun 2010 05:16:36 -0700 (PDT) In-Reply-To: <201001050237.o052bxEd061444@svn.freebsd.org> References: <201001050237.o052bxEd061444@svn.freebsd.org> From: Renato Botelho Date: Wed, 16 Jun 2010 09:16:36 -0300 Message-ID: To: David Xu Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201546 - in head: . include lib/libc/gen lib/libc/include lib/libthr lib/libthr/thread sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2010 12:42:41 -0000 On Mon, Jan 4, 2010 at 11:37 PM, David Xu wrote: > Author: davidxu > Date: Tue Jan =A05 02:37:59 2010 > New Revision: 201546 > URL: http://svn.freebsd.org/changeset/base/201546 > > Log: > =A0Use umtx to implement process sharable semaphore, to make this work, > =A0now type sema_t is a structure which can be put in a shared memory are= a, > =A0and multiple processes can operate it concurrently. > =A0User can either use mmap(MAP_SHARED) + sem_init(pshared=3D1) or use se= m_open() > =A0to initialize a shared semaphore. > =A0Named semaphore uses file system and is located in /tmp directory, and= its > =A0file name is prefixed with 'SEMD', so now it is chroot or jail friendl= y. > =A0In simplist cases, both for named and un-named semaphore, userland cod= e > =A0does not have to enter kernel to reduce/increase semaphore's count. > =A0The semaphore is designed to be crash-safe, it means even if an applic= ation > =A0is crashed in the middle of operating semaphore, the semaphore state i= s > =A0still safely recovered by later use, there is no waiter counter mainta= ined > =A0by userland code. > =A0The main semaphore code is in libc and libthr only has some necessary = stubs, > =A0this makes it possible that a non-threaded application can use semapho= re > =A0without linking to thread library. > =A0Old semaphore implementation is kept libc to maintain binary compatibi= lity. > =A0The kernel ksem API is no longer used in the new implemenation. > > =A0Discussed on: threads@ > > Added: > =A0head/include/semaphore.h =A0 (contents, props changed) > =A0head/lib/libc/gen/sem_new.c =A0 (contents, props changed) > =A0head/lib/libthr/thread/thr_sem_new.c =A0 (contents, props changed) > Deleted: > =A0head/sys/sys/semaphore.h > Modified: > =A0head/ObsoleteFiles.inc > =A0head/include/Makefile > =A0head/lib/libc/gen/Makefile.inc > =A0head/lib/libc/gen/Symbol.map > =A0head/lib/libc/gen/_pthread_stubs.c > =A0head/lib/libc/gen/sem.c > =A0head/lib/libc/include/libc_private.h > =A0head/lib/libthr/pthread.map > =A0head/lib/libthr/thread/Makefile.inc > =A0head/lib/libthr/thread/thr_init.c > =A0head/lib/libthr/thread/thr_private.h > =A0head/lib/libthr/thread/thr_sem.c > =A0head/sys/kern/uipc_sem.c > =A0head/sys/sys/_semaphore.h > > Modified: head/ObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/ObsoleteFiles.inc =A0 =A0 =A0Tue Jan =A05 02:06:05 2010 =A0 =A0 = =A0 =A0(r201545) > +++ head/ObsoleteFiles.inc =A0 =A0 =A0Tue Jan =A05 02:37:59 2010 =A0 =A0 = =A0 =A0(r201546) > @@ -14,6 +14,8 @@ > =A0# The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS= last. > =A0# > > +# 20100105: new userland semaphore implementation > +OLD_FILES+=3Dusr/include/sys/semaphore.h Everythime I update my -CURRENT this file is installed again, and is listed when i run make check-old, I think there is something wrong. --=20 Renato Botelho From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 12:44: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 DC1671065678; Wed, 16 Jun 2010 12:44:02 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 24DD08FC14; Wed, 16 Jun 2010 12:44:01 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 36D9745E90; Wed, 16 Jun 2010 14:43:59 +0200 (CEST) Received: from localhost (pdawidek.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 03E5545E87; Wed, 16 Jun 2010 14:43:55 +0200 (CEST) Date: Wed, 16 Jun 2010 14:43:46 +0200 From: Pawel Jakub Dawidek To: Alan Cox Message-ID: <20100616124346.GI1739@garage.freebsd.pl> References: <201006160041.o5G0fLvZ041271@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+ZmrHH5cGjskQnY1" Content-Disposition: inline In-Reply-To: <201006160041.o5G0fLvZ041271@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209226 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2010 12:44:03 -0000 --+ZmrHH5cGjskQnY1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 16, 2010 at 12:41:21AM +0000, Alan Cox wrote: > Author: alc > Date: Wed Jun 16 00:41:21 2010 > New Revision: 209226 > URL: http://svn.freebsd.org/changeset/base/209226 >=20 > Log: > Eliminate unnecessary page queues locking. [...] Could you take a look at this patch: http://people.freebsd.org/~pjd/patches/zfs_vnops.c.4.patch Reviewing entire VM interaction there would be even better:) --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --+ZmrHH5cGjskQnY1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwYxwEACgkQForvXbEpPzQfvgCgzR2Wtcmmr+O1Q62baDi4iP5l SeUAn3t1lV17TXxlSKc1CsLUU/THdOc6 =wB5R -----END PGP SIGNATURE----- --+ZmrHH5cGjskQnY1-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 12:55: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 10E7C1065678; Wed, 16 Jun 2010 12:55:15 +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 F23F98FC15; Wed, 16 Jun 2010 12:55: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 o5GCtEbT006008; Wed, 16 Jun 2010 12:55:14 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5GCtE83005999; Wed, 16 Jun 2010 12:55:14 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201006161255.o5GCtE83005999@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 16 Jun 2010 12:55: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: r209231 - in head/lib/libc/mips: . gen string 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, 16 Jun 2010 12:55:15 -0000 Author: jchandra Date: Wed Jun 16 12:55:14 2010 New Revision: 209231 URL: http://svn.freebsd.org/changeset/base/209231 Log: Merge jmallett@'s n64 work into HEAD - changeset 1. Update libc assembly code to use macros that work on both o32 and n64. Merge string functions from NetBSD. The changes are from http://svn.freebsd.org/base/user/jmallett/octeon Approved by: rrs (mentor), jmallett Modified: head/lib/libc/mips/SYS.h head/lib/libc/mips/gen/_setjmp.S head/lib/libc/mips/gen/setjmp.S head/lib/libc/mips/gen/sigsetjmp.S head/lib/libc/mips/string/bcmp.S head/lib/libc/mips/string/bcopy.S head/lib/libc/mips/string/bzero.S head/lib/libc/mips/string/ffs.S head/lib/libc/mips/string/index.S head/lib/libc/mips/string/rindex.S head/lib/libc/mips/string/strcmp.S head/lib/libc/mips/string/strlen.S head/lib/libc/mips/sys/Ovfork.S head/lib/libc/mips/sys/brk.S head/lib/libc/mips/sys/cerror.S head/lib/libc/mips/sys/exect.S head/lib/libc/mips/sys/fork.S head/lib/libc/mips/sys/pipe.S head/lib/libc/mips/sys/ptrace.S head/lib/libc/mips/sys/sbrk.S Modified: head/lib/libc/mips/SYS.h ============================================================================== --- head/lib/libc/mips/SYS.h Wed Jun 16 12:42:20 2010 (r209230) +++ head/lib/libc/mips/SYS.h Wed Jun 16 12:55:14 2010 (r209231) @@ -1,4 +1,4 @@ -/* $NetBSD: SYS.h,v 1.18 2003/10/29 12:28:33 pooka Exp $ */ +/* $NetBSD: SYS.h,v 1.19 2009/12/14 01:07:41 matt Exp $ */ /* $FreeBSD$ */ /*- @@ -79,14 +79,22 @@ */ #ifdef __ABICALLS__ .abicalls -# define PIC_PROLOGUE(x,sr) .set noreorder; .cpload sr; .set reorder -# define PIC_CALL(l,sr) la sr, _C_LABEL(l); jr sr +# if defined(__mips_o32) || defined(__mips_o64) +# define PIC_PROLOGUE(x) SETUP_GP +# define PIC_TAILCALL(l) PTR_LA t9, _C_LABEL(l); jr t9 +# define PIC_RETURN() j ra +# else +# define PIC_PROLOGUE(x) SETUP_GP64(t3, x) +# define PIC_TAILCALL(l) PTR_LA t9, _C_LABEL(l); RESTORE_GP64; jr t9 +# define PIC_RETURN() RESTORE_GP64; j ra +# endif #else -# define PIC_PROLOGUE(x,sr) -# define PIC_CALL(l,sr) j _C_LABEL(l) -#endif +# define PIC_PROLOGUE(x) +# define PIC_TAILCALL(l) j _C_LABEL(l) +# define PIC_RETURN() +#endif /* __ABICALLS__ */ -# define SYSTRAP(x) li v0, SYS_ ## x; syscall; +# define SYSTRAP(x) li v0,SYS_ ## x; syscall; /* * Do a syscall that cannot fail (sync, get{p,u,g,eu,eg)id) @@ -106,7 +114,7 @@ */ #define PSEUDO_NOERROR(x) \ LEAF(__sys_ ## x); \ - .weak _C_LABEL(x); \ + .weak _C_LABEL(x); \ _C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \ .weak _C_LABEL(__CONCAT(_,x)); \ _C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \ @@ -116,14 +124,14 @@ LEAF(__sys_ ## x); \ #define PSEUDO(x) \ LEAF(__sys_ ## x); \ - .weak _C_LABEL(x); \ + .weak _C_LABEL(x); \ _C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \ .weak _C_LABEL(__CONCAT(_,x)); \ _C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \ - PIC_PROLOGUE(x,t9); \ + PIC_PROLOGUE(__sys_ ## x); \ SYSTRAP(x); \ bne a3,zero,err; \ - j ra; \ + PIC_RETURN(); \ err: \ - PIC_CALL(__cerror,t9); \ - END(__sys_ ## x) + PIC_TAILCALL(__cerror); \ +END(__sys_ ## x) Modified: head/lib/libc/mips/gen/_setjmp.S ============================================================================== --- head/lib/libc/mips/gen/_setjmp.S Wed Jun 16 12:42:20 2010 (r209230) +++ head/lib/libc/mips/gen/_setjmp.S Wed Jun 16 12:55:14 2010 (r209231) @@ -1,4 +1,4 @@ -/* $NetBSD: _setjmp.S,v 1.20 2005/10/07 17:16:40 tsutsui Exp $ */ +/* $NetBSD: _setjmp.S,v 1.20.34.5 2010/02/03 23:46:47 matt Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -36,14 +36,15 @@ __FBSDID("$FreeBSD$"); #include -#if defined(LIBC_SCCS) && !defined(lint) - ASMSTR("from: @(#)_setjmp.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: _setjmp.S,v 1.20 2005/10/07 17:16:40 tsutsui Exp $") -#endif /* LIBC_SCCS and not lint */ +#include "SYS.h" -#ifdef __ABICALLS__ - .abicalls +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 + RCSID("from: @(#)_setjmp.s 8.1 (Berkeley) 6/4/93") +#else + RCSID("$NetBSD: _setjmp.S,v 1.20.34.5 2010/02/03 23:46:47 matt Exp $") #endif +#endif /* LIBC_SCCS and not lint */ /* * C library -- _setjmp, _longjmp @@ -56,62 +57,70 @@ __FBSDID("$FreeBSD$"); * The previous signal state is NOT restored. */ + .set noreorder LEAF(_setjmp) -#ifdef __ABICALLS__ - .set noreorder - .cpload t9 - subu sp, sp, CALLFRAME_SIZ # allocate stack frame - .cprestore 16 + REG_PROLOGUE + REG_LI v0, _JB_MAGIC__SETJMP + REG_S v0, (_JB_MAGIC * SZREG)(a0) + REG_S ra, (_JB_REG_RA * SZREG)(a0) + REG_S s0, (_JB_REG_S0 * SZREG)(a0) + REG_S s1, (_JB_REG_S1 * SZREG)(a0) + REG_S s2, (_JB_REG_S2 * SZREG)(a0) + REG_S s3, (_JB_REG_S3 * SZREG)(a0) + REG_S s4, (_JB_REG_S4 * SZREG)(a0) + REG_S s5, (_JB_REG_S5 * SZREG)(a0) + REG_S s6, (_JB_REG_S6 * SZREG)(a0) + REG_S s7, (_JB_REG_S7 * SZREG)(a0) + REG_S s8, (_JB_REG_S8 * SZREG)(a0) +#if defined(__mips_n32) || defined(__mips_n64) + REG_S gp, (_JB_REG_GP * SZREG)(a0) # newabi gp is callee-saved #endif - li v0, _JB_MAGIC__SETJMP - sw v0, (_JB_MAGIC * SZREG)(a0) - sw ra, (_JB_REG_RA * SZREG)(a0) - sw s0, (_JB_REG_S0 * SZREG)(a0) - sw s1, (_JB_REG_S1 * SZREG)(a0) - sw s2, (_JB_REG_S2 * SZREG)(a0) - sw s3, (_JB_REG_S3 * SZREG)(a0) - sw s4, (_JB_REG_S4 * SZREG)(a0) - sw s5, (_JB_REG_S5 * SZREG)(a0) - sw s6, (_JB_REG_S6 * SZREG)(a0) - sw s7, (_JB_REG_S7 * SZREG)(a0) - sw s8, (_JB_REG_S8 * SZREG)(a0) -#ifdef __ABICALLS__ - addu sp, sp, CALLFRAME_SIZ # un-allocate the stack frame -#endif - sw sp, (_JB_REG_SP * SZREG)(a0) + REG_S sp, (_JB_REG_SP * SZREG)(a0) + REG_EPILOGUE + j ra move v0, zero END(_setjmp) LEAF(_longjmp) -#ifdef __ABICALLS__ - .set noreorder - .cpload t9 - subu sp, sp, CALLFRAME_SIZ # allocate stack frame - .cprestore 16 -#endif - lw v0, (_JB_MAGIC * SZREG)(a0) - lw ra, (_JB_REG_RA * SZREG)(a0) - li t0, _JB_MAGIC__SETJMP - bne v0, t0, botch # jump if error - lw s0, (_JB_REG_S0 * SZREG)(a0) - lw s1, (_JB_REG_S1 * SZREG)(a0) - lw s2, (_JB_REG_S2 * SZREG)(a0) - lw s3, (_JB_REG_S3 * SZREG)(a0) - lw s4, (_JB_REG_S4 * SZREG)(a0) - lw s5, (_JB_REG_S5 * SZREG)(a0) - lw s6, (_JB_REG_S6 * SZREG)(a0) - lw s7, (_JB_REG_S7 * SZREG)(a0) - lw sp, (_JB_REG_SP * SZREG)(a0) - lw s8, (_JB_REG_S8 * SZREG)(a0) + PIC_PROLOGUE(_longjmp) + PTR_SUBU sp, sp, CALLFRAME_SIZ + SAVE_GP(CALLFRAME_GP) + + REG_PROLOGUE + REG_L v0, (_JB_MAGIC * SZREG)(a0) # get magic number + REG_L ra, (_JB_REG_RA * SZREG)(a0) + REG_LI t0, _JB_MAGIC__SETJMP + bne v0, t0, botch # jump if error + PTR_ADDU sp, sp, CALLFRAME_SIZ # does not matter, sanity + REG_L s0, (_JB_REG_S0 * SZREG)(a0) + REG_L s1, (_JB_REG_S1 * SZREG)(a0) + REG_L s2, (_JB_REG_S2 * SZREG)(a0) + REG_L s3, (_JB_REG_S3 * SZREG)(a0) + REG_L s4, (_JB_REG_S4 * SZREG)(a0) + REG_L s5, (_JB_REG_S5 * SZREG)(a0) + REG_L s6, (_JB_REG_S6 * SZREG)(a0) + REG_L s7, (_JB_REG_S7 * SZREG)(a0) +#if defined(__mips_n32) || defined(__mips_n64) + REG_L gp, (_JB_REG_GP * SZREG)(a0) +#endif + REG_L sp, (_JB_REG_SP * SZREG)(a0) + REG_L s8, (_JB_REG_S8 * SZREG)(a0) + REG_EPILOGUE + move v0, a1 # get return value in 1st arg j ra - move v0, a1 + nop botch: - jal _C_LABEL(longjmperror) - nop - jal _C_LABEL(abort) + /* + * We know we aren't returning so we don't care about restoring + * our caller's GP. + */ + PTR_LA t9, _C_LABEL(longjmperror) + jalr t9 nop + + PIC_TAILCALL(abort) END(_longjmp) Modified: head/lib/libc/mips/gen/setjmp.S ============================================================================== --- head/lib/libc/mips/gen/setjmp.S Wed Jun 16 12:42:20 2010 (r209230) +++ head/lib/libc/mips/gen/setjmp.S Wed Jun 16 12:55:14 2010 (r209231) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); ASMSTR("$NetBSD: setjmp.S,v 1.17 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ +#include "SYS.h" + #ifdef __ABICALLS__ .abicalls #endif @@ -61,100 +63,102 @@ __FBSDID("$FreeBSD$"); NESTED(setjmp, SETJMP_FRAME_SIZE, ra) .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) - .set noreorder -#ifdef __ABICALLS__ - .cpload t9 -#endif - subu sp, sp, SETJMP_FRAME_SIZE # allocate stack frame -#ifdef __ABICALLS__ - .cprestore 16 -#endif - sw ra, CALLFRAME_RA(sp) # save RA - sw a0, CALLFRAME_SIZ(sp) # store env + SETUP_GP + PTR_SUBU sp, sp, SETJMP_FRAME_SIZE # allocate stack frame + SAVE_GP(CALLFRAME_GP) + SETUP_GP64(CALLFRAME_GP, setjmp) + + REG_S ra, CALLFRAME_RA(sp) # save RA + REG_S a0, CALLFRAME_SIZ(sp) # store env /* Get the signal mask. */ - addu a2, a0, _JB_SIGMASK * SZREG # &oenv + PTR_ADDU a2, a0, _JB_SIGMASK * SZREG # &oenv li a0, 1 # SIG_SETBLOCK move a1, zero # &env == 0 - la t9, _C_LABEL(sigprocmask) # get current signal mask - jal t9 - nop + PTR_LA t9, _C_LABEL(sigprocmask) # get current signal mask + jalr t9 - lw a0, CALLFRAME_SIZ(sp) # restore env pointer - lw ra, CALLFRAME_RA(sp) # restore RA - addu sp, sp, SETJMP_FRAME_SIZE # pop stack frame - - li v0, _JB_MAGIC_SETJMP - sw v0, (_JB_MAGIC * SZREG)(a0) - sw ra, (_JB_REG_RA * SZREG)(a0) - sw s0, (_JB_REG_S0 * SZREG)(a0) - sw s1, (_JB_REG_S1 * SZREG)(a0) - sw s2, (_JB_REG_S2 * SZREG)(a0) - sw s3, (_JB_REG_S3 * SZREG)(a0) - sw s4, (_JB_REG_S4 * SZREG)(a0) - sw s5, (_JB_REG_S5 * SZREG)(a0) - sw s6, (_JB_REG_S6 * SZREG)(a0) - sw s7, (_JB_REG_S7 * SZREG)(a0) - sw sp, (_JB_REG_SP * SZREG)(a0) - sw s8, (_JB_REG_S8 * SZREG)(a0) + RESTORE_GP64 + REG_L a0, CALLFRAME_SIZ(sp) # restore env pointer + REG_L ra, CALLFRAME_RA(sp) # restore RA + PTR_ADDU sp, sp, SETJMP_FRAME_SIZE # pop stack frame + + REG_LI v0, _JB_MAGIC_SETJMP + REG_S v0, (_JB_MAGIC * SZREG)(a0) + REG_S ra, (_JB_REG_RA * SZREG)(a0) + REG_S s0, (_JB_REG_S0 * SZREG)(a0) + REG_S s1, (_JB_REG_S1 * SZREG)(a0) + REG_S s2, (_JB_REG_S2 * SZREG)(a0) + REG_S s3, (_JB_REG_S3 * SZREG)(a0) + REG_S s4, (_JB_REG_S4 * SZREG)(a0) + REG_S s5, (_JB_REG_S5 * SZREG)(a0) + REG_S s6, (_JB_REG_S6 * SZREG)(a0) + REG_S s7, (_JB_REG_S7 * SZREG)(a0) + REG_S sp, (_JB_REG_SP * SZREG)(a0) + REG_S s8, (_JB_REG_S8 * SZREG)(a0) +#if defined(__mips_n32) || defined(__mips_n64) + REG_S gp, (_JB_REG_GP * SZREG)(a0) +#endif move v0, zero - j ra + jr ra END(setjmp) #define LONGJMP_FRAME_SIZE (CALLFRAME_SIZ + (SZREG * 2)) NESTED(longjmp, LONGJMP_FRAME_SIZE, ra) .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) - .set noreorder -#ifdef __ABICALLS__ - .cpload t9 -#endif - subu sp, sp, LONGJMP_FRAME_SIZE # allocate stack frame -#ifdef __ABICALLS__ - .cprestore 16 -#endif - sw ra, CALLFRAME_RA(sp) # save RA - lw v0, (_JB_MAGIC * SZREG)(a0) - li t0, _JB_MAGIC_SETJMP + PIC_PROLOGUE(longjmp) + PTR_SUBU sp, sp, LONGJMP_FRAME_SIZE # allocate stack frame + SAVE_GP(CALLFRAME_GP) + + REG_S ra, CALLFRAME_RA(sp) # save RA + REG_L v0, (_JB_MAGIC * SZREG)(a0) + REG_LI t0, _JB_MAGIC_SETJMP bne v0, t0, botch # jump if error nop - sw a0, CALLFRAME_SIZ(sp) # save env - sw a1, (CALLFRAME_SIZ + SZREG)(sp) # save return value + REG_S a0, CALLFRAME_SIZ(sp) # save env + REG_S a1, (CALLFRAME_SIZ + SZREG)(sp) # save return value # set sigmask - addu a1, a0, _JB_SIGMASK * SZREG # &set + PTR_ADDU a1, a0, _JB_SIGMASK * SZREG # &set move a2, zero # &oset == NULL li a0, 3 # SIG_SETMASK - la t9,_C_LABEL(sigprocmask) # set current signal mask + PTR_LA t9,_C_LABEL(sigprocmask) # set current signal mask jal t9 nop - lw a0, CALLFRAME_SIZ(sp) # restore env - lw a1, (CALLFRAME_SIZ + SZREG)(sp) # restore return value + REG_L a0, CALLFRAME_SIZ(sp) # restore env + REG_L a1, (CALLFRAME_SIZ + SZREG)(sp) # restore return value + + REG_L ra, (_JB_REG_RA * SZREG)(a0) + REG_L s0, (_JB_REG_S0 * SZREG)(a0) + REG_L s1, (_JB_REG_S1 * SZREG)(a0) + REG_L s2, (_JB_REG_S2 * SZREG)(a0) + REG_L s3, (_JB_REG_S3 * SZREG)(a0) + REG_L s4, (_JB_REG_S4 * SZREG)(a0) + REG_L s5, (_JB_REG_S5 * SZREG)(a0) + REG_L s6, (_JB_REG_S6 * SZREG)(a0) + REG_L s7, (_JB_REG_S7 * SZREG)(a0) + REG_L sp, (_JB_REG_SP * SZREG)(a0) + REG_L s8, (_JB_REG_S8 * SZREG)(a0) +#if defined(__mips_n32) || defined(__mips_n64) + REG_L gp, (_JB_REG_GP * SZREG)(a0) +#endif - lw ra, (_JB_REG_RA * SZREG)(a0) - lw s0, (_JB_REG_S0 * SZREG)(a0) - lw s1, (_JB_REG_S1 * SZREG)(a0) - lw s2, (_JB_REG_S2 * SZREG)(a0) - lw s3, (_JB_REG_S3 * SZREG)(a0) - lw s4, (_JB_REG_S4 * SZREG)(a0) - lw s5, (_JB_REG_S5 * SZREG)(a0) - lw s6, (_JB_REG_S6 * SZREG)(a0) - lw s7, (_JB_REG_S7 * SZREG)(a0) - lw sp, (_JB_REG_SP * SZREG)(a0) - lw s8, (_JB_REG_S8 * SZREG)(a0) move v0, a1 j ra nop botch: - la t9, _C_LABEL(longjmperror) - jal t9 + /* + * We know we aren't returning so we don't care about restoring + * our caller's GP. + */ + PTR_LA t9, _C_LABEL(longjmperror) + jalr t9 nop - la t9, _C_LABEL(abort) - jal t9 - nop + PIC_TAILCALL(abort) END(longjmp) Modified: head/lib/libc/mips/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/mips/gen/sigsetjmp.S Wed Jun 16 12:42:20 2010 (r209230) +++ head/lib/libc/mips/gen/sigsetjmp.S Wed Jun 16 12:55:14 2010 (r209231) @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); ASMSTR("$NetBSD: sigsetjmp.S,v 1.8 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ +#include "SYS.h" + #ifdef __ABICALLS__ .abicalls #endif @@ -57,30 +59,19 @@ __FBSDID("$FreeBSD$"); */ LEAF(sigsetjmp) -#ifdef __ABICALLS__ - .set noreorder - .cpload t9 - .set reorder -#endif + PIC_PROLOGUE(sigsetjmp) + bne a1, 0x0, 1f # do saving of signal mask? - la t9, _setjmp - jr t9 + PIC_TAILCALL(_setjmp) -1: la t9, setjmp - jr t9 +1: PIC_TAILCALL(setjmp) END(sigsetjmp) LEAF(siglongjmp) -#ifdef __ABICALLS__ - .set noreorder - .cpload t9 - .set reorder -#endif - lw t0, (_JB_MAGIC * SZREG)(a0) - li t1, _JB_MAGIC__SETJMP + PIC_PROLOGUE(siglongjmp) + REG_L t0, (_JB_MAGIC * SZREG)(a0) + REG_LI t1, _JB_MAGIC__SETJMP bne t0, t1, 1f # setjmp or _setjmp magic? - la t9, _longjmp - jr t9 -1: la t9, longjmp - jr t9 + PIC_TAILCALL(_longjmp) +1: PIC_TAILCALL(longjmp) END(siglongjmp) Modified: head/lib/libc/mips/string/bcmp.S ============================================================================== --- head/lib/libc/mips/string/bcmp.S Wed Jun 16 12:42:20 2010 (r209230) +++ head/lib/libc/mips/string/bcmp.S Wed Jun 16 12:55:14 2010 (r209231) @@ -1,4 +1,4 @@ -/* $NetBSD: bcmp.S,v 1.8 2003/08/07 16:42:16 agc Exp $ */ +/* $NetBSD: bcmp.S,v 1.9 2009/12/14 01:07:42 matt Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -35,9 +35,15 @@ #include __FBSDID("$FreeBSD$"); +#define _LOCORE /* XXX not really, just assembly-code source */ +#include /* LWLO/LWHI, SWLO/SWHI */ + #if defined(LIBC_SCCS) && !defined(lint) +#if 0 ASMSTR("from: @(#)bcmp.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: bcmp.S,v 1.8 2003/08/07 16:42:16 agc Exp $") +#else + ASMSTR("$NetBSD: bcmp.S,v 1.9 2009/12/14 01:07:42 matt Exp $") +#endif #endif /* LIBC_SCCS and not lint */ #ifdef __ABICALLS__ @@ -49,86 +55,76 @@ __FBSDID("$FreeBSD$"); LEAF(bcmp) .set noreorder - blt a2, 16, small # is it worth any trouble? - xor v0, a0, a1 # compare low two bits of addresses - and v0, v0, 3 - subu a3, zero, a1 # compute # bytes to word align address - bne v0, zero, unaligned # not possible to align addresses - and a3, a3, 3 - - beq a3, zero, 1f - subu a2, a2, a3 # subtract from remaining count - move v0, v1 # init v0,v1 so unmodified bytes match -#ifdef __MIPSEB__ - lwl v0, 0(a0) # read 1, 2, or 3 bytes - lwl v1, 0(a1) -#else - lwr v0, 0(a0) # read 1, 2, or 3 bytes - lwr v1, 0(a1) -#endif - addu a1, a1, a3 - bne v0, v1, nomatch - addu a0, a0, a3 + blt a2, 16, small # is it worth any trouble? + xor v0, a0, a1 # compare low two bits of addresses + and v0, v0, 3 + PTR_SUBU a3, zero, a1 # compute # bytes to word align address + bne v0, zero, unaligned # not possible to align addresses + and a3, a3, 3 + + beq a3, zero, 1f + PTR_SUBU a2, a2, a3 # subtract from remaining count + move v0, v1 # init v0,v1 so unmodified bytes match + LWHI v0, 0(a0) # read 1, 2, or 3 bytes + LWHI v1, 0(a1) + PTR_ADDU a1, a1, a3 + bne v0, v1, nomatch + PTR_ADDU a0, a0, a3 1: - and a3, a2, ~3 # compute number of whole words left - subu a2, a2, a3 # which has to be >= (16-3) & ~3 - addu a3, a3, a0 # compute ending address + and a3, a2, ~3 # compute number of whole words left + PTR_SUBU a2, a2, a3 # which has to be >= (16-3) & ~3 + PTR_ADDU a3, a3, a0 # compute ending address 2: - lw v0, 0(a0) # compare words - lw v1, 0(a1) - addu a0, a0, 4 - bne v0, v1, nomatch - addu a1, a1, 4 - bne a0, a3, 2b + lw v0, 0(a0) # compare words + lw v1, 0(a1) + PTR_ADDU a0, a0, 4 + bne v0, v1, nomatch + PTR_ADDU a1, a1, 4 + bne a0, a3, 2b nop - b small # finish remainder + b small # finish remainder nop unaligned: - beq a3, zero, 2f - subu a2, a2, a3 # subtract from remaining count - addu a3, a3, a0 # compute ending address + beq a3, zero, 2f + PTR_SUBU a2, a2, a3 # subtract from remaining count + PTR_ADDU a3, a3, a0 # compute ending address 1: - lbu v0, 0(a0) # compare bytes until a1 word aligned - lbu v1, 0(a1) - addu a0, a0, 1 - bne v0, v1, nomatch - addu a1, a1, 1 - bne a0, a3, 1b + lbu v0, 0(a0) # compare bytes until a1 word aligned + lbu v1, 0(a1) + PTR_ADDU a0, a0, 1 + bne v0, v1, nomatch + PTR_ADDU a1, a1, 1 + bne a0, a3, 1b nop 2: - and a3, a2, ~3 # compute number of whole words left - subu a2, a2, a3 # which has to be >= (16-3) & ~3 - addu a3, a3, a0 # compute ending address + and a3, a2, ~3 # compute number of whole words left + PTR_SUBU a2, a2, a3 # which has to be >= (16-3) & ~3 + PTR_ADDU a3, a3, a0 # compute ending address 3: -#ifdef __MIPSEB__ - lwl v0, 0(a0) # compare words a0 unaligned, a1 aligned - lwr v0, 3(a0) -#else - lwr v0, 0(a0) # compare words a0 unaligned, a1 aligned - lwl v0, 3(a0) -#endif - lw v1, 0(a1) - addu a0, a0, 4 - bne v0, v1, nomatch - addu a1, a1, 4 - bne a0, a3, 3b + LWHI v0, 0(a0) # compare words a0 unaligned, a1 aligned + LWLO v0, 3(a0) + lw v1, 0(a1) + PTR_ADDU a0, a0, 4 + bne v0, v1, nomatch + PTR_ADDU a1, a1, 4 + bne a0, a3, 3b nop small: - ble a2, zero, match - addu a3, a2, a0 # compute ending address + ble a2, zero, match + PTR_ADDU a3, a2, a0 # compute ending address 1: - lbu v0, 0(a0) - lbu v1, 0(a1) - addu a0, a0, 1 - bne v0, v1, nomatch - addu a1, a1, 1 - bne a0, a3, 1b + lbu v0, 0(a0) + lbu v1, 0(a1) + PTR_ADDU a0, a0, 1 + bne v0, v1, nomatch + PTR_ADDU a1, a1, 1 + bne a0, a3, 1b nop match: - j ra - move v0, zero + j ra + move v0, zero nomatch: - j ra - li v0, 1 + j ra + li v0, 1 .set reorder END(bcmp) Modified: head/lib/libc/mips/string/bcopy.S ============================================================================== --- head/lib/libc/mips/string/bcopy.S Wed Jun 16 12:42:20 2010 (r209230) +++ head/lib/libc/mips/string/bcopy.S Wed Jun 16 12:55:14 2010 (r209231) @@ -1,4 +1,4 @@ -/* $NetBSD: bcopy.S,v 1.2 2005/12/27 11:23:53 tsutsui Exp $ */ +/* $NetBSD: bcopy.S,v 1.3 2009/12/14 00:39:00 matt Exp $ */ /* * Mach Operating System @@ -38,9 +38,15 @@ #include __FBSDID("$FreeBSD$"); +#define _LOCORE /* XXX not really, just assembly-code source */ +#include + #if defined(LIBC_SCCS) && !defined(lint) +#if 0 ASMSTR("from: @(#)mips_bcopy.s 2.2 CMU 18/06/93") - ASMSTR("$NetBSD: bcopy.S,v 1.2 2005/12/27 11:23:53 tsutsui Exp $") +#else + ASMSTR("$NetBSD: bcopy.S,v 1.3 2009/12/14 00:39:00 matt Exp $") +#endif #endif /* LIBC_SCCS and not lint */ #ifdef __ABICALLS__ @@ -99,71 +105,72 @@ LEAF(FUNCTION) * copy is alignable. eg if src and dest are both * on a halfword boundary. */ - andi t1,DSTREG,3 # get last 3 bits of dest - bne t1,zero,3f - andi t0,SRCREG,3 # get last 3 bits of src - bne t0,zero,5f + andi t1,DSTREG,(SZREG-1) # get last bits of dest + bne t1,zero,3f # dest unaligned + andi t0,SRCREG,(SZREG-1) # get last bits of src + bne t0,zero,5f /* - * Forward aligned->aligned copy, 8*4 bytes at a time. + * Forward aligned->aligned copy, 8 words at a time. */ - li AT,-32 - and t0,SIZEREG,AT # count truncated to multiple of 32 */ - addu a3,SRCREG,t0 # run fast loop up to this address - sltu AT,SRCREG,a3 # any work to do? - beq AT,zero,2f - subu SIZEREG,t0 +98: + li AT,-(SZREG*8) + and t0,SIZEREG,AT # count truncated to multiples + PTR_ADDU a3,SRCREG,t0 # run fast loop up to this addr + sltu AT,SRCREG,a3 # any work to do? + beq AT,zero,2f + PTR_SUBU SIZEREG,t0 /* * loop body */ 1: # cp - lw t3,0(SRCREG) - lw v1,4(SRCREG) - lw t0,8(SRCREG) - lw t1,12(SRCREG) - addu SRCREG,32 - sw t3,0(DSTREG) - sw v1,4(DSTREG) - sw t0,8(DSTREG) - sw t1,12(DSTREG) - lw t1,-4(SRCREG) - lw t0,-8(SRCREG) - lw v1,-12(SRCREG) - lw t3,-16(SRCREG) - addu DSTREG,32 - sw t1,-4(DSTREG) - sw t0,-8(DSTREG) - sw v1,-12(DSTREG) - bne SRCREG,a3,1b - sw t3,-16(DSTREG) + REG_L t3,(0*SZREG)(SRCREG) + REG_L v1,(1*SZREG)(SRCREG) + REG_L t0,(2*SZREG)(SRCREG) + REG_L t1,(3*SZREG)(SRCREG) + PTR_ADDU SRCREG,SZREG*8 + REG_S t3,(0*SZREG)(DSTREG) + REG_S v1,(1*SZREG)(DSTREG) + REG_S t0,(2*SZREG)(DSTREG) + REG_S t1,(3*SZREG)(DSTREG) + REG_L t1,(-1*SZREG)(SRCREG) + REG_L t0,(-2*SZREG)(SRCREG) + REG_L v1,(-3*SZREG)(SRCREG) + REG_L t3,(-4*SZREG)(SRCREG) + PTR_ADDU DSTREG,SZREG*8 + REG_S t1,(-1*SZREG)(DSTREG) + REG_S t0,(-2*SZREG)(DSTREG) + REG_S v1,(-3*SZREG)(DSTREG) + bne SRCREG,a3,1b + REG_S t3,(-4*SZREG)(DSTREG) /* * Copy a word at a time, no loop unrolling. */ 2: # wordcopy - andi t2,SIZEREG,3 # get byte count / 4 - subu t2,SIZEREG,t2 # t2 = number of words to copy * 4 - beq t2,zero,3f - addu t0,SRCREG,t2 # stop at t0 - subu SIZEREG,SIZEREG,t2 + andi t2,SIZEREG,(SZREG-1) # get byte count / SZREG + PTR_SUBU t2,SIZEREG,t2 # t2 = words to copy * SZREG + beq t2,zero,3f + PTR_ADDU t0,SRCREG,t2 # stop at t0 + PTR_SUBU SIZEREG,SIZEREG,t2 1: - lw t3,0(SRCREG) - addu SRCREG,4 - sw t3,0(DSTREG) - bne SRCREG,t0,1b - addu DSTREG,4 + REG_L t3,0(SRCREG) + PTR_ADDU SRCREG,SZREG + REG_S t3,0(DSTREG) + bne SRCREG,t0,1b + PTR_ADDU DSTREG,SZREG 3: # bytecopy - beq SIZEREG,zero,4f # nothing left to do? + beq SIZEREG,zero,4f # nothing left to do? nop 1: - lb t3,0(SRCREG) - addu SRCREG,1 - sb t3,0(DSTREG) - subu SIZEREG,1 - bgtz SIZEREG,1b - addu DSTREG,1 + lb t3,0(SRCREG) + PTR_ADDU SRCREG,1 + sb t3,0(DSTREG) + PTR_SUBU SIZEREG,1 + bgtz SIZEREG,1b + PTR_ADDU DSTREG,1 4: # copydone j ra @@ -173,96 +180,91 @@ LEAF(FUNCTION) * Copy from unaligned source to aligned dest. */ 5: # destaligned - andi t0,SIZEREG,3 # t0 = bytecount mod 4 - subu a3,SIZEREG,t0 # number of words to transfer - beq a3,zero,3b + andi t0,SIZEREG,(SZREG-1) # t0 = bytecount mod SZREG + PTR_SUBU a3,SIZEREG,t0 # number of words to transfer + beq a3,zero,3b nop - move SIZEREG,t0 # this many to do after we are done - addu a3,SRCREG,a3 # stop point + move SIZEREG,t0 # this many to do after we are done + PTR_ADDU a3,SRCREG,a3 # stop point 1: -#ifdef __MIPSEB__ - lwl t3,0(SRCREG) - lwr t3,3(SRCREG) -#else - lwr t3,0(SRCREG) - lwl t3,3(SRCREG) -#endif - addi SRCREG,4 - sw t3,0(DSTREG) - bne SRCREG,a3,1b - addi DSTREG,4 + REG_LHI t3,0(SRCREG) + REG_LLO t3,SZREG-1(SRCREG) + PTR_ADDI SRCREG,SZREG + REG_S t3,0(DSTREG) + bne SRCREG,a3,1b + PTR_ADDI DSTREG,SZREG - j 3b + b 3b nop 6: # backcopy -- based on above - addu SRCREG,SIZEREG - addu DSTREG,SIZEREG - andi t1,DSTREG,3 # get last 3 bits of dest - bne t1,zero,3f - andi t0,SRCREG,3 # get last 3 bits of src - bne t0,zero,5f + PTR_ADDU SRCREG,SIZEREG + PTR_ADDU DSTREG,SIZEREG + andi t1,DSTREG,SZREG-1 # get last 3 bits of dest + bne t1,zero,3f + andi t0,SRCREG,SZREG-1 # get last 3 bits of src + bne t0,zero,5f /* * Forward aligned->aligned copy, 8*4 bytes at a time. */ - li AT,-32 - and t0,SIZEREG,AT # count truncated to multiple of 32 - beq t0,zero,2f # any work to do? - subu SIZEREG,t0 - subu a3,SRCREG,t0 + li AT,(-8*SZREG) + and t0,SIZEREG,AT # count truncated to multiple of 32 + beq t0,zero,2f # any work to do? + PTR_SUBU SIZEREG,t0 + PTR_SUBU a3,SRCREG,t0 /* * loop body */ 1: # cp - lw t3,-16(SRCREG) - lw v1,-12(SRCREG) - lw t0,-8(SRCREG) - lw t1,-4(SRCREG) - subu SRCREG,32 - sw t3,-16(DSTREG) - sw v1,-12(DSTREG) - sw t0,-8(DSTREG) - sw t1,-4(DSTREG) - lw t1,12(SRCREG) - lw t0,8(SRCREG) - lw v1,4(SRCREG) - lw t3,0(SRCREG) - subu DSTREG,32 - sw t1,12(DSTREG) - sw t0,8(DSTREG) - sw v1,4(DSTREG) - bne SRCREG,a3,1b - sw t3,0(DSTREG) + REG_L t3,(-4*SZREG)(SRCREG) + REG_L v1,(-3*SZREG)(SRCREG) + REG_L t0,(-2*SZREG)(SRCREG) + REG_L t1,(-1*SZREG)(SRCREG) + PTR_SUBU SRCREG,8*SZREG + REG_S t3,(-4*SZREG)(DSTREG) + REG_S v1,(-3*SZREG)(DSTREG) + REG_S t0,(-2*SZREG)(DSTREG) + REG_S t1,(-1*SZREG)(DSTREG) + REG_L t1,(3*SZREG)(SRCREG) + REG_L t0,(2*SZREG)(SRCREG) + REG_L v1,(1*SZREG)(SRCREG) + REG_L t3,(0*SZREG)(SRCREG) + PTR_SUBU DSTREG,8*SZREG + REG_S t1,(3*SZREG)(DSTREG) + REG_S t0,(2*SZREG)(DSTREG) + REG_S v1,(1*SZREG)(DSTREG) + bne SRCREG,a3,1b + REG_S t3,(0*SZREG)(DSTREG) /* * Copy a word at a time, no loop unrolling. */ 2: # wordcopy - andi t2,SIZEREG,3 # get byte count / 4 - subu t2,SIZEREG,t2 # t2 = number of words to copy * 4 - beq t2,zero,3f - subu t0,SRCREG,t2 # stop at t0 - subu SIZEREG,SIZEREG,t2 + andi t2,SIZEREG,SZREG-1 # get byte count / 4 + PTR_SUBU t2,SIZEREG,t2 # t2 = number of words to copy + beq t2,zero,3f + PTR_SUBU t0,SRCREG,t2 # stop at t0 + PTR_SUBU SIZEREG,SIZEREG,t2 1: - lw t3,-4(SRCREG) - subu SRCREG,4 - sw t3,-4(DSTREG) - bne SRCREG,t0,1b - subu DSTREG,4 + REG_L t3,-SZREG(SRCREG) + PTR_SUBU SRCREG,SZREG + REG_S t3,-SZREG(DSTREG) + bne SRCREG,t0,1b + PTR_SUBU DSTREG,SZREG 3: # bytecopy - beq SIZEREG,zero,4f # nothing left to do? + beq SIZEREG,zero,4f # nothing left to do? nop 1: - lb t3,-1(SRCREG) - subu SRCREG,1 - sb t3,-1(DSTREG) - subu SIZEREG,1 - bgtz SIZEREG,1b - subu DSTREG,1 + lb t3,-1(SRCREG) + PTR_SUBU SRCREG,1 + sb t3,-1(DSTREG) + PTR_SUBU SIZEREG,1 + bgtz SIZEREG,1b + PTR_SUBU DSTREG,1 4: # copydone j ra @@ -272,27 +274,22 @@ LEAF(FUNCTION) * Copy from unaligned source to aligned dest. */ 5: # destaligned - andi t0,SIZEREG,3 # t0 = bytecount mod 4 - subu a3,SIZEREG,t0 # number of words to transfer - beq a3,zero,3b + andi t0,SIZEREG,SZREG-1 # t0 = bytecount mod 4 + PTR_SUBU a3,SIZEREG,t0 # number of words to transfer + beq a3,zero,3b nop - move SIZEREG,t0 # this many to do after we are done - subu a3,SRCREG,a3 # stop point + move SIZEREG,t0 # this many to do after we are done + PTR_SUBU a3,SRCREG,a3 # stop point 1: -#ifdef __MIPSEB__ - lwl t3,-4(SRCREG) - lwr t3,-1(SRCREG) -#else - lwr t3,-4(SRCREG) - lwl t3,-1(SRCREG) -#endif - subu SRCREG,4 - sw t3,-4(DSTREG) - bne SRCREG,a3,1b - subu DSTREG,4 + REG_LHI t3,-SZREG(SRCREG) + REG_LLO t3,-1(SRCREG) + PTR_SUBU SRCREG,SZREG + REG_S t3,-SZREG(DSTREG) + bne SRCREG,a3,1b + PTR_SUBU DSTREG,SZREG - j 3b + b 3b nop .set reorder Modified: head/lib/libc/mips/string/bzero.S ============================================================================== --- head/lib/libc/mips/string/bzero.S Wed Jun 16 12:42:20 2010 (r209230) +++ head/lib/libc/mips/string/bzero.S Wed Jun 16 12:55:14 2010 (r209231) @@ -1,4 +1,4 @@ -/* $NetBSD: bzero.S,v 1.8 2003/08/07 16:42:16 agc Exp $ */ +/* $NetBSD: bzero.S,v 1.10 2009/12/14 02:53:52 matt Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -36,10 +36,15 @@ __FBSDID("$FreeBSD$"); #if defined(LIBC_SCCS) && !defined(lint) +#if 0 ASMSTR("from: @(#)bzero.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: bzero.S,v 1.8 2003/08/07 16:42:16 agc Exp $") +#else + ASMSTR("$NetBSD: bzero.S,v 1.10 2009/12/14 02:53:52 matt Exp $") +#endif #endif /* LIBC_SCCS and not lint */ +#define _LOCORE /* XXX not really, just assembly-code source */ +#include #ifdef __ABICALLS__ .abicalls @@ -49,34 +54,48 @@ __FBSDID("$FreeBSD$"); LEAF(bzero) .set noreorder - blt a1, 12, smallclr # small amount to clear? - subu a3, zero, a0 # compute # bytes to word align address - and a3, a3, 3 - beq a3, zero, 1f # skip if word aligned - subu a1, a1, a3 # subtract from remaining count -#ifdef __MIPSEB__ - swl zero, 0(a0) # clear 1, 2, or 3 bytes to align -#else - swr zero, 0(a0) # clear 1, 2, or 3 bytes to align + blt a1, 3*SZREG, smallclr # small amount to clear? + PTR_SUBU a3, zero, a0 # compute # bytes to word align address + and a3, a3, SZREG-1 + beq a3, zero, 1f # skip if word aligned +#if SZREG == 4 + PTR_SUBU a1, a1, a3 # subtract from remaining count + SWHI zero, 0(a0) # clear 1, 2, or 3 bytes to align + PTR_ADDU a0, a0, a3 +#endif +#if SZREG == 8 + PTR_SUBU a1, a1, a3 # subtract from remaining count *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 14:10: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 2A22F106564A; Wed, 16 Jun 2010 14:10:40 +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 19F068FC0C; Wed, 16 Jun 2010 14:10: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 o5GEAdMw022617; Wed, 16 Jun 2010 14:10:39 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5GEAdbI022616; Wed, 16 Jun 2010 14:10:39 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201006161410.o5GEAdbI022616@svn.freebsd.org> From: Rafal Jaworowski Date: Wed, 16 Jun 2010 14:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209232 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2010 14:10:40 -0000 Author: raj Date: Wed Jun 16 14:10:39 2010 New Revision: 209232 URL: http://svn.freebsd.org/changeset/base/209232 Log: Move ARM nexus rman initialization to attach routine. This fixes a panic, which started to trigger after r209129 cleanup. Submitted by: Andrew Turner Modified: head/sys/arm/arm/nexus.c Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Wed Jun 16 12:55:14 2010 (r209231) +++ head/sys/arm/arm/nexus.c Wed Jun 16 14:10:39 2010 (r209232) @@ -110,13 +110,6 @@ nexus_probe(device_t dev) device_quiet(dev); /* suppress attach message for neatness */ - mem_rman.rm_start = 0; - mem_rman.rm_end = ~0u; - mem_rman.rm_type = RMAN_ARRAY; - mem_rman.rm_descr = "I/O memory addresses"; - if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0u)) - panic("nexus_probe mem_rman"); - return (BUS_PROBE_DEFAULT); } @@ -144,6 +137,13 @@ static int nexus_attach(device_t dev) { + mem_rman.rm_start = 0; + mem_rman.rm_end = ~0u; + mem_rman.rm_type = RMAN_ARRAY; + mem_rman.rm_descr = "I/O memory addresses"; + if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0u)) + panic("nexus_probe mem_rman"); + /* * First, deal with the children we know about already */ From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 14:13: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 38FE81065670; Wed, 16 Jun 2010 14:13:37 +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 274638FC0C; Wed, 16 Jun 2010 14:13:37 +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 o5GEDa7e023294; Wed, 16 Jun 2010 14:13:36 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5GEDapZ023286; Wed, 16 Jun 2010 14:13:36 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201006161413.o5GEDapZ023286@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 16 Jun 2010 14: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: r209233 - in head/lib/libc: . mips mips/gen mips/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, 16 Jun 2010 14:13:37 -0000 Author: jchandra Date: Wed Jun 16 14:13:36 2010 New Revision: 209233 URL: http://svn.freebsd.org/changeset/base/209233 Log: Merge jmallett@'s n64 work into HEAD - changeset 2 Update libc Makefiles. Add makecontext implementation. Changes from http://svn.freebsd.org/base/user/jmallett/octeon Approved by: rrs(mentor), jmallett Added: head/lib/libc/mips/gen/_ctx_start.S (contents, props changed) Modified: head/lib/libc/Makefile head/lib/libc/mips/Makefile.inc head/lib/libc/mips/Symbol.map head/lib/libc/mips/gen/Makefile.inc head/lib/libc/mips/gen/makecontext.c head/lib/libc/mips/sys/Makefile.inc Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Wed Jun 16 14:10:39 2010 (r209232) +++ head/lib/libc/Makefile Wed Jun 16 14:13:36 2010 (r209233) @@ -51,7 +51,12 @@ NOASM= .include "${.CURDIR}/posix1e/Makefile.inc" .if ${MACHINE_ARCH} != "amd64" && \ ${MACHINE_ARCH} != "ia64" && \ - ${MACHINE_ARCH} != "sparc64" + ${MACHINE_ARCH} != "sparc64" && \ + ${MACHINE_ARCH} != "mips" +.include "${.CURDIR}/quad/Makefile.inc" +.endif +.if ${MACHINE_ARCH} == "mips" && \ + (!defined(TARGET_ABI) || ${TARGET_ABI} == "o32") .include "${.CURDIR}/quad/Makefile.inc" .endif .include "${.CURDIR}/regex/Makefile.inc" Modified: head/lib/libc/mips/Makefile.inc ============================================================================== --- head/lib/libc/mips/Makefile.inc Wed Jun 16 14:10:39 2010 (r209232) +++ head/lib/libc/mips/Makefile.inc Wed Jun 16 14:13:36 2010 (r209233) @@ -1,8 +1,6 @@ # $NetBSD: Makefile.inc,v 1.7 2005/09/17 11:49:39 tsutsui Exp $ # $FreeBSD$ -SOFTFLOAT_BITS=32 - CFLAGS+=-DSOFTFLOAT MDSRCS+= machdep_ldisd.c Modified: head/lib/libc/mips/Symbol.map ============================================================================== --- head/lib/libc/mips/Symbol.map Wed Jun 16 14:10:39 2010 (r209232) +++ head/lib/libc/mips/Symbol.map Wed Jun 16 14:13:36 2010 (r209233) @@ -24,13 +24,9 @@ FBSD_1.0 { sigsetjmp; siglongjmp; htonl; - __htonl; htons; - __htons; ntohl; - __ntohl; ntohs; - __ntohs; vfork; brk; cerror; /* XXX - Should this be .cerror (see sys/cerror.S)? */ Modified: head/lib/libc/mips/gen/Makefile.inc ============================================================================== --- head/lib/libc/mips/gen/Makefile.inc Wed Jun 16 14:10:39 2010 (r209232) +++ head/lib/libc/mips/gen/Makefile.inc Wed Jun 16 14:13:36 2010 (r209233) @@ -6,4 +6,4 @@ SRCS+= infinity.c fabs.c ldexp.c modf.c # SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ # fpsetround.c fpsetsticky.c -SRCS+= _set_tp.c _setjmp.S makecontext.c setjmp.S signalcontext.c sigsetjmp.S +SRCS+= _ctx_start.S _set_tp.c _setjmp.S makecontext.c setjmp.S signalcontext.c sigsetjmp.S Added: head/lib/libc/mips/gen/_ctx_start.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/mips/gen/_ctx_start.S Wed Jun 16 14:13:36 2010 (r209233) @@ -0,0 +1,41 @@ +/*- + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * XXX gp? + */ +ENTRY(_ctx_start) + jalr t9 + + move a0, s0 + PTR_LA t9, _ctx_done + jalr t9 + + break 0 +END(_ctx_start) Modified: head/lib/libc/mips/gen/makecontext.c ============================================================================== --- head/lib/libc/mips/gen/makecontext.c Wed Jun 16 14:10:39 2010 (r209232) +++ head/lib/libc/mips/gen/makecontext.c Wed Jun 16 14:13:36 2010 (r209233) @@ -1,4 +1,4 @@ -/* $NetBSD: makecontext.c,v 1.3 2003/01/19 08:53:36 matt Exp $ */ +/* $NetBSD: makecontext.c,v 1.5 2009/12/14 01:07:42 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -15,13 +15,6 @@ * 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 the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -39,48 +32,92 @@ #include __FBSDID("$FreeBSD$"); #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: makecontext.c,v 1.3 2003/01/19 08:53:36 matt Exp $"); +__RCSID("$NetBSD: makecontext.c,v 1.5 2009/12/14 01:07:42 matt Exp $"); #endif -#include -#include +#include +#include + #include +#include +#include +#include +#include + +__weak_reference(__makecontext, makecontext); + +void _ctx_done(ucontext_t *); +void _ctx_start(void); void -makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) +__makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) { - /* XXXMIPS: Implement me */ -#if 0 - __greg_t *gr = ucp->uc_mcontext.__gregs; - uintptr_t *sp; + mcontext_t *mc; + register_t *sp; int i; va_list ap; - void __resumecontext(void); + /* + * XXX/juli + * We need an mc_len or mc_flags like other architectures + * so that we can mark a context as invalid. Store it in + * mc->mc_regs[ZERO] perhaps? + */ + if (argc < 0 || argc > 6 || ucp == NULL || + ucp->uc_stack.ss_sp == NULL || + ucp->uc_stack.ss_size < MINSIGSTKSZ) + return; + mc = &ucp->uc_mcontext; - /* LINTED uintptr_t is safe */ - sp = (uintptr_t *) + sp = (register_t *) ((uintptr_t)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size); - /* LINTED uintptr_t is safe */ +#if defined(__mips_o32) || defined(__mips_o64) sp -= (argc >= 4 ? argc : 4); /* Make room for >=4 arguments. */ - sp = (uintptr_t *) - ((uintptr_t)sp & ~0x7); /* Align on double-word boundary. */ + sp = (register_t *) + ((uintptr_t)sp & ~0x7); /* Align on double-word boundary. */ +#elif defined(__mips_n32) || defined(__mips_n64) + sp -= (argc > 8 ? argc - 8 : 0); /* Make room for > 8 arguments. */ + sp = (register_t *) + ((uintptr_t)sp & ~0xf); /* Align on quad-word boundary. */ +#endif - gr[_REG_SP] = (__greg_t)sp; - gr[_REG_RA] = (__greg_t)__resumecontext; - gr[_REG_T9] = (__greg_t)func; /* required for .abicalls */ - gr[_REG_EPC] = (__greg_t)func; + mc->mc_regs[SP] = (intptr_t)sp; + mc->mc_regs[S0] = (intptr_t)ucp; + mc->mc_regs[T9] = (intptr_t)func; + mc->mc_pc = (intptr_t)_ctx_start; /* Construct argument list. */ va_start(ap, argc); +#if defined(__mips_o32) || defined(__mips_o64) /* Up to the first four arguments are passed in $a0-3. */ for (i = 0; i < argc && i < 4; i++) - /* LINTED uintptr_t is safe */ - gr[_REG_A0 + i] = va_arg(ap, uintptr_t); + /* LINTED register_t is safe */ + mc->mc_regs[A0 + i] = va_arg(ap, register_t); + /* Pass remaining arguments on the stack above the $a0-3 gap. */ + sp += i; +#endif +#if defined(__mips_n32) || defined(__mips_n64) + /* Up to the first 8 arguments are passed in $a0-7. */ + for (i = 0; i < argc && i < 8; i++) + /* LINTED register_t is safe */ + mc->mc_regs[A0 + i] = va_arg(ap, register_t); /* Pass remaining arguments on the stack above the $a0-3 gap. */ - for (sp += 4; i < argc; i++) +#endif + /* Pass remaining arguments on the stack above the $a0-3 gap. */ + for (; i < argc; i++) /* LINTED uintptr_t is safe */ - *sp++ = va_arg(ap, uintptr_t); + *sp++ = va_arg(ap, register_t); va_end(ap); -#endif +} + +void +_ctx_done(ucontext_t *ucp) +{ + + if (ucp->uc_link == NULL) + exit(0); + else { + setcontext((const ucontext_t *)ucp->uc_link); + abort(); + } } Modified: head/lib/libc/mips/sys/Makefile.inc ============================================================================== --- head/lib/libc/mips/sys/Makefile.inc Wed Jun 16 14:10:39 2010 (r209232) +++ head/lib/libc/mips/sys/Makefile.inc Wed Jun 16 14:13:36 2010 (r209233) @@ -1,7 +1,7 @@ # $FreeBSD$ MDASM= Ovfork.S brk.S cerror.S exect.S \ - fork.S pipe.S ptrace.S sbrk.S shmat.S syscall.S + fork.S pipe.S ptrace.S sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM= break.o exit.o ftruncate.o getlogin.o lseek.o mmap.o \ From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 14:13: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 E28D1106567C; Wed, 16 Jun 2010 14:13:57 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 8B2418FC1F; Wed, 16 Jun 2010 14:13:57 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id D98E8C42DB; Wed, 16 Jun 2010 16:19:17 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id 6FUq8JWVi5ae; Wed, 16 Jun 2010 16:19:17 +0200 (CEST) Received: from [10.0.0.79] (cardhu.semihalf.com [213.17.239.108]) by smtp.semihalf.com (Postfix) with ESMTPSA id 4DF7FC42E1; Wed, 16 Jun 2010 16:19:17 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <20100616210344.47209ff2@bender> Date: Wed, 16 Jun 2010 16:13:55 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201006131308.o5DD8NTA033564@svn.freebsd.org> <20100616210344.47209ff2@bender> To: Andrew Turner X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209129 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2010 14:13:58 -0000 On 2010-06-16, at 11:03, Andrew Turner wrote: > On Sun, 13 Jun 2010 13:08:23 +0000 (UTC) > Rafal Jaworowski wrote: >=20 >> Author: raj >> Date: Sun Jun 13 13:08:23 2010 >> New Revision: 209129 >> URL: http://svn.freebsd.org/changeset/base/209129 >>=20 >> Log: >> Improve style. >>=20 >> Modified: >> head/sys/arm/arm/nexus.c >>=20 >> Modified: head/sys/arm/arm/nexus.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/arm/arm/nexus.c Sun Jun 13 13:02:43 2010 >> (r209128) +++ head/sys/arm/arm/nexus.c Sun Jun 13 13:08:23 >> 2010 (r209129) @@ -107,6 +107,7 @@ static devclass_t >> nexus_devclass; static int >> nexus_probe(device_t dev) >> { >> + >> device_quiet(dev); /* suppress attach message for >> neatness */=20 >> mem_rman.rm_start =3D 0; >> @@ -116,7 +117,7 @@ nexus_probe(device_t dev) >> if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, >> ~0u)) panic("nexus_probe mem_rman"); >>=20 >> - return (0); >> + return (BUS_PROBE_DEFAULT); > Changing the return value of nexus_probe from 0 to BUS_PROBE_DEFAULT > causes the following panic for me when the s3c24x0 driver calls > rman_init. The attached patch fixes it by moving the call to rman_init > from nexus_probe to nexus_attach. Thanks (and sorry for the breakage -- it wasn't seen on FDT-enabled = platforms as they use their own rman(s)..), should be fixed in r209232. Rafal From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 15:09: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 3F06B1065673; Wed, 16 Jun 2010 15:09:46 +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 167178FC13; Wed, 16 Jun 2010 15:09: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 o5GF9jXB035699; Wed, 16 Jun 2010 15:09:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5GF9jpY035697; Wed, 16 Jun 2010 15:09:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006161509.o5GF9jpY035697@svn.freebsd.org> From: Alexander Motin Date: Wed, 16 Jun 2010 15:09: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: r209234 - head/usr.sbin/powerd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2010 15:09:46 -0000 Author: mav Date: Wed Jun 16 15:09:45 2010 New Revision: 209234 URL: http://svn.freebsd.org/changeset/base/209234 Log: Freq sysctls are quite heavy due to set of malloc()/free() calls. Avoid reading current frequency on every period. Instead do it only after changing and periodically from time to time if somebody else change it. Also dynamically decrease sampling frequency up to 4 times on inactivity, Modified: head/usr.sbin/powerd/powerd.c Modified: head/usr.sbin/powerd/powerd.c ============================================================================== --- head/usr.sbin/powerd/powerd.c Wed Jun 16 14:13:36 2010 (r209233) +++ head/usr.sbin/powerd/powerd.c Wed Jun 16 15:09:45 2010 (r209234) @@ -435,7 +435,7 @@ main(int argc, char * argv[]) struct pidfh *pfh = NULL; const char *pidfile = NULL; int freq, curfreq, initfreq, *freqs, i, j, *mwatts, numfreqs, load; - int ch, mode, mode_ac, mode_battery, mode_none; + int ch, mode, mode_ac, mode_battery, mode_none, idle, to; uint64_t mjoules_used; size_t len; @@ -548,9 +548,11 @@ main(int argc, char * argv[]) signal(SIGINT, handle_sigs); signal(SIGTERM, handle_sigs); - freq = initfreq = get_freq(); + freq = initfreq = curfreq = get_freq(); + i = get_freq_id(curfreq, freqs, numfreqs); if (freq < 1) freq = 1; + idle = 0; /* Main loop. */ for (;;) { FD_ZERO(&fdset); @@ -560,8 +562,14 @@ main(int argc, char * argv[]) } else { nfds = 0; } - timeout.tv_sec = poll_ival / 1000000; - timeout.tv_usec = poll_ival % 1000000; + if (mode == MODE_HIADAPTIVE || idle < 120) + to = poll_ival; + else if (idle < 360) + to = poll_ival * 2; + else + to = poll_ival * 4; + timeout.tv_sec = to / 1000000; + timeout.tv_usec = to % 1000000; select(nfds, &fdset, NULL, &fdset, &timeout); /* If the user requested we quit, print some statistics. */ @@ -590,11 +598,12 @@ main(int argc, char * argv[]) } /* Read the current frequency. */ - if ((curfreq = get_freq()) == 0) - continue; - - i = get_freq_id(curfreq, freqs, numfreqs); - + if (idle % 32 == 0) { + if ((curfreq = get_freq()) == 0) + continue; + i = get_freq_id(curfreq, freqs, numfreqs); + } + idle++; if (vflag) { /* Keep a sum of all power actually used. */ if (mwatts[i] != -1) @@ -611,6 +620,7 @@ main(int argc, char * argv[]) "changing frequency to %d MHz\n", modes[acline_status], freq); } + idle = 0; if (set_freq(freq) != 0) { warn("error setting CPU freq %d", freq); @@ -629,6 +639,7 @@ main(int argc, char * argv[]) "changing frequency to %d MHz\n", modes[acline_status], freq); } + idle = 0; if (set_freq(freq) != 0) { warn("error setting CPU freq %d", freq); @@ -689,6 +700,7 @@ main(int argc, char * argv[]) " speed from %d MHz to %d MHz\n", freqs[i], freqs[j]); } + idle = 0; if (set_freq(freqs[j])) warn("error setting CPU frequency %d", freqs[j]); From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 15:40: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 55F0B106566B; Wed, 16 Jun 2010 15:40:14 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 459BB8FC0A; Wed, 16 Jun 2010 15:40: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 o5GFeEHF042397; Wed, 16 Jun 2010 15:40:14 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5GFeEOO042393; Wed, 16 Jun 2010 15:40:14 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201006161540.o5GFeEOO042393@svn.freebsd.org> From: Bruce Cran Date: Wed, 16 Jun 2010 15:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209235 - 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: Wed, 16 Jun 2010 15:40:14 -0000 Author: brucec Date: Wed Jun 16 15:40:13 2010 New Revision: 209235 URL: http://svn.freebsd.org/changeset/base/209235 Log: * Allow partial MB/GB values to be entered in the slice and label editors. * Don't strdup the name when calling deviceRegister because the string is copied within new_device. * Use a subtype of 165, not 3, when creating a slice in noninteractive mode. PR: bin/135333 PR: bin/66350 Approved by: rrs (mentor) MFC after: 1 month Modified: head/usr.sbin/sysinstall/devices.c head/usr.sbin/sysinstall/disks.c head/usr.sbin/sysinstall/label.c Modified: head/usr.sbin/sysinstall/devices.c ============================================================================== --- head/usr.sbin/sysinstall/devices.c Wed Jun 16 15:09:45 2010 (r209234) +++ head/usr.sbin/sysinstall/devices.c Wed Jun 16 15:40:13 2010 (r209235) @@ -295,6 +295,8 @@ deviceGetAll(void) msgNotify("Probing devices, please wait (this can take a while)..."); /* First go for the network interfaces. Stolen shamelessly from ifconfig! */ + memset(&ifc, 0, sizeof(ifc)); + memset(buffer, 0, INTERFACE_MAX * sizeof(struct ifreq)); ifc.ifc_len = sizeof(buffer); ifc.ifc_buf = buffer; @@ -371,7 +373,7 @@ skipif: if (fd >= 0) close(fd); snprintf(n, sizeof n, device_names[i].name, j); - deviceRegister(strdup(n), device_names[i].description, strdup(try), + deviceRegister(n, device_names[i].description, strdup(try), DEVICE_TYPE_CDROM, TRUE, mediaInitCDROM, mediaGetCDROM, mediaShutdownCDROM, NULL); if (isDebug()) @@ -390,7 +392,7 @@ skipif: close(fd); snprintf(n, sizeof n, device_names[i].name, j); - deviceRegister(strdup(n), device_names[i].description, strdup(try), + deviceRegister(n, device_names[i].description, strdup(try), DEVICE_TYPE_FLOPPY, TRUE, mediaInitFloppy, mediaGetFloppy, mediaShutdownFloppy, NULL); if (isDebug()) @@ -405,7 +407,7 @@ skipif: close(fd); snprintf(n, sizeof(n), device_names[i].name, j); - deviceRegister(strdup(n), device_names[i].description, + deviceRegister(n, device_names[i].description, strdup(try), DEVICE_TYPE_USB, TRUE, mediaInitUSB, mediaGetUSB, mediaShutdownUSB, NULL); Modified: head/usr.sbin/sysinstall/disks.c ============================================================================== --- head/usr.sbin/sysinstall/disks.c Wed Jun 16 15:09:45 2010 (r209234) +++ head/usr.sbin/sysinstall/disks.c Wed Jun 16 15:40:13 2010 (r209235) @@ -479,6 +479,7 @@ diskPartition(Device *dev) else { char *val, tmp[20], name[16], *cp; daddr_t size; + long double dsize; int subtype; chunk_e partitiontype; #ifdef PC98 @@ -493,11 +494,20 @@ diskPartition(Device *dev) snprintf(tmp, 20, "%jd", (intmax_t)chunk_info[current_chunk]->size); val = msgGetInput(tmp, "Please specify the size for new FreeBSD slice in blocks\n" "or append a trailing `M' for megabytes (e.g. 20M)."); - if (val && (size = strtoimax(val, &cp, 0)) > 0) { + if (val && (dsize = strtold(val, &cp)) > 0 && dsize < UINT32_MAX) { if (*cp && toupper(*cp) == 'M') - size *= ONE_MEG; + size = (daddr_t) (dsize * ONE_MEG); else if (*cp && toupper(*cp) == 'G') - size *= ONE_GIG; + size = (daddr_t) (dsize * ONE_GIG); + else + size = (daddr_t) dsize; + + if (size < ONE_MEG) { + msgConfirm("The minimum slice size is 1MB"); + break; + } + + sprintf(tmp, "%d", SUBTYPE_FREEBSD); val = msgGetInput(tmp, "Enter type of partition to create:\n\n" "Pressing Enter will choose the default, a native FreeBSD\n" @@ -920,7 +930,8 @@ diskPartitionNonInteractive(Device *dev) { char *cp; int i, all_disk = 0; - daddr_t sz; + daddr_t size; + long double dsize; #ifdef PC98 u_char *bootipl; size_t bootipl_size; @@ -964,7 +975,7 @@ diskPartitionNonInteractive(Device *dev) /* If a chunk is at least 10MB in size, use it. */ if (chunk_info[i]->type == unused && chunk_info[i]->size > (10 * ONE_MEG)) { Create_Chunk(d, chunk_info[i]->offset, chunk_info[i]->size, - freebsd, 3, + freebsd, SUBTYPE_FREEBSD, (chunk_info[i]->flags & CHUNK_ALIGN), "FreeBSD"); variable_set2(DISK_PARTITIONED, "yes", 0); @@ -988,16 +999,19 @@ diskPartitionNonInteractive(Device *dev) All_FreeBSD(d, all_disk = TRUE); } - else if ((sz = strtoimax(cp, &cp, 0))) { - /* Look for sz bytes free */ + else if ((dsize = strtold(cp, &cp))) { if (*cp && toupper(*cp) == 'M') - sz *= ONE_MEG; + size *= (daddr_t) (dsize * ONE_MEG); else if (*cp && toupper(*cp) == 'G') - sz *= ONE_GIG; + size = (daddr_t) (dsize * ONE_GIG); + else + size = (daddr_t) dsize; + + /* Look for size bytes free */ for (i = 0; chunk_info[i]; i++) { /* If a chunk is at least sz MB, use it. */ - if (chunk_info[i]->type == unused && chunk_info[i]->size >= sz) { - Create_Chunk(d, chunk_info[i]->offset, sz, freebsd, 3, + if (chunk_info[i]->type == unused && chunk_info[i]->size >= size) { + Create_Chunk(d, chunk_info[i]->offset, size, freebsd, SUBTYPE_FREEBSD, (chunk_info[i]->flags & CHUNK_ALIGN), "FreeBSD"); variable_set2(DISK_PARTITIONED, "yes", 0); @@ -1006,7 +1020,7 @@ diskPartitionNonInteractive(Device *dev) } if (!chunk_info[i]) { msgConfirm("Unable to find %jd free blocks on this disk!", - (intmax_t)sz); + (intmax_t)size); return; } } Modified: head/usr.sbin/sysinstall/label.c ============================================================================== --- head/usr.sbin/sysinstall/label.c Wed Jun 16 15:09:45 2010 (r209234) +++ head/usr.sbin/sysinstall/label.c Wed Jun 16 15:40:13 2010 (r209235) @@ -999,6 +999,7 @@ diskLabel(Device *dev) else { char *val; daddr_t size; + long double dsize; struct chunk *tmp; char osize[80]; u_long flags = 0; @@ -1019,22 +1020,24 @@ diskLabel(Device *dev) #endif "%jd blocks (%jdMB) are free.", (intmax_t)sz, (intmax_t)sz / ONE_MEG); - if (!val || (size = strtoimax(val, &cp, 0)) <= 0) { + if (!val || (dsize = strtold(val, &cp)) <= 0) { clear_wins(); break; } if (*cp) { if (toupper(*cp) == 'M') - size *= ONE_MEG; + size = (daddr_t) (dsize * ONE_MEG); else if (toupper(*cp) == 'G') - size *= ONE_GIG; + size = (daddr_t) (dsize * ONE_GIG); #ifndef __ia64__ else if (toupper(*cp) == 'C') - size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect); + size = (daddr_t) dsize * (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect); #endif + else + size = (daddr_t) dsize; } - if (size <= FS_MIN_SIZE) { + if (size < FS_MIN_SIZE) { msgConfirm("The minimum filesystem size is %dMB", FS_MIN_SIZE / ONE_MEG); clear_wins(); break; From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 15:49: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 19E421065687; Wed, 16 Jun 2010 15:49:18 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0040C8FC24; Wed, 16 Jun 2010 15:49: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 o5GFnHqj044410; Wed, 16 Jun 2010 15:49:17 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5GFnHJr044409; Wed, 16 Jun 2010 15:49:17 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201006161549.o5GFnHJr044409@svn.freebsd.org> From: Bruce Cran Date: Wed, 16 Jun 2010 15:49: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: r209236 - head/sbin/ping6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2010 15:49:18 -0000 Author: brucec Date: Wed Jun 16 15:49:17 2010 New Revision: 209236 URL: http://svn.freebsd.org/changeset/base/209236 Log: Call free and freeaddrinfo before exiting. PR: bin/144730 PR: bin/144974 Submitted by: Earl R. Lapus Approved by: rrs (mentor) MFC after: 1 month Modified: head/sbin/ping6/ping6.c Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Wed Jun 16 15:40:13 2010 (r209235) +++ head/sbin/ping6/ping6.c Wed Jun 16 15:49:17 2010 (r209236) @@ -210,7 +210,7 @@ u_int options; int mx_dup_ck = MAX_DUP_CHK; char rcvd_tbl[MAX_DUP_CHK / 8]; -struct addrinfo *res; +struct addrinfo *res = NULL; struct sockaddr_in6 dst; /* who to ping6 */ struct sockaddr_in6 src; /* src addr of this packet */ socklen_t srclen; @@ -225,6 +225,13 @@ int ident; /* process id to identify o u_int8_t nonce[8]; /* nonce field for node information */ int hoplimit = -1; /* hoplimit */ int pathmtu = 0; /* path MTU for the destination. 0 = unspec. */ +u_char *packet = NULL; +#ifdef HAVE_POLL_H +struct pollfd fdmaskp[1]; +#else +fd_set *fdmaskp = NULL; +int fdmasks; +#endif /* counters */ long nmissedmax; /* max value of ntransmitted - nreceived - 1 */ @@ -302,19 +309,14 @@ main(argc, argv) struct timeval timeout, *tv; #endif struct addrinfo hints; -#ifdef HAVE_POLL_H - struct pollfd fdmaskp[1]; -#else - fd_set *fdmaskp; - int fdmasks; -#endif int cc, i; int ch, hold, packlen, preload, optval, ret_ga; - u_char *datap, *packet; + u_char *datap; char *e, *target, *ifname = NULL, *gateway = NULL; int ip6optlen = 0; struct cmsghdr *scmsgp = NULL; - struct cmsghdr *cm; + /* For control (ancillary) data received from recvmsg() */ + struct cmsghdr cm[CONTROLLEN]; #if defined(SO_SNDBUF) && defined(SO_RCVBUF) u_long lsockbufsize; int sockbufsize = 0; @@ -529,6 +531,7 @@ main(argc, argv) memcpy(&src, res->ai_addr, res->ai_addrlen); srclen = res->ai_addrlen; freeaddrinfo(res); + res = NULL; options |= F_SRCADDR; break; case 's': /* size of packet to send */ @@ -1081,11 +1084,6 @@ main(argc, argv) seeninfo = 0; #endif - /* For control (ancillary) data received from recvmsg() */ - cm = (struct cmsghdr *)malloc(CONTROLLEN); - if (cm == NULL) - err(1, "malloc"); - for (;;) { struct msghdr m; struct iovec iov[2]; @@ -1199,6 +1197,18 @@ main(argc, argv) } } summary(); + + if (res != NULL) + freeaddrinfo(res); + + if(packet != NULL) + free(packet); + +#ifndef HAVE_POLL_H + if(fdmaskp != NULL) + free(fdmaskp); +#endif + exit(nreceived == 0 ? 2 : 0); } @@ -2255,6 +2265,17 @@ onint(notused) { summary(); + if (res != NULL) + freeaddrinfo(res); + + if(packet != NULL) + free(packet); + +#ifndef HAVE_POLL_H + if(fdmaskp != NULL) + free(fdmaskp); +#endif + (void)signal(SIGINT, SIG_DFL); (void)kill(getpid(), SIGINT); From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 15:56:01 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 2B7161065675; Wed, 16 Jun 2010 15:56:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 9901A8FC1A; Wed, 16 Jun 2010 15:55:59 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o5GFtuXk089968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Jun 2010 18:55:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o5GFtuUF006842; Wed, 16 Jun 2010 18:55:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5GFtuxu006841; Wed, 16 Jun 2010 18:55:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 16 Jun 2010 18:55:56 +0300 From: Kostik Belousov To: Bruce Cran Message-ID: <20100616155556.GT13238@deviant.kiev.zoral.com.ua> References: <201006161549.o5GFnHJr044409@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RDZKVD6KUognMRfE" Content-Disposition: inline In-Reply-To: <201006161549.o5GFnHJr044409@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_05, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209236 - head/sbin/ping6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2010 15:56:01 -0000 --RDZKVD6KUognMRfE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 16, 2010 at 03:49:17PM +0000, Bruce Cran wrote: > Author: brucec > Date: Wed Jun 16 15:49:17 2010 > New Revision: 209236 > URL: http://svn.freebsd.org/changeset/base/209236 >=20 > Log: > Call free and freeaddrinfo before exiting. Why ? Do you distrust the _exit(2) so much ? The calls are wasted compile and run time. --RDZKVD6KUognMRfE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwY9AwACgkQC3+MBN1Mb4gnIQCfcA+KROAfHYmjXmlIzntdkSNY LoAAn0dI5sJe8Mebjw+7HoM5dvkJGnT1 =jzHo -----END PGP SIGNATURE----- --RDZKVD6KUognMRfE-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 16:02: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 468D5106566C; Wed, 16 Jun 2010 16:02:18 +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 37B508FC12; Wed, 16 Jun 2010 16:02: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 o5GG2IsX047339; Wed, 16 Jun 2010 16:02:18 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5GG2Itq047337; Wed, 16 Jun 2010 16:02:18 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201006161602.o5GG2Itq047337@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 16 Jun 2010 16:02: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: r209237 - 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, 16 Jun 2010 16:02:18 -0000 Author: jh Date: Wed Jun 16 16:02:17 2010 New Revision: 209237 URL: http://svn.freebsd.org/changeset/base/209237 Log: Correct the function name in a KASSERT. Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Wed Jun 16 15:49:17 2010 (r209236) +++ head/sys/kern/kern_conf.c Wed Jun 16 16:02:17 2010 (r209237) @@ -778,7 +778,7 @@ make_dev_p(int flags, struct cdev **cdev va_end(ap); KASSERT((flags & MAKEDEV_NOWAIT) != 0 || res == 0, - ("make_dev_credf: failed make_dev_credv")); + ("make_dev_p: failed make_dev_credv")); return (res); } From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 16:04: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 EDC36106566C; Wed, 16 Jun 2010 16:04:20 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [204.109.60.94]) by mx1.freebsd.org (Postfix) with ESMTP id AAEBB8FC12; Wed, 16 Jun 2010 16:04:20 +0000 (UTC) Received: from core.draftnet (87-194-158-129.bethere.co.uk [87.194.158.129]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id B305D5C03; Wed, 16 Jun 2010 16:04:39 +0000 (UTC) From: Bruce Cran To: Kostik Belousov Date: Wed, 16 Jun 2010 17:04:07 +0100 User-Agent: KMail/1.13.3 (FreeBSD/9.0-CURRENT; KDE/4.4.4; amd64; ; ) References: <201006161549.o5GFnHJr044409@svn.freebsd.org> <20100616155556.GT13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100616155556.GT13238@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006161704.07999.bruce@cran.org.uk> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Cran Subject: Re: svn commit: r209236 - head/sbin/ping6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2010 16:04:21 -0000 On Wednesday 16 June 2010 16:55:56 Kostik Belousov wrote: > Why ? Do you distrust the _exit(2) so much ? > The calls are wasted compile and run time. Freeing resources in something as simple as ping6 won't use much compile or run time, and it's good style to free anything you allocate. -- Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 16:22: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 49E9C1065678; Wed, 16 Jun 2010 16:22:05 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id 1D8188FC13; Wed, 16 Jun 2010 16:22:04 +0000 (UTC) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 8C7632C2A81; Wed, 16 Jun 2010 11:22:04 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id fDdAu-c4XWdY; Wed, 16 Jun 2010 11:21:56 -0500 (CDT) Received: from [10.24.157.195] (h-67-101-114-10.snfccasy.static.covad.net [67.101.114.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 647182C2ACE; Wed, 16 Jun 2010 11:21:55 -0500 (CDT) Message-ID: <4C18FA00.3050804@cs.rice.edu> Date: Wed, 16 Jun 2010 11:21:20 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201006160041.o5G0fLvZ041271@svn.freebsd.org> <20100616124346.GI1739@garage.freebsd.pl> In-Reply-To: <20100616124346.GI1739@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209226 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2010 16:22:05 -0000 On 6/16/2010 7:43 AM, Pawel Jakub Dawidek wrote: > On Wed, Jun 16, 2010 at 12:41:21AM +0000, Alan Cox wrote: > >> Author: alc >> Date: Wed Jun 16 00:41:21 2010 >> New Revision: 209226 >> URL: http://svn.freebsd.org/changeset/base/209226 >> >> Log: >> Eliminate unnecessary page queues locking. >> > [...] > > Could you take a look at this patch: > > http://people.freebsd.org/~pjd/patches/zfs_vnops.c.4.patch > > The patch is correct. Go ahead and commit it. Couldn't this function be simplified a little using uiomove_fromphys() instead of sf_buf_alloc() and uiomove()? One effect would be the elimination of the pinning that isn't needed by amd64 (and other architectures that have a direct map). Alan From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 16:37: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 C81BD106568B; Wed, 16 Jun 2010 16:37:36 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B766F8FC16; Wed, 16 Jun 2010 16:37: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 o5GGbaSp055125; Wed, 16 Jun 2010 16:37:36 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5GGbaai055120; Wed, 16 Jun 2010 16:37:36 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201006161637.o5GGbaai055120@svn.freebsd.org> From: Jack F Vogel Date: Wed, 16 Jun 2010 16:37: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: r209238 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2010 16:37:36 -0000 Author: jfv Date: Wed Jun 16 16:37:36 2010 New Revision: 209238 URL: http://svn.freebsd.org/changeset/base/209238 Log: Changes from John Baldwin adding to last commit, change rxeof api for poll friendliness, and eliminate unnecessary link tasklet use. Thanks John! Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Jun 16 16:02:17 2010 (r209237) +++ head/sys/dev/e1000/if_em.c Wed Jun 16 16:37:36 2010 (r209238) @@ -231,7 +231,7 @@ static void em_enable_intr(struct adapte static void em_disable_intr(struct adapter *); static void em_update_stats_counters(struct adapter *); static bool em_txeof(struct tx_ring *); -static int em_rxeof(struct rx_ring *, int); +static bool em_rxeof(struct rx_ring *, int, int *); #ifndef __NO_STRICT_ALIGNMENT static int em_fixup_rx(struct rx_ring *); #endif @@ -1356,12 +1356,13 @@ em_poll(struct ifnet *ifp, enum poll_cmd struct adapter *adapter = ifp->if_softc; struct tx_ring *txr = adapter->tx_rings; struct rx_ring *rxr = adapter->rx_rings; - u32 reg_icr, rx_done = 0; + u32 reg_icr; + int rx_done; EM_CORE_LOCK(adapter); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { EM_CORE_UNLOCK(adapter); - return (rx_done); + return (0); } if (cmd == POLL_AND_CHECK_STATUS) { @@ -1376,7 +1377,7 @@ em_poll(struct ifnet *ifp, enum poll_cmd } EM_CORE_UNLOCK(adapter); - rx_done = em_rxeof(rxr, count); + em_rxeof(rxr, count, &rx_done); EM_TX_LOCK(txr); em_txeof(txr); @@ -1448,14 +1449,15 @@ em_handle_que(void *context, int pending struct ifnet *ifp = adapter->ifp; struct tx_ring *txr = adapter->tx_rings; struct rx_ring *rxr = adapter->rx_rings; - bool more_rx; + bool more; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - more_rx = em_rxeof(rxr, adapter->rx_process_limit); + more = em_rxeof(rxr, adapter->rx_process_limit, NULL); EM_TX_LOCK(txr); - em_txeof(txr); + if (em_txeof(txr)) + more = TRUE; #ifdef EM_MULTIQUEUE if (!drbr_empty(ifp, txr->br)) em_mq_start_locked(ifp, txr, NULL); @@ -1464,7 +1466,7 @@ em_handle_que(void *context, int pending em_start_locked(ifp, txr); #endif EM_TX_UNLOCK(txr); - if (more_rx) { + if (more) { taskqueue_enqueue(adapter->tq, &adapter->que_task); return; } @@ -1513,7 +1515,7 @@ em_msix_rx(void *arg) bool more; ++rxr->rx_irq; - more = em_rxeof(rxr, adapter->rx_process_limit); + more = em_rxeof(rxr, adapter->rx_process_limit, NULL); if (more) taskqueue_enqueue(rxr->tq, &rxr->rx_task); else @@ -1538,7 +1540,7 @@ em_msix_link(void *arg) if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { adapter->hw.mac.get_link_status = 1; - taskqueue_enqueue(taskqueue_fast, &adapter->link_task); + em_handle_link(adapter, 0); } else E1000_WRITE_REG(&adapter->hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC); @@ -1552,7 +1554,7 @@ em_handle_rx(void *context, int pending) struct adapter *adapter = rxr->adapter; bool more; - more = em_rxeof(rxr, adapter->rx_process_limit); + more = em_rxeof(rxr, adapter->rx_process_limit, NULL); if (more) taskqueue_enqueue(rxr->tq, &rxr->rx_task); else @@ -2428,11 +2430,6 @@ em_allocate_msix(struct adapter *adapter adapter->linkvec = vector; adapter->ivars |= (8 | vector) << 16; adapter->ivars |= 0x80000000; - TASK_INIT(&adapter->link_task, 0, em_handle_link, adapter); - adapter->tq = taskqueue_create_fast("em_link", M_NOWAIT, - taskqueue_thread_enqueue, &adapter->tq); - taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s linkq", - device_get_nameunit(adapter->dev)); return (0); } @@ -4087,8 +4084,8 @@ em_initialize_receive_unit(struct adapte * * For polling we also now return the number of cleaned packets *********************************************************************/ -static int -em_rxeof(struct rx_ring *rxr, int count) +static bool +em_rxeof(struct rx_ring *rxr, int count, int *done) { struct adapter *adapter = rxr->adapter; struct ifnet *ifp = adapter->ifp; @@ -4215,13 +4212,11 @@ skip: } rxr->next_to_check = i; + if (done != NULL) + *done = rxdone; EM_RX_UNLOCK(rxr); -#ifdef DEVICE_POLLING - return (rxdone); -#else return ((status & E1000_RXD_STAT_DD) ? TRUE : FALSE); -#endif } #ifndef __NO_STRICT_ALIGNMENT Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Wed Jun 16 16:02:17 2010 (r209237) +++ head/sys/dev/e1000/if_igb.c Wed Jun 16 16:37:36 2010 (r209238) @@ -205,7 +205,7 @@ static __inline void igb_rx_discard(stru static __inline void igb_rx_input(struct rx_ring *, struct ifnet *, struct mbuf *, u32); -static bool igb_rxeof(struct igb_queue *, int); +static bool igb_rxeof(struct igb_queue *, int, int *); static void igb_rx_checksum(u32, struct mbuf *, u32); static int igb_tx_ctx_setup(struct tx_ring *, struct mbuf *); static bool igb_tso_setup(struct tx_ring *, struct mbuf *, u32 *); @@ -1234,13 +1234,15 @@ igb_handle_que(void *context, int pendin struct adapter *adapter = que->adapter; struct tx_ring *txr = que->txr; struct ifnet *ifp = adapter->ifp; - bool more; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - more = igb_rxeof(que, -1); + bool more; + + more = igb_rxeof(que, -1, NULL); IGB_TX_LOCK(txr); - igb_txeof(txr); + if (igb_txeof(txr)) + more = TRUE; #if __FreeBSD_version >= 800000 if (!drbr_empty(ifp, txr->br)) igb_mq_start_locked(ifp, txr, NULL); @@ -1353,15 +1355,14 @@ igb_poll(struct ifnet *ifp, enum poll_cm reg_icr = E1000_READ_REG(&adapter->hw, E1000_ICR); /* Link status change */ if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) - taskqueue_enqueue(que->tq, &adapter->link_task); + igb_handle_link(adapter, 0); if (reg_icr & E1000_ICR_RXO) adapter->rx_overruns++; } IGB_CORE_UNLOCK(adapter); - /* TODO: rx_count */ - rx_done = igb_rxeof(que, count) ? 1 : 0; + igb_rxeof(que, count, &rx_done); IGB_TX_LOCK(txr); do { @@ -1401,7 +1402,7 @@ igb_msix_que(void *arg) more_tx = igb_txeof(txr); IGB_TX_UNLOCK(txr); - more_rx = igb_rxeof(que, adapter->rx_process_limit); + more_rx = igb_rxeof(que, adapter->rx_process_limit, NULL); if (igb_enable_aim == FALSE) goto no_calc; @@ -1481,7 +1482,7 @@ igb_msix_link(void *arg) icr = E1000_READ_REG(&adapter->hw, E1000_ICR); if (!(icr & E1000_ICR_LSC)) goto spurious; - taskqueue_enqueue(adapter->tq, &adapter->link_task); + igb_handle_link(adapter, 0); spurious: /* Rearm */ @@ -2212,13 +2213,6 @@ igb_allocate_msix(struct adapter *adapte #endif adapter->linkvec = vector; - /* Make tasklet for deferred handling */ - TASK_INIT(&adapter->link_task, 0, igb_handle_link, adapter); - adapter->tq = taskqueue_create_fast("igb_link", M_NOWAIT, - taskqueue_thread_enqueue, &adapter->tq); - taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s link", - device_get_nameunit(adapter->dev)); - return (0); } @@ -4199,14 +4193,14 @@ igb_rx_input(struct rx_ring *rxr, struct * Return TRUE if more to clean, FALSE otherwise *********************************************************************/ static bool -igb_rxeof(struct igb_queue *que, int count) +igb_rxeof(struct igb_queue *que, int count, int *done) { struct adapter *adapter = que->adapter; struct rx_ring *rxr = que->rxr; struct ifnet *ifp = adapter->ifp; struct lro_ctrl *lro = &rxr->lro; struct lro_entry *queued; - int i, processed = 0; + int i, processed = 0, rxdone = 0; u32 ptype, staterr = 0; union e1000_adv_rx_desc *cur; @@ -4359,6 +4353,7 @@ next_desc: rxr->next_to_check = i; igb_rx_input(rxr, ifp, sendmp, ptype); i = rxr->next_to_check; + rxdone++; } /* Every 8 descriptors we go to refresh mbufs */ @@ -4386,6 +4381,9 @@ next_desc: IGB_RX_UNLOCK(rxr); + if (done != NULL) + *done = rxdone; + /* ** We still have cleaning to do? ** Schedule another interrupt if so. Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Wed Jun 16 16:02:17 2010 (r209237) +++ head/sys/dev/e1000/if_igb.h Wed Jun 16 16:37:36 2010 (r209238) @@ -382,7 +382,6 @@ struct adapter { int min_frame_size; struct mtx core_mtx; int igb_insert_vlan_header; - struct taskqueue *tq; /* adapter task queue */ u16 num_queues; eventhandler_tag vlan_attach; Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Wed Jun 16 16:02:17 2010 (r209237) +++ head/sys/dev/e1000/if_lem.c Wed Jun 16 16:37:36 2010 (r209238) @@ -200,7 +200,7 @@ static void lem_txeof(struct adapter *); static void lem_tx_purge(struct adapter *); static int lem_allocate_receive_structures(struct adapter *); static int lem_allocate_transmit_structures(struct adapter *); -static int lem_rxeof(struct adapter *, int); +static bool lem_rxeof(struct adapter *, int, int *); #ifndef __NO_STRICT_ALIGNMENT static int lem_fixup_rx(struct adapter *); #endif @@ -1255,7 +1255,7 @@ lem_poll(struct ifnet *ifp, enum poll_cm } EM_CORE_UNLOCK(adapter); - rx_done = lem_rxeof(adapter, count); + lem_rxeof(adapter, count, &rx_done); EM_TX_LOCK(adapter); lem_txeof(adapter); @@ -1308,7 +1308,7 @@ lem_intr(void *arg) EM_TX_LOCK(adapter); lem_txeof(adapter); - lem_rxeof(adapter, -1); + lem_rxeof(adapter, -1, NULL); lem_txeof(adapter); if (ifp->if_drv_flags & IFF_DRV_RUNNING && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1350,7 +1350,7 @@ lem_handle_rxtx(void *context, int pendi if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - if (lem_rxeof(adapter, adapter->rx_process_limit) != 0) + if (lem_rxeof(adapter, adapter->rx_process_limit, NULL) != 0) taskqueue_enqueue(adapter->tq, &adapter->rxtx_task); EM_TX_LOCK(adapter); lem_txeof(adapter); @@ -3449,8 +3449,8 @@ lem_free_receive_structures(struct adapt * * For polling we also now return the number of cleaned packets *********************************************************************/ -static int -lem_rxeof(struct adapter *adapter, int count) +static bool +lem_rxeof(struct adapter *adapter, int count, int *done) { struct ifnet *ifp = adapter->ifp;; struct mbuf *mp; @@ -3466,8 +3466,10 @@ lem_rxeof(struct adapter *adapter, int c BUS_DMASYNC_POSTREAD); if (!((current_desc->status) & E1000_RXD_STAT_DD)) { + if (done != NULL) + *done = rx_sent; EM_RX_UNLOCK(adapter); - return (rx_sent); + return (FALSE); } while ((current_desc->status & E1000_RXD_STAT_DD) && @@ -3626,8 +3628,10 @@ discard: if (--i < 0) i = adapter->num_rx_desc - 1; E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), i); + if (done != NULL) + *done = rx_sent; EM_RX_UNLOCK(adapter); - return (rx_sent); + return (current_desc->status & E1000_RXD_STAT_DD); } #ifndef __NO_STRICT_ALIGNMENT From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 16:39: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 029C3106566C; Wed, 16 Jun 2010 16:39:02 +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 E69858FC0A; Wed, 16 Jun 2010 16:39: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 o5GGd12O055499; Wed, 16 Jun 2010 16:39:01 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5GGd1sq055497; Wed, 16 Jun 2010 16:39:01 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201006161639.o5GGd1sq055497@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 16 Jun 2010 16:39: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: r209239 - head/libexec/rtld-elf/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: Wed, 16 Jun 2010 16:39:02 -0000 Author: jchandra Date: Wed Jun 16 16:39:01 2010 New Revision: 209239 URL: http://svn.freebsd.org/changeset/base/209239 Log: Merge jmallett@'s n64 work into HEAD - changeset 3 Update rtld MIPS code to use assembly macros that work on o32/n64. Changes from http://svn.freebsd.org/base/user/jmallett/octeon Approved by: rrs(mentor), jmallett Modified: head/libexec/rtld-elf/mips/rtld_start.S Modified: head/libexec/rtld-elf/mips/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/mips/rtld_start.S Wed Jun 16 16:37:36 2010 (r209238) +++ head/libexec/rtld-elf/mips/rtld_start.S Wed Jun 16 16:39:01 2010 (r209239) @@ -68,7 +68,8 @@ LEAF(rtld_start) move a0, s0 /* sp */ PTR_ADDU a1, sp, 2*PTR_SIZE /* &our atexit function */ PTR_ADDU a2, sp, 3*PTR_SIZE /* obj_main entry */ - jal _C_LABEL(_rtld) /* v0 = _rtld(sp, cleanup, objp) */ + PTR_LA t9, _C_LABEL(_rtld) + jalr t9 /* v0 = _rtld(sp, cleanup, objp) */ nop PTR_L a1, 2*PTR_SIZE(sp) /* our atexit function */ @@ -123,7 +124,7 @@ _rtld_bind_start: move s0, sp move a0, v1 /* old GP */ - subu a0, a0, 0x7ff0 /* The offset of $gp from the */ + PTR_SUBU a0, a0, 0x7ff0 /* The offset of $gp from the */ /* beginning of the .got section: */ /* $gp = .got + 0x7ff0, so */ /* .got = $gp - 0x7ff0 */ @@ -136,7 +137,8 @@ _rtld_bind_start: and a0, a0, 0x7fffffff move a1, t8 /* symbol index */ - jal _C_LABEL(_mips_rtld_bind) + PTR_LA t9, _C_LABEL(_mips_rtld_bind) + jalr t9 nop move sp, s0 From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 16:52: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 5CACD1065679; Wed, 16 Jun 2010 16:52:36 +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 4CBA58FC16; Wed, 16 Jun 2010 16:52: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 o5GGqZeL058563; Wed, 16 Jun 2010 16:52:35 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5GGqZDo058561; Wed, 16 Jun 2010 16:52:35 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201006161652.o5GGqZDo058561@svn.freebsd.org> From: Rafal Jaworowski Date: Wed, 16 Jun 2010 16:52: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: r209240 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2010 16:52:36 -0000 Author: raj Date: Wed Jun 16 16:52:35 2010 New Revision: 209240 URL: http://svn.freebsd.org/changeset/base/209240 Log: Use awk alone for extracting FDT_DTS_FILE instead of grep/cut, which is simpler and more robust. Submitted by: Andrzej Tobola Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jun 16 16:39:01 2010 (r209239) +++ head/Makefile.inc1 Wed Jun 16 16:52:35 2010 (r209240) @@ -1458,8 +1458,8 @@ _xi-links: DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ .if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) -FDT_DTS_FILE!= grep "^makeoptions[[:space:]]\+FDT_DTS_FILE" \ - ${KERNCONFDIR}/${KERNCONF} 2> /dev/null | cut -d= -f2 +FDT_DTS_FILE!= awk '/^makeoptions[[:space:]]+FDT_DTS_FILE/ {FS="=|[ \t]+"; print $$3}' \ + ${KERNCONFDIR}/${KERNCONF} .endif .endif From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 16:55: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 8CF58106566C; Wed, 16 Jun 2010 16:55:15 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id 625338FC17; Wed, 16 Jun 2010 16:55:15 +0000 (UTC) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id E13802C2AD0; Wed, 16 Jun 2010 11:55:14 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id EjJiKuOE4+nt; Wed, 16 Jun 2010 11:55:07 -0500 (CDT) Received: from [10.24.157.195] (h-67-101-114-10.snfccasy.static.covad.net [67.101.114.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 9CBE42C2ACE; Wed, 16 Jun 2010 11:55:06 -0500 (CDT) Message-ID: <4C1901C7.1070903@cs.rice.edu> Date: Wed, 16 Jun 2010 11:54:31 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201006160041.o5G0fLvZ041271@svn.freebsd.org> <20100616124346.GI1739@garage.freebsd.pl> In-Reply-To: <20100616124346.GI1739@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209226 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2010 16:55:15 -0000 On 6/16/2010 7:43 AM, Pawel Jakub Dawidek wrote: > On Wed, Jun 16, 2010 at 12:41:21AM +0000, Alan Cox wrote: > >> Author: alc >> Date: Wed Jun 16 00:41:21 2010 >> New Revision: 209226 >> URL: http://svn.freebsd.org/changeset/base/209226 >> >> Log: >> Eliminate unnecessary page queues locking. >> > [...] > > Could you take a look at this patch: > > http://people.freebsd.org/~pjd/patches/zfs_vnops.c.4.patch > > Reviewing entire VM interaction there would be even better:) > > You should also duplicate here the change made to tmpfs_vnops.c in r207530 Regards, Alan From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 17:36: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 8B754106564A; Wed, 16 Jun 2010 17:36:53 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 783C98FC1E; Wed, 16 Jun 2010 17:36:53 +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 o5GHarbA068503; Wed, 16 Jun 2010 17:36:53 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5GHarDG068500; Wed, 16 Jun 2010 17:36:53 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201006161736.o5GHarDG068500@svn.freebsd.org> From: "George V. Neville-Neil" Date: Wed, 16 Jun 2010 17:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209241 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2010 17:36:53 -0000 Author: gnn Date: Wed Jun 16 17:36:53 2010 New Revision: 209241 URL: http://svn.freebsd.org/changeset/base/209241 Log: Move statistics into the sysctl tree making it easier to find and use them. Add previously hidden statistics, some of which include interrupt and host/card communication counters. Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Wed Jun 16 16:52:35 2010 (r209240) +++ head/sys/dev/e1000/if_igb.c Wed Jun 16 17:36:53 2010 (r209241) @@ -212,7 +212,6 @@ static bool igb_tso_setup(struct tx_ring static void igb_set_promisc(struct adapter *); static void igb_disable_promisc(struct adapter *); static void igb_set_multi(struct adapter *); -static void igb_print_hw_stats(struct adapter *); static void igb_update_link_status(struct adapter *); static void igb_refresh_mbufs(struct rx_ring *, int); @@ -224,11 +223,10 @@ static int igb_xmit(struct tx_ring *, st static int igb_dma_malloc(struct adapter *, bus_size_t, struct igb_dma_alloc *, int); static void igb_dma_free(struct adapter *, struct igb_dma_alloc *); -static void igb_print_debug_info(struct adapter *); +static int igb_sysctl_nvm_info(SYSCTL_HANDLER_ARGS); static void igb_print_nvm_info(struct adapter *); static int igb_is_valid_ether_addr(u8 *); -static int igb_sysctl_stats(SYSCTL_HANDLER_ARGS); -static int igb_sysctl_debug_info(SYSCTL_HANDLER_ARGS); +static void igb_add_hw_stats(struct adapter *adapter); /* Management and WOL Support */ static void igb_init_manageability(struct adapter *); static void igb_release_manageability(struct adapter *); @@ -411,13 +409,8 @@ igb_attach(device_t dev) /* SYSCTL stuff */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "debug", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, - igb_sysctl_debug_info, "I", "Debug Information"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "stats", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, - igb_sysctl_stats, "I", "Statistics"); + OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, + igb_sysctl_nvm_info, "I", "NVM Information"); SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), @@ -583,6 +576,8 @@ igb_attach(device_t dev) adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, igb_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); + igb_add_hw_stats(adapter); + /* Tell the stack that the interface is not active */ adapter->ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); @@ -1881,7 +1876,6 @@ static void igb_local_timer(void *arg) { struct adapter *adapter = arg; - struct ifnet *ifp = adapter->ifp; device_t dev = adapter->dev; struct tx_ring *txr = adapter->tx_rings; @@ -1891,9 +1885,6 @@ igb_local_timer(void *arg) igb_update_link_status(adapter); igb_update_stats_counters(adapter); - if (igb_display_debug_stats && ifp->if_drv_flags & IFF_DRV_RUNNING) - igb_print_hw_stats(adapter); - /* ** Watchdog: check for time since any descriptor was cleaned */ @@ -4741,8 +4732,10 @@ igb_update_stats_counters(struct adapter /* For the 64-bit byte counters the low dword must be read first. */ /* Both registers clear on the read of the high dword */ - adapter->stats.gorc += E1000_READ_REG(&adapter->hw, E1000_GORCH); - adapter->stats.gotc += E1000_READ_REG(&adapter->hw, E1000_GOTCH); + adapter->stats.gorc += E1000_READ_REG(&adapter->hw, E1000_GORCL) + + ((u64)E1000_READ_REG(&adapter->hw, E1000_GORCH) << 32); + adapter->stats.gotc += E1000_READ_REG(&adapter->hw, E1000_GOTCL) + + ((u64)E1000_READ_REG(&adapter->hw, E1000_GOTCH) << 32) ; adapter->stats.rnbc += E1000_READ_REG(&adapter->hw, E1000_RNBC); adapter->stats.ruc += E1000_READ_REG(&adapter->hw, E1000_RUC); @@ -4764,6 +4757,38 @@ igb_update_stats_counters(struct adapter adapter->stats.mptc += E1000_READ_REG(&adapter->hw, E1000_MPTC); adapter->stats.bptc += E1000_READ_REG(&adapter->hw, E1000_BPTC); + /* Interrupt Counts */ + + adapter->stats.iac += E1000_READ_REG(&adapter->hw, E1000_IAC); + adapter->stats.icrxptc += E1000_READ_REG(&adapter->hw, E1000_ICRXPTC); + adapter->stats.icrxatc += E1000_READ_REG(&adapter->hw, E1000_ICRXATC); + adapter->stats.ictxptc += E1000_READ_REG(&adapter->hw, E1000_ICTXPTC); + adapter->stats.ictxatc += E1000_READ_REG(&adapter->hw, E1000_ICTXATC); + adapter->stats.ictxqec += E1000_READ_REG(&adapter->hw, E1000_ICTXQEC); + adapter->stats.ictxqmtc += E1000_READ_REG(&adapter->hw, E1000_ICTXQMTC); + adapter->stats.icrxdmtc += E1000_READ_REG(&adapter->hw, E1000_ICRXDMTC); + adapter->stats.icrxoc += E1000_READ_REG(&adapter->hw, E1000_ICRXOC); + + /* Host to Card Statistics */ + + adapter->stats.cbtmpc += E1000_READ_REG(&adapter->hw, E1000_CBTMPC); + adapter->stats.htdpmc += E1000_READ_REG(&adapter->hw, E1000_HTDPMC); + adapter->stats.cbrdpc += E1000_READ_REG(&adapter->hw, E1000_CBRDPC); + adapter->stats.cbrmpc += E1000_READ_REG(&adapter->hw, E1000_CBRMPC); + adapter->stats.rpthc += E1000_READ_REG(&adapter->hw, E1000_RPTHC); + adapter->stats.hgptc += E1000_READ_REG(&adapter->hw, E1000_HGPTC); + adapter->stats.htcbdpc += E1000_READ_REG(&adapter->hw, E1000_HTCBDPC); + adapter->stats.hgorc += (E1000_READ_REG(&adapter->hw, E1000_HGORCL) + + ((u64)E1000_READ_REG(&adapter->hw, + E1000_HGORCH) << 32)); + + adapter->stats.hgotc += (E1000_READ_REG(&adapter->hw, E1000_HGOTCL) + + ((u64)E1000_READ_REG(&adapter->hw, + E1000_HGOTCH) << 32)); + adapter->stats.lenerrs += E1000_READ_REG(&adapter->hw, E1000_LENERRS); + adapter->stats.scvpc += E1000_READ_REG(&adapter->hw, E1000_SCVPC); + adapter->stats.hrmpc += E1000_READ_REG(&adapter->hw, E1000_HRMPC); + adapter->stats.algnerrc += E1000_READ_REG(&adapter->hw, E1000_ALGNERRC); adapter->stats.rxerrc += @@ -4792,135 +4817,375 @@ igb_update_stats_counters(struct adapter } -/********************************************************************** - * - * This routine is called only when igb_display_debug_stats is enabled. - * This routine provides a way to take a look at important statistics - * maintained by the driver and hardware. - * - **********************************************************************/ +/* + * Add sysctl variables, one per statistic, to the system. + */ static void -igb_print_debug_info(struct adapter *adapter) +igb_add_hw_stats(struct adapter *adapter) { + device_t dev = adapter->dev; - struct igb_queue *que = adapter->queues; - struct rx_ring *rxr = adapter->rx_rings; - struct tx_ring *txr = adapter->tx_rings; - uint8_t *hw_addr = adapter->hw.hw_addr; - device_printf(dev, "Adapter hardware address = %p \n", hw_addr); - device_printf(dev, "CTRL = 0x%x RCTL = 0x%x \n", - E1000_READ_REG(&adapter->hw, E1000_CTRL), - E1000_READ_REG(&adapter->hw, E1000_RCTL)); - -#if (DEBUG_HW > 0) /* Dont output these errors normally */ - device_printf(dev, "IMS = 0x%x EIMS = 0x%x \n", - E1000_READ_REG(&adapter->hw, E1000_IMS), - E1000_READ_REG(&adapter->hw, E1000_EIMS)); -#endif + struct tx_ring *txr = adapter->tx_rings; + struct rx_ring *rxr = adapter->rx_rings; - device_printf(dev, "Packet buffer = Tx=%dk Rx=%dk \n", - ((E1000_READ_REG(&adapter->hw, E1000_PBA) & 0xffff0000) >> 16),\ - (E1000_READ_REG(&adapter->hw, E1000_PBA) & 0xffff) ); - device_printf(dev, "Flow control watermarks high = %d low = %d\n", - adapter->hw.fc.high_water, - adapter->hw.fc.low_water); + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); + struct sysctl_oid *tree = device_get_sysctl_tree(dev); + struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); + struct e1000_hw_stats *stats = &adapter->stats; + + struct sysctl_oid *stat_node, *queue_node, *int_node, *host_node; + struct sysctl_oid_list *stat_list, *queue_list, *int_list, *host_list; + +#define QUEUE_NAME_LEN 32 + char namebuf[QUEUE_NAME_LEN]; + + /* Driver Statistics */ + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "link_irq", + CTLFLAG_RD, &adapter->link_irq, 0, + "Link MSIX IRQ Handled"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "dropped", + CTLFLAG_RD, &adapter->dropped_pkts, + "Driver dropped packets"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_dma_fail", + CTLFLAG_RD, &adapter->no_tx_dma_setup, + "Driver tx dma failure in xmit"); + + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "device_control", + CTLFLAG_RD, &adapter->device_control, + "Device Control Register"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "rx_control", + CTLFLAG_RD, &adapter->rx_control, + "Receiver Control Register"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "interrupt_mask", + CTLFLAG_RD, &adapter->int_mask, + "Interrupt Mask"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "extended_int_mask", + CTLFLAG_RD, &adapter->eint_mask, + "Extended Interrupt Mask"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_buf_alloc", + CTLFLAG_RD, &adapter->packet_buf_alloc_tx, + "Transmit Buffer Packet Allocation"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "rx_buf_alloc", + CTLFLAG_RD, &adapter->packet_buf_alloc_rx, + "Receive Buffer Packet Allocation"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_high_water", + CTLFLAG_RD, &adapter->hw.fc.high_water, 0, + "Flow Control High Watermark"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_low_water", + CTLFLAG_RD, &adapter->hw.fc.low_water, 0, + "Flow Control Low Watermark"); for (int i = 0; i < adapter->num_queues; i++, txr++) { - device_printf(dev, "Queue(%d) tdh = %d, tdt = %d ", i, - E1000_READ_REG(&adapter->hw, E1000_TDH(i)), - E1000_READ_REG(&adapter->hw, E1000_TDT(i))); - device_printf(dev, "TX(%d) no descriptors = %lld\n", - txr->me, (long long)txr->no_desc_avail); - device_printf(dev, "TX(%d) Packets sent = %lld\n", - txr->me, (long long)txr->tx_packets); + snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i); + queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, + CTLFLAG_RD, NULL, "Queue Name"); + queue_list = SYSCTL_CHILDREN(queue_node); + + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "txd_head", + CTLFLAG_RD, &txr->tdh, 0, + "Transmit Descriptor Head"); + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "txd_tail", + CTLFLAG_RD, &txr->tdt, 0, + "Transmit Descriptor Tail"); + SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "no_desc_avail", + CTLFLAG_RD, &txr->no_desc_avail, + "Queue No Descriptor Available"); + SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "tx_packets", + CTLFLAG_RD, &txr->tx_packets, + "Queue Packets Transmitted"); } for (int i = 0; i < adapter->num_queues; i++, rxr++) { struct lro_ctrl *lro = &rxr->lro; - device_printf(dev, "Queue(%d) rdh = %d, rdt = %d\n", i, - E1000_READ_REG(&adapter->hw, E1000_RDH(i)), - E1000_READ_REG(&adapter->hw, E1000_RDT(i))); - device_printf(dev, "RX(%d) Packets received = %lld\n", rxr->me, - (long long)rxr->rx_packets); - device_printf(dev, " Split Packets = %lld ", - (long long)rxr->rx_split_packets); - device_printf(dev, " Byte count = %lld\n", - (long long)rxr->rx_bytes); - device_printf(dev,"RX(%d) LRO Queued= %d ", - i, lro->lro_queued); - device_printf(dev,"LRO Flushed= %d\n",lro->lro_flushed); - } - - for (int i = 0; i < adapter->num_queues; i++, que++) - device_printf(dev,"QUE(%d) IRQs = %lld\n", - i, (long long)que->irqs); - - device_printf(dev, "LINK MSIX IRQ Handled = %u\n", adapter->link_irq); - device_printf(dev, "Mbuf defrag failed = %ld\n", - adapter->mbuf_defrag_failed); - device_printf(dev, "Std mbuf header failed = %ld\n", - adapter->mbuf_header_failed); - device_printf(dev, "Std mbuf packet failed = %ld\n", - adapter->mbuf_packet_failed); - device_printf(dev, "Driver dropped packets = %ld\n", - adapter->dropped_pkts); - device_printf(dev, "Driver tx dma failure in xmit = %ld\n", - adapter->no_tx_dma_setup); -} -static void -igb_print_hw_stats(struct adapter *adapter) -{ - device_t dev = adapter->dev; + snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i); + queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, + CTLFLAG_RD, NULL, "Queue Name"); + queue_list = SYSCTL_CHILDREN(queue_node); + + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "rxd_head", + CTLFLAG_RD, &rxr->rdh, 0, + "Receive Descriptor Head"); + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "rxd_tail", + CTLFLAG_RD, &rxr->rdt, 0, + "Receive Descriptor Tail"); + SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "rx_packets", + CTLFLAG_RD, &rxr->rx_packets, + "Queue Packets Received"); + SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "rx_bytes", + CTLFLAG_RD, &rxr->rx_bytes, + "Queue Bytes Received"); + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "lro_queued", + CTLFLAG_RD, &lro->lro_queued, 0, + "LRO Queued"); + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "lro_flushed", + CTLFLAG_RD, &lro->lro_flushed, 0, + "LRO Flushed"); + } + + /* MAC stats get the own sub node */ + + stat_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "mac_stats", + CTLFLAG_RD, NULL, "MAC Statistics"); + stat_list = SYSCTL_CHILDREN(stat_node); + + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "excess_coll", + CTLFLAG_RD, &stats->ecol, + "Excessive collisions"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "single_coll", + CTLFLAG_RD, &stats->scc, + "Single collisions"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "multiple_coll", + CTLFLAG_RD, &stats->mcc, + "Multiple collisions"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "late_coll", + CTLFLAG_RD, &stats->latecol, + "Late collisions"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "collision_count", + CTLFLAG_RD, &stats->colc, + "Collision Count"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "symbol_errors", + CTLFLAG_RD, &adapter->stats.symerrs, + "Symbol Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "sequence_errors", + CTLFLAG_RD, &adapter->stats.sec, + "Sequence Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "defer_count", + CTLFLAG_RD, &adapter->stats.dc, + "Defer Count"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "missed_packets", + CTLFLAG_RD, &adapter->stats.mpc, + "Missed Packets"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_no_buff", + CTLFLAG_RD, &adapter->stats.rnbc, + "Receive No Buffers"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_undersize", + CTLFLAG_RD, &adapter->stats.ruc, + "Receive Undersize"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_fragmented", + CTLFLAG_RD, &adapter->stats.rfc, + "Fragmented Packets Received "); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_oversize", + CTLFLAG_RD, &adapter->stats.roc, + "Oversized Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_jabber", + CTLFLAG_RD, &adapter->stats.rjc, + "Recevied Jabber"); - device_printf(dev, "Excessive collisions = %lld\n", - (long long)adapter->stats.ecol); -#if (DEBUG_HW > 0) /* Dont output these errors normally */ - device_printf(dev, "Symbol errors = %lld\n", - (long long)adapter->stats.symerrs); -#endif - device_printf(dev, "Sequence errors = %lld\n", - (long long)adapter->stats.sec); - device_printf(dev, "Defer count = %lld\n", - (long long)adapter->stats.dc); - device_printf(dev, "Missed Packets = %lld\n", - (long long)adapter->stats.mpc); - device_printf(dev, "Receive No Buffers = %lld\n", - (long long)adapter->stats.rnbc); /* RLEC is inaccurate on some hardware, calculate our own. */ - device_printf(dev, "Receive Length Errors = %lld\n", - ((long long)adapter->stats.roc + (long long)adapter->stats.ruc)); - device_printf(dev, "Receive errors = %lld\n", - (long long)adapter->stats.rxerrc); - device_printf(dev, "Crc errors = %lld\n", - (long long)adapter->stats.crcerrs); - device_printf(dev, "Alignment errors = %lld\n", - (long long)adapter->stats.algnerrc); +/* SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_len_errs", */ +/* CTLFLAG_RD, adapter->stats.roc + adapter->stats.ruc, */ +/* "Receive Length Errors"); */ + + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_errs", + CTLFLAG_RD, &adapter->stats.rxerrc, + "Receive Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "crc_errs", + CTLFLAG_RD, &adapter->stats.crcerrs, + "CRC errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "alignment_errs", + CTLFLAG_RD, &adapter->stats.algnerrc, + "Alignment Errors"); /* On 82575 these are collision counts */ - device_printf(dev, "Collision/Carrier extension errors = %lld\n", - (long long)adapter->stats.cexterr); - device_printf(dev, "RX overruns = %ld\n", adapter->rx_overruns); - device_printf(dev, "watchdog timeouts = %ld\n", - adapter->watchdog_events); - device_printf(dev, "XON Rcvd = %lld\n", - (long long)adapter->stats.xonrxc); - device_printf(dev, "XON Xmtd = %lld\n", - (long long)adapter->stats.xontxc); - device_printf(dev, "XOFF Rcvd = %lld\n", - (long long)adapter->stats.xoffrxc); - device_printf(dev, "XOFF Xmtd = %lld\n", - (long long)adapter->stats.xofftxc); - device_printf(dev, "Good Packets Rcvd = %lld\n", - (long long)adapter->stats.gprc); - device_printf(dev, "Good Packets Xmtd = %lld\n", - (long long)adapter->stats.gptc); - device_printf(dev, "TSO Contexts Xmtd = %lld\n", - (long long)adapter->stats.tsctc); - device_printf(dev, "TSO Contexts Failed = %lld\n", - (long long)adapter->stats.tsctfc); -} + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "coll_ext_errs", + CTLFLAG_RD, &adapter->stats.cexterr, + "Collision/Carrier extension errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_overruns", + CTLFLAG_RD, &adapter->rx_overruns, + "RX overruns"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "watchdog_timeouts", + CTLFLAG_RD, &adapter->watchdog_events, + "Watchdog timeouts"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xon_recvd", + CTLFLAG_RD, &adapter->stats.xonrxc, + "XON Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xon_txd", + CTLFLAG_RD, &adapter->stats.xontxc, + "XON Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xoff_recvd", + CTLFLAG_RD, &adapter->stats.xoffrxc, + "XOFF Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xoff_txd", + CTLFLAG_RD, &adapter->stats.xofftxc, + "XOFF Transmitted"); + /* Packet Reception Stats */ + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_recvd", + CTLFLAG_RD, &adapter->stats.tpr, + "Total Packets Received "); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_recvd", + CTLFLAG_RD, &adapter->stats.gprc, + "Good Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "bcast_pkts_recvd", + CTLFLAG_RD, &adapter->stats.bprc, + "Broadcast Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mcast_pkts_recvd", + CTLFLAG_RD, &adapter->stats.mprc, + "Multicast Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_64", + CTLFLAG_RD, &adapter->stats.prc64, + "64 byte frames received "); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_65_127", + CTLFLAG_RD, &adapter->stats.prc127, + "65-127 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_128_255", + CTLFLAG_RD, &adapter->stats.prc255, + "128-255 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_256_511", + CTLFLAG_RD, &adapter->stats.prc511, + "256-511 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_512_1023", + CTLFLAG_RD, &adapter->stats.prc1023, + "512-1023 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_1024_1522", + CTLFLAG_RD, &adapter->stats.prc1522, + "1023-1522 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_recvd", + CTLFLAG_RD, &adapter->stats.gorc, + "Good Octets Received"); + + /* Packet Transmission Stats */ + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octest_txd", + CTLFLAG_RD, &adapter->stats.gotc, + "Good Octest Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_txd", + CTLFLAG_RD, &adapter->stats.tpt, + "Total Packets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_txd", + CTLFLAG_RD, &adapter->stats.gptc, + "Good Packets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "bcast_pkts_txd", + CTLFLAG_RD, &adapter->stats.bptc, + "Broadcast Packets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mcast_pkts_txd", + CTLFLAG_RD, &adapter->stats.mptc, + "Multicast Packets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_64", + CTLFLAG_RD, &adapter->stats.ptc64, + "64 byte frames transmitted "); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_65_127", + CTLFLAG_RD, &adapter->stats.ptc127, + "65-127 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_128_255", + CTLFLAG_RD, &adapter->stats.ptc255, + "128-255 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_256_511", + CTLFLAG_RD, &adapter->stats.ptc511, + "256-511 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_512_1023", + CTLFLAG_RD, &adapter->stats.ptc1023, + "512-1023 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_1024_1522", + CTLFLAG_RD, &adapter->stats.ptc1522, + "1024-1522 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tso_txd", + CTLFLAG_RD, &adapter->stats.tsctc, + "TSO Contexts Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tso_ctx_fail", + CTLFLAG_RD, &adapter->stats.tsctfc, + "TSO Contexts Failed"); + + + /* Interrupt Stats */ + + int_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "interrupts", + CTLFLAG_RD, NULL, "Interrupt Statistics"); + int_list = SYSCTL_CHILDREN(int_node); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "asserts", + CTLFLAG_RD, &adapter->stats.iac, + "Interrupt Assertion Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "rx_pkt_timer", + CTLFLAG_RD, &adapter->stats.icrxptc, + "Interrupt Cause Rx Pkt Timer Expire Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "rx_abs_timer", + CTLFLAG_RD, &adapter->stats.icrxatc, + "Interrupt Cause Rx Abs Timer Expire Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "tx_pkt_timer", + CTLFLAG_RD, &adapter->stats.ictxptc, + "Interrupt Cause Tx Pkt Timer Expire Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "tx_abs_timer", + CTLFLAG_RD, &adapter->stats.ictxatc, + "Interrupt Cause Tx Abs Timer Expire Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "tx_queue_empty", + CTLFLAG_RD, &adapter->stats.ictxqec, + "Interrupt Cause Tx Queue Empty Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "tx_queue_min_thresh", + CTLFLAG_RD, &adapter->stats.ictxqmtc, + "Interrupt Cause Tx Queue Min Thresh Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "rx_desc_min_thresh", + CTLFLAG_RD, &adapter->stats.icrxdmtc, + "Interrupt Cause Rx Desc Min Thresh Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "rx_overrun", + CTLFLAG_RD, &adapter->stats.icrxoc, + "Interrupt Cause Receiver Overrun Count"); + + /* Host to Card Stats */ + + host_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "host", + CTLFLAG_RD, NULL, + "Host to Card Statistics"); + + host_list = SYSCTL_CHILDREN(host_node); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_tx_pkt", + CTLFLAG_RD, &adapter->stats.cbtmpc, + "Circuit Breaker Tx Packet Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "host_tx_pkt_discard", + CTLFLAG_RD, &adapter->stats.htdpmc, + "Host Transmit Discarded Packets"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "rx_pkt", + CTLFLAG_RD, &adapter->stats.rpthc, + "Rx Packets To Host"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_rx_pkts", + CTLFLAG_RD, &adapter->stats.cbrmpc, + "Circuit Breaker Rx Packet Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_rx_pkt_drop", + CTLFLAG_RD, &adapter->stats.cbrdpc, + "Circuit Breaker Rx Dropped Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "tx_good_pkt", + CTLFLAG_RD, &adapter->stats.hgptc, + "Host Good Packets Tx Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_tx_pkt_drop", + CTLFLAG_RD, &adapter->stats.htcbdpc, + "Host Tx Circuit Breaker Dropped Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "rx_good_bytes", + CTLFLAG_RD, &adapter->stats.hgorc, + "Host Good Octets Received Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "tx_good_bytes", + CTLFLAG_RD, &adapter->stats.hgotc, + "Host Good Octets Transmit Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "length_errors", + CTLFLAG_RD, &adapter->stats.lenerrs, + "Length Errors"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "serdes_violation_pkt", + CTLFLAG_RD, &adapter->stats.scvpc, + "SerDes/SGMII Code Violation Pkt Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "header_redir_missed", + CTLFLAG_RD, &adapter->stats.hrmpc, + "Header Redirection Missed Packet Count"); + +} /********************************************************************** * * This routine provides a way to dump out the adapter eeprom, @@ -4928,28 +5193,8 @@ igb_print_hw_stats(struct adapter *adapt * 32 words, stuff that matters is in that extent. * **********************************************************************/ -static void -igb_print_nvm_info(struct adapter *adapter) -{ - u16 eeprom_data; - int i, j, row = 0; - - /* Its a bit crude, but it gets the job done */ - printf("\nInterface EEPROM Dump:\n"); - printf("Offset\n0x0000 "); - for (i = 0, j = 0; i < 32; i++, j++) { - if (j == 8) { /* Make the offset block */ - j = 0; ++row; - printf("\n0x00%x0 ",row); - } - e1000_read_nvm(&adapter->hw, i, 1, &eeprom_data); - printf("%04x ", eeprom_data); - } - printf("\n"); -} - static int -igb_sysctl_debug_info(SYSCTL_HANDLER_ARGS) +igb_sysctl_nvm_info(SYSCTL_HANDLER_ARGS) { struct adapter *adapter; int error; @@ -4961,16 +5206,12 @@ igb_sysctl_debug_info(SYSCTL_HANDLER_ARG if (error || !req->newptr) return (error); - if (result == 1) { - adapter = (struct adapter *)arg1; - igb_print_debug_info(adapter); - } /* * This value will cause a hex dump of the * first 32 16-bit words of the EEPROM to * the screen. */ - if (result == 2) { + if (result == 1) { adapter = (struct adapter *)arg1; igb_print_nvm_info(adapter); } @@ -4978,26 +5219,24 @@ igb_sysctl_debug_info(SYSCTL_HANDLER_ARG return (error); } - -static int -igb_sysctl_stats(SYSCTL_HANDLER_ARGS) +static void +igb_print_nvm_info(struct adapter *adapter) { - struct adapter *adapter; - int error; - int result; - - result = -1; - error = sysctl_handle_int(oidp, &result, 0, req); - - if (error || !req->newptr) - return (error); + u16 eeprom_data; + int i, j, row = 0; - if (result == 1) { - adapter = (struct adapter *)arg1; - igb_print_hw_stats(adapter); + /* Its a bit crude, but it gets the job done */ + printf("\nInterface EEPROM Dump:\n"); + printf("Offset\n0x0000 "); + for (i = 0, j = 0; i < 32; i++, j++) { + if (j == 8) { /* Make the offset block */ + j = 0; ++row; + printf("\n0x00%x0 ",row); + } + e1000_read_nvm(&adapter->hw, i, 1, &eeprom_data); + printf("%04x ", eeprom_data); } - - return (error); + printf("\n"); } static void Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Wed Jun 16 16:52:35 2010 (r209240) +++ head/sys/dev/e1000/if_igb.h Wed Jun 16 17:36:53 2010 (r209241) @@ -317,6 +317,9 @@ struct tx_ring { int watchdog_time; u64 no_desc_avail; u64 tx_packets; + /* Statistics for reporting, ONLY. */ + u32 tdh; /* Transmit Descriptor Head */ + u32 tdt; /* Transmit Descriptor Tail */ }; /* @@ -353,6 +356,9 @@ struct rx_ring { u64 rx_discarded; u64 rx_packets; u64 rx_bytes; + /* Statistics for reporting, ONLY. */ + u32 rdh; /* Transmit Descriptor Head */ + u32 rdt; /* Transmit Descriptor Tail */ }; struct adapter { @@ -426,6 +432,12 @@ struct adapter { unsigned long no_tx_dma_setup; unsigned long watchdog_events; unsigned long rx_overruns; + unsigned long device_control; + unsigned long rx_control; + unsigned long int_mask; + unsigned long eint_mask; + unsigned long packet_buf_alloc_rx; + unsigned long packet_buf_alloc_tx; boolean_t in_detach; From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 17:41: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 860841065670; Wed, 16 Jun 2010 17:41:31 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8E5DC8FC14; Wed, 16 Jun 2010 17:41:30 +0000 (UTC) Received: by vws20 with SMTP id 20so8870864vws.13 for ; Wed, 16 Jun 2010 10:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=IXsFVxGMU2TgAhA1sBeP25vBIZcZA1Ivi24au5gqG7A=; b=WBMdzBXzo6vx2YjGkoMjCKWoh0BYUp+Qt0/8lBhedSgaJIDEg55bGjN3KnYmTbFJxn kNg+3bZ0+pqrliz9kBpU3Zid9vplpBejn3Q/JIFLZ99Zp9DQ+Ju9Jnqn24XOX5BoXq29 iY8xvBuUHH73UU5rLLTLr+VGOkoe5PDDBZnOM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ZgGDE6aDWSfTgnWEgpAaE2h5bnT2vDVD1bThlxsn2iFPQksKEidx1UoDtgG8X/5TS/ rOhngw3iaiWKQbUKo2PwNahnDXnohW6/UhstnwDQnAVEwyFdffCUwfoNJpmpqG0E8pJs KGKDDUc2zD8HT11LZKdSf+D7vi3cjGvncF+5o= MIME-Version: 1.0 Received: by 10.224.43.16 with SMTP id u16mr4403333qae.115.1276710084654; Wed, 16 Jun 2010 10:41:24 -0700 (PDT) Received: by 10.229.246.65 with HTTP; Wed, 16 Jun 2010 10:41:24 -0700 (PDT) In-Reply-To: <201006161736.o5GHarDG068500@svn.freebsd.org> References: <201006161736.o5GHarDG068500@svn.freebsd.org> Date: Wed, 16 Jun 2010 10:41:24 -0700 Message-ID: From: Jack Vogel To: "George V. Neville-Neil" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209241 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2010 17:41:31 -0000 Awesome, look forward to checking this out, thanks much George!! Jack On Wed, Jun 16, 2010 at 10:36 AM, George V. Neville-Neil wrote: > Author: gnn > Date: Wed Jun 16 17:36:53 2010 > New Revision: 209241 > URL: http://svn.freebsd.org/changeset/base/209241 > > Log: > Move statistics into the sysctl tree making it easier to find > and use them. > Add previously hidden statistics, some of which include interrupt > and host/card communication counters. > > Modified: > head/sys/dev/e1000/if_igb.c > head/sys/dev/e1000/if_igb.h > > Modified: head/sys/dev/e1000/if_igb.c > > ============================================================================== > --- head/sys/dev/e1000/if_igb.c Wed Jun 16 16:52:35 2010 (r209240) > +++ head/sys/dev/e1000/if_igb.c Wed Jun 16 17:36:53 2010 (r209241) > @@ -212,7 +212,6 @@ static bool igb_tso_setup(struct tx_ring > static void igb_set_promisc(struct adapter *); > static void igb_disable_promisc(struct adapter *); > static void igb_set_multi(struct adapter *); > -static void igb_print_hw_stats(struct adapter *); > static void igb_update_link_status(struct adapter *); > static void igb_refresh_mbufs(struct rx_ring *, int); > > @@ -224,11 +223,10 @@ static int igb_xmit(struct tx_ring *, st > static int igb_dma_malloc(struct adapter *, bus_size_t, > struct igb_dma_alloc *, int); > static void igb_dma_free(struct adapter *, struct igb_dma_alloc *); > -static void igb_print_debug_info(struct adapter *); > +static int igb_sysctl_nvm_info(SYSCTL_HANDLER_ARGS); > static void igb_print_nvm_info(struct adapter *); > static int igb_is_valid_ether_addr(u8 *); > -static int igb_sysctl_stats(SYSCTL_HANDLER_ARGS); > -static int igb_sysctl_debug_info(SYSCTL_HANDLER_ARGS); > +static void igb_add_hw_stats(struct adapter *adapter); > /* Management and WOL Support */ > static void igb_init_manageability(struct adapter *); > static void igb_release_manageability(struct adapter *); > @@ -411,13 +409,8 @@ igb_attach(device_t dev) > /* SYSCTL stuff */ > SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), > SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), > - OID_AUTO, "debug", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, > - igb_sysctl_debug_info, "I", "Debug Information"); > - > - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), > - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), > - OID_AUTO, "stats", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, > - igb_sysctl_stats, "I", "Statistics"); > + OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, > + igb_sysctl_nvm_info, "I", "NVM Information"); > > SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), > SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), > @@ -583,6 +576,8 @@ igb_attach(device_t dev) > adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, > igb_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); > > + igb_add_hw_stats(adapter); > + > /* Tell the stack that the interface is not active */ > adapter->ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); > > @@ -1881,7 +1876,6 @@ static void > igb_local_timer(void *arg) > { > struct adapter *adapter = arg; > - struct ifnet *ifp = adapter->ifp; > device_t dev = adapter->dev; > struct tx_ring *txr = adapter->tx_rings; > > @@ -1891,9 +1885,6 @@ igb_local_timer(void *arg) > igb_update_link_status(adapter); > igb_update_stats_counters(adapter); > > - if (igb_display_debug_stats && ifp->if_drv_flags & IFF_DRV_RUNNING) > - igb_print_hw_stats(adapter); > - > /* > ** Watchdog: check for time since any descriptor was cleaned > */ > @@ -4741,8 +4732,10 @@ igb_update_stats_counters(struct adapter > /* For the 64-bit byte counters the low dword must be read first. */ > /* Both registers clear on the read of the high dword */ > > - adapter->stats.gorc += E1000_READ_REG(&adapter->hw, E1000_GORCH); > - adapter->stats.gotc += E1000_READ_REG(&adapter->hw, E1000_GOTCH); > + adapter->stats.gorc += E1000_READ_REG(&adapter->hw, E1000_GORCL) + > + ((u64)E1000_READ_REG(&adapter->hw, E1000_GORCH) << 32); > + adapter->stats.gotc += E1000_READ_REG(&adapter->hw, E1000_GOTCL) + > + ((u64)E1000_READ_REG(&adapter->hw, E1000_GOTCH) << 32) ; > > adapter->stats.rnbc += E1000_READ_REG(&adapter->hw, E1000_RNBC); > adapter->stats.ruc += E1000_READ_REG(&adapter->hw, E1000_RUC); > @@ -4764,6 +4757,38 @@ igb_update_stats_counters(struct adapter > adapter->stats.mptc += E1000_READ_REG(&adapter->hw, E1000_MPTC); > adapter->stats.bptc += E1000_READ_REG(&adapter->hw, E1000_BPTC); > > + /* Interrupt Counts */ > + > + adapter->stats.iac += E1000_READ_REG(&adapter->hw, E1000_IAC); > + adapter->stats.icrxptc += E1000_READ_REG(&adapter->hw, > E1000_ICRXPTC); > + adapter->stats.icrxatc += E1000_READ_REG(&adapter->hw, > E1000_ICRXATC); > + adapter->stats.ictxptc += E1000_READ_REG(&adapter->hw, > E1000_ICTXPTC); > + adapter->stats.ictxatc += E1000_READ_REG(&adapter->hw, > E1000_ICTXATC); > + adapter->stats.ictxqec += E1000_READ_REG(&adapter->hw, > E1000_ICTXQEC); > + adapter->stats.ictxqmtc += E1000_READ_REG(&adapter->hw, > E1000_ICTXQMTC); > + adapter->stats.icrxdmtc += E1000_READ_REG(&adapter->hw, > E1000_ICRXDMTC); > + adapter->stats.icrxoc += E1000_READ_REG(&adapter->hw, > E1000_ICRXOC); > + > + /* Host to Card Statistics */ > + > + adapter->stats.cbtmpc += E1000_READ_REG(&adapter->hw, > E1000_CBTMPC); > + adapter->stats.htdpmc += E1000_READ_REG(&adapter->hw, > E1000_HTDPMC); > + adapter->stats.cbrdpc += E1000_READ_REG(&adapter->hw, > E1000_CBRDPC); > + adapter->stats.cbrmpc += E1000_READ_REG(&adapter->hw, > E1000_CBRMPC); > + adapter->stats.rpthc += E1000_READ_REG(&adapter->hw, E1000_RPTHC); > + adapter->stats.hgptc += E1000_READ_REG(&adapter->hw, E1000_HGPTC); > + adapter->stats.htcbdpc += E1000_READ_REG(&adapter->hw, > E1000_HTCBDPC); > + adapter->stats.hgorc += (E1000_READ_REG(&adapter->hw, E1000_HGORCL) > + > + ((u64)E1000_READ_REG(&adapter->hw, > + E1000_HGORCH) << > 32)); > + > + adapter->stats.hgotc += (E1000_READ_REG(&adapter->hw, E1000_HGOTCL) > + > + ((u64)E1000_READ_REG(&adapter->hw, > + E1000_HGOTCH) << > 32)); > + adapter->stats.lenerrs += E1000_READ_REG(&adapter->hw, > E1000_LENERRS); > + adapter->stats.scvpc += E1000_READ_REG(&adapter->hw, E1000_SCVPC); > + adapter->stats.hrmpc += E1000_READ_REG(&adapter->hw, E1000_HRMPC); > + > adapter->stats.algnerrc += > E1000_READ_REG(&adapter->hw, E1000_ALGNERRC); > adapter->stats.rxerrc += > @@ -4792,135 +4817,375 @@ igb_update_stats_counters(struct adapter > } > > > -/********************************************************************** > - * > - * This routine is called only when igb_display_debug_stats is enabled. > - * This routine provides a way to take a look at important statistics > - * maintained by the driver and hardware. > - * > - **********************************************************************/ > +/* > + * Add sysctl variables, one per statistic, to the system. > + */ > static void > -igb_print_debug_info(struct adapter *adapter) > +igb_add_hw_stats(struct adapter *adapter) > { > + > device_t dev = adapter->dev; > - struct igb_queue *que = adapter->queues; > - struct rx_ring *rxr = adapter->rx_rings; > - struct tx_ring *txr = adapter->tx_rings; > - uint8_t *hw_addr = adapter->hw.hw_addr; > > - device_printf(dev, "Adapter hardware address = %p \n", hw_addr); > - device_printf(dev, "CTRL = 0x%x RCTL = 0x%x \n", > - E1000_READ_REG(&adapter->hw, E1000_CTRL), > - E1000_READ_REG(&adapter->hw, E1000_RCTL)); > - > -#if (DEBUG_HW > 0) /* Dont output these errors normally */ > - device_printf(dev, "IMS = 0x%x EIMS = 0x%x \n", > - E1000_READ_REG(&adapter->hw, E1000_IMS), > - E1000_READ_REG(&adapter->hw, E1000_EIMS)); > -#endif > + struct tx_ring *txr = adapter->tx_rings; > + struct rx_ring *rxr = adapter->rx_rings; > > - device_printf(dev, "Packet buffer = Tx=%dk Rx=%dk \n", > - ((E1000_READ_REG(&adapter->hw, E1000_PBA) & 0xffff0000) >> > 16),\ > - (E1000_READ_REG(&adapter->hw, E1000_PBA) & 0xffff) ); > - device_printf(dev, "Flow control watermarks high = %d low = %d\n", > - adapter->hw.fc.high_water, > - adapter->hw.fc.low_water); > + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); > + struct sysctl_oid *tree = device_get_sysctl_tree(dev); > + struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); > + struct e1000_hw_stats *stats = &adapter->stats; > + > + struct sysctl_oid *stat_node, *queue_node, *int_node, *host_node; > + struct sysctl_oid_list *stat_list, *queue_list, *int_list, > *host_list; > + > +#define QUEUE_NAME_LEN 32 > + char namebuf[QUEUE_NAME_LEN]; > + > + /* Driver Statistics */ > + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "link_irq", > + CTLFLAG_RD, &adapter->link_irq, 0, > + "Link MSIX IRQ Handled"); > + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "dropped", > + CTLFLAG_RD, &adapter->dropped_pkts, > + "Driver dropped packets"); > + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_dma_fail", > + CTLFLAG_RD, &adapter->no_tx_dma_setup, > + "Driver tx dma failure in xmit"); > + > + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "device_control", > + CTLFLAG_RD, &adapter->device_control, > + "Device Control Register"); > + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "rx_control", > + CTLFLAG_RD, &adapter->rx_control, > + "Receiver Control Register"); > + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "interrupt_mask", > + CTLFLAG_RD, &adapter->int_mask, > + "Interrupt Mask"); > + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "extended_int_mask", > + CTLFLAG_RD, &adapter->eint_mask, > + "Extended Interrupt Mask"); > + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_buf_alloc", > + CTLFLAG_RD, &adapter->packet_buf_alloc_tx, > + "Transmit Buffer Packet Allocation"); > + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "rx_buf_alloc", > + CTLFLAG_RD, &adapter->packet_buf_alloc_rx, > + "Receive Buffer Packet Allocation"); > + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_high_water", > + CTLFLAG_RD, &adapter->hw.fc.high_water, 0, > + "Flow Control High Watermark"); > + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_low_water", > + CTLFLAG_RD, &adapter->hw.fc.low_water, 0, > + "Flow Control Low Watermark"); > > for (int i = 0; i < adapter->num_queues; i++, txr++) { > - device_printf(dev, "Queue(%d) tdh = %d, tdt = %d ", i, > - E1000_READ_REG(&adapter->hw, E1000_TDH(i)), > - E1000_READ_REG(&adapter->hw, E1000_TDT(i))); > - device_printf(dev, "TX(%d) no descriptors = %lld\n", > - txr->me, (long long)txr->no_desc_avail); > - device_printf(dev, "TX(%d) Packets sent = %lld\n", > - txr->me, (long long)txr->tx_packets); > + snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i); > + queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, > + CTLFLAG_RD, NULL, "Queue > Name"); > + queue_list = SYSCTL_CHILDREN(queue_node); > + > + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "txd_head", > + CTLFLAG_RD, &txr->tdh, 0, > + "Transmit Descriptor Head"); > + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "txd_tail", > + CTLFLAG_RD, &txr->tdt, 0, > + "Transmit Descriptor Tail"); > + SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "no_desc_avail", > + CTLFLAG_RD, &txr->no_desc_avail, > + "Queue No Descriptor Available"); > + SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "tx_packets", > + CTLFLAG_RD, &txr->tx_packets, > + "Queue Packets Transmitted"); > } > > for (int i = 0; i < adapter->num_queues; i++, rxr++) { > struct lro_ctrl *lro = &rxr->lro; > - device_printf(dev, "Queue(%d) rdh = %d, rdt = %d\n", i, > - E1000_READ_REG(&adapter->hw, E1000_RDH(i)), > - E1000_READ_REG(&adapter->hw, E1000_RDT(i))); > - device_printf(dev, "RX(%d) Packets received = %lld\n", > rxr->me, > - (long long)rxr->rx_packets); > - device_printf(dev, " Split Packets = %lld ", > - (long long)rxr->rx_split_packets); > - device_printf(dev, " Byte count = %lld\n", > - (long long)rxr->rx_bytes); > - device_printf(dev,"RX(%d) LRO Queued= %d ", > - i, lro->lro_queued); > - device_printf(dev,"LRO Flushed= %d\n",lro->lro_flushed); > - } > - > - for (int i = 0; i < adapter->num_queues; i++, que++) > - device_printf(dev,"QUE(%d) IRQs = %lld\n", > - i, (long long)que->irqs); > - > - device_printf(dev, "LINK MSIX IRQ Handled = %u\n", > adapter->link_irq); > - device_printf(dev, "Mbuf defrag failed = %ld\n", > - adapter->mbuf_defrag_failed); > - device_printf(dev, "Std mbuf header failed = %ld\n", > - adapter->mbuf_header_failed); > - device_printf(dev, "Std mbuf packet failed = %ld\n", > - adapter->mbuf_packet_failed); > - device_printf(dev, "Driver dropped packets = %ld\n", > - adapter->dropped_pkts); > - device_printf(dev, "Driver tx dma failure in xmit = %ld\n", > - adapter->no_tx_dma_setup); > -} > > -static void > -igb_print_hw_stats(struct adapter *adapter) > -{ > - device_t dev = adapter->dev; > + snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i); > + queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, > + CTLFLAG_RD, NULL, "Queue > Name"); > + queue_list = SYSCTL_CHILDREN(queue_node); > + > + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "rxd_head", > + CTLFLAG_RD, &rxr->rdh, 0, > + "Receive Descriptor Head"); > + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "rxd_tail", > + CTLFLAG_RD, &rxr->rdt, 0, > + "Receive Descriptor Tail"); > + SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "rx_packets", > + CTLFLAG_RD, &rxr->rx_packets, > + "Queue Packets Received"); > + SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "rx_bytes", > + CTLFLAG_RD, &rxr->rx_bytes, > + "Queue Bytes Received"); > + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "lro_queued", > + CTLFLAG_RD, &lro->lro_queued, 0, > + "LRO Queued"); > + SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "lro_flushed", > + CTLFLAG_RD, &lro->lro_flushed, 0, > + "LRO Flushed"); > + } > + > + /* MAC stats get the own sub node */ > + > + stat_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "mac_stats", > + CTLFLAG_RD, NULL, "MAC Statistics"); > + stat_list = SYSCTL_CHILDREN(stat_node); > + > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "excess_coll", > + CTLFLAG_RD, &stats->ecol, > + "Excessive collisions"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "single_coll", > + CTLFLAG_RD, &stats->scc, > + "Single collisions"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "multiple_coll", > + CTLFLAG_RD, &stats->mcc, > + "Multiple collisions"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "late_coll", > + CTLFLAG_RD, &stats->latecol, > + "Late collisions"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "collision_count", > + CTLFLAG_RD, &stats->colc, > + "Collision Count"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "symbol_errors", > + CTLFLAG_RD, &adapter->stats.symerrs, > + "Symbol Errors"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "sequence_errors", > + CTLFLAG_RD, &adapter->stats.sec, > + "Sequence Errors"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "defer_count", > + CTLFLAG_RD, &adapter->stats.dc, > + "Defer Count"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "missed_packets", > + CTLFLAG_RD, &adapter->stats.mpc, > + "Missed Packets"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_no_buff", > + CTLFLAG_RD, &adapter->stats.rnbc, > + "Receive No Buffers"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_undersize", > + CTLFLAG_RD, &adapter->stats.ruc, > + "Receive Undersize"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_fragmented", > + CTLFLAG_RD, &adapter->stats.rfc, > + "Fragmented Packets Received "); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_oversize", > + CTLFLAG_RD, &adapter->stats.roc, > + "Oversized Packets Received"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_jabber", > + CTLFLAG_RD, &adapter->stats.rjc, > + "Recevied Jabber"); > > - device_printf(dev, "Excessive collisions = %lld\n", > - (long long)adapter->stats.ecol); > -#if (DEBUG_HW > 0) /* Dont output these errors normally */ > - device_printf(dev, "Symbol errors = %lld\n", > - (long long)adapter->stats.symerrs); > -#endif > - device_printf(dev, "Sequence errors = %lld\n", > - (long long)adapter->stats.sec); > - device_printf(dev, "Defer count = %lld\n", > - (long long)adapter->stats.dc); > - device_printf(dev, "Missed Packets = %lld\n", > - (long long)adapter->stats.mpc); > - device_printf(dev, "Receive No Buffers = %lld\n", > - (long long)adapter->stats.rnbc); > /* RLEC is inaccurate on some hardware, calculate our own. */ > - device_printf(dev, "Receive Length Errors = %lld\n", > - ((long long)adapter->stats.roc + (long > long)adapter->stats.ruc)); > - device_printf(dev, "Receive errors = %lld\n", > - (long long)adapter->stats.rxerrc); > - device_printf(dev, "Crc errors = %lld\n", > - (long long)adapter->stats.crcerrs); > - device_printf(dev, "Alignment errors = %lld\n", > - (long long)adapter->stats.algnerrc); > +/* SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_len_errs", */ > +/* CTLFLAG_RD, adapter->stats.roc + > adapter->stats.ruc, */ > +/* "Receive Length Errors"); */ > + > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_errs", > + CTLFLAG_RD, &adapter->stats.rxerrc, > + "Receive Errors"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "crc_errs", > + CTLFLAG_RD, &adapter->stats.crcerrs, > + "CRC errors"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "alignment_errs", > + CTLFLAG_RD, &adapter->stats.algnerrc, > + "Alignment Errors"); > /* On 82575 these are collision counts */ > - device_printf(dev, "Collision/Carrier extension errors = %lld\n", > - (long long)adapter->stats.cexterr); > - device_printf(dev, "RX overruns = %ld\n", adapter->rx_overruns); > - device_printf(dev, "watchdog timeouts = %ld\n", > - adapter->watchdog_events); > - device_printf(dev, "XON Rcvd = %lld\n", > - (long long)adapter->stats.xonrxc); > - device_printf(dev, "XON Xmtd = %lld\n", > - (long long)adapter->stats.xontxc); > - device_printf(dev, "XOFF Rcvd = %lld\n", > - (long long)adapter->stats.xoffrxc); > - device_printf(dev, "XOFF Xmtd = %lld\n", > - (long long)adapter->stats.xofftxc); > - device_printf(dev, "Good Packets Rcvd = %lld\n", > - (long long)adapter->stats.gprc); > - device_printf(dev, "Good Packets Xmtd = %lld\n", > - (long long)adapter->stats.gptc); > - device_printf(dev, "TSO Contexts Xmtd = %lld\n", > - (long long)adapter->stats.tsctc); > - device_printf(dev, "TSO Contexts Failed = %lld\n", > - (long long)adapter->stats.tsctfc); > -} > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "coll_ext_errs", > + CTLFLAG_RD, &adapter->stats.cexterr, > + "Collision/Carrier extension errors"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_overruns", > + CTLFLAG_RD, &adapter->rx_overruns, > + "RX overruns"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "watchdog_timeouts", > + CTLFLAG_RD, &adapter->watchdog_events, > + "Watchdog timeouts"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xon_recvd", > + CTLFLAG_RD, &adapter->stats.xonrxc, > + "XON Received"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xon_txd", > + CTLFLAG_RD, &adapter->stats.xontxc, > + "XON Transmitted"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xoff_recvd", > + CTLFLAG_RD, &adapter->stats.xoffrxc, > + "XOFF Received"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xoff_txd", > + CTLFLAG_RD, &adapter->stats.xofftxc, > + "XOFF Transmitted"); > + /* Packet Reception Stats */ > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_recvd", > + CTLFLAG_RD, &adapter->stats.tpr, > + "Total Packets Received "); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_recvd", > + CTLFLAG_RD, &adapter->stats.gprc, > + "Good Packets Received"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "bcast_pkts_recvd", > + CTLFLAG_RD, &adapter->stats.bprc, > + "Broadcast Packets Received"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mcast_pkts_recvd", > + CTLFLAG_RD, &adapter->stats.mprc, > + "Multicast Packets Received"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_64", > + CTLFLAG_RD, &adapter->stats.prc64, > + "64 byte frames received "); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_65_127", > + CTLFLAG_RD, &adapter->stats.prc127, > + "65-127 byte frames received"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_128_255", > + CTLFLAG_RD, &adapter->stats.prc255, > + "128-255 byte frames received"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_256_511", > + CTLFLAG_RD, &adapter->stats.prc511, > + "256-511 byte frames received"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_512_1023", > + CTLFLAG_RD, &adapter->stats.prc1023, > + "512-1023 byte frames received"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_1024_1522", > + CTLFLAG_RD, &adapter->stats.prc1522, > + "1023-1522 byte frames received"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_recvd", > + CTLFLAG_RD, &adapter->stats.gorc, > + "Good Octets Received"); > + > + /* Packet Transmission Stats */ > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octest_txd", > + CTLFLAG_RD, &adapter->stats.gotc, > + "Good Octest Transmitted"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_txd", > + CTLFLAG_RD, &adapter->stats.tpt, > + "Total Packets Transmitted"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_txd", > + CTLFLAG_RD, &adapter->stats.gptc, > + "Good Packets Transmitted"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "bcast_pkts_txd", > + CTLFLAG_RD, &adapter->stats.bptc, > + "Broadcast Packets Transmitted"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mcast_pkts_txd", > + CTLFLAG_RD, &adapter->stats.mptc, > + "Multicast Packets Transmitted"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_64", > + CTLFLAG_RD, &adapter->stats.ptc64, > + "64 byte frames transmitted "); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_65_127", > + CTLFLAG_RD, &adapter->stats.ptc127, > + "65-127 byte frames transmitted"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_128_255", > + CTLFLAG_RD, &adapter->stats.ptc255, > + "128-255 byte frames transmitted"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_256_511", > + CTLFLAG_RD, &adapter->stats.ptc511, > + "256-511 byte frames transmitted"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_512_1023", > + CTLFLAG_RD, &adapter->stats.ptc1023, > + "512-1023 byte frames transmitted"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_1024_1522", > + CTLFLAG_RD, &adapter->stats.ptc1522, > + "1024-1522 byte frames transmitted"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tso_txd", > + CTLFLAG_RD, &adapter->stats.tsctc, > + "TSO Contexts Transmitted"); > + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tso_ctx_fail", > + CTLFLAG_RD, &adapter->stats.tsctfc, > + "TSO Contexts Failed"); > + > + > + /* Interrupt Stats */ > + > + int_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "interrupts", > + CTLFLAG_RD, NULL, "Interrupt > Statistics"); > + int_list = SYSCTL_CHILDREN(int_node); > + > + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "asserts", > + CTLFLAG_RD, &adapter->stats.iac, > + "Interrupt Assertion Count"); > + > + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "rx_pkt_timer", > + CTLFLAG_RD, &adapter->stats.icrxptc, > + "Interrupt Cause Rx Pkt Timer Expire Count"); > + > + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "rx_abs_timer", > + CTLFLAG_RD, &adapter->stats.icrxatc, > + "Interrupt Cause Rx Abs Timer Expire Count"); > + > + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "tx_pkt_timer", > + CTLFLAG_RD, &adapter->stats.ictxptc, > + "Interrupt Cause Tx Pkt Timer Expire Count"); > + > + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "tx_abs_timer", > + CTLFLAG_RD, &adapter->stats.ictxatc, > + "Interrupt Cause Tx Abs Timer Expire Count"); > + > + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "tx_queue_empty", > + CTLFLAG_RD, &adapter->stats.ictxqec, > + "Interrupt Cause Tx Queue Empty Count"); > + > + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "tx_queue_min_thresh", > + CTLFLAG_RD, &adapter->stats.ictxqmtc, > + "Interrupt Cause Tx Queue Min Thresh Count"); > + > + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "rx_desc_min_thresh", > + CTLFLAG_RD, &adapter->stats.icrxdmtc, > + "Interrupt Cause Rx Desc Min Thresh Count"); > + > + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "rx_overrun", > + CTLFLAG_RD, &adapter->stats.icrxoc, > + "Interrupt Cause Receiver Overrun Count"); > + > + /* Host to Card Stats */ > + > + host_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "host", > + CTLFLAG_RD, NULL, > + "Host to Card Statistics"); > + > + host_list = SYSCTL_CHILDREN(host_node); > + > + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_tx_pkt", > + CTLFLAG_RD, &adapter->stats.cbtmpc, > + "Circuit Breaker Tx Packet Count"); > + > + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "host_tx_pkt_discard", > + CTLFLAG_RD, &adapter->stats.htdpmc, > + "Host Transmit Discarded Packets"); > + > + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "rx_pkt", > + CTLFLAG_RD, &adapter->stats.rpthc, > + "Rx Packets To Host"); > + > + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_rx_pkts", > + CTLFLAG_RD, &adapter->stats.cbrmpc, > + "Circuit Breaker Rx Packet Count"); > + > + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_rx_pkt_drop", > + CTLFLAG_RD, &adapter->stats.cbrdpc, > + "Circuit Breaker Rx Dropped Count"); > + > + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "tx_good_pkt", > + CTLFLAG_RD, &adapter->stats.hgptc, > + "Host Good Packets Tx Count"); > + > + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_tx_pkt_drop", > + CTLFLAG_RD, &adapter->stats.htcbdpc, > + "Host Tx Circuit Breaker Dropped Count"); > + > + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "rx_good_bytes", > + CTLFLAG_RD, &adapter->stats.hgorc, > + "Host Good Octets Received Count"); > + > + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "tx_good_bytes", > + CTLFLAG_RD, &adapter->stats.hgotc, > + "Host Good Octets Transmit Count"); > + > + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "length_errors", > + CTLFLAG_RD, &adapter->stats.lenerrs, > + "Length Errors"); > + > + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "serdes_violation_pkt", > + CTLFLAG_RD, &adapter->stats.scvpc, > + "SerDes/SGMII Code Violation Pkt Count"); > + > + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "header_redir_missed", > + CTLFLAG_RD, &adapter->stats.hrmpc, > + "Header Redirection Missed Packet Count"); > > + > +} > /********************************************************************** > * > * This routine provides a way to dump out the adapter eeprom, > @@ -4928,28 +5193,8 @@ igb_print_hw_stats(struct adapter *adapt > * 32 words, stuff that matters is in that extent. > * > **********************************************************************/ > -static void > -igb_print_nvm_info(struct adapter *adapter) > -{ > - u16 eeprom_data; > - int i, j, row = 0; > - > - /* Its a bit crude, but it gets the job done */ > - printf("\nInterface EEPROM Dump:\n"); > - printf("Offset\n0x0000 "); > - for (i = 0, j = 0; i < 32; i++, j++) { > - if (j == 8) { /* Make the offset block */ > - j = 0; ++row; > - printf("\n0x00%x0 ",row); > - } > - e1000_read_nvm(&adapter->hw, i, 1, &eeprom_data); > - printf("%04x ", eeprom_data); > - } > - printf("\n"); > -} > - > static int > -igb_sysctl_debug_info(SYSCTL_HANDLER_ARGS) > +igb_sysctl_nvm_info(SYSCTL_HANDLER_ARGS) > { > struct adapter *adapter; > int error; > @@ -4961,16 +5206,12 @@ igb_sysctl_debug_info(SYSCTL_HANDLER_ARG > if (error || !req->newptr) > return (error); > > - if (result == 1) { > - adapter = (struct adapter *)arg1; > - igb_print_debug_info(adapter); > - } > /* > * This value will cause a hex dump of the > * first 32 16-bit words of the EEPROM to > * the screen. > */ > - if (result == 2) { > + if (result == 1) { > adapter = (struct adapter *)arg1; > igb_print_nvm_info(adapter); > } > @@ -4978,26 +5219,24 @@ igb_sysctl_debug_info(SYSCTL_HANDLER_ARG > return (error); > } > > - > -static int > -igb_sysctl_stats(SYSCTL_HANDLER_ARGS) > +static void > +igb_print_nvm_info(struct adapter *adapter) > { > - struct adapter *adapter; > - int error; > - int result; > - > - result = -1; > - error = sysctl_handle_int(oidp, &result, 0, req); > - > - if (error || !req->newptr) > - return (error); > + u16 eeprom_data; > + int i, j, row = 0; > > - if (result == 1) { > - adapter = (struct adapter *)arg1; > - igb_print_hw_stats(adapter); > + /* Its a bit crude, but it gets the job done */ > + printf("\nInterface EEPROM Dump:\n"); > + printf("Offset\n0x0000 "); > + for (i = 0, j = 0; i < 32; i++, j++) { > + if (j == 8) { /* Make the offset block */ > + j = 0; ++row; > + printf("\n0x00%x0 ",row); > + } > + e1000_read_nvm(&adapter->hw, i, 1, &eeprom_data); > + printf("%04x ", eeprom_data); > } > - > - return (error); > + printf("\n"); > } > > static void > > Modified: head/sys/dev/e1000/if_igb.h > > ============================================================================== > --- head/sys/dev/e1000/if_igb.h Wed Jun 16 16:52:35 2010 (r209240) > +++ head/sys/dev/e1000/if_igb.h Wed Jun 16 17:36:53 2010 (r209241) > @@ -317,6 +317,9 @@ struct tx_ring { > int watchdog_time; > u64 no_desc_avail; > u64 tx_packets; > + /* Statistics for reporting, ONLY. */ > + u32 tdh; /* Transmit Descriptor Head */ > + u32 tdt; /* Transmit Descriptor Tail */ > }; > > /* > @@ -353,6 +356,9 @@ struct rx_ring { > u64 rx_discarded; > u64 rx_packets; > u64 rx_bytes; > + /* Statistics for reporting, ONLY. */ > + u32 rdh; /* Transmit Descriptor Head */ > + u32 rdt; /* Transmit Descriptor Tail */ > }; > > struct adapter { > @@ -426,6 +432,12 @@ struct adapter { > unsigned long no_tx_dma_setup; > unsigned long watchdog_events; > unsigned long rx_overruns; > + unsigned long device_control; > + unsigned long rx_control; > + unsigned long int_mask; > + unsigned long eint_mask; > + unsigned long packet_buf_alloc_rx; > + unsigned long packet_buf_alloc_tx; > > boolean_t in_detach; > > From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 20:57: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 4AC4F1065677; Wed, 16 Jun 2010 20:57:42 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 381068FC14; Wed, 16 Jun 2010 20:57: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 o5GKvgZ8013379; Wed, 16 Jun 2010 20:57:42 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5GKvgYi013377; Wed, 16 Jun 2010 20:57:42 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201006162057.o5GKvgYi013377@svn.freebsd.org> From: "George V. Neville-Neil" Date: Wed, 16 Jun 2010 20:57: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: r209242 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2010 20:57:42 -0000 Author: gnn Date: Wed Jun 16 20:57:41 2010 New Revision: 209242 URL: http://svn.freebsd.org/changeset/base/209242 Log: Move statistics into the sysctl tree making it easier to find and use them. Add previously hidden statistics, some of which include interrupt and host/card communication counters. Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Jun 16 17:36:53 2010 (r209241) +++ head/sys/dev/e1000/if_em.c Wed Jun 16 20:57:41 2010 (r209242) @@ -230,6 +230,7 @@ static void em_free_receive_buffers(stru static void em_enable_intr(struct adapter *); static void em_disable_intr(struct adapter *); static void em_update_stats_counters(struct adapter *); +static void em_add_hw_stats(struct adapter *adapter); static bool em_txeof(struct tx_ring *); static bool em_rxeof(struct rx_ring *, int, int *); #ifndef __NO_STRICT_ALIGNMENT @@ -242,7 +243,6 @@ static bool em_tso_setup(struct tx_ring static void em_set_promisc(struct adapter *); static void em_disable_promisc(struct adapter *); static void em_set_multi(struct adapter *); -static void em_print_hw_stats(struct adapter *); static void em_update_link_status(struct adapter *); static void em_refresh_mbufs(struct rx_ring *, int); static void em_register_vlan(void *, struct ifnet *, u16); @@ -252,11 +252,9 @@ static int em_xmit(struct tx_ring *, str static int em_dma_malloc(struct adapter *, bus_size_t, struct em_dma_alloc *, int); static void em_dma_free(struct adapter *, struct em_dma_alloc *); -static void em_print_debug_info(struct adapter *); +static int em_sysctl_nvm_info(SYSCTL_HANDLER_ARGS); static void em_print_nvm_info(struct adapter *); static int em_is_valid_ether_addr(u8 *); -static int em_sysctl_stats(SYSCTL_HANDLER_ARGS); -static int em_sysctl_debug_info(SYSCTL_HANDLER_ARGS); static int em_sysctl_int_delay(SYSCTL_HANDLER_ARGS); static void em_add_int_delay_sysctl(struct adapter *, const char *, const char *, struct em_int_delay_info *, int, int); @@ -452,13 +450,8 @@ em_attach(device_t dev) /* SYSCTL stuff */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "debug", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, - em_sysctl_debug_info, "I", "Debug Information"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "stats", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, - em_sysctl_stats, "I", "Statistics"); + OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, + em_sysctl_nvm_info, "I", "NVM Information"); callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0); @@ -656,6 +649,8 @@ em_attach(device_t dev) adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, em_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); + em_add_hw_stats(adapter); + /* Non-AMT based hardware can now take control from firmware */ if (adapter->has_manage && !adapter->has_amt) em_get_hw_control(adapter); @@ -2068,9 +2063,6 @@ em_local_timer(void *arg) if (e1000_get_laa_state_82571(&adapter->hw) == TRUE) e1000_rar_set(&adapter->hw, adapter->hw.mac.addr, 0); - if (em_display_debug_stats && ifp->if_drv_flags & IFF_DRV_RUNNING) - em_print_hw_stats(adapter); - /* ** Check for time since any descriptor was cleaned */ @@ -4867,114 +4859,291 @@ em_update_stats_counters(struct adapter } -/********************************************************************** - * - * This routine is called only when em_display_debug_stats is enabled. - * This routine provides a way to take a look at important statistics - * maintained by the driver and hardware. - * - **********************************************************************/ +/* + * Add sysctl variables, one per statistic, to the system. + */ static void -em_print_debug_info(struct adapter *adapter) +em_add_hw_stats(struct adapter *adapter) { + device_t dev = adapter->dev; - u8 *hw_addr = adapter->hw.hw_addr; - struct rx_ring *rxr = adapter->rx_rings; - struct tx_ring *txr = adapter->tx_rings; - device_printf(dev, "Adapter hardware address = %p \n", hw_addr); - device_printf(dev, "CTRL = 0x%x RCTL = 0x%x \n", - E1000_READ_REG(&adapter->hw, E1000_CTRL), - E1000_READ_REG(&adapter->hw, E1000_RCTL)); - device_printf(dev, "Packet buffer = Tx=%dk Rx=%dk \n", - ((E1000_READ_REG(&adapter->hw, E1000_PBA) & 0xffff0000) >> 16),\ - (E1000_READ_REG(&adapter->hw, E1000_PBA) & 0xffff) ); - device_printf(dev, "Flow control watermarks high = %d low = %d\n", - adapter->hw.fc.high_water, - adapter->hw.fc.low_water); - device_printf(dev, "tx_int_delay = %d, tx_abs_int_delay = %d\n", - E1000_READ_REG(&adapter->hw, E1000_TIDV), - E1000_READ_REG(&adapter->hw, E1000_TADV)); - device_printf(dev, "rx_int_delay = %d, rx_abs_int_delay = %d\n", - E1000_READ_REG(&adapter->hw, E1000_RDTR), - E1000_READ_REG(&adapter->hw, E1000_RADV)); + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); + struct sysctl_oid *tree = device_get_sysctl_tree(dev); + struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); + struct e1000_hw_stats *stats = &adapter->stats; + + struct sysctl_oid *stat_node, *int_node, *host_node; + struct sysctl_oid_list *stat_list, *int_list, *host_list; + + /* Driver Statistics */ + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "link_irq", + CTLFLAG_RD, &adapter->link_irq, 0, + "Link MSIX IRQ Handled"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_alloc_fail", + CTLFLAG_RD, &adapter->mbuf_alloc_failed, + "Std mbuf failed"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "cluster_alloc_fail", + CTLFLAG_RD, &adapter->mbuf_cluster_failed, + "Std mbuf cluster failed"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "dropped", + CTLFLAG_RD, &adapter->dropped_pkts, + "Driver dropped packets"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_dma_fail", + CTLFLAG_RD, &adapter->no_tx_dma_setup, + "Driver tx dma failure in xmit"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_high_water", + CTLFLAG_RD, &adapter->hw.fc.high_water, 0, + "Flow Control High Watermark"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_low_water", + CTLFLAG_RD, &adapter->hw.fc.low_water, 0, + "Flow Control Low Watermark"); + + /* MAC stats get the own sub node */ + + stat_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "mac_stats", + CTLFLAG_RD, NULL, "Statistics"); + stat_list = SYSCTL_CHILDREN(stat_node); + + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "excess_coll", + CTLFLAG_RD, &stats->ecol, + "Excessive collisions"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "symbol_errors", + CTLFLAG_RD, &adapter->stats.symerrs, + "Symbol Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "sequence_errors", + CTLFLAG_RD, &adapter->stats.sec, + "Sequence Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "defer_count", + CTLFLAG_RD, &adapter->stats.dc, + "Defer Count"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "missed_packets", + CTLFLAG_RD, &adapter->stats.mpc, + "Missed Packets"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_no_buff", + CTLFLAG_RD, &adapter->stats.rnbc, + "Receive No Buffers"); + /* RLEC is inaccurate on some hardware, calculate our own. */ +/* SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_len_errs", */ +/* CTLFLAG_RD, adapter->stats.roc + adapter->stats.ruc, */ +/* "Receive Length Errors"); */ + + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "recv_errs", + CTLFLAG_RD, &adapter->stats.rxerrc, + "Receive Errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "crc_errs", + CTLFLAG_RD, &adapter->stats.crcerrs, + "CRC errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "alignment_errs", + CTLFLAG_RD, &adapter->stats.algnerrc, + "Alignment Errors"); + /* On 82575 these are collision counts */ + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "coll_ext_errs", + CTLFLAG_RD, &adapter->stats.cexterr, + "Collision/Carrier extension errors"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_overruns", + CTLFLAG_RD, &adapter->rx_overruns, + "RX overruns"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "watchdog_timeouts", + CTLFLAG_RD, &adapter->watchdog_events, + "Watchdog timeouts"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xon_recvd", + CTLFLAG_RD, &adapter->stats.xonrxc, + "XON Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xon_txd", + CTLFLAG_RD, &adapter->stats.xontxc, + "XON Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xoff_recvd", + CTLFLAG_RD, &adapter->stats.xoffrxc, + "XOFF Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xoff_txd", + CTLFLAG_RD, &adapter->stats.xofftxc, + "XOFF Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_recvd", + CTLFLAG_RD, &adapter->stats.gprc, + "Good Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_txd", + CTLFLAG_RD, &adapter->stats.gptc, + "Good Packets Transmitted"); + + /* Packet Reception Stats */ + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_recvd", + CTLFLAG_RD, &adapter->stats.tpr, + "Total Packets Received "); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_recvd", + CTLFLAG_RD, &adapter->stats.gprc, + "Good Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "bcast_pkts_recvd", + CTLFLAG_RD, &adapter->stats.bprc, + "Broadcast Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mcast_pkts_recvd", + CTLFLAG_RD, &adapter->stats.mprc, + "Multicast Packets Received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_64", + CTLFLAG_RD, &adapter->stats.prc64, + "64 byte frames received "); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_65_127", + CTLFLAG_RD, &adapter->stats.prc127, + "65-127 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_128_255", + CTLFLAG_RD, &adapter->stats.prc255, + "128-255 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_256_511", + CTLFLAG_RD, &adapter->stats.prc511, + "256-511 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_512_1023", + CTLFLAG_RD, &adapter->stats.prc1023, + "512-1023 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "rx_frames_1024_1522", + CTLFLAG_RD, &adapter->stats.prc1522, + "1023-1522 byte frames received"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octets_recvd", + CTLFLAG_RD, &adapter->stats.gorc, + "Good Octets Received"); + + /* Packet Transmission Stats */ + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_octest_txd", + CTLFLAG_RD, &adapter->stats.gotc, + "Good Octest Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_txd", + CTLFLAG_RD, &adapter->stats.tpt, + "Total Packets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_txd", + CTLFLAG_RD, &adapter->stats.gptc, + "Good Packets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "bcast_pkts_txd", + CTLFLAG_RD, &adapter->stats.bptc, + "Broadcast Packets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "mcast_pkts_txd", + CTLFLAG_RD, &adapter->stats.mptc, + "Multicast Packets Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_64", + CTLFLAG_RD, &adapter->stats.ptc64, + "64 byte frames transmitted "); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_65_127", + CTLFLAG_RD, &adapter->stats.ptc127, + "65-127 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_128_255", + CTLFLAG_RD, &adapter->stats.ptc255, + "128-255 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_256_511", + CTLFLAG_RD, &adapter->stats.ptc511, + "256-511 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_512_1023", + CTLFLAG_RD, &adapter->stats.ptc1023, + "512-1023 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tx_frames_1024_1522", + CTLFLAG_RD, &adapter->stats.ptc1522, + "1024-1522 byte frames transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tso_txd", + CTLFLAG_RD, &adapter->stats.tsctc, + "TSO Contexts Transmitted"); + SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "tso_ctx_fail", + CTLFLAG_RD, &adapter->stats.tsctfc, + "TSO Contexts Failed"); + + + /* Interrupt Stats */ + + int_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "interrupts", + CTLFLAG_RD, NULL, "Interrupt Statistics"); + int_list = SYSCTL_CHILDREN(int_node); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "asserts", + CTLFLAG_RD, &adapter->stats.iac, + "Interrupt Assertion Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "rx_pkt_timer", + CTLFLAG_RD, &adapter->stats.icrxptc, + "Interrupt Cause Rx Pkt Timer Expire Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "rx_abs_timer", + CTLFLAG_RD, &adapter->stats.icrxatc, + "Interrupt Cause Rx Abs Timer Expire Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "tx_pkt_timer", + CTLFLAG_RD, &adapter->stats.ictxptc, + "Interrupt Cause Tx Pkt Timer Expire Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "tx_abs_timer", + CTLFLAG_RD, &adapter->stats.ictxatc, + "Interrupt Cause Tx Abs Timer Expire Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "tx_queue_empty", + CTLFLAG_RD, &adapter->stats.ictxqec, + "Interrupt Cause Tx Queue Empty Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "tx_queue_min_thresh", + CTLFLAG_RD, &adapter->stats.ictxqmtc, + "Interrupt Cause Tx Queue Min Thresh Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "rx_desc_min_thresh", + CTLFLAG_RD, &adapter->stats.icrxdmtc, + "Interrupt Cause Rx Desc Min Thresh Count"); + + SYSCTL_ADD_QUAD(ctx, int_list, OID_AUTO, "rx_overrun", + CTLFLAG_RD, &adapter->stats.icrxoc, + "Interrupt Cause Receiver Overrun Count"); + + /* Host to Card Stats */ + + host_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "host", + CTLFLAG_RD, NULL, + "Host to Card Statistics"); + + host_list = SYSCTL_CHILDREN(host_node); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_tx_pkt", + CTLFLAG_RD, &adapter->stats.cbtmpc, + "Circuit Breaker Tx Packet Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "host_tx_pkt_discard", + CTLFLAG_RD, &adapter->stats.htdpmc, + "Host Transmit Discarded Packets"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "rx_pkt", + CTLFLAG_RD, &adapter->stats.rpthc, + "Rx Packets To Host"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_rx_pkts", + CTLFLAG_RD, &adapter->stats.cbrmpc, + "Circuit Breaker Rx Packet Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_rx_pkt_drop", + CTLFLAG_RD, &adapter->stats.cbrdpc, + "Circuit Breaker Rx Dropped Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "tx_good_pkt", + CTLFLAG_RD, &adapter->stats.hgptc, + "Host Good Packets Tx Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "breaker_tx_pkt_drop", + CTLFLAG_RD, &adapter->stats.htcbdpc, + "Host Tx Circuit Breaker Dropped Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "rx_good_bytes", + CTLFLAG_RD, &adapter->stats.hgorc, + "Host Good Octets Received Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "tx_good_bytes", + CTLFLAG_RD, &adapter->stats.hgotc, + "Host Good Octets Transmit Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "length_errors", + CTLFLAG_RD, &adapter->stats.lenerrs, + "Length Errors"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "serdes_violation_pkt", + CTLFLAG_RD, &adapter->stats.scvpc, + "SerDes/SGMII Code Violation Pkt Count"); + + SYSCTL_ADD_QUAD(ctx, host_list, OID_AUTO, "header_redir_missed", + CTLFLAG_RD, &adapter->stats.hrmpc, + "Header Redirection Missed Packet Count"); - for (int i = 0; i < adapter->num_queues; i++, txr++) { - device_printf(dev, "Queue(%d) tdh = %d, tdt = %d\n", i, - E1000_READ_REG(&adapter->hw, E1000_TDH(i)), - E1000_READ_REG(&adapter->hw, E1000_TDT(i))); - device_printf(dev, "TX(%d) no descriptors avail event = %ld\n", - txr->me, txr->no_desc_avail); - device_printf(dev, "TX(%d) MSIX IRQ Handled = %ld\n", - txr->me, txr->tx_irq); - device_printf(dev, "Num Tx descriptors avail = %d\n", - txr->tx_avail); - device_printf(dev, "Tx Descriptors not avail1 = %ld\n", - txr->no_desc_avail); - } - for (int i = 0; i < adapter->num_queues; i++, rxr++) { - device_printf(dev, "RX(%d) MSIX IRQ Handled = %ld\n", - rxr->me, rxr->rx_irq); - device_printf(dev, "hw rdh = %d, hw rdt = %d\n", - E1000_READ_REG(&adapter->hw, E1000_RDH(i)), - E1000_READ_REG(&adapter->hw, E1000_RDT(i))); - } - device_printf(dev, "Std mbuf failed = %ld\n", - adapter->mbuf_alloc_failed); - device_printf(dev, "Std mbuf cluster failed = %ld\n", - adapter->mbuf_cluster_failed); - device_printf(dev, "Driver dropped packets = %ld\n", - adapter->dropped_pkts); -} -static void -em_print_hw_stats(struct adapter *adapter) -{ - device_t dev = adapter->dev; - device_printf(dev, "Excessive collisions = %lld\n", - (long long)adapter->stats.ecol); -#if (DEBUG_HW > 0) /* Dont output these errors normally */ - device_printf(dev, "Symbol errors = %lld\n", - (long long)adapter->stats.symerrs); -#endif - device_printf(dev, "Sequence errors = %lld\n", - (long long)adapter->stats.sec); - device_printf(dev, "Defer count = %lld\n", - (long long)adapter->stats.dc); - device_printf(dev, "Missed Packets = %lld\n", - (long long)adapter->stats.mpc); - device_printf(dev, "Receive No Buffers = %lld\n", - (long long)adapter->stats.rnbc); - /* RLEC is inaccurate on some hardware, calculate our own. */ - device_printf(dev, "Receive Length Errors = %lld\n", - ((long long)adapter->stats.roc + (long long)adapter->stats.ruc)); - device_printf(dev, "Receive errors = %lld\n", - (long long)adapter->stats.rxerrc); - device_printf(dev, "Crc errors = %lld\n", - (long long)adapter->stats.crcerrs); - device_printf(dev, "Alignment errors = %lld\n", - (long long)adapter->stats.algnerrc); - device_printf(dev, "Collision/Carrier extension errors = %lld\n", - (long long)adapter->stats.cexterr); - device_printf(dev, "watchdog timeouts = %ld\n", - adapter->watchdog_events); - device_printf(dev, "XON Rcvd = %lld\n", - (long long)adapter->stats.xonrxc); - device_printf(dev, "XON Xmtd = %lld\n", - (long long)adapter->stats.xontxc); - device_printf(dev, "XOFF Rcvd = %lld\n", - (long long)adapter->stats.xoffrxc); - device_printf(dev, "XOFF Xmtd = %lld\n", - (long long)adapter->stats.xofftxc); - device_printf(dev, "Good Packets Rcvd = %lld\n", - (long long)adapter->stats.gprc); - device_printf(dev, "Good Packets Xmtd = %lld\n", - (long long)adapter->stats.gptc); - device_printf(dev, "TSO Contexts Xmtd = %lld\n", - (long long)adapter->stats.tsctc); - device_printf(dev, "TSO Contexts Failed = %lld\n", - (long long)adapter->stats.tsctfc); } /********************************************************************** @@ -4984,28 +5153,9 @@ em_print_hw_stats(struct adapter *adapte * 32 words, stuff that matters is in that extent. * **********************************************************************/ -static void -em_print_nvm_info(struct adapter *adapter) -{ - u16 eeprom_data; - int i, j, row = 0; - - /* Its a bit crude, but it gets the job done */ - printf("\nInterface EEPROM Dump:\n"); - printf("Offset\n0x0000 "); - for (i = 0, j = 0; i < 32; i++, j++) { - if (j == 8) { /* Make the offset block */ - j = 0; ++row; - printf("\n0x00%x0 ",row); - } - e1000_read_nvm(&adapter->hw, i, 1, &eeprom_data); - printf("%04x ", eeprom_data); - } - printf("\n"); -} static int -em_sysctl_debug_info(SYSCTL_HANDLER_ARGS) +em_sysctl_nvm_info(SYSCTL_HANDLER_ARGS) { struct adapter *adapter; int error; @@ -5017,16 +5167,12 @@ em_sysctl_debug_info(SYSCTL_HANDLER_ARGS if (error || !req->newptr) return (error); - if (result == 1) { - adapter = (struct adapter *)arg1; - em_print_debug_info(adapter); - } /* * This value will cause a hex dump of the * first 32 16-bit words of the EEPROM to * the screen. */ - if (result == 2) { + if (result == 1) { adapter = (struct adapter *)arg1; em_print_nvm_info(adapter); } @@ -5034,26 +5180,24 @@ em_sysctl_debug_info(SYSCTL_HANDLER_ARGS return (error); } - -static int -em_sysctl_stats(SYSCTL_HANDLER_ARGS) +static void +em_print_nvm_info(struct adapter *adapter) { - struct adapter *adapter; - int error; - int result; - - result = -1; - error = sysctl_handle_int(oidp, &result, 0, req); - - if (error || !req->newptr) - return (error); + u16 eeprom_data; + int i, j, row = 0; - if (result == 1) { - adapter = (struct adapter *)arg1; - em_print_hw_stats(adapter); + /* Its a bit crude, but it gets the job done */ + printf("\nInterface EEPROM Dump:\n"); + printf("Offset\n0x0000 "); + for (i = 0, j = 0; i < 32; i++, j++) { + if (j == 8) { /* Make the offset block */ + j = 0; ++row; + printf("\n0x00%x0 ",row); + } + e1000_read_nvm(&adapter->hw, i, 1, &eeprom_data); + printf("%04x ", eeprom_data); } - - return (error); + printf("\n"); } static int From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 21:34: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 B4F841065670; Wed, 16 Jun 2010 21:34:38 +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 57F668FC12; Wed, 16 Jun 2010 21:34:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o5GLPgEm057756; Wed, 16 Jun 2010 15:25:47 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 16 Jun 2010 15:25:47 -0600 (MDT) Message-Id: <20100616.152547.756786594356063577.imp@bsdimp.com> To: andrew@fubar.geek.nz From: "M. Warner Losh" In-Reply-To: <20100616210344.47209ff2@bender> References: <201006131308.o5DD8NTA033564@svn.freebsd.org> <20100616210344.47209ff2@bender> 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, raj@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209129 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2010 21:34:38 -0000 In message: <20100616210344.47209ff2@bender> Andrew Turner writes: : On Sun, 13 Jun 2010 13:08:23 +0000 (UTC) : Rafal Jaworowski wrote: : : > Author: raj : > Date: Sun Jun 13 13:08:23 2010 : > New Revision: 209129 : > URL: http://svn.freebsd.org/changeset/base/209129 : > : > Log: : > Improve style. : > : > Modified: : > head/sys/arm/arm/nexus.c : > : > Modified: head/sys/arm/arm/nexus.c : > ============================================================================== : > --- head/sys/arm/arm/nexus.c Sun Jun 13 13:02:43 2010 : > (r209128) +++ head/sys/arm/arm/nexus.c Sun Jun 13 13:08:23 : > 2010 (r209129) @@ -107,6 +107,7 @@ static devclass_t : > nexus_devclass; static int : > nexus_probe(device_t dev) : > { : > + : > device_quiet(dev); /* suppress attach message for : > neatness */ : > mem_rman.rm_start = 0; : > @@ -116,7 +117,7 @@ nexus_probe(device_t dev) : > if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, : > ~0u)) panic("nexus_probe mem_rman"); : > : > - return (0); : > + return (BUS_PROBE_DEFAULT); : Changing the return value of nexus_probe from 0 to BUS_PROBE_DEFAULT : causes the following panic for me when the s3c24x0 driver calls : rman_init. The attached patch fixes it by moving the call to rman_init : from nexus_probe to nexus_attach. The reason is that softc is reset between probe/attach when a number that isn't 0 is returned, but doesn't when 0 is returned. Warner : Andrew : : KDB: debugger backends: ddb : KDB: current backend: ddb : Copyright (c) 1992-2010 The FreeBSD Project. : Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 : The Regents of the University of California. All rights : reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. : FreeBSD 9.0-CURRENT #10 r209128M: Wed Jun 16 20:47:22 NZST 2010 : andrew@bender:/usr/obj/arm/home/andrew/freebsd/svn/head/sys/LN2410SBC : arm WARNING: WITNESS option enabled, expect reduced performance. : CPU: ARM920T rev 0 (ARM9TDMI core) : DC enabled IC enabled WB enabled LABT : 16KB/32B 64-way Instruction cache : 16KB/32B 64-way write-back-locking-A Data cache : real memory = 67108864 (64 MB) : avail memory = 56320000 (53 MB) : s3c24x00 on motherboard : s3c24x00: Found S3C2410A CPU (Chip ID: 0x32410002) : s3c24x00: fclk 202 MHz hclk 101 MHz pclk 50 MHz : panic: Bad tailq NEXT(0xc068eab8->tqh_last) != NULL : KDB: enter: panic : [ thread pid 0 tid 100000 ] : Stopped at kdb_enter+0x44: ldrb r15, [r15, r15, ror r15]! : db> reset From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 22:16: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 61DE41065670; Wed, 16 Jun 2010 22:16:13 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2001:4dd0:ff41::b23f:aa]) by mx1.freebsd.org (Postfix) with ESMTP id 1FF668FC18; Wed, 16 Jun 2010 22:16:13 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 6A3AE2A29247; Thu, 17 Jun 2010 00:16:12 +0200 (CEST) Date: Thu, 17 Jun 2010 00:16:12 +0200 From: Ed Schouten To: Konstantin Belousov Message-ID: <20100616221612.GZ1797@hoeg.nl> References: <201006121322.o5CDMd57010715@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aSM3KCOUSI0G0tph" Content-Disposition: inline In-Reply-To: <201006121322.o5CDMd57010715@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: r209106 - 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: Wed, 16 Jun 2010 22:16:13 -0000 --aSM3KCOUSI0G0tph Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Kostik, * Konstantin Belousov wrote: > Log: > Add another variation of make_dev(9), make_dev_p(9), that is allowed > to fail and can return useful error code. While we're at it, couldn't we consider removing the `unit' argument =66rom this function? Nowadays unit numbers are mainly useful when using clone lists, which have been almost entirely obsoleted by cdevpriv. We could just call make_dev_credv with unit =3D=3D 0. Cheers, --=20 Ed Schouten WWW: http://80386.nl/ --aSM3KCOUSI0G0tph Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkwZTSwACgkQ52SDGA2eCwWVdQCfa6N4R7Q91hTfoG847jCRkMxe 66YAn3SiyluYKh9F1qV8z0a6LgS8kW9s =i0cg -----END PGP SIGNATURE----- --aSM3KCOUSI0G0tph-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 16 23:24: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 BB8F4106564A; Wed, 16 Jun 2010 23:24:22 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4F7D98FC08; Wed, 16 Jun 2010 23:24:22 +0000 (UTC) Received: by iwn7 with SMTP id 7so8522644iwn.13 for ; Wed, 16 Jun 2010 16:24:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=ySd8FwlHV0cDRoTd0f7UTHCx/CQMFU30Ez1PvQ0uWJc=; b=pMZRXJx9b0dd0F8R2unWS3GuR9q07+t2hiRxi1el7Z3ovzrQidn/3Rx3FfGbVVdrHo S03owHwHQU6RYVCyl1S7hnfBlw//mgHfTg6iGsTCaaxMvKUkQg8SDJ9ZwdbSMJsQ0c+w sYMnpfkdPAmThMKQMpWfXxqYWz18b4X0HWiws= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=jwS6mL/ArR3aana5mF8H+TQ8njTWaLwL65ayatxeZb9Djv9Qgm+xEY0x/vlLHNaI53 qdrfFevRVazZMtnynAt8ZS9emZoQMToIkmABGdNgoG4AeQhtxH+P4nTu+Wz3BGOv6UnC GiKn2BdoKPtEfZx4ONGMNIAnQf+eUbif3sKvI= MIME-Version: 1.0 Received: by 10.231.207.225 with SMTP id fz33mr9533622ibb.173.1276730661566; Wed, 16 Jun 2010 16:24:21 -0700 (PDT) Received: by 10.231.169.206 with HTTP; Wed, 16 Jun 2010 16:24:21 -0700 (PDT) In-Reply-To: References: <201001050237.o052bxEd061444@svn.freebsd.org> Date: Wed, 16 Jun 2010 16:24:21 -0700 Message-ID: From: Xin LI To: Renato Botelho Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu Subject: Re: svn commit: r201546 - in head: . include lib/libc/gen lib/libc/include lib/libthr lib/libthr/thread sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2010 23:24:22 -0000 On Wed, Jun 16, 2010 at 5:16 AM, Renato Botelho wrote: >> +# 20100105: new userland semaphore implementation >> +OLD_FILES+=usr/include/sys/semaphore.h > > Everythime I update my -CURRENT this file is installed again, and is > listed when i run make check-old, I think there is something wrong. I think that's because src/sys/sys/semaphore.h somehow ended up there without being removed? Cheers, -- Xin LI http://www.delphij.net From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 02:38: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 1D7BA106566C; Thu, 17 Jun 2010 02:38:11 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 703B78FC29; Thu, 17 Jun 2010 02:38:10 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id ABAA77E853; Thu, 17 Jun 2010 12:38:08 +1000 (EST) Message-ID: <4C198A90.3060905@freebsd.org> Date: Thu, 17 Jun 2010 12:38:08 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Kostik Belousov References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C158B71.205@freebsd.org> <20100614085205.GD13238@deviant.kiev.zoral.com.ua> <4C1605A7.2000202@freebsd.org> <20100614104349.GF13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100614104349.GF13238@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Matthew Fleming , src-committers@FreeBSD.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@FreeBSD.org, brde@optusnet.com.au, svn-src-head@FreeBSD.org Subject: Re: svn commit: r209119 - 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: Thu, 17 Jun 2010 02:38:11 -0000 On 06/14/10 20:43, Kostik Belousov wrote: > On Mon, Jun 14, 2010 at 08:34:15PM +1000, Lawrence Stewart wrote: >> On 06/14/10 18:52, Kostik Belousov wrote: >>> On Mon, Jun 14, 2010 at 11:52:49AM +1000, Lawrence Stewart wrote: >>>> On 06/13/10 20:10, Pawel Jakub Dawidek wrote: >>>>> On Sun, Jun 13, 2010 at 02:39:55AM +0000, Lawrence Stewart wrote: >>>> [snip] >>>>>> >>>>>> Modified: head/sys/sys/pcpu.h >>>>>> ============================================================================== >>>>>> --- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010 (r209118) >>>>>> +++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 (r209119) >>>>>> @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[]; >>>>>> #define DPCPU_ID_GET(i, n) (*DPCPU_ID_PTR(i, n)) >>>>>> #define DPCPU_ID_SET(i, n, v) (*DPCPU_ID_PTR(i, n) = v) >>>>>> >>>>>> +/* >>>>>> + * Utility macros. >>>>>> + */ >>>>>> +#define DPCPU_SUM(n, var, sum) \ >>>>>> +do { \ >>>>>> + (sum) = 0; \ >>>>>> + u_int i; \ >>>>>> + CPU_FOREACH(i) \ >>>>>> + (sum) += (DPCPU_ID_PTR(i, n))->var; \ >>>>>> +} while (0) >>>>> >>>>> I'd suggest first swapping variable declaration and '(sum) = 0;'. >>>>> Also using 'i' as a counter in macro can easly lead to name collision. >>>>> If you need to do it, I'd suggest '_i' or something. >>>> >>>> Given that the DPCPU variable name space is flat and variable names have >>>> to be unique, perhaps something like the following would address the >>>> concerns raised? >>>> >>>> #define DPCPU_SUM(n, var, sum) \ >>>> do { \ >>>> u_int _##n##_i; \ >>>> (sum) = 0; \ >>>> CPU_FOREACH(_##n##_i) \ >>>> (sum) += (DPCPU_ID_PTR(_##n##_i, n))->var; \ >>>> } while (0) >>> >>> You do not have to jump through this. Mostly by convention, in our kernel >>> sources, names with "_" prefix are reserved for the infrastructure (cannot >>> say implementation). I think it is quite safe to use _i for the iteration >>> variable. >>> >>> As an example of this, look at sys/sys/mount.h, implementation of >>> VFS_NEEDGIANT, VFS_LOCK_GIANT etc macros. They do use gcc ({}) extension >>> to provide function-like macros, but this is irrelevant. Or, look at >>> the VFS_ASSERT_GIANT that is exactly like what you need. >> >> Ok cool, thanks for the info and pointers (I didn't know about the ({}) >> extension or that "_" prefix was definitely reserved). I'm happy to use >> _i. Does the following diff against head look suitable to commit? >> >> --- a/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 +0000 >> +++ b/sys/sys/pcpu.h Mon Jun 14 20:12:27 2010 +1000 >> @@ -111,10 +111,10 @@ >> */ >> #define DPCPU_SUM(n, var, sum) \ >> do { \ >> + u_int _i; \ >> (sum) = 0; \ >> - u_int i; \ >> - CPU_FOREACH(i) \ >> - (sum) += (DPCPU_ID_PTR(i, n))->var; \ >> + CPU_FOREACH(_i) \ >> + (sum) += (DPCPU_ID_PTR(_i, n))->var; \ >> } while (0) > > You might want to introduce local accumulator to prevent several evaluations > of sum, to avoid possible side-effects. Then, after, the loop, do single > asignment to the the sum. > > Or, you could ditch the sum at all, indeed using ({}) and returning the > result. __typeof is your friend to select proper type of accumulator. So, something like this? #define DPCPU_SUM(n, var) __extension__ \ ({ \ u_int _i; \ __typeof((DPCPU_PTR(n))->var) sum; \ \ sum = 0; \ CPU_FOREACH(_i) { \ sum += (DPCPU_ID_PTR(_i, n))->var; \ } \ sum; \ }) Which can be used like this: totalss.n_in = DPCPU_SUM(ss, n_in); I've tested the above and it works. I also prefer the idea of having DPCPU_SUM return the sum so that you can do "var = DPCPU_SUM(...)". My only concern with this method is that the caller no longer has the choice to make the sum variable a larger type to avoid overflow. It would be nice to be able to have the DPCPU vars be uint32_t but be able to sum them into a uint64_t accumulator for example. Perhaps this isn't really an issue though... I'm not sure. Thoughts? Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 05:03: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 64FC3106564A; Thu, 17 Jun 2010 05:03:02 +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 518948FC0C; Thu, 17 Jun 2010 05:03: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 o5H532kN021509; Thu, 17 Jun 2010 05:03:02 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5H532Yw021498; Thu, 17 Jun 2010 05:03:02 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201006170503.o5H532Yw021498@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 17 Jun 2010 05:03: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: r209243 - in head/sys: 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: Thu, 17 Jun 2010 05:03:02 -0000 Author: jchandra Date: Thu Jun 17 05:03:01 2010 New Revision: 209243 URL: http://svn.freebsd.org/changeset/base/209243 Log: Merge jmallett@'s n64 work into HEAD - changeset 4 Re-write tlb operations in C with a simpler API. Update callers to use the new API. Changes from http://svn.freebsd.org/base/user/jmallett/octeon Approved by: rrs(mentor), jmallett Added: head/sys/mips/include/tlb.h (contents, props changed) head/sys/mips/mips/tlb.c (contents, props changed) Modified: head/sys/conf/files.mips head/sys/mips/include/cpu.h head/sys/mips/include/pmap.h head/sys/mips/include/pte.h head/sys/mips/mips/cpu.c head/sys/mips/mips/machdep.c head/sys/mips/mips/mp_machdep.c head/sys/mips/mips/pmap.c head/sys/mips/mips/trap.c Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Wed Jun 16 20:57:41 2010 (r209242) +++ head/sys/conf/files.mips Thu Jun 17 05:03:01 2010 (r209243) @@ -44,7 +44,7 @@ mips/mips/vm_machdep.c standard mips/mips/fp.S standard mips/mips/pm_machdep.c standard mips/mips/swtch.S standard -mips/mips/tlb.S standard +mips/mips/tlb.c standard mips/mips/bus_space_generic.c standard mips/mips/busdma_machdep.c standard Modified: head/sys/mips/include/cpu.h ============================================================================== --- head/sys/mips/include/cpu.h Wed Jun 16 20:57:41 2010 (r209242) +++ head/sys/mips/include/cpu.h Thu Jun 17 05:03:01 2010 (r209243) @@ -274,27 +274,6 @@ #define OPCODE_C1 0x11 /* - * The low part of the TLB entry. - */ -#define VMTLB_PF_NUM 0x3fffffc0 -#define VMTLB_ATTR_MASK 0x00000038 -#define VMTLB_MOD_BIT 0x00000004 -#define VMTLB_VALID_BIT 0x00000002 -#define VMTLB_GLOBAL_BIT 0x00000001 - -#define VMTLB_PHYS_PAGE_SHIFT 6 - -/* - * The high part of the TLB entry. - */ -#define VMTLB_VIRT_PAGE_NUM 0xffffe000 -#define VMTLB_PID 0x000000ff -#define VMTLB_PID_R9K 0x00000fff -#define VMTLB_PID_SHIFT 0 -#define VMTLB_VIRT_PAGE_SHIFT 12 -#define VMTLB_VIRT_PAGE_SHIFT_R9K 13 - -/* * The first TLB entry that write random hits. * TLB entry 0 maps the kernel stack of the currently running thread * TLB entry 1 maps the pcpu area of processor (only for SMP builds) @@ -313,14 +292,6 @@ #define VMNUM_PIDS 256 /* - * TLB probe return codes. - */ -#define VMTLB_NOT_FOUND 0 -#define VMTLB_FOUND 1 -#define VMTLB_FOUND_WITH_PATCH 2 -#define VMTLB_PROBE_ERROR 3 - -/* * Exported definitions unique to mips cpu support. */ @@ -335,6 +306,7 @@ #ifndef _LOCORE #include #include + /* * Arguments to hardclock and gatherstats encapsulate the previous * machine state in an opaque clockframe. @@ -455,12 +427,9 @@ extern union cpuprid cpu_id; #if defined(_KERNEL) && !defined(_LOCORE) extern union cpuprid fpu_id; -struct tlb; struct user; int Mips_ConfigCache(void); -void Mips_SetWIRED(int); -void Mips_SetPID(int); void Mips_SyncCache(void); void Mips_SyncDCache(vm_offset_t, int); @@ -471,12 +440,6 @@ void Mips_HitInvalidateDCache(vm_offset_ void Mips_SyncICache(vm_offset_t, int); void Mips_InvalidateICache(vm_offset_t, int); -void Mips_TLBFlush(int); -void Mips_TLBFlushAddr(vm_offset_t); -void Mips_TLBWriteIndexed(int, struct tlb *); -void Mips_TLBUpdate(vm_offset_t, unsigned); -void Mips_TLBRead(int, struct tlb *); -void mips_TBIAP(int); void wbflush(void); extern u_int32_t cpu_counter_interval; /* Number of counter ticks/tick */ @@ -516,16 +479,6 @@ extern int intr_nesting_level; : "r" (func), "r" (arg0), "r" (arg1), "r" (arg2) /* inputs */ \ : "$31", "$4", "$5", "$6"); -#define MachSetPID Mips_SetPID -#define MachTLBUpdate Mips_TLBUpdate -#define mips_TBIS Mips_TLBFlushAddr -#define MIPS_TBIAP() mips_TBIAP(num_tlbentries) -#define MachSetWIRED(index) Mips_SetWIRED(index) -#define MachTLBFlush(count) Mips_TLBFlush(count) -#define MachTLBGetPID(pid) (pid = Mips_TLBGetPID()) -#define MachTLBRead(tlbno, tlbp) Mips_TLBRead(tlbno, tlbp) -#define MachFPTrap(sr, cause, pc) MipsFPTrap(sr, cause, pc) - /* * Enable realtime clock (always enabled). */ @@ -542,8 +495,6 @@ extern int intr_nesting_level; * Low level access routines to CPU registers */ -int Mips_TLBGetPID(void); - void swi_vm(void *); void cpu_halt(void); void cpu_reset(void); Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Wed Jun 16 20:57:41 2010 (r209242) +++ head/sys/mips/include/pmap.h Thu Jun 17 05:03:01 2010 (r209243) @@ -49,15 +49,7 @@ #include #include -#define VADDR(pdi, pti) ((vm_offset_t)(((pdi)<> SEGSHIFT) #define NUSERPGTBLS (VM_MAXUSER_ADDRESS >> SEGSHIFT) #ifndef LOCORE @@ -109,6 +101,7 @@ pd_entry_t pmap_segmap(pmap_t pmap, vm_o vm_offset_t pmap_kextract(vm_offset_t va); #define vtophys(va) pmap_kextract(((vm_offset_t) (va))) +#define pmap_asid(pmap) (pmap)->pm_asid[PCPU_GET(cpuid)].asid extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) @@ -183,11 +176,6 @@ int pmap_compute_pages_to_dump(void); void pmap_update_page(pmap_t pmap, vm_offset_t va, pt_entry_t pte); void pmap_flush_pvcache(vm_page_t m); -/* - * Function to save TLB contents so that they may be inspected in the debugger. - */ -extern void pmap_save_tlb(void); - #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/mips/include/pte.h ============================================================================== --- head/sys/mips/include/pte.h Wed Jun 16 20:57:41 2010 (r209242) +++ head/sys/mips/include/pte.h Thu Jun 17 05:03:01 2010 (r209243) @@ -1,13 +1,6 @@ -/* $OpenBSD: pte.h,v 1.4 1998/01/28 13:46:25 pefo Exp $ */ - /*- - * Copyright (c) 1988 University of Utah. - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * the Systems Programming Group of the University of Utah Computer - * Science Department and Ralph Campbell. + * Copyright (c) 2004-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 @@ -17,18 +10,11 @@ * 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 the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * 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 REGENTS OR CONTRIBUTORS BE LIABLE + * 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) @@ -37,60 +23,66 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from: Utah Hdr: pte.h 1.11 89/09/03 - * from: @(#)pte.h 8.1 (Berkeley) 6/10/93 - * JNPR: pte.h,v 1.1.4.1 2007/09/10 06:20:19 girish * $FreeBSD$ */ -#ifndef _MACHINE_PTE_H_ +#ifndef _MACHINE_PTE_H_ #define _MACHINE_PTE_H_ -#include - /* - * MIPS hardware page table entry + * TLB and PTE management. Most things operate within the context of + * EntryLo0,1, and begin with TLBLO_. Things which work with EntryHi + * start with TLBHI_. PTE bits begin with PG_. + * + * Note that we use the same size VM and TLB pages. */ - -#ifndef _LOCORE -struct pte { -#if BYTE_ORDER == BIG_ENDIAN -unsigned int pg_prot:2, /* SW: access control */ - pg_pfnum:24, /* HW: core page frame number or 0 */ - pg_attr:3, /* HW: cache attribute */ - pg_m:1, /* HW: modified (dirty) bit */ - pg_v:1, /* HW: valid bit */ - pg_g:1; /* HW: ignore pid bit */ -#endif -#if BYTE_ORDER == LITTLE_ENDIAN -unsigned int pg_g:1, /* HW: ignore pid bit */ - pg_v:1, /* HW: valid bit */ - pg_m:1, /* HW: modified (dirty) bit */ - pg_attr:3, /* HW: cache attribute */ - pg_pfnum:24, /* HW: core page frame number or 0 */ - pg_prot:2; /* SW: access control */ -#endif -}; +#define TLB_PAGE_SHIFT (PAGE_SHIFT) +#define TLB_PAGE_SIZE (1 << TLB_PAGE_SHIFT) +#define TLB_PAGE_MASK (TLB_PAGE_SIZE - 1) /* - * Structure defining an tlb entry data set. + * TLB PageMask register. Has mask bits set above the default, 4K, page mask. */ +#define TLBMASK_SHIFT (13) +#define TLBMASK_MASK ((PAGE_MASK >> TLBMASK_SHIFT) << TLBMASK_SHIFT) -struct tlb { - int tlb_mask; - int tlb_hi; - int tlb_lo0; - int tlb_lo1; -}; +/* + * PFN for EntryLo register. Upper bits are 0, which is to say that + * bit 29 is the last hardware bit; Bits 30 and upwards (EntryLo is + * 64 bit though it can be referred to in 32-bits providing 2 software + * bits safely. We use it as 64 bits to get many software bits, and + * god knows what else.) are unacknowledged by hardware. They may be + * written as anything, but otherwise they have as much meaning as + * other 0 fields. + */ +#define TLBLO_SWBITS_SHIFT (30) +#define TLBLO_SWBITS_MASK (0x3U << TLBLO_SWBITS_SHIFT) +#define TLBLO_PFN_SHIFT (6) +#define TLBLO_PFN_MASK (0x3FFFFFC0) +#define TLBLO_PA_TO_PFN(pa) ((((pa) >> TLB_PAGE_SHIFT) << TLBLO_PFN_SHIFT) & TLBLO_PFN_MASK) +#define TLBLO_PFN_TO_PA(pfn) ((vm_paddr_t)((pfn) >> TLBLO_PFN_SHIFT) << TLB_PAGE_SHIFT) +#define TLBLO_PTE_TO_PFN(pte) ((pte) & TLBLO_PFN_MASK) +#define TLBLO_PTE_TO_PA(pte) (TLBLO_PFN_TO_PA(TLBLO_PTE_TO_PFN((pte)))) + +/* + * VPN for EntryHi register. Upper two bits select user, supervisor, + * or kernel. Bits 61 to 40 copy bit 63. VPN2 is bits 39 and down to + * as low as 13, down to PAGE_SHIFT, to index 2 TLB pages*. From bit 12 + * to bit 8 there is a 5-bit 0 field. Low byte is ASID. + * + * Note that in FreeBSD, we map 2 TLB pages is equal to 1 VM page. + */ +#define TLBHI_ASID_MASK (0xff) +#define TLBHI_ENTRY(va, asid) (((va) & ~PAGE_MASK) | ((asid) & TLBHI_ASID_MASK)) +#ifndef _LOCORE typedef unsigned int pt_entry_t; typedef pt_entry_t *pd_entry_t; +#endif #define PDESIZE sizeof(pd_entry_t) /* for assembly files */ #define PTESIZE sizeof(pt_entry_t) /* for assembly files */ -#endif /* _LOCORE */ - #define PT_ENTRY_NULL ((pt_entry_t *) 0) #define PTE_WIRED 0x80000000 /* SW */ @@ -119,11 +111,6 @@ typedef pt_entry_t *pd_entry_t; #define PTE_HVPN 0xffffe000 /* Hardware page no mask */ #define PTE_ASID 0x000000ff /* Address space ID */ -#define PTE_SHIFT 6 -#define pfn_is_ext(x) ((x) & 0x3c000000) -#define vad_to_pfn(x) (((unsigned)(x) >> PTE_SHIFT) & PTE_FRAME) -#define vad_to_pfn64(x) ((quad_t)(x) >> PTE_SHIFT) & PTE_FRAME) -#define pfn_to_vad(x) (((x) & PTE_FRAME) << PTE_SHIFT) /* User virtual to pte offset in page table */ #define vad_to_pte_offset(adr) (((adr) >> PAGE_SHIFT) & (NPTEPG -1)) @@ -138,16 +125,5 @@ typedef pt_entry_t *pd_entry_t; #define mips_pg_cwpage_bit() (PTE_CWPAGE) #define mips_pg_global_bit() (PTE_G) #define mips_pg_wired_bit() (PTE_WIRED) -#define mips_tlbpfn_to_paddr(x) pfn_to_vad((x)) -#define mips_paddr_to_tlbpfn(x) vad_to_pfn((x)) - -/* These are not used */ -#define PTE_SIZE_4K 0x00000000 -#define PTE_SIZE_16K 0x00006000 -#define PTE_SIZE_64K 0x0001e000 -#define PTE_SIZE_256K 0x0007e000 -#define PTE_SIZE_1M 0x001fe000 -#define PTE_SIZE_4M 0x007fe000 -#define PTE_SIZE_16M 0x01ffe000 -#endif /* !_MACHINE_PTE_H_ */ +#endif /* !_MACHINE_PTE_H_ */ Added: head/sys/mips/include/tlb.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/include/tlb.h Thu Jun 17 05:03:01 2010 (r209243) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2004-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$ + */ + +#ifndef _MACHINE_TLB_H_ +#define _MACHINE_TLB_H_ + +void tlb_insert_wired(unsigned, vm_offset_t, pt_entry_t, pt_entry_t); +void tlb_invalidate_address(struct pmap *, vm_offset_t); +void tlb_invalidate_all(void); +void tlb_invalidate_all_user(struct pmap *); +void tlb_save(void); +void tlb_update(struct pmap *, vm_offset_t, pt_entry_t); + +#endif /* !_MACHINE_TLB_H_ */ Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Wed Jun 16 20:57:41 2010 (r209242) +++ head/sys/mips/mips/cpu.c Thu Jun 17 05:03:01 2010 (r209243) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include struct mips_cpuinfo cpuinfo; @@ -135,9 +136,9 @@ mips_cpu_init(void) platform_cpu_init(); mips_get_identity(&cpuinfo); num_tlbentries = cpuinfo.tlb_nentries; - Mips_SetWIRED(0); - Mips_TLBFlush(num_tlbentries); - Mips_SetWIRED(VMWIRED_ENTRIES); + mips_wr_wired(0); + tlb_invalidate_all(); + mips_wr_wired(VMWIRED_ENTRIES); mips_config_cache(&cpuinfo); mips_vector_init(); Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Wed Jun 16 20:57:41 2010 (r209242) +++ head/sys/mips/mips/machdep.c Thu Jun 17 05:03:01 2010 (r209243) @@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef DDB #include #include @@ -118,7 +119,7 @@ vm_offset_t kstack0; /* * Each entry in the pcpu_space[] array is laid out in the following manner: * struct pcpu for cpu 'n' pcpu_space[n] - * boot stack for cpu 'n' pcpu_space[n] + PAGE_SIZE * 2 - START_FRAME + * boot stack for cpu 'n' pcpu_space[n] + PAGE_SIZE * 2 - CALLFRAME_SIZ * * Note that the boot stack grows downwards and we assume that we never * use enough stack space to trample over the 'struct pcpu' that is at @@ -413,20 +414,17 @@ void mips_pcpu_tlb_init(struct pcpu *pcpu) { vm_paddr_t pa; - struct tlb tlb; - int lobits; + pt_entry_t pte; /* * Map the pcpu structure at the virtual address 'pcpup'. * We use a wired tlb index to do this one-time mapping. */ - memset(&tlb, 0, sizeof(tlb)); pa = vtophys(pcpu); - lobits = PTE_RW | PTE_V | PTE_G | PTE_CACHE; - tlb.tlb_hi = (vm_offset_t)pcpup; - tlb.tlb_lo0 = mips_paddr_to_tlbpfn(pa) | lobits; - tlb.tlb_lo1 = mips_paddr_to_tlbpfn(pa + PAGE_SIZE) | lobits; - Mips_TLBWriteIndexed(PCPU_TLB_ENTRY, &tlb); + pte = PTE_RW | PTE_V | PTE_G | PTE_CACHE; + tlb_insert_wired(PCPU_TLB_ENTRY, (vm_offset_t)pcpup, + TLBLO_PA_TO_PFN(pa) | pte, + TLBLO_PA_TO_PFN(pa + PAGE_SIZE) | pte); } #endif Modified: head/sys/mips/mips/mp_machdep.c ============================================================================== --- head/sys/mips/mips/mp_machdep.c Wed Jun 16 20:57:41 2010 (r209242) +++ head/sys/mips/mips/mp_machdep.c Thu Jun 17 05:03:01 2010 (r209243) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include struct pcb stoppcbs[MAXCPU]; @@ -128,7 +129,7 @@ mips_ipi_handler(void *arg) CTR0(KTR_SMP, "IPI_STOP or IPI_STOP_HARD"); savectx(&stoppcbs[cpu]); - pmap_save_tlb(); + tlb_save(); /* Indicate we are stopped */ atomic_set_int(&stopped_cpus, cpumask); @@ -238,9 +239,9 @@ void smp_init_secondary(u_int32_t cpuid) { /* TLB */ - Mips_SetWIRED(0); - Mips_TLBFlush(num_tlbentries); - Mips_SetWIRED(VMWIRED_ENTRIES); + mips_wr_wired(0); + tlb_invalidate_all(); + mips_wr_wired(VMWIRED_ENTRIES); /* * We assume that the L1 cache on the APs is identical to the one @@ -251,7 +252,7 @@ smp_init_secondary(u_int32_t cpuid) mips_sync(); - MachSetPID(0); + mips_wr_entryhi(0); pcpu_init(PCPU_ADDR(cpuid), cpuid, sizeof(struct pcpu)); dpcpu_init(dpcpu, cpuid); Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Wed Jun 16 20:57:41 2010 (r209242) +++ head/sys/mips/mips/pmap.c Thu Jun 17 05:03:01 2010 (r209243) @@ -99,6 +99,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #if defined(DIAGNOSTIC) #define PMAP_DIAGNOSTIC @@ -150,8 +151,6 @@ unsigned pmap_max_asid; /* max ASID sup vm_offset_t kernel_vm_end; -static struct tlb tlbstash[MAXCPU][MIPS_MAX_TLB_ENTRIES]; - static void pmap_asid_alloc(pmap_t pmap); /* @@ -182,8 +181,6 @@ 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 void pmap_TLB_invalidate_kernel(vm_offset_t); -static void pmap_TLB_update_kernel(vm_offset_t, pt_entry_t); 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); @@ -223,7 +220,7 @@ static struct local_sysmaps sysmap_lmem[ intr = intr_disable(); \ sched_pin(); \ va = sysm->base; \ - npte = mips_paddr_to_tlbpfn(phys) | \ + npte = TLBLO_PA_TO_PFN(phys) | \ PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; \ pte = pmap_pte(kernel_pmap, va); \ *pte = npte; \ @@ -241,11 +238,11 @@ static struct local_sysmaps sysmap_lmem[ sched_pin(); \ va1 = sysm->base; \ va2 = sysm->base + PAGE_SIZE; \ - npte = mips_paddr_to_tlbpfn(phys1) | \ + npte = TLBLO_PA_TO_PFN(phys1) | \ PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; \ pte = pmap_pte(kernel_pmap, va1); \ *pte = npte; \ - npte = mips_paddr_to_tlbpfn(phys2) | \ + npte = TLBLO_PA_TO_PFN(phys2) | \ PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; \ pte = pmap_pte(kernel_pmap, va2); \ *pte = npte; \ @@ -255,11 +252,11 @@ static struct local_sysmaps sysmap_lmem[ #define PMAP_LMEM_UNMAP() \ pte = pmap_pte(kernel_pmap, sysm->base); \ *pte = PTE_G; \ - pmap_TLB_invalidate_kernel(sysm->base); \ + tlb_invalidate_address(kernel_pmap, sysm->base); \ sysm->valid1 = 0; \ pte = pmap_pte(kernel_pmap, sysm->base + PAGE_SIZE); \ *pte = PTE_G; \ - pmap_TLB_invalidate_kernel(sysm->base + PAGE_SIZE); \ + tlb_invalidate_address(kernel_pmap, sysm->base + PAGE_SIZE); \ sysm->valid2 = 0; \ sched_unpin(); \ intr_restore(intr); \ @@ -499,7 +496,7 @@ again: kernel_pmap->pm_asid[0].asid = PMAP_ASID_RESERVED; kernel_pmap->pm_asid[0].gen = 0; pmap_max_asid = VMNUM_PIDS; - MachSetPID(0); + mips_wr_entryhi(0); } /* @@ -576,9 +573,14 @@ pmap_invalidate_all_action(void *arg) #endif - if (pmap->pm_active & PCPU_GET(cpumask)) { - pmap_TLB_invalidate_all(); - } else + if (pmap == kernel_pmap) { + tlb_invalidate_all(); + return; + } + + if (pmap->pm_active & PCPU_GET(cpumask)) + tlb_invalidate_all_user(pmap); + else pmap->pm_asid[PCPU_GET(cpuid)].gen = 0; } @@ -608,7 +610,7 @@ pmap_invalidate_page_action(void *arg) #endif if (is_kernel_pmap(pmap)) { - pmap_TLB_invalidate_kernel(va); + tlb_invalidate_address(pmap, va); return; } if (pmap->pm_asid[PCPU_GET(cpuid)].gen != PCPU_GET(asid_generation)) @@ -617,18 +619,7 @@ pmap_invalidate_page_action(void *arg) pmap->pm_asid[PCPU_GET(cpuid)].gen = 0; return; } - va = pmap_va_asid(pmap, (va & ~PAGE_MASK)); - mips_TBIS(va); -} - -static void -pmap_TLB_invalidate_kernel(vm_offset_t va) -{ - u_int32_t pid; - - MachTLBGetPID(pid); - va = va | (pid << VMTLB_PID_SHIFT); - mips_TBIS(va); + tlb_invalidate_address(pmap, va); } struct pmap_update_page_arg { @@ -659,7 +650,7 @@ pmap_update_page_action(void *arg) #endif if (is_kernel_pmap(pmap)) { - pmap_TLB_update_kernel(va, pte); + tlb_update(pmap, va, pte); return; } if (pmap->pm_asid[PCPU_GET(cpuid)].gen != PCPU_GET(asid_generation)) @@ -668,21 +659,7 @@ pmap_update_page_action(void *arg) pmap->pm_asid[PCPU_GET(cpuid)].gen = 0; return; } - va = pmap_va_asid(pmap, (va & ~PAGE_MASK)); - MachTLBUpdate(va, pte); -} - -static void -pmap_TLB_update_kernel(vm_offset_t va, pt_entry_t pte) -{ - u_int32_t pid; - - va &= ~PAGE_MASK; - - MachTLBGetPID(pid); - va = va | (pid << VMTLB_PID_SHIFT); - - MachTLBUpdate(va, pte); + tlb_update(pmap, va, pte); } /* @@ -700,7 +677,7 @@ pmap_extract(pmap_t pmap, vm_offset_t va PMAP_LOCK(pmap); pte = pmap_pte(pmap, va); if (pte) { - retval = mips_tlbpfn_to_paddr(*pte) | (va & PAGE_MASK); + retval = TLBLO_PTE_TO_PA(*pte) | (va & PAGE_MASK); } PMAP_UNLOCK(pmap); return retval; @@ -727,10 +704,10 @@ retry: pte = *pmap_pte(pmap, va); if (pte != 0 && pmap_pte_v(&pte) && ((pte & PTE_RW) || (prot & VM_PROT_WRITE) == 0)) { - if (vm_page_pa_tryrelock(pmap, mips_tlbpfn_to_paddr(pte), &pa)) + if (vm_page_pa_tryrelock(pmap, TLBLO_PTE_TO_PA(pte), &pa)) goto retry; - m = PHYS_TO_VM_PAGE(mips_tlbpfn_to_paddr(pte)); + m = PHYS_TO_VM_PAGE(TLBLO_PTE_TO_PA(pte)); vm_page_hold(m); } PA_UNLOCK_COND(pa); @@ -754,7 +731,7 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p #ifdef PMAP_DEBUG printf("pmap_kenter: va: 0x%08x -> pa: 0x%08x\n", va, pa); #endif - npte = mips_paddr_to_tlbpfn(pa) | PTE_RW | PTE_V | PTE_G | PTE_W; + npte = TLBLO_PA_TO_PFN(pa) | PTE_RW | PTE_V | PTE_G | PTE_W; if (is_cacheable_mem(pa)) npte |= PTE_CACHE; @@ -1484,7 +1461,7 @@ pmap_remove_pte(struct pmap *pmap, pt_en pmap->pm_stats.wired_count -= 1; pmap->pm_stats.resident_count -= 1; - pa = mips_tlbpfn_to_paddr(oldpte); + pa = TLBLO_PTE_TO_PA(oldpte); if (page_is_managed(pa)) { m = PHYS_TO_VM_PAGE(pa); @@ -1700,7 +1677,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv } retry: obits = pbits = *pte; - pa = mips_tlbpfn_to_paddr(pbits); + pa = TLBLO_PTE_TO_PA(pbits); if (page_is_managed(pa) && (pbits & PTE_M) != 0) { m = PHYS_TO_VM_PAGE(pa); @@ -1776,7 +1753,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pa = VM_PAGE_TO_PHYS(m); om = NULL; origpte = *pte; - opa = mips_tlbpfn_to_paddr(origpte); + opa = TLBLO_PTE_TO_PA(origpte); /* * Mapping has not changed, must be protection or wiring change. @@ -1873,7 +1850,7 @@ validate: /* * Now validate mapping with desired protection/wiring. */ - newpte = mips_paddr_to_tlbpfn(pa) | rw | PTE_V; + newpte = TLBLO_PA_TO_PFN(pa) | rw | PTE_V; if (is_cacheable_mem(pa)) newpte |= PTE_CACHE; @@ -2039,7 +2016,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ /* * Now validate mapping with RO protection */ - *pte = mips_paddr_to_tlbpfn(pa) | PTE_V; + *pte = TLBLO_PA_TO_PFN(pa) | PTE_V; if (is_cacheable_mem(pa)) *pte |= PTE_CACHE; @@ -2092,7 +2069,7 @@ pmap_kenter_temporary(vm_paddr_t pa, int cpu = PCPU_GET(cpuid); sysm = &sysmap_lmem[cpu]; /* Since this is for the debugger, no locks or any other fun */ - npte = mips_paddr_to_tlbpfn(pa) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; + npte = TLBLO_PA_TO_PFN(pa) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; pte = pmap_pte(kernel_pmap, sysm->base); *pte = npte; sysm->valid1 = 1; @@ -2407,7 +2384,7 @@ pmap_remove_pages(pmap_t pmap) } *pte = is_kernel_pmap(pmap) ? PTE_G : 0; - m = PHYS_TO_VM_PAGE(mips_tlbpfn_to_paddr(tpte)); + m = PHYS_TO_VM_PAGE(TLBLO_PTE_TO_PA(tpte)); KASSERT(m != NULL, ("pmap_remove_pages: bad tpte %x", tpte)); @@ -2814,7 +2791,7 @@ retry: val = MINCORE_INCORE; if ((pte & PTE_M) != 0) val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; - pa = mips_tlbpfn_to_paddr(pte); + pa = TLBLO_PTE_TO_PA(pte); managed = page_is_managed(pa); if (managed) { /* @@ -2856,7 +2833,7 @@ pmap_activate(struct thread *td) pmap_asid_alloc(pmap); if (td == curthread) { PCPU_SET(segbase, pmap->pm_segtab); - MachSetPID(pmap->pm_asid[PCPU_GET(cpuid)].asid); + mips_wr_entryhi(pmap->pm_asid[PCPU_GET(cpuid)].asid); } PCPU_SET(curpmap, pmap); @@ -2948,7 +2925,7 @@ pmap_pid_dump(int pid) vm_offset_t pa; vm_page_t m; - pa = mips_tlbpfn_to_paddr(*pte); + pa = TLBLO_PFN_TO_PA(*pte); m = PHYS_TO_VM_PAGE(pa); printf("va: %p, pt: %p, h: %d, w: %d, f: 0x%x", (void *)va, @@ -3044,7 +3021,7 @@ pmap_asid_alloc(pmap) pmap->pm_asid[PCPU_GET(cpuid)].gen == PCPU_GET(asid_generation)); else { if (PCPU_GET(next_asid) == pmap_max_asid) { - MIPS_TBIAP(); + tlb_invalidate_all_user(NULL); PCPU_SET(asid_generation, (PCPU_GET(asid_generation) + 1) & ASIDGEN_MASK); if (PCPU_GET(asid_generation) == 0) { @@ -3124,7 +3101,7 @@ pmap_kextract(vm_offset_t va) if (curproc && curproc->p_vmspace) { ptep = pmap_pte(&curproc->p_vmspace->vm_pmap, va); if (ptep) - pa = mips_tlbpfn_to_paddr(*ptep) | + pa = TLBLO_PTE_TO_PA(*ptep) | (va & PAGE_MASK); } } else if (va >= MIPS_KSEG0_START && @@ -3140,9 +3117,11 @@ pmap_kextract(vm_offset_t va) if (kernel_pmap->pm_active) { /* Its inside the virtual address range */ ptep = pmap_pte(kernel_pmap, va); - if (ptep) - pa = mips_tlbpfn_to_paddr(*ptep) | - (va & PAGE_MASK); + if (ptep) { + return (TLBLO_PTE_TO_PA(*ptep) | + (va & PAGE_MASK)); + } + return (0); } } return pa; @@ -3160,61 +3139,3 @@ pmap_flush_pvcache(vm_page_t m) } } } - -void -pmap_save_tlb(void) -{ - int tlbno, cpu; - - cpu = PCPU_GET(cpuid); - - for (tlbno = 0; tlbno < num_tlbentries; ++tlbno) - MachTLBRead(tlbno, &tlbstash[cpu][tlbno]); -} - -#ifdef DDB -#include - -DB_SHOW_COMMAND(tlb, ddb_dump_tlb) -{ - int cpu, tlbno; - struct tlb *tlb; - - if (have_addr) - cpu = ((addr >> 4) % 16) * 10 + (addr % 16); - else - cpu = PCPU_GET(cpuid); - - if (cpu < 0 || cpu >= mp_ncpus) { - db_printf("Invalid CPU %d\n", cpu); - return; - } else - db_printf("CPU %d:\n", cpu); - - if (cpu == PCPU_GET(cpuid)) - pmap_save_tlb(); - - for (tlbno = 0; tlbno < num_tlbentries; ++tlbno) { - tlb = &tlbstash[cpu][tlbno]; - if (tlb->tlb_lo0 & PTE_V || tlb->tlb_lo1 & PTE_V) { - printf("TLB %2d vad 0x%0lx ", - tlbno, (long)(tlb->tlb_hi & 0xffffff00)); - } else { - printf("TLB*%2d vad 0x%0lx ", - tlbno, (long)(tlb->tlb_hi & 0xffffff00)); - } - printf("0=0x%0lx ", pfn_to_vad((long)tlb->tlb_lo0)); - printf("%c", tlb->tlb_lo0 & PTE_V ? 'V' : '-'); - printf("%c", tlb->tlb_lo0 & PTE_M ? 'M' : '-'); - printf("%c", tlb->tlb_lo0 & PTE_G ? 'G' : '-'); - printf(" atr %x ", (tlb->tlb_lo0 >> 3) & 7); - printf("1=0x%0lx ", pfn_to_vad((long)tlb->tlb_lo1)); - printf("%c", tlb->tlb_lo1 & PTE_V ? 'V' : '-'); - printf("%c", tlb->tlb_lo1 & PTE_M ? 'M' : '-'); - printf("%c", tlb->tlb_lo1 & PTE_G ? 'G' : '-'); - printf(" atr %x ", (tlb->tlb_lo1 >> 3) & 7); - printf(" sz=%x pid=%x\n", tlb->tlb_mask, - (tlb->tlb_hi & 0x000000ff)); - } -} -#endif /* DDB */ Added: head/sys/mips/mips/tlb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/tlb.c Thu Jun 17 05:03:01 2010 (r209243) @@ -0,0 +1,311 @@ +/*- + * Copyright (c) 2004-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 "opt_ddb.h" + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +struct tlb_state { + unsigned wired; + struct tlb_entry { + register_t entryhi; + register_t entrylo0; + register_t entrylo1; + } entry[MIPS_MAX_TLB_ENTRIES]; +}; + +static struct tlb_state tlb_state[MAXCPU]; + +#if 0 +/* + * PageMask must increment in steps of 2 bits. + */ +COMPILE_TIME_ASSERT(POPCNT(TLBMASK_MASK) % 2 == 0); +#endif + +static inline void +tlb_probe(void) +{ + __asm __volatile ("tlbp" : : : "memory"); + mips_cp0_sync(); +} + +static inline void +tlb_read(void) +{ + __asm __volatile ("tlbr" : : : "memory"); + mips_cp0_sync(); +} + +static inline void +tlb_write_indexed(void) +{ + __asm __volatile ("tlbwi" : : : "memory"); + mips_cp0_sync(); +} + +static inline void +tlb_write_random(void) +{ + __asm __volatile ("tlbwr" : : : "memory"); + mips_cp0_sync(); +} + +static void tlb_invalidate_one(unsigned); + +void +tlb_insert_wired(unsigned i, vm_offset_t va, pt_entry_t pte0, pt_entry_t pte1) +{ + register_t mask, asid; + register_t s; + + va &= ~PAGE_MASK; + + s = intr_disable(); + mask = mips_rd_pagemask(); + asid = mips_rd_entryhi() & TLBHI_ASID_MASK; + + mips_wr_index(i); + mips_wr_pagemask(0); + mips_wr_entryhi(TLBHI_ENTRY(va, 0)); + mips_wr_entrylo0(pte0); + mips_wr_entrylo1(pte1); + tlb_write_indexed(); + + mips_wr_entryhi(asid); + mips_wr_pagemask(mask); + intr_restore(s); +} + +void +tlb_invalidate_address(struct pmap *pmap, vm_offset_t va) +{ + register_t mask, asid; + register_t s; + int i; + + va &= ~PAGE_MASK; + + s = intr_disable(); + mask = mips_rd_pagemask(); + asid = mips_rd_entryhi() & TLBHI_ASID_MASK; + + mips_wr_pagemask(0); + mips_wr_entryhi(TLBHI_ENTRY(va, pmap_asid(pmap))); + tlb_probe(); + i = mips_rd_index(); + if (i >= 0) + tlb_invalidate_one(i); + + mips_wr_entryhi(asid); + mips_wr_pagemask(mask); + intr_restore(s); +} + +void +tlb_invalidate_all(void) +{ + register_t mask, asid; + register_t s; + unsigned i; + + s = intr_disable(); + mask = mips_rd_pagemask(); + asid = mips_rd_entryhi() & TLBHI_ASID_MASK; + + for (i = mips_rd_wired(); i < num_tlbentries; i++) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 07:13: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 2DB491065673; Thu, 17 Jun 2010 07:13:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 83E058FC32; Thu, 17 Jun 2010 07:13:14 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o5H7D0ve064840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Jun 2010 10:13:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o5H7D0pY011141; Thu, 17 Jun 2010 10:13:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5H7D0nX011140; Thu, 17 Jun 2010 10:13:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 17 Jun 2010 10:13:00 +0300 From: Kostik Belousov To: Lawrence Stewart Message-ID: <20100617071300.GX13238@deviant.kiev.zoral.com.ua> References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C158B71.205@freebsd.org> <20100614085205.GD13238@deviant.kiev.zoral.com.ua> <4C1605A7.2000202@freebsd.org> <20100614104349.GF13238@deviant.kiev.zoral.com.ua> <4C198A90.3060905@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wrIrAujhz1F5gxq3" Content-Disposition: inline In-Reply-To: <4C198A90.3060905@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Matthew Fleming , src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@freebsd.org, brde@optusnet.com.au, svn-src-head@freebsd.org Subject: Re: svn commit: r209119 - 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: Thu, 17 Jun 2010 07:13:15 -0000 --wrIrAujhz1F5gxq3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 17, 2010 at 12:38:08PM +1000, Lawrence Stewart wrote: > On 06/14/10 20:43, Kostik Belousov wrote: > >On Mon, Jun 14, 2010 at 08:34:15PM +1000, Lawrence Stewart wrote: > >>On 06/14/10 18:52, Kostik Belousov wrote: > >>>On Mon, Jun 14, 2010 at 11:52:49AM +1000, Lawrence Stewart wrote: > >>>>On 06/13/10 20:10, Pawel Jakub Dawidek wrote: > >>>>>On Sun, Jun 13, 2010 at 02:39:55AM +0000, Lawrence Stewart wrote: > >>>>[snip] > >>>>>> > >>>>>>Modified: head/sys/sys/pcpu.h > >>>>>>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > >>>>>>--- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010 (r209118) > >>>>>>+++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 (r209119) > >>>>>>@@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[]; > >>>>>> #define DPCPU_ID_GET(i, n) (*DPCPU_ID_PTR(i, n)) > >>>>>> #define DPCPU_ID_SET(i, n, v) (*DPCPU_ID_PTR(i, n) =3D v) > >>>>>> > >>>>>>+/* > >>>>>>+ * Utility macros. > >>>>>>+ */ > >>>>>>+#define DPCPU_SUM(n, var, sum) \ > >>>>>>+do { \ > >>>>>>+ (sum) =3D 0; \ > >>>>>>+ u_int i; \ > >>>>>>+ CPU_FOREACH(i) \ > >>>>>>+ (sum) +=3D (DPCPU_ID_PTR(i, n))->var; \ > >>>>>>+} while (0) > >>>>> > >>>>>I'd suggest first swapping variable declaration and '(sum) =3D 0;'. > >>>>>Also using 'i' as a counter in macro can easly lead to name collisio= n. > >>>>>If you need to do it, I'd suggest '_i' or something. > >>>> > >>>>Given that the DPCPU variable name space is flat and variable names h= ave > >>>>to be unique, perhaps something like the following would address the > >>>>concerns raised? > >>>> > >>>>#define DPCPU_SUM(n, var, sum) = \ > >>>>do { = \ > >>>> u_int _##n##_i; = =20 > >>>> \ > >>>> (sum) =3D 0; = =20 > >>>> \ > >>>> CPU_FOREACH(_##n##_i) = =20 > >>>> \ > >>>> (sum) +=3D (DPCPU_ID_PTR(_##n##_i, n))->var; = =20 > >>>> \ > >>>>} while (0) > >>> > >>>You do not have to jump through this. Mostly by convention, in our ker= nel > >>>sources, names with "_" prefix are reserved for the infrastructure=20 > >>>(cannot > >>>say implementation). I think it is quite safe to use _i for the iterat= ion > >>>variable. > >>> > >>>As an example of this, look at sys/sys/mount.h, implementation of > >>>VFS_NEEDGIANT, VFS_LOCK_GIANT etc macros. They do use gcc ({}) extensi= on > >>>to provide function-like macros, but this is irrelevant. Or, look at > >>>the VFS_ASSERT_GIANT that is exactly like what you need. > >> > >>Ok cool, thanks for the info and pointers (I didn't know about the ({}) > >>extension or that "_" prefix was definitely reserved). I'm happy to use > >>_i. Does the following diff against head look suitable to commit? > >> > >>--- a/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010 +0000 > >>+++ b/sys/sys/pcpu.h Mon Jun 14 20:12:27 2010 +1000 > >>@@ -111,10 +111,10 @@ > >> */ > >> #define DPCPU_SUM(n, var, sum) = \ > >> do { = \ > >>+ u_int _i; \ > >> (sum) =3D 0; = \ > >>- u_int i; \ > >>- CPU_FOREACH(i) \ > >>- (sum) +=3D (DPCPU_ID_PTR(i, n))->var; = \ > >>+ CPU_FOREACH(_i) \ > >>+ (sum) +=3D (DPCPU_ID_PTR(_i, n))->var; = \ > >> } while (0) > > > >You might want to introduce local accumulator to prevent several=20 > >evaluations > >of sum, to avoid possible side-effects. Then, after, the loop, do single > >asignment to the the sum. > > > >Or, you could ditch the sum at all, indeed using ({}) and returning the > >result. __typeof is your friend to select proper type of accumulator. >=20 > So, something like this? >=20 > #define DPCPU_SUM(n, var) __extension__ \ > ({ \ > u_int _i; \ > __typeof((DPCPU_PTR(n))->var) sum; \ > \ > sum =3D 0; \ > CPU_FOREACH(_i) { \ > sum +=3D (DPCPU_ID_PTR(_i, n))->var; \ > } \ > sum; \ > }) >=20 > Which can be used like this: >=20 > totalss.n_in =3D DPCPU_SUM(ss, n_in); Yes, exactly. >=20 >=20 > I've tested the above and it works. I also prefer the idea of having=20 > DPCPU_SUM return the sum so that you can do "var =3D DPCPU_SUM(...)". My= =20 > only concern with this method is that the caller no longer has the=20 > choice to make the sum variable a larger type to avoid overflow. It=20 > would be nice to be able to have the DPCPU vars be uint32_t but be able= =20 > to sum them into a uint64_t accumulator for example. Perhaps this isn't= =20 > really an issue though... I'm not sure. You are worried about overflow in the sum of 32 or 64 variables, but if this is the case, then each member of the sum can overflow as well, IMO. Either ignore the issue, or use a uintmax_t. --wrIrAujhz1F5gxq3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwZyvwACgkQC3+MBN1Mb4hCygCggVYn/S5PXUgEhI/9Kgsdy7gp 5WwAnjK91AIc6FSJLUPctT7CFkRb5V0t =nbCD -----END PGP SIGNATURE----- --wrIrAujhz1F5gxq3-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 08:34: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 066A61065672; Thu, 17 Jun 2010 08:34:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 7280A8FC12; Thu, 17 Jun 2010 08:34:17 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o5H8Y9AY079376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Jun 2010 11:34:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o5H8Y9f4037675; Thu, 17 Jun 2010 11:34:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5H8Y9Wg037674; Thu, 17 Jun 2010 11:34:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 17 Jun 2010 11:34:09 +0300 From: Kostik Belousov To: Ed Schouten Message-ID: <20100617083409.GA13238@deviant.kiev.zoral.com.ua> References: <201006121322.o5CDMd57010715@svn.freebsd.org> <20100616221612.GZ1797@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zDL9gdIhmXu2QQXr" Content-Disposition: inline In-Reply-To: <20100616221612.GZ1797@hoeg.nl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209106 - 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, 17 Jun 2010 08:34:18 -0000 --zDL9gdIhmXu2QQXr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 17, 2010 at 12:16:12AM +0200, Ed Schouten wrote: > Hi Kostik, >=20 > * Konstantin Belousov wrote: > > Log: > > Add another variation of make_dev(9), make_dev_p(9), that is allowed > > to fail and can return useful error code. >=20 > While we're at it, couldn't we consider removing the `unit' argument > from this function? Nowadays unit numbers are mainly useful when using > clone lists, which have been almost entirely obsoleted by cdevpriv. We > could just call make_dev_credv with unit =3D=3D 0. Feel free to change it, I have no objections. --zDL9gdIhmXu2QQXr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwZ3gAACgkQC3+MBN1Mb4gxhQCfWevs0pZXogi8KW9PdYUHtT+J UnwAn3lt6gJOk23fQJVvKm1VLfQiV/gX =5qhM -----END PGP SIGNATURE----- --zDL9gdIhmXu2QQXr-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 08:49: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 B95211065674; Thu, 17 Jun 2010 08:49:31 +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 A8D158FC24; Thu, 17 Jun 2010 08:49: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 o5H8nVGV071594; Thu, 17 Jun 2010 08:49:31 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5H8nV3h071591; Thu, 17 Jun 2010 08:49:31 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006170849.o5H8nV3h071591@svn.freebsd.org> From: Ed Schouten Date: Thu, 17 Jun 2010 08:49: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: r209244 - 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, 17 Jun 2010 08:49:31 -0000 Author: ed Date: Thu Jun 17 08:49:31 2010 New Revision: 209244 URL: http://svn.freebsd.org/changeset/base/209244 Log: Remove the unit argument from the recently added make_dev_p(). New code that creates character devices shouldn't use device unit numbers, but only si_drv[12] to hold pointer to per-device data. Make this function more future proof by removing the unit number argument. Discussed with: kib Modified: head/sys/kern/kern_conf.c head/sys/sys/conf.h Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Thu Jun 17 05:03:01 2010 (r209243) +++ head/sys/kern/kern_conf.c Thu Jun 17 08:49:31 2010 (r209244) @@ -766,14 +766,14 @@ make_dev_credf(int flags, struct cdevsw } int -make_dev_p(int flags, struct cdev **cdev, struct cdevsw *devsw, int unit, +make_dev_p(int flags, struct cdev **cdev, struct cdevsw *devsw, struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, ...) { va_list ap; int res; va_start(ap, fmt); - res = make_dev_credv(flags, cdev, devsw, unit, cr, uid, gid, mode, + res = make_dev_credv(flags, cdev, devsw, 0, cr, uid, gid, mode, fmt, ap); va_end(ap); Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Thu Jun 17 05:03:01 2010 (r209243) +++ head/sys/sys/conf.h Thu Jun 17 08:49:31 2010 (r209244) @@ -271,8 +271,8 @@ struct cdev *make_dev_credf(int _flags, struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode, const char *_fmt, ...) __printflike(8, 9); int make_dev_p(int _flags, struct cdev **_cdev, struct cdevsw *_devsw, - int _unit, struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode, - const char *_fmt, ...) __printflike(9, 10); + struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode, + const char *_fmt, ...) __printflike(8, 9); struct cdev *make_dev_alias(struct cdev *_pdev, const char *_fmt, ...) __printflike(2, 3); void dev_lock(void); From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 09:49: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 B40521065673; Thu, 17 Jun 2010 09:49:54 +0000 (UTC) (envelope-from prvs=1777d6675c=brian@Awfulhak.org) Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9]) by mx1.freebsd.org (Postfix) with ESMTP id 54E8C8FC15; Thu, 17 Jun 2010 09:49:54 +0000 (UTC) Received: from pd5ml1no-ssvc.prod.shaw.ca ([10.0.153.166]) by pd6mo1no-svcs.prod.shaw.ca with ESMTP; 17 Jun 2010 03:34:52 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=K3_rCe1KIZ8A:10 a=ADBQPqJMlbwA:10 a=VphdPIyG4kEA:10 a=IkcTkHD0fZMA:10 a=MJPcHhXccCG8eBs0us8XwA==:17 a=6I5d2MoRAAAA:8 a=MMwg4So0AAAA:8 a=FZ2G38OXSC-SkUgBGwUA:9 a=Fn67_oPPTPshrGj52hok9r8f6S4A:4 a=QEXdDO2ut3YA:10 a=SV7veod9ZcQA:10 a=WJ3hkfHDukgA:10 Received: from unknown (HELO store.lan.Awfulhak.org) ([70.79.162.198]) by pd5ml1no-dmz.prod.shaw.ca with ESMTP; 17 Jun 2010 03:34:51 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 5B636C433C6_C19EC3BB; Thu, 17 Jun 2010 09:34:51 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id 0B501C460F7_C19EC33F; Thu, 17 Jun 2010 09:34:43 +0000 (GMT) Received: from dev.lan.Awfulhak.org (brian@dev.lan.Awfulhak.org [172.16.0.5]) by gw.Awfulhak.org (8.14.4/8.14.4) with ESMTP id o5H9YgLX089249; Thu, 17 Jun 2010 02:34:42 -0700 (PDT) (envelope-from brian@Awfulhak.org) Date: Thu, 17 Jun 2010 02:34:41 -0700 From: Brian Somers To: Dag-Erling =?UTF-8?B?U23DuHJncmF2?= Message-ID: <20100617023441.008cd737@dev.lan.Awfulhak.org> In-Reply-To: <86ljafwypm.fsf@ds4.des.no> References: <201006152158.o5FLwerZ005440@svn.freebsd.org> <86ljafwypm.fsf@ds4.des.no> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Jilles Tjoelker , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 09:49:54 -0000 On Wed, 16 Jun 2010 03:30:45 +0200 Dag-Erling Sm=C3=B8rgrav wr= ote: > Jilles Tjoelker writes: > > Log: > > sh: Add filename completion. >=20 > Wonderful! Now I'll never have to use csh again :) Is there a plan to change root's shell from csh to sh? If not, should ther= e be? I've been doing this locally for 17 years. --=20 Brian Somers Don't _EVER_ lose your sense of humour ! From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 10:03: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 A632C106566B; Thu, 17 Jun 2010 10:03:21 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0D18FC17; Thu, 17 Jun 2010 10:03:20 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.4/8.14.4) with ESMTP id o5HA3FsL037615; Thu, 17 Jun 2010 14:03:15 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1276768996; bh=JhJ2ns60vHn0nOUuGZ0+XzNPXNIdJh+CdakxYU9e3Ic=; l=796; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=RjbX3F4D0d2+gehAgxuA6YKJguqNcnk+UGG7f1ms1okNhMYqoLEhDxeuFSzWjWE5L qNMtGWouiyfPjn7BO/xDrm4vJT3GSr9X+MVFAungPsdHu/fwc9TAsXh1RO3rkG8oXC g9NRT5Rd8W7mKSwPRNesTw0It67Tq7c8y8bDq0kE= Received: (from ache@localhost) by nagual.pp.ru (8.14.4/8.14.4/Submit) id o5HA3F86037614; Thu, 17 Jun 2010 14:03:15 +0400 (MSD) (envelope-from ache) Date: Thu, 17 Jun 2010 14:03:15 +0400 From: Andrey Chernov To: Brian Somers Message-ID: <20100617100315.GA37522@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Brian Somers , Dag-Erling Sm??rgrav , Jilles Tjoelker , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201006152158.o5FLwerZ005440@svn.freebsd.org> <86ljafwypm.fsf@ds4.des.no> <20100617023441.008cd737@dev.lan.Awfulhak.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100617023441.008cd737@dev.lan.Awfulhak.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Jilles Tjoelker , Dag-Erling Sm??rgrav , svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Subject: Re: svn commit: r209221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 10:03:21 -0000 On Thu, Jun 17, 2010 at 02:34:41AM -0700, Brian Somers wrote: > On Wed, 16 Jun 2010 03:30:45 +0200 Dag-Erling Sm??rgrav wrote: > > Jilles Tjoelker writes: > > > Log: > > > sh: Add filename completion. > > > > Wonderful! Now I'll never have to use csh again :) > > Is there a plan to change root's shell from csh to sh? If not, should there be? > I've been doing this locally for 17 years. sh completion works very strange at now moment. Just two things: 1) $^I Display all 973 possibilities? (y or n) (tcsh - beep) 2) $ll^I beep second ^I completion, including non-program files. (tcsh - completeion, programs & aliases only) I don't remember other strange places right now. Verdict - not usable yet. -- http://ache.pp.ru/ From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 10:15: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 1266F1065674; Thu, 17 Jun 2010 10:15:14 +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 01E2F8FC1B; Thu, 17 Jun 2010 10:15: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 o5HAFD8C091111; Thu, 17 Jun 2010 10:15:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HAFDaU091109; Thu, 17 Jun 2010 10:15:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006171015.o5HAFDaU091109@svn.freebsd.org> From: Andriy Gapon Date: Thu, 17 Jun 2010 10:15: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: r209247 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 10:15:14 -0000 Author: avg Date: Thu Jun 17 10:15:13 2010 New Revision: 209247 URL: http://svn.freebsd.org/changeset/base/209247 Log: lock_profile_release_lock: do not compare unsigned with zero Found by: Coverity Prevent CID: 3660 Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/kern/subr_lock.c Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Thu Jun 17 09:43:07 2010 (r209246) +++ head/sys/kern/subr_lock.c Thu Jun 17 10:15:13 2010 (r209247) @@ -598,7 +598,7 @@ lock_profile_release_lock(struct lock_ob struct lock_profile_object *l; struct lock_prof_type *type; struct lock_prof *lp; - u_int64_t holdtime; + u_int64_t curtime, holdtime; struct lpohead *head; int spin; @@ -626,9 +626,11 @@ lock_profile_release_lock(struct lock_ob lp = lock_profile_lookup(lo, spin, l->lpo_file, l->lpo_line); if (lp == NULL) goto release; - holdtime = nanoseconds() - l->lpo_acqtime; - if (holdtime < 0) + curtime = nanoseconds(); + if (curtime < l->lpo_acqtime) goto release; + holdtime = curtime - l->lpo_acqtime; + /* * Record if the lock has been held longer now than ever * before. From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 11:54: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 366E91065672; Thu, 17 Jun 2010 11:54: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 23B9B8FC08; Thu, 17 Jun 2010 11:54: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 o5HBso0Q014591; Thu, 17 Jun 2010 11:54:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HBsnTh014584; Thu, 17 Jun 2010 11:54:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006171154.o5HBsnTh014584@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 Jun 2010 11:54: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: r209248 - in head/sys: amd64/amd64 amd64/conf amd64/include conf i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 11:54:50 -0000 Author: mav Date: Thu Jun 17 11:54:49 2010 New Revision: 209248 URL: http://svn.freebsd.org/changeset/base/209248 Log: Merge COUNT_XINVLTLB_HITS and COUNT_IPIS kernel options from i386 to amd64. This information can be very valuable for CPU sleep-time (and respectively idle power consumption) optimization. Add counters for timer-related IPIs. Reviewed by: jhb@ (previous version) Modified: head/sys/amd64/amd64/apic_vector.S head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/conf/NOTES head/sys/amd64/include/smp.h head/sys/conf/options.amd64 head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Thu Jun 17 10:15:13 2010 (r209247) +++ head/sys/amd64/amd64/apic_vector.S Thu Jun 17 11:54:49 2010 (r209248) @@ -36,6 +36,8 @@ * as well as IPI handlers. */ +#include "opt_smp.h" + #include #include @@ -135,6 +137,19 @@ IDTVEC(errorint) .text SUPERALIGN_TEXT IDTVEC(invltlb) +#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) + PUSH_FRAME + movl PCPU(CPUID), %eax +#ifdef COUNT_XINVLTLB_HITS + incl xhits_gbl(,%rax,4) +#endif +#ifdef COUNT_IPIS + movq ipi_invltlb_counts(,%rax,8),%rax + incq (%rax) +#endif + POP_FRAME +#endif + pushq %rax movq %cr3, %rax /* invalidate the TLB */ @@ -155,6 +170,19 @@ IDTVEC(invltlb) .text SUPERALIGN_TEXT IDTVEC(invlpg) +#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) + PUSH_FRAME + movl PCPU(CPUID), %eax +#ifdef COUNT_XINVLTLB_HITS + incl xhits_pg(,%rax,4) +#endif +#ifdef COUNT_IPIS + movq ipi_invlpg_counts(,%rax,8),%rax + incq (%rax) +#endif + POP_FRAME +#endif + pushq %rax movq smp_tlb_addr1, %rax @@ -175,6 +203,19 @@ IDTVEC(invlpg) .text SUPERALIGN_TEXT IDTVEC(invlrng) +#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) + PUSH_FRAME + movl PCPU(CPUID), %eax +#ifdef COUNT_XINVLTLB_HITS + incl xhits_rng(,%rax,4) +#endif +#ifdef COUNT_IPIS + movq ipi_invlrng_counts(,%rax,8),%rax + incq (%rax) +#endif + POP_FRAME +#endif + pushq %rax pushq %rdx @@ -201,6 +242,14 @@ IDTVEC(invlrng) .text SUPERALIGN_TEXT IDTVEC(invlcache) +#ifdef COUNT_IPIS + PUSH_FRAME + movl PCPU(CPUID), %eax + movq ipi_invlcache_counts(,%rax,8),%rax + incq (%rax) + POP_FRAME +#endif + pushq %rax wbinvd @@ -270,6 +319,11 @@ IDTVEC(cpususpend) SUPERALIGN_TEXT IDTVEC(rendezvous) PUSH_FRAME +#ifdef COUNT_IPIS + movl PCPU(CPUID), %eax + movq ipi_rendezvous_counts(,%rax,8), %rax + incq (%rax) +#endif call smp_rendezvous_action movq lapic, %rax movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */ Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Thu Jun 17 10:15:13 2010 (r209247) +++ head/sys/amd64/amd64/mp_machdep.c Thu Jun 17 11:54:49 2010 (r209248) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" #include "opt_mp_watchdog.h" #include "opt_sched.h" +#include "opt_smp.h" #include #include @@ -106,6 +107,20 @@ vm_offset_t smp_tlb_addr1; vm_offset_t smp_tlb_addr2; volatile int smp_tlb_wait; +#ifdef COUNT_IPIS +/* Interrupt counts. */ +static u_long *ipi_preempt_counts[MAXCPU]; +static u_long *ipi_ast_counts[MAXCPU]; +u_long *ipi_invltlb_counts[MAXCPU]; +u_long *ipi_invlrng_counts[MAXCPU]; +u_long *ipi_invlpg_counts[MAXCPU]; +u_long *ipi_invlcache_counts[MAXCPU]; +u_long *ipi_rendezvous_counts[MAXCPU]; +u_long *ipi_lazypmap_counts[MAXCPU]; +static u_long *ipi_hardclock_counts[MAXCPU]; +static u_long *ipi_statclock_counts[MAXCPU]; +#endif + extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32); /* @@ -970,6 +985,42 @@ start_ap(int apic_id) return 0; /* return FAILURE */ } +#ifdef COUNT_XINVLTLB_HITS +u_int xhits_gbl[MAXCPU]; +u_int xhits_pg[MAXCPU]; +u_int xhits_rng[MAXCPU]; +SYSCTL_NODE(_debug, OID_AUTO, xhits, CTLFLAG_RW, 0, ""); +SYSCTL_OPAQUE(_debug_xhits, OID_AUTO, global, CTLFLAG_RW, &xhits_gbl, + sizeof(xhits_gbl), "IU", ""); +SYSCTL_OPAQUE(_debug_xhits, OID_AUTO, page, CTLFLAG_RW, &xhits_pg, + sizeof(xhits_pg), "IU", ""); +SYSCTL_OPAQUE(_debug_xhits, OID_AUTO, range, CTLFLAG_RW, &xhits_rng, + sizeof(xhits_rng), "IU", ""); + +u_int ipi_global; +u_int ipi_page; +u_int ipi_range; +u_int ipi_range_size; +SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_global, CTLFLAG_RW, &ipi_global, 0, ""); +SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_page, CTLFLAG_RW, &ipi_page, 0, ""); +SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_range, CTLFLAG_RW, &ipi_range, 0, ""); +SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_range_size, CTLFLAG_RW, &ipi_range_size, + 0, ""); + +u_int ipi_masked_global; +u_int ipi_masked_page; +u_int ipi_masked_range; +u_int ipi_masked_range_size; +SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_masked_global, CTLFLAG_RW, + &ipi_masked_global, 0, ""); +SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_masked_page, CTLFLAG_RW, + &ipi_masked_page, 0, ""); +SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_masked_range, CTLFLAG_RW, + &ipi_masked_range, 0, ""); +SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_masked_range_size, CTLFLAG_RW, + &ipi_masked_range_size, 0, ""); +#endif /* COUNT_XINVLTLB_HITS */ + /* * Flush the TLB on all other CPU's */ @@ -1047,6 +1098,9 @@ smp_invltlb(void) if (smp_started) { smp_tlb_shootdown(IPI_INVLTLB, 0, 0); +#ifdef COUNT_XINVLTLB_HITS + ipi_global++; +#endif } } @@ -1054,8 +1108,12 @@ void smp_invlpg(vm_offset_t addr) { - if (smp_started) + if (smp_started) { smp_tlb_shootdown(IPI_INVLPG, addr, 0); +#ifdef COUNT_XINVLTLB_HITS + ipi_page++; +#endif + } } void @@ -1064,6 +1122,10 @@ smp_invlpg_range(vm_offset_t addr1, vm_o if (smp_started) { smp_tlb_shootdown(IPI_INVLRNG, addr1, addr2); +#ifdef COUNT_XINVLTLB_HITS + ipi_range++; + ipi_range_size += (addr2 - addr1) / PAGE_SIZE; +#endif } } @@ -1073,6 +1135,9 @@ smp_masked_invltlb(cpumask_t mask) if (smp_started) { smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, 0, 0); +#ifdef COUNT_XINVLTLB_HITS + ipi_masked_global++; +#endif } } @@ -1082,6 +1147,9 @@ smp_masked_invlpg(cpumask_t mask, vm_off if (smp_started) { smp_targeted_tlb_shootdown(mask, IPI_INVLPG, addr, 0); +#ifdef COUNT_XINVLTLB_HITS + ipi_masked_page++; +#endif } } @@ -1091,6 +1159,10 @@ smp_masked_invlpg_range(cpumask_t mask, if (smp_started) { smp_targeted_tlb_shootdown(mask, IPI_INVLRNG, addr1, addr2); +#ifdef COUNT_XINVLTLB_HITS + ipi_masked_range++; + ipi_masked_range_size += (addr2 - addr1) / PAGE_SIZE; +#endif } } @@ -1102,16 +1174,30 @@ ipi_bitmap_handler(struct trapframe fram ipi_bitmap = atomic_readandclear_int(&cpu_ipi_pending[cpu]); - if (ipi_bitmap & (1 << IPI_PREEMPT)) + if (ipi_bitmap & (1 << IPI_PREEMPT)) { +#ifdef COUNT_IPIS + (*ipi_preempt_counts[cpu])++; +#endif sched_preempt(curthread); - - /* Nothing to do for AST */ - - if (ipi_bitmap & (1 << IPI_HARDCLOCK)) + } + if (ipi_bitmap & (1 << IPI_AST)) { +#ifdef COUNT_IPIS + (*ipi_ast_counts[cpu])++; +#endif + /* Nothing to do for AST */ + } + if (ipi_bitmap & (1 << IPI_HARDCLOCK)) { +#ifdef COUNT_IPIS + (*ipi_hardclock_counts[cpu])++; +#endif hardclockintr(&frame); - - if (ipi_bitmap & (1 << IPI_STATCLOCK)) + } + if (ipi_bitmap & (1 << IPI_STATCLOCK)) { +#ifdef COUNT_IPIS + (*ipi_statclock_counts[cpu])++; +#endif statclockintr(&frame); + } } /* @@ -1432,3 +1518,38 @@ mp_grab_cpu_hlt(void) __asm __volatile("sti; hlt" : : : "memory"); return (retval); } + +#ifdef COUNT_IPIS +/* + * Setup interrupt counters for IPI handlers. + */ +static void +mp_ipi_intrcnt(void *dummy) +{ + char buf[64]; + int i; + + CPU_FOREACH(i) { + snprintf(buf, sizeof(buf), "cpu%d:invltlb", i); + intrcnt_add(buf, &ipi_invltlb_counts[i]); + snprintf(buf, sizeof(buf), "cpu%d:invlrng", i); + intrcnt_add(buf, &ipi_invlrng_counts[i]); + snprintf(buf, sizeof(buf), "cpu%d:invlpg", i); + intrcnt_add(buf, &ipi_invlpg_counts[i]); + snprintf(buf, sizeof(buf), "cpu%d:preempt", i); + intrcnt_add(buf, &ipi_preempt_counts[i]); + snprintf(buf, sizeof(buf), "cpu%d:ast", i); + intrcnt_add(buf, &ipi_ast_counts[i]); + snprintf(buf, sizeof(buf), "cpu%d:rendezvous", i); + intrcnt_add(buf, &ipi_rendezvous_counts[i]); + snprintf(buf, sizeof(buf), "cpu%d:lazypmap", i); + intrcnt_add(buf, &ipi_lazypmap_counts[i]); + snprintf(buf, sizeof(buf), "cpu%d:hardclock", i); + intrcnt_add(buf, &ipi_hardclock_counts[i]); + snprintf(buf, sizeof(buf), "cpu%d:statclock", i); + intrcnt_add(buf, &ipi_statclock_counts[i]); + } +} +SYSINIT(mp_ipi_intrcnt, SI_SUB_INTR, SI_ORDER_MIDDLE, mp_ipi_intrcnt, NULL); +#endif + Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Thu Jun 17 10:15:13 2010 (r209247) +++ head/sys/amd64/conf/NOTES Thu Jun 17 11:54:49 2010 (r209248) @@ -30,6 +30,11 @@ device mptable # Optional MPSPEC mpta # options MP_WATCHDOG +# Debugging options. +# +options COUNT_XINVLTLB_HITS # Counters for TLB events +options COUNT_IPIS # Per-CPU IPI interrupt counters + ##################################################################### Modified: head/sys/amd64/include/smp.h ============================================================================== --- head/sys/amd64/include/smp.h Thu Jun 17 10:15:13 2010 (r209247) +++ head/sys/amd64/include/smp.h Thu Jun 17 11:54:49 2010 (r209248) @@ -35,6 +35,14 @@ extern int mp_naps; extern int boot_cpu_id; extern struct pcb stoppcbs[]; extern int cpu_apic_ids[]; +#ifdef COUNT_IPIS +extern u_long *ipi_invltlb_counts[MAXCPU]; +extern u_long *ipi_invlrng_counts[MAXCPU]; +extern u_long *ipi_invlpg_counts[MAXCPU]; +extern u_long *ipi_invlcache_counts[MAXCPU]; +extern u_long *ipi_rendezvous_counts[MAXCPU]; +extern u_long *ipi_lazypmap_counts[MAXCPU]; +#endif /* IPI handlers */ inthand_t Modified: head/sys/conf/options.amd64 ============================================================================== --- head/sys/conf/options.amd64 Thu Jun 17 10:15:13 2010 (r209247) +++ head/sys/conf/options.amd64 Thu Jun 17 11:54:49 2010 (r209248) @@ -3,6 +3,8 @@ AUTO_EOI_1 opt_auto_eoi.h AUTO_EOI_2 opt_auto_eoi.h +COUNT_XINVLTLB_HITS opt_smp.h +COUNT_IPIS opt_smp.h MAXMEM PERFMON PMAP_SHPGPERPROC opt_pmap.h Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Thu Jun 17 10:15:13 2010 (r209247) +++ head/sys/i386/i386/mp_machdep.c Thu Jun 17 11:54:49 2010 (r209248) @@ -166,6 +166,8 @@ u_long *ipi_invlpg_counts[MAXCPU]; u_long *ipi_invlcache_counts[MAXCPU]; u_long *ipi_rendezvous_counts[MAXCPU]; u_long *ipi_lazypmap_counts[MAXCPU]; +static u_long *ipi_hardclock_counts[MAXCPU]; +static u_long *ipi_statclock_counts[MAXCPU]; #endif /* @@ -1266,19 +1268,24 @@ ipi_bitmap_handler(struct trapframe fram #endif sched_preempt(curthread); } - if (ipi_bitmap & (1 << IPI_AST)) { #ifdef COUNT_IPIS (*ipi_ast_counts[cpu])++; #endif /* Nothing to do for AST */ } - - if (ipi_bitmap & (1 << IPI_HARDCLOCK)) + if (ipi_bitmap & (1 << IPI_HARDCLOCK)) { +#ifdef COUNT_IPIS + (*ipi_hardclock_counts[cpu])++; +#endif hardclockintr(&frame); - - if (ipi_bitmap & (1 << IPI_STATCLOCK)) + } + if (ipi_bitmap & (1 << IPI_STATCLOCK)) { +#ifdef COUNT_IPIS + (*ipi_statclock_counts[cpu])++; +#endif statclockintr(&frame); + } } /* @@ -1574,20 +1581,24 @@ mp_ipi_intrcnt(void *dummy) int i; CPU_FOREACH(i) { - snprintf(buf, sizeof(buf), "cpu%d: invltlb", i); + snprintf(buf, sizeof(buf), "cpu%d:invltlb", i); intrcnt_add(buf, &ipi_invltlb_counts[i]); - snprintf(buf, sizeof(buf), "cpu%d: invlrng", i); + snprintf(buf, sizeof(buf), "cpu%d:invlrng", i); intrcnt_add(buf, &ipi_invlrng_counts[i]); - snprintf(buf, sizeof(buf), "cpu%d: invlpg", i); + snprintf(buf, sizeof(buf), "cpu%d:invlpg", i); intrcnt_add(buf, &ipi_invlpg_counts[i]); - snprintf(buf, sizeof(buf), "cpu%d: preempt", i); + snprintf(buf, sizeof(buf), "cpu%d:preempt", i); intrcnt_add(buf, &ipi_preempt_counts[i]); - snprintf(buf, sizeof(buf), "cpu%d: ast", i); + snprintf(buf, sizeof(buf), "cpu%d:ast", i); intrcnt_add(buf, &ipi_ast_counts[i]); - snprintf(buf, sizeof(buf), "cpu%d: rendezvous", i); + snprintf(buf, sizeof(buf), "cpu%d:rendezvous", i); intrcnt_add(buf, &ipi_rendezvous_counts[i]); - snprintf(buf, sizeof(buf), "cpu%d: lazypmap", i); + snprintf(buf, sizeof(buf), "cpu%d:lazypmap", i); intrcnt_add(buf, &ipi_lazypmap_counts[i]); + snprintf(buf, sizeof(buf), "cpu%d:hardclock", i); + intrcnt_add(buf, &ipi_hardclock_counts[i]); + snprintf(buf, sizeof(buf), "cpu%d:statclock", i); + intrcnt_add(buf, &ipi_statclock_counts[i]); } } SYSINIT(mp_ipi_intrcnt, SI_SUB_INTR, SI_ORDER_MIDDLE, mp_ipi_intrcnt, NULL); From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 12:05:47 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 67E761065672; Thu, 17 Jun 2010 12:05:47 +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 55B1A8FC1B; Thu, 17 Jun 2010 12:05:47 +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 o5HC5lL6017099; Thu, 17 Jun 2010 12:05:47 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HC5lV1017096; Thu, 17 Jun 2010 12:05:47 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201006171205.o5HC5lV1017096@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 17 Jun 2010 12:05: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: r209249 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 12:05:47 -0000 Author: gabor Date: Thu Jun 17 12:05:47 2010 New Revision: 209249 URL: http://svn.freebsd.org/changeset/base/209249 Log: - Add c99(7) manual page - Add MLINKS to c.7, c79.7, c89.7, c90.7 Added: head/share/man/man7/c99.7 (contents, props changed) Modified: head/share/man/man7/Makefile Modified: head/share/man/man7/Makefile ============================================================================== --- head/share/man/man7/Makefile Thu Jun 17 11:54:49 2010 (r209248) +++ head/share/man/man7/Makefile Thu Jun 17 12:05:47 2010 (r209249) @@ -7,6 +7,7 @@ MAN= adding_user.7 \ bsd.snmpmod.mk.7 \ build.7 \ clocks.7 \ + c99.7 \ development.7 \ environ.7 \ ffs.7 \ @@ -27,5 +28,9 @@ MAN= adding_user.7 \ MLINKS= intro.7 miscellaneous.7 MLINKS+= security.7 securelevel.7 +MLINKS+= c99.7 c.7 +MLINKS+= c99.7 c79.7 +MLINKS+= c99.7 c89.7 +MLINKS+= c99.7 c90.7 .include Added: head/share/man/man7/c99.7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man7/c99.7 Thu Jun 17 12:05:47 2010 (r209249) @@ -0,0 +1,183 @@ +.\" Copyright (C) 2007, 2010 Gabor Kovesdan. 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 17, 2010 +.Dt C 7 +.Os +.Sh NAME +.Nm c, c78, c89, c90, c99 +.Nd The C programming language +.Sh DESCRIPTION +C is a general purpose programming language, which has a strong connection +with the UNIX operating system and its derivatives, since the vast +majority of those systems were written in the C language. +The C language contains some basic ideas from the BCPL language through +the B language written by Ken Thompson in 1970 for the DEC PDP-7 machines. +The development of the UNIX operating system was started on a PDP-7 +machine in assembly language, but it made very difficult to port the existing +code to other systems. +.Pp +In 1972 Dennis M. Ritchie worked out the C programming language for +further development of the UNIX operating system. +The idea was to implement only the C compiler for different +platforms, and implement most part of the operating system +in the new programming language to simplify the portability between +different architectures. +It follows that C is very eligible for (but not limited to) writing +operating systems and low-level applications. +.Pp +The C language did not have a specification or standardized version for +a long time. +It went through a lot of changes and improvements for ages. +In 1978, Brian W. Kernighan and Dennis M. Ritchie published the +first book about C under the title "The C Programming Language". +We can think of this book as the first specification of the language. +This version is often referred as K&R C after the names of the authors. +Sometimes it is referred as C78, as well, after the publishing year of +the first edition of the book. +.Pp +It is important to notice, that the instruction set of the language is +limited to the most fundamental elements for simplicity. +Handling of the standard I/O and such common functions are implemented in +the libraries shipped with the compiler. +As these functions are also widely used, it was demanded to include into +the description what requisites the library should conform to, not just +strictly the language itself. +Accordingly, the aforementioned standards cover the library elements, as well. +The elements of this standard library is still not enough for more +complicated tasks. +In this case the provided system calls of the given operating system can be +used. +To not loose the portability by using these system calls, the POSIX +(Portable Operating System Interface) standard evolved. +It describes what functions should be available to keep portability. +Note, that POSIX is not a C standard, but an operating system standard +and thus is beyond the scope of this manual. +The standards discussed below are all C standards and only cover +the C programming language and the accompanying library. +.Pp +After the publication of the book mentioned before, +the American National Standards Institute (ANSI) started to work on +standardizing the language, and they announced ANSI X3.159-1989 +in 1989. +It is usually referred as ANSI C or C89. +The main difference in this standard were the function prototypes, +which is a new way of declaring functions. +With the old-style function declarations, the compiler was unable to +check the sanity of the actual parameters at a function call. +The old syntax was highly error-prone because incompatible parameters +were hard to detect in the program code and the problem only showed up +at run-time. +.Pp +In 1990, the International Organization for Standardization (ISO) adopted +the ANSI standard as ISO/IEC 9899:1990 in 1990. +This is also referred as ISO C or C90. +It only contains negligible minor modifications against ANSI C, +so the two standards often considered to be fully equivalent. +This was a very important milestone in the history of the C language, but the +development of the language did not stop. +.Pp +The ISO C standard was later extended with an amendment as +ISO/IEC 9899 AM1 in 1995. +This contained, for example, the wide-character support in wchar.h and +wctype.h. +Two corregenda were also published: Technical Corrigendum 1 as +ISO/IEC 9899 TCOR1 in 1995 and Technical Corrigendum 2 as ISO/IEC 9899 TCOR1 +in 1996. +The continuous development and growth made it necessary to work out a new +standard, which contains the new features and fixes the known defects and +deficiencies of the language. +As a result, ISO/IEC 9899:1999 was born in 1999. +Similarly to the other standards, this is referred after the +publication year as C99. +The improvements include the following: +.Bl -bullet -offset indent +.It +Inline functions +.It +Support for variable length arrays +.It +New high-precision integer type named long long int, and other integer types +defined in stdint.h +.It +New boolen data type implemented in stdbool.h +.It +One line comments taken from the C++ language +.It +Some new preprocessor features +.It +New variables can be declared anywhere, not just in the beginning of the +program or program blocks +.It +No implicit int type +.El +.Pp +Since then new standards have not been published, but the C language is still +evolving. +New and useful features have been showed up in the most famous +C compiler: GNU C. +Most of the UNIX-like operating systems use GNU C as a system compiler, +but those addition in GNU C should not be considered as +standard features. +.Sh SEE ALSO +.Xr cc 1 , +.Xr c89 1 , +.Xr c99 1 +.Sh STANDARDS +.Rs +.%A ANSI +.%T X3.159-1989 +.Re +.Pp +.Rs +.%A ISO/IEC +.%T 9899:1990, Programming languages -- C +.Re +.Pp +.Rs +.%A ISO/IEC +.%T 9899 AM1 +.Re +.Pp +.Rs +.%A ISO/IEC +.%T 9899 TCOR1, Programming languages -- C, Technical Corrigendum 1 +.Re +.Pp +.Rs +.%A ISO/IEC +.%T 9899 TCOR2, Programming languages -- C, Technical Corrigendum 2 +.Re +.Pp +.Rs +.%A ISO/IEC +.%T 9899:1999, Programming languages -- C +.Re +.Sh HISTORY +This manual page first appeared in +.Fx 9.0 . +.Sh AUTHORS +This manual page was originally written by +.An Gabor Kovesdan Aq gabor@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 12: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 A2129106564A; Thu, 17 Jun 2010 12:17:33 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id A502C8FC1C; Thu, 17 Jun 2010 12:17:32 +0000 (UTC) Received: by wyb34 with SMTP id 34so3722910wyb.13 for ; Thu, 17 Jun 2010 05:17:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=y0yvqgQSuAqKcMPWtX6DLlRQwku7vFIuIiX2YJl0Mho=; b=vjDy2h2LXEYFOXchklBwNc44+JcSqJQVEWO1oRHZDHCjhCsp8XrfF8Wuibes3C5O4v 2kZLCV3H+dhSPhP1/pYr8HqLmHuSs/oD3itRf8C8VUP7GqtC6NkNmn4Cad5TN2Ph6Bdi 7noKD8Ae3RhHYwzeozaqYEv43Y94KvyCorX/I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=A7g+foC+M/3PDQR8SUXwUWj+pbfpSSz8FeNmQBJb0IyMcmlLTp300uZ+D4JNO2o6OR CmXe9isKmbGqWEgCfl2/jXDlgeY3PItl4g9AQNMviRIijKZLX6pupTECxMjHEJjmSaQF pFp3ges91wojyE7AM4r6JLifPIWpNalhQwcIs= MIME-Version: 1.0 Received: by 10.216.87.201 with SMTP id y51mr6356593wee.80.1276777050364; Thu, 17 Jun 2010 05:17:30 -0700 (PDT) Received: by 10.216.51.78 with HTTP; Thu, 17 Jun 2010 05:17:30 -0700 (PDT) In-Reply-To: <201006171205.o5HC5lV1017096@svn.freebsd.org> References: <201006171205.o5HC5lV1017096@svn.freebsd.org> Date: Thu, 17 Jun 2010 16:17:30 +0400 Message-ID: From: pluknet To: Gabor Kovesdan Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209249 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 12:17:33 -0000 On 17 June 2010 16:05, Gabor Kovesdan wrote: > Author: gabor > Date: Thu Jun 17 12:05:47 2010 > New Revision: 209249 > URL: http://svn.freebsd.org/changeset/base/209249 > > Log: > =A0- Add c99(7) manual page > =A0- Add MLINKS to c.7, c79.7, c89.7, c90.7 > > Added: > =A0head/share/man/man7/c99.7 =A0 (contents, props changed) > Modified: > =A0head/share/man/man7/Makefile > > Modified: head/share/man/man7/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/man/man7/Makefile =A0 =A0 =A0 =A0Thu Jun 17 11:54:49 2010 = =A0 =A0 =A0 =A0(r209248) > +++ head/share/man/man7/Makefile =A0 =A0 =A0 =A0Thu Jun 17 12:05:47 2010 = =A0 =A0 =A0 =A0(r209249) > @@ -7,6 +7,7 @@ MAN=3D =A0 =A0adding_user.7 \ > =A0 =A0 =A0 =A0bsd.snmpmod.mk.7 \ > =A0 =A0 =A0 =A0build.7 \ > =A0 =A0 =A0 =A0clocks.7 \ > + =A0 =A0 =A0 c99.7 \ > =A0 =A0 =A0 =A0development.7 \ > =A0 =A0 =A0 =A0environ.7 \ > =A0 =A0 =A0 =A0ffs.7 \ > @@ -27,5 +28,9 @@ MAN=3D =A0adding_user.7 \ > > =A0MLINKS=3D =A0 =A0 =A0 =A0intro.7 miscellaneous.7 > =A0MLINKS+=3D security.7 securelevel.7 > +MLINKS+=3D c99.7 c.7 > +MLINKS+=3D c99.7 c79.7 Hi, should it be MLINKS+=3D c99.7 c78.7 instead? You cite c78 in manpage, but link to c79 here in Makefile. --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 12:25:47 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 BED781065675; Thu, 17 Jun 2010 12:25:47 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADB388FC1E; Thu, 17 Jun 2010 12:25:47 +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 o5HCPl2k021561; Thu, 17 Jun 2010 12:25:47 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HCPlXD021559; Thu, 17 Jun 2010 12:25:47 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201006171225.o5HCPlXD021559@svn.freebsd.org> From: Alexander Leidinger Date: Thu, 17 Jun 2010 12:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209250 - head/etc/periodic/daily X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2010 12:25:47 -0000 Author: netchild Date: Thu Jun 17 12:25:47 2010 New Revision: 209250 URL: http://svn.freebsd.org/changeset/base/209250 Log: - add the zfs scrub script - move the zfs status script into the MK_ZFS conditional to respect WITHOUT_ZFS Noticed by: Andrzej Tobola Modified: head/etc/periodic/daily/Makefile Modified: head/etc/periodic/daily/Makefile ============================================================================== --- head/etc/periodic/daily/Makefile Thu Jun 17 12:05:47 2010 (r209249) +++ head/etc/periodic/daily/Makefile Thu Jun 17 12:25:47 2010 (r209250) @@ -8,7 +8,6 @@ FILES= 100.clean-disks \ 200.backup-passwd \ 330.news \ 400.status-disks \ - 404.status-zfs \ 405.status-ata-raid \ 406.status-gmirror \ 407.status-graid3 \ @@ -53,4 +52,9 @@ FILES+= 150.clean-hoststat \ 500.queuerun .endif +.if ${MK_ZFS} != "no" +FILES+= 404.status-zfs \ + 800.scrub-zfs +.endif + .include From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 12:35: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 92DC4106566C; Thu, 17 Jun 2010 12:35:17 +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 81D5E8FC1D; Thu, 17 Jun 2010 12:35: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 o5HCZHms023725; Thu, 17 Jun 2010 12:35:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HCZHbI023723; Thu, 17 Jun 2010 12:35:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006171235.o5HCZHbI023723@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 17 Jun 2010 12:35: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: r209252 - head/sys/amd64/ia32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2010 12:35:17 -0000 Author: kib Date: Thu Jun 17 12:35:17 2010 New Revision: 209252 URL: http://svn.freebsd.org/changeset/base/209252 Log: In the ia32_{get,set}_fpcontext(), use fpu{get,set}userregs instead of fpu{get,set}regs. Noted by: bde MFC after: 1 month Modified: head/sys/amd64/ia32/ia32_signal.c Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Thu Jun 17 12:30:41 2010 (r209251) +++ head/sys/amd64/ia32/ia32_signal.c Thu Jun 17 12:35:17 2010 (r209252) @@ -98,7 +98,8 @@ ia32_get_fpcontext(struct thread *td, st * 64bit instruction and data pointers. Ignore the difference * for now, it should be irrelevant for most applications. */ - mcp->mc_ownedfp = fpugetregs(td, (struct savefpu *)&mcp->mc_fpstate); + mcp->mc_ownedfp = fpugetuserregs(td, + (struct savefpu *)&mcp->mc_fpstate); mcp->mc_fpformat = fpuformat(); } @@ -115,7 +116,7 @@ ia32_set_fpcontext(struct thread *td, co fpstate_drop(td); else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { - fpusetregs(td, (struct savefpu *)&mcp->mc_fpstate); + fpusetuserregs(td, (struct savefpu *)&mcp->mc_fpstate); } else return (EINVAL); return (0); From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 12:37: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 CBBE31065677; Thu, 17 Jun 2010 12:37:50 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAA028FC27; Thu, 17 Jun 2010 12:37: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 o5HCboQl024352; Thu, 17 Jun 2010 12:37:50 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HCboRM024350; Thu, 17 Jun 2010 12:37:50 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201006171237.o5HCboRM024350@svn.freebsd.org> From: Alexander Leidinger Date: Thu, 17 Jun 2010 12:37: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: r209253 - 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: Thu, 17 Jun 2010 12:37:50 -0000 Author: netchild Date: Thu Jun 17 12:37:50 2010 New Revision: 209253 URL: http://svn.freebsd.org/changeset/base/209253 Log: Add the ZFS periodic daily scripts to the ZFS part. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jun 17 12:35:17 2010 (r209252) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jun 17 12:37:50 2010 (r209253) @@ -596,6 +596,8 @@ OLD_FILES+=usr/share/man/man1/dtrace.1.g OLD_FILES+=boot/gptzfsboot OLD_FILES+=boot/zfsboot OLD_FILES+=boot/zfsloader +OLD_FILES+=etc/periodic/daily/404.status-zfs +OLD_FILES+=etc/periodic/daily/800.scrub-zfs OLD_LIBS+=lib/libzfs.so.2 OLD_LIBS+=lib/libzpool.so.2 OLD_FILES+=rescue/zfs From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 12:44: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 09C02106566C; Thu, 17 Jun 2010 12:44:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 7016F8FC0C; Thu, 17 Jun 2010 12:44:29 +0000 (UTC) Received: from c122-106-175-69.carlnfd1.nsw.optusnet.com.au (c122-106-175-69.carlnfd1.nsw.optusnet.com.au [122.106.175.69]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o5HCiPwK009548 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Jun 2010 22:44:26 +1000 Date: Thu, 17 Jun 2010 22:44:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Kostik Belousov In-Reply-To: <20100617071300.GX13238@deviant.kiev.zoral.com.ua> Message-ID: <20100617223406.B40711@delplex.bde.org> References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C158B71.205@freebsd.org> <20100614085205.GD13238@deviant.kiev.zoral.com.ua> <4C1605A7.2000202@freebsd.org> <20100614104349.GF13238@deviant.kiev.zoral.com.ua> <4C198A90.3060905@freebsd.org> <20100617071300.GX13238@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Matthew Fleming , src-committers@FreeBSD.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@FreeBSD.org, brde@optusnet.com.au, svn-src-head@FreeBSD.org, Lawrence Stewart Subject: Re: svn commit: r209119 - 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: Thu, 17 Jun 2010 12:44:30 -0000 On Thu, 17 Jun 2010, Kostik Belousov wrote: > On Thu, Jun 17, 2010 at 12:38:08PM +1000, Lawrence Stewart wrote: >> I've tested the above and it works. I also prefer the idea of having >> DPCPU_SUM return the sum so that you can do "var = DPCPU_SUM(...)". My >> only concern with this method is that the caller no longer has the >> choice to make the sum variable a larger type to avoid overflow. It >> would be nice to be able to have the DPCPU vars be uint32_t but be able >> to sum them into a uint64_t accumulator for example. Perhaps this isn't >> really an issue though... I'm not sure. > You are worried about overflow in the sum of 32 or 64 variables, but if > this is the case, then each member of the sum can overflow as well, IMO. > Either ignore the issue, or use a uintmax_t. Or use int variables so that the overflow trap can work, and fix the overflow trap to work (gcc -ftapv, but this is unusable in the kernel), and get a nice panic on all overflows, not just here :-). Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 13:59: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 C48931065673; Thu, 17 Jun 2010 13:59:41 +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 B39568FC13; Thu, 17 Jun 2010 13:59: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 o5HDxfw9047097; Thu, 17 Jun 2010 13:59:41 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HDxfN7047095; Thu, 17 Jun 2010 13:59:41 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201006171359.o5HDxfN7047095@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 17 Jun 2010 13:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209254 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 13:59:41 -0000 Author: gabor Date: Thu Jun 17 13:59:41 2010 New Revision: 209254 URL: http://svn.freebsd.org/changeset/base/209254 Log: - Fix typo, it should have been c78.7 Submitted by: pluknet Modified: head/share/man/man7/Makefile Modified: head/share/man/man7/Makefile ============================================================================== --- head/share/man/man7/Makefile Thu Jun 17 12:37:50 2010 (r209253) +++ head/share/man/man7/Makefile Thu Jun 17 13:59:41 2010 (r209254) @@ -29,7 +29,7 @@ MAN= adding_user.7 \ MLINKS= intro.7 miscellaneous.7 MLINKS+= security.7 securelevel.7 MLINKS+= c99.7 c.7 -MLINKS+= c99.7 c79.7 +MLINKS+= c99.7 c78.7 MLINKS+= c99.7 c89.7 MLINKS+= c99.7 c90.7 From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 14:00: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 A782A1065672; Thu, 17 Jun 2010 14:00:07 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 47F308FC18; Thu, 17 Jun 2010 14:00:07 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 62D1C14DBB84; Thu, 17 Jun 2010 16:00:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dbMosyD831y5; Thu, 17 Jun 2010 16:00:04 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 5AEA314DBBF3; Thu, 17 Jun 2010 16:00:03 +0200 (CEST) Message-ID: <4C1A2A61.90807@FreeBSD.org> Date: Thu, 17 Jun 2010 16:00:01 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; es-ES; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: pluknet References: <201006171205.o5HC5lV1017096@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209249 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 14:00:07 -0000 > Hi, should it be MLINKS+= c99.7 c78.7 instead? > You cite c78 in manpage, but link to c79 here in Makefile. > Oh, yes, I just made a typo. Fixed, thanks. -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 14:37: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 111111065674; Thu, 17 Jun 2010 14:37:48 +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 0010B8FC17; Thu, 17 Jun 2010 14:37:47 +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 o5HEblNF059172; Thu, 17 Jun 2010 14:37:47 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HEbli2059170; Thu, 17 Jun 2010 14:37:47 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201006171437.o5HEbli2059170@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 17 Jun 2010 14:37: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: r209255 - head/usr.bin/c99 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2010 14:37:48 -0000 Author: gabor Date: Thu Jun 17 14:37:47 2010 New Revision: 209255 URL: http://svn.freebsd.org/changeset/base/209255 Log: - Update GCC reference from 3.3 to 4.2 [1] - Add reference to c99(7) Submitted by: stefanf Modified: head/usr.bin/c99/c99.1 Modified: head/usr.bin/c99/c99.1 ============================================================================== --- head/usr.bin/c99/c99.1 Thu Jun 17 13:59:41 2010 (r209254) +++ head/usr.bin/c99/c99.1 Thu Jun 17 14:37:47 2010 (r209255) @@ -26,7 +26,7 @@ .\" From FreeBSD: src/usr.bin/c89/c89.1,v 1.11 2007/03/10 07:10:01 ru Exp .\" $FreeBSD$ .\" -.Dd October 7, 2002 +.Dd June 17, 2010 .Dt C99 1 .Os .Sh NAME @@ -181,7 +181,8 @@ operand is significant. .Sh SEE ALSO .Xr ar 1 , .Xr c89 1 , -.Xr cc 1 +.Xr cc 1 , +.Xr c99 7 .Sh STANDARDS The .Nm @@ -195,4 +196,4 @@ features that .Tn GCC actually implements. See -.Pa http://gcc.gnu.org/gcc-3.3/c99status.html . +.Pa http://gcc.gnu.org/gcc-4.2/c99status.html . From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 16:12: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 332EF1065672; Thu, 17 Jun 2010 16:12:07 +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 226D98FC13; Thu, 17 Jun 2010 16:12: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 o5HGC7Ak082420; Thu, 17 Jun 2010 16:12:07 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HGC6Lq082419; Thu, 17 Jun 2010 16:12:06 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201006171612.o5HGC6Lq082419@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 17 Jun 2010 16:12: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: r209256 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 16:12:07 -0000 Author: jh Date: Thu Jun 17 16:12:06 2010 New Revision: 209256 URL: http://svn.freebsd.org/changeset/base/209256 Log: - Fix compilation of the subr_unit.c user space test program. - Use %zu for size_t in a few format strings. Modified: head/sys/kern/subr_unit.c Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Thu Jun 17 14:37:47 2010 (r209255) +++ head/sys/kern/subr_unit.c Thu Jun 17 16:12:06 2010 (r209256) @@ -153,6 +153,7 @@ mtx_assert(struct mtx *mp, int flag) } #define CTASSERT(foo) +#define WITNESS_WARN(flags, lock, fmt, ...) (void)0 #endif /* USERLAND */ @@ -825,9 +826,9 @@ main(int argc __unused, const char **arg memset(a, 0, sizeof a); - fprintf(stderr, "sizeof(struct unr) %d\n", sizeof (struct unr)); - fprintf(stderr, "sizeof(struct unrb) %d\n", sizeof (struct unrb)); - fprintf(stderr, "sizeof(struct unrhdr) %d\n", sizeof (struct unrhdr)); + fprintf(stderr, "sizeof(struct unr) %zu\n", sizeof(struct unr)); + fprintf(stderr, "sizeof(struct unrb) %zu\n", sizeof(struct unrb)); + fprintf(stderr, "sizeof(struct unrhdr) %zu\n", sizeof(struct unrhdr)); fprintf(stderr, "NBITS %d\n", NBITS); x = 1; for (m = 0; m < NN * 100; m++) { From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 17:34: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 104781065676; Thu, 17 Jun 2010 17:34:46 +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 DB0F98FC1B; Thu, 17 Jun 2010 17: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 o5HHYj4s000998; Thu, 17 Jun 2010 17:34:45 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HHYjtB000996; Thu, 17 Jun 2010 17:34:45 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006171734.o5HHYjtB000996@svn.freebsd.org> From: Rui Paulo Date: Thu, 17 Jun 2010 17: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: r209258 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 17:34:46 -0000 Author: rpaulo Date: Thu Jun 17 17:34:45 2010 New Revision: 209258 URL: http://svn.freebsd.org/changeset/base/209258 Log: Make DTrace syscall provider work again by including opt_kdtrace.h here. Modified: head/sys/kern/subr_trap.c Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Thu Jun 17 17:06:52 2010 (r209257) +++ head/sys/kern/subr_trap.c Thu Jun 17 17:34:45 2010 (r209258) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" +#include "opt_kdtrace.h" #ifdef __i386__ #include "opt_npx.h" #endif From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 17:38:39 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 7CB5E106566B; Thu, 17 Jun 2010 17:38:39 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C8A18FC1B; Thu, 17 Jun 2010 17:38:39 +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 o5HHcdY8001902; Thu, 17 Jun 2010 17:38:39 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HHcdnq001900; Thu, 17 Jun 2010 17:38:39 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201006171738.o5HHcdnq001900@svn.freebsd.org> From: Jack F Vogel Date: Thu, 17 Jun 2010 17:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209259 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2010 17:38:39 -0000 Author: jfv Date: Thu Jun 17 17:38:39 2010 New Revision: 209259 URL: http://svn.freebsd.org/changeset/base/209259 Log: Two stats were duplicated, thanks to Andrew Boyer for pointing this out. Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jun 17 17:34:45 2010 (r209258) +++ head/sys/dev/e1000/if_em.c Thu Jun 17 17:38:39 2010 (r209259) @@ -4960,12 +4960,6 @@ em_add_hw_stats(struct adapter *adapter) SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "xoff_txd", CTLFLAG_RD, &adapter->stats.xofftxc, "XOFF Transmitted"); - SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_recvd", - CTLFLAG_RD, &adapter->stats.gprc, - "Good Packets Received"); - SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "good_pkts_txd", - CTLFLAG_RD, &adapter->stats.gptc, - "Good Packets Transmitted"); /* Packet Reception Stats */ SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "total_pkts_recvd", From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 17:39: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 0B0321065675; Thu, 17 Jun 2010 17:39:52 +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 EF3118FC21; Thu, 17 Jun 2010 17:39: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 o5HHdpJN002239; Thu, 17 Jun 2010 17:39:51 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HHdp4t002237; Thu, 17 Jun 2010 17:39:51 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006171739.o5HHdp4t002237@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 17 Jun 2010 17:39: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: r209260 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 17:39:52 -0000 Author: pjd Date: Thu Jun 17 17:39:51 2010 New Revision: 209260 URL: http://svn.freebsd.org/changeset/base/209260 Log: Backout r207970 for now, it can lead to deadlocks. Reported by: kan MFC after: 3 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Jun 17 17:38:39 2010 (r209259) +++ head/sys/kern/vfs_subr.c Thu Jun 17 17:39:51 2010 (r209260) @@ -822,19 +822,6 @@ static struct kproc_desc vnlru_kp = { SYSINIT(vnlru, SI_SUB_KTHREAD_UPDATE, SI_ORDER_FIRST, kproc_start, &vnlru_kp); -static void -vfs_lowmem(void *arg __unused) -{ - - /* - * On low memory condition free 1/8th of the free vnodes. - */ - mtx_lock(&vnode_free_list_mtx); - vnlru_free(freevnodes / 8); - mtx_unlock(&vnode_free_list_mtx); -} -EVENTHANDLER_DEFINE(vm_lowmem, vfs_lowmem, NULL, 0); - /* * Routines having to do with the management of the vnode table. */ From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 17:41: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 7F150106564A; Thu, 17 Jun 2010 17:41:42 +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 6E9438FC1C; Thu, 17 Jun 2010 17:41: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 o5HHfgwR002681; Thu, 17 Jun 2010 17:41:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HHfge0002679; Thu, 17 Jun 2010 17:41:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006171741.o5HHfge0002679@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 17 Jun 2010 17:41: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: r209261 - 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: Thu, 17 Jun 2010 17:41:42 -0000 Author: pjd Date: Thu Jun 17 17:41:42 2010 New Revision: 209261 URL: http://svn.freebsd.org/changeset/base/209261 Log: Turn off UMA allocations on all archs by default. It isn't stable even on amd64. Reported by: many MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jun 17 17:39:51 2010 (r209260) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jun 17 17:41:42 2010 (r209261) @@ -33,13 +33,9 @@ #include #include -#if defined(__amd64__) -static int zio_use_uma = 1; -#else -static int zio_use_uma = 0; -#endif SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, zio, CTLFLAG_RW, 0, "ZFS ZIO"); +static int zio_use_uma = 0; TUNABLE_INT("vfs.zfs.zio.use_uma", &zio_use_uma); SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, use_uma, CTLFLAG_RDTUN, &zio_use_uma, 0, "Use uma(9) for ZIO allocations"); From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 18:09: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 C0E7D1065678; Thu, 17 Jun 2010 18:09:03 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id 955838FC1E; Thu, 17 Jun 2010 18:09:03 +0000 (UTC) Received: from smtp.hudson-trading.com ([209.249.190.9] helo=gnnmac.hudson-trading.com) by vps.hungerhost.com with esmtpa (Exim 4.69) (envelope-from ) id 1OPJ9Y-0003VB-U9; Thu, 17 Jun 2010 13:45:25 -0400 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: George Neville-Neil In-Reply-To: <201006171738.o5HHcdnq001900@svn.freebsd.org> Date: Thu, 17 Jun 2010 13:45:22 -0400 Content-Transfer-Encoding: 7bit Message-Id: References: <201006171738.o5HHcdnq001900@svn.freebsd.org> To: Jack F Vogel X-Mailer: Apple Mail (2.1081) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Source: X-Source-Args: X-Source-Dir: Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209259 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2010 18:09:03 -0000 On Jun 17, 2010, at 13:38 , Jack F Vogel wrote: > Author: jfv > Date: Thu Jun 17 17:38:39 2010 > New Revision: 209259 > URL: http://svn.freebsd.org/changeset/base/209259 > > Log: > Two stats were duplicated, thanks to Andrew Boyer > for pointing this out. > And thanks to you for fixing it! Best, George From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 19:28: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 928B81065675; Thu, 17 Jun 2010 19:28:56 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 823D68FC1B; Thu, 17 Jun 2010 19:28: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 o5HJSupL026839; Thu, 17 Jun 2010 19:28:56 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HJSugl026837; Thu, 17 Jun 2010 19:28:56 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201006171928.o5HJSugl026837@svn.freebsd.org> From: Sean Bruno Date: Thu, 17 Jun 2010 19:28: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: r209266 - head/usr.sbin/mptutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2010 19:28:56 -0000 Author: sbruno Date: Thu Jun 17 19:28:56 2010 New Revision: 209266 URL: http://svn.freebsd.org/changeset/base/209266 Log: Expand man page to document the fact that mptutil/mpt doesn't support RAID volumes in excess of 2TB. Document workaround via geom or zfs Modified submitter's original patch to reference why this is broken and what to do to work around the issue. Submitted by: hubert@tournier.org PR: bin/147572 Reviewed by: jhb MFC after: 2 weeks Modified: head/usr.sbin/mptutil/mptutil.8 Modified: head/usr.sbin/mptutil/mptutil.8 ============================================================================== --- head/usr.sbin/mptutil/mptutil.8 Thu Jun 17 19:25:05 2010 (r209265) +++ head/usr.sbin/mptutil/mptutil.8 Thu Jun 17 19:28:56 2010 (r209266) @@ -384,3 +384,15 @@ configurations may not work reliably. .Pp Drive configuration commands result in an excessive flood of messages on the console. +.Pp +The mpt version 1 API that is used by +.Nm +and +.Xr mpt 4 +doesn't support volumes above two terabytes. +This is a limitation of the API. +If you are using this adapter with volumes larger than two terabytes, use the adapter in JBOD mode. +Utilize +.Xr geom 8 +.Xr zfs 1M +or another software volume manager to work around this limitation. From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 19:36:55 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 1A3F0106566B for ; Thu, 17 Jun 2010 19:36:55 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id AB8168FC08 for ; Thu, 17 Jun 2010 19:36:54 +0000 (UTC) Received: (qmail 19303 invoked by uid 399); 17 Jun 2010 19:36:53 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 17 Jun 2010 19:36:53 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C1A7953.4080201@FreeBSD.org> Date: Thu, 17 Jun 2010 12:36:51 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.9) Gecko/20100330 Thunderbird/3.0.4 MIME-Version: 1.0 To: Andrey Chernov , Brian Somers , Dag-Erling Sm??rgrav , Jilles Tjoelker , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201006152158.o5FLwerZ005440@svn.freebsd.org> <86ljafwypm.fsf@ds4.des.no> <20100617023441.008cd737@dev.lan.Awfulhak.org> <20100617100315.GA37522@nagual.pp.ru> In-Reply-To: <20100617100315.GA37522@nagual.pp.ru> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r209221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 19:36:55 -0000 On 06/17/10 03:03, Andrey Chernov wrote: > On Thu, Jun 17, 2010 at 02:34:41AM -0700, Brian Somers wrote: >> On Wed, 16 Jun 2010 03:30:45 +0200 Dag-Erling Sm??rgrav wrote: >>> Jilles Tjoelker writes: >>>> Log: >>>> sh: Add filename completion. >>> >>> Wonderful! Now I'll never have to use csh again :) >> >> Is there a plan to change root's shell from csh to sh? If not, should there be? >> I've been doing this locally for 17 years. Me too (as in, always changing it), but every time this is discussed it's the bikeshed from $CULTURALLY_RELEVANT_PLACE_OF_TORMENT. FWIW, what I actually do is set the shell for both root and my unprivileged user to sh, compile bash static, and put a copy of the static shell in /root. Then my .profile tests for the existence of bash and execs it if available. > sh completion works very strange at now moment. These are basically bourne-type shell behaviors that are different from *csh. > Just two things: > > 1) $^I > Display all 973 possibilities? (y or n) > (tcsh - beep) bash also beeps here, FWIW, although I think there is a knob to twist to make it do what sh is doing here. > 2) $ll^I > beep > second ^I > completion, including non-program files. This is a libedit thing. libreadline (which is what bash uses) has a flag to control this behavior that you can add to ~/.inputrc which makes it show all of the options the first time. The inclusion of non-program files in the current directory as input to a command is a feature, since it allows you to do things like: cd /etc vi make^I Having the shell include non-{program|alias} stuff as the first completion is dubious (bash does not do this). > (tcsh - completeion, programs& aliases only) > > I don't remember other strange places right now. Verdict - not usable yet. I've been very supportive of Jilles work up to this point, and I think he's done a great job of making our sh functional and compliant as a scripting shell. However in my mind adding completion (and his suggested inclusion of the kill builtin) tips the balance from "good system shell" to more of an interactive shell, and that makes me wonder if this is the right direction to go in. If we want a good interactive bourne-based shell in the base I'd rather have the discussion about which one to import, rather than trying to have our sh catch up with the last 15 years of development in this area. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 19: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 C6C83106566B; Thu, 17 Jun 2010 19:48:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B65928FC2B; Thu, 17 Jun 2010 19: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 o5HJm3Dv031260; Thu, 17 Jun 2010 19:48:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HJm3Hc031258; Thu, 17 Jun 2010 19:48:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006171948.o5HJm3Hc031258@svn.freebsd.org> From: Xin LI Date: Thu, 17 Jun 2010 19: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: r209268 - head/sys/dev/twa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2010 19:48:03 -0000 Author: delphij Date: Thu Jun 17 19:48:03 2010 New Revision: 209268 URL: http://svn.freebsd.org/changeset/base/209268 Log: Remove an unused comment. Modified: head/sys/dev/twa/tw_cl_misc.c Modified: head/sys/dev/twa/tw_cl_misc.c ============================================================================== --- head/sys/dev/twa/tw_cl_misc.c Thu Jun 17 19:46:36 2010 (r209267) +++ head/sys/dev/twa/tw_cl_misc.c Thu Jun 17 19:48:03 2010 (r209268) @@ -810,7 +810,7 @@ tw_cli_check_ctlr_state(struct tw_cli_ct "status reg = 0x%x %s", status_reg, tw_cli_describe_bits(status_reg, desc)); - error = TW_OSL_EGENFAILURE; // tw_cl_reset_ctlr(ctlr_handle); + error = TW_OSL_EGENFAILURE; } } return(error); From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 21:38: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 2E8AB1065672; Thu, 17 Jun 2010 21:38:09 +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 E1D958FC17; Thu, 17 Jun 2010 21:38:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o5HLUc47074849; Thu, 17 Jun 2010 15:30:38 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 17 Jun 2010 15:30:42 -0600 (MDT) Message-Id: <20100617.153042.119882392285756102.imp@bsdimp.com> To: dougb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <4C1A7953.4080201@FreeBSD.org> References: <20100617023441.008cd737@dev.lan.Awfulhak.org> <20100617100315.GA37522@nagual.pp.ru> <4C1A7953.4080201@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: src-committers@FreeBSD.org, ache@nagual.pp.ru, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, brian@Awfulhak.org, jilles@FreeBSD.org, des@des.no Subject: Re: svn commit: r209221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 21:38:09 -0000 In message: <4C1A7953.4080201@FreeBSD.org> Doug Barton writes: : I've been very supportive of Jilles work up to this point, and I think : he's done a great job of making our sh functional and compliant as a : scripting shell. However in my mind adding completion (and his : suggested inclusion of the kill builtin) tips the balance from "good : system shell" to more of an interactive shell, and that makes me : wonder if this is the right direction to go in. If we want a good : interactive bourne-based shell in the base I'd rather have the : discussion about which one to import, rather than trying to have our : sh catch up with the last 15 years of development in this area. My main objection to sh growing lots of new functionality is the embedded world. It is so much smaller than csh, like 1/3 the size. I'd prefer we keep it small, or at least keep it buildable in the small... Warner From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 21:55: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 5C5CA1065672; Thu, 17 Jun 2010 21:55:16 +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 1C8778FC38; Thu, 17 Jun 2010 21:55:16 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 3D93235A83A; Thu, 17 Jun 2010 23:55:14 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 2C54817295; Thu, 17 Jun 2010 23:55:14 +0200 (CEST) Date: Thu, 17 Jun 2010 23:55:14 +0200 From: Jilles Tjoelker To: Doug Barton Message-ID: <20100617215513.GA49512@stack.nl> References: <201006152158.o5FLwerZ005440@svn.freebsd.org> <86ljafwypm.fsf@ds4.des.no> <20100617023441.008cd737@dev.lan.Awfulhak.org> <20100617100315.GA37522@nagual.pp.ru> <4C1A7953.4080201@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C1A7953.4080201@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: src-committers@FreeBSD.ORG, Andrey Chernov , svn-src-all@FreeBSD.ORG, Brian Somers , svn-src-head@FreeBSD.ORG, Dag-Erling Sm??rgrav Subject: Re: svn commit: r209221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 21:55:16 -0000 On Thu, Jun 17, 2010 at 12:36:51PM -0700, Doug Barton wrote: > On 06/17/10 03:03, Andrey Chernov wrote: > >>> Jilles Tjoelker writes: > >>>> Log: > >>>> sh: Add filename completion. > FWIW, what I actually do is set the shell for both root and my > unprivileged user to sh, compile bash static, and put a copy of the > static shell in /root. Then my .profile tests for the existence of > bash and execs it if available. Hmm, I see no problems with setting the shell of my unprivileged user to something dynamically linked in /usr/local/bin. > > sh completion works very strange at now moment. > These are basically bourne-type shell behaviors that are different from > *csh. > > Just two things: > > > > 1) $^I > > Display all 973 possibilities? (y or n) > > (tcsh - beep) > bash also beeps here, FWIW, although I think there is a knob to twist to > make it do what sh is doing here. It beeps first, then asks with the second tab. As said elsewhere in the thread, it may be useful to allow initial tabs to indent, like zsh and ksh93 do, to allow pasting script fragments indented with tabs. > > 2) $ll^I > > beep > > second ^I > > completion, including non-program files. > This is a libedit thing. libreadline (which is what bash uses) has a > flag to control this behavior that you can add to ~/.inputrc which makes > it show all of the options the first time. The inclusion of non-program > files in the current directory as input to a command is a feature, since > it allows you to do things like: > cd /etc > vi make^I > Having the shell include non-{program|alias} stuff as the first > completion is dubious (bash does not do this). > > (tcsh - completeion, programs& aliases only) Yes, many other shells complete command names at appropriate places in the line. However, at this time, it doesn't really fit in my idea of what sh(1) should be. Listing all possible command names is a fair bit of functionality not present yet (sh only caches command pathnames that have been used, it does not readdir all of $PATH like tcsh does). A somewhat related consideration is that this widens the interface between sh and libedit. Currently, sh only relies on _el_fn_sh_complete being a libedit key action function for its completion support; all the magic is in libedit. > > I don't remember other strange places right now. Verdict - not usable yet. > I've been very supportive of Jilles work up to this point, and I think > he's done a great job of making our sh functional and compliant as a > scripting shell. However in my mind adding completion (and his suggested > inclusion of the kill builtin) tips the balance from "good system shell" > to more of an interactive shell, and that makes me wonder if this is the > right direction to go in. If we want a good interactive bourne-based > shell in the base I'd rather have the discussion about which one to > import, rather than trying to have our sh catch up with the last 15 > years of development in this area. Adding a few interactive features does not mean I want sh(1) to be a bash or zsh clone. Rather, I think that they can improve the sh(1) interactive user experience considerably while adding little code. This is useful for installations where it is desirable to minimize the number of ports installed and make buildenv type shells, for instance. More demanding users will want to use a more powerful interactive shell, and I think most operating systems based on FreeBSD should provide some (this does not mean they should be in the base system). -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 22:47: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 01DC5106564A; Thu, 17 Jun 2010 22:47:45 +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 CB51F8FC13; Thu, 17 Jun 2010 22:47: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 o5HMli2o071869; Thu, 17 Jun 2010 22:47:44 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5HMli6l071867; Thu, 17 Jun 2010 22:47:44 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201006172247.o5HMli6l071867@svn.freebsd.org> From: Martin Matuska Date: Thu, 17 Jun 2010 22:47: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: r209275 - 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: Thu, 17 Jun 2010 22:47:45 -0000 Author: mm Date: Thu Jun 17 22:47:44 2010 New Revision: 209275 URL: http://svn.freebsd.org/changeset/base/209275 Log: Import latest ARC change from OpenSolaris: - large ghost eviction causes high write latency - arc_adjust might adjust MRU unnecessarily - arc_adapt can lead to wild arc_p adjustment OpenSolaris onnv-revision: 12636:13b5d698941e Submitted by: avg Approved by: pjd, delphij (mentor) Obtained from: OpenSolaris (Bug ID 6950219, 6953403, 6951024) MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jun 17 22:38:23 2010 (r209274) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jun 17 22:47:44 2010 (r209275) @@ -1949,8 +1949,9 @@ arc_adjust(void) * Adjust MRU size */ - adjustment = MIN(arc_size - arc_c, - arc_anon->arcs_size + arc_mru->arcs_size + arc_meta_used - arc_p); + adjustment = MIN((int64_t)(arc_size - arc_c), + (int64_t)(arc_anon->arcs_size + arc_mru->arcs_size + arc_meta_used - + arc_p)); if (adjustment > 0 && arc_mru->arcs_lsize[ARC_BUFC_DATA] > 0) { delta = MIN(arc_mru->arcs_lsize[ARC_BUFC_DATA], adjustment); @@ -2271,10 +2272,7 @@ arc_reclaim_thread(void *dummy __unused) arc_no_grow = FALSE; } - if (needfree || - (2 * arc_c < arc_size + - arc_mru_ghost->arcs_size + arc_mfu_ghost->arcs_size)) - arc_adjust(); + arc_adjust(); if (arc_eviction_list != NULL) arc_do_user_evicts(); @@ -2325,6 +2323,7 @@ arc_adapt(int bytes, arc_state_t *state) if (state == arc_mru_ghost) { mult = ((arc_mru_ghost->arcs_size >= arc_mfu_ghost->arcs_size) ? 1 : (arc_mfu_ghost->arcs_size/arc_mru_ghost->arcs_size)); + mult = MIN(mult, 10); /* avoid wild arc_p adjustment */ arc_p = MIN(arc_c - arc_p_min, arc_p + bytes * mult); } else if (state == arc_mfu_ghost) { @@ -2332,6 +2331,7 @@ arc_adapt(int bytes, arc_state_t *state) mult = ((arc_mfu_ghost->arcs_size >= arc_mru_ghost->arcs_size) ? 1 : (arc_mru_ghost->arcs_size/arc_mfu_ghost->arcs_size)); + mult = MIN(mult, 10); delta = MIN(bytes * mult, arc_p); arc_p = MAX(arc_p_min, arc_p - delta); From owner-svn-src-head@FreeBSD.ORG Thu Jun 17 23:46: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 ABE9D106564A; Thu, 17 Jun 2010 23:46:26 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (lefty.soaustin.net [66.135.55.46]) by mx1.freebsd.org (Postfix) with ESMTP id 84F0E8FC0C; Thu, 17 Jun 2010 23:46:26 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id EAE988C06D; Thu, 17 Jun 2010 18:46:25 -0500 (CDT) Date: Thu, 17 Jun 2010 18:46:25 -0500 From: Mark Linimon To: Doug Barton Message-ID: <20100617234625.GA18613@lonesome.com> References: <201006152158.o5FLwerZ005440@svn.freebsd.org> <86ljafwypm.fsf@ds4.des.no> <20100617023441.008cd737@dev.lan.Awfulhak.org> <20100617100315.GA37522@nagual.pp.ru> <4C1A7953.4080201@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C1A7953.4080201@FreeBSD.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: src-committers@FreeBSD.ORG, Andrey Chernov , svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, Brian Somers , Jilles Tjoelker , Dag-Erling Sm??rgrav Subject: Re: svn commit: r209221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2010 23:46:26 -0000 On Thu, Jun 17, 2010 at 12:36:51PM -0700, Doug Barton wrote: > every time this is discussed it's the bikeshed from > $CULTURALLY_RELEVANT_PLACE_OF_TORMENT. On occasion I'm attempted to close incoming PRs with the following text: "Administer your system." The upside of FreeBSD being so configurable is that you can make it behave exactly as you like. The downside is that this takes extra work. IMHO we'll never achieve consensus on this issue, so we should just let it go. Me? I don't use tcsh for root, I use sh. mcl From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 01:17: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 8300E1065672; Fri, 18 Jun 2010 01:17:17 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 728AF8FC14; Fri, 18 Jun 2010 01:17: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 o5I1HHV2005309; Fri, 18 Jun 2010 01:17:17 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5I1HHb5005308; Fri, 18 Jun 2010 01:17:17 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201006180117.o5I1HHb5005308@svn.freebsd.org> From: Sean Bruno Date: Fri, 18 Jun 2010 01:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209276 - head/lib/libkvm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 01:17:17 -0000 Author: sbruno Date: Fri Jun 18 01:17:16 2010 New Revision: 209276 URL: http://svn.freebsd.org/changeset/base/209276 Log: Much closer approximation of the kernel's calculation of this value. Reviewed by: alc Obtained from: Yahoo Inc. Modified: head/lib/libkvm/kvm_proc.c Modified: head/lib/libkvm/kvm_proc.c ============================================================================== --- head/lib/libkvm/kvm_proc.c Thu Jun 17 22:47:44 2010 (r209275) +++ head/lib/libkvm/kvm_proc.c Fri Jun 18 01:17:16 2010 (r209276) @@ -323,7 +323,12 @@ nopgrp: (void)kvm_read(kd, (u_long)proc.p_vmspace, (char *)&vmspace, sizeof(vmspace)); kp->ki_size = vmspace.vm_map.size; - kp->ki_rssize = vmspace.vm_swrss; /* XXX */ + /* + * Approximate the kernel's method of calculating + * this field. + */ +#define pmap_resident_count(pm) ((pm)->pm_stats.resident_count) + kp->ki_rssize = pmap_resident_count(&vmspace.vm_pmap); kp->ki_swrss = vmspace.vm_swrss; kp->ki_tsize = vmspace.vm_tsize; kp->ki_dsize = vmspace.vm_dsize; From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 01:57:47 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 95835106566C; Fri, 18 Jun 2010 01:57:47 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 4DFE48FC08; Fri, 18 Jun 2010 01:57:47 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id C2C267E84A; Fri, 18 Jun 2010 11:57:38 +1000 (EST) Message-ID: <4C1AD292.5070508@freebsd.org> Date: Fri, 18 Jun 2010 11:57:38 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Kostik Belousov References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C158B71.205@freebsd.org> <20100614085205.GD13238@deviant.kiev.zoral.com.ua> <4C1605A7.2000202@freebsd.org> <20100614104349.GF13238@deviant.kiev.zoral.com.ua> <4C198A90.3060905@freebsd.org> <20100617071300.GX13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100617071300.GX13238@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Matthew Fleming , src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@freebsd.org, brde@optusnet.com.au, svn-src-head@freebsd.org Subject: Re: svn commit: r209119 - 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: Fri, 18 Jun 2010 01:57:47 -0000 On 06/17/10 17:13, Kostik Belousov wrote: > On Thu, Jun 17, 2010 at 12:38:08PM +1000, Lawrence Stewart wrote: >> On 06/14/10 20:43, Kostik Belousov wrote: [snip] >>> Or, you could ditch the sum at all, indeed using ({}) and returning the >>> result. __typeof is your friend to select proper type of accumulator. >> >> So, something like this? >> >> #define DPCPU_SUM(n, var) __extension__ \ >> ({ \ >> u_int _i; \ >> __typeof((DPCPU_PTR(n))->var) sum; \ >> \ >> sum = 0; \ >> CPU_FOREACH(_i) { \ >> sum += (DPCPU_ID_PTR(_i, n))->var; \ >> } \ >> sum; \ >> }) >> >> Which can be used like this: >> >> totalss.n_in = DPCPU_SUM(ss, n_in); > Yes, exactly. > >> >> >> I've tested the above and it works. I also prefer the idea of having >> DPCPU_SUM return the sum so that you can do "var = DPCPU_SUM(...)". My >> only concern with this method is that the caller no longer has the >> choice to make the sum variable a larger type to avoid overflow. It >> would be nice to be able to have the DPCPU vars be uint32_t but be able >> to sum them into a uint64_t accumulator for example. Perhaps this isn't >> really an issue though... I'm not sure. > You are worried about overflow in the sum of 32 or 64 variables, but if > this is the case, then each member of the sum can overflow as well, IMO. > Either ignore the issue, or use a uintmax_t. True but I figured on large SMP systems where the potential to process more is likely, 32bit counters per cpu may be enough to avoid overflow but the aggregate number of events may exceed a 32bit variable. I suspect you're right though and that if there's a likely chance the aggregate could overflow, then the DPCPU var should simply be made 64bit to also remove any possibility of individual PCPU counters overflowing. I'll commit the above version of the macro this evening (GMT+10) unless I hear any objections. Thanks to all of you for your input. Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 08:11: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 5BF53106564A; Fri, 18 Jun 2010 08:11:52 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BBD48FC16; Fri, 18 Jun 2010 08:11: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 o5I8Bqaq097727; Fri, 18 Jun 2010 08:11:52 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5I8BqBo097725; Fri, 18 Jun 2010 08:11:52 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201006180811.o5I8BqBo097725@svn.freebsd.org> From: Doug Barton Date: Fri, 18 Jun 2010 08:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209286 - head/etc/namedb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 08:11:52 -0000 Author: dougb Date: Fri Jun 18 08:11:52 2010 New Revision: 209286 URL: http://svn.freebsd.org/changeset/base/209286 Log: Add the AAAA address for i.root-servers.net Modified: head/etc/namedb/named.root Modified: head/etc/namedb/named.root ============================================================================== --- head/etc/namedb/named.root Fri Jun 18 07:37:50 2010 (r209285) +++ head/etc/namedb/named.root Fri Jun 18 08:11:52 2010 (r209286) @@ -13,8 +13,8 @@ ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: Dec 12, 2008 -; related version of root zone: 2008121200 +; last update: Jun 17, 2010 +; related version of root zone: 2010061700 ; ; formerly NS.INTERNIC.NET ; @@ -63,6 +63,7 @@ H.ROOT-SERVERS.NET. 3600000 AA ; . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 +I.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FE::53 ; ; OPERATED BY VERISIGN, INC. ; From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 09:01: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 29F52106566C; Fri, 18 Jun 2010 09:01:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 195AC8FC1B; Fri, 18 Jun 2010 09:01: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 o5I91ig7009111; Fri, 18 Jun 2010 09:01:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5I91iHY009107; Fri, 18 Jun 2010 09:01:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201006180901.o5I91iHY009107@svn.freebsd.org> From: Michael Tuexen Date: Fri, 18 Jun 2010 09:01: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: r209289 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 09:01:45 -0000 Author: tuexen Date: Fri Jun 18 09:01:44 2010 New Revision: 209289 URL: http://svn.freebsd.org/changeset/base/209289 Log: Fix a rece condition in the shutdown handling. The race condition resulted in a panic. MFC after: 3 days Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Fri Jun 18 08:51:20 2010 (r209288) +++ head/sys/netinet/sctp.h Fri Jun 18 09:01:44 2010 (r209289) @@ -442,6 +442,7 @@ struct sctp_error_unrecognized_chunk { #define SCTP_PCB_FLAGS_BLOCKING_IO 0x08000000 #define SCTP_PCB_FLAGS_SOCKET_GONE 0x10000000 #define SCTP_PCB_FLAGS_SOCKET_ALLGONE 0x20000000 +#define SCTP_PCB_FLAGS_SOCKET_CANT_READ 0x40000000 /* flags to copy to new PCB */ #define SCTP_PCB_COPY_FLAGS (SCTP_PCB_FLAGS_BOUNDALL|\ SCTP_PCB_FLAGS_WAKEINPUT|\ Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Fri Jun 18 08:51:20 2010 (r209288) +++ head/sys/netinet/sctp_usrreq.c Fri Jun 18 09:01:44 2010 (r209289) @@ -947,11 +947,30 @@ sctp_flush(struct socket *so, int how) * they will not be able to read the data, the socket will block * that from happening. */ + struct sctp_inpcb *inp; + + inp = (struct sctp_inpcb *)so->so_pcb; + if (inp == NULL) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + return EINVAL; + } + SCTP_INP_RLOCK(inp); + /* For the 1 to many model this does nothing */ + if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { + SCTP_INP_RUNLOCK(inp); + return (0); + } + SCTP_INP_RUNLOCK(inp); if ((how == PRU_FLUSH_RD) || (how == PRU_FLUSH_RDWR)) { /* * First make sure the sb will be happy, we don't use these * except maybe the count */ + SCTP_INP_WLOCK(inp); + SCTP_INP_READ_LOCK(inp); + inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ; + SCTP_INP_READ_UNLOCK(inp); + SCTP_INP_WUNLOCK(inp); so->so_rcv.sb_cc = 0; so->so_rcv.sb_mbcnt = 0; so->so_rcv.sb_mb = NULL; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Jun 18 08:51:20 2010 (r209288) +++ head/sys/netinet/sctputil.c Fri Jun 18 09:01:44 2010 (r209289) @@ -3185,6 +3185,9 @@ sctp_notify_partial_delivery_indication( /* event not enabled */ return; } + if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ) { + return; + } m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_pdapi_event), 0, M_DONTWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ @@ -4365,6 +4368,17 @@ sctp_add_to_readq(struct sctp_inpcb *inp } if (inp_read_lock_held == 0) SCTP_INP_READ_LOCK(inp); + if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ) { + sctp_free_remote_addr(control->whoFrom); + if (control->data) { + sctp_m_freem(control->data); + control->data = NULL; + } + SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_readq), control); + if (inp_read_lock_held == 0) + SCTP_INP_READ_UNLOCK(inp); + return; + } if (!(control->spec_flags & M_NOTIFICATION)) { atomic_add_int(&inp->total_recvs, 1); if (!control->do_not_ref_stcb) { @@ -4405,6 +4419,8 @@ sctp_add_to_readq(struct sctp_inpcb *inp control->tail_mbuf = prev; } else { /* Everything got collapsed out?? */ + sctp_free_remote_addr(control->whoFrom); + SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_readq), control); if (inp_read_lock_held == 0) SCTP_INP_READ_UNLOCK(inp); return; @@ -4477,6 +4493,10 @@ get_out: } return (-1); } + if (inp && (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ)) { + SCTP_INP_READ_UNLOCK(inp); + return 0; + } if (control->end_added) { /* huh this one is complete? */ goto get_out; From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 11:09: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 A1B90106566B; Fri, 18 Jun 2010 11:09:51 +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 911E28FC26; Fri, 18 Jun 2010 11:09: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 o5IB9ptx038530; Fri, 18 Jun 2010 11:09:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IB9piK038529; Fri, 18 Jun 2010 11:09:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006181109.o5IB9piK038529@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 18 Jun 2010 11:09: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: r209294 - head/gnu/lib/csu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 11:09:51 -0000 Author: kib Date: Fri Jun 18 11:09:51 2010 New Revision: 209294 URL: http://svn.freebsd.org/changeset/base/209294 Log: Often reported issue with newer ld is: error in /usr/lib/crtendS.o(.eh_frame); no .eh_frame_hdr table will be created. The issue is that crtend is compiled with unwind table, and also it places the special CIE into the .eh_frame indicating the end of section, that is located before generated unwind table. New ld has assertion that verifies that closing CIE is indeed the last CIE, causing the crypting message to be issued, and refusing to generate dwarf unwind. Add -fno-asynchronous-unwind-tables to disable unwind table generation for crtbegin/crtend. While there, disable omitting the frame pointer [1]. Requested by: kan [1] Reviewed by: kan MFC after: 2 weeks Modified: head/gnu/lib/csu/Makefile Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Fri Jun 18 09:40:01 2010 (r209293) +++ head/gnu/lib/csu/Makefile Fri Jun 18 11:09:51 2010 (r209294) @@ -17,7 +17,8 @@ CSTD?= gnu89 CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3 CFLAGS+= -finhibit-size-directive -fno-inline-functions \ -fno-exceptions -fno-zero-initialized-in-bss \ - -fno-zero-initialized-in-bss -fno-toplevel-reorder + -fno-zero-initialized-in-bss -fno-toplevel-reorder \ + -fno-asynchronous-unwind-tables -fno-omit-frame-pointer CFLAGS+= -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. \ -I${CCDIR}/cc_tools CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG} From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 11:10: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 03EB0106566C; Fri, 18 Jun 2010 11:10:41 +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 E78E28FC1A; Fri, 18 Jun 2010 11:10: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 o5IBAeui038766; Fri, 18 Jun 2010 11:10:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IBAeSt038734; Fri, 18 Jun 2010 11:10:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006181110.o5IBAeSt038734@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 18 Jun 2010 11:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209295 - head/lib/csu/i386-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 11:10:41 -0000 Author: kib Date: Fri Jun 18 11:10:39 2010 New Revision: 209295 URL: http://svn.freebsd.org/changeset/base/209295 Log: Add unwind annotations to the asm part of crt1 on i386. Terminate the process with SIGTRAP if _start1() unexpectedly returns. Reviewed by: kan MFC after: 2 weeks Modified: head/lib/csu/i386-elf/crt1_s.S Modified: head/lib/csu/i386-elf/crt1_s.S ============================================================================== --- head/lib/csu/i386-elf/crt1_s.S Fri Jun 18 11:09:51 2010 (r209294) +++ head/lib/csu/i386-elf/crt1_s.S Fri Jun 18 11:10:39 2010 (r209295) @@ -30,15 +30,22 @@ .align 4 .globl _start .type _start, @function -_start: xorl %ebp,%ebp +_start: + .cfi_startproc + xorl %ebp,%ebp pushl %ebp + .cfi_def_cfa_offset 4 movl %esp,%ebp + .cfi_offset %ebp,-8 + .cfi_def_cfa_register %ebp andl $0xfffffff0,%esp # align stack leal 8(%ebp),%eax pushl %eax # argv pushl 4(%ebp) # argc pushl %edx # rtld cleanup call _start1 + int3 + .cfi_endproc .size _start, . - _start .ident "$FreeBSD$" From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 12:08: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 D5ED81065672; Fri, 18 Jun 2010 12:08:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A8D8D8FC0C; Fri, 18 Jun 2010 12:08:56 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 2D36746C5B; Fri, 18 Jun 2010 08:08:56 -0400 (EDT) Date: Fri, 18 Jun 2010 13:08:56 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Lawrence Stewart In-Reply-To: <4C1AD292.5070508@freebsd.org> Message-ID: References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C158B71.205@freebsd.org> <20100614085205.GD13238@deviant.kiev.zoral.com.ua> <4C1605A7.2000202@freebsd.org> <20100614104349.GF13238@deviant.kiev.zoral.com.ua> <4C198A90.3060905@freebsd.org> <20100617071300.GX13238@deviant.kiev.zoral.com.ua> <4C1AD292.5070508@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Matthew Fleming , src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@freebsd.org, svn-src-head@freebsd.org, brde@optusnet.com.au, Kostik Belousov Subject: Re: svn commit: r209119 - 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: Fri, 18 Jun 2010 12:08:56 -0000 On Fri, 18 Jun 2010, Lawrence Stewart wrote: > True but I figured on large SMP systems where the potential to process more > is likely, 32bit counters per cpu may be enough to avoid overflow but the > aggregate number of events may exceed a 32bit variable. I suspect you're > right though and that if there's a likely chance the aggregate could > overflow, then the DPCPU var should simply be made 64bit to also remove any > possibility of individual PCPU counters overflowing. > > I'll commit the above version of the macro this evening (GMT+10) unless I > hear any objections. Thanks to all of you for your input. The only reservation I have, really, is that 64-bit writes are non-atomic on i386 and other 32-bit architectures (or, at least, I think they are). This means DPCPU_SUM may encounter non-atomicity rather than just staleness in the values it reads as it iterates. That said, we should probably use 64-bit anyway, because 32-bit counters are gauche. :-) Robert From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 14:06: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 3D2241065673; Fri, 18 Jun 2010 14:06:28 +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 27ED68FC18; Fri, 18 Jun 2010 14:06: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 o5IE6SvD077956; Fri, 18 Jun 2010 14:06:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IE6R2A077930; Fri, 18 Jun 2010 14:06:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006181406.o5IE6R2A077930@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 18 Jun 2010 14:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209298 - in head/sys: dev/iicbus dev/ofw powerpc/aim powerpc/booke powerpc/include powerpc/mpc85xx powerpc/ofw powerpc/powermac powerpc/powerpc sparc64/ebus sparc64/isa sparc64/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: Fri, 18 Jun 2010 14:06:28 -0000 Author: nwhitehorn Date: Fri Jun 18 14:06:27 2010 New Revision: 209298 URL: http://svn.freebsd.org/changeset/base/209298 Log: Provide for multiple, cascaded PICs on PowerPC systems, and extend the OFW interrupt map interface to also return the device's interrupt parent. MFC after: 8.1-RELEASE Modified: head/sys/dev/iicbus/iiconf.c head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/powerpc/aim/interrupt.c head/sys/powerpc/aim/nexus.c head/sys/powerpc/booke/interrupt.c head/sys/powerpc/include/intr_machdep.h head/sys/powerpc/include/ocpbus.h head/sys/powerpc/include/openpicvar.h head/sys/powerpc/mpc85xx/atpic.c head/sys/powerpc/mpc85xx/isa.c head/sys/powerpc/mpc85xx/ocpbus.c head/sys/powerpc/mpc85xx/ocpbus.h head/sys/powerpc/mpc85xx/opic.c head/sys/powerpc/mpc85xx/pci_ocp.c head/sys/powerpc/ofw/ofw_pcib_pci.c head/sys/powerpc/ofw/ofw_pcibus.c head/sys/powerpc/powermac/cpcht.c head/sys/powerpc/powermac/grackle.c head/sys/powerpc/powermac/hrowpic.c head/sys/powerpc/powermac/macgpio.c head/sys/powerpc/powermac/macio.c head/sys/powerpc/powermac/openpic_macio.c head/sys/powerpc/powermac/uninorth.c head/sys/powerpc/powermac/uninorthpci.c head/sys/powerpc/powerpc/intr_machdep.c head/sys/powerpc/powerpc/mp_machdep.c head/sys/powerpc/powerpc/openpic.c head/sys/powerpc/powerpc/pic_if.m head/sys/sparc64/ebus/ebus.c head/sys/sparc64/isa/ofw_isa.c head/sys/sparc64/pci/fire.c head/sys/sparc64/pci/ofw_pcib_subr.c head/sys/sparc64/pci/psycho.c head/sys/sparc64/pci/schizo.c Modified: head/sys/dev/iicbus/iiconf.c ============================================================================== --- head/sys/dev/iicbus/iiconf.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/dev/iicbus/iiconf.c Fri Jun 18 14:06:27 2010 (r209298) @@ -363,7 +363,7 @@ iicbus_transfer(device_t bus, struct iic int iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) { - int i, error, lenread, lenwrote, nkid; + int i, error, lenread, lenwrote, nkid, rpstart, addr; device_t *children, bus; if ((error = device_get_children(dev, &children, &nkid)) != 0) @@ -373,14 +373,38 @@ iicbus_transfer_gen(device_t dev, struct return (EIO); } bus = children[0]; + rpstart = 0; free(children, M_TEMP); for (i = 0, error = 0; i < nmsgs && error == 0; i++) { + addr = msgs[i].slave; if (msgs[i].flags & IIC_M_RD) - error = iicbus_block_read(bus, msgs[i].slave, - msgs[i].buf, msgs[i].len, &lenread); + addr |= LSB; else - error = iicbus_block_write(bus, msgs[i].slave, - msgs[i].buf, msgs[i].len, &lenwrote); + addr &= ~LSB; + + if (!(msgs[i].flags & IIC_M_NOSTART)) { + if (rpstart) + error = iicbus_repeated_start(bus, addr, 0); + else + error = iicbus_start(bus, addr, 0); + } + + if (error) + break; + + if (msgs[i].flags & IIC_M_RD) + error = iicbus_read(bus, msgs[i].buf, msgs[i].len, + &lenread, IIC_LAST_READ, 0); + else + error = iicbus_write(bus, msgs[i].buf, msgs[i].len, + &lenwrote, 0); + + if (!(msgs[i].flags & IIC_M_NOSTOP)) { + rpstart = 0; + iicbus_stop(bus); + } else { + rpstart = 1; /* Next message gets repeated start */ + } } return (error); } Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/dev/ofw/ofw_bus_subr.c Fri Jun 18 14:06:27 2010 (r209298) @@ -222,7 +222,7 @@ ofw_bus_setup_iinfo(phandle_t node, stru int ofw_bus_lookup_imap(phandle_t node, struct ofw_bus_iinfo *ii, void *reg, int regsz, void *pintr, int pintrsz, void *mintr, int mintrsz, - void *maskbuf) + phandle_t *iparent, void *maskbuf) { int rv; @@ -236,7 +236,7 @@ ofw_bus_lookup_imap(phandle_t node, stru panic("ofw_bus_lookup_imap: could not get reg property"); return (ofw_bus_search_intrmap(pintr, pintrsz, reg, ii->opi_addrc, ii->opi_imap, ii->opi_imapsz, ii->opi_imapmsk, maskbuf, mintr, - mintrsz)); + mintrsz, iparent)); } /* @@ -259,7 +259,7 @@ ofw_bus_lookup_imap(phandle_t node, stru int ofw_bus_search_intrmap(void *intr, int intrsz, void *regs, int physsz, void *imap, int imapsz, void *imapmsk, void *maskbuf, void *result, - int rintrsz) + int rintrsz, phandle_t *iparent) { phandle_t parent; uint8_t *ref = maskbuf; @@ -303,6 +303,9 @@ ofw_bus_search_intrmap(void *intr, int i if (bcmp(ref, mptr, physsz + intrsz) == 0) { bcopy(mptr + physsz + intrsz + sizeof(parent), result, rintrsz); + + if (iparent != NULL) + *iparent = parent; return (1); } mptr += tsz; Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/dev/ofw/ofw_bus_subr.h Fri Jun 18 14:06:27 2010 (r209298) @@ -63,9 +63,12 @@ bus_child_pnpinfo_str_t ofw_bus_gen_chil /* Routines for processing firmware interrupt maps */ void ofw_bus_setup_iinfo(phandle_t, struct ofw_bus_iinfo *, int); int ofw_bus_lookup_imap(phandle_t, struct ofw_bus_iinfo *, void *, int, - void *, int, void *, int, void *); + void *, int, void *, int, phandle_t *, void *); int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *, - void *, void *, int); + void *, void *, int, phandle_t *); + +/* Helper to get node's interrupt parent */ +void ofw_bus_find_iparent(phandle_t); /* Helper routine for checking compat prop */ int ofw_bus_is_compatible(device_t, const char *); Modified: head/sys/powerpc/aim/interrupt.c ============================================================================== --- head/sys/powerpc/aim/interrupt.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/aim/interrupt.c Fri Jun 18 14:06:27 2010 (r209298) @@ -81,7 +81,7 @@ powerpc_interrupt(struct trapframe *fram switch (framep->exc) { case EXC_EXI: critical_enter(); - PIC_DISPATCH(pic, framep); + PIC_DISPATCH(root_pic, framep); critical_exit(); break; Modified: head/sys/powerpc/aim/nexus.c ============================================================================== --- head/sys/powerpc/aim/nexus.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/aim/nexus.c Fri Jun 18 14:06:27 2010 (r209298) @@ -208,7 +208,7 @@ nexus_attach(device_t dev) sc = device_get_softc(dev); start = 0; - end = INTR_VECTORS - 1; + end = MAX_PICS*INTR_VECTORS - 1; sc->sc_rman.rm_start = start; sc->sc_rman.rm_end = end; Modified: head/sys/powerpc/booke/interrupt.c ============================================================================== --- head/sys/powerpc/booke/interrupt.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/booke/interrupt.c Fri Jun 18 14:06:27 2010 (r209298) @@ -134,7 +134,7 @@ powerpc_extr_interrupt(struct trapframe { critical_enter(); - PIC_DISPATCH(pic, framep); + PIC_DISPATCH(root_pic, framep); critical_exit(); framep->srr1 &= ~PSL_WE; } Modified: head/sys/powerpc/include/intr_machdep.h ============================================================================== --- head/sys/powerpc/include/intr_machdep.h Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/include/intr_machdep.h Fri Jun 18 14:06:27 2010 (r209298) @@ -29,26 +29,32 @@ #define _MACHINE_INTR_MACHDEP_H_ #define INTR_VECTORS 256 +#define MAX_PICS 5 + +#define IGN_SHIFT 8 +#define INTR_INTLINE(irq) (irq & ((1 << IGN_SHIFT) - 1)) +#define INTR_IGN(irq) (irq >> IGN_SHIFT) + +#define INTR_VEC(pic_id, irq) ((powerpc_ign_lookup(pic_id) << IGN_SHIFT) | irq) /* * Default base address for MSI messages on PowerPC */ #define MSI_INTEL_ADDR_BASE 0xfee00000 -extern device_t pic; -extern device_t pic8259; +extern device_t root_pic; struct trapframe; driver_filter_t powerpc_ipi_handler; void powerpc_register_pic(device_t, u_int); -void powerpc_register_8259(device_t); +int powerpc_ign_lookup(uint32_t pic_id); void powerpc_dispatch_intr(u_int, struct trapframe *); int powerpc_enable_intr(void); -int powerpc_setup_intr(const char *, u_int, driver_filter_t, - driver_intr_t, void *, enum intr_type, void **); +int powerpc_setup_intr(const char *, u_int, driver_filter_t, driver_intr_t, + void *, enum intr_type, void **); int powerpc_teardown_intr(void *); int powerpc_config_intr(int, enum intr_trigger, enum intr_polarity); Modified: head/sys/powerpc/include/ocpbus.h ============================================================================== --- head/sys/powerpc/include/ocpbus.h Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/include/ocpbus.h Fri Jun 18 14:06:27 2010 (r209298) @@ -44,4 +44,8 @@ #define OCPBUS_DEVTYPE_I2C 7 #define OCPBUS_DEVTYPE_SEC 8 +/* PIC IDs */ +#define OPIC_ID 0 +#define ATPIC_ID 1 + #endif /* _MACHINE_OCPBUS_H_ */ Modified: head/sys/powerpc/include/openpicvar.h ============================================================================== --- head/sys/powerpc/include/openpicvar.h Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/include/openpicvar.h Fri Jun 18 14:06:27 2010 (r209298) @@ -35,10 +35,13 @@ struct openpic_softc { device_t sc_dev; struct resource *sc_memr; + struct resource *sc_intr; bus_space_tag_t sc_bt; bus_space_handle_t sc_bh; char *sc_version; int sc_rid; + int sc_irq; + void *sc_icookie; u_int sc_ncpu; u_int sc_nirq; int sc_psim; Modified: head/sys/powerpc/mpc85xx/atpic.c ============================================================================== --- head/sys/powerpc/mpc85xx/atpic.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/mpc85xx/atpic.c Fri Jun 18 14:06:27 2010 (r209298) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -79,6 +80,9 @@ static void atpic_eoi(device_t, u_int); static void atpic_ipi(device_t, u_int); static void atpic_mask(device_t, u_int); static void atpic_unmask(device_t, u_int); +static uint32_t atpic_id (device_t dev); + +static device_t pic8259; static device_method_t atpic_isa_methods[] = { /* Device interface */ @@ -94,6 +98,7 @@ static device_method_t atpic_isa_methods DEVMETHOD(pic_ipi, atpic_ipi), DEVMETHOD(pic_mask, atpic_mask), DEVMETHOD(pic_unmask, atpic_unmask), + DEVMETHOD(pic_id, atpic_id), { 0, 0 }, }; @@ -219,7 +224,8 @@ atpic_isa_attach(device_t dev) atpic_init(sc, ATPIC_SLAVE); atpic_init(sc, ATPIC_MASTER); - powerpc_register_8259(dev); + powerpc_register_pic(dev, 0x10); + pic8259 = dev; return (0); fail: @@ -328,3 +334,11 @@ atpic_unmask(device_t dev, u_int irq) atpic_write(sc, ATPIC_MASTER, 1, sc->sc_mask[ATPIC_MASTER]); } } + +static uint32_t +atpic_id (device_t dev) +{ + + return (ATPIC_ID); +} + Modified: head/sys/powerpc/mpc85xx/isa.c ============================================================================== --- head/sys/powerpc/mpc85xx/isa.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/mpc85xx/isa.c Fri Jun 18 14:06:27 2010 (r209298) @@ -32,12 +32,16 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include #include +#include "ocpbus.h" + void isa_init(device_t dev) { @@ -58,7 +62,10 @@ isa_alloc_resource(device_t bus, device_ resource_list_find(rl, type, *rid) == NULL) { switch (type) { case SYS_RES_IOPORT: rids = ISA_PNP_NPORT; break; - case SYS_RES_IRQ: rids = ISA_PNP_NIRQ; break; + case SYS_RES_IRQ: + rids = ISA_PNP_NIRQ; + start = ISA_IRQ(start); + break; case SYS_RES_MEMORY: rids = ISA_PNP_NMEM; break; default: rids = 0; break; } Modified: head/sys/powerpc/mpc85xx/ocpbus.c ============================================================================== --- head/sys/powerpc/mpc85xx/ocpbus.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/mpc85xx/ocpbus.c Fri Jun 18 14:06:27 2010 (r209298) @@ -277,7 +277,7 @@ ocpbus_attach(device_t dev) ccsr_read4(OCP85XX_PORDEVSR), ccsr_read4(OCP85XX_PORDEVSR2)); - for (i = PIC_IRQ_START; i < PIC_IRQ_START + 4; i++) + for (i = INTR_VEC(OPIC_ID, 0); i < INTR_VEC(OPIC_ID, 4); i++) powerpc_config_intr(i, INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW); return (bus_generic_attach(dev)); @@ -305,35 +305,35 @@ const struct ocp_resource mpc8555_resour {OCPBUS_DEVTYPE_QUICC, 0, SYS_RES_MEMORY, 0, OCP85XX_QUICC_OFF, OCP85XX_QUICC_SIZE}, - {OCPBUS_DEVTYPE_QUICC, 0, SYS_RES_IRQ, 0, PIC_IRQ_INT(30), 1}, + {OCPBUS_DEVTYPE_QUICC, 0, SYS_RES_IRQ, 0, 30, 1}, {OCPBUS_DEVTYPE_TSEC, 0, SYS_RES_MEMORY, 0, OCP85XX_TSEC0_OFF, OCP85XX_TSEC_SIZE}, - {OCPBUS_DEVTYPE_TSEC, 0, SYS_RES_IRQ, 0, PIC_IRQ_INT(13), 1}, - {OCPBUS_DEVTYPE_TSEC, 0, SYS_RES_IRQ, 1, PIC_IRQ_INT(14), 1}, - {OCPBUS_DEVTYPE_TSEC, 0, SYS_RES_IRQ, 2, PIC_IRQ_INT(18), 1}, + {OCPBUS_DEVTYPE_TSEC, 0, SYS_RES_IRQ, 0, 13, 1}, + {OCPBUS_DEVTYPE_TSEC, 0, SYS_RES_IRQ, 1, 14, 1}, + {OCPBUS_DEVTYPE_TSEC, 0, SYS_RES_IRQ, 2, 18, 1}, {OCPBUS_DEVTYPE_TSEC, 1, SYS_RES_MEMORY, 0, OCP85XX_TSEC1_OFF, OCP85XX_TSEC_SIZE}, - {OCPBUS_DEVTYPE_TSEC, 1, SYS_RES_IRQ, 0, PIC_IRQ_INT(19), 1}, - {OCPBUS_DEVTYPE_TSEC, 1, SYS_RES_IRQ, 1, PIC_IRQ_INT(20), 1}, - {OCPBUS_DEVTYPE_TSEC, 1, SYS_RES_IRQ, 2, PIC_IRQ_INT(24), 1}, + {OCPBUS_DEVTYPE_TSEC, 1, SYS_RES_IRQ, 0, 19, 1}, + {OCPBUS_DEVTYPE_TSEC, 1, SYS_RES_IRQ, 1, 20, 1}, + {OCPBUS_DEVTYPE_TSEC, 1, SYS_RES_IRQ, 2, 24, 1}, {OCPBUS_DEVTYPE_TSEC, 2, SYS_RES_MEMORY, 0, OCP85XX_TSEC2_OFF, OCP85XX_TSEC_SIZE}, - {OCPBUS_DEVTYPE_TSEC, 2, SYS_RES_IRQ, 0, PIC_IRQ_INT(15), 1}, - {OCPBUS_DEVTYPE_TSEC, 2, SYS_RES_IRQ, 1, PIC_IRQ_INT(16), 1}, - {OCPBUS_DEVTYPE_TSEC, 2, SYS_RES_IRQ, 2, PIC_IRQ_INT(17), 1}, + {OCPBUS_DEVTYPE_TSEC, 2, SYS_RES_IRQ, 0, 15, 1}, + {OCPBUS_DEVTYPE_TSEC, 2, SYS_RES_IRQ, 1, 16, 1}, + {OCPBUS_DEVTYPE_TSEC, 2, SYS_RES_IRQ, 2, 17, 1}, {OCPBUS_DEVTYPE_TSEC, 3, SYS_RES_MEMORY, 0, OCP85XX_TSEC3_OFF, OCP85XX_TSEC_SIZE}, - {OCPBUS_DEVTYPE_TSEC, 3, SYS_RES_IRQ, 0, PIC_IRQ_INT(21), 1}, - {OCPBUS_DEVTYPE_TSEC, 3, SYS_RES_IRQ, 1, PIC_IRQ_INT(22), 1}, - {OCPBUS_DEVTYPE_TSEC, 3, SYS_RES_IRQ, 2, PIC_IRQ_INT(23), 1}, + {OCPBUS_DEVTYPE_TSEC, 3, SYS_RES_IRQ, 0, 21, 1}, + {OCPBUS_DEVTYPE_TSEC, 3, SYS_RES_IRQ, 1, 22, 1}, + {OCPBUS_DEVTYPE_TSEC, 3, SYS_RES_IRQ, 2, 23, 1}, {OCPBUS_DEVTYPE_UART, 0, SYS_RES_MEMORY, 0, OCP85XX_UART0_OFF, OCP85XX_UART_SIZE}, - {OCPBUS_DEVTYPE_UART, 0, SYS_RES_IRQ, 0, PIC_IRQ_INT(26), 1}, + {OCPBUS_DEVTYPE_UART, 0, SYS_RES_IRQ, 0, 26, 1}, {OCPBUS_DEVTYPE_UART, 1, SYS_RES_MEMORY, 0, OCP85XX_UART1_OFF, OCP85XX_UART_SIZE}, - {OCPBUS_DEVTYPE_UART, 1, SYS_RES_IRQ, 0, PIC_IRQ_INT(26), 1}, + {OCPBUS_DEVTYPE_UART, 1, SYS_RES_IRQ, 0, 26, 1}, {OCPBUS_DEVTYPE_PCIB, 0, SYS_RES_MEMORY, 0, OCP85XX_PCI0_OFF, OCP85XX_PCI_SIZE}, @@ -357,15 +357,15 @@ const struct ocp_resource mpc8555_resour {OCPBUS_DEVTYPE_I2C, 0, SYS_RES_MEMORY, 0, OCP85XX_I2C0_OFF, OCP85XX_I2C_SIZE}, - {OCPBUS_DEVTYPE_I2C, 0, SYS_RES_IRQ, 0, PIC_IRQ_INT(27), 1}, + {OCPBUS_DEVTYPE_I2C, 0, SYS_RES_IRQ, 0, 27, 1}, {OCPBUS_DEVTYPE_I2C, 1, SYS_RES_MEMORY, 0, OCP85XX_I2C1_OFF, OCP85XX_I2C_SIZE}, - {OCPBUS_DEVTYPE_I2C, 1, SYS_RES_IRQ, 0, PIC_IRQ_INT(27), 1}, + {OCPBUS_DEVTYPE_I2C, 1, SYS_RES_IRQ, 0, 27, 1}, {OCPBUS_DEVTYPE_SEC, 0, SYS_RES_MEMORY, 0, OCP85XX_SEC_OFF, OCP85XX_SEC_SIZE}, - {OCPBUS_DEVTYPE_SEC, 0, SYS_RES_IRQ, 0, PIC_IRQ_INT(29), 1}, - {OCPBUS_DEVTYPE_SEC, 0, SYS_RES_IRQ, 1, PIC_IRQ_INT(42), 1}, + {OCPBUS_DEVTYPE_SEC, 0, SYS_RES_IRQ, 0, 29, 1}, + {OCPBUS_DEVTYPE_SEC, 0, SYS_RES_IRQ, 1, 42, 1}, {0} }; @@ -402,7 +402,7 @@ ocpbus_get_resource(device_t dev, device start = res->sr_offset + CCSRBAR_VA; break; case SYS_RES_IRQ: - start = res->sr_offset; + start = PIC_IRQ_INT(res->sr_offset); break; default: error = EINVAL; Modified: head/sys/powerpc/mpc85xx/ocpbus.h ============================================================================== --- head/sys/powerpc/mpc85xx/ocpbus.h Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/mpc85xx/ocpbus.h Fri Jun 18 14:06:27 2010 (r209298) @@ -104,11 +104,9 @@ /* * PIC definitions */ -#define ISA_IRQ_START 0 -#define PIC_IRQ_START (ISA_IRQ_START + 16) -#define ISA_IRQ(n) (ISA_IRQ_START + (n)) -#define PIC_IRQ_EXT(n) (PIC_IRQ_START + (n)) -#define PIC_IRQ_INT(n) (PIC_IRQ_START + 16 + (n)) +#define ISA_IRQ(n) (INTR_VEC(ATPIC_ID, n)) +#define PIC_IRQ_EXT(n) (INTR_VEC(OPIC_ID, (n))) +#define PIC_IRQ_INT(n) (INTR_VEC(OPIC_ID, (16 + (n)))) #endif /* _MACHINE_OCP85XX_H */ Modified: head/sys/powerpc/mpc85xx/opic.c ============================================================================== --- head/sys/powerpc/mpc85xx/opic.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/mpc85xx/opic.c Fri Jun 18 14:06:27 2010 (r209298) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); * OpenPIC attachment to ocpbus */ static int openpic_ocpbus_probe(device_t); +static uint32_t openpic_ocpbus_id(device_t); static device_method_t openpic_ocpbus_methods[] = { /* Device interface */ @@ -63,6 +64,7 @@ static device_method_t openpic_ocpbus_m DEVMETHOD(pic_ipi, openpic_ipi), DEVMETHOD(pic_mask, openpic_mask), DEVMETHOD(pic_unmask, openpic_unmask), + DEVMETHOD(pic_id, openpic_ocpbus_id), { 0, 0 }, }; @@ -93,3 +95,11 @@ openpic_ocpbus_probe (device_t dev) device_set_desc(dev, OPENPIC_DEVSTR); return (BUS_PROBE_DEFAULT); } + +static uint32_t +openpic_ocpbus_id (device_t dev) +{ + return (OPIC_ID); +} + + Modified: head/sys/powerpc/mpc85xx/pci_ocp.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_ocp.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/mpc85xx/pci_ocp.c Fri Jun 18 14:06:27 2010 (r209298) @@ -792,7 +792,7 @@ pci_ocp_alloc_resource(device_t dev, dev va = sc->sc_iomem_va; break; case SYS_RES_IRQ: - if (start < PIC_IRQ_START) { + if (INTR_IGN(start) == powerpc_ign_lookup(ATPIC_ID)) { device_printf(dev, "%s requested ISA interrupt %lu\n", device_get_nameunit(child), start); } Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcib_pci.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/ofw/ofw_pcib_pci.c Fri Jun 18 14:06:27 2010 (r209298) @@ -42,6 +42,8 @@ #include #include +#include + #include "pcib_if.h" static int ofw_pcib_pci_probe(device_t bus); @@ -149,6 +151,7 @@ ofw_pcib_pci_route_interrupt(device_t br struct ofw_bus_iinfo *ii; struct ofw_pci_register reg; cell_t pintr, mintr; + phandle_t iparent; uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bridge); @@ -157,13 +160,13 @@ ofw_pcib_pci_route_interrupt(device_t br pintr = intpin; if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - maskbuf)) { + &iparent, maskbuf)) { /* * If we've found a mapping, return it and don't map * it again on higher levels - that causes problems * in some cases, and never seems to be required. */ - return (mintr); + return (INTR_VEC(iparent, mintr)); } } else if (intpin >= 1 && intpin <= 4) { /* Modified: head/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcibus.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/ofw/ofw_pcibus.c Fri Jun 18 14:06:27 2010 (r209298) @@ -212,13 +212,16 @@ ofw_pcibus_enum_devtree(device_t dev, u_ OF_getprop(iparent, "#interrupt-cells", &icells, sizeof(icells)); + if (iparent != 0) + intr[0] = INTR_VEC(iparent, intr[0]); + if (iparent != 0 && icells > 1) { powerpc_config_intr(intr[0], (intr[1] & 1) ? INTR_TRIGGER_LEVEL : INTR_TRIGGER_EDGE, INTR_POLARITY_HIGH); } - + resource_list_add(&dinfo->opd_dinfo.resources, SYS_RES_IRQ, 0, intr[0], intr[0], 1); } @@ -293,7 +296,7 @@ static int ofw_pcibus_assign_interrupt(device_t dev, device_t child) { ofw_pci_intr_t intr; - phandle_t node; + phandle_t node, iparent; int isz; node = ofw_bus_get_node(child); @@ -303,8 +306,8 @@ ofw_pcibus_assign_interrupt(device_t dev /* * XXX: Right now we don't have anything sensible to do here, - * since the ofw_imap stuff relies on nodes have a reg - * property. There exists ways around this, so the ePAPR + * since the ofw_imap stuff relies on nodes having a reg + * property. There exist ways around this, so the ePAPR * spec will need to be studied. */ @@ -318,18 +321,29 @@ ofw_pcibus_assign_interrupt(device_t dev } /* + * Try to determine the node's interrupt parent so we know which + * PIC to use. + */ + + iparent = -1; + if (OF_getprop(node, "interrupt-parent", &iparent, sizeof(iparent)) < 0) + iparent = -1; + + /* * Any AAPL,interrupts property gets priority and is * fully specified (i.e. does not need routing) */ isz = OF_getprop(node, "AAPL,interrupts", &intr, sizeof(intr)); - if (isz == sizeof(intr)) { - return (intr); - } + if (isz == sizeof(intr)) + return ((iparent == -1) ? intr : INTR_VEC(iparent, intr)); isz = OF_getprop(node, "interrupts", &intr, sizeof(intr)); - if (isz != sizeof(intr)) { - /* No property; our best guess is the intpin. */ + if (isz == sizeof(intr)) { + if (iparent != -1) + intr = INTR_VEC(iparent, intr); + } else { + /* No property: our best guess is the intpin. */ intr = pci_get_intpin(child); } Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/powermac/cpcht.c Fri Jun 18 14:06:27 2010 (r209298) @@ -595,6 +595,7 @@ static void openpic_cpcht_config(device_ static void openpic_cpcht_enable(device_t, u_int irq, u_int vector); static void openpic_cpcht_unmask(device_t, u_int irq); static void openpic_cpcht_eoi(device_t, u_int irq); +static uint32_t openpic_cpcht_id(device_t); static device_method_t openpic_cpcht_methods[] = { /* Device interface */ @@ -609,6 +610,7 @@ static device_method_t openpic_cpcht_me DEVMETHOD(pic_ipi, openpic_ipi), DEVMETHOD(pic_mask, openpic_mask), DEVMETHOD(pic_unmask, openpic_cpcht_unmask), + DEVMETHOD(pic_id, openpic_cpcht_id), { 0, 0 }, }; @@ -808,3 +810,9 @@ openpic_cpcht_eoi(device_t dev, u_int ir openpic_eoi(dev, irq); } +static uint32_t +openpic_cpcht_id(device_t dev) +{ + return (ofw_bus_get_node(dev)); +} + Modified: head/sys/powerpc/powermac/grackle.c ============================================================================== --- head/sys/powerpc/powermac/grackle.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/powermac/grackle.c Fri Jun 18 14:06:27 2010 (r209298) @@ -43,6 +43,7 @@ #include #include +#include #include #include #include @@ -341,13 +342,15 @@ grackle_route_interrupt(device_t bus, de struct grackle_softc *sc; struct ofw_pci_register reg; uint32_t pintr, mintr; + phandle_t iparent; uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bus); pintr = pin; if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) - return (mintr); + sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), + &iparent, maskbuf)) + return (INTR_VEC(iparent, mintr)); /* Maybe it's a real interrupt, not an intpin */ if (pin > 4) Modified: head/sys/powerpc/powermac/hrowpic.c ============================================================================== --- head/sys/powerpc/powermac/hrowpic.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/powermac/hrowpic.c Fri Jun 18 14:06:27 2010 (r209298) @@ -70,6 +70,7 @@ static void hrowpic_eoi(device_t, u_int) static void hrowpic_ipi(device_t, u_int); static void hrowpic_mask(device_t, u_int); static void hrowpic_unmask(device_t, u_int); +static uint32_t hrowpic_id(device_t dev); static device_method_t hrowpic_methods[] = { /* Device interface */ @@ -80,6 +81,7 @@ static device_method_t hrowpic_methods[ DEVMETHOD(pic_dispatch, hrowpic_dispatch), DEVMETHOD(pic_enable, hrowpic_enable), DEVMETHOD(pic_eoi, hrowpic_eoi), + DEVMETHOD(pic_id, hrowpic_id), DEVMETHOD(pic_ipi, hrowpic_ipi), DEVMETHOD(pic_mask, hrowpic_mask), DEVMETHOD(pic_unmask, hrowpic_unmask), @@ -169,6 +171,8 @@ hrowpic_attach(device_t dev) hrowpic_write_reg(sc, HPIC_CLEAR, HPIC_SECONDARY, 0xffffffff); powerpc_register_pic(dev, 64); + root_pic = dev; /* Heathrow systems have only one PIC */ + return (0); } @@ -282,3 +286,10 @@ hrowpic_unmask(device_t dev, u_int irq) sc = device_get_softc(dev); hrowpic_toggle_irq(sc, irq, 1); } + +static uint32_t +hrowpic_id(device_t dev) +{ + return (ofw_bus_get_node(dev)); +} + Modified: head/sys/powerpc/powermac/macgpio.c ============================================================================== --- head/sys/powerpc/powermac/macgpio.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/powermac/macgpio.c Fri Jun 18 14:06:27 2010 (r209298) @@ -35,15 +35,16 @@ #include #include #include -#include #include -#include #include #include -#include +#include +#include +#include #include +#include #include #include @@ -150,8 +151,7 @@ macgpio_attach(device_t dev) { struct macgpio_softc *sc; struct macgpio_devinfo *dinfo; - phandle_t root; - phandle_t child; + phandle_t root, child, iparent; device_t cdev; uint32_t irq; @@ -186,10 +186,13 @@ macgpio_attach(device_t dev) resource_list_init(&dinfo->mdi_resources); - if (OF_getprop(child,"interrupts",&irq, sizeof(irq)) == + if (OF_getprop(child, "interrupts", &irq, sizeof(irq)) == sizeof(irq)) { + OF_searchprop(child, "interrupt-parent", &iparent, + sizeof(iparent)); resource_list_add(&dinfo->mdi_resources, SYS_RES_IRQ, - 0, irq, irq, 1); + 0, INTR_VEC(iparent, irq), INTR_VEC(iparent, irq), + 1); } /* Fix messed-up offsets */ Modified: head/sys/powerpc/powermac/macio.c ============================================================================== --- head/sys/powerpc/powermac/macio.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/powermac/macio.c Fri Jun 18 14:06:27 2010 (r209298) @@ -37,15 +37,16 @@ #include #include #include -#include #include -#include #include #include -#include +#include +#include +#include #include +#include #include #include @@ -186,6 +187,7 @@ macio_get_quirks(const char *name) static void macio_add_intr(phandle_t devnode, struct macio_devinfo *dinfo) { + phandle_t iparent; int *intr; int i, nintr; int icells; @@ -211,11 +213,17 @@ macio_add_intr(phandle_t devnode, struct if (intr[0] == -1) return; + if (OF_getprop(devnode, "interrupt-parent", &iparent, sizeof(iparent)) + <= 0) + panic("Interrupt but no interrupt parent!\n"); + for (i = 0; i < nintr; i+=icells) { resource_list_add(&dinfo->mdi_resources, SYS_RES_IRQ, - dinfo->mdi_ninterrupts, intr[i], intr[i], 1); + dinfo->mdi_ninterrupts, INTR_VEC(iparent, intr[i]), + INTR_VEC(iparent, intr[i]), 1); - dinfo->mdi_interrupts[dinfo->mdi_ninterrupts] = intr[i]; + dinfo->mdi_interrupts[dinfo->mdi_ninterrupts] = + INTR_VEC(iparent, intr[i]); dinfo->mdi_ninterrupts++; } } Modified: head/sys/powerpc/powermac/openpic_macio.c ============================================================================== --- head/sys/powerpc/powermac/openpic_macio.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/powermac/openpic_macio.c Fri Jun 18 14:06:27 2010 (r209298) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); * MacIO interface */ static int openpic_macio_probe(device_t); +static uint32_t openpic_macio_id(device_t); static device_method_t openpic_macio_methods[] = { /* Device interface */ @@ -73,6 +74,7 @@ static device_method_t openpic_macio_me DEVMETHOD(pic_ipi, openpic_ipi), DEVMETHOD(pic_mask, openpic_mask), DEVMETHOD(pic_unmask, openpic_unmask), + DEVMETHOD(pic_id, openpic_macio_id), { 0, 0 }, }; @@ -96,3 +98,10 @@ openpic_macio_probe(device_t dev) device_set_desc(dev, OPENPIC_DEVSTR); return (0); } + +static uint32_t +openpic_macio_id(device_t dev) +{ + return (ofw_bus_get_node(dev)); +} + Modified: head/sys/powerpc/powermac/uninorth.c ============================================================================== --- head/sys/powerpc/powermac/uninorth.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/powermac/uninorth.c Fri Jun 18 14:06:27 2010 (r209298) @@ -144,9 +144,9 @@ DRIVER_MODULE(unin, nexus, unin_chip_dri static void unin_chip_add_intr(phandle_t devnode, struct unin_chip_devinfo *dinfo) { + phandle_t iparent; int *intr; int i, nintr; - phandle_t iparent; int icells; if (dinfo->udi_ninterrupts >= 6) { @@ -176,9 +176,17 @@ unin_chip_add_intr(phandle_t devnode, st for (i = 0; i < nintr; i+=icells) { resource_list_add(&dinfo->udi_resources, SYS_RES_IRQ, - dinfo->udi_ninterrupts, intr[i], intr[i], 1); + dinfo->udi_ninterrupts, INTR_VEC(iparent, intr[i]), + INTR_VEC(iparent, intr[i]), 1); + + if (icells > 1) { + powerpc_config_intr(INTR_VEC(iparent, intr[i]), + (intr[i+1] & 1) ? INTR_TRIGGER_LEVEL : + INTR_TRIGGER_EDGE, INTR_POLARITY_HIGH); + } - dinfo->udi_interrupts[dinfo->udi_ninterrupts] = intr[i]; + dinfo->udi_interrupts[dinfo->udi_ninterrupts] = + INTR_VEC(iparent, intr[i]); dinfo->udi_ninterrupts++; } } Modified: head/sys/powerpc/powermac/uninorthpci.c ============================================================================== --- head/sys/powerpc/powermac/uninorthpci.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/powermac/uninorthpci.c Fri Jun 18 14:06:27 2010 (r209298) @@ -356,14 +356,15 @@ uninorth_route_interrupt(device_t bus, d struct uninorth_softc *sc; struct ofw_pci_register reg; uint32_t pintr, mintr; + phandle_t iparent; uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; sc = device_get_softc(bus); pintr = pin; if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - maskbuf)) - return (mintr); + &iparent, maskbuf)) + return (INTR_VEC(iparent, mintr)); /* Maybe it's a real interrupt, not an intpin */ if (pin > 4) Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/powerpc/intr_machdep.c Fri Jun 18 14:06:27 2010 (r209298) @@ -85,14 +85,6 @@ #include "pic_if.h" -#ifdef MPC85XX -#define ISA_IRQ_COUNT 16 -#endif - -#ifndef ISA_IRQ_COUNT -#define ISA_IRQ_COUNT 0 -#endif - #define MAX_STRAY_LOG 5 MALLOC_DEFINE(M_INTR, "intr", "interrupt handler data"); @@ -108,20 +100,25 @@ struct powerpc_intr { enum intr_polarity pol; }; +struct pic { + device_t pic; + uint32_t pic_id; + int ipi_irq; +}; + static struct mtx intr_table_lock; static struct powerpc_intr *powerpc_intrs[INTR_VECTORS]; +static struct pic piclist[MAX_PICS]; static u_int nvectors; /* Allocated vectors */ +static u_int npics; /* PICs registered */ static u_int stray_count; +device_t root_pic; + #ifdef SMP static void *ipi_cookie; #endif -static u_int ipi_irq; - -device_t pic; -device_t pic8259; - static void intr_init(void *dummy __unused) { @@ -198,21 +195,13 @@ static int powerpc_map_irq(struct powerpc_intr *i) { -#if ISA_IRQ_COUNT > 0 - if (i->irq < ISA_IRQ_COUNT) { - if (pic8259 == NULL) { - i->pic = pic; - i->intline = 0; - return (ENXIO); - } - i->pic = pic8259; - i->intline = i->irq; - return (0); - } -#endif + i->intline = INTR_INTLINE(i->irq); + i->pic = piclist[INTR_IGN(i->irq)].pic; + + /* Try a best guess if that failed */ + if (i->pic == NULL) + i->pic = root_pic; - i->pic = pic; - i->intline = i->irq - ISA_IRQ_COUNT; return (0); } @@ -243,16 +232,44 @@ powerpc_intr_unmask(void *arg) void powerpc_register_pic(device_t dev, u_int ipi) { + int i; + + mtx_lock(&intr_table_lock); - pic = dev; - ipi_irq = ipi + ISA_IRQ_COUNT; + for (i = 0; i < npics; i++) { + if (piclist[i].pic_id == PIC_ID(dev)) + break; + } + piclist[i].pic = dev; + piclist[i].pic_id = PIC_ID(dev); + piclist[i].ipi_irq = ipi; + if (i == npics) + npics++; + + mtx_unlock(&intr_table_lock); } -void -powerpc_register_8259(device_t dev) +int +powerpc_ign_lookup(uint32_t pic_id) { + int i; + + mtx_lock(&intr_table_lock); + + for (i = 0; i < npics; i++) { + if (piclist[i].pic_id == pic_id) { + mtx_unlock(&intr_table_lock); + return (i); + } + } + piclist[i].pic = NULL; + piclist[i].pic_id = pic_id; + piclist[i].ipi_irq = 0; + npics++; - pic8259 = dev; + mtx_unlock(&intr_table_lock); + + return (i); } int @@ -260,17 +277,28 @@ powerpc_enable_intr(void) { struct powerpc_intr *i; int error, vector; +#ifdef SMP + int n; +#endif - if (pic == NULL) + if (npics == 0) panic("no PIC detected\n"); #ifdef SMP /* Install an IPI handler. */ - error = powerpc_setup_intr("IPI", ipi_irq, powerpc_ipi_handler, - NULL, NULL, INTR_TYPE_MISC | INTR_EXCL | INTR_FAST, &ipi_cookie); - if (error) { - printf("unable to setup IPI handler\n"); - return (error); + + for (n = 0; n < npics; n++) { + if (piclist[n].pic != root_pic) + continue; + + error = powerpc_setup_intr("IPI", + INTR_VEC(piclist[n].pic_id, piclist[n].ipi_irq), + powerpc_ipi_handler, NULL, NULL, + INTR_TYPE_MISC | INTR_EXCL | INTR_FAST, &ipi_cookie); + if (error) { + printf("unable to setup IPI handler\n"); + return (error); + } } #endif @@ -295,7 +323,7 @@ powerpc_enable_intr(void) } int -powerpc_setup_intr(const char *name, u_int irq, driver_filter_t filter, +powerpc_setup_intr(const char *name, u_int irq, driver_filter_t filter, driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep) { struct powerpc_intr *i; Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Fri Jun 18 11:36:55 2010 (r209297) +++ head/sys/powerpc/powerpc/mp_machdep.c Fri Jun 18 14:06:27 2010 (r209298) @@ -319,7 +319,7 @@ ipi_send(struct pcpu *pc, int ipi) pc, pc->pc_cpuid, ipi); atomic_set_32(&pc->pc_ipimask, (1 << ipi)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 14:16: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 8B192106566B; Fri, 18 Jun 2010 14:16:25 +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 7911A8FC1D; Fri, 18 Jun 2010 14:16: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 o5IEGPFJ080245; Fri, 18 Jun 2010 14:16:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IEGPRO080241; Fri, 18 Jun 2010 14:16:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006181416.o5IEGPRO080241@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 18 Jun 2010 14:16: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: r209299 - in head/sys/powerpc: ofw powermac powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 14:16:25 -0000 Author: nwhitehorn Date: Fri Jun 18 14:16:24 2010 New Revision: 209299 URL: http://svn.freebsd.org/changeset/base/209299 Log: Change the default interrupt polarity on PowerPC systems from high to low. On Apple systems at least, all the level interrupts are wired active low. Before this change, our PIC programming only worked because Apple hardware ignores the interrupt polarity bit on all interrupts except IRQ 0. Modified: head/sys/powerpc/ofw/ofw_pcibus.c head/sys/powerpc/powermac/uninorth.c head/sys/powerpc/powerpc/openpic.c Modified: head/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcibus.c Fri Jun 18 14:06:27 2010 (r209298) +++ head/sys/powerpc/ofw/ofw_pcibus.c Fri Jun 18 14:16:24 2010 (r209299) @@ -219,7 +219,7 @@ ofw_pcibus_enum_devtree(device_t dev, u_ powerpc_config_intr(intr[0], (intr[1] & 1) ? INTR_TRIGGER_LEVEL : INTR_TRIGGER_EDGE, - INTR_POLARITY_HIGH); + INTR_POLARITY_LOW); } resource_list_add(&dinfo->opd_dinfo.resources, @@ -265,15 +265,27 @@ ofw_pcibus_enum_bus(device_t dev, u_int dinfo = (struct ofw_pcibus_devinfo *)pci_read_device( pcib, domain, busno, s, f, sizeof(*dinfo)); - if (dinfo != NULL) { - dinfo->opd_obdinfo.obd_node = -1; + if (dinfo == NULL) + continue; + + dinfo->opd_obdinfo.obd_node = -1; - dinfo->opd_obdinfo.obd_name = NULL; - dinfo->opd_obdinfo.obd_compat = NULL; - dinfo->opd_obdinfo.obd_type = NULL; - dinfo->opd_obdinfo.obd_model = NULL; - pci_add_child(dev, (struct pci_devinfo *)dinfo); + dinfo->opd_obdinfo.obd_name = NULL; + dinfo->opd_obdinfo.obd_compat = NULL; + dinfo->opd_obdinfo.obd_type = NULL; + dinfo->opd_obdinfo.obd_model = NULL; + + /* + * For non OFW-devices, don't believe 0 + * for an interrupt. + */ + if (dinfo->opd_dinfo.cfg.intline == 0) { + dinfo->opd_dinfo.cfg.intline = PCI_INVALID_IRQ; + PCIB_WRITE_CONFIG(pcib, busno, s, f, + PCIR_INTLINE, PCI_INVALID_IRQ, 1); } + + pci_add_child(dev, (struct pci_devinfo *)dinfo); } } } @@ -311,7 +323,7 @@ ofw_pcibus_assign_interrupt(device_t dev * spec will need to be studied. */ - return (0); + return (PCI_INVALID_IRQ); #ifdef NOTYET intr = pci_get_intpin(child); Modified: head/sys/powerpc/powermac/uninorth.c ============================================================================== --- head/sys/powerpc/powermac/uninorth.c Fri Jun 18 14:06:27 2010 (r209298) +++ head/sys/powerpc/powermac/uninorth.c Fri Jun 18 14:16:24 2010 (r209299) @@ -182,7 +182,7 @@ unin_chip_add_intr(phandle_t devnode, st if (icells > 1) { powerpc_config_intr(INTR_VEC(iparent, intr[i]), (intr[i+1] & 1) ? INTR_TRIGGER_LEVEL : - INTR_TRIGGER_EDGE, INTR_POLARITY_HIGH); + INTR_TRIGGER_EDGE, INTR_POLARITY_LOW); } dinfo->udi_interrupts[dinfo->udi_ninterrupts] = Modified: head/sys/powerpc/powerpc/openpic.c ============================================================================== --- head/sys/powerpc/powerpc/openpic.c Fri Jun 18 14:06:27 2010 (r209298) +++ head/sys/powerpc/powerpc/openpic.c Fri Jun 18 14:16:24 2010 (r209299) @@ -175,7 +175,7 @@ openpic_attach(device_t dev) for (irq = 0; irq < sc->sc_nirq; irq++) { x = irq; /* irq == vector. */ x |= OPENPIC_IMASK; - x |= OPENPIC_POLARITY_POSITIVE; + x |= OPENPIC_POLARITY_NEGATIVE; x |= OPENPIC_SENSE_LEVEL; x |= 8 << OPENPIC_PRIORITY_SHIFT; openpic_write(sc, OPENPIC_SRC_VECTOR(irq), x); From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 14:17: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 2A9711065678; Fri, 18 Jun 2010 14:17:46 +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 199F08FC13; Fri, 18 Jun 2010 14:17: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 o5IEHjvC080579; Fri, 18 Jun 2010 14:17:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IEHj1B080577; Fri, 18 Jun 2010 14:17:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006181417.o5IEHj1B080577@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 18 Jun 2010 14:17: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: r209300 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 14:17:46 -0000 Author: nwhitehorn Date: Fri Jun 18 14:17:45 2010 New Revision: 209300 URL: http://svn.freebsd.org/changeset/base/209300 Log: Following r209299, level interrupts are low by default on PPC, so remove the hack here to reprogram the interrupt for K2 SATA devices. Modified: head/sys/dev/ata/chipsets/ata-serverworks.c Modified: head/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-serverworks.c Fri Jun 18 14:16:24 2010 (r209299) +++ head/sys/dev/ata/chipsets/ata-serverworks.c Fri Jun 18 14:17:45 2010 (r209300) @@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef __powerpc__ -#include -#endif #include #include #include @@ -220,10 +217,6 @@ ata_serverworks_ch_attach(device_t dev) ch->hw.tf_write = ata_serverworks_tf_write; #ifdef __powerpc__ ch->hw.status = ata_serverworks_status; - - /* Make sure that our interrupt is level low */ - powerpc_config_intr(bus_get_resource_start(device_get_parent(dev), - SYS_RES_IRQ, 0), INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW); #endif if (ctlr->chip->chipid == ATA_K2) { From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 14:20: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 8AC2B1065670; Fri, 18 Jun 2010 14:20:54 +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 797E78FC14; Fri, 18 Jun 2010 14:20: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 o5IEKsi5081318; Fri, 18 Jun 2010 14:20:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IEKspQ081316; Fri, 18 Jun 2010 14:20:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006181420.o5IEKspQ081316@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 18 Jun 2010 14:20: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: r209301 - head/sys/dev/iicbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 14:20:54 -0000 Author: nwhitehorn Date: Fri Jun 18 14:20:54 2010 New Revision: 209301 URL: http://svn.freebsd.org/changeset/base/209301 Log: Revert changes accidentally committed as part of r209298. Modified: head/sys/dev/iicbus/iiconf.c Modified: head/sys/dev/iicbus/iiconf.c ============================================================================== --- head/sys/dev/iicbus/iiconf.c Fri Jun 18 14:17:45 2010 (r209300) +++ head/sys/dev/iicbus/iiconf.c Fri Jun 18 14:20:54 2010 (r209301) @@ -363,7 +363,7 @@ iicbus_transfer(device_t bus, struct iic int iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) { - int i, error, lenread, lenwrote, nkid, rpstart, addr; + int i, error, lenread, lenwrote, nkid; device_t *children, bus; if ((error = device_get_children(dev, &children, &nkid)) != 0) @@ -373,38 +373,14 @@ iicbus_transfer_gen(device_t dev, struct return (EIO); } bus = children[0]; - rpstart = 0; free(children, M_TEMP); for (i = 0, error = 0; i < nmsgs && error == 0; i++) { - addr = msgs[i].slave; if (msgs[i].flags & IIC_M_RD) - addr |= LSB; + error = iicbus_block_read(bus, msgs[i].slave, + msgs[i].buf, msgs[i].len, &lenread); else - addr &= ~LSB; - - if (!(msgs[i].flags & IIC_M_NOSTART)) { - if (rpstart) - error = iicbus_repeated_start(bus, addr, 0); - else - error = iicbus_start(bus, addr, 0); - } - - if (error) - break; - - if (msgs[i].flags & IIC_M_RD) - error = iicbus_read(bus, msgs[i].buf, msgs[i].len, - &lenread, IIC_LAST_READ, 0); - else - error = iicbus_write(bus, msgs[i].buf, msgs[i].len, - &lenwrote, 0); - - if (!(msgs[i].flags & IIC_M_NOSTOP)) { - rpstart = 0; - iicbus_stop(bus); - } else { - rpstart = 1; /* Next message gets repeated start */ - } + error = iicbus_block_write(bus, msgs[i].slave, + msgs[i].buf, msgs[i].len, &lenwrote); } return (error); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 14:28: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 13830106564A; Fri, 18 Jun 2010 14:28:58 +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 0255D8FC1B; Fri, 18 Jun 2010 14:28: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 o5IESvr4083123; Fri, 18 Jun 2010 14:28:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IESvDT083121; Fri, 18 Jun 2010 14:28:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006181428.o5IESvDT083121@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 18 Jun 2010 14:28: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: r209302 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 14:28:58 -0000 Author: nwhitehorn Date: Fri Jun 18 14:28:57 2010 New Revision: 209302 URL: http://svn.freebsd.org/changeset/base/209302 Log: Add support for the Keywest I2C controller in Apple uninorth northbridges. Although the Keywest registers have only 1 byte of content, they are secretly 4-byte registers, which became apparent from them moving on the big-endian Uninorth version of the controller. Modified: head/sys/powerpc/powermac/kiic.c Modified: head/sys/powerpc/powermac/kiic.c ============================================================================== --- head/sys/powerpc/powermac/kiic.c Fri Jun 18 14:20:54 2010 (r209301) +++ head/sys/powerpc/powermac/kiic.c Fri Jun 18 14:28:57 2010 (r209302) @@ -57,6 +57,7 @@ #define ADDR 5 #define SUBADDR 6 #define DATA 7 +#define REV 8 /* MODE */ #define I2C_SPEED 0x03 /* Speed mask */ @@ -146,6 +147,7 @@ static driver_t kiic_driver = { static devclass_t kiic_devclass; DRIVER_MODULE(kiic, macio, kiic_driver, kiic_devclass, 0, 0); +DRIVER_MODULE(kiic, unin, kiic_driver, kiic_devclass, 0, 0); static int kiic_probe(device_t self) @@ -235,6 +237,9 @@ kiic_attach(device_t self) kiic_writereg(sc, IER, I2C_INT_DATA | I2C_INT_ADDR | I2C_INT_STOP); + if (bootverbose) + device_printf(self, "Revision: %02X\n", kiic_readreg(sc, REV)); + /* Add the IIC bus layer */ sc->sc_iicbus = device_add_child(self, "iicbus", -1); @@ -244,14 +249,14 @@ kiic_attach(device_t self) static void kiic_writereg(struct kiic_softc *sc, u_int reg, u_int val) { - bus_write_1(sc->sc_reg, sc->sc_regstep * reg, val); + bus_write_4(sc->sc_reg, sc->sc_regstep * reg, val); DELAY(10); /* register access delay */ } static u_int kiic_readreg(struct kiic_softc *sc, u_int reg) { - return bus_read_1(sc->sc_reg, sc->sc_regstep * reg); + return bus_read_4(sc->sc_reg, sc->sc_regstep * reg) & 0xff; } static void From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 16:07: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 3B4381065673; Fri, 18 Jun 2010 16:07:25 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A9508FC08; Fri, 18 Jun 2010 16:07: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 o5IG7POs005201; Fri, 18 Jun 2010 16:07:25 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IG7PjF005199; Fri, 18 Jun 2010 16:07:25 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201006181607.o5IG7PjF005199@svn.freebsd.org> From: Alexander Kabaev Date: Fri, 18 Jun 2010 16:07: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: r209305 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 16:07:25 -0000 Author: kan Date: Fri Jun 18 16:07:24 2010 New Revision: 209305 URL: http://svn.freebsd.org/changeset/base/209305 Log: Do not allow EOF token to be put back into input buffer. This reimplements previous change from r20930 in more generic way. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Fri Jun 18 15:25:57 2010 (r209304) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Fri Jun 18 16:07:24 2010 (r209305) @@ -45,7 +45,7 @@ #undef input #undef unput #else -/* +/* * Define YY_INPUT for flex since input() can't be re-defined. */ #define YY_INPUT(buf,result,max_size) \ @@ -60,6 +60,15 @@ buf[n] = *yypcb->pcb_strptr++; \ result = n; \ } +/* + * Do not EOF let tokens to be put back. This does not work with flex. + * On the other hand, leaving current buffer in same state it was when + * last EOF was received guarantees that input() will keep returning EOF + * for all subsequent invocations, which is the effect desired. + */ +#undef unput +#define unput(c) \ + if (c != EOF) yyunput( c, yytext_ptr ) #endif static int id_or_type(const char *); @@ -811,8 +820,7 @@ id_or_type(const char *s) longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); } - if (c0 != EOF) - unput(c0); + unput(c0); return (ttok); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 16:29: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 658E71065670; Fri, 18 Jun 2010 16:29:03 +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 54F128FC14; Fri, 18 Jun 2010 16:29: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 o5IGT3WR010080; Fri, 18 Jun 2010 16:29:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IGT3SQ010078; Fri, 18 Jun 2010 16:29:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006181629.o5IGT3SQ010078@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 18 Jun 2010 16:29: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: r209307 - head/sys/sun4v/sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 16:29:03 -0000 Author: nwhitehorn Date: Fri Jun 18 16:29:03 2010 New Revision: 209307 URL: http://svn.freebsd.org/changeset/base/209307 Log: Missed change to sun4v while adding iparent lookup to the OFW interrupt map interface. Modified: head/sys/sun4v/sun4v/hv_pci.c Modified: head/sys/sun4v/sun4v/hv_pci.c ============================================================================== --- head/sys/sun4v/sun4v/hv_pci.c Fri Jun 18 16:14:37 2010 (r209306) +++ head/sys/sun4v/sun4v/hv_pci.c Fri Jun 18 16:29:03 2010 (r209307) @@ -333,7 +333,7 @@ hvpci_route_interrupt(device_t bridge, d node = ofw_bus_get_node(dev); pintr = pin; obli = ofw_bus_lookup_imap(node, &sc->hs_pci_iinfo, ®, sizeof(reg), - &pintr, sizeof(pintr), &mintr, sizeof(mintr), maskbuf); + &pintr, sizeof(pintr), &mintr, sizeof(mintr), NULL, maskbuf); device_printf(dev, "called hvpci_route_intr: %d, got: mintr: %#x\n", obli, mintr); if (obli) From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 17:39: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 C82AE106566B; Fri, 18 Jun 2010 17:39:56 +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 B6B518FC15; Fri, 18 Jun 2010 17:39: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 o5IHduEj025922; Fri, 18 Jun 2010 17:39:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IHdu6x025919; Fri, 18 Jun 2010 17:39:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006181739.o5IHdu6x025919@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 18 Jun 2010 17:39: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: r209310 - in head/sys/powerpc: ofw powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 17:39:57 -0000 Author: nwhitehorn Date: Fri Jun 18 17:39:56 2010 New Revision: 209310 URL: http://svn.freebsd.org/changeset/base/209310 Log: Add MSI support for PCI devices attached to the CPC925 and CPC945 bridges found in Apple and IBM G5 systems. Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c head/sys/powerpc/powermac/cpcht.c Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcib_pci.c Fri Jun 18 17:22:08 2010 (r209309) +++ head/sys/powerpc/ofw/ofw_pcib_pci.c Fri Jun 18 17:39:56 2010 (r209310) @@ -76,6 +76,11 @@ static device_method_t ofw_pcib_pci_meth DEVMETHOD(pcib_read_config, pcib_read_config), DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, ofw_pcib_pci_route_interrupt), + DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), + DEVMETHOD(pcib_release_msi, pcib_release_msi), + DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), + DEVMETHOD(pcib_release_msix, pcib_release_msix), + DEVMETHOD(pcib_map_msi, pcib_map_msi), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_pci_get_node), Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Fri Jun 18 17:22:08 2010 (r209309) +++ head/sys/powerpc/powermac/cpcht.c Fri Jun 18 17:39:56 2010 (r209310) @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include #include @@ -45,8 +47,6 @@ #include #include -#include - #include #include @@ -89,6 +89,16 @@ static void cpcht_write_config(device_t u_int, u_int32_t, int); static int cpcht_route_interrupt(device_t bus, device_t dev, int pin); +static int cpcht_alloc_msi(device_t dev, device_t child, + int count, int maxcount, int *irqs); +static int cpcht_release_msi(device_t dev, device_t child, + int count, int *irqs); +static int cpcht_alloc_msix(device_t dev, device_t child, + int *irq); +static int cpcht_release_msix(device_t dev, device_t child, + int irq); +static int cpcht_map_msi(device_t dev, device_t child, + int irq, uint64_t *addr, uint32_t *data); /* * ofw_bus interface @@ -119,6 +129,11 @@ static device_method_t cpcht_methods[] = DEVMETHOD(pcib_read_config, cpcht_read_config), DEVMETHOD(pcib_write_config, cpcht_write_config), DEVMETHOD(pcib_route_interrupt, cpcht_route_interrupt), + DEVMETHOD(pcib_alloc_msi, cpcht_alloc_msi), + DEVMETHOD(pcib_release_msi, cpcht_release_msi), + DEVMETHOD(pcib_alloc_msix, cpcht_alloc_msix), + DEVMETHOD(pcib_release_msix, cpcht_release_msix), + DEVMETHOD(pcib_map_msi, cpcht_map_msi), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, cpcht_get_node), @@ -126,6 +141,10 @@ static device_method_t cpcht_methods[] = }; struct cpcht_irq { + enum { + IRQ_NONE, IRQ_HT, IRQ_MSI, IRQ_INTERNAL + } irq_type; + int ht_source; vm_offset_t ht_base; @@ -135,6 +154,7 @@ struct cpcht_irq { }; static struct cpcht_irq *cpcht_irqmap = NULL; +uint32_t cpcht_msipic = 0; struct cpcht_softc { device_t sc_dev; @@ -144,6 +164,7 @@ struct cpcht_softc { struct rman sc_mem_rman; struct cpcht_irq htirq_map[128]; + struct mtx htirq_mtx; }; static driver_t cpcht_driver = { @@ -199,7 +220,7 @@ cpcht_attach(device_t dev) struct cpcht_softc *sc; phandle_t node, child; u_int32_t reg[3]; - int error; + int i, error; node = ofw_bus_get_node(dev); sc = device_get_softc(dev); @@ -228,6 +249,9 @@ cpcht_attach(device_t dev) */ bzero(sc->htirq_map, sizeof(sc->htirq_map)); + mtx_init(&sc->htirq_mtx, "cpcht irq", NULL, MTX_DEF); + for (i = 0; i < 8; i++) + sc->htirq_map[i].irq_type = IRQ_INTERNAL; for (child = OF_child(node); child != 0; child = OF_peer(child)) cpcht_configure_htbridge(dev, child); @@ -336,6 +360,7 @@ cpcht_configure_htbridge(device_t dev, p irq | HTAPIC_MASK, 4); irq = (irq >> 16) & 0xff; + sc->htirq_map[irq].irq_type = IRQ_HT; sc->htirq_map[irq].ht_source = i; sc->htirq_map[irq].ht_base = sc->sc_data + (((((s & 0x1f) << 3) | (f & 0x07)) << 8) | (ptr)); @@ -584,6 +609,129 @@ cpcht_deactivate_resource(device_t bus, return (rman_deactivate_resource(res)); } +static int +cpcht_alloc_msi(device_t dev, device_t child, int count, int maxcount, + int *irqs) +{ + struct cpcht_softc *sc; + int i, j; + + sc = device_get_softc(dev); + j = 0; + + /* Bail if no MSI PIC yet */ + if (cpcht_msipic == 0) + return (ENXIO); + + mtx_lock(&sc->htirq_mtx); + for (i = 8; i < 124 - count; i++) { + for (j = 0; j < count; j++) { + if (sc->htirq_map[i+j].irq_type != IRQ_NONE) + break; + } + if (j == count) + break; + + i += j; /* We know there isn't a large enough run */ + } + + if (j != count) { + mtx_unlock(&sc->htirq_mtx); + return (ENXIO); + } + + for (j = 0; j < count; j++) { + irqs[j] = INTR_VEC(cpcht_msipic, i+j); + sc->htirq_map[i+j].irq_type = IRQ_MSI; + } + mtx_unlock(&sc->htirq_mtx); + + return (0); +} + +static int +cpcht_release_msi(device_t dev, device_t child, int count, int *irqs) +{ + struct cpcht_softc *sc; + int i; + + sc = device_get_softc(dev); + + mtx_lock(&sc->htirq_mtx); + for (i = 0; i < count; i++) + sc->htirq_map[irqs[i] & 0xff].irq_type = IRQ_NONE; + mtx_unlock(&sc->htirq_mtx); + + return (0); +} + +static int +cpcht_alloc_msix(device_t dev, device_t child, int *irq) +{ + struct cpcht_softc *sc; + int i; + + sc = device_get_softc(dev); + + /* Bail if no MSI PIC yet */ + if (cpcht_msipic == 0) + return (ENXIO); + + mtx_lock(&sc->htirq_mtx); + for (i = 8; i < 124; i++) { + if (sc->htirq_map[i].irq_type == IRQ_NONE) { + sc->htirq_map[i].irq_type = IRQ_MSI; + *irq = INTR_VEC(cpcht_msipic, i); + + mtx_unlock(&sc->htirq_mtx); + return (0); + } + } + mtx_unlock(&sc->htirq_mtx); + + return (ENXIO); +} + +static int +cpcht_release_msix(device_t dev, device_t child, int irq) +{ + struct cpcht_softc *sc; + + sc = device_get_softc(dev); + + mtx_lock(&sc->htirq_mtx); + sc->htirq_map[irq & 0xff].irq_type = IRQ_NONE; + mtx_unlock(&sc->htirq_mtx); + + return (0); +} + +static int +cpcht_map_msi(device_t dev, device_t child, int irq, uint64_t *addr, + uint32_t *data) +{ + device_t pcib; + struct pci_devinfo *dinfo; + struct pcicfg_ht *ht = NULL; + + for (pcib = child; pcib != dev; pcib = + device_get_parent(device_get_parent(pcib))) { + dinfo = device_get_ivars(pcib); + ht = &dinfo->cfg.ht; + + if (ht == NULL) + continue; + } + + if (ht == NULL) + return (ENXIO); + + *addr = ht->ht_msiaddr; + *data = irq & 0xff; + + return (0); +} + /* * Driver for the integrated MPIC on U3/U4 (CPC925/CPC945) */ @@ -671,6 +819,15 @@ openpic_cpcht_attach(device_t dev) for (irq = 4; irq < 124; irq++) openpic_config(dev, irq, INTR_TRIGGER_EDGE, INTR_POLARITY_LOW); + /* + * Use this PIC for MSI only if it is the root PIC. This may not + * be necessary, but Linux does it, and I cannot find any U3 machines + * with MSI devices to test. + */ + + if (dev == root_pic) + cpcht_msipic = PIC_ID(dev); + return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 18:18: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 4F28C106564A; Fri, 18 Jun 2010 18:18:04 +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 3F2188FC19; Fri, 18 Jun 2010 18:18: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 o5III4IK034500; Fri, 18 Jun 2010 18:18:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5III4kb034498; Fri, 18 Jun 2010 18:18:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006181818.o5III4kb034498@svn.freebsd.org> From: Alexander Motin Date: Fri, 18 Jun 2010 18:18: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: r209312 - 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: Fri, 18 Jun 2010 18:18:04 -0000 Author: mav Date: Fri Jun 18 18:18:03 2010 New Revision: 209312 URL: http://svn.freebsd.org/changeset/base/209312 Log: Do not print first digits of IRQ number if whole number doesn't fit. Modified: head/usr.bin/systat/vmstat.c Modified: head/usr.bin/systat/vmstat.c ============================================================================== --- head/usr.bin/systat/vmstat.c Fri Jun 18 18:15:40 2010 (r209311) +++ head/usr.bin/systat/vmstat.c Fri Jun 18 18:18:03 2010 (r209312) @@ -254,24 +254,23 @@ initkre(void) cp1++; if (cp1 != cp && *cp1 == ':' && *(cp1 + 1) == ' ') { + sz = strlen(cp); *cp1 = '\0'; cp1 = cp1 + 2; cp2 = strdup(cp); - bcopy(cp1, cp, strlen(cp1) + 1); - strcat(cp, " "); - strcat(cp, cp2); + 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) { + 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 Fri Jun 18 18:51: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 3C81A1065670; Fri, 18 Jun 2010 18:51:10 +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 12A1F8FC16; Fri, 18 Jun 2010 18:51:10 +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 o5IIp9tD041866; Fri, 18 Jun 2010 18:51:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IIp99D041862; Fri, 18 Jun 2010 18:51:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006181851.o5IIp99D041862@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 18 Jun 2010 18:51: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: r209313 - in head/sys: amd64/conf conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 18:51:10 -0000 Author: kib Date: Fri Jun 18 18:51:09 2010 New Revision: 209313 URL: http://svn.freebsd.org/changeset/base/209313 Log: Only enable kdtrace hook in the LINT on the architectures that implement it. Modified: head/sys/amd64/conf/NOTES head/sys/conf/NOTES head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri Jun 18 18:18:03 2010 (r209312) +++ head/sys/amd64/conf/NOTES Fri Jun 18 18:51:09 2010 (r209313) @@ -11,6 +11,12 @@ # We want LINT to cover profiling as well. profile 2 +# +# Enable the kernel DTrace hooks which are required to load the DTrace +# kernel modules. +# +options KDTRACE_HOOKS + ##################################################################### # SMP OPTIONS: Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Jun 18 18:18:03 2010 (r209312) +++ head/sys/conf/NOTES Fri Jun 18 18:51:09 2010 (r209313) @@ -372,12 +372,6 @@ options DDB_NUMSYM options GDB # -# Enable the kernel DTrace hooks which are required to load the DTrace -# kernel modules. -# -options KDTRACE_HOOKS - -# # SYSCTL_DEBUG enables a 'sysctl' debug tree that can be used to dump the # contents of the registered sysctl nodes on the console. It is disabled by # default because it generates excessively verbose console output that can Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Jun 18 18:18:03 2010 (r209312) +++ head/sys/i386/conf/NOTES Fri Jun 18 18:51:09 2010 (r209313) @@ -11,6 +11,12 @@ # We want LINT to cover profiling as well. profile 2 +# +# Enable the kernel DTrace hooks which are required to load the DTrace +# kernel modules. +# +options KDTRACE_HOOKS + ##################################################################### # SMP OPTIONS: From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 20:07: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 3E41E106566C; Fri, 18 Jun 2010 20:07:31 +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 234118FC1D; Fri, 18 Jun 2010 20:07: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 o5IK7Voa058804; Fri, 18 Jun 2010 20:07:31 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IK7V7h058801; Fri, 18 Jun 2010 20:07:31 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201006182007.o5IK7V7h058801@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 18 Jun 2010 20:07: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: r209314 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 20:07:31 -0000 Author: jchandra Date: Fri Jun 18 20:07:30 2010 New Revision: 209314 URL: http://svn.freebsd.org/changeset/base/209314 Log: Merge jmallett@'s n64 work into HEAD - changeset 5 Remove unnecessary locking and sched_pin() call while creating a temporary mapping. Changes from http://svn.freebsd.org/base/user/jmallett/octeon Approved by: rrs (mentor), jmallett Modified: head/sys/mips/include/pmap.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Fri Jun 18 18:51:09 2010 (r209313) +++ head/sys/mips/include/pmap.h Fri Jun 18 20:07:30 2010 (r209314) @@ -116,12 +116,6 @@ extern struct pmap kernel_pmap_store; #define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx) #define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) -#define PMAP_LGMEM_LOCK_INIT(sysmap) mtx_init(&(sysmap)->lock, "pmap-lgmem", \ - "per-cpu-map", (MTX_DEF| MTX_DUPOK)) -#define PMAP_LGMEM_LOCK(sysmap) mtx_lock(&(sysmap)->lock) -#define PMAP_LGMEM_UNLOCK(sysmap) mtx_unlock(&(sysmap)->lock) -#define PMAP_LGMEM_DESTROY(sysmap) mtx_destroy(&(sysmap)->lock) - /* * For each vm_page_t, there is a list of all currently valid virtual * mappings of that page. An entry is a pv_entry_t, the list is pv_table. Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri Jun 18 18:51:09 2010 (r209313) +++ head/sys/mips/mips/pmap.c Fri Jun 18 20:07:30 2010 (r209314) @@ -195,7 +195,6 @@ static void *pmap_ptpgzone_allocf(uma_zo static uma_zone_t ptpgzone; struct local_sysmaps { - struct mtx lock; vm_offset_t base; uint16_t valid1, valid2; }; @@ -214,11 +213,9 @@ static struct local_sysmaps sysmap_lmem[ struct local_sysmaps *sysm; \ pt_entry_t *pte, npte; \ \ + intr = intr_disable(); \ cpu = PCPU_GET(cpuid); \ sysm = &sysmap_lmem[cpu]; \ - PMAP_LGMEM_LOCK(sysm); \ - intr = intr_disable(); \ - sched_pin(); \ va = sysm->base; \ npte = TLBLO_PA_TO_PFN(phys) | \ PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; \ @@ -231,11 +228,9 @@ static struct local_sysmaps sysmap_lmem[ struct local_sysmaps *sysm; \ pt_entry_t *pte, npte; \ \ + intr = intr_disable(); \ cpu = PCPU_GET(cpuid); \ sysm = &sysmap_lmem[cpu]; \ - PMAP_LGMEM_LOCK(sysm); \ - intr = intr_disable(); \ - sched_pin(); \ va1 = sysm->base; \ va2 = sysm->base + PAGE_SIZE; \ npte = TLBLO_PA_TO_PFN(phys1) | \ @@ -258,9 +253,7 @@ static struct local_sysmaps sysmap_lmem[ *pte = PTE_G; \ tlb_invalidate_address(kernel_pmap, sysm->base + PAGE_SIZE); \ sysm->valid2 = 0; \ - sched_unpin(); \ - intr_restore(intr); \ - PMAP_LGMEM_UNLOCK(sysm); + intr_restore(intr) pd_entry_t pmap_segmap(pmap_t pmap, vm_offset_t va) @@ -436,7 +429,6 @@ again: sysmap_lmem[i].base = virtual_avail; virtual_avail += PAGE_SIZE * 2; sysmap_lmem[i].valid1 = sysmap_lmem[i].valid2 = 0; - PMAP_LGMEM_LOCK_INIT(&sysmap_lmem[i]); } } From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 21:24: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 9E06F10656C4; Fri, 18 Jun 2010 21:24:17 +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 8D3368FC17; Fri, 18 Jun 2010 21:24: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 o5ILOHHv075946; Fri, 18 Jun 2010 21:24:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ILOHGi075945; Fri, 18 Jun 2010 21:24:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006182124.o5ILOHGi075945@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 18 Jun 2010 21:24: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: r209316 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 21:24:17 -0000 Author: nwhitehorn Date: Fri Jun 18 21:24:17 2010 New Revision: 209316 URL: http://svn.freebsd.org/changeset/base/209316 Log: Missed commit in r209310: the IRQ number in INTR_VEC() should have parantheses around it to allow arithmetic expressions to be passed. Submitted by: Andreas Tobler Modified: head/sys/powerpc/include/intr_machdep.h Modified: head/sys/powerpc/include/intr_machdep.h ============================================================================== --- head/sys/powerpc/include/intr_machdep.h Fri Jun 18 21:10:56 2010 (r209315) +++ head/sys/powerpc/include/intr_machdep.h Fri Jun 18 21:24:17 2010 (r209316) @@ -35,7 +35,7 @@ #define INTR_INTLINE(irq) (irq & ((1 << IGN_SHIFT) - 1)) #define INTR_IGN(irq) (irq >> IGN_SHIFT) -#define INTR_VEC(pic_id, irq) ((powerpc_ign_lookup(pic_id) << IGN_SHIFT) | irq) +#define INTR_VEC(pic_id, irq) ((powerpc_ign_lookup(pic_id) << IGN_SHIFT) | (irq)) /* * Default base address for MSI messages on PowerPC From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 21:40: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 27077106566B; Fri, 18 Jun 2010 21:40:33 +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 152FB8FC12; Fri, 18 Jun 2010 21:40: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 o5ILeX0D079615; Fri, 18 Jun 2010 21:40:33 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ILeX9a079611; Fri, 18 Jun 2010 21:40:33 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201006182140.o5ILeX9a079611@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 18 Jun 2010 21:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209318 - in head/sys/mips/rmi: . dev/xlr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 21:40:33 -0000 Author: jchandra Date: Fri Jun 18 21:40:32 2010 New Revision: 209318 URL: http://svn.freebsd.org/changeset/base/209318 Log: Add support for newer XLS chips/boards in the GMAC driver. Improved processor id code in board.h, remove unnecessary macros. Approved by: rrs(mentor) Modified: head/sys/mips/rmi/board.c head/sys/mips/rmi/board.h head/sys/mips/rmi/dev/xlr/rge.c Modified: head/sys/mips/rmi/board.c ============================================================================== --- head/sys/mips/rmi/board.c Fri Jun 18 21:37:27 2010 (r209317) +++ head/sys/mips/rmi/board.c Fri Jun 18 21:40:32 2010 (r209318) @@ -100,6 +100,7 @@ xlr_board_info_setup() xlr_board_info.is_xls = 1; xlr_board_info.nr_cpus = 8; xlr_board_info.usb = 1; + /* Board version 8 has NAND flash */ xlr_board_info.cfi = (xlr_boot1_info.board_major_version != RMI_XLR_BOARD_ARIZONA_VIII); xlr_board_info.pci_irq = 0; @@ -114,7 +115,9 @@ xlr_board_info_setup() xlr_board_info.gmac_block[0].credit_config = &xls_cc_table_gmac0; xlr_board_info.gmac_block[0].station_txbase = MSGRNG_STNID_GMACTX0; xlr_board_info.gmac_block[0].station_rfr = MSGRNG_STNID_GMACRFR_0; - if (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_VI) + if (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_VI || + xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_XI || + xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_XII) xlr_board_info.gmac_block[0].mode = XLR_PORT0_RGMII; else xlr_board_info.gmac_block[0].mode = XLR_SGMII; @@ -125,12 +128,12 @@ xlr_board_info_setup() /* network block 1 */ xlr_board_info.gmac_block[1].type = XLR_GMAC; xlr_board_info.gmac_block[1].enabled = 0xf; - if (xlr_is_xls4xx()) { + if (xlr_is_xls4xx_lite()) { xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_GPIO_OFFSET); uint32_t tmp; - /* some ports are not enabled on 4xx, figure this out - from the GPIO fuse bank */ + /* some ports are not enabled on the condor 4xx, figure this + out from the GPIO fuse bank */ tmp = xlr_read_reg(mmio, 35); if (tmp & (1<<28)) xlr_board_info.gmac_block[1].enabled &= ~0x8; Modified: head/sys/mips/rmi/board.h ============================================================================== --- head/sys/mips/rmi/board.h Fri Jun 18 21:37:27 2010 (r209317) +++ head/sys/mips/rmi/board.h Fri Jun 18 21:40:32 2010 (r209318) @@ -26,10 +26,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * RMI_BSD */ + * RMI_BSD + * $FreeBSD$ + */ #ifndef _RMI_BOARD_H_ #define _RMI_BOARD_H_ +/* + * Engineering boards have a major/minor number in their EEPROM to + * identify their configuration + */ #define RMI_XLR_BOARD_ARIZONA_I 1 #define RMI_XLR_BOARD_ARIZONA_II 2 #define RMI_XLR_BOARD_ARIZONA_III 3 @@ -38,95 +44,34 @@ #define RMI_XLR_BOARD_ARIZONA_VI 6 #define RMI_XLR_BOARD_ARIZONA_VII 7 #define RMI_XLR_BOARD_ARIZONA_VIII 8 +#define RMI_XLR_BOARD_ARIZONA_XI 11 +#define RMI_XLR_BOARD_ARIZONA_XII 12 -#define RMI_CHIP_XLR308_A0 0x0c0600 -#define RMI_CHIP_XLR508_A0 0x0c0700 -#define RMI_CHIP_XLR516_A0 0x0c0800 -#define RMI_CHIP_XLR532_A0 0x0c0900 -#define RMI_CHIP_XLR716_A0 0x0c0a00 -#define RMI_CHIP_XLR732_A0 0x0c0b00 - -#define RMI_CHIP_XLR308_A1 0x0c0601 -#define RMI_CHIP_XLR508_A1 0x0c0701 -#define RMI_CHIP_XLR516_A1 0x0c0801 -#define RMI_CHIP_XLR532_A1 0x0c0901 -#define RMI_CHIP_XLR716_A1 0x0c0a01 -#define RMI_CHIP_XLR732_A1 0x0c0b01 - -#define RMI_CHIP_XLR308_B0 0x0c0602 -#define RMI_CHIP_XLR508_B0 0x0c0702 -#define RMI_CHIP_XLR516_B0 0x0c0802 -#define RMI_CHIP_XLR532_B0 0x0c0902 -#define RMI_CHIP_XLR716_B0 0x0c0a02 -#define RMI_CHIP_XLR732_B0 0x0c0b02 - -#define RMI_CHIP_XLR308_B1 0x0c0603 -#define RMI_CHIP_XLR508_B1 0x0c0703 -#define RMI_CHIP_XLR516_B1 0x0c0803 -#define RMI_CHIP_XLR532_B1 0x0c0903 -#define RMI_CHIP_XLR716_B1 0x0c0a03 -#define RMI_CHIP_XLR732_B1 0x0c0b03 - -#define RMI_CHIP_XLR308_B2 0x0c0604 -#define RMI_CHIP_XLR508_B2 0x0c0704 -#define RMI_CHIP_XLR516_B2 0x0c0804 -#define RMI_CHIP_XLR532_B2 0x0c0904 -#define RMI_CHIP_XLR716_B2 0x0c0a04 -#define RMI_CHIP_XLR732_B2 0x0c0b04 - -#define RMI_CHIP_XLR308_C0 0x0c0705 -#define RMI_CHIP_XLR508_C0 0x0c0b05 -#define RMI_CHIP_XLR516_C0 0x0c0a05 -#define RMI_CHIP_XLR532_C0 0x0c0805 -#define RMI_CHIP_XLR716_C0 0x0c0205 -#define RMI_CHIP_XLR732_C0 0x0c0005 - -#define RMI_CHIP_XLR308_C1 0x0c0706 -#define RMI_CHIP_XLR508_C1 0x0c0b06 -#define RMI_CHIP_XLR516_C1 0x0c0a06 -#define RMI_CHIP_XLR532_C1 0x0c0806 -#define RMI_CHIP_XLR716_C1 0x0c0206 -#define RMI_CHIP_XLR732_C1 0x0c0006 - -#define RMI_CHIP_XLR308_C2 0x0c0707 -#define RMI_CHIP_XLR508_C2 0x0c0b07 -#define RMI_CHIP_XLR516_C2 0x0c0a07 -#define RMI_CHIP_XLR532_C2 0x0c0807 -#define RMI_CHIP_XLR716_C2 0x0c0207 -#define RMI_CHIP_XLR732_C2 0x0c0007 - -#define RMI_CHIP_XLR308_C3 0x0c0708 -#define RMI_CHIP_XLR508_C3 0x0c0b08 -#define RMI_CHIP_XLR516_C3 0x0c0a08 -#define RMI_CHIP_XLR532_C3 0x0c0808 -#define RMI_CHIP_XLR716_C3 0x0c0208 -#define RMI_CHIP_XLR732_C3 0x0c0008 - -#define RMI_CHIP_XLR308_C4 0x0c0709 -#define RMI_CHIP_XLR508_C4 0x0c0b09 -#define RMI_CHIP_XLR516_C4 0x0c0a09 -#define RMI_CHIP_XLR532_C4 0x0c0809 -#define RMI_CHIP_XLR716_C4 0x0c0209 -#define RMI_CHIP_XLR732_C4 0x0c0009 - -#define RMI_CHIP_XLS608_A0 0x0c8000 -#define RMI_CHIP_XLS408_A0 0x0c8800 -#define RMI_CHIP_XLS404_A0 0x0c8c00 -#define RMI_CHIP_XLS208_A0 0x0c8e00 -#define RMI_CHIP_XLS204_A0 0x0c8f00 - -#define RMI_CHIP_XLS608_A1 0x0c8001 -#define RMI_CHIP_XLS408_A1 0x0c8801 -#define RMI_CHIP_XLS404_A1 0x0c8c01 -#define RMI_CHIP_XLS208_A1 0x0c8e01 -#define RMI_CHIP_XLS204_A1 0x0c8f01 - -static __inline__ unsigned int -xlr_revision(void) -{ - return mips_rd_prid() & 0xff00ff; -} - +/* + * RMI Chips - Values in Processor ID field + */ +#define RMI_CHIP_XLR732 0x00 +#define RMI_CHIP_XLR716 0x02 +#define RMI_CHIP_XLR308 0x06 +#define RMI_CHIP_XLR532 0x09 + +#define RMI_CHIP_XLS616_B0 0x40 +#define RMI_CHIP_XLS608_B0 0x4a +#define RMI_CHIP_XLS608 0x80 /* Internal */ +#define RMI_CHIP_XLS416_B0 0x44 +#define RMI_CHIP_XLS412_B0 0x4c +#define RMI_CHIP_XLS408_B0 0x4e +#define RMI_CHIP_XLS408 0x88 /* Lite "Condor" */ +#define RMI_CHIP_XLS404_B0 0x4f +#define RMI_CHIP_XLS404 0x8c /* Lite "Condor" */ +#define RMI_CHIP_XLS208 0x8e +#define RMI_CHIP_XLS204 0x8f +#define RMI_CHIP_XLS108 0xce +#define RMI_CHIP_XLS104 0xcf + +/* + * The XLS product line has chip versions 0x4x and 0x8x + */ static __inline__ unsigned int xlr_is_xls(void) { @@ -135,122 +80,60 @@ xlr_is_xls(void) return (prid & 0xf000) == 0x8000 || (prid & 0xf000) == 0x4000; } -static __inline__ int -xlr_revision_a0(void) -{ - return xlr_revision() == 0x0c0000; -} - -static __inline__ int -xlr_revision_b0(void) -{ - return xlr_revision() == 0x0c0002; -} - -static __inline__ int -xlr_revision_b1(void) -{ - return xlr_revision() == 0x0c0003; -} - -static __inline__ int -xlr_board_atx_i(void) -{ - return xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_I; -} - -static __inline__ int -xlr_board_atx_ii(void) -{ - return xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_II; -} - -static __inline__ int -xlr_board_atx_ii_b(void) -{ - return (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_II) - && (xlr_boot1_info.board_minor_version == 1); -} - -static __inline__ int -xlr_board_atx_iii(void) -{ - return xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_III; -} - -static __inline__ int -xlr_board_atx_iv(void) -{ - return (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_IV) - && (xlr_boot1_info.board_minor_version == 0); -} -static __inline__ int -xlr_board_atx_iv_b(void) -{ - return (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_IV) - && (xlr_boot1_info.board_minor_version == 1); -} -static __inline__ int -xlr_board_atx_v(void) -{ - return xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_V; -} -static __inline__ int -xlr_board_atx_vi(void) -{ - return xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_VI; -} - -static __inline__ int -xlr_board_atx_iii_256(void) -{ - return (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_III) - && (xlr_boot1_info.board_minor_version == 0); -} - -static __inline__ int -xlr_board_atx_iii_512(void) +/* + * The last byte of the processor id field is revision + */ +static __inline__ unsigned int +xlr_revision(void) { - return (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_III) - && (xlr_boot1_info.board_minor_version == 1); + return mips_rd_prid() & 0xff; } -static __inline__ int -xlr_board_atx_v_512(void) +/* + * The 15:8 byte of the PR Id register is the Processor ID + */ +static __inline__ unsigned int +xlr_processor_id(void) { - return (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_V) - && (xlr_boot1_info.board_minor_version == 1); + return ((mips_rd_prid() & 0xff00) >> 8); } +/* + * RMI Engineering boards which are PCI cards + * These should come up in PCI device mode (not yet) + */ static __inline__ int xlr_board_pci(void) { - return (xlr_board_atx_iii_256() || xlr_board_atx_iii_512() - || xlr_board_atx_v_512()); + return ((xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_III) || + (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_V)); } + static __inline__ int xlr_is_xls2xx(void) { - uint32_t chipid = mips_rd_prid() & 0xffffff00U; + uint32_t chipid = xlr_processor_id(); - return chipid == 0x0c8e00 || chipid == 0x0c8f00; + return (chipid == 0x8e || chipid == 0x8f); } static __inline__ int -xlr_is_xls4xx(void) +xlr_is_xls4xx_lite(void) { - uint32_t chipid = mips_rd_prid() & 0xffffff00U; + uint32_t chipid = xlr_processor_id(); - return chipid == 0x0c8800 || chipid == 0x0c8c00; + return (chipid == 0x88 || chipid == 0x8c); } /* all our knowledge of chip and board that cannot be detected run-time goes here */ enum gmac_block_types { XLR_GMAC, XLR_XGMAC, XLR_SPI4 }; + enum gmac_block_modes { XLR_RGMII, XLR_SGMII, XLR_PORT0_RGMII }; + struct xlr_board_info { int is_xls; int nr_cpus; @@ -273,7 +156,7 @@ struct xlr_board_info { int baseirq; /* first irq for this block, the rest are in * sequence */ int baseinst; /* the first rge unit for this block */ - } gmac_block[3]; + } gmac_block[3]; }; extern struct xlr_board_info xlr_board_info; Modified: head/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.c Fri Jun 18 21:37:27 2010 (r209317) +++ head/sys/mips/rmi/dev/xlr/rge.c Fri Jun 18 21:40:32 2010 (r209318) @@ -899,7 +899,6 @@ static void serdes_regs_init(struct driver_data *priv) { xlr_reg_t *mmio_gpio = (xlr_reg_t *) (xlr_io_base + XLR_IO_GPIO_OFFSET); - int i; /* Initialize SERDES CONTROL Registers */ rge_mii_write_internal(priv->serdes_mmio, 26, 0, 0x6DB0); @@ -915,14 +914,27 @@ serdes_regs_init(struct driver_data *pri rge_mii_write_internal(priv->serdes_mmio, 26, 10, 0x0000); /* - * For loop delay and GPIO programming crud from Linux driver, + * GPIO setting which affect the serdes - needs figuring out */ - for (i = 0; i < 10000000; i++) { - } - mmio_gpio[0x20] = 0x7e6802; - mmio_gpio[0x10] = 0x7104; - for (i = 0; i < 100000000; i++) { + DELAY(100); + xlr_write_reg(mmio_gpio, 0x20, 0x7e6802); + xlr_write_reg(mmio_gpio, 0x10, 0x7104); + DELAY(100); + + /* + * This kludge is needed to setup serdes (?) clock correctly on some + * XLS boards + */ + if ((xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_XI || + xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_XII) && + xlr_boot1_info.board_minor_version == 4) { + /* use 125 Mhz instead of 156.25Mhz ref clock */ + DELAY(100); + xlr_write_reg(mmio_gpio, 0x10, 0x7103); + xlr_write_reg(mmio_gpio, 0x21, 0x7103); + DELAY(100); } + return; } @@ -1085,7 +1097,7 @@ rmi_xlr_gmac_config_speed(struct driver_ if (priv->speed == xlr_mac_speed_10) { if (priv->mode != XLR_RGMII) xlr_write_reg(mmio, R_INTERFACE_CONTROL, SGMII_SPEED_10); - xlr_write_reg(mmio, R_MAC_CONFIG_2, 0x7137); + xlr_write_reg(mmio, R_MAC_CONFIG_2, 0x7117); xlr_write_reg(mmio, R_CORECONTROL, 0x02); printf("%s: [10Mbps]\n", device_get_nameunit(sc->rge_dev)); sc->rge_mii.mii_media.ifm_media = IFM_ETHER | IFM_AUTO | IFM_10_T | IFM_FDX; @@ -1094,7 +1106,7 @@ rmi_xlr_gmac_config_speed(struct driver_ } else if (priv->speed == xlr_mac_speed_100) { if (priv->mode != XLR_RGMII) xlr_write_reg(mmio, R_INTERFACE_CONTROL, SGMII_SPEED_100); - xlr_write_reg(mmio, R_MAC_CONFIG_2, 0x7137); + xlr_write_reg(mmio, R_MAC_CONFIG_2, 0x7117); xlr_write_reg(mmio, R_CORECONTROL, 0x01); printf("%s: [100Mbps]\n", device_get_nameunit(sc->rge_dev)); sc->rge_mii.mii_media.ifm_media = IFM_ETHER | IFM_AUTO | IFM_100_TX | IFM_FDX; @@ -1105,7 +1117,7 @@ rmi_xlr_gmac_config_speed(struct driver_ if (priv->mode != XLR_RGMII) xlr_write_reg(mmio, R_INTERFACE_CONTROL, SGMII_SPEED_100); printf("PHY reported unknown MAC speed, defaulting to 100Mbps\n"); - xlr_write_reg(mmio, R_MAC_CONFIG_2, 0x7137); + xlr_write_reg(mmio, R_MAC_CONFIG_2, 0x7117); xlr_write_reg(mmio, R_CORECONTROL, 0x01); sc->rge_mii.mii_media.ifm_media = IFM_ETHER | IFM_AUTO | IFM_100_TX | IFM_FDX; sc->rge_mii.mii_media.ifm_cur->ifm_media = IFM_ETHER | IFM_AUTO | IFM_100_TX | IFM_FDX; @@ -1113,7 +1125,7 @@ rmi_xlr_gmac_config_speed(struct driver_ } else { if (priv->mode != XLR_RGMII) xlr_write_reg(mmio, R_INTERFACE_CONTROL, SGMII_SPEED_1000); - xlr_write_reg(mmio, R_MAC_CONFIG_2, 0x7237); + xlr_write_reg(mmio, R_MAC_CONFIG_2, 0x7217); xlr_write_reg(mmio, R_CORECONTROL, 0x00); printf("%s: [1000Mbps]\n", device_get_nameunit(sc->rge_dev)); sc->rge_mii.mii_media.ifm_media = IFM_ETHER | IFM_AUTO | IFM_1000_T | IFM_FDX; @@ -1788,7 +1800,9 @@ rge_attach(device_t dev) priv->instance = priv->id - xlr_board_info.gmacports; priv->mmio = (xlr_reg_t *) (xlr_io_base + gmac_conf->baseaddr); } - if (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_VI) { + if (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_VI || + (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_XI && + priv->instance >=4)) { dbg_msg("Arizona board - offset 4 \n"); priv->mii_mmio = (xlr_reg_t *) (xlr_io_base + XLR_IO_GMAC_4_OFFSET); } else @@ -1812,7 +1826,9 @@ rge_attach(device_t dev) priv->mode = gmac_conf->mode; if (xlr_board_info.is_xls == 0) { - if (xlr_board_atx_ii() && !xlr_board_atx_ii_b()) + /* TODO - check II and IIB boards */ + if (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_II && + xlr_boot1_info.board_minor_version != 1) priv->phy_addr = priv->instance - 2; else priv->phy_addr = priv->instance; @@ -1824,7 +1840,12 @@ rge_attach(device_t dev) priv->phy_addr = 0; } else { priv->mode = XLR_SGMII; - priv->phy_addr = priv->instance + 16; + /* Board 11 has SGMII daughter cards with the XLS chips, in this case + the phy number is 0-3 for both GMAC blocks */ + if (xlr_boot1_info.board_major_version == RMI_XLR_BOARD_ARIZONA_XI) + priv->phy_addr = priv->instance % 4 + 16; + else + priv->phy_addr = priv->instance + 16; } } @@ -2088,8 +2109,8 @@ rge_intr(void *arg) /* clear all interrupts and hope to make progress */ xlr_write_reg(mmio, R_INTREG, 0xffffffff); - /* on A0 and B0, xgmac interrupts are routed only to xgs_1 irq */ - if ((xlr_revision_b0()) && (priv->type == XLR_XGMAC)) { + /* (not yet) on A0 and B0, xgmac interrupts are routed only to xgs_1 irq */ + if ((xlr_revision() < 2) && (priv->type == XLR_XGMAC)) { struct rge_softc *xgs0_dev = dev_mac[dev_mac_xgs0]; struct driver_data *xgs0_priv = &xgs0_dev->priv; xlr_reg_t *xgs0_mmio = xgs0_priv->mmio; From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 22:12: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 0DD62106564A; Fri, 18 Jun 2010 22:12:13 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F145A8FC16; Fri, 18 Jun 2010 22:12: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 o5IMCCCU086657; Fri, 18 Jun 2010 22:12:12 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IMCCbP086654; Fri, 18 Jun 2010 22:12:12 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006182212.o5IMCCbP086654@svn.freebsd.org> From: Alan Cox Date: Fri, 18 Jun 2010 22:12: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: r209320 - in head/sys/fs: nwfs smbfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 22:12:13 -0000 Author: alc Date: Fri Jun 18 22:12:12 2010 New Revision: 209320 URL: http://svn.freebsd.org/changeset/base/209320 Log: Eliminate unnecessary page queues locking. Modified: head/sys/fs/nwfs/nwfs_io.c head/sys/fs/smbfs/smbfs_io.c Modified: head/sys/fs/nwfs/nwfs_io.c ============================================================================== --- head/sys/fs/nwfs/nwfs_io.c Fri Jun 18 22:06:49 2010 (r209319) +++ head/sys/fs/nwfs/nwfs_io.c Fri Jun 18 22:12:12 2010 (r209320) @@ -571,12 +571,10 @@ nwfs_putpages(ap) if (!error) { int nwritten = round_page(count - uio.uio_resid) / PAGE_SIZE; - vm_page_lock_queues(); for (i = 0; i < nwritten; i++) { rtvals[i] = VM_PAGER_OK; vm_page_undirty(pages[i]); } - vm_page_unlock_queues(); } return rtvals[0]; #endif /* NWFS_RWCACHE */ Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Fri Jun 18 22:06:49 2010 (r209319) +++ head/sys/fs/smbfs/smbfs_io.c Fri Jun 18 22:12:12 2010 (r209320) @@ -641,12 +641,10 @@ smbfs_putpages(ap) if (!error) { int nwritten = round_page(count - uio.uio_resid) / PAGE_SIZE; - vm_page_lock_queues(); for (i = 0; i < nwritten; i++) { rtvals[i] = VM_PAGER_OK; vm_page_undirty(pages[i]); } - vm_page_unlock_queues(); } return rtvals[0]; #endif /* SMBFS_RWGENERIC */ From owner-svn-src-head@FreeBSD.ORG Fri Jun 18 23:14: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 DF7BA106566C; Fri, 18 Jun 2010 23:14:16 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B58EB8FC16; Fri, 18 Jun 2010 23:14:16 +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 o5INEGcS000496; Fri, 18 Jun 2010 23:14:16 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5INEGuJ000494; Fri, 18 Jun 2010 23:14:16 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006182314.o5INEGuJ000494@svn.freebsd.org> From: Alan Cox Date: Fri, 18 Jun 2010 23:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209321 - head/sys/dev/cxgb/ulp/tom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 23:14:17 -0000 Author: alc Date: Fri Jun 18 23:14:16 2010 New Revision: 209321 URL: http://svn.freebsd.org/changeset/base/209321 Log: Catch up with the page and page queues locking changes. Modified: head/sys/dev/cxgb/ulp/tom/cxgb_vm.c Modified: head/sys/dev/cxgb/ulp/tom/cxgb_vm.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_vm.c Fri Jun 18 22:12:12 2010 (r209320) +++ head/sys/dev/cxgb/ulp/tom/cxgb_vm.c Fri Jun 18 23:14:16 2010 (r209321) @@ -90,11 +90,9 @@ vm_fault_hold_user_pages(vm_map_t map, v * (and R/W if for write) if so just mark pages as held (and * dirty if for write) and return */ - vm_page_lock_queues(); for (pages = mp, faults = 0, va = addr; va < end; va += PAGE_SIZE, pages++) { /* - * page queue mutex is recursable so this is OK * it would be really nice if we had an unlocked * version of this so we were only acquiring the * pmap lock 1 time as opposed to potentially @@ -110,11 +108,13 @@ vm_fault_hold_user_pages(vm_map_t map, v * will never have the modified bit set if * they are only changed via DMA */ - if (prot & VM_PROT_WRITE) + if (prot & VM_PROT_WRITE) { + vm_page_lock_queues(); vm_page_dirty(m); + vm_page_unlock_queues(); + } } - vm_page_unlock_queues(); if (faults == 0) return (0); @@ -141,13 +141,13 @@ vm_fault_hold_user_pages(vm_map_t map, v error: log(LOG_WARNING, "vm_fault bad return rv=%d va=0x%zx\n", rv, va); - vm_page_lock_queues(); for (pages = mp, va = addr; va < end; va += PAGE_SIZE, pages++) if (*pages) { + vm_page_lock(*pages); vm_page_unhold(*pages); + vm_page_unlock(*pages); *pages = NULL; } - vm_page_unlock_queues(); return (EFAULT); } @@ -156,10 +156,10 @@ vm_fault_unhold_pages(vm_page_t *mp, int { KASSERT(count >= 0, ("negative count %d", count)); - vm_page_lock_queues(); while (count--) { + vm_page_lock(*mp); vm_page_unhold(*mp); + vm_page_unlock(*mp); mp++; } - vm_page_unlock_queues(); } From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 02:30: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 B78F4106564A; Sat, 19 Jun 2010 02:30:10 +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 A69408FC18; Sat, 19 Jun 2010 02:30:10 +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 o5J2UAWQ043991; Sat, 19 Jun 2010 02:30:10 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5J2UA8M043989; Sat, 19 Jun 2010 02:30:10 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201006190230.o5J2UA8M043989@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 19 Jun 2010 02:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209325 - 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: Sat, 19 Jun 2010 02:30:10 -0000 Author: lstewart Date: Sat Jun 19 02:30:10 2010 New Revision: 209325 URL: http://svn.freebsd.org/changeset/base/209325 Log: - Rename the internal for loop iterator to "_i" to avoid potential shadowing of external variables named "i". The "_" prefix is reserved for infrastructure type code and is therefore not expected to be used by normal code likely to call DPCPU_SUM(). [1] - Change DPCPU_SUM to return the sum rather than calculate and assign it internally. Usage is now: "sum = DPCPU_SUM(dpcpu_var, member_to_sum);" [2] - Fix some style nits. [3] Sponsored by: FreeBSD Foundation Suggested by: bde [3], mdf [1], kib [1,2], pjd [1,3] Reviewed by: kib MFC after: 1 week (instead of r209119) Modified: head/sys/sys/pcpu.h Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Sat Jun 19 00:41:29 2010 (r209324) +++ head/sys/sys/pcpu.h Sat Jun 19 02:30:10 2010 (r209325) @@ -109,13 +109,17 @@ extern uintptr_t dpcpu_off[]; /* * Utility macros. */ -#define DPCPU_SUM(n, var, sum) \ -do { \ - (sum) = 0; \ - u_int i; \ - CPU_FOREACH(i) \ - (sum) += (DPCPU_ID_PTR(i, n))->var; \ -} while (0) +#define DPCPU_SUM(n, var) __extension__ \ +({ \ + u_int _i; \ + __typeof((DPCPU_PTR(n))->var) sum; \ + \ + sum = 0; \ + CPU_FOREACH(_i) { \ + sum += (DPCPU_ID_PTR(_i, n))->var; \ + } \ + sum; \ +}) /* * XXXUPS remove as soon as we have per cpu variable From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 02:54: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 6AF46106566C; Sat, 19 Jun 2010 02:54:29 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 24DA38FC1E; Sat, 19 Jun 2010 02:54:28 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 07F177E84A; Sat, 19 Jun 2010 12:54:27 +1000 (EST) Message-ID: <4C1C3162.60300@freebsd.org> Date: Sat, 19 Jun 2010 12:54:26 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Rui Paulo References: <201006141537.o5EFbnTD093866@svn.freebsd.org> In-Reply-To: <201006141537.o5EFbnTD093866@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209158 - in head/contrib/wpa: hostapd hostapd/doc src/common src/crypto src/drivers src/eap_common src/eap_peer src/eap_server src/eapol_supp src/hlr_auc_gw src/l2_packet src/radius sr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 02:54:29 -0000 Hi Rui, On 06/15/10 01:37, Rui Paulo wrote: > Author: rpaulo > Date: Mon Jun 14 15:37:48 2010 > New Revision: 209158 > URL: http://svn.freebsd.org/changeset/base/209158 > > Log: > MFV hostapd& wpa_supplicant 0.6.10. > > Added: [snip] > head/contrib/wpa/hostapd/radiotap.h > - copied unchanged from r209140, vendor/wpa/dist/hostapd/radiotap.h [snip] > head/contrib/wpa/src/drivers/radiotap.h > - copied unchanged from r209140, vendor/wpa/dist/src/drivers/radiotap.h There seems to be a minor issue with at least the above two files. Something went wrong with the keyword expansion and these two files have been committed with $FreeBSD$ expanded. Perhaps you didn't use the subversion-freebsd client to do some of the work? I believe the following diff should fix the issue I'm seeing. http://people.freebsd.org/~lstewart/patches/misc/wpa_keyword.diff Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 03:29: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 0B5BA1065670; Sat, 19 Jun 2010 03:29:53 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id B3BCC8FC15; Sat, 19 Jun 2010 03:29:52 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id DA09E7E84A; Sat, 19 Jun 2010 13:29:51 +1000 (EST) Message-ID: <4C1C39AF.5010906@freebsd.org> Date: Sat, 19 Jun 2010 13:29:51 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Robert Watson References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C158B71.205@freebsd.org> <20100614085205.GD13238@deviant.kiev.zoral.com.ua> <4C1605A7.2000202@freebsd.org> <20100614104349.GF13238@deviant.kiev.zoral.com.ua> <4C198A90.3060905@freebsd.org> <20100617071300.GX13238@deviant.kiev.zoral.com.ua> <4C1AD292.5070508@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Matthew Fleming , src-committers@FreeBSD.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, brde@optusnet.com.au, Kostik Belousov Subject: Re: svn commit: r209119 - 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: Sat, 19 Jun 2010 03:29:53 -0000 On 06/18/10 22:08, Robert Watson wrote: > > On Fri, 18 Jun 2010, Lawrence Stewart wrote: > >> True but I figured on large SMP systems where the potential to process >> more is likely, 32bit counters per cpu may be enough to avoid overflow >> but the aggregate number of events may exceed a 32bit variable. I >> suspect you're right though and that if there's a likely chance the >> aggregate could overflow, then the DPCPU var should simply be made >> 64bit to also remove any possibility of individual PCPU counters >> overflowing. >> >> I'll commit the above version of the macro this evening (GMT+10) >> unless I hear any objections. Thanks to all of you for your input. I've just committed the updated macro to at least get the new calling syntax settled in. > The only reservation I have, really, is that 64-bit writes are > non-atomic on i386 and other 32-bit architectures (or, at least, I think > they are). This means DPCPU_SUM may encounter non-atomicity rather than > just staleness in the values it reads as it iterates. That said, we > should probably use 64-bit anyway, because 32-bit counters are gauche. :-) hrm that's messy and somewhat useless. Are there some tricks we can add to force a flush of any outstanding writes to the DPCPU var on the cpu we're reading from to ensure the counter is at least stable at the time we read? This stuff is way beyond my realm of knowledge so I defer to the greater wisdom of the masses on this. Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 05:15:06 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: by hub.freebsd.org (Postfix, from userid 1033) id 736471065673; Sat, 19 Jun 2010 05:15:06 +0000 (UTC) Date: Sat, 19 Jun 2010 05:15:06 +0000 From: Alexey Dokuchaev To: Doug Barton Message-ID: <20100619051506.GA15449@FreeBSD.org> References: <201006152158.o5FLwerZ005440@svn.freebsd.org> <86ljafwypm.fsf@ds4.des.no> <20100617023441.008cd737@dev.lan.Awfulhak.org> <20100617100315.GA37522@nagual.pp.ru> <4C1A7953.4080201@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <4C1A7953.4080201@FreeBSD.org> User-Agent: Mutt/1.4.2.1i Cc: src-committers@FreeBSD.ORG, Andrey Chernov , svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, Brian Somers , Jilles Tjoelker , Dag-Erling Sm??rgrav Subject: Re: svn commit: r209221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 05:15:06 -0000 On Thu, Jun 17, 2010 at 12:36:51PM -0700, Doug Barton wrote: > I've been very supportive of Jilles work up to this point, and I think > he's done a great job of making our sh functional and compliant as a > scripting shell. However in my mind adding completion (and his suggested > inclusion of the kill builtin) tips the balance from "good system shell" > to more of an interactive shell, and that makes me wonder if this is the > right direction to go in. I tend to agree. I see no good point in trying to teach sh(1) to be something other than good, coherent, standards compliant system shell. For interactive use, tcsh(1) is much better anyways (but do not ever use it for scripting). Provided there are many good alternatives to those of us who does not like tcsh(1) for some reason, hacking upon bells and whistles for sh(1) seems controversial at best. ./danfe From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 06:36:47 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 33565106564A for ; Sat, 19 Jun 2010 06:36:47 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id B169E8FC1B for ; Sat, 19 Jun 2010 06:36:46 +0000 (UTC) Received: (qmail 22977 invoked by uid 399); 19 Jun 2010 06:36:45 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 19 Jun 2010 06:36:45 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C1C657C.8030606@FreeBSD.org> Date: Fri, 18 Jun 2010 23:36:44 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.9) Gecko/20100330 Thunderbird/3.0.4 MIME-Version: 1.0 To: Jilles Tjoelker References: <201006152158.o5FLwerZ005440@svn.freebsd.org> <86ljafwypm.fsf@ds4.des.no> <20100617023441.008cd737@dev.lan.Awfulhak.org> <20100617100315.GA37522@nagual.pp.ru> <4C1A7953.4080201@FreeBSD.org> <20100617215513.GA49512@stack.nl> In-Reply-To: <20100617215513.GA49512@stack.nl> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.ORG, Andrey Chernov , svn-src-all@FreeBSD.ORG, Brian Somers , svn-src-head@FreeBSD.ORG, Dag-Erling Sm??rgrav Subject: Re: svn commit: r209221 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 06:36:47 -0000 On 06/17/10 14:55, Jilles Tjoelker wrote: > On Thu, Jun 17, 2010 at 12:36:51PM -0700, Doug Barton wrote: >> On 06/17/10 03:03, Andrey Chernov wrote: >>>>> Jilles Tjoelker writes: >>>>>> Log: >>>>>> sh: Add filename completion. > >> FWIW, what I actually do is set the shell for both root and my >> unprivileged user to sh, compile bash static, and put a copy of the >> static shell in /root. Then my .profile tests for the existence of >> bash and execs it if available. > > Hmm, I see no problems with setting the shell of my unprivileged user to > something dynamically linked in /usr/local/bin. I use the same profile/bashrc/etc. for my local users, root, remote users, etc. Starting with sh and only exec'ing bash if it's viable has solved the occasional problem of something going screwy that prevents bash from running (and thereby preventing me from logging in remotely). It also helps when I'm in single user mode. > Yes, many other shells complete command names at appropriate places in > the line. However, at this time, it doesn't really fit in my idea of > what sh(1) should be. If I'm understanding the other comments and various other feedback correctly, at this point I think it would be worthwhile for you to post your plans to -arch and let people comment before proceeding with more changes. > Listing all possible command names is a fair bit > of functionality not present yet (sh only caches command pathnames that > have been used, it does not readdir all of $PATH like tcsh does). This is a perfect example of why I'm concerned about adding incompletely implemented features of an interactive shell to our sh. I'd prefer that there be a separation, but if you do post your plans to -arch I'd like to hear what others have to say as well. >> I've been very supportive of Jilles work up to this point, and I think >> he's done a great job of making our sh functional and compliant as a >> scripting shell. However in my mind adding completion (and his suggested >> inclusion of the kill builtin) tips the balance from "good system shell" >> to more of an interactive shell, and that makes me wonder if this is the >> right direction to go in. If we want a good interactive bourne-based >> shell in the base I'd rather have the discussion about which one to >> import, rather than trying to have our sh catch up with the last 15 >> years of development in this area. -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 08:36: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 31BD2106566B; Sat, 19 Jun 2010 08:36:13 +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 213C28FC0C; Sat, 19 Jun 2010 08:36: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 o5J8aDPs025205; Sat, 19 Jun 2010 08:36:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5J8aDbR025203; Sat, 19 Jun 2010 08:36:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006190836.o5J8aDbR025203@svn.freebsd.org> From: Alexander Motin Date: Sat, 19 Jun 2010 08:36: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: r209328 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 08:36:13 -0000 Author: mav Date: Sat Jun 19 08:36:12 2010 New Revision: 209328 URL: http://svn.freebsd.org/changeset/base/209328 Log: While we indeed can't precisely measure time spent in C1, we can consider measured interval as upper bound. It should be more precise then just assuming hz/2. For idle CPU it should be quite precise, for busy - not worse then before. Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sat Jun 19 05:35:47 2010 (r209327) +++ head/sys/dev/acpica/acpi_cpu.c Sat Jun 19 08:36:12 2010 (r209328) @@ -928,12 +928,16 @@ acpi_cpu_idle() /* * Execute HLT (or equivalent) and wait for an interrupt. We can't - * calculate the time spent in C1 since the place we wake up is an - * ISR. Assume we slept half of quantum and return. + * precisely calculate the time spent in C1 since the place we wake up + * is an ISR. Assume we slept no more then half of quantum. */ if (cx_next->type == ACPI_STATE_C1) { - sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + 500000 / hz) / 4; + AcpiHwRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); acpi_cpu_c1(); + AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); + end_time = acpi_TimerDelta(end_time, start_time); + sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + + min(PM_USEC(end_time), 500000)) / 4; return; } From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 08:42: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 717D3106566C; Sat, 19 Jun 2010 08:42:29 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 611908FC17; Sat, 19 Jun 2010 08:42: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 o5J8gTrd026686; Sat, 19 Jun 2010 08:42:29 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5J8gTPn026684; Sat, 19 Jun 2010 08:42:29 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201006190842.o5J8gTPn026684@svn.freebsd.org> From: Brian Somers Date: Sat, 19 Jun 2010 08: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: r209329 - head/sys/dev/agp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 08:42:29 -0000 Author: brian Date: Sat Jun 19 08:42:29 2010 New Revision: 209329 URL: http://svn.freebsd.org/changeset/base/209329 Log: Add a missing linefeed PR: 147337 Submitted by: cyberleo at cyberleo dot net MFC after: 1 week Modified: head/sys/dev/agp/agp_nvidia.c Modified: head/sys/dev/agp/agp_nvidia.c ============================================================================== --- head/sys/dev/agp/agp_nvidia.c Sat Jun 19 08:36:12 2010 (r209328) +++ head/sys/dev/agp/agp_nvidia.c Sat Jun 19 08:42:29 2010 (r209329) @@ -282,7 +282,7 @@ agp_nvidia_get_aperture(device_t dev) case 14: return (64 * 1024 * 1024); break; case 15: return (32 * 1024 * 1024); break; default: - device_printf(dev, "Invalid aperture setting 0x%x", + device_printf(dev, "Invalid aperture setting 0x%x\n", pci_read_config(dev, AGP_NVIDIA_0_APSIZE, 1)); return 0; } From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 08:46: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 2C869106564A; Sat, 19 Jun 2010 08:46:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C2828FC1A; Sat, 19 Jun 2010 08:46: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 o5J8kIAQ027561; Sat, 19 Jun 2010 08:46:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5J8kHxU027558; Sat, 19 Jun 2010 08:46:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006190846.o5J8kHxU027558@svn.freebsd.org> From: Alexander Motin Date: Sat, 19 Jun 2010 08:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209330 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 08:46:18 -0000 Author: mav Date: Sat Jun 19 08:46:17 2010 New Revision: 209330 URL: http://svn.freebsd.org/changeset/base/209330 Log: Oops! Add " / hz" missed in r209328. Assume interrupt rate hz/2, not 1/2. Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sat Jun 19 08:42:29 2010 (r209329) +++ head/sys/dev/acpica/acpi_cpu.c Sat Jun 19 08:46:17 2010 (r209330) @@ -937,7 +937,7 @@ acpi_cpu_idle() AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); end_time = acpi_TimerDelta(end_time, start_time); sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + - min(PM_USEC(end_time), 500000)) / 4; + min(PM_USEC(end_time), 500000 / hz)) / 4; return; } From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 09:21: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 99991106566B; Sat, 19 Jun 2010 09:21:34 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F16D8FC25; Sat, 19 Jun 2010 09:21: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 o5J9LYBn035316; Sat, 19 Jun 2010 09:21:34 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5J9LYng035312; Sat, 19 Jun 2010 09:21:34 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201006190921.o5J9LYng035312@svn.freebsd.org> From: Brian Somers Date: Sat, 19 Jun 2010 09:21: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: r209331 - in head: etc tools/tools/tinybsd/conf/default tools/tools/tinybsd/conf/vpn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 09:21:34 -0000 Author: brian Date: Sat Jun 19 09:21:34 2010 New Revision: 209331 URL: http://svn.freebsd.org/changeset/base/209331 Log: Remove vestiges of 'slip'. PR: 145648 Submitted by: alexbestms at wwu dot de and spam at rm-rf dot kiev dot ua MFC after: 1 week Modified: head/etc/login.conf head/tools/tools/tinybsd/conf/default/TINYBSD head/tools/tools/tinybsd/conf/vpn/TINYBSD Modified: head/etc/login.conf ============================================================================== --- head/etc/login.conf Sat Jun 19 08:46:17 2010 (r209330) +++ head/etc/login.conf Sat Jun 19 09:21:34 2010 (r209331) @@ -228,7 +228,7 @@ russian|Russian Users Accounts:\ # # ## -## The dialer class should be used for a dialup PPP/SLIP accounts +## The dialer class should be used for a dialup PPP account ## Welcome messages/news suppressed ## #dialer:\ @@ -247,7 +247,7 @@ russian|Russian Users Accounts:\ # # ## -## Site full-time 24/7 PPP/SLIP connections +## Site full-time 24/7 PPP connection ## - no time accounting, restricted to access via dialin lines ## #site:\ @@ -306,11 +306,6 @@ russian|Russian Users Accounts:\ # :tc=subscriber: # # -#subslip|SLIP Subscriber Accounts:\ -# :tc=dialer:\ -# :tc=subscriber: -# -# #subshell|Shell Subscriber Accounts:\ # :tc=subscriber: # Modified: head/tools/tools/tinybsd/conf/default/TINYBSD ============================================================================== --- head/tools/tools/tinybsd/conf/default/TINYBSD Sat Jun 19 08:46:17 2010 (r209330) +++ head/tools/tools/tinybsd/conf/default/TINYBSD Sat Jun 19 09:21:34 2010 (r209331) @@ -143,7 +143,6 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop # Network loopback device random # Entropy device device ether # Ethernet support -#device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) Modified: head/tools/tools/tinybsd/conf/vpn/TINYBSD ============================================================================== --- head/tools/tools/tinybsd/conf/vpn/TINYBSD Sat Jun 19 08:46:17 2010 (r209330) +++ head/tools/tools/tinybsd/conf/vpn/TINYBSD Sat Jun 19 09:21:34 2010 (r209331) @@ -133,7 +133,6 @@ device xe # Xircom pccard Ethernet device loop # Network loopback device random # Entropy device device ether # Ethernet support -#device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 09:33: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 9B03B106566B; Sat, 19 Jun 2010 09:33:11 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53DAC8FC18; Sat, 19 Jun 2010 09:33: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 o5J9XBsc037945; Sat, 19 Jun 2010 09:33:11 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5J9XBOI037943; Sat, 19 Jun 2010 09:33:11 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201006190933.o5J9XBOI037943@svn.freebsd.org> From: Brian Somers Date: Sat, 19 Jun 2010 09:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209332 - head/release/scripts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 09:33:11 -0000 Author: brian Date: Sat Jun 19 09:33:11 2010 New Revision: 209332 URL: http://svn.freebsd.org/changeset/base/209332 Log: Remove an unnecessary cat. PR: 145447 Submitted by: u at netbeisser dot de MFC after: 1 week Modified: head/release/scripts/ports-install.sh Modified: head/release/scripts/ports-install.sh ============================================================================== --- head/release/scripts/ports-install.sh Sat Jun 19 09:21:34 2010 (r209331) +++ head/release/scripts/ports-install.sh Sat Jun 19 09:33:11 2010 (r209332) @@ -8,5 +8,5 @@ if [ "`id -u`" != "0" ]; then exit 1 fi echo "Extracting ports tarball into ${DESTDIR}/usr" -cat ports.tgz | tar --unlink -xpzf - -C ${DESTDIR}/usr +tar --unlink -xpzf ports.tgz -C ${DESTDIR}/usr exit 0 From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 09:56: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 AE51A106566C; Sat, 19 Jun 2010 09:56:29 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id 46D908FC16; Sat, 19 Jun 2010 09:56:29 +0000 (UTC) Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14]) by karen.lavabit.com (Postfix) with ESMTP id E77C111BA46; Sat, 19 Jun 2010 04:56:23 -0500 (CDT) Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by lavabit.com with ESMTP id OIVKZ286YRAC; Sat, 19 Jun 2010 04:56:23 -0500 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <4C1C3162.60300@freebsd.org> Date: Sat, 19 Jun 2010 10:56:20 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201006141537.o5EFbnTD093866@svn.freebsd.org> <4C1C3162.60300@freebsd.org> To: Lawrence Stewart 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: r209158 - in head/contrib/wpa: hostapd hostapd/doc src/common src/crypto src/drivers src/eap_common src/eap_peer src/eap_server src/eapol_supp src/hlr_auc_gw src/l2_packet src/radius sr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 09:56:29 -0000 On 19 Jun 2010, at 03:54, Lawrence Stewart wrote: > Hi Rui, >=20 > On 06/15/10 01:37, Rui Paulo wrote: >> Author: rpaulo >> Date: Mon Jun 14 15:37:48 2010 >> New Revision: 209158 >> URL: http://svn.freebsd.org/changeset/base/209158 >>=20 >> Log: >> MFV hostapd& wpa_supplicant 0.6.10. >>=20 >> Added: >=20 > [snip] >=20 >> head/contrib/wpa/hostapd/radiotap.h >> - copied unchanged from r209140, = vendor/wpa/dist/hostapd/radiotap.h >=20 > [snip] >=20 >> head/contrib/wpa/src/drivers/radiotap.h >> - copied unchanged from r209140, = vendor/wpa/dist/src/drivers/radiotap.h >=20 > There seems to be a minor issue with at least the above two files. = Something went wrong with the keyword expansion and these two files have = been committed with $FreeBSD$ expanded. Perhaps you didn't use the = subversion-freebsd client to do some of the work? I believe the = following diff should fix the issue I'm seeing. >=20 > http://people.freebsd.org/~lstewart/patches/misc/wpa_keyword.diff What is the problem, exactly? Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 10:33: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 89F25106564A; Sat, 19 Jun 2010 10:33:05 +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 79C1B8FC1A; Sat, 19 Jun 2010 10:33: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 o5JAX5Rh054645; Sat, 19 Jun 2010 10:33:05 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5JAX55M054643; Sat, 19 Jun 2010 10:33:05 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201006191033.o5JAX55M054643@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 19 Jun 2010 10:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209337 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 10:33:05 -0000 Author: jilles Date: Sat Jun 19 10:33:04 2010 New Revision: 209337 URL: http://svn.freebsd.org/changeset/base/209337 Log: sh: Fix compilation with -DNO_HISTORY. The LINENO code uses snprintf() and relied on "myhistedit.h" to pull in the necessary . Compiling with -DNO_HISTORY disables all editing and history support and allows linking without -ledit -ltermcap. This may be useful for embedded systems. MFC after: 2 weeks Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sat Jun 19 10:23:23 2010 (r209336) +++ head/bin/sh/parser.c Sat Jun 19 10:33:04 2010 (r209337) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "shell.h" #include "parser.h" From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 12:12:39 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 B1A44106564A; Sat, 19 Jun 2010 12:12:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 977618FC17; Sat, 19 Jun 2010 12:12:39 +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 o5JCCdqn076757; Sat, 19 Jun 2010 12:12:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5JCCdhx076756; Sat, 19 Jun 2010 12:12:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201006191212.o5JCCdhx076756@svn.freebsd.org> From: Adrian Chadd Date: Sat, 19 Jun 2010 12:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209338 - head/sys/mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 12:12:39 -0000 Author: adrian Date: Sat Jun 19 12:12:39 2010 New Revision: 209338 URL: http://svn.freebsd.org/changeset/base/209338 Log: Extend the AR71XX watchdog debugging and data. * Add some per-device sysctl entries which record the watchdog state - whether it is armed; whether the last reboot was due to the watchdog. * Add a per-device sysctl debug flag to enable logging watchdog arming/ disarming. Reviewed by: gonzo@ Modified: head/sys/mips/atheros/ar71xx_wdog.c Modified: head/sys/mips/atheros/ar71xx_wdog.c ============================================================================== --- head/sys/mips/atheros/ar71xx_wdog.c Sat Jun 19 10:33:04 2010 (r209337) +++ head/sys/mips/atheros/ar71xx_wdog.c Sat Jun 19 12:12:39 2010 (r209338) @@ -38,12 +38,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include struct ar71xx_wdog_softc { device_t dev; int armed; + int reboot_from_watchdog; + int debug; }; static void @@ -53,9 +56,13 @@ ar71xx_wdog_watchdog_fn(void *private, u uint64_t timer_val; cmd &= WD_INTERVAL; + if (sc->debug) + device_printf(sc->dev, "ar71xx_wdog_watchdog_fn: cmd: %x\n", cmd); if (cmd > 0) { timer_val = (uint64_t)(1ULL << cmd) * ar71xx_ahb_freq() / 1000000000; + if (sc->debug) + device_printf(sc->dev, "ar71xx_wdog_watchdog_fn: programming timer: %jx\n", (uintmax_t) timer_val); /* * Load timer with large enough value to prevent spurious * reset @@ -69,6 +76,8 @@ ar71xx_wdog_watchdog_fn(void *private, u sc->armed = 1; *error = 0; } else { + if (sc->debug) + device_printf(sc->dev, "ar71xx_wdog_watchdog_fn: disarming\n"); if (sc->armed) { ATH_WRITE_REG(AR71XX_RST_WDOG_CONTROL, RST_WDOG_ACTION_NOACTION); @@ -85,19 +94,47 @@ ar71xx_wdog_probe(device_t dev) return (0); } +static void +ar71xx_wdog_sysctl(device_t dev) +{ + struct ar71xx_wdog_softc *sc = device_get_softc(dev); + + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev); + struct sysctl_oid *tree = device_get_sysctl_tree(sc->dev); + + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "debug", CTLFLAG_RW, &sc->debug, 0, + "enable watchdog debugging"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "armed", CTLFLAG_RD, &sc->armed, 0, + "whether the watchdog is armed"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "reboot_from_watchdog", CTLFLAG_RD, &sc->reboot_from_watchdog, 0, + "whether the system rebooted from the watchdog"); +} + + static int ar71xx_wdog_attach(device_t dev) { struct ar71xx_wdog_softc *sc = device_get_softc(dev); - if (ATH_READ_REG(AR71XX_RST_WDOG_CONTROL) & RST_WDOG_LAST) + /* Initialise */ + sc->reboot_from_watchdog = 0; + sc->armed = 0; + sc->debug = 0; + + if (ATH_READ_REG(AR71XX_RST_WDOG_CONTROL) & RST_WDOG_LAST) { device_printf (dev, "Previous reset was due to watchdog timeout\n"); + sc->reboot_from_watchdog = 1; + } ATH_WRITE_REG(AR71XX_RST_WDOG_CONTROL, RST_WDOG_ACTION_NOACTION); sc->dev = dev; EVENTHANDLER_REGISTER(watchdog_list, ar71xx_wdog_watchdog_fn, sc, 0); + ar71xx_wdog_sysctl(dev); return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 13:09: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 3F415106564A; Sat, 19 Jun 2010 13:09:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F28E8FC1B; Sat, 19 Jun 2010 13:09: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 o5JD9gog089361; Sat, 19 Jun 2010 13:09:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5JD9gAg089359; Sat, 19 Jun 2010 13:09:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006191309.o5JD9gAg089359@svn.freebsd.org> From: Alexander Motin Date: Sat, 19 Jun 2010 13:09: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: r209339 - head/sys/x86/cpufreq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 13:09:44 -0000 Author: mav Date: Sat Jun 19 13:09:42 2010 New Revision: 209339 URL: http://svn.freebsd.org/changeset/base/209339 Log: Core i5, same as previously Core2Duo, found to not set P-state for single core lower then set on other cores. Do not try to test P-states on attach on SMP systems. It is hopeless now and will just pollute verbose logs. If needed, check still can be forced via loader tunable. Modified: head/sys/x86/cpufreq/est.c Modified: head/sys/x86/cpufreq/est.c ============================================================================== --- head/sys/x86/cpufreq/est.c Sat Jun 19 12:12:39 2010 (r209338) +++ head/sys/x86/cpufreq/est.c Sat Jun 19 13:09:42 2010 (r209339) @@ -1123,16 +1123,12 @@ est_acpi_info(device_t dev, freq_info ** * Confirm id16 value is correct. */ if (sets[i].freq > 0) { - error = est_set_id16(dev, sets[i].spec[0], 1); - if (error != 0 && strict) { + error = est_set_id16(dev, sets[i].spec[0], strict); + if (error != 0) { if (bootverbose) device_printf(dev, "Invalid freq %u, " "ignored.\n", sets[i].freq); continue; - } else if (error != 0 && bootverbose) { - device_printf(dev, "Can't check freq %u, " - "it may be invalid\n", - sets[i].freq); } table[j].freq = sets[i].freq; table[j].volts = sets[i].volts; From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 13:41: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 D7DAB106564A; Sat, 19 Jun 2010 13:41:17 +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 C7DE48FC0A; Sat, 19 Jun 2010 13:41: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 o5JDfH8m096302; Sat, 19 Jun 2010 13:41:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5JDfHpD096300; Sat, 19 Jun 2010 13:41:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006191341.o5JDfHpD096300@svn.freebsd.org> From: Alexander Motin Date: Sat, 19 Jun 2010 13:41: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: r209340 - head/sys/dev/hptiop X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 13:41:17 -0000 Author: mav Date: Sat Jun 19 13:41:17 2010 New Revision: 209340 URL: http://svn.freebsd.org/changeset/base/209340 Log: Report transport type in XPT_PATH_INQ. PR: i386/147929 MFC after: 3 days Modified: head/sys/dev/hptiop/hptiop.c Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Sat Jun 19 13:09:42 2010 (r209339) +++ head/sys/dev/hptiop/hptiop.c Sat Jun 19 13:41:17 2010 (r209340) @@ -1823,6 +1823,10 @@ scsi_done: strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); + cpi->transport = XPORT_SPI; + cpi->transport_version = 2; + cpi->protocol = PROTO_SCSI; + cpi->protocol_version = SCSI_REV_2; cpi->ccb_h.status = CAM_REQ_CMP; break; } From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 13:42: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 61C3F106566B; Sat, 19 Jun 2010 13:42:14 +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 51D948FC15; Sat, 19 Jun 2010 13:42: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 o5JDgEhP096536; Sat, 19 Jun 2010 13:42:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5JDgEHW096534; Sat, 19 Jun 2010 13:42:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006191342.o5JDgEHW096534@svn.freebsd.org> From: Alexander Motin Date: Sat, 19 Jun 2010 13:42: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: r209341 - head/sys/dev/hptmv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 13:42:14 -0000 Author: mav Date: Sat Jun 19 13:42:14 2010 New Revision: 209341 URL: http://svn.freebsd.org/changeset/base/209341 Log: Report transport type in XPT_PATH_INQ. MFC after: 3 days Modified: head/sys/dev/hptmv/entry.c Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Sat Jun 19 13:41:17 2010 (r209340) +++ head/sys/dev/hptmv/entry.c Sat Jun 19 13:42:14 2010 (r209341) @@ -2414,6 +2414,10 @@ hpt_action(struct cam_sim *sim, union cc strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); + cpi->transport = XPORT_SPI; + cpi->transport_version = 2; + cpi->protocol = PROTO_SCSI; + cpi->protocol_version = SCSI_REV_2; cpi->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 16:24:55 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 A92E7106566B; Sat, 19 Jun 2010 16:24:55 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9804C8FC16; Sat, 19 Jun 2010 16:24:55 +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 o5JGOt5p032506; Sat, 19 Jun 2010 16:24:55 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5JGOtX1032504; Sat, 19 Jun 2010 16:24:55 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201006191624.o5JGOtX1032504@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 19 Jun 2010 16:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209342 - head/usr.bin/ypwhich X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 16:24:55 -0000 Author: gavin Date: Sat Jun 19 16:24:55 2010 New Revision: 209342 URL: http://svn.freebsd.org/changeset/base/209342 Log: Variable 'getmap' is unused. Found by: clang static analyzer Modified: head/usr.bin/ypwhich/ypwhich.c Modified: head/usr.bin/ypwhich/ypwhich.c ============================================================================== --- head/usr.bin/ypwhich/ypwhich.c Sat Jun 19 13:42:14 2010 (r209341) +++ head/usr.bin/ypwhich/ypwhich.c Sat Jun 19 16:24:55 2010 (r209342) @@ -143,11 +143,11 @@ main(int argc, char *argv[]) struct ypmaplist *ypml, *y; struct hostent *hent; struct sockaddr_in lsin; - int notrans, mode, getmap; + int notrans, mode; int c, r; u_int i; - getmap = notrans = mode = 0; + notrans = mode = 0; while ((c = getopt(argc, argv, "xd:mt")) != -1) switch (c) { case 'x': From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 16:29: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 477F9106564A; Sat, 19 Jun 2010 16:29:24 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 360F88FC15; Sat, 19 Jun 2010 16:29: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 o5JGTNCb033502; Sat, 19 Jun 2010 16:29:23 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5JGTN6x033499; Sat, 19 Jun 2010 16:29:23 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201006191629.o5JGTN6x033499@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 19 Jun 2010 16:29: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: r209343 - head/usr.sbin/cpucontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 16:29:24 -0000 Author: gavin Date: Sat Jun 19 16:29:23 2010 New Revision: 209343 URL: http://svn.freebsd.org/changeset/base/209343 Log: Remove dead assignments, we overwrite the variable almost immediately. Found by: clang static analyzer Modified: head/usr.sbin/cpucontrol/amd.c head/usr.sbin/cpucontrol/intel.c Modified: head/usr.sbin/cpucontrol/amd.c ============================================================================== --- head/usr.sbin/cpucontrol/amd.c Sat Jun 19 16:24:55 2010 (r209342) +++ head/usr.sbin/cpucontrol/amd.c Sat Jun 19 16:29:23 2010 (r209343) @@ -92,9 +92,7 @@ amd_update(const char *dev, const char * assert(dev); fd = -1; - devfd = -1; fw_image = MAP_FAILED; - error = 0; devfd = open(dev, O_RDWR); if (devfd < 0) { WARN(0, "could not open %s for writing", dev); Modified: head/usr.sbin/cpucontrol/intel.c ============================================================================== --- head/usr.sbin/cpucontrol/intel.c Sat Jun 19 16:24:55 2010 (r209342) +++ head/usr.sbin/cpucontrol/intel.c Sat Jun 19 16:29:23 2010 (r209343) @@ -104,7 +104,6 @@ intel_update(const char *dev, const char assert(dev); fd = -1; - devfd = -1; fw_image = MAP_FAILED; ext_table = NULL; ext_header = NULL; From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 17:04:01 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 C9C7D106566B; Sat, 19 Jun 2010 17:04:01 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B83B78FC13; Sat, 19 Jun 2010 17:04: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 o5JH411b041257; Sat, 19 Jun 2010 17:04:01 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5JH410c041255; Sat, 19 Jun 2010 17:04:01 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201006191704.o5JH410c041255@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 19 Jun 2010 17:04: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: r209344 - head/usr.sbin/timed/timed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 17:04:01 -0000 Author: gavin Date: Sat Jun 19 17:04:01 2010 New Revision: 209344 URL: http://svn.freebsd.org/changeset/base/209344 Log: Initialise the "trials" variable to zero earlier in case we unexpectedly error out early. Found by: clang static analyzer Modified: head/usr.sbin/timed/timed/measure.c Modified: head/usr.sbin/timed/timed/measure.c ============================================================================== --- head/usr.sbin/timed/timed/measure.c Sat Jun 19 16:29:23 2010 (r209343) +++ head/usr.sbin/timed/timed/measure.c Sat Jun 19 17:04:01 2010 (r209344) @@ -86,6 +86,7 @@ measure(maxmsec, wmsec, hname, addr, pri min_idelta = min_odelta = 0x7fffffff; measure_status = HOSTDOWN; measure_delta = HOSTDOWN; + trials = 0; errno = 0; /* open raw socket used to measure time differences */ @@ -138,7 +139,6 @@ measure(maxmsec, wmsec, hname, addr, pri mstotvround(&twait, wmsec); rcvcount = 0; - trials = 0; while (rcvcount < MSGS) { (void)gettimeofday(&tcur, 0); From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 17:36: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 2653D1065670; Sat, 19 Jun 2010 17:36:15 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id D2DF18FC08; Sat, 19 Jun 2010 17:36:14 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 5120A7E84A; Sun, 20 Jun 2010 03:36:13 +1000 (EST) Message-ID: <4C1D000C.8090807@freebsd.org> Date: Sun, 20 Jun 2010 03:36:12 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Rui Paulo References: <201006141537.o5EFbnTD093866@svn.freebsd.org> <4C1C3162.60300@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209158 - in head/contrib/wpa: hostapd hostapd/doc src/common src/crypto src/drivers src/eap_common src/eap_peer src/eap_server src/eapol_supp src/hlr_auc_gw src/l2_packet src/radius sr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 17:36:15 -0000 On 06/19/10 19:56, Rui Paulo wrote: > > On 19 Jun 2010, at 03:54, Lawrence Stewart wrote: > >> Hi Rui, >> >> On 06/15/10 01:37, Rui Paulo wrote: >>> Author: rpaulo >>> Date: Mon Jun 14 15:37:48 2010 >>> New Revision: 209158 >>> URL: http://svn.freebsd.org/changeset/base/209158 >>> >>> Log: >>> MFV hostapd& wpa_supplicant 0.6.10. >>> >>> Added: >> >> [snip] >> >>> head/contrib/wpa/hostapd/radiotap.h >>> - copied unchanged from r209140, vendor/wpa/dist/hostapd/radiotap.h >> >> [snip] >> >>> head/contrib/wpa/src/drivers/radiotap.h >>> - copied unchanged from r209140, vendor/wpa/dist/src/drivers/radiotap.h >> >> There seems to be a minor issue with at least the above two files. Something went wrong with the keyword expansion and these two files have been committed with $FreeBSD$ expanded. Perhaps you didn't use the subversion-freebsd client to do some of the work? I believe the following diff should fix the issue I'm seeing. >> >> http://people.freebsd.org/~lstewart/patches/misc/wpa_keyword.diff > > What is the problem, exactly? Looking into this a bit more, I believe the problem is that you don't have your svn client autoprops set up correctly, and the files you committed don't have the "svn:keywords FreeBSD=%H" property set on them, so you committed the files with the expanded keyword instead of committing the keyword itself. The reason it's these 2 files is that they're the only ones with $FreeBSD:...$ in them, the others don't have the keyword. I'm not sure how the expanded keyword got into those two though... Take a look at: http://people.freebsd.org/~lstewart/misc/bsdcan2010/config in order to get a decent autoprops config going in your ~/.subversion/config file. You'll also want to manually go through and add the appropriate props to the files you committed. There is a python script distributed with svn that will retrospectively apply autoprops for you. cd /usr/ports/devel/subversion-freebsd/ ; make patch cp work/subversion-1.6.11/contrib/client-side/svn_apply_autoprops.py You can then use that script to apply the props to the files - it'll save you time and pain. This showed up as a problem in my private Hg repo because when I diff head against my dev branch, I'm seeing the $FreeBSD: ...$ line showing up as a diff when it shouldn't be there if the keywords were correct in the svn repo. Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 18:52: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 09D63106564A; Sat, 19 Jun 2010 18:52:38 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC4A48FC13; Sat, 19 Jun 2010 18:52:37 +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 o5JIqbFb065521; Sat, 19 Jun 2010 18:52:37 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5JIqbPd065519; Sat, 19 Jun 2010 18:52:37 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201006191852.o5JIqbPd065519@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 19 Jun 2010 18:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209350 - head/sbin/geom/class/sched X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 18:52:38 -0000 Author: uqs Date: Sat Jun 19 18:52:37 2010 New Revision: 209350 URL: http://svn.freebsd.org/changeset/base/209350 Log: mdoc nitpicking for gsched.8 - remove stray argument [1] - remove stray whitespace - use canonical wording for the HISTORY section PR: docs/147119 [1] Submitted by: Alexander Best [1] MFC after: 1 week Modified: head/sbin/geom/class/sched/gsched.8 Modified: head/sbin/geom/class/sched/gsched.8 ============================================================================== --- head/sbin/geom/class/sched/gsched.8 Sat Jun 19 18:38:03 2010 (r209349) +++ head/sbin/geom/class/sched/gsched.8 Sat Jun 19 18:52:37 2010 (r209350) @@ -94,10 +94,9 @@ on an already existing provider. .Pp A subsequent 'destroy' will remove the newly created geom and hook the provider back to the original geom. -.Ar algorithm .It Cm configure Configure existing scheduling provider. It supports the same options -as the +as the .Nm create command. .It Cm destroy @@ -157,7 +156,8 @@ geom sched destroy -v ad0.sched. .Sh HISTORY The .Nm -utility appeared in April 2010. +utility first appeared in +.Fx 9.0 . .Sh AUTHORS .An Fabio Checconi Aq fabio@FreeBSD.org .An Luigi Rizzo Aq luigi@FreeBSD.org From owner-svn-src-head@FreeBSD.ORG Sat Jun 19 19:22: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 3450F106564A; Sat, 19 Jun 2010 19:22:42 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id 90EB48FC08; Sat, 19 Jun 2010 19:22:42 +0000 (UTC) Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14]) by karen.lavabit.com (Postfix) with ESMTP id D19DC157551; Sat, 19 Jun 2010 14:22:37 -0500 (CDT) Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by lavabit.com with ESMTP id HJT114BNLXXJ; Sat, 19 Jun 2010 14:22:37 -0500 Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <4C1D000C.8090807@freebsd.org> Date: Sat, 19 Jun 2010 20:22:34 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201006141537.o5EFbnTD093866@svn.freebsd.org> <4C1C3162.60300@freebsd.org> <4C1D000C.8090807@freebsd.org> To: Lawrence Stewart 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: r209158 - in head/contrib/wpa: hostapd hostapd/doc src/common src/crypto src/drivers src/eap_common src/eap_peer src/eap_server src/eapol_supp src/hlr_auc_gw src/l2_packet src/radius sr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2010 19:22:43 -0000 Lawrence, I don't see the point in enabling svn:keywords in vendor code. It's = actually a good thing that radiotap.h doesn't get expanded. Regards, -- Rui Paulo