From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:12:32 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B1EB1065672; Sun, 29 Jan 2012 00:12:32 +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 0A9858FC0C; Sun, 29 Jan 2012 00:12:31 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0T0CUWs032449; Sat, 28 Jan 2012 19:12:30 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0T0CPne032446; Sat, 28 Jan 2012 19:12:25 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Sat, 28 Jan 2012 19:12:25 -0500 From: David Schultz To: Kostik Belousov Message-ID: <20120129001225.GA32220@zim.MIT.EDU> Mail-Followup-To: Kostik Belousov , Bruce Evans , Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201201261159.q0QBxma2086162@svn.freebsd.org> <20120126233110.C960@besplex.bde.org> <20120126153641.GA68112@FreeBSD.org> <20120127194612.H1547@besplex.bde.org> <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> <20120127194221.GA25723@zim.MIT.EDU> <20120128123748.GD2726@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120128123748.GD2726@deviant.kiev.zoral.com.ua> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Gleb Smirnoff , src-committers@FreeBSD.ORG, Bruce Evans Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:12:32 -0000 On Sat, Jan 28, 2012, Kostik Belousov wrote: > On Fri, Jan 27, 2012 at 02:42:21PM -0500, David Schultz wrote: > > On Fri, Jan 27, 2012, Kostik Belousov wrote: > > > On Fri, Jan 27, 2012 at 07:50:30PM +1100, Bruce Evans wrote: > > > > On Thu, 26 Jan 2012, Gleb Smirnoff wrote: > > > > > > > > >On Thu, Jan 26, 2012 at 11:53:57PM +1100, Bruce Evans wrote: > > > > >B> > @@ -1552,6 +1552,12 @@ aio_aqueue(struct thread *td, struct aio > > > > >B> > return (error); > > > > >B> > } > > > > >B> > > > > > >B> > + /* XXX: aio_nbytes is later casted to signed types. */ > > > > >B> > + if ((int)aiocbe->uaiocb.aio_nbytes < 0) { > > > > >B> > > > > >B> This should avoid implementation-defined behaviour by checking if > > > > >B> > > > > >B> (uncast)aiocbe->uaiocb.aio_nbytes > INT_MAX. > > > > > > > > >Is the attached patch okay? > > > > > > > > Yes. It now matches the style used for read^Wsys_read() and friends. > > > > This used to have to fit the count in "int uio_resid". uio_resid now > > > > has type ssize_t, but for some reason the old INT_MAX limits remain. > > > > > > Well, I can revive the patch. I still think it is good to get rid of > > > the limit. > > > > The correct limit on the maximum size of a single read/write is > > SSIZE_MAX, but FreeBSD uses INT_MAX. It's not safe to raise the > > limit yet, though, because of bugs in several filesystems. For > > example, FFS copies uio_resid into a local variable of type int. > > I have some old patches that fix some of these issues for FFS and > > cd9660, but surely there are more places I didn't notice. > > > Absolutely agree. > > http://people.freebsd.org/~kib/misc/uio_resid.5.patch Nice. You found a lot more than I've got in my tree, and you even fixed the return values. There are at least a few more places to fix. For instance, cd9660 and the NFS client pass uio_resid or iov_len to min(), which operates on ints. (Incidentally, C11 generics ought to make it possible to write type-generic min() and max() functions.) From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:19:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 730EC1065670; Sun, 29 Jan 2012 00:19:20 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CFF78FC08; Sun, 29 Jan 2012 00:19:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0JKxp006425; Sun, 29 Jan 2012 00:19:20 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0JKqO006423; Sun, 29 Jan 2012 00:19:20 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201201290019.q0T0JKqO006423@svn.freebsd.org> From: Kip Macy Date: Sun, 29 Jan 2012 00:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230689 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:19:20 -0000 Author: kmacy Date: Sun Jan 29 00:19:19 2012 New Revision: 230689 URL: http://svn.freebsd.org/changeset/base/230689 Log: always exclude data bufs regardless of debug settings 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 Sun Jan 29 00:00:15 2012 (r230688) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sun Jan 29 00:19:19 2012 (r230689) @@ -152,7 +152,7 @@ zio_init(void) (void) sprintf(name, "zio_data_buf_%lu", (ulong_t)size); zio_data_buf_cache[c] = kmem_cache_create(name, size, align, NULL, NULL, NULL, NULL, NULL, - cflags | KMC_NOTOUCH); + cflags | KMC_NOTOUCH | KMC_NODEBUG); } } From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:24:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FE0A1065670; Sun, 29 Jan 2012 00:24:47 +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 1828E8FC18; Sun, 29 Jan 2012 00:24:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0OkW2006632; Sun, 29 Jan 2012 00:24:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0OkEv006628; Sun, 29 Jan 2012 00:24:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290024.q0T0OkEv006628@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230690 - in stable/9/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:24:47 -0000 Author: marius Date: Sun Jan 29 00:24:46 2012 New Revision: 230690 URL: http://svn.freebsd.org/changeset/base/230690 Log: MFC: r226054 - Use atomic operations rather than sched_lock for safely assigning pm_active and pc_pmap for SMP. This is key to allowing adding support for SCHED_ULE. Thanks go to Peter Jeremy for additional testing. - Add support for SCHED_ULE to cpu_switch(). Modified: stable/9/sys/sparc64/include/asmacros.h stable/9/sys/sparc64/sparc64/pmap.c stable/9/sys/sparc64/sparc64/swtch.S Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/include/asmacros.h ============================================================================== --- stable/9/sys/sparc64/include/asmacros.h Sun Jan 29 00:19:19 2012 (r230689) +++ stable/9/sys/sparc64/include/asmacros.h Sun Jan 29 00:24:46 2012 (r230690) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001 Jake Burkholder. + * Copyright (c) 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -98,9 +99,67 @@ 9: andn r2, bits, r3 ; \ casxa [r1] ASI_N, r2, r3 ; \ cmp r2, r3 ; \ + bne,pn %xcc, 9b ; \ + mov r3, r2 + +/* + * Atomically load an integer from memory. + */ +#define ATOMIC_LOAD_INT(r1, val) \ + clr val ; \ + casa [r1] ASI_N, %g0, val + +/* + * Atomically load a long from memory. + */ +#define ATOMIC_LOAD_LONG(r1, val) \ + clr val ; \ + casxa [r1] ASI_N, %g0, val + +/* + * Atomically set a number of bits of an integer in memory. + */ +#define ATOMIC_SET_INT(r1, r2, r3, bits) \ + lduw [r1], r2 ; \ +9: or r2, bits, r3 ; \ + casa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ + mov r3, r2 + +/* + * Atomically set a number of bits of a long in memory. + */ +#define ATOMIC_SET_LONG(r1, r2, r3, bits) \ + ldx [r1], r2 ; \ +9: or r2, bits, r3 ; \ + casxa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %xcc, 9b ; \ + mov r3, r2 + +/* + * Atomically store an integer in memory. + */ +#define ATOMIC_STORE_INT(r1, r2, r3, val) \ + lduw [r1], r2 ; \ +9: mov val, r3 ; \ + casa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ bne,pn %icc, 9b ; \ mov r3, r2 +/* + * Atomically store a long in memory. + */ +#define ATOMIC_STORE_LONG(r1, r2, r3, val) \ + ldx [r1], r2 ; \ +9: mov val, r3 ; \ + casxa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %xcc, 9b ; \ + mov r3, r2 + #define PCPU(member) PCPU_REG + PC_ ## member #define PCPU_ADDR(member, reg) \ add PCPU_REG, PC_ ## member, reg Modified: stable/9/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/9/sys/sparc64/sparc64/pmap.c Sun Jan 29 00:19:19 2012 (r230689) +++ stable/9/sys/sparc64/sparc64/pmap.c Sun Jan 29 00:24:46 2012 (r230690) @@ -100,13 +100,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* XXX */ -#include "opt_sched.h" -#ifndef SCHED_4BSD -#error "sparc64 only works with SCHED_4BSD which uses a global scheduler lock." -#endif -extern struct mtx sched_lock; - /* * Virtual address of message buffer */ @@ -1232,11 +1225,9 @@ pmap_pinit(pmap_t pm) if (pm->pm_tsb_obj == NULL) pm->pm_tsb_obj = vm_object_allocate(OBJT_PHYS, TSB_PAGES); - mtx_lock_spin(&sched_lock); for (i = 0; i < MAXCPU; i++) pm->pm_context[i] = -1; CPU_ZERO(&pm->pm_active); - mtx_unlock_spin(&sched_lock); VM_OBJECT_LOCK(pm->pm_tsb_obj); for (i = 0; i < TSB_PAGES; i++) { @@ -1263,7 +1254,9 @@ pmap_release(pmap_t pm) { vm_object_t obj; vm_page_t m; +#ifdef SMP struct pcpu *pc; +#endif CTR2(KTR_PMAP, "pmap_release: ctx=%#x tsb=%p", pm->pm_context[curcpu], pm->pm_tsb); @@ -1283,11 +1276,18 @@ pmap_release(pmap_t pm) * - A process that referenced this pmap ran on a CPU, but we switched * to a kernel thread, leaving the pmap pointer unchanged. */ - mtx_lock_spin(&sched_lock); +#ifdef SMP + sched_pin(); STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) - if (pc->pc_pmap == pm) - pc->pc_pmap = NULL; - mtx_unlock_spin(&sched_lock); + atomic_cmpset_rel_ptr((uintptr_t *)&pc->pc_pmap, + (uintptr_t)pm, (uintptr_t)NULL); + sched_unpin(); +#else + critical_enter(); + if (PCPU_GET(pmap) == pm) + PCPU_SET(pmap, NULL); + critical_exit(); +#endif pmap_qremove((vm_offset_t)pm->pm_tsb, TSB_PAGES); obj = pm->pm_tsb_obj; @@ -2232,11 +2232,14 @@ pmap_activate(struct thread *td) } PCPU_SET(tlb_ctx, context + 1); - mtx_lock_spin(&sched_lock); pm->pm_context[curcpu] = context; +#ifdef SMP + CPU_SET_ATOMIC(PCPU_GET(cpuid), &pm->pm_active); + atomic_store_ptr((uintptr_t *)PCPU_PTR(pmap), (uintptr_t)pm); +#else CPU_SET(PCPU_GET(cpuid), &pm->pm_active); PCPU_SET(pmap, pm); - mtx_unlock_spin(&sched_lock); +#endif stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb); Modified: stable/9/sys/sparc64/sparc64/swtch.S ============================================================================== --- stable/9/sys/sparc64/sparc64/swtch.S Sun Jan 29 00:19:19 2012 (r230689) +++ stable/9/sys/sparc64/sparc64/swtch.S Sun Jan 29 00:24:46 2012 (r230690) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001 Jake Burkholder. + * Copyright (c) 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include "assym.s" +#include "opt_sched.h" .register %g2, #ignore .register %g3, #ignore @@ -66,7 +68,7 @@ ENTRY(cpu_switch) nop call savefpctx add PCB_REG, PCB_KFP, %o0 - ba,a %xcc, 2f + ba,a,pt %xcc, 2f nop /* @@ -148,7 +150,7 @@ ENTRY(cpu_switch) * If they are the same we are done. */ cmp %l2, %l1 - be,a,pn %xcc, 7f + be,a,pn %xcc, 8f nop /* @@ -157,7 +159,7 @@ ENTRY(cpu_switch) */ SET(vmspace0, %i4, %i3) cmp %i5, %i3 - be,a,pn %xcc, 7f + be,a,pn %xcc, 8f nop /* @@ -180,9 +182,15 @@ ENTRY(cpu_switch) sub %l3, %l5, %l5 mov 1, %l6 sllx %l6, %l5, %l5 +#ifdef SMP + add %l2, %l4, %l4 + membar #LoadStore | #StoreStore + ATOMIC_CLEAR_LONG(%l4, %l6, %l7, %l5) +#else ldx [%l2 + %l4], %l6 andn %l6, %l5, %l6 stx %l6, [%l2 + %l4] +#endif /* * Take away its context number. @@ -194,14 +202,20 @@ ENTRY(cpu_switch) 3: cmp %i2, %g0 be,pn %xcc, 4f - lduw [PCPU(TLB_CTX_MAX)], %i4 - stx %i2, [%i0 + TD_LOCK] + add %i0, TD_LOCK, %l4 +#if defined(SCHED_ULE) && defined(SMP) + membar #LoadStore | #StoreStore + ATOMIC_STORE_LONG(%l4, %l6, %l7, %i2) +#else + stx %i2, [%l4] +#endif /* * Find a new TLB context. If we've run out we have to flush all * user mappings from the TLB and reset the context numbers. */ 4: lduw [PCPU(TLB_CTX)], %i3 + lduw [PCPU(TLB_CTX_MAX)], %i4 cmp %i3, %i4 bne,a,pt %xcc, 5f nop @@ -237,14 +251,24 @@ ENTRY(cpu_switch) sub %l3, %l5, %l5 mov 1, %l6 sllx %l6, %l5, %l5 +#ifdef SMP + add %l1, %l4, %l4 + ATOMIC_SET_LONG(%l4, %l6, %l7, %l5) +#else ldx [%l1 + %l4], %l6 or %l6, %l5, %l6 stx %l6, [%l1 + %l4] +#endif /* * Make note of the change in pmap. */ +#ifdef SMP + PCPU_ADDR(PMAP, %l4) + ATOMIC_STORE_LONG(%l4, %l5, %l6, %l1) +#else stx %l1, [PCPU(PMAP)] +#endif /* * Fiddle the hardware bits. Set the TSB registers and install the @@ -264,19 +288,35 @@ ENTRY(cpu_switch) stxa %i3, [%i5] ASI_DMMU flush %i4 +6: +#if defined(SCHED_ULE) && defined(SMP) + SET(blocked_lock, %l2, %l1) + add %i1, TD_LOCK, %l2 +7: + ATOMIC_LOAD_LONG(%l2, %l3) + cmp %l1, %l3 + be,a,pn %xcc, 7b + nop +#endif + /* * Done, return and load the new process's window from the stack. */ - -6: ret + ret restore -7: cmp %i2, %g0 - be,a,pn %xcc, 6b +8: cmp %i2, %g0 + be,pn %xcc, 6b + add %i0, TD_LOCK, %l4 +#if defined(SCHED_ULE) && defined(SMP) + membar #LoadStore | #StoreStore + ATOMIC_STORE_LONG(%l4, %l6, %l7, %i2) + ba,pt %xcc, 6b nop - stx %i2, [%i0 + TD_LOCK] - ret - restore +#else + ba,pt %xcc, 6b + stx %i2, [%l4] +#endif END(cpu_switch) ENTRY(savectx) From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:32:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0439D106566C; Sun, 29 Jan 2012 00:32:38 +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 D81FD8FC15; Sun, 29 Jan 2012 00:32:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0Wb0t006922; Sun, 29 Jan 2012 00:32:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0WbJB006920; Sun, 29 Jan 2012 00:32:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290032.q0T0WbJB006920@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230691 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:32:38 -0000 Author: marius Date: Sun Jan 29 00:32:37 2012 New Revision: 230691 URL: http://svn.freebsd.org/changeset/base/230691 Log: MFC: r226057 - Currently, sched_balance_pair() may cause a CPU to send an IPI_PREEMPT to itself, which sparc64 hardware doesn't support. One way to solve this would be to directly call sched_preempt() instead of issuing a self-IPI. However, quoting jhb@: "On the other hand, you can probably just skip the IPI entirely if we are going to send it to the current CPU. Presumably, once this routine finishes, the current CPU will exit softlock (or will do so "soon") and will then pick the next thread to run based on the adjustments made in this routine, so there's no need to IPI the CPU running this routine anyway. I think this is the better solution. Right now what is probably happening on other platforms is as soon as this routine finishes the CPU processes its self-IPI and causes mi_switch() which will just switch back to the softclock thread it is already running." - With r226054 (MFC'ed to stable/9 in r230690) and the the above change in place, sparc64 now no longer is incompatible with ULE and vice versa. However, powerpc/E500 still is. Submitted by: jhb Reviewed by: jeff Modified: stable/9/sys/kern/sched_ule.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Sun Jan 29 00:24:46 2012 (r230690) +++ stable/9/sys/kern/sched_ule.c Sun Jan 29 00:32:37 2012 (r230691) @@ -76,7 +76,7 @@ dtrace_vtime_switch_func_t dtrace_vtime_ #include #include -#if defined(__sparc64__) +#if defined(__powerpc__) && defined(E500) #error "This architecture is not currently compatible with ULE" #endif @@ -839,6 +839,7 @@ sched_balance_pair(struct tdq *high, str int low_load; int moved; int move; + int cpu; int diff; int i; @@ -860,10 +861,14 @@ sched_balance_pair(struct tdq *high, str for (i = 0; i < move; i++) moved += tdq_move(high, low); /* - * IPI the target cpu to force it to reschedule with the new - * workload. + * In case the target isn't the current cpu IPI it to force a + * reschedule with the new workload. */ - ipi_cpu(TDQ_ID(low), IPI_PREEMPT); + cpu = TDQ_ID(low); + sched_pin(); + if (cpu != PCPU_GET(cpuid)) + ipi_cpu(cpu, IPI_PREEMPT); + sched_unpin(); } tdq_unlock_pair(high, low); return (moved); From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:34:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04FC01065672; Sun, 29 Jan 2012 00:34:20 +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 C8E8C8FC13; Sun, 29 Jan 2012 00:34:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0YJ96007037; Sun, 29 Jan 2012 00:34:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0YJ9a007033; Sun, 29 Jan 2012 00:34:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290034.q0T0YJ9a007033@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230692 - in stable/8/sys/dev: isp mps mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:34:20 -0000 Author: marius Date: Sun Jan 29 00:34:19 2012 New Revision: 230692 URL: http://svn.freebsd.org/changeset/base/230692 Log: MFC: r226118 Sync with ahc(4)/ahd(4)/sym(4) etc: Zero any sense not transferred by the device as the SCSI specification mandates that any untransferred data should be assumed to be zero. Reviewed by: ken Modified: stable/8/sys/dev/isp/isp_freebsd.h stable/8/sys/dev/mps/mps_sas.c stable/8/sys/dev/mpt/mpt_cam.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.h Sun Jan 29 00:32:37 2012 (r230691) +++ stable/8/sys/dev/isp/isp_freebsd.h Sun Jan 29 00:34:19 2012 (r230692) @@ -473,6 +473,7 @@ default: \ #define XS_SAVE_SENSE(xs, sense_ptr, sense_len) \ (xs)->ccb_h.status |= CAM_AUTOSNS_VALID; \ + memset(&(xs)->sense_data, 0, sizeof(&(xs)->sense_data)); \ memcpy(&(xs)->sense_data, sense_ptr, imin(XS_SNSLEN(xs), sense_len)) #define XS_SENSE_VALID(xs) (((xs)->ccb_h.status & CAM_AUTOSNS_VALID) != 0) Modified: stable/8/sys/dev/mps/mps_sas.c ============================================================================== --- stable/8/sys/dev/mps/mps_sas.c Sun Jan 29 00:32:37 2012 (r230691) +++ stable/8/sys/dev/mps/mps_sas.c Sun Jan 29 00:34:19 2012 (r230692) @@ -1670,6 +1670,7 @@ mpssas_scsiio_complete(struct mps_softc sizeof(struct scsi_sense_data)); if (sense_len < rep->SenseCount) ccb->csio.sense_resid = rep->SenseCount - sense_len; + bzero(&ccb->csio.sense_data, sizeof(&ccb->csio.sense_data)); bcopy(cm->cm_sense, &ccb->csio.sense_data, sense_len); ccb->ccb_h.status |= CAM_AUTOSNS_VALID; } Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Sun Jan 29 00:32:37 2012 (r230691) +++ stable/8/sys/dev/mpt/mpt_cam.c Sun Jan 29 00:34:19 2012 (r230692) @@ -3170,6 +3170,7 @@ mpt_scsi_reply_frame_handler(struct mpt_ ccb->ccb_h.status |= CAM_AUTOSNS_VALID; ccb->csio.sense_resid = ccb->csio.sense_len - le32toh(scsi_io_reply->SenseCount); + bzero(&ccb->csio.sense_data, sizeof(&ccb->csio.sense_data)); bcopy(req->sense_vbuf, &ccb->csio.sense_data, min(ccb->csio.sense_len, le32toh(scsi_io_reply->SenseCount))); From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:35:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 849F8106564A; Sun, 29 Jan 2012 00:35:23 +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 5361D8FC14; Sun, 29 Jan 2012 00:35:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0ZMwT007201; Sun, 29 Jan 2012 00:35:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0ZMFQ007199; Sun, 29 Jan 2012 00:35:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290035.q0T0ZMFQ007199@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230693 - stable/8/sys/dev/vr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:35:23 -0000 Author: marius Date: Sun Jan 29 00:35:22 2012 New Revision: 230693 URL: http://svn.freebsd.org/changeset/base/230693 Log: MFC: r226171 Sprinkle const. Modified: stable/8/sys/dev/vr/if_vr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/vr/if_vr.c ============================================================================== --- stable/8/sys/dev/vr/if_vr.c Sun Jan 29 00:34:19 2012 (r230692) +++ stable/8/sys/dev/vr/if_vr.c Sun Jan 29 00:35:22 2012 (r230693) @@ -114,12 +114,12 @@ MODULE_DEPEND(vr, miibus, 1, 1, 1); #define VR_Q_CSUM (1<<1) #define VR_Q_CAM (1<<2) -static struct vr_type { +static const struct vr_type { u_int16_t vr_vid; u_int16_t vr_did; int vr_quirks; - char *vr_name; -} vr_devs[] = { + const char *vr_name; +} const vr_devs[] = { { VIA_VENDORID, VIA_DEVICEID_RHINE, VR_Q_NEEDALIGN, "VIA VT3043 Rhine I 10/100BaseTX" }, @@ -195,11 +195,11 @@ static void vr_setwol(struct vr_softc *) static void vr_clrwol(struct vr_softc *); static int vr_sysctl_stats(SYSCTL_HANDLER_ARGS); -static struct vr_tx_threshold_table { +static const struct vr_tx_threshold_table { int tx_cfg; int bcr_cfg; int value; -} vr_tx_threshold_tables[] = { +} const vr_tx_threshold_tables[] = { { VR_TXTHRESH_64BYTES, VR_BCR1_TXTHRESH64BYTES, 64 }, { VR_TXTHRESH_128BYTES, VR_BCR1_TXTHRESH128BYTES, 128 }, { VR_TXTHRESH_256BYTES, VR_BCR1_TXTHRESH256BYTES, 256 }, @@ -557,10 +557,10 @@ vr_reset(const struct vr_softc *sc) * Probe for a VIA Rhine chip. Check the PCI vendor and device * IDs against our list and return a match or NULL */ -static struct vr_type * +static const struct vr_type * vr_match(device_t dev) { - struct vr_type *t = vr_devs; + const struct vr_type *t = vr_devs; for (t = vr_devs; t->vr_name != NULL; t++) if ((pci_get_vendor(dev) == t->vr_vid) && @@ -576,7 +576,7 @@ vr_match(device_t dev) static int vr_probe(device_t dev) { - struct vr_type *t; + const struct vr_type *t; t = vr_match(dev); if (t != NULL) { @@ -595,7 +595,7 @@ vr_attach(device_t dev) { struct vr_softc *sc; struct ifnet *ifp; - struct vr_type *t; + const struct vr_type *t; uint8_t eaddr[ETHER_ADDR_LEN]; int error, rid; int i, phy, pmc; From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:35:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B42C21065670; Sun, 29 Jan 2012 00:35:23 +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 83D1B8FC1D; Sun, 29 Jan 2012 00:35:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0ZNdU007215; Sun, 29 Jan 2012 00:35:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0ZN9E007213; Sun, 29 Jan 2012 00:35:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290035.q0T0ZN9E007213@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230694 - stable/9/sys/dev/vr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:35:23 -0000 Author: marius Date: Sun Jan 29 00:35:22 2012 New Revision: 230694 URL: http://svn.freebsd.org/changeset/base/230694 Log: MFC: r226171 Sprinkle const. Modified: stable/9/sys/dev/vr/if_vr.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/vr/if_vr.c ============================================================================== --- stable/9/sys/dev/vr/if_vr.c Sun Jan 29 00:35:22 2012 (r230693) +++ stable/9/sys/dev/vr/if_vr.c Sun Jan 29 00:35:22 2012 (r230694) @@ -114,12 +114,12 @@ MODULE_DEPEND(vr, miibus, 1, 1, 1); #define VR_Q_CSUM (1<<1) #define VR_Q_CAM (1<<2) -static struct vr_type { +static const struct vr_type { u_int16_t vr_vid; u_int16_t vr_did; int vr_quirks; - char *vr_name; -} vr_devs[] = { + const char *vr_name; +} const vr_devs[] = { { VIA_VENDORID, VIA_DEVICEID_RHINE, VR_Q_NEEDALIGN, "VIA VT3043 Rhine I 10/100BaseTX" }, @@ -195,11 +195,11 @@ static void vr_setwol(struct vr_softc *) static void vr_clrwol(struct vr_softc *); static int vr_sysctl_stats(SYSCTL_HANDLER_ARGS); -static struct vr_tx_threshold_table { +static const struct vr_tx_threshold_table { int tx_cfg; int bcr_cfg; int value; -} vr_tx_threshold_tables[] = { +} const vr_tx_threshold_tables[] = { { VR_TXTHRESH_64BYTES, VR_BCR1_TXTHRESH64BYTES, 64 }, { VR_TXTHRESH_128BYTES, VR_BCR1_TXTHRESH128BYTES, 128 }, { VR_TXTHRESH_256BYTES, VR_BCR1_TXTHRESH256BYTES, 256 }, @@ -553,10 +553,10 @@ vr_reset(const struct vr_softc *sc) * Probe for a VIA Rhine chip. Check the PCI vendor and device * IDs against our list and return a match or NULL */ -static struct vr_type * +static const struct vr_type * vr_match(device_t dev) { - struct vr_type *t = vr_devs; + const struct vr_type *t = vr_devs; for (t = vr_devs; t->vr_name != NULL; t++) if ((pci_get_vendor(dev) == t->vr_vid) && @@ -572,7 +572,7 @@ vr_match(device_t dev) static int vr_probe(device_t dev) { - struct vr_type *t; + const struct vr_type *t; t = vr_match(dev); if (t != NULL) { @@ -591,7 +591,7 @@ vr_attach(device_t dev) { struct vr_softc *sc; struct ifnet *ifp; - struct vr_type *t; + const struct vr_type *t; uint8_t eaddr[ETHER_ADDR_LEN]; int error, rid; int i, phy, pmc; From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:40:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D312C106566C; Sun, 29 Jan 2012 00:40:39 +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 BC6778FC08; Sun, 29 Jan 2012 00:40:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0edU6007454; Sun, 29 Jan 2012 00:40:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0edhw007452; Sun, 29 Jan 2012 00:40:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290040.q0T0edhw007452@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230695 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:40:39 -0000 Author: marius Date: Sun Jan 29 00:40:39 2012 New Revision: 230695 URL: http://svn.freebsd.org/changeset/base/230695 Log: MFC: r226175 In device_get_children() avoid malloc(0) in order to increase portability to other operating systems. PR: 154287 Modified: stable/9/sys/kern/subr_bus.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/subr_bus.c ============================================================================== --- stable/9/sys/kern/subr_bus.c Sun Jan 29 00:35:22 2012 (r230694) +++ stable/9/sys/kern/subr_bus.c Sun Jan 29 00:40:39 2012 (r230695) @@ -2173,6 +2173,11 @@ device_get_children(device_t dev, device TAILQ_FOREACH(child, &dev->children, link) { count++; } + if (count == 0) { + *devlistp = NULL; + *devcountp = 0; + return (0); + } list = malloc(count * sizeof(device_t), M_TEMP, M_NOWAIT|M_ZERO); if (!list) From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:41:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15A26106566C; Sun, 29 Jan 2012 00:41:09 +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 F37758FC20; Sun, 29 Jan 2012 00:41:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0f8fQ007506; Sun, 29 Jan 2012 00:41:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0f8iF007504; Sun, 29 Jan 2012 00:41:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290041.q0T0f8iF007504@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230696 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:41:09 -0000 Author: marius Date: Sun Jan 29 00:41:08 2012 New Revision: 230696 URL: http://svn.freebsd.org/changeset/base/230696 Log: MFC: r226175 In device_get_children() avoid malloc(0) in order to increase portability to other operating systems. PR: 154287 Modified: stable/8/sys/kern/subr_bus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Sun Jan 29 00:40:39 2012 (r230695) +++ stable/8/sys/kern/subr_bus.c Sun Jan 29 00:41:08 2012 (r230696) @@ -2176,6 +2176,11 @@ device_get_children(device_t dev, device TAILQ_FOREACH(child, &dev->children, link) { count++; } + if (count == 0) { + *devlistp = NULL; + *devcountp = 0; + return (0); + } list = malloc(count * sizeof(device_t), M_TEMP, M_NOWAIT|M_ZERO); if (!list) From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:42:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEEA31065675; Sun, 29 Jan 2012 00:42:54 +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 8E4468FC0C; Sun, 29 Jan 2012 00:42:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0gs3n007639; Sun, 29 Jan 2012 00:42:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0gsbJ007636; Sun, 29 Jan 2012 00:42:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290042.q0T0gsbJ007636@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230697 - stable/9/sys/dev/lge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:42:54 -0000 Author: marius Date: Sun Jan 29 00:42:54 2012 New Revision: 230697 URL: http://svn.freebsd.org/changeset/base/230697 Log: MFC: r226270 - Remove unused remnants of MII bitbang'ing. - Sprinkle const. Modified: stable/9/sys/dev/lge/if_lge.c stable/9/sys/dev/lge/if_lgereg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/lge/if_lge.c ============================================================================== --- stable/9/sys/dev/lge/if_lge.c Sun Jan 29 00:41:08 2012 (r230696) +++ stable/9/sys/dev/lge/if_lge.c Sun Jan 29 00:42:54 2012 (r230697) @@ -110,7 +110,7 @@ __FBSDID("$FreeBSD$"); /* * Various supported device vendors/types and their names. */ -static struct lge_type lge_devs[] = { +static const struct lge_type const lge_devs[] = { { LGE_VENDORID, LGE_DEVICEID, "Level 1 Gigabit Ethernet" }, { 0, 0, NULL } }; @@ -438,7 +438,7 @@ static int lge_probe(dev) device_t dev; { - struct lge_type *t; + const struct lge_type *t; t = lge_devs; Modified: stable/9/sys/dev/lge/if_lgereg.h ============================================================================== --- stable/9/sys/dev/lge/if_lgereg.h Sun Jan 29 00:41:08 2012 (r230696) +++ stable/9/sys/dev/lge/if_lgereg.h Sun Jan 29 00:42:54 2012 (r230697) @@ -475,26 +475,9 @@ struct lge_list_data { struct lge_type { u_int16_t lge_vid; u_int16_t lge_did; - char *lge_name; + const char *lge_name; }; -struct lge_mii_frame { - u_int8_t mii_stdelim; - u_int8_t mii_opcode; - u_int8_t mii_phyaddr; - u_int8_t mii_regaddr; - u_int8_t mii_turnaround; - u_int16_t mii_data; -}; - -/* - * MII constants - */ -#define LGE_MII_STARTDELIM 0x01 -#define LGE_MII_READOP 0x02 -#define LGE_MII_WRITEOP 0x01 -#define LGE_MII_TURNAROUND 0x02 - #define LGE_JUMBO_FRAMELEN 9018 #define LGE_JUMBO_MTU (LGE_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN) #define LGE_JSLOTS 384 From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:42:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 809331065673; Sun, 29 Jan 2012 00:42: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 5078E8FC14; Sun, 29 Jan 2012 00:42:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0gtWn007655; Sun, 29 Jan 2012 00:42:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0gtDu007652; Sun, 29 Jan 2012 00:42:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290042.q0T0gtDu007652@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230698 - stable/8/sys/dev/lge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:42:55 -0000 Author: marius Date: Sun Jan 29 00:42:54 2012 New Revision: 230698 URL: http://svn.freebsd.org/changeset/base/230698 Log: MFC: r226270 - Remove unused remnants of MII bitbang'ing. - Sprinkle const. Modified: stable/8/sys/dev/lge/if_lge.c stable/8/sys/dev/lge/if_lgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/lge/if_lge.c ============================================================================== --- stable/8/sys/dev/lge/if_lge.c Sun Jan 29 00:42:54 2012 (r230697) +++ stable/8/sys/dev/lge/if_lge.c Sun Jan 29 00:42:54 2012 (r230698) @@ -110,7 +110,7 @@ __FBSDID("$FreeBSD$"); /* * Various supported device vendors/types and their names. */ -static struct lge_type lge_devs[] = { +static const struct lge_type const lge_devs[] = { { LGE_VENDORID, LGE_DEVICEID, "Level 1 Gigabit Ethernet" }, { 0, 0, NULL } }; @@ -442,7 +442,7 @@ static int lge_probe(dev) device_t dev; { - struct lge_type *t; + const struct lge_type *t; t = lge_devs; Modified: stable/8/sys/dev/lge/if_lgereg.h ============================================================================== --- stable/8/sys/dev/lge/if_lgereg.h Sun Jan 29 00:42:54 2012 (r230697) +++ stable/8/sys/dev/lge/if_lgereg.h Sun Jan 29 00:42:54 2012 (r230698) @@ -475,26 +475,9 @@ struct lge_list_data { struct lge_type { u_int16_t lge_vid; u_int16_t lge_did; - char *lge_name; + const char *lge_name; }; -struct lge_mii_frame { - u_int8_t mii_stdelim; - u_int8_t mii_opcode; - u_int8_t mii_phyaddr; - u_int8_t mii_regaddr; - u_int8_t mii_turnaround; - u_int16_t mii_data; -}; - -/* - * MII constants - */ -#define LGE_MII_STARTDELIM 0x01 -#define LGE_MII_READOP 0x02 -#define LGE_MII_WRITEOP 0x01 -#define LGE_MII_TURNAROUND 0x02 - #define LGE_JUMBO_FRAMELEN 9018 #define LGE_JUMBO_MTU (LGE_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN) #define LGE_JSLOTS 384 From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:45:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6BF81065674; Sun, 29 Jan 2012 00:45:52 +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 908628FC0A; Sun, 29 Jan 2012 00:45:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0jqm5007824; Sun, 29 Jan 2012 00:45:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0jqDF007822; Sun, 29 Jan 2012 00:45:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290045.q0T0jqDF007822@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230699 - stable/9/sys/sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:45:52 -0000 Author: marius Date: Sun Jan 29 00:45:52 2012 New Revision: 230699 URL: http://svn.freebsd.org/changeset/base/230699 Log: MFC: r226948 Remove unnecessary DMA constraints. Modified: stable/9/sys/sparc64/sbus/dma_sbus.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/sbus/dma_sbus.c ============================================================================== --- stable/9/sys/sparc64/sbus/dma_sbus.c Sun Jan 29 00:42:54 2012 (r230698) +++ stable/9/sys/sparc64/sbus/dma_sbus.c Sun Jan 29 00:45:52 2012 (r230699) @@ -233,9 +233,9 @@ dma_attach(device_t dev) BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ - 0, /* nsegments */ - BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + BUS_SPACE_MAXSIZE, /* maxsize */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ + BUS_SPACE_MAXSIZE, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* no locking */ &lsc->sc_parent_dmat); From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:45:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63C51106566C; Sun, 29 Jan 2012 00:45: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 4E61E8FC08; Sun, 29 Jan 2012 00:45:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0jtRx007858; Sun, 29 Jan 2012 00:45:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0jtkh007856; Sun, 29 Jan 2012 00:45:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290045.q0T0jtkh007856@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230700 - stable/8/sys/sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:45:55 -0000 Author: marius Date: Sun Jan 29 00:45:54 2012 New Revision: 230700 URL: http://svn.freebsd.org/changeset/base/230700 Log: MFC: r226948 Remove unnecessary DMA constraints. Modified: stable/8/sys/sparc64/sbus/dma_sbus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/sbus/dma_sbus.c ============================================================================== --- stable/8/sys/sparc64/sbus/dma_sbus.c Sun Jan 29 00:45:52 2012 (r230699) +++ stable/8/sys/sparc64/sbus/dma_sbus.c Sun Jan 29 00:45:54 2012 (r230700) @@ -233,9 +233,9 @@ dma_attach(device_t dev) BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ - 0, /* nsegments */ - BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + BUS_SPACE_MAXSIZE, /* maxsize */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ + BUS_SPACE_MAXSIZE, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* no locking */ &lsc->sc_parent_dmat); From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:47:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2689D1065690; Sun, 29 Jan 2012 00:47:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10C748FC1F; Sun, 29 Jan 2012 00:47:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0lB9W007962; Sun, 29 Jan 2012 00:47:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0lBKZ007960; Sun, 29 Jan 2012 00:47:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290047.q0T0lBKZ007960@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230701 - stable/9/sys/dev/esp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:47:12 -0000 Author: marius Date: Sun Jan 29 00:47:11 2012 New Revision: 230701 URL: http://svn.freebsd.org/changeset/base/230701 Log: MFC: r226950 Add multiple inclusion protection. Modified: stable/9/sys/dev/esp/ncr53c9xreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/esp/ncr53c9xreg.h ============================================================================== --- stable/9/sys/dev/esp/ncr53c9xreg.h Sun Jan 29 00:45:54 2012 (r230700) +++ stable/9/sys/dev/esp/ncr53c9xreg.h Sun Jan 29 00:47:11 2012 (r230701) @@ -31,6 +31,9 @@ /* $FreeBSD$ */ +#ifndef _NCR53C9XREG_H_ +#define _NCR53C9XREG_H_ + /* * Register addresses, relative to some base address */ @@ -288,3 +291,4 @@ #define NCRFAS_STAT2_OSHUTTLE 0x40 /* next byte from FIFO is MSB */ #define NCRFAS_STAT2_EMPTY 0x80 /* FIFO is empty */ +#endif /* _NCR53C9XREG_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:47:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEA8D106567C; Sun, 29 Jan 2012 00:47:14 +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 A87278FC13; Sun, 29 Jan 2012 00:47:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0lEEf007996; Sun, 29 Jan 2012 00:47:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0lEd1007994; Sun, 29 Jan 2012 00:47:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290047.q0T0lEd1007994@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230702 - stable/8/sys/dev/esp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:47:14 -0000 Author: marius Date: Sun Jan 29 00:47:14 2012 New Revision: 230702 URL: http://svn.freebsd.org/changeset/base/230702 Log: MFC: r226950 Add multiple inclusion protection. Modified: stable/8/sys/dev/esp/ncr53c9xreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/esp/ncr53c9xreg.h ============================================================================== --- stable/8/sys/dev/esp/ncr53c9xreg.h Sun Jan 29 00:47:11 2012 (r230701) +++ stable/8/sys/dev/esp/ncr53c9xreg.h Sun Jan 29 00:47:14 2012 (r230702) @@ -31,6 +31,9 @@ /* $FreeBSD$ */ +#ifndef _NCR53C9XREG_H_ +#define _NCR53C9XREG_H_ + /* * Register addresses, relative to some base address */ @@ -288,3 +291,4 @@ #define NCRFAS_STAT2_OSHUTTLE 0x40 /* next byte from FIFO is MSB */ #define NCRFAS_STAT2_EMPTY 0x80 /* FIFO is empty */ +#endif /* _NCR53C9XREG_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:49:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37076106566C; Sun, 29 Jan 2012 00:49:13 +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 06F278FC13; Sun, 29 Jan 2012 00:49:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0nCWI008123; Sun, 29 Jan 2012 00:49:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0nCwk008121; Sun, 29 Jan 2012 00:49:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290049.q0T0nCwk008121@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230703 - stable/9/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:49:13 -0000 Author: marius Date: Sun Jan 29 00:49:12 2012 New Revision: 230703 URL: http://svn.freebsd.org/changeset/base/230703 Log: MFC: r227043 Sprinkle some const. Modified: stable/9/sys/dev/re/if_re.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/re/if_re.c ============================================================================== --- stable/9/sys/dev/re/if_re.c Sun Jan 29 00:47:14 2012 (r230702) +++ stable/9/sys/dev/re/if_re.c Sun Jan 29 00:49:12 2012 (r230703) @@ -171,7 +171,7 @@ TUNABLE_INT("hw.re.prefer_iomap", &prefe /* * Various supported device vendors/types and their names. */ -static struct rl_type re_devs[] = { +static const struct rl_type const re_devs[] = { { DLINK_VENDORID, DLINK_DEVICEID_528T, 0, "D-Link DGE-528(T) Gigabit Ethernet Adapter" }, { DLINK_VENDORID, DLINK_DEVICEID_530T_REVC, 0, @@ -194,8 +194,8 @@ static struct rl_type re_devs[] = { "US Robotics 997902 (RTL8169S) Gigabit Ethernet" } }; -static struct rl_hwrev re_hwrevs[] = { - { RL_HWREV_8139, RL_8139, "", RL_MTU }, +static const struct rl_hwrev const re_hwrevs[] = { + { RL_HWREV_8139, RL_8139, "", RL_MTU }, { RL_HWREV_8139A, RL_8139, "A", RL_MTU }, { RL_HWREV_8139AG, RL_8139, "A-G", RL_MTU }, { RL_HWREV_8139B, RL_8139, "B", RL_MTU }, @@ -869,7 +869,7 @@ re_diag(struct rl_softc *sc) device_printf(sc->rl_dev, "expected TX data: %6D/%6D/0x%x\n", dst, ":", src, ":", ETHERTYPE_IP); device_printf(sc->rl_dev, "received RX data: %6D/%6D/0x%x\n", - eh->ether_dhost, ":", eh->ether_shost, ":", + eh->ether_dhost, ":", eh->ether_shost, ":", ntohs(eh->ether_type)); device_printf(sc->rl_dev, "You may have a defective 32-bit " "NIC plugged into a 64-bit PCI slot.\n"); @@ -904,7 +904,7 @@ done: static int re_probe(device_t dev) { - struct rl_type *t; + const struct rl_type *t; uint16_t devid, vendor; uint16_t revid, sdevid; int i; @@ -1184,7 +1184,7 @@ re_attach(device_t dev) u_int16_t as[ETHER_ADDR_LEN / 2]; struct rl_softc *sc; struct ifnet *ifp; - struct rl_hwrev *hw_rev; + const struct rl_hwrev *hw_rev; u_int32_t cap, ctl; int hwrev; u_int16_t devid, re_did = 0; From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:49:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23A531065670; Sun, 29 Jan 2012 00:49:15 +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 0DF688FC08; Sun, 29 Jan 2012 00:49:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0nEXX008153; Sun, 29 Jan 2012 00:49:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0nEBB008151; Sun, 29 Jan 2012 00:49:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290049.q0T0nEBB008151@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230704 - stable/8/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:49:15 -0000 Author: marius Date: Sun Jan 29 00:49:14 2012 New Revision: 230704 URL: http://svn.freebsd.org/changeset/base/230704 Log: MFC: r227043 Sprinkle some const. Modified: stable/8/sys/dev/re/if_re.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Sun Jan 29 00:49:12 2012 (r230703) +++ stable/8/sys/dev/re/if_re.c Sun Jan 29 00:49:14 2012 (r230704) @@ -171,7 +171,7 @@ TUNABLE_INT("hw.re.prefer_iomap", &prefe /* * Various supported device vendors/types and their names. */ -static struct rl_type re_devs[] = { +static const struct rl_type const re_devs[] = { { DLINK_VENDORID, DLINK_DEVICEID_528T, 0, "D-Link DGE-528(T) Gigabit Ethernet Adapter" }, { DLINK_VENDORID, DLINK_DEVICEID_530T_REVC, 0, @@ -194,8 +194,8 @@ static struct rl_type re_devs[] = { "US Robotics 997902 (RTL8169S) Gigabit Ethernet" } }; -static struct rl_hwrev re_hwrevs[] = { - { RL_HWREV_8139, RL_8139, "", RL_MTU }, +static const struct rl_hwrev const re_hwrevs[] = { + { RL_HWREV_8139, RL_8139, "", RL_MTU }, { RL_HWREV_8139A, RL_8139, "A", RL_MTU }, { RL_HWREV_8139AG, RL_8139, "A-G", RL_MTU }, { RL_HWREV_8139B, RL_8139, "B", RL_MTU }, @@ -873,7 +873,7 @@ re_diag(struct rl_softc *sc) device_printf(sc->rl_dev, "expected TX data: %6D/%6D/0x%x\n", dst, ":", src, ":", ETHERTYPE_IP); device_printf(sc->rl_dev, "received RX data: %6D/%6D/0x%x\n", - eh->ether_dhost, ":", eh->ether_shost, ":", + eh->ether_dhost, ":", eh->ether_shost, ":", ntohs(eh->ether_type)); device_printf(sc->rl_dev, "You may have a defective 32-bit " "NIC plugged into a 64-bit PCI slot.\n"); @@ -908,7 +908,7 @@ done: static int re_probe(device_t dev) { - struct rl_type *t; + const struct rl_type *t; uint16_t devid, vendor; uint16_t revid, sdevid; int i; @@ -1188,7 +1188,7 @@ re_attach(device_t dev) u_int16_t as[ETHER_ADDR_LEN / 2]; struct rl_softc *sc; struct ifnet *ifp; - struct rl_hwrev *hw_rev; + const struct rl_hwrev *hw_rev; u_int32_t cap, ctl; int hwrev; u_int16_t devid, re_did = 0; From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:50:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06A9710656D7; Sun, 29 Jan 2012 00:50:42 +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 CA8FF8FC20; Sun, 29 Jan 2012 00:50:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0of1H008268; Sun, 29 Jan 2012 00:50:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0offU008266; Sun, 29 Jan 2012 00:50:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290050.q0T0offU008266@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:50:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230705 - stable/9/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:50:42 -0000 Author: marius Date: Sun Jan 29 00:50:41 2012 New Revision: 230705 URL: http://svn.freebsd.org/changeset/base/230705 Log: MFC: r227685 - There's no need to ignore the return value of mii_attach(9) when attaching dcphy(4) (CID 9283). - In dc_detach(), check whether ifp is NULL as dc_attach() may call the former without ifp being allocated (CID 4288). Found with: Coverity Prevent(tm) Modified: stable/9/sys/dev/dc/if_dc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/dc/if_dc.c ============================================================================== --- stable/9/sys/dev/dc/if_dc.c Sun Jan 29 00:49:14 2012 (r230704) +++ stable/9/sys/dev/dc/if_dc.c Sun Jan 29 00:50:41 2012 (r230705) @@ -2452,9 +2452,6 @@ dc_attach(device_t dev) if (sc->dc_pmode != DC_PMODE_SIA) sc->dc_pmode = DC_PMODE_SYM; sc->dc_flags |= DC_21143_NWAY; - mii_attach(dev, &sc->dc_miibus, ifp, dc_ifmedia_upd, - dc_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, - MII_OFFSET_ANY, 0); /* * For non-MII cards, we need to have the 21143 * drive the LEDs. Except there are some systems @@ -2465,7 +2462,9 @@ dc_attach(device_t dev) if (!(pci_get_subvendor(dev) == 0x1033 && pci_get_subdevice(dev) == 0x8028)) sc->dc_flags |= DC_TULIP_LEDS; - error = 0; + error = mii_attach(dev, &sc->dc_miibus, ifp, dc_ifmedia_upd, + dc_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0); } if (error) { @@ -2534,7 +2533,7 @@ dc_detach(device_t dev) ifp = sc->dc_ifp; #ifdef DEVICE_POLLING - if (ifp->if_capenable & IFCAP_POLLING) + if (ifp != NULL && ifp->if_capenable & IFCAP_POLLING) ether_poll_deregister(ifp); #endif @@ -2558,7 +2557,7 @@ dc_detach(device_t dev) if (sc->dc_res) bus_release_resource(dev, DC_RES, DC_RID, sc->dc_res); - if (ifp) + if (ifp != NULL) if_free(ifp); dc_dma_free(sc); @@ -2608,7 +2607,6 @@ dc_list_tx_init(struct dc_softc *sc) return (0); } - /* * Initialize the RX descriptors and allocate mbufs for them. Note that * we arrange the descriptors in a closed ring, so that the last descriptor From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:50:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FBE510656DA; Sun, 29 Jan 2012 00:50:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 007538FC13; Sun, 29 Jan 2012 00:50:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0ooTd008308; Sun, 29 Jan 2012 00:50:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0oos0008306; Sun, 29 Jan 2012 00:50:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290050.q0T0oos0008306@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230706 - stable/8/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:50:51 -0000 Author: marius Date: Sun Jan 29 00:50:50 2012 New Revision: 230706 URL: http://svn.freebsd.org/changeset/base/230706 Log: MFC: r227685 - There's no need to ignore the return value of mii_attach(9) when attaching dcphy(4) (CID 9283). - In dc_detach(), check whether ifp is NULL as dc_attach() may call the former without ifp being allocated (CID 4288). Found with: Coverity Prevent(tm) Modified: stable/8/sys/dev/dc/if_dc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/dc/if_dc.c ============================================================================== --- stable/8/sys/dev/dc/if_dc.c Sun Jan 29 00:50:41 2012 (r230705) +++ stable/8/sys/dev/dc/if_dc.c Sun Jan 29 00:50:50 2012 (r230706) @@ -2456,9 +2456,6 @@ dc_attach(device_t dev) if (sc->dc_pmode != DC_PMODE_SIA) sc->dc_pmode = DC_PMODE_SYM; sc->dc_flags |= DC_21143_NWAY; - mii_attach(dev, &sc->dc_miibus, ifp, dc_ifmedia_upd, - dc_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, - MII_OFFSET_ANY, 0); /* * For non-MII cards, we need to have the 21143 * drive the LEDs. Except there are some systems @@ -2469,7 +2466,9 @@ dc_attach(device_t dev) if (!(pci_get_subvendor(dev) == 0x1033 && pci_get_subdevice(dev) == 0x8028)) sc->dc_flags |= DC_TULIP_LEDS; - error = 0; + error = mii_attach(dev, &sc->dc_miibus, ifp, dc_ifmedia_upd, + dc_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0); } if (error) { @@ -2538,7 +2537,7 @@ dc_detach(device_t dev) ifp = sc->dc_ifp; #ifdef DEVICE_POLLING - if (ifp->if_capenable & IFCAP_POLLING) + if (ifp != NULL && ifp->if_capenable & IFCAP_POLLING) ether_poll_deregister(ifp); #endif @@ -2562,7 +2561,7 @@ dc_detach(device_t dev) if (sc->dc_res) bus_release_resource(dev, DC_RES, DC_RID, sc->dc_res); - if (ifp) + if (ifp != NULL) if_free(ifp); dc_dma_free(sc); @@ -2612,7 +2611,6 @@ dc_list_tx_init(struct dc_softc *sc) return (0); } - /* * Initialize the RX descriptors and allocate mbufs for them. Note that * we arrange the descriptors in a closed ring, so that the last descriptor From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:52:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DF5C106566C; Sun, 29 Jan 2012 00:52:05 +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 3D9158FC0C; Sun, 29 Jan 2012 00:52:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0q5ae008414; Sun, 29 Jan 2012 00:52:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0q5Qo008411; Sun, 29 Jan 2012 00:52:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290052.q0T0q5Qo008411@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230707 - stable/9/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:52:05 -0000 Author: marius Date: Sun Jan 29 00:52:04 2012 New Revision: 230707 URL: http://svn.freebsd.org/changeset/base/230707 Log: MFC: r227686 There's no need to read DC_10BTSTAT twice in dcphy_status(). Modified: stable/9/sys/dev/dc/dcphy.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/dc/dcphy.c ============================================================================== --- stable/9/sys/dev/dc/dcphy.c Sun Jan 29 00:50:50 2012 (r230706) +++ stable/9/sys/dev/dc/dcphy.c Sun Jan 29 00:52:04 2012 (r230707) @@ -294,7 +294,7 @@ static void dcphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; - int reg, anlpar, tstat = 0; + int anlpar, tstat; struct dc_softc *dc_sc; dc_sc = mii->mii_ifp->if_softc; @@ -305,13 +305,12 @@ dcphy_status(struct mii_softc *sc) if ((mii->mii_ifp->if_flags & IFF_UP) == 0) return; - reg = CSR_READ_4(dc_sc, DC_10BTSTAT); - if (!(reg & DC_TSTAT_LS10) || !(reg & DC_TSTAT_LS100)) + tstat = CSR_READ_4(dc_sc, DC_10BTSTAT); + if (!(tstat & DC_TSTAT_LS10) || !(tstat & DC_TSTAT_LS100)) mii->mii_media_status |= IFM_ACTIVE; if (CSR_READ_4(dc_sc, DC_10BTCTRL) & DC_TCTL_AUTONEGENBL) { /* Erg, still trying, I guess... */ - tstat = CSR_READ_4(dc_sc, DC_10BTSTAT); if ((tstat & DC_TSTAT_ANEGSTAT) != DC_ASTAT_AUTONEGCMP) { if ((DC_IS_MACRONIX(dc_sc) || DC_IS_PNICII(dc_sc)) && (tstat & DC_TSTAT_ANEGSTAT) == DC_ASTAT_DISABLE) @@ -351,9 +350,9 @@ dcphy_status(struct mii_softc *sc) * and hope that the user is clever enough to manually * change the media settings if we're wrong. */ - if (!(reg & DC_TSTAT_LS100)) + if (!(tstat & DC_TSTAT_LS100)) mii->mii_media_active |= IFM_100_TX | IFM_HDX; - else if (!(reg & DC_TSTAT_LS10)) + else if (!(tstat & DC_TSTAT_LS10)) mii->mii_media_active |= IFM_10_T | IFM_HDX; else mii->mii_media_active |= IFM_NONE; From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:52:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A181C1065670; Sun, 29 Jan 2012 00:52:08 +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 70ABB8FC12; Sun, 29 Jan 2012 00:52:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T0q8U7008450; Sun, 29 Jan 2012 00:52:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T0q8UC008448; Sun, 29 Jan 2012 00:52:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290052.q0T0q8UC008448@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230708 - stable/8/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:52:08 -0000 Author: marius Date: Sun Jan 29 00:52:07 2012 New Revision: 230708 URL: http://svn.freebsd.org/changeset/base/230708 Log: MFC: r227686 There's no need to read DC_10BTSTAT twice in dcphy_status(). Modified: stable/8/sys/dev/dc/dcphy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/dc/dcphy.c ============================================================================== --- stable/8/sys/dev/dc/dcphy.c Sun Jan 29 00:52:04 2012 (r230707) +++ stable/8/sys/dev/dc/dcphy.c Sun Jan 29 00:52:07 2012 (r230708) @@ -303,7 +303,7 @@ static void dcphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; - int reg, anlpar, tstat = 0; + int anlpar, tstat; struct dc_softc *dc_sc; dc_sc = mii->mii_ifp->if_softc; @@ -314,13 +314,12 @@ dcphy_status(struct mii_softc *sc) if ((mii->mii_ifp->if_flags & IFF_UP) == 0) return; - reg = CSR_READ_4(dc_sc, DC_10BTSTAT); - if (!(reg & DC_TSTAT_LS10) || !(reg & DC_TSTAT_LS100)) + tstat = CSR_READ_4(dc_sc, DC_10BTSTAT); + if (!(tstat & DC_TSTAT_LS10) || !(tstat & DC_TSTAT_LS100)) mii->mii_media_status |= IFM_ACTIVE; if (CSR_READ_4(dc_sc, DC_10BTCTRL) & DC_TCTL_AUTONEGENBL) { /* Erg, still trying, I guess... */ - tstat = CSR_READ_4(dc_sc, DC_10BTSTAT); if ((tstat & DC_TSTAT_ANEGSTAT) != DC_ASTAT_AUTONEGCMP) { if ((DC_IS_MACRONIX(dc_sc) || DC_IS_PNICII(dc_sc)) && (tstat & DC_TSTAT_ANEGSTAT) == DC_ASTAT_DISABLE) @@ -360,9 +359,9 @@ dcphy_status(struct mii_softc *sc) * and hope that the user is clever enough to manually * change the media settings if we're wrong. */ - if (!(reg & DC_TSTAT_LS100)) + if (!(tstat & DC_TSTAT_LS100)) mii->mii_media_active |= IFM_100_TX | IFM_HDX; - else if (!(reg & DC_TSTAT_LS10)) + else if (!(tstat & DC_TSTAT_LS10)) mii->mii_media_active |= IFM_10_T | IFM_HDX; else mii->mii_media_active |= IFM_NONE; From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 01:00:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4F091065670; Sun, 29 Jan 2012 01:00:11 +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 90F0F8FC18; Sun, 29 Jan 2012 01:00:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T10B2B008799; Sun, 29 Jan 2012 01:00:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T10BR7008797; Sun, 29 Jan 2012 01:00:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290100.q0T10BR7008797@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 01:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230709 - stable/9/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 01:00:12 -0000 Author: marius Date: Sun Jan 29 01:00:11 2012 New Revision: 230709 URL: http://svn.freebsd.org/changeset/base/230709 Log: MFC: r227687, r228290 - Add a hint.miibus.X.phymask hint, allowing do individually exclude PHY addresses from being probed and attaching something including ukphy(4) to it. This is mainly necessarily for PHY switches that create duplicate or fake PHYs on the bus that can corrupt the PHY state when accessed or simply cause problems when ukphy(4) isolates the additional instances. - Change miibus(4) to be a hinted bus, allowing to add child devices via hints and to set their attach arguments (including for automatically probed PHYs). This is mainly needed for PHY switches that violate IEEE 802.3 and don't even implement the basic register set so we can't probe them automatically. However, the ability to alter the attach arguments for automatically probed PHYs is also useful as for example it allows to test (or tell a user to test) new variant of a PHY with a specific driver by letting an existing driver attach to it via manipulating the IDs without the need to touch the source code or to limit a Gigabit Ethernet PHY to only announce up to Fast Ethernet in order to save energy by limiting the capability mask. Generally, a driver has to be hinted via hint.phydrv.X.at="miibusY" and hint.phydrv.X.phyno="Z" (which already is sufficient to add phydrvX at miibusY at PHY address Z). Then optionally the following attach arguments additionally can be configured: hint.phydrv.X.id1 hint.phydrv.X.id2 hint.phydrv.X.capmask - Some minor cleanup. Reviewed by: adrian, ray Modified: stable/9/sys/dev/mii/mii.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/mii/mii.c ============================================================================== --- stable/9/sys/dev/mii/mii.c Sun Jan 29 00:52:07 2012 (r230708) +++ stable/9/sys/dev/mii/mii.c Sun Jan 29 01:00:11 2012 (r230709) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -57,18 +56,17 @@ MODULE_VERSION(miibus, 1); #include "miibus_if.h" -static int miibus_print_child(device_t dev, device_t child); -static int miibus_read_ivar(device_t dev, device_t child, int which, - uintptr_t *result); -static int miibus_child_location_str(device_t bus, device_t child, char *buf, - size_t buflen); -static int miibus_child_pnpinfo_str(device_t bus, device_t child, char *buf, - size_t buflen); -static int miibus_readreg(device_t, int, int); -static int miibus_writereg(device_t, int, int, int); -static void miibus_statchg(device_t); -static void miibus_linkchg(device_t); -static void miibus_mediainit(device_t); +static bus_child_location_str_t miibus_child_location_str; +static bus_child_pnpinfo_str_t miibus_child_pnpinfo_str; +static bus_hinted_child_t miibus_hinted_child; +static bus_print_child_t miibus_print_child; +static bus_read_ivar_t miibus_read_ivar; +static miibus_readreg_t miibus_readreg; +static miibus_statchg_t miibus_statchg; +static miibus_writereg_t miibus_writereg; +static miibus_linkchg_t miibus_linkchg; +static miibus_mediainit_t miibus_mediainit; + static unsigned char mii_bitreverse(unsigned char x); static device_method_t miibus_methods[] = { @@ -83,6 +81,7 @@ static device_method_t miibus_methods[] DEVMETHOD(bus_read_ivar, miibus_read_ivar), DEVMETHOD(bus_child_pnpinfo_str, miibus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, miibus_child_location_str), + DEVMETHOD(bus_hinted_child, miibus_hinted_child), /* MII interface */ DEVMETHOD(miibus_readreg, miibus_readreg), @@ -106,7 +105,8 @@ struct miibus_ivars { struct ifnet *ifp; ifm_change_cb_t ifmedia_upd; ifm_stat_cb_t ifmedia_sts; - int mii_flags; + u_int mii_flags; + u_int mii_offset; }; int @@ -128,7 +128,6 @@ miibus_attach(device_t dev) int i, nchildren; mii = device_get_softc(dev); - nchildren = 0; if (device_get_children(dev, &children, &nchildren) == 0) { for (i = 0; i < nchildren; i++) { ma = device_get_ivars(children[i]); @@ -200,7 +199,7 @@ miibus_read_ivar(device_t dev, device_t } static int -miibus_child_pnpinfo_str(device_t bus __unused, device_t child, char *buf, +miibus_child_pnpinfo_str(device_t dev __unused, device_t child, char *buf, size_t buflen) { struct mii_attach_args *ma; @@ -213,7 +212,7 @@ miibus_child_pnpinfo_str(device_t bus __ } static int -miibus_child_location_str(device_t bus __unused, device_t child, char *buf, +miibus_child_location_str(device_t dev __unused, device_t child, char *buf, size_t buflen) { struct mii_attach_args *ma; @@ -223,6 +222,60 @@ miibus_child_location_str(device_t bus _ return (0); } +static void +miibus_hinted_child(device_t dev, const char *name, int unit) +{ + struct miibus_ivars *ivars; + struct mii_attach_args *args, *ma; + device_t *children, phy; + int i, nchildren; + u_int val; + + if (resource_int_value(name, unit, "phyno", &val) != 0) + return; + if (device_get_children(dev, &children, &nchildren) != 0) + return; + ma = NULL; + for (i = 0; i < nchildren; i++) { + args = device_get_ivars(children[i]); + if (args->mii_phyno == val) { + ma = args; + break; + } + } + free(children, M_TEMP); + + /* + * Don't add a PHY that was automatically identified by having media + * in its BMSR twice, only allow to alter its attach arguments. + */ + if (ma == NULL) { + ma = malloc(sizeof(struct mii_attach_args), M_DEVBUF, + M_NOWAIT); + if (ma == NULL) + return; + phy = device_add_child(dev, name, unit); + if (phy == NULL) { + free(ma, M_DEVBUF); + return; + } + ivars = device_get_ivars(dev); + ma->mii_phyno = val; + ma->mii_offset = ivars->mii_offset++; + ma->mii_id1 = 0; + ma->mii_id2 = 0; + ma->mii_capmask = BMSR_DEFCAPMASK; + device_set_ivars(phy, ma); + } + + if (resource_int_value(name, unit, "id1", &val) == 0) + ma->mii_id1 = val; + if (resource_int_value(name, unit, "id2", &val) == 0) + ma->mii_id2 = val; + if (resource_int_value(name, unit, "capmask", &val) == 0) + ma->mii_capmask = val; +} + static int miibus_readreg(device_t dev, int phy, int reg) { @@ -306,9 +359,10 @@ mii_attach(device_t dev, device_t *miibu int phyloc, int offloc, int flags) { struct miibus_ivars *ivars; - struct mii_attach_args ma, *args; + struct mii_attach_args *args, ma; device_t *children, phy; - int bmsr, first, i, nchildren, offset, phymax, phymin, rv; + int bmsr, first, i, nchildren, phymax, phymin, rv; + uint32_t phymask; if (phyloc != MII_PHY_ANY && offloc != MII_OFFSET_ANY) { printf("%s: phyloc and offloc specified\n", __func__); @@ -365,27 +419,30 @@ mii_attach(device_t dev, device_t *miibu ma.mii_capmask = capmask; - phy = NULL; - offset = 0; + if (resource_int_value(device_get_name(*miibus), + device_get_unit(*miibus), "phymask", &phymask) != 0) + phymask = 0xffffffff; + + if (device_get_children(*miibus, &children, &nchildren) != 0) { + children = NULL; + nchildren = 0; + } + ivars->mii_offset = 0; for (ma.mii_phyno = phymin; ma.mii_phyno <= phymax; ma.mii_phyno++) { /* * Make sure we haven't already configured a PHY at this * address. This allows mii_attach() to be called * multiple times. */ - if (device_get_children(*miibus, &children, &nchildren) == 0) { - for (i = 0; i < nchildren; i++) { - args = device_get_ivars(children[i]); - if (args->mii_phyno == ma.mii_phyno) { - /* - * Yes, there is already something - * configured at this address. - */ - free(children, M_TEMP); - goto skip; - } + for (i = 0; i < nchildren; i++) { + args = device_get_ivars(children[i]); + if (args->mii_phyno == ma.mii_phyno) { + /* + * Yes, there is already something + * configured at this address. + */ + goto skip; } - free(children, M_TEMP); } /* @@ -404,18 +461,24 @@ mii_attach(device_t dev, device_t *miibu * There is a PHY at this address. If we were given an * `offset' locator, skip this PHY if it doesn't match. */ - if (offloc != MII_OFFSET_ANY && offloc != offset) + if (offloc != MII_OFFSET_ANY && offloc != ivars->mii_offset) goto skip; /* - * Extract the IDs. Braindead PHYs will be handled by + * Skip this PHY if it's not included in the phymask hint. + */ + if ((phymask & (1 << ma.mii_phyno)) == 0) + goto skip; + + /* + * Extract the IDs. Braindead PHYs will be handled by * the `ukphy' driver, as we have no ID information to * match on. */ ma.mii_id1 = MIIBUS_READREG(dev, ma.mii_phyno, MII_PHYIDR1); ma.mii_id2 = MIIBUS_READREG(dev, ma.mii_phyno, MII_PHYIDR2); - ma.mii_offset = offset; + ma.mii_offset = ivars->mii_offset; args = malloc(sizeof(struct mii_attach_args), M_DEVBUF, M_NOWAIT); if (args == NULL) @@ -428,11 +491,20 @@ mii_attach(device_t dev, device_t *miibu } device_set_ivars(phy, args); skip: - offset++; + ivars->mii_offset++; } + free(children, M_TEMP); if (first != 0) { - if (phy == NULL) { + rv = device_set_driver(*miibus, &miibus_driver); + if (rv != 0) + goto fail; + bus_enumerate_hinted_children(*miibus); + rv = device_get_children(*miibus, &children, &nchildren); + if (rv != 0) + goto fail; + free(children, M_TEMP); + if (nchildren == 0) { rv = ENXIO; goto fail; } @@ -551,7 +623,7 @@ mii_down(struct mii_data *mii) static unsigned char mii_bitreverse(unsigned char x) { - unsigned const char const nibbletab[16] = { + static unsigned const char const nibbletab[16] = { 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 }; From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 01:00:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2475B1065672; Sun, 29 Jan 2012 01:00:17 +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 E281F8FC1D; Sun, 29 Jan 2012 01:00:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T10Grc008839; Sun, 29 Jan 2012 01:00:16 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T10GhE008837; Sun, 29 Jan 2012 01:00:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290100.q0T10GhE008837@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 01:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230710 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 01:00:17 -0000 Author: marius Date: Sun Jan 29 01:00:16 2012 New Revision: 230710 URL: http://svn.freebsd.org/changeset/base/230710 Log: MFC: r227687, r228290 (partial) - Add a hint.miibus.X.phymask hint, allowing do individually exclude PHY addresses from being probed and attaching something including ukphy(4) to it. This is mainly necessarily for PHY switches that create duplicate or fake PHYs on the bus that can corrupt the PHY state when accessed or simply cause problems when ukphy(4) isolates the additional instances. - Change miibus(4) to be a hinted bus, allowing to add child devices via hints and to set their attach arguments (including for automatically probed PHYs). This is mainly needed for PHY switches that violate IEEE 802.3 and don't even implement the basic register set so we can't probe them automatically. However, the ability to alter the attach arguments for automatically probed PHYs is also useful as for example it allows to test (or tell a user to test) new variant of a PHY with a specific driver by letting an existing driver attach to it via manipulating the IDs without the need to touch the source code or to limit a Gigabit Ethernet PHY to only announce up to Fast Ethernet in order to save energy by limiting the capability mask. Generally, a driver has to be hinted via hint.phydrv.X.at="miibusY" and hint.phydrv.X.phyno="Z" (which already is sufficient to add phydrvX at miibusY at PHY address Z). Then optionally the following attach arguments additionally can be configured: hint.phydrv.X.id1 hint.phydrv.X.id2 hint.phydrv.X.capmask - Some minor cleanup. Reviewed by: adrian, ray Modified: stable/8/sys/dev/mii/mii.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mii/mii.c ============================================================================== --- stable/8/sys/dev/mii/mii.c Sun Jan 29 01:00:11 2012 (r230709) +++ stable/8/sys/dev/mii/mii.c Sun Jan 29 01:00:16 2012 (r230710) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -57,18 +56,17 @@ MODULE_VERSION(miibus, 1); #include "miibus_if.h" -static int miibus_print_child(device_t dev, device_t child); -static int miibus_read_ivar(device_t dev, device_t child, int which, - uintptr_t *result); -static int miibus_child_location_str(device_t bus, device_t child, char *buf, - size_t buflen); -static int miibus_child_pnpinfo_str(device_t bus, device_t child, char *buf, - size_t buflen); -static int miibus_readreg(device_t, int, int); -static int miibus_writereg(device_t, int, int, int); -static void miibus_statchg(device_t); -static void miibus_linkchg(device_t); -static void miibus_mediainit(device_t); +static bus_child_location_str_t miibus_child_location_str; +static bus_child_pnpinfo_str_t miibus_child_pnpinfo_str; +static bus_hinted_child_t miibus_hinted_child; +static bus_print_child_t miibus_print_child; +static bus_read_ivar_t miibus_read_ivar; +static miibus_readreg_t miibus_readreg; +static miibus_statchg_t miibus_statchg; +static miibus_writereg_t miibus_writereg; +static miibus_linkchg_t miibus_linkchg; +static miibus_mediainit_t miibus_mediainit; + static device_method_t miibus_methods[] = { /* device interface */ @@ -83,6 +81,7 @@ static device_method_t miibus_methods[] DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_child_pnpinfo_str, miibus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, miibus_child_location_str), + DEVMETHOD(bus_hinted_child, miibus_hinted_child), /* MII interface */ DEVMETHOD(miibus_readreg, miibus_readreg), @@ -106,7 +105,8 @@ struct miibus_ivars { struct ifnet *ifp; ifm_change_cb_t ifmedia_upd; ifm_stat_cb_t ifmedia_sts; - int mii_flags; + u_int mii_flags; + u_int mii_offset; }; int @@ -128,7 +128,6 @@ miibus_attach(device_t dev) int i, nchildren; mii = device_get_softc(dev); - nchildren = 0; if (device_get_children(dev, &children, &nchildren) == 0) { for (i = 0; i < nchildren; i++) { ma = device_get_ivars(children[i]); @@ -200,7 +199,7 @@ miibus_read_ivar(device_t dev, device_t } static int -miibus_child_pnpinfo_str(device_t bus __unused, device_t child, char *buf, +miibus_child_pnpinfo_str(device_t dev __unused, device_t child, char *buf, size_t buflen) { struct mii_attach_args *ma; @@ -213,7 +212,7 @@ miibus_child_pnpinfo_str(device_t bus __ } static int -miibus_child_location_str(device_t bus __unused, device_t child, char *buf, +miibus_child_location_str(device_t dev __unused, device_t child, char *buf, size_t buflen) { struct mii_attach_args *ma; @@ -223,6 +222,60 @@ miibus_child_location_str(device_t bus _ return (0); } +static void +miibus_hinted_child(device_t dev, const char *name, int unit) +{ + struct miibus_ivars *ivars; + struct mii_attach_args *args, *ma; + device_t *children, phy; + int i, nchildren; + u_int val; + + if (resource_int_value(name, unit, "phyno", &val) != 0) + return; + if (device_get_children(dev, &children, &nchildren) != 0) + return; + ma = NULL; + for (i = 0; i < nchildren; i++) { + args = device_get_ivars(children[i]); + if (args->mii_phyno == val) { + ma = args; + break; + } + } + free(children, M_TEMP); + + /* + * Don't add a PHY that was automatically identified by having media + * in its BMSR twice, only allow to alter its attach arguments. + */ + if (ma == NULL) { + ma = malloc(sizeof(struct mii_attach_args), M_DEVBUF, + M_NOWAIT); + if (ma == NULL) + return; + phy = device_add_child(dev, name, unit); + if (phy == NULL) { + free(ma, M_DEVBUF); + return; + } + ivars = device_get_ivars(dev); + ma->mii_phyno = val; + ma->mii_offset = ivars->mii_offset++; + ma->mii_id1 = 0; + ma->mii_id2 = 0; + ma->mii_capmask = BMSR_DEFCAPMASK; + device_set_ivars(phy, ma); + } + + if (resource_int_value(name, unit, "id1", &val) == 0) + ma->mii_id1 = val; + if (resource_int_value(name, unit, "id2", &val) == 0) + ma->mii_id2 = val; + if (resource_int_value(name, unit, "capmask", &val) == 0) + ma->mii_capmask = val; +} + static int miibus_readreg(device_t dev, int phy, int reg) { @@ -317,9 +370,10 @@ mii_attach(device_t dev, device_t *miibu int phyloc, int offloc, int flags) { struct miibus_ivars *ivars; - struct mii_attach_args ma, *args; + struct mii_attach_args *args, ma; device_t *children, phy; - int bmsr, first, i, nchildren, offset, phymax, phymin, rv; + int bmsr, first, i, nchildren, phymax, phymin, rv; + uint32_t phymask; if (phyloc != MII_PHY_ANY && offloc != MII_OFFSET_ANY) { printf("%s: phyloc and offloc specified\n", __func__); @@ -376,27 +430,30 @@ mii_attach(device_t dev, device_t *miibu ma.mii_capmask = capmask; - phy = NULL; - offset = 0; + if (resource_int_value(device_get_name(*miibus), + device_get_unit(*miibus), "phymask", &phymask) != 0) + phymask = 0xffffffff; + + if (device_get_children(*miibus, &children, &nchildren) != 0) { + children = NULL; + nchildren = 0; + } + ivars->mii_offset = 0; for (ma.mii_phyno = phymin; ma.mii_phyno <= phymax; ma.mii_phyno++) { /* * Make sure we haven't already configured a PHY at this * address. This allows mii_attach() to be called * multiple times. */ - if (device_get_children(*miibus, &children, &nchildren) == 0) { - for (i = 0; i < nchildren; i++) { - args = device_get_ivars(children[i]); - if (args->mii_phyno == ma.mii_phyno) { - /* - * Yes, there is already something - * configured at this address. - */ - free(children, M_TEMP); - goto skip; - } + for (i = 0; i < nchildren; i++) { + args = device_get_ivars(children[i]); + if (args->mii_phyno == ma.mii_phyno) { + /* + * Yes, there is already something + * configured at this address. + */ + goto skip; } - free(children, M_TEMP); } /* @@ -415,11 +472,17 @@ mii_attach(device_t dev, device_t *miibu * There is a PHY at this address. If we were given an * `offset' locator, skip this PHY if it doesn't match. */ - if (offloc != MII_OFFSET_ANY && offloc != offset) + if (offloc != MII_OFFSET_ANY && offloc != ivars->mii_offset) goto skip; /* - * Extract the IDs. Braindead PHYs will be handled by + * Skip this PHY if it's not included in the phymask hint. + */ + if ((phymask & (1 << ma.mii_phyno)) == 0) + goto skip; + + /* + * Extract the IDs. Braindead PHYs will be handled by * the `ukphy' driver, as we have no ID information to * match on. */ @@ -438,11 +501,20 @@ mii_attach(device_t dev, device_t *miibu } device_set_ivars(phy, args); skip: - offset++; + ivars->mii_offset++; } + free(children, M_TEMP); if (first != 0) { - if (phy == NULL) { + rv = device_set_driver(*miibus, &miibus_driver); + if (rv != 0) + goto fail; + bus_enumerate_hinted_children(*miibus); + rv = device_get_children(*miibus, &children, &nchildren); + if (rv != 0) + goto fail; + free(children, M_TEMP); + if (nchildren == 0) { rv = ENXIO; goto fail; } From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 01:01:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0D33106566B; Sun, 29 Jan 2012 01:01:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A090B8FC0C; Sun, 29 Jan 2012 01:01:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T11X9o008944; Sun, 29 Jan 2012 01:01:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T11W1U008941; Sun, 29 Jan 2012 01:01:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290101.q0T11W1U008941@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 01:01:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230711 - stable/9/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 01:01:33 -0000 Author: marius Date: Sun Jan 29 01:01:32 2012 New Revision: 230711 URL: http://svn.freebsd.org/changeset/base/230711 Log: MFC: r227688 There's no need export the device interface methods of miibus(4). Modified: stable/9/sys/dev/mii/mii.c stable/9/sys/dev/mii/miivar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/mii/mii.c ============================================================================== --- stable/9/sys/dev/mii/mii.c Sun Jan 29 01:00:16 2012 (r230710) +++ stable/9/sys/dev/mii/mii.c Sun Jan 29 01:01:32 2012 (r230711) @@ -56,10 +56,13 @@ MODULE_VERSION(miibus, 1); #include "miibus_if.h" +static device_attach_t miibus_attach; static bus_child_location_str_t miibus_child_location_str; static bus_child_pnpinfo_str_t miibus_child_pnpinfo_str; +static device_detach_t miibus_detach; static bus_hinted_child_t miibus_hinted_child; static bus_print_child_t miibus_print_child; +static device_probe_t miibus_probe; static bus_read_ivar_t miibus_read_ivar; static miibus_readreg_t miibus_readreg; static miibus_statchg_t miibus_statchg; @@ -109,7 +112,7 @@ struct miibus_ivars { u_int mii_offset; }; -int +static int miibus_probe(device_t dev) { @@ -118,7 +121,7 @@ miibus_probe(device_t dev) return (BUS_PROBE_SPECIFIC); } -int +static int miibus_attach(device_t dev) { struct miibus_ivars *ivars; @@ -150,7 +153,7 @@ miibus_attach(device_t dev) return (bus_generic_attach(dev)); } -int +static int miibus_detach(device_t dev) { struct mii_data *mii; Modified: stable/9/sys/dev/mii/miivar.h ============================================================================== --- stable/9/sys/dev/mii/miivar.h Sun Jan 29 01:00:16 2012 (r230710) +++ stable/9/sys/dev/mii/miivar.h Sun Jan 29 01:01:32 2012 (r230711) @@ -246,10 +246,6 @@ MIIBUS_ACCESSOR(flags, FLAGS, u_int) extern devclass_t miibus_devclass; extern driver_t miibus_driver; -int miibus_probe(device_t); -int miibus_attach(device_t); -int miibus_detach(device_t); - int mii_attach(device_t, device_t *, struct ifnet *, ifm_change_cb_t, ifm_stat_cb_t, int, int, int, int); void mii_down(struct mii_data *); From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 01:01:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4C161065672; Sun, 29 Jan 2012 01:01:35 +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 B4A388FC13; Sun, 29 Jan 2012 01:01:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T11ZVl008978; Sun, 29 Jan 2012 01:01:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T11ZEN008975; Sun, 29 Jan 2012 01:01:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290101.q0T11ZEN008975@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 01:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230712 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 01:01:36 -0000 Author: marius Date: Sun Jan 29 01:01:35 2012 New Revision: 230712 URL: http://svn.freebsd.org/changeset/base/230712 Log: MFC: r227688 There's no need export the device interface methods of miibus(4). Modified: stable/8/sys/dev/mii/mii.c stable/8/sys/dev/mii/miivar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mii/mii.c ============================================================================== --- stable/8/sys/dev/mii/mii.c Sun Jan 29 01:01:32 2012 (r230711) +++ stable/8/sys/dev/mii/mii.c Sun Jan 29 01:01:35 2012 (r230712) @@ -56,10 +56,13 @@ MODULE_VERSION(miibus, 1); #include "miibus_if.h" +static device_attach_t miibus_attach; static bus_child_location_str_t miibus_child_location_str; static bus_child_pnpinfo_str_t miibus_child_pnpinfo_str; +static device_detach_t miibus_detach; static bus_hinted_child_t miibus_hinted_child; static bus_print_child_t miibus_print_child; +static device_probe_t miibus_probe; static bus_read_ivar_t miibus_read_ivar; static miibus_readreg_t miibus_readreg; static miibus_statchg_t miibus_statchg; @@ -109,7 +112,7 @@ struct miibus_ivars { u_int mii_offset; }; -int +static int miibus_probe(device_t dev) { @@ -118,7 +121,7 @@ miibus_probe(device_t dev) return (BUS_PROBE_SPECIFIC); } -int +static int miibus_attach(device_t dev) { struct miibus_ivars *ivars; @@ -150,7 +153,7 @@ miibus_attach(device_t dev) return (bus_generic_attach(dev)); } -int +static int miibus_detach(device_t dev) { struct mii_data *mii; Modified: stable/8/sys/dev/mii/miivar.h ============================================================================== --- stable/8/sys/dev/mii/miivar.h Sun Jan 29 01:01:32 2012 (r230711) +++ stable/8/sys/dev/mii/miivar.h Sun Jan 29 01:01:35 2012 (r230712) @@ -225,10 +225,6 @@ MIIBUS_ACCESSOR(flags, FLAGS, u_int) extern devclass_t miibus_devclass; extern driver_t miibus_driver; -int miibus_probe(device_t); -int miibus_attach(device_t); -int miibus_detach(device_t); - int mii_attach(device_t, device_t *, struct ifnet *, ifm_change_cb_t, ifm_stat_cb_t, int, int, int, int); int mii_anar(int); From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 01:22:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FD2A106566C; Sun, 29 Jan 2012 01:22:50 +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 E9C138FC18; Sun, 29 Jan 2012 01:22:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T1MnLH009763; Sun, 29 Jan 2012 01:22:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T1MmB3009708; Sun, 29 Jan 2012 01:22:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290122.q0T1MmB3009708@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 01:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230714 - in stable/8/sys: amd64/amd64 amd64/pci arm/mv arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 dev/aac dev/acpi_support dev/acpica dev/amr dev/arcmsr dev/bce dev/bfe dev/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 01:22:50 -0000 Author: marius Date: Sun Jan 29 01:22:48 2012 New Revision: 230714 URL: http://svn.freebsd.org/changeset/base/230714 Log: MFC: r227843 (partial) - There's no need to overwrite the default device method with the default one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID. Modified: stable/8/sys/amd64/amd64/legacy.c stable/8/sys/amd64/pci/pci_bus.c stable/8/sys/arm/mv/mv_pci.c stable/8/sys/arm/xscale/i80321/i80321_pci.c stable/8/sys/arm/xscale/i8134x/i81342_pci.c stable/8/sys/arm/xscale/ixp425/ixp425_pci.c stable/8/sys/dev/aac/aac_pci.c stable/8/sys/dev/acpi_support/acpi_wmi.c stable/8/sys/dev/acpica/acpi_cpu.c stable/8/sys/dev/acpica/acpi_isab.c stable/8/sys/dev/acpica/acpi_pcib_acpi.c stable/8/sys/dev/amr/amr_pci.c stable/8/sys/dev/arcmsr/arcmsr.c stable/8/sys/dev/bce/if_bce.c stable/8/sys/dev/bfe/if_bfe.c stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bm/if_bm.c stable/8/sys/dev/cas/if_cas.c stable/8/sys/dev/cxgb/cxgb_main.c stable/8/sys/dev/cxgbe/t4_main.c stable/8/sys/dev/dc/if_dc.c stable/8/sys/dev/eisa/eisaconf.c stable/8/sys/dev/et/if_et.c stable/8/sys/dev/fb/fb.c stable/8/sys/dev/firewire/firewire.c stable/8/sys/dev/firewire/fwohci_pci.c stable/8/sys/dev/gem/if_gem_pci.c stable/8/sys/dev/gem/if_gem_sbus.c stable/8/sys/dev/hifn/hifn7751.c stable/8/sys/dev/hme/if_hme_pci.c stable/8/sys/dev/hme/if_hme_sbus.c stable/8/sys/dev/ichsmb/ichsmb_pci.c stable/8/sys/dev/ida/ida_pci.c stable/8/sys/dev/if_ndis/if_ndis_usb.c stable/8/sys/dev/iicbus/iicbus.c stable/8/sys/dev/iicbus/iicsmb.c stable/8/sys/dev/lge/if_lge.c stable/8/sys/dev/mca/mca_bus.c stable/8/sys/dev/mfi/mfi_pci.c stable/8/sys/dev/mii/mii.c stable/8/sys/dev/mlx/mlx_pci.c stable/8/sys/dev/mps/mps_pci.c stable/8/sys/dev/msk/if_msk.c stable/8/sys/dev/nfe/if_nfe.c stable/8/sys/dev/nge/if_nge.c stable/8/sys/dev/nve/if_nve.c stable/8/sys/dev/pccbb/pccbb_isa.c stable/8/sys/dev/pccbb/pccbb_pci.c stable/8/sys/dev/pci/eisa_pci.c stable/8/sys/dev/pci/isa_pci.c stable/8/sys/dev/pci/pci_pci.c stable/8/sys/dev/pcn/if_pcn.c stable/8/sys/dev/ppbus/lpbb.c stable/8/sys/dev/puc/puc_pccard.c stable/8/sys/dev/puc/puc_pci.c stable/8/sys/dev/re/if_re.c stable/8/sys/dev/safe/safe.c stable/8/sys/dev/scc/scc_bfe_ebus.c stable/8/sys/dev/scc/scc_bfe_macio.c stable/8/sys/dev/scc/scc_bfe_quicc.c stable/8/sys/dev/scc/scc_bfe_sbus.c stable/8/sys/dev/sec/sec.c stable/8/sys/dev/sf/if_sf.c stable/8/sys/dev/sge/if_sge.c stable/8/sys/dev/siba/siba_pcib.c stable/8/sys/dev/sis/if_sis.c stable/8/sys/dev/sk/if_sk.c stable/8/sys/dev/smbus/smbus.c stable/8/sys/dev/sound/isa/gusc.c stable/8/sys/dev/sound/isa/sbc.c stable/8/sys/dev/sound/pci/csa.c stable/8/sys/dev/sound/pci/fm801.c stable/8/sys/dev/sound/usb/uaudio.c stable/8/sys/dev/spibus/spibus.c stable/8/sys/dev/ste/if_ste.c stable/8/sys/dev/tl/if_tl.c stable/8/sys/dev/twa/tw_osl_freebsd.c stable/8/sys/dev/twe/twe_freebsd.c stable/8/sys/dev/tws/tws.c stable/8/sys/dev/ubsec/ubsec.c stable/8/sys/dev/usb/controller/at91dci_atmelarm.c stable/8/sys/dev/usb/controller/atmegadci_atmelarm.c stable/8/sys/dev/usb/controller/ehci_ixp4xx.c stable/8/sys/dev/usb/controller/musb_otg_atmelarm.c stable/8/sys/dev/usb/controller/ohci_atmelarm.c stable/8/sys/dev/usb/controller/uss820dci_atmelarm.c stable/8/sys/dev/usb/controller/xhci_pci.c stable/8/sys/dev/usb/net/if_aue.c stable/8/sys/dev/usb/net/if_axe.c stable/8/sys/dev/usb/net/if_rue.c stable/8/sys/dev/usb/net/if_udav.c stable/8/sys/dev/vge/if_vge.c stable/8/sys/dev/vr/if_vr.c stable/8/sys/dev/wb/if_wb.c stable/8/sys/dev/xen/pcifront/pcifront.c stable/8/sys/dev/xl/if_xl.c stable/8/sys/i386/i386/legacy.c stable/8/sys/i386/pci/pci_bus.c stable/8/sys/isa/vga_isa.c stable/8/sys/mips/adm5120/admpci.c stable/8/sys/mips/atheros/apb.c stable/8/sys/mips/atheros/ar71xx_ehci.c stable/8/sys/mips/atheros/ar71xx_ohci.c stable/8/sys/mips/atheros/ar71xx_pci.c stable/8/sys/mips/atheros/if_arge.c stable/8/sys/mips/cavium/octopci.c stable/8/sys/mips/cavium/usb/octusb_octeon.c stable/8/sys/mips/idt/idtpci.c stable/8/sys/mips/idt/if_kr.c stable/8/sys/mips/malta/gt.c stable/8/sys/mips/malta/gt_pci.c stable/8/sys/mips/rmi/dev/nlge/if_nlge.c stable/8/sys/mips/rmi/dev/sec/rmisec.c stable/8/sys/mips/rmi/xlr_pci.c stable/8/sys/mips/rmi/xls_ehci.c stable/8/sys/pci/if_rl.c stable/8/sys/pci/intpm.c stable/8/sys/pci/viapm.c stable/8/sys/powerpc/aim/nexus.c stable/8/sys/powerpc/mpc85xx/nexus.c stable/8/sys/powerpc/ofw/ofw_cpu.c stable/8/sys/powerpc/ofw/ofw_pcib_pci.c stable/8/sys/powerpc/powermac/cpcht.c stable/8/sys/powerpc/powermac/cuda.c stable/8/sys/powerpc/powermac/grackle.c stable/8/sys/powerpc/powermac/pmu.c stable/8/sys/powerpc/powermac/uninorthpci.c stable/8/sys/sparc64/pci/fire.c stable/8/sys/sparc64/pci/psycho.c stable/8/sys/sparc64/pci/sbbc.c stable/8/sys/sparc64/pci/schizo.c stable/8/sys/x86/pci/qpi.c stable/8/sys/x86/x86/mptable_pci.c stable/8/sys/xen/xenstore/xenstore.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/legacy.c ============================================================================== --- stable/8/sys/amd64/amd64/legacy.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/amd64/amd64/legacy.c Sun Jan 29 01:22:48 2012 (r230714) @@ -236,19 +236,17 @@ static device_method_t cpu_methods[] = { /* Bus interface */ DEVMETHOD(bus_add_child, cpu_add_child), DEVMETHOD(bus_read_ivar, cpu_read_ivar), - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_get_resource_list, cpu_get_rlist), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - { 0, 0 } + DEVMETHOD_END }; static driver_t cpu_driver = { Modified: stable/8/sys/amd64/pci/pci_bus.c ============================================================================== --- stable/8/sys/amd64/pci/pci_bus.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/amd64/pci/pci_bus.c Sun Jan 29 01:22:48 2012 (r230714) @@ -345,7 +345,6 @@ static device_method_t legacy_pcib_metho DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar), DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource), @@ -367,7 +366,7 @@ static device_method_t legacy_pcib_metho DEVMETHOD(pcib_release_msix, pcib_release_msix), DEVMETHOD(pcib_map_msi, legacy_pcib_map_msi), - { 0, 0 } + DEVMETHOD_END }; static devclass_t hostb_devclass; Modified: stable/8/sys/arm/mv/mv_pci.c ============================================================================== --- stable/8/sys/arm/mv/mv_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/arm/mv/mv_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -151,7 +151,6 @@ static device_method_t pcib_mbus_methods DEVMETHOD(device_attach, pcib_mbus_attach), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, pcib_mbus_read_ivar), DEVMETHOD(bus_write_ivar, pcib_mbus_write_ivar), DEVMETHOD(bus_alloc_resource, pcib_mbus_alloc_resource), @@ -167,7 +166,7 @@ static device_method_t pcib_mbus_methods DEVMETHOD(pcib_write_config, pcib_mbus_write_config), DEVMETHOD(pcib_route_interrupt, pcib_route_interrupt), - { 0, 0 } + DEVMETHOD_END }; static driver_t pcib_mbus_driver = { Modified: stable/8/sys/arm/xscale/i80321/i80321_pci.c ============================================================================== --- stable/8/sys/arm/xscale/i80321/i80321_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/arm/xscale/i80321/i80321_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -373,7 +373,6 @@ static device_method_t i80321_pci_method DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, i80321_read_ivar), DEVMETHOD(bus_write_ivar, i80321_write_ivar), DEVMETHOD(bus_alloc_resource, i80321_pci_alloc_resource), @@ -389,7 +388,7 @@ static device_method_t i80321_pci_method DEVMETHOD(pcib_write_config, i80321_pci_write_config), DEVMETHOD(pcib_route_interrupt, machdep_pci_route_interrupt), - {0, 0} + DEVMETHOD_END }; static driver_t i80321_pci_driver = { Modified: stable/8/sys/arm/xscale/i8134x/i81342_pci.c ============================================================================== --- stable/8/sys/arm/xscale/i8134x/i81342_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/arm/xscale/i8134x/i81342_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -516,7 +516,6 @@ static device_method_t i81342_pci_method DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, i81342_read_ivar), DEVMETHOD(bus_write_ivar, i81342_write_ivar), DEVMETHOD(bus_alloc_resource, i81342_pci_alloc_resource), @@ -532,7 +531,7 @@ static device_method_t i81342_pci_method DEVMETHOD(pcib_write_config, i81342_pci_write_config), DEVMETHOD(pcib_route_interrupt, i81342_pci_route_interrupt), - {0, 0} + DEVMETHOD_END }; static driver_t i81342_pci_driver = { Modified: stable/8/sys/arm/xscale/ixp425/ixp425_pci.c ============================================================================== --- stable/8/sys/arm/xscale/ixp425/ixp425_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/arm/xscale/ixp425/ixp425_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -445,7 +445,6 @@ static device_method_t ixppcib_methods[] DEVMETHOD(device_attach, ixppcib_attach), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, ixppcib_read_ivar), DEVMETHOD(bus_write_ivar, ixppcib_write_ivar), DEVMETHOD(bus_setup_intr, ixppcib_setup_intr), @@ -462,7 +461,7 @@ static device_method_t ixppcib_methods[] DEVMETHOD(pcib_write_config, ixppcib_write_config), DEVMETHOD(pcib_route_interrupt, ixppcib_route_interrupt), - {0, 0}, + DEVMETHOD_END }; static driver_t ixppcib_driver = { Modified: stable/8/sys/dev/aac/aac_pci.c ============================================================================== --- stable/8/sys/dev/aac/aac_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/aac/aac_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -68,9 +68,7 @@ static device_method_t aac_methods[] = { DEVMETHOD(device_suspend, aac_suspend), DEVMETHOD(device_resume, aac_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - { 0, 0 } + DEVMETHOD_END }; static driver_t aac_pci_driver = { Modified: stable/8/sys/dev/acpi_support/acpi_wmi.c ============================================================================== --- stable/8/sys/dev/acpi_support/acpi_wmi.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/acpi_support/acpi_wmi.c Sun Jan 29 01:22:48 2012 (r230714) @@ -175,7 +175,6 @@ static device_method_t acpi_wmi_methods[ /* bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_print_child, bus_generic_print_child), /* acpi_wmi interface */ DEVMETHOD(acpi_wmi_provides_guid_string, @@ -189,7 +188,7 @@ static device_method_t acpi_wmi_methods[ DEVMETHOD(acpi_wmi_get_block, acpi_wmi_get_block_method), DEVMETHOD(acpi_wmi_set_block, acpi_wmi_set_block_method), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_wmi_driver = { Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/acpica/acpi_cpu.c Sun Jan 29 01:22:48 2012 (r230714) @@ -184,13 +184,12 @@ static device_method_t acpi_cpu_methods[ DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_cpu_driver = { Modified: stable/8/sys/dev/acpica/acpi_isab.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_isab.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/acpica/acpi_isab.c Sun Jan 29 01:22:48 2012 (r230714) @@ -68,7 +68,6 @@ static device_method_t acpi_isab_methods DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, acpi_isab_read_ivar), DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), @@ -77,7 +76,7 @@ static device_method_t acpi_isab_methods DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - {0, 0} + DEVMETHOD_END }; static driver_t acpi_isab_driver = { Modified: stable/8/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_pcib_acpi.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/acpica/acpi_pcib_acpi.c Sun Jan 29 01:22:48 2012 (r230714) @@ -97,7 +97,6 @@ static device_method_t acpi_pcib_acpi_me DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, acpi_pcib_read_ivar), DEVMETHOD(bus_write_ivar, acpi_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, acpi_pcib_acpi_alloc_resource), @@ -119,7 +118,7 @@ static device_method_t acpi_pcib_acpi_me DEVMETHOD(pcib_release_msix, pcib_release_msix), DEVMETHOD(pcib_map_msi, acpi_pcib_map_msi), - {0, 0} + DEVMETHOD_END }; static devclass_t pcib_devclass; Modified: stable/8/sys/dev/amr/amr_pci.c ============================================================================== --- stable/8/sys/dev/amr/amr_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/amr/amr_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -106,9 +106,7 @@ static device_method_t amr_methods[] = { DEVMETHOD(device_suspend, amr_pci_suspend), DEVMETHOD(device_resume, amr_pci_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - { 0, 0 } + DEVMETHOD_END }; static driver_t amr_pci_driver = { Modified: stable/8/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/arcmsr/arcmsr.c Sun Jan 29 01:22:48 2012 (r230714) @@ -70,8 +70,11 @@ ** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it ** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic ****************************************************************************************** -* $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); + #if 0 #define ARCMSR_DEBUG1 1 #endif @@ -223,9 +226,8 @@ static device_method_t arcmsr_methods[]= DEVMETHOD(device_shutdown, arcmsr_shutdown), DEVMETHOD(device_suspend, arcmsr_suspend), DEVMETHOD(device_resume, arcmsr_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - { 0, 0 } + + DEVMETHOD_END }; static driver_t arcmsr_driver={ Modified: stable/8/sys/dev/bce/if_bce.c ============================================================================== --- stable/8/sys/dev/bce/if_bce.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/bce/if_bce.c Sun Jan 29 01:22:48 2012 (r230714) @@ -455,10 +455,6 @@ static device_method_t bce_methods[] = { /* DEVMETHOD(device_resume, bce_resume), */ /* DEVMETHOD(device_quiesce, bce_quiesce), */ - /* Bus interface (bus_if.h) */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface (miibus_if.h) */ DEVMETHOD(miibus_readreg, bce_miibus_read_reg), DEVMETHOD(miibus_writereg, bce_miibus_write_reg), @@ -467,7 +463,7 @@ static device_method_t bce_methods[] = { /* DEVMETHOD(miibus_linkchg, bce_miibus_linkchg), */ /* DEVMETHOD(miibus_mediainit, bce_miibus_mediainit), */ - { 0, 0 } + DEVMETHOD_END }; static driver_t bce_driver = { Modified: stable/8/sys/dev/bfe/if_bfe.c ============================================================================== --- stable/8/sys/dev/bfe/if_bfe.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/bfe/if_bfe.c Sun Jan 29 01:22:48 2012 (r230714) @@ -137,16 +137,12 @@ static device_method_t bfe_methods[] = { DEVMETHOD(device_suspend, bfe_suspend), DEVMETHOD(device_resume, bfe_resume), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, bfe_miibus_readreg), DEVMETHOD(miibus_writereg, bfe_miibus_writereg), DEVMETHOD(miibus_statchg, bfe_miibus_statchg), - { 0, 0 } + DEVMETHOD_END }; static driver_t bfe_driver = { Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/bge/if_bge.c Sun Jan 29 01:22:48 2012 (r230714) @@ -493,16 +493,12 @@ static device_method_t bge_methods[] = { DEVMETHOD(device_suspend, bge_suspend), DEVMETHOD(device_resume, bge_resume), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, bge_miibus_readreg), DEVMETHOD(miibus_writereg, bge_miibus_writereg), DEVMETHOD(miibus_statchg, bge_miibus_statchg), - { 0, 0 } + DEVMETHOD_END }; static driver_t bge_driver = { Modified: stable/8/sys/dev/bm/if_bm.c ============================================================================== --- stable/8/sys/dev/bm/if_bm.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/bm/if_bm.c Sun Jan 29 01:22:48 2012 (r230714) @@ -135,15 +135,12 @@ static device_method_t bm_methods[] = { DEVMETHOD(device_detach, bm_detach), DEVMETHOD(device_shutdown, bm_shutdown), - /* bus interface, for miibus */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, bm_miibus_readreg), DEVMETHOD(miibus_writereg, bm_miibus_writereg), DEVMETHOD(miibus_statchg, bm_miibus_statchg), - { 0, 0 } + + DEVMETHOD_END }; static driver_t bm_macio_driver = { Modified: stable/8/sys/dev/cas/if_cas.c ============================================================================== --- stable/8/sys/dev/cas/if_cas.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/cas/if_cas.c Sun Jan 29 01:22:48 2012 (r230714) @@ -2606,16 +2606,12 @@ static device_method_t cas_pci_methods[] /* Use the suspend handler here, it is all that is required. */ DEVMETHOD(device_shutdown, cas_pci_suspend), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, cas_mii_readreg), DEVMETHOD(miibus_writereg, cas_mii_writereg), DEVMETHOD(miibus_statchg, cas_mii_statchg), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t cas_pci_driver = { Modified: stable/8/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_main.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/cxgb/cxgb_main.c Sun Jan 29 01:22:48 2012 (r230714) @@ -129,11 +129,7 @@ static device_method_t cxgb_controller_m DEVMETHOD(device_attach, cxgb_controller_attach), DEVMETHOD(device_detach, cxgb_controller_detach), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - - { 0, 0 } + DEVMETHOD_END }; static driver_t cxgb_controller_driver = { Modified: stable/8/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/8/sys/dev/cxgbe/t4_main.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/cxgbe/t4_main.c Sun Jan 29 01:22:48 2012 (r230714) @@ -73,11 +73,7 @@ static device_method_t t4_methods[] = { DEVMETHOD(device_attach, t4_attach), DEVMETHOD(device_detach, t4_detach), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - - { 0, 0 } + DEVMETHOD_END }; static driver_t t4_driver = { "t4nex", Modified: stable/8/sys/dev/dc/if_dc.c ============================================================================== --- stable/8/sys/dev/dc/if_dc.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/dc/if_dc.c Sun Jan 29 01:22:48 2012 (r230714) @@ -337,17 +337,13 @@ static device_method_t dc_methods[] = { DEVMETHOD(device_resume, dc_resume), DEVMETHOD(device_shutdown, dc_shutdown), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, dc_miibus_readreg), DEVMETHOD(miibus_writereg, dc_miibus_writereg), DEVMETHOD(miibus_statchg, dc_miibus_statchg), DEVMETHOD(miibus_mediainit, dc_miibus_mediainit), - { 0, 0 } + DEVMETHOD_END }; static driver_t dc_driver = { Modified: stable/8/sys/dev/eisa/eisaconf.c ============================================================================== --- stable/8/sys/dev/eisa/eisaconf.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/eisa/eisaconf.c Sun Jan 29 01:22:48 2012 (r230714) @@ -557,7 +557,6 @@ static device_method_t eisa_methods[] = DEVMETHOD(bus_probe_nomatch, eisa_probe_nomatch), DEVMETHOD(bus_read_ivar, eisa_read_ivar), DEVMETHOD(bus_write_ivar, eisa_write_ivar), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_alloc_resource, eisa_alloc_resource), DEVMETHOD(bus_release_resource, eisa_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), @@ -570,7 +569,7 @@ static device_method_t eisa_methods[] = DEVMETHOD(eisa_add_iospace, eisa_add_iospace_m), DEVMETHOD(eisa_add_mspace, eisa_add_mspace_m), - { 0, 0 } + DEVMETHOD_END }; static driver_t eisa_driver = { Modified: stable/8/sys/dev/et/if_et.c ============================================================================== --- stable/8/sys/dev/et/if_et.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/et/if_et.c Sun Jan 29 01:22:48 2012 (r230714) @@ -169,14 +169,11 @@ static device_method_t et_methods[] = { DEVMETHOD(device_suspend, et_suspend), DEVMETHOD(device_resume, et_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - DEVMETHOD(miibus_readreg, et_miibus_readreg), DEVMETHOD(miibus_writereg, et_miibus_writereg), DEVMETHOD(miibus_statchg, et_miibus_statchg), - { 0, 0 } + DEVMETHOD_END }; static driver_t et_driver = { Modified: stable/8/sys/dev/fb/fb.c ============================================================================== --- stable/8/sys/dev/fb/fb.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/fb/fb.c Sun Jan 29 01:22:48 2012 (r230714) @@ -315,8 +315,7 @@ static device_method_t fb_methods[] = { DEVMETHOD(device_probe, fbprobe), DEVMETHOD(device_attach, fbattach), - DEVMETHOD(bus_print_child, bus_generic_print_child), - { 0, 0 } + DEVMETHOD_END }; static driver_t fb_driver = { Modified: stable/8/sys/dev/firewire/firewire.c ============================================================================== --- stable/8/sys/dev/firewire/firewire.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/firewire/firewire.c Sun Jan 29 01:22:48 2012 (r230714) @@ -30,11 +30,11 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - * */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -128,9 +128,8 @@ static device_method_t firewire_methods[ /* Bus interface */ DEVMETHOD(bus_add_child, firewire_add_child), - DEVMETHOD(bus_print_child, bus_generic_print_child), - { 0, 0 } + DEVMETHOD_END }; char *linkspeed[] = { "S100", "S200", "S400", "S800", Modified: stable/8/sys/dev/firewire/fwohci_pci.c ============================================================================== --- stable/8/sys/dev/firewire/fwohci_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/firewire/fwohci_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -30,10 +30,11 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #define BOUNCE_BUFFER_TEST 0 #include @@ -536,9 +537,8 @@ static device_method_t fwohci_methods[] /* Bus interface */ DEVMETHOD(bus_add_child, fwohci_pci_add_child), - DEVMETHOD(bus_print_child, bus_generic_print_child), - { 0, 0 } + DEVMETHOD_END }; static driver_t fwohci_driver = { Modified: stable/8/sys/dev/gem/if_gem_pci.c ============================================================================== --- stable/8/sys/dev/gem/if_gem_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/gem/if_gem_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -82,16 +82,12 @@ static device_method_t gem_pci_methods[] /* Use the suspend handler here, it is all that is required. */ DEVMETHOD(device_shutdown, gem_pci_suspend), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, gem_mii_readreg), DEVMETHOD(miibus_writereg, gem_mii_writereg), DEVMETHOD(miibus_statchg, gem_mii_statchg), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t gem_pci_driver = { Modified: stable/8/sys/dev/gem/if_gem_sbus.c ============================================================================== --- stable/8/sys/dev/gem/if_gem_sbus.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/gem/if_gem_sbus.c Sun Jan 29 01:22:48 2012 (r230714) @@ -78,16 +78,12 @@ static device_method_t gem_sbus_methods[ /* Use the suspend handler here, it is all that is required. */ DEVMETHOD(device_shutdown, gem_sbus_suspend), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, gem_mii_readreg), DEVMETHOD(miibus_writereg, gem_mii_writereg), DEVMETHOD(miibus_statchg, gem_mii_statchg), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t gem_sbus_driver = { Modified: stable/8/sys/dev/hifn/hifn7751.c ============================================================================== --- stable/8/sys/dev/hifn/hifn7751.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/hifn/hifn7751.c Sun Jan 29 01:22:48 2012 (r230714) @@ -113,16 +113,12 @@ static device_method_t hifn_methods[] = DEVMETHOD(device_resume, hifn_resume), DEVMETHOD(device_shutdown, hifn_shutdown), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* crypto device methods */ DEVMETHOD(cryptodev_newsession, hifn_newsession), DEVMETHOD(cryptodev_freesession,hifn_freesession), DEVMETHOD(cryptodev_process, hifn_process), - { 0, 0 } + DEVMETHOD_END }; static driver_t hifn_driver = { "hifn", Modified: stable/8/sys/dev/hme/if_hme_pci.c ============================================================================== --- stable/8/sys/dev/hme/if_hme_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/hme/if_hme_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -93,16 +93,12 @@ static device_method_t hme_pci_methods[] /* Can just use the suspend method here. */ DEVMETHOD(device_shutdown, hme_pci_suspend), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, hme_mii_readreg), DEVMETHOD(miibus_writereg, hme_mii_writereg), DEVMETHOD(miibus_statchg, hme_mii_statchg), - { 0, 0 } + DEVMETHOD_END }; static driver_t hme_pci_driver = { Modified: stable/8/sys/dev/hme/if_hme_sbus.c ============================================================================== --- stable/8/sys/dev/hme/if_hme_sbus.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/hme/if_hme_sbus.c Sun Jan 29 01:22:48 2012 (r230714) @@ -95,16 +95,12 @@ static device_method_t hme_sbus_methods[ /* Can just use the suspend method here. */ DEVMETHOD(device_shutdown, hme_sbus_suspend), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, hme_mii_readreg), DEVMETHOD(miibus_writereg, hme_mii_writereg), DEVMETHOD(miibus_statchg, hme_mii_statchg), - { 0, 0 } + DEVMETHOD_END }; static driver_t hme_sbus_driver = { Modified: stable/8/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/8/sys/dev/ichsmb/ichsmb_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/ichsmb/ichsmb_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -103,9 +103,6 @@ static device_method_t ichsmb_pci_method DEVMETHOD(device_attach, ichsmb_pci_attach), DEVMETHOD(device_detach, ichsmb_detach), - /* Bus methods */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - /* SMBus methods */ DEVMETHOD(smbus_callback, ichsmb_callback), DEVMETHOD(smbus_quick, ichsmb_quick), @@ -118,7 +115,8 @@ static device_method_t ichsmb_pci_method DEVMETHOD(smbus_pcall, ichsmb_pcall), DEVMETHOD(smbus_bwrite, ichsmb_bwrite), DEVMETHOD(smbus_bread, ichsmb_bread), - { 0, 0 } + + DEVMETHOD_END }; static driver_t ichsmb_pci_driver = { Modified: stable/8/sys/dev/ida/ida_pci.c ============================================================================== --- stable/8/sys/dev/ida/ida_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/ida/ida_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -188,9 +188,7 @@ static device_method_t ida_pci_methods[] DEVMETHOD(device_attach, ida_pci_attach), DEVMETHOD(device_detach, ida_detach), - DEVMETHOD(bus_print_child, bus_generic_print_child), - - { 0, 0 } + DEVMETHOD_END }; static driver_t ida_pci_driver = { Modified: stable/8/sys/dev/if_ndis/if_ndis_usb.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis_usb.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/if_ndis/if_ndis_usb.c Sun Jan 29 01:22:48 2012 (r230714) @@ -91,11 +91,9 @@ static device_method_t ndis_methods[] = DEVMETHOD(device_shutdown, ndis_shutdown), /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_get_resource_list, ndis_get_resource_list), - { 0, 0 } + DEVMETHOD_END }; static driver_t ndis_driver = { Modified: stable/8/sys/dev/iicbus/iicbus.c ============================================================================== --- stable/8/sys/dev/iicbus/iicbus.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/iicbus/iicbus.c Sun Jan 29 01:22:48 2012 (r230714) @@ -245,7 +245,6 @@ static device_method_t iicbus_methods[] /* bus interface */ DEVMETHOD(bus_add_child, iicbus_add_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_print_child, iicbus_print_child), DEVMETHOD(bus_probe_nomatch, iicbus_probe_nomatch), DEVMETHOD(bus_read_ivar, iicbus_read_ivar), @@ -256,7 +255,7 @@ static device_method_t iicbus_methods[] /* iicbus interface */ DEVMETHOD(iicbus_transfer, iicbus_transfer), - { 0, 0 } + DEVMETHOD_END }; driver_t iicbus_driver = { Modified: stable/8/sys/dev/iicbus/iicsmb.c ============================================================================== --- stable/8/sys/dev/iicbus/iicsmb.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/iicbus/iicsmb.c Sun Jan 29 01:22:48 2012 (r230714) @@ -22,11 +22,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ - * */ +#include +__FBSDID("$FreeBSD$"); + /* * I2C to SMB bridge * @@ -106,10 +106,6 @@ static device_method_t iicsmb_methods[] DEVMETHOD(device_attach, iicsmb_attach), DEVMETHOD(device_detach, iicsmb_detach), - /* bus interface */ - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - DEVMETHOD(bus_print_child, bus_generic_print_child), - /* iicbus interface */ DEVMETHOD(iicbus_intr, iicsmb_intr), @@ -125,8 +121,8 @@ static device_method_t iicsmb_methods[] DEVMETHOD(smbus_pcall, iicsmb_pcall), DEVMETHOD(smbus_bwrite, iicsmb_bwrite), DEVMETHOD(smbus_bread, iicsmb_bread), - - { 0, 0 } + + DEVMETHOD_END }; static driver_t iicsmb_driver = { Modified: stable/8/sys/dev/lge/if_lge.c ============================================================================== --- stable/8/sys/dev/lge/if_lge.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/lge/if_lge.c Sun Jan 29 01:22:48 2012 (r230714) @@ -170,16 +170,12 @@ static device_method_t lge_methods[] = { DEVMETHOD(device_detach, lge_detach), DEVMETHOD(device_shutdown, lge_shutdown), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, lge_miibus_readreg), DEVMETHOD(miibus_writereg, lge_miibus_writereg), DEVMETHOD(miibus_statchg, lge_miibus_statchg), - { 0, 0 } + DEVMETHOD_END }; static driver_t lge_driver = { Modified: stable/8/sys/dev/mca/mca_bus.c ============================================================================== --- stable/8/sys/dev/mca/mca_bus.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/mca/mca_bus.c Sun Jan 29 01:22:48 2012 (r230714) @@ -507,7 +507,6 @@ static device_method_t mca_methods[] = { DEVMETHOD(bus_probe_nomatch, mca_probe_nomatch), DEVMETHOD(bus_read_ivar, mca_read_ivar), DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -520,7 +519,7 @@ static device_method_t mca_methods[] = { DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - { 0, 0 } + DEVMETHOD_END }; static driver_t mca_driver = { Modified: stable/8/sys/dev/mfi/mfi_pci.c ============================================================================== --- stable/8/sys/dev/mfi/mfi_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/mfi/mfi_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -93,9 +93,8 @@ static device_method_t mfi_methods[] = { DEVMETHOD(device_detach, mfi_pci_detach), DEVMETHOD(device_suspend, mfi_pci_suspend), DEVMETHOD(device_resume, mfi_pci_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - { 0, 0 } + + DEVMETHOD_END }; static driver_t mfi_pci_driver = { Modified: stable/8/sys/dev/mii/mii.c ============================================================================== --- stable/8/sys/dev/mii/mii.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/mii/mii.c Sun Jan 29 01:22:48 2012 (r230714) @@ -81,7 +81,6 @@ static device_method_t miibus_methods[] /* bus interface */ DEVMETHOD(bus_print_child, miibus_print_child), DEVMETHOD(bus_read_ivar, miibus_read_ivar), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_child_pnpinfo_str, miibus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, miibus_child_location_str), DEVMETHOD(bus_hinted_child, miibus_hinted_child), @@ -93,7 +92,7 @@ static device_method_t miibus_methods[] DEVMETHOD(miibus_linkchg, miibus_linkchg), DEVMETHOD(miibus_mediainit, miibus_mediainit), - { 0, 0 } + DEVMETHOD_END }; devclass_t miibus_devclass; Modified: stable/8/sys/dev/mlx/mlx_pci.c ============================================================================== --- stable/8/sys/dev/mlx/mlx_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/mlx/mlx_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -61,9 +61,7 @@ static device_method_t mlx_methods[] = { DEVMETHOD(device_suspend, mlx_suspend), DEVMETHOD(device_resume, mlx_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - { 0, 0 } + DEVMETHOD_END }; static driver_t mlx_pci_driver = { Modified: stable/8/sys/dev/mps/mps_pci.c ============================================================================== --- stable/8/sys/dev/mps/mps_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/mps/mps_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -78,9 +78,8 @@ static device_method_t mps_methods[] = { DEVMETHOD(device_detach, mps_pci_detach), DEVMETHOD(device_suspend, mps_pci_suspend), DEVMETHOD(device_resume, mps_pci_resume), - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - { 0, 0 } + + DEVMETHOD_END }; static driver_t mps_pci_driver = { Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/msk/if_msk.c Sun Jan 29 01:22:48 2012 (r230714) @@ -334,11 +334,7 @@ static device_method_t mskc_methods[] = DEVMETHOD(device_resume, mskc_resume), DEVMETHOD(device_shutdown, mskc_shutdown), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - - { NULL, NULL } + DEVMETHOD_END }; static driver_t mskc_driver = { @@ -356,16 +352,12 @@ static device_method_t msk_methods[] = { DEVMETHOD(device_detach, msk_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, msk_miibus_readreg), DEVMETHOD(miibus_writereg, msk_miibus_writereg), DEVMETHOD(miibus_statchg, msk_miibus_statchg), - { NULL, NULL } + DEVMETHOD_END }; static driver_t msk_driver = { Modified: stable/8/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/8/sys/dev/nfe/if_nfe.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/nfe/if_nfe.c Sun Jan 29 01:22:48 2012 (r230714) @@ -165,16 +165,12 @@ static device_method_t nfe_methods[] = { DEVMETHOD(device_resume, nfe_resume), DEVMETHOD(device_shutdown, nfe_shutdown), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, nfe_miibus_readreg), DEVMETHOD(miibus_writereg, nfe_miibus_writereg), DEVMETHOD(miibus_statchg, nfe_miibus_statchg), - { NULL, NULL } + DEVMETHOD_END }; static driver_t nfe_driver = { Modified: stable/8/sys/dev/nge/if_nge.c ============================================================================== --- stable/8/sys/dev/nge/if_nge.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/nge/if_nge.c Sun Jan 29 01:22:48 2012 (r230714) @@ -223,16 +223,12 @@ static device_method_t nge_methods[] = { DEVMETHOD(device_suspend, nge_suspend), DEVMETHOD(device_resume, nge_resume), - /* bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, nge_miibus_readreg), DEVMETHOD(miibus_writereg, nge_miibus_writereg), DEVMETHOD(miibus_statchg, nge_miibus_statchg), - { NULL, NULL } + DEVMETHOD_END }; static driver_t nge_driver = { Modified: stable/8/sys/dev/nve/if_nve.c ============================================================================== --- stable/8/sys/dev/nve/if_nve.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/nve/if_nve.c Sun Jan 29 01:22:48 2012 (r230714) @@ -184,15 +184,11 @@ static device_method_t nve_methods[] = { DEVMETHOD(device_detach, nve_detach), DEVMETHOD(device_shutdown, nve_shutdown), - /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - /* MII interface */ DEVMETHOD(miibus_readreg, nve_miibus_readreg), DEVMETHOD(miibus_writereg, nve_miibus_writereg), - {0, 0} + DEVMETHOD_END }; static driver_t nve_driver = { Modified: stable/8/sys/dev/pccbb/pccbb_isa.c ============================================================================== --- stable/8/sys/dev/pccbb/pccbb_isa.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/pccbb/pccbb_isa.c Sun Jan 29 01:22:48 2012 (r230714) @@ -211,7 +211,6 @@ static device_method_t cbb_methods[] = { DEVMETHOD(device_resume, cbb_resume), /* bus methods */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, cbb_read_ivar), DEVMETHOD(bus_write_ivar, cbb_write_ivar), DEVMETHOD(bus_alloc_resource, cbb_alloc_resource), @@ -232,7 +231,7 @@ static device_method_t cbb_methods[] = { DEVMETHOD(power_enable_socket, cbb_power_enable_socket), DEVMETHOD(power_disable_socket, cbb_power_disable_socket), - {0,0} + DEVMETHOD_END }; static driver_t cbb_isa_driver = { Modified: stable/8/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- stable/8/sys/dev/pccbb/pccbb_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/pccbb/pccbb_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -816,7 +816,6 @@ static device_method_t cbb_methods[] = { DEVMETHOD(device_resume, cbb_resume), /* bus methods */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, cbb_read_ivar), DEVMETHOD(bus_write_ivar, cbb_write_ivar), DEVMETHOD(bus_alloc_resource, cbb_alloc_resource), @@ -843,7 +842,7 @@ static device_method_t cbb_methods[] = { DEVMETHOD(pcib_write_config, cbb_write_config), DEVMETHOD(pcib_route_interrupt, cbb_route_interrupt), - {0,0} + DEVMETHOD_END }; static driver_t cbb_driver = { Modified: stable/8/sys/dev/pci/eisa_pci.c ============================================================================== --- stable/8/sys/dev/pci/eisa_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/pci/eisa_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -55,7 +55,6 @@ static device_method_t eisab_methods[] = DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), @@ -63,7 +62,7 @@ static device_method_t eisab_methods[] = DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - { 0, 0 } + DEVMETHOD_END }; static driver_t eisab_driver = { Modified: stable/8/sys/dev/pci/isa_pci.c ============================================================================== --- stable/8/sys/dev/pci/isa_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/pci/isa_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -57,8 +57,6 @@ static device_method_t isab_methods[] = DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), @@ -66,7 +64,7 @@ static device_method_t isab_methods[] = DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - { 0, 0 } + DEVMETHOD_END }; static driver_t isab_driver = { Modified: stable/8/sys/dev/pci/pci_pci.c ============================================================================== --- stable/8/sys/dev/pci/pci_pci.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/pci/pci_pci.c Sun Jan 29 01:22:48 2012 (r230714) @@ -66,7 +66,6 @@ static device_method_t pcib_methods[] = DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, pcib_read_ivar), DEVMETHOD(bus_write_ivar, pcib_write_ivar), DEVMETHOD(bus_alloc_resource, pcib_alloc_resource), @@ -93,7 +92,7 @@ static device_method_t pcib_methods[] = DEVMETHOD(pcib_release_msix, pcib_release_msix), DEVMETHOD(pcib_map_msi, pcib_map_msi), - { 0, 0 } + DEVMETHOD_END }; static devclass_t pcib_devclass; Modified: stable/8/sys/dev/pcn/if_pcn.c ============================================================================== --- stable/8/sys/dev/pcn/if_pcn.c Sun Jan 29 01:01:41 2012 (r230713) +++ stable/8/sys/dev/pcn/if_pcn.c Sun Jan 29 01:22:48 2012 (r230714) @@ -173,16 +173,12 @@ static device_method_t pcn_methods[] = { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 01:27:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36EBA106566B; Sun, 29 Jan 2012 01:27:40 +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 1B5158FC12; Sun, 29 Jan 2012 01:27:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T1ReLI009980; Sun, 29 Jan 2012 01:27:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T1Rd5p009952; Sun, 29 Jan 2012 01:27:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290127.q0T1Rd5p009952@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 01:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230715 - in stable/8/sys: dev/bwn dev/esp dev/mii dev/ofw dev/siba dev/stge dev/vte sparc64/central sparc64/ebus sparc64/fhc sparc64/pci sparc64/sbus sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 01:27:40 -0000 Author: marius Date: Sun Jan 29 01:27:39 2012 New Revision: 230715 URL: http://svn.freebsd.org/changeset/base/230715 Log: MFC: r226173, r227848 s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention of kobj(9) from device drivers. Modified: stable/8/sys/dev/bwn/if_bwn.c stable/8/sys/dev/esp/esp_pci.c stable/8/sys/dev/esp/esp_sbus.c stable/8/sys/dev/mii/rdcphy.c stable/8/sys/dev/ofw/ofw_iicbus.c stable/8/sys/dev/siba/siba.c stable/8/sys/dev/siba/siba_bwn.c stable/8/sys/dev/siba/siba_cc.c stable/8/sys/dev/stge/if_stge.c stable/8/sys/dev/vte/if_vte.c stable/8/sys/sparc64/central/central.c stable/8/sys/sparc64/ebus/ebus.c stable/8/sys/sparc64/ebus/epic.c stable/8/sys/sparc64/fhc/fhc.c stable/8/sys/sparc64/pci/apb.c stable/8/sys/sparc64/pci/ofw_pcib.c stable/8/sys/sparc64/pci/ofw_pcibus.c stable/8/sys/sparc64/sbus/dma_sbus.c stable/8/sys/sparc64/sbus/sbus.c stable/8/sys/sparc64/sparc64/eeprom.c stable/8/sys/sparc64/sparc64/jbusppm.c stable/8/sys/sparc64/sparc64/nexus.c stable/8/sys/sparc64/sparc64/rtc.c stable/8/sys/sparc64/sparc64/sc_machdep.c stable/8/sys/sparc64/sparc64/schppm.c stable/8/sys/sparc64/sparc64/ssm.c stable/8/sys/sparc64/sparc64/upa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/bwn/if_bwn.c ============================================================================== --- stable/8/sys/dev/bwn/if_bwn.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/dev/bwn/if_bwn.c Sun Jan 29 01:27:39 2012 (r230715) @@ -14225,7 +14225,7 @@ static device_method_t bwn_methods[] = { DEVMETHOD(device_detach, bwn_detach), DEVMETHOD(device_suspend, bwn_suspend), DEVMETHOD(device_resume, bwn_resume), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t bwn_driver = { "bwn", Modified: stable/8/sys/dev/esp/esp_pci.c ============================================================================== --- stable/8/sys/dev/esp/esp_pci.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/dev/esp/esp_pci.c Sun Jan 29 01:27:39 2012 (r230715) @@ -146,7 +146,7 @@ static device_method_t esp_pci_methods[] DEVMETHOD(device_suspend, esp_pci_suspend), DEVMETHOD(device_resume, esp_pci_resume), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t esp_pci_driver = { Modified: stable/8/sys/dev/esp/esp_sbus.c ============================================================================== --- stable/8/sys/dev/esp/esp_sbus.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/dev/esp/esp_sbus.c Sun Jan 29 01:27:39 2012 (r230715) @@ -117,7 +117,7 @@ static device_method_t esp_dma_methods[] DEVMETHOD(device_suspend, esp_suspend), DEVMETHOD(device_resume, esp_resume), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t esp_dma_driver = { @@ -136,7 +136,7 @@ static device_method_t esp_sbus_methods[ DEVMETHOD(device_suspend, esp_suspend), DEVMETHOD(device_resume, esp_resume), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t esp_sbus_driver = { Modified: stable/8/sys/dev/mii/rdcphy.c ============================================================================== --- stable/8/sys/dev/mii/rdcphy.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/dev/mii/rdcphy.c Sun Jan 29 01:27:39 2012 (r230715) @@ -66,7 +66,7 @@ static device_method_t rdcphy_methods[] DEVMETHOD(device_attach, rdcphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t rdcphy_devclass; Modified: stable/8/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- stable/8/sys/dev/ofw/ofw_iicbus.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/dev/ofw/ofw_iicbus.c Sun Jan 29 01:27:39 2012 (r230715) @@ -68,7 +68,7 @@ static device_method_t ofw_iicbus_method DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; struct ofw_iicbus_devinfo { Modified: stable/8/sys/dev/siba/siba.c ============================================================================== --- stable/8/sys/dev/siba/siba.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/dev/siba/siba.c Sun Jan 29 01:27:39 2012 (r230715) @@ -632,7 +632,7 @@ static device_method_t siba_methods[] = DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_write_ivar, siba_write_ivar), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t siba_driver = { Modified: stable/8/sys/dev/siba/siba_bwn.c ============================================================================== --- stable/8/sys/dev/siba/siba_bwn.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/dev/siba/siba_bwn.c Sun Jan 29 01:27:39 2012 (r230715) @@ -410,7 +410,7 @@ static device_method_t siba_bwn_methods[ DEVMETHOD(pci_release_msi, siba_bwn_release_msi), DEVMETHOD(pci_msi_count, siba_bwn_msi_count), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t siba_bwn_driver = { "siba_bwn", Modified: stable/8/sys/dev/siba/siba_cc.c ============================================================================== --- stable/8/sys/dev/siba/siba_cc.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/dev/siba/siba_cc.c Sun Jan 29 01:27:39 2012 (r230715) @@ -141,7 +141,7 @@ static device_method_t siba_cc_methods[] DEVMETHOD(device_attach, siba_cc_attach), DEVMETHOD(device_probe, siba_cc_probe), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t siba_cc_driver = { Modified: stable/8/sys/dev/stge/if_stge.c ============================================================================== --- stable/8/sys/dev/stge/if_stge.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/dev/stge/if_stge.c Sun Jan 29 01:27:39 2012 (r230715) @@ -221,8 +221,7 @@ static device_method_t stge_methods[] = DEVMETHOD(miibus_writereg, stge_miibus_writereg), DEVMETHOD(miibus_statchg, stge_miibus_statchg), - { 0, 0 } - + DEVMETHOD_END }; static driver_t stge_driver = { Modified: stable/8/sys/dev/vte/if_vte.c ============================================================================== --- stable/8/sys/dev/vte/if_vte.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/dev/vte/if_vte.c Sun Jan 29 01:27:39 2012 (r230715) @@ -151,7 +151,7 @@ static device_method_t vte_methods[] = { DEVMETHOD(miibus_writereg, vte_miibus_writereg), DEVMETHOD(miibus_statchg, vte_miibus_statchg), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t vte_driver = { Modified: stable/8/sys/sparc64/central/central.c ============================================================================== --- stable/8/sys/sparc64/central/central.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/central/central.c Sun Jan 29 01:27:39 2012 (r230715) @@ -96,7 +96,7 @@ static device_method_t central_methods[] DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t central_driver = { Modified: stable/8/sys/sparc64/ebus/ebus.c ============================================================================== --- stable/8/sys/sparc64/ebus/ebus.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/ebus/ebus.c Sun Jan 29 01:27:39 2012 (r230715) @@ -181,7 +181,7 @@ static device_method_t ebus_nexus_method DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t ebus_nexus_driver = { @@ -228,7 +228,7 @@ static device_method_t ebus_pci_methods[ DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t ebus_pci_driver = { Modified: stable/8/sys/sparc64/ebus/epic.c ============================================================================== --- stable/8/sys/sparc64/ebus/epic.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/ebus/epic.c Sun Jan 29 01:27:39 2012 (r230715) @@ -125,7 +125,7 @@ static device_method_t epic_methods[] = DEVMETHOD(device_attach, epic_attach), DEVMETHOD(device_detach, epic_detach), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t epic_devclass; Modified: stable/8/sys/sparc64/fhc/fhc.c ============================================================================== --- stable/8/sys/sparc64/fhc/fhc.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/fhc/fhc.c Sun Jan 29 01:27:39 2012 (r230715) @@ -110,7 +110,7 @@ static device_method_t fhc_methods[] = { DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t fhc_driver = { Modified: stable/8/sys/sparc64/pci/apb.c ============================================================================== --- stable/8/sys/sparc64/pci/apb.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/pci/apb.c Sun Jan 29 01:27:39 2012 (r230715) @@ -96,7 +96,7 @@ static device_method_t apb_methods[] = { /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_gen_get_node), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t pcib_devclass; Modified: stable/8/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pcib.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/pci/ofw_pcib.c Sun Jan 29 01:27:39 2012 (r230715) @@ -74,7 +74,7 @@ static device_method_t ofw_pcib_methods[ /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_gen_get_node), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t pcib_devclass; Modified: stable/8/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pcibus.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/pci/ofw_pcibus.c Sun Jan 29 01:27:39 2012 (r230715) @@ -90,7 +90,7 @@ static device_method_t ofw_pcibus_method DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; struct ofw_pcibus_devinfo { Modified: stable/8/sys/sparc64/sbus/dma_sbus.c ============================================================================== --- stable/8/sys/sparc64/sbus/dma_sbus.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/sbus/dma_sbus.c Sun Jan 29 01:27:39 2012 (r230715) @@ -134,7 +134,7 @@ static device_method_t dma_methods[] = { DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t dma_driver = { Modified: stable/8/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/8/sys/sparc64/sbus/sbus.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/sbus/sbus.c Sun Jan 29 01:27:39 2012 (r230715) @@ -188,7 +188,7 @@ static device_method_t sbus_methods[] = DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t sbus_driver = { Modified: stable/8/sys/sparc64/sparc64/eeprom.c ============================================================================== --- stable/8/sys/sparc64/sparc64/eeprom.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/sparc64/eeprom.c Sun Jan 29 01:27:39 2012 (r230715) @@ -91,7 +91,7 @@ static device_method_t eeprom_methods[] DEVMETHOD(clock_gettime, mk48txx_gettime), DEVMETHOD(clock_settime, mk48txx_settime), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t eeprom_driver = { Modified: stable/8/sys/sparc64/sparc64/jbusppm.c ============================================================================== --- stable/8/sys/sparc64/sparc64/jbusppm.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/sparc64/jbusppm.c Sun Jan 29 01:27:39 2012 (r230715) @@ -82,7 +82,7 @@ static device_method_t jbusppm_methods[] DEVMETHOD(device_probe, jbusppm_probe), DEVMETHOD(device_attach, jbusppm_attach), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t jbusppm_devclass; Modified: stable/8/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/8/sys/sparc64/sparc64/nexus.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/sparc64/nexus.c Sun Jan 29 01:27:39 2012 (r230715) @@ -144,7 +144,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t nexus_devclass; Modified: stable/8/sys/sparc64/sparc64/rtc.c ============================================================================== --- stable/8/sys/sparc64/sparc64/rtc.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/sparc64/rtc.c Sun Jan 29 01:27:39 2012 (r230715) @@ -90,7 +90,7 @@ static device_method_t rtc_ebus_methods[ DEVMETHOD(clock_gettime, mc146818_gettime), DEVMETHOD(clock_settime, mc146818_settime), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t rtc_ebus_driver = { @@ -111,7 +111,7 @@ static device_method_t rtc_isa_methods[] DEVMETHOD(clock_gettime, mc146818_gettime), DEVMETHOD(clock_settime, mc146818_settime), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t rtc_isa_driver = { Modified: stable/8/sys/sparc64/sparc64/sc_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/sc_machdep.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/sparc64/sc_machdep.c Sun Jan 29 01:27:39 2012 (r230715) @@ -57,7 +57,7 @@ static device_method_t sc_methods[] = { DEVMETHOD(device_probe, sc_probe), DEVMETHOD(device_attach, sc_attach), - KOBJMETHOD_END + DEVMETHOD_END }; static driver_t sc_driver = { Modified: stable/8/sys/sparc64/sparc64/schppm.c ============================================================================== --- stable/8/sys/sparc64/sparc64/schppm.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/sparc64/schppm.c Sun Jan 29 01:27:39 2012 (r230715) @@ -73,7 +73,7 @@ static device_method_t schppm_methods[] DEVMETHOD(device_probe, schppm_probe), DEVMETHOD(device_attach, schppm_attach), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t schppm_devclass; Modified: stable/8/sys/sparc64/sparc64/ssm.c ============================================================================== --- stable/8/sys/sparc64/sparc64/ssm.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/sparc64/ssm.c Sun Jan 29 01:27:39 2012 (r230715) @@ -52,7 +52,7 @@ static device_method_t ssm_methods[] = { /* ofw_bus interface */ - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t ssm_devclass; Modified: stable/8/sys/sparc64/sparc64/upa.c ============================================================================== --- stable/8/sys/sparc64/sparc64/upa.c Sun Jan 29 01:22:48 2012 (r230714) +++ stable/8/sys/sparc64/sparc64/upa.c Sun Jan 29 01:27:39 2012 (r230715) @@ -147,7 +147,7 @@ static device_method_t upa_methods[] = { DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - KOBJMETHOD_END + DEVMETHOD_END }; static devclass_t upa_devclass; From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 01:29:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBCF2106564A; Sun, 29 Jan 2012 01:29:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5F7A8FC1B; Sun, 29 Jan 2012 01:29:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T1TVEa010083; Sun, 29 Jan 2012 01:29:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T1TVoj010081; Sun, 29 Jan 2012 01:29:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290129.q0T1TVoj010081@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 01:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230716 - stable/9/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 01:29:31 -0000 Author: marius Date: Sun Jan 29 01:29:31 2012 New Revision: 230716 URL: http://svn.freebsd.org/changeset/base/230716 Log: MFC: r227906 Sync with NetBSD rev. 1.104 Obtained from: NetBSD Modified: stable/9/sys/dev/mii/miidevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/mii/miidevs ============================================================================== --- stable/9/sys/dev/mii/miidevs Sun Jan 29 01:27:39 2012 (r230715) +++ stable/9/sys/dev/mii/miidevs Sun Jan 29 01:29:31 2012 (r230716) @@ -1,5 +1,5 @@ $FreeBSD$ -/*$NetBSD: miidevs,v 1.99 2011/01/26 18:39:04 bouyer Exp $*/ +/*$NetBSD: miidevs,v 1.104 2011/11/12 11:10:49 sekiya Exp $*/ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -146,6 +146,7 @@ model xxBROADCOM BCM5214 0x0028 BCM5214 model xxBROADCOM BCM5221 0x001e BCM5221 10/100 media interface model xxBROADCOM BCM5222 0x0032 BCM5222 Dual 10/100 media interface model xxBROADCOM BCM4401 0x0036 BCM4401 10/100 media interface +model xxBROADCOM BCM5365 0x0037 BCM5365 10/100 5-port PHY switch model BROADCOM BCM5400 0x0004 BCM5400 1000BASE-T media interface model BROADCOM BCM5401 0x0005 BCM5401 1000BASE-T media interface model BROADCOM BCM5411 0x0007 BCM5411 1000BASE-T media interface @@ -164,12 +165,14 @@ model BROADCOM BCM54K2 0x002e BCM54K2 1 model BROADCOM BCM5714 0x0034 BCM5714 1000BASE-T media interface model BROADCOM BCM5780 0x0035 BCM5780 1000BASE-T media interface model BROADCOM BCM5708C 0x0036 BCM5708C 1000BASE-T media interface +model BROADCOM2 BCM5325 0x0003 BCM5325 10/100 5-port PHY switch model BROADCOM2 BCM5906 0x0004 BCM5906 10/100baseTX media interface model BROADCOM2 BCM5481 0x000a BCM5481 1000BASE-T media interface model BROADCOM2 BCM5482 0x000b BCM5482 1000BASE-T media interface model BROADCOM2 BCM5755 0x000c BCM5755 1000BASE-T media interface model BROADCOM2 BCM5754 0x000e BCM5754/5787 1000BASE-T media interface model BROADCOM2 BCM5708S 0x0015 BCM5708S 1000/2500baseSX PHY +model BROADCOM2 BCM5785 0x0016 BCM5785 1000BASE-T media interface model BROADCOM2 BCM5709CAX 0x002c BCM5709CAX 10/100/1000baseT PHY model BROADCOM2 BCM5722 0x002d BCM5722 1000BASE-T media interface model BROADCOM2 BCM5784 0x003a BCM5784 10/100/1000baseT PHY @@ -218,6 +221,10 @@ model yyINTEL I82562ET 0x0033 i82562ET model yyINTEL I82553 0x0035 i82553 10/100 media interface model yyINTEL I82566 0x0039 i82566 10/100/1000 media interface model INTEL I82577 0x0005 i82577 10/100/1000 media interface +model INTEL I82579 0x0009 i82579 10/100/1000 media interface +model xxMARVELL I82563 0x000a i82563 10/100/1000 media interface + +model yyINTEL IGP01E1000 0x0038 Intel IGP01E1000 Gigabit PHY /* Jato Technologies PHYs */ model xxJATO BASEX 0x0000 Jato 1000baseX media interface @@ -246,18 +253,24 @@ model xxMARVELL E3082 0x0008 Marvell 88 model xxMARVELL E1112 0x0009 Marvell 88E1112 Gigabit PHY model xxMARVELL E1149 0x000b Marvell 88E1149 Gigabit PHY model xxMARVELL E1111 0x000c Marvell 88E1111 Gigabit PHY +model xxMARVELL E1145 0x000d Marvell 88E1145 Quad Gigabit PHY model xxMARVELL E1116 0x0021 Marvell 88E1116 Gigabit PHY model xxMARVELL E1116R 0x0024 Marvell 88E1116R Gigabit PHY model xxMARVELL E1118 0x0022 Marvell 88E1118 Gigabit PHY model xxMARVELL E1149R 0x0025 Marvell 88E1149R Quad Gigabit PHY model xxMARVELL E3016 0x0026 Marvell 88E3016 10/100 Fast Ethernet PHY model xxMARVELL PHYG65G 0x0027 Marvell PHYG65G Gigabit PHY +model xxMARVELL E1116R_29 0x0029 Marvell 88E1116R Gigabit PHY model MARVELL E1000 0x0005 Marvell 88E1000 Gigabit PHY model MARVELL E1011 0x0002 Marvell 88E1011 Gigabit PHY model MARVELL E1000_3 0x0003 Marvell 88E1000 Gigabit PHY model MARVELL E1000_5 0x0005 Marvell 88E1000 Gigabit PHY model MARVELL E1111 0x000c Marvell 88E1111 Gigabit PHY +/* Myson Technology PHYs */ +model xxMYSON MTD972 0x0000 MTD972 10/100 media interface +model MYSON MTD803 0x0000 MTD803 3-in-1 media interface + /* National Semiconductor PHYs */ model xxNATSEMI DP83840 0x0000 DP83840 10/100 media interface model xxNATSEMI DP83843 0x0001 DP83843 10/100 media interface From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 01:32:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BF9A106566C; Sun, 29 Jan 2012 01:32:25 +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 55EDB8FC16; Sun, 29 Jan 2012 01:32:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T1WPEW010248; Sun, 29 Jan 2012 01:32:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T1WPi4010246; Sun, 29 Jan 2012 01:32:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290132.q0T1WPi4010246@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 01:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230717 - stable/9/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 01:32:25 -0000 Author: marius Date: Sun Jan 29 01:32:24 2012 New Revision: 230717 URL: http://svn.freebsd.org/changeset/base/230717 Log: MFC: r227907, r22791 (for diff reduction) Add BCM5785 but wrap it in #ifdef notyet for now. According to yongari@ there are issues probably needing workarounds in bge(4) when brgphy(4) handles this PHY. Letting ukphy(4) handle it instead results in a working configuration, although likely with performance penalties. Modified: stable/9/sys/dev/mii/brgphy.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/mii/brgphy.c ============================================================================== --- stable/9/sys/dev/mii/brgphy.c Sun Jan 29 01:29:31 2012 (r230716) +++ stable/9/sys/dev/mii/brgphy.c Sun Jan 29 01:32:24 2012 (r230717) @@ -139,6 +139,9 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(BROADCOM2, BCM5754), MII_PHY_DESC(BROADCOM2, BCM5761), MII_PHY_DESC(BROADCOM2, BCM5784), +#ifdef notyet /* better handled by ukphy(4) until WARs are implemented */ + MII_PHY_DESC(BROADCOM2, BCM5785), +#endif MII_PHY_DESC(BROADCOM3, BCM5717C), MII_PHY_DESC(BROADCOM3, BCM5719C), MII_PHY_DESC(BROADCOM3, BCM5720C), From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 01:35:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 099FC1065670; Sun, 29 Jan 2012 01:35:16 +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 E53AD8FC08; Sun, 29 Jan 2012 01:35:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T1ZFFF010415; Sun, 29 Jan 2012 01:35:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T1ZFWQ010382; Sun, 29 Jan 2012 01:35:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290135.q0T1ZFWQ010382@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 01:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230718 - in stable/8/sys/dev: dc mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 01:35:16 -0000 Author: marius Date: Sun Jan 29 01:35:14 2012 New Revision: 230718 URL: http://svn.freebsd.org/changeset/base/230718 Log: MFC: r227908 Use DEVMETHOD_END. Modified: stable/8/sys/dev/dc/dcphy.c stable/8/sys/dev/dc/pnphy.c stable/8/sys/dev/mii/acphy.c stable/8/sys/dev/mii/amphy.c stable/8/sys/dev/mii/atphy.c stable/8/sys/dev/mii/axphy.c stable/8/sys/dev/mii/bmtphy.c stable/8/sys/dev/mii/brgphy.c stable/8/sys/dev/mii/ciphy.c stable/8/sys/dev/mii/e1000phy.c stable/8/sys/dev/mii/exphy.c stable/8/sys/dev/mii/gentbi.c stable/8/sys/dev/mii/icsphy.c stable/8/sys/dev/mii/ip1000phy.c stable/8/sys/dev/mii/jmphy.c stable/8/sys/dev/mii/lxtphy.c stable/8/sys/dev/mii/mlphy.c stable/8/sys/dev/mii/nsgphy.c stable/8/sys/dev/mii/nsphy.c stable/8/sys/dev/mii/nsphyter.c stable/8/sys/dev/mii/pnaphy.c stable/8/sys/dev/mii/qsphy.c stable/8/sys/dev/mii/rgephy.c stable/8/sys/dev/mii/rlphy.c stable/8/sys/dev/mii/rlswitch.c stable/8/sys/dev/mii/ruephy.c stable/8/sys/dev/mii/smcphy.c stable/8/sys/dev/mii/tdkphy.c stable/8/sys/dev/mii/tlphy.c stable/8/sys/dev/mii/truephy.c stable/8/sys/dev/mii/ukphy.c stable/8/sys/dev/mii/xmphy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/dc/dcphy.c ============================================================================== --- stable/8/sys/dev/dc/dcphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/dc/dcphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -96,7 +96,7 @@ static device_method_t dcphy_methods[] = DEVMETHOD(device_attach, dcphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t dcphy_devclass; Modified: stable/8/sys/dev/dc/pnphy.c ============================================================================== --- stable/8/sys/dev/dc/pnphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/dc/pnphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -75,7 +75,7 @@ static device_method_t pnphy_methods[] = DEVMETHOD(device_attach, pnphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t pnphy_devclass; Modified: stable/8/sys/dev/mii/acphy.c ============================================================================== --- stable/8/sys/dev/mii/acphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/acphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -87,7 +87,7 @@ static device_method_t acphy_methods[] = DEVMETHOD(device_attach, acphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t acphy_devclass; Modified: stable/8/sys/dev/mii/amphy.c ============================================================================== --- stable/8/sys/dev/mii/amphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/amphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -66,7 +66,7 @@ static device_method_t amphy_methods[] = DEVMETHOD(device_attach, amphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t amphy_devclass; Modified: stable/8/sys/dev/mii/atphy.c ============================================================================== --- stable/8/sys/dev/mii/atphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/atphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -66,7 +66,7 @@ static device_method_t atphy_methods[] = DEVMETHOD(device_attach, atphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { NULL, NULL } + DEVMETHOD_END }; static devclass_t atphy_devclass; Modified: stable/8/sys/dev/mii/axphy.c ============================================================================== --- stable/8/sys/dev/mii/axphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/axphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -56,7 +56,7 @@ static device_method_t axphy_methods[] = DEVMETHOD(device_attach, axphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t axphy_devclass; Modified: stable/8/sys/dev/mii/bmtphy.c ============================================================================== --- stable/8/sys/dev/mii/bmtphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/bmtphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -96,8 +96,7 @@ static device_method_t bmtphy_methods[] DEVMETHOD(device_attach, bmtphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - - { 0, 0 } + DEVMETHOD_END }; static devclass_t bmtphy_devclass; Modified: stable/8/sys/dev/mii/brgphy.c ============================================================================== --- stable/8/sys/dev/mii/brgphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/brgphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -85,7 +85,7 @@ static device_method_t brgphy_methods[] DEVMETHOD(device_attach, brgphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t brgphy_devclass; Modified: stable/8/sys/dev/mii/ciphy.c ============================================================================== --- stable/8/sys/dev/mii/ciphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/ciphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -67,7 +67,7 @@ static device_method_t ciphy_methods[] = DEVMETHOD(device_attach, ciphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t ciphy_devclass; Modified: stable/8/sys/dev/mii/e1000phy.c ============================================================================== --- stable/8/sys/dev/mii/e1000phy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/e1000phy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -76,7 +76,7 @@ static device_method_t e1000phy_methods[ DEVMETHOD(device_attach, e1000phy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t e1000phy_devclass; Modified: stable/8/sys/dev/mii/exphy.c ============================================================================== --- stable/8/sys/dev/mii/exphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/exphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -86,7 +86,7 @@ static device_method_t exphy_methods[] = DEVMETHOD(device_attach, exphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t exphy_devclass; Modified: stable/8/sys/dev/mii/gentbi.c ============================================================================== --- stable/8/sys/dev/mii/gentbi.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/gentbi.c Sun Jan 29 01:35:14 2012 (r230718) @@ -95,7 +95,7 @@ static device_method_t gentbi_methods[] DEVMETHOD(device_attach, gentbi_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - {0, 0} + DEVMETHOD_END }; static devclass_t gentbi_devclass; Modified: stable/8/sys/dev/mii/icsphy.c ============================================================================== --- stable/8/sys/dev/mii/icsphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/icsphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -94,7 +94,7 @@ static device_method_t icsphy_methods[] DEVMETHOD(device_attach, icsphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t icsphy_devclass; Modified: stable/8/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/8/sys/dev/mii/ip1000phy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/ip1000phy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -69,7 +69,7 @@ static device_method_t ip1000phy_methods DEVMETHOD(device_attach, ip1000phy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t ip1000phy_devclass; Modified: stable/8/sys/dev/mii/jmphy.c ============================================================================== --- stable/8/sys/dev/mii/jmphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/jmphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -69,7 +69,7 @@ static device_method_t jmphy_methods[] = DEVMETHOD(device_attach, jmphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { NULL, NULL } + DEVMETHOD_END }; static devclass_t jmphy_devclass; Modified: stable/8/sys/dev/mii/lxtphy.c ============================================================================== --- stable/8/sys/dev/mii/lxtphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/lxtphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -91,7 +91,7 @@ static device_method_t lxtphy_methods[] DEVMETHOD(device_attach, lxtphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t lxtphy_devclass; Modified: stable/8/sys/dev/mii/mlphy.c ============================================================================== --- stable/8/sys/dev/mii/mlphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/mlphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -84,7 +84,7 @@ static device_method_t mlphy_methods[] = DEVMETHOD(device_attach, mlphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t mlphy_devclass; Modified: stable/8/sys/dev/mii/nsgphy.c ============================================================================== --- stable/8/sys/dev/mii/nsgphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/nsgphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -83,7 +83,7 @@ static device_method_t nsgphy_methods[] DEVMETHOD(device_attach, nsgphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t nsgphy_devclass; Modified: stable/8/sys/dev/mii/nsphy.c ============================================================================== --- stable/8/sys/dev/mii/nsphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/nsphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -90,7 +90,7 @@ static device_method_t nsphy_methods[] = DEVMETHOD(device_attach, nsphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t nsphy_devclass; Modified: stable/8/sys/dev/mii/nsphyter.c ============================================================================== --- stable/8/sys/dev/mii/nsphyter.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/nsphyter.c Sun Jan 29 01:35:14 2012 (r230718) @@ -93,7 +93,7 @@ static device_method_t nsphyter_methods[ DEVMETHOD(device_attach, nsphyter_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t nsphyter_devclass; Modified: stable/8/sys/dev/mii/pnaphy.c ============================================================================== --- stable/8/sys/dev/mii/pnaphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/pnaphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -69,7 +69,7 @@ static device_method_t pnaphy_methods[] DEVMETHOD(device_attach, pnaphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t pnaphy_devclass; Modified: stable/8/sys/dev/mii/qsphy.c ============================================================================== --- stable/8/sys/dev/mii/qsphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/qsphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -91,7 +91,7 @@ static device_method_t qsphy_methods[] = DEVMETHOD(device_attach, qsphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t qsphy_devclass; Modified: stable/8/sys/dev/mii/rgephy.c ============================================================================== --- stable/8/sys/dev/mii/rgephy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/rgephy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -74,7 +74,7 @@ static device_method_t rgephy_methods[] DEVMETHOD(device_attach, rgephy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t rgephy_devclass; Modified: stable/8/sys/dev/mii/rlphy.c ============================================================================== --- stable/8/sys/dev/mii/rlphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/rlphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -71,7 +71,7 @@ static device_method_t rlphy_methods[] = DEVMETHOD(device_attach, rlphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t rlphy_devclass; Modified: stable/8/sys/dev/mii/rlswitch.c ============================================================================== --- stable/8/sys/dev/mii/rlswitch.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/rlswitch.c Sun Jan 29 01:35:14 2012 (r230718) @@ -70,7 +70,7 @@ static device_method_t rlswitch_methods[ DEVMETHOD(device_attach, rlswitch_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t rlswitch_devclass; Modified: stable/8/sys/dev/mii/ruephy.c ============================================================================== --- stable/8/sys/dev/mii/ruephy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/ruephy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -62,7 +62,7 @@ static device_method_t ruephy_methods[] DEVMETHOD(device_attach, ruephy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t ruephy_devclass; Modified: stable/8/sys/dev/mii/smcphy.c ============================================================================== --- stable/8/sys/dev/mii/smcphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/smcphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -62,8 +62,7 @@ static device_method_t smcphy_methods[] DEVMETHOD(device_attach, smcphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - - { 0, 0 } + DEVMETHOD_END }; static devclass_t smcphy_devclass; @@ -224,8 +223,7 @@ smcphy_auto(struct mii_softc *sc, int me { uint16_t anar; - anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | - ANAR_CSMA; + anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; if ((media & IFM_FLOW) != 0 || (sc->mii_flags & MIIF_FORCEPAUSE) != 0) anar |= ANAR_FC; PHY_WRITE(sc, MII_ANAR, anar); Modified: stable/8/sys/dev/mii/tdkphy.c ============================================================================== --- stable/8/sys/dev/mii/tdkphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/tdkphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -71,7 +71,7 @@ static device_method_t tdkphy_methods[] DEVMETHOD(device_attach, tdkphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t tdkphy_devclass; Modified: stable/8/sys/dev/mii/tlphy.c ============================================================================== --- stable/8/sys/dev/mii/tlphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/tlphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -97,7 +97,7 @@ static device_method_t tlphy_methods[] = DEVMETHOD(device_attach, tlphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t tlphy_devclass; Modified: stable/8/sys/dev/mii/truephy.c ============================================================================== --- stable/8/sys/dev/mii/truephy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/truephy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -72,7 +72,7 @@ static device_method_t truephy_methods[] DEVMETHOD(device_attach, truephy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static const struct mii_phydesc truephys[] = { Modified: stable/8/sys/dev/mii/ukphy.c ============================================================================== --- stable/8/sys/dev/mii/ukphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/ukphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -86,7 +86,7 @@ static device_method_t ukphy_methods[] = DEVMETHOD(device_attach, ukphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t ukphy_devclass; Modified: stable/8/sys/dev/mii/xmphy.c ============================================================================== --- stable/8/sys/dev/mii/xmphy.c Sun Jan 29 01:32:24 2012 (r230717) +++ stable/8/sys/dev/mii/xmphy.c Sun Jan 29 01:35:14 2012 (r230718) @@ -66,7 +66,7 @@ static device_method_t xmphy_methods[] = DEVMETHOD(device_attach, xmphy_attach), DEVMETHOD(device_detach, mii_phy_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - { 0, 0 } + DEVMETHOD_END }; static devclass_t xmphy_devclass; From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 01:40:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70624106564A; Sun, 29 Jan 2012 01:40:38 +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 58EE48FC15; Sun, 29 Jan 2012 01:40:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T1ecXW010636; Sun, 29 Jan 2012 01:40:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T1ecsY010631; Sun, 29 Jan 2012 01:40:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290140.q0T1ecsY010631@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 01:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230719 - in stable/9/sys/dev: arcmsr hptiop hptmv hptrr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 01:40:38 -0000 Author: marius Date: Sun Jan 29 01:40:37 2012 New Revision: 230719 URL: http://svn.freebsd.org/changeset/base/230719 Log: MFC: r227912 - Just use cam_calc_geometry(9) on newer version of FreeBSD rather than duplicating it. - In hptmv(4) and hptrr(4) use __FBSDID and DEVMETHOD_END. Modified: stable/9/sys/dev/arcmsr/arcmsr.c stable/9/sys/dev/hptiop/hptiop.c stable/9/sys/dev/hptmv/entry.c stable/9/sys/dev/hptrr/hptrr_osm_bsd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/9/sys/dev/arcmsr/arcmsr.c Sun Jan 29 01:35:14 2012 (r230718) +++ stable/9/sys/dev/arcmsr/arcmsr.c Sun Jan 29 01:40:37 2012 (r230719) @@ -2714,16 +2714,20 @@ static void arcmsr_action(struct cam_sim xpt_done(pccb); break; } - case XPT_CALC_GEOMETRY: { - struct ccb_calc_geometry *ccg; - u_int32_t size_mb; - u_int32_t secs_per_cylinder; - + case XPT_CALC_GEOMETRY: if(pccb->ccb_h.target_id == 16) { pccb->ccb_h.status |= CAM_FUNC_NOTAVAIL; xpt_done(pccb); break; } +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&pccb->ccg, 1); +#else + { + struct ccb_calc_geometry *ccg; + u_int32_t size_mb; + u_int32_t secs_per_cylinder; + ccg= &pccb->ccg; if (ccg->block_size == 0) { pccb->ccb_h.status = CAM_REQ_INVALID; @@ -2746,9 +2750,10 @@ static void arcmsr_action(struct cam_sim secs_per_cylinder=ccg->heads * ccg->secs_per_track; ccg->cylinders=ccg->volume_size / secs_per_cylinder; pccb->ccb_h.status |= CAM_REQ_CMP; + } +#endif xpt_done(pccb); break; - } default: pccb->ccb_h.status |= CAM_REQ_INVALID; xpt_done(pccb); Modified: stable/9/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/9/sys/dev/hptiop/hptiop.c Sun Jan 29 01:35:14 2012 (r230718) +++ stable/9/sys/dev/hptiop/hptiop.c Sun Jan 29 01:40:37 2012 (r230719) @@ -1813,11 +1813,15 @@ scsi_done: break; case XPT_CALC_GEOMETRY: +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&ccb->ccg, 1); +#else ccb->ccg.heads = 255; ccb->ccg.secs_per_track = 63; ccb->ccg.cylinders = ccb->ccg.volume_size / (ccb->ccg.heads * ccb->ccg.secs_per_track); ccb->ccb_h.status = CAM_REQ_CMP; +#endif break; case XPT_PATH_INQ: Modified: stable/9/sys/dev/hptmv/entry.c ============================================================================== --- stable/9/sys/dev/hptmv/entry.c Sun Jan 29 01:35:14 2012 (r230718) +++ stable/9/sys/dev/hptmv/entry.c Sun Jan 29 01:40:37 2012 (r230719) @@ -22,9 +22,10 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include @@ -94,7 +95,7 @@ static device_method_t driver_methods[] DEVMETHOD(device_detach, hpt_detach), DEVMETHOD(device_shutdown, hpt_shutdown), - { 0, 0 } + DEVMETHOD_END }; static driver_t hpt_pci_driver = { @@ -2371,7 +2372,10 @@ hpt_action(struct cam_sim *sim, union cc break; case XPT_CALC_GEOMETRY: - { +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&ccb->ccg, 1); +#else + { struct ccb_calc_geometry *ccg; u_int32_t size_mb; u_int32_t secs_per_cylinder; @@ -2389,9 +2393,10 @@ hpt_action(struct cam_sim *sim, union cc secs_per_cylinder = ccg->heads * ccg->secs_per_track; ccg->cylinders = ccg->volume_size / secs_per_cylinder; ccb->ccb_h.status = CAM_REQ_CMP; + } +#endif xpt_done(ccb); break; - } case XPT_PATH_INQ: /* Path routing inquiry */ { Modified: stable/9/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- stable/9/sys/dev/hptrr/hptrr_osm_bsd.c Sun Jan 29 01:35:14 2012 (r230718) +++ stable/9/sys/dev/hptrr/hptrr_osm_bsd.c Sun Jan 29 01:40:37 2012 (r230719) @@ -22,9 +22,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); + #include /* $Id: osm_bsd.c,v 1.27 2007/11/22 07:35:49 gmm Exp $ * @@ -795,10 +797,14 @@ static void hpt_action(struct cam_sim *s break; case XPT_CALC_GEOMETRY: +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&ccb->ccg, 1); +#else ccb->ccg.heads = 255; ccb->ccg.secs_per_track = 63; ccb->ccg.cylinders = ccb->ccg.volume_size / (ccb->ccg.heads * ccb->ccg.secs_per_track); ccb->ccb_h.status = CAM_REQ_CMP; +#endif break; case XPT_PATH_INQ: @@ -1250,7 +1256,7 @@ static device_method_t driver_methods[] DEVMETHOD(device_attach, hpt_attach), DEVMETHOD(device_detach, hpt_detach), DEVMETHOD(device_shutdown, hpt_shutdown), - { 0, 0 } + DEVMETHOD_END }; static driver_t hpt_pci_driver = { From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 01:40:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67B7D1065673; Sun, 29 Jan 2012 01:40:40 +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 513948FC17; Sun, 29 Jan 2012 01:40:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T1eeEO010670; Sun, 29 Jan 2012 01:40:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T1eesj010665; Sun, 29 Jan 2012 01:40:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290140.q0T1eesj010665@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 01:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230720 - in stable/8/sys/dev: arcmsr hptiop hptmv hptrr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 01:40:40 -0000 Author: marius Date: Sun Jan 29 01:40:39 2012 New Revision: 230720 URL: http://svn.freebsd.org/changeset/base/230720 Log: MFC: r227912 - Just use cam_calc_geometry(9) on newer version of FreeBSD rather than duplicating it. - In hptmv(4) and hptrr(4) use __FBSDID and DEVMETHOD_END. Modified: stable/8/sys/dev/arcmsr/arcmsr.c stable/8/sys/dev/hptiop/hptiop.c stable/8/sys/dev/hptmv/entry.c stable/8/sys/dev/hptrr/hptrr_osm_bsd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/8/sys/dev/arcmsr/arcmsr.c Sun Jan 29 01:40:37 2012 (r230719) +++ stable/8/sys/dev/arcmsr/arcmsr.c Sun Jan 29 01:40:39 2012 (r230720) @@ -2714,16 +2714,20 @@ static void arcmsr_action(struct cam_sim xpt_done(pccb); break; } - case XPT_CALC_GEOMETRY: { - struct ccb_calc_geometry *ccg; - u_int32_t size_mb; - u_int32_t secs_per_cylinder; - + case XPT_CALC_GEOMETRY: if(pccb->ccb_h.target_id == 16) { pccb->ccb_h.status |= CAM_FUNC_NOTAVAIL; xpt_done(pccb); break; } +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&pccb->ccg, 1); +#else + { + struct ccb_calc_geometry *ccg; + u_int32_t size_mb; + u_int32_t secs_per_cylinder; + ccg= &pccb->ccg; if (ccg->block_size == 0) { pccb->ccb_h.status = CAM_REQ_INVALID; @@ -2746,9 +2750,10 @@ static void arcmsr_action(struct cam_sim secs_per_cylinder=ccg->heads * ccg->secs_per_track; ccg->cylinders=ccg->volume_size / secs_per_cylinder; pccb->ccb_h.status |= CAM_REQ_CMP; + } +#endif xpt_done(pccb); break; - } default: pccb->ccb_h.status |= CAM_REQ_INVALID; xpt_done(pccb); Modified: stable/8/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/8/sys/dev/hptiop/hptiop.c Sun Jan 29 01:40:37 2012 (r230719) +++ stable/8/sys/dev/hptiop/hptiop.c Sun Jan 29 01:40:39 2012 (r230720) @@ -1813,11 +1813,15 @@ scsi_done: break; case XPT_CALC_GEOMETRY: +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&ccb->ccg, 1); +#else ccb->ccg.heads = 255; ccb->ccg.secs_per_track = 63; ccb->ccg.cylinders = ccb->ccg.volume_size / (ccb->ccg.heads * ccb->ccg.secs_per_track); ccb->ccb_h.status = CAM_REQ_CMP; +#endif break; case XPT_PATH_INQ: Modified: stable/8/sys/dev/hptmv/entry.c ============================================================================== --- stable/8/sys/dev/hptmv/entry.c Sun Jan 29 01:40:37 2012 (r230719) +++ stable/8/sys/dev/hptmv/entry.c Sun Jan 29 01:40:39 2012 (r230720) @@ -22,9 +22,10 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include @@ -94,7 +95,7 @@ static device_method_t driver_methods[] DEVMETHOD(device_detach, hpt_detach), DEVMETHOD(device_shutdown, hpt_shutdown), - { 0, 0 } + DEVMETHOD_END }; static driver_t hpt_pci_driver = { @@ -2371,7 +2372,10 @@ hpt_action(struct cam_sim *sim, union cc break; case XPT_CALC_GEOMETRY: - { +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&ccb->ccg, 1); +#else + { struct ccb_calc_geometry *ccg; u_int32_t size_mb; u_int32_t secs_per_cylinder; @@ -2389,9 +2393,10 @@ hpt_action(struct cam_sim *sim, union cc secs_per_cylinder = ccg->heads * ccg->secs_per_track; ccg->cylinders = ccg->volume_size / secs_per_cylinder; ccb->ccb_h.status = CAM_REQ_CMP; + } +#endif xpt_done(ccb); break; - } case XPT_PATH_INQ: /* Path routing inquiry */ { Modified: stable/8/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- stable/8/sys/dev/hptrr/hptrr_osm_bsd.c Sun Jan 29 01:40:37 2012 (r230719) +++ stable/8/sys/dev/hptrr/hptrr_osm_bsd.c Sun Jan 29 01:40:39 2012 (r230720) @@ -22,9 +22,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); + #include /* $Id: osm_bsd.c,v 1.27 2007/11/22 07:35:49 gmm Exp $ * @@ -795,10 +797,14 @@ static void hpt_action(struct cam_sim *s break; case XPT_CALC_GEOMETRY: +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&ccb->ccg, 1); +#else ccb->ccg.heads = 255; ccb->ccg.secs_per_track = 63; ccb->ccg.cylinders = ccb->ccg.volume_size / (ccb->ccg.heads * ccb->ccg.secs_per_track); ccb->ccb_h.status = CAM_REQ_CMP; +#endif break; case XPT_PATH_INQ: @@ -1250,7 +1256,7 @@ static device_method_t driver_methods[] DEVMETHOD(device_attach, hpt_attach), DEVMETHOD(device_detach, hpt_detach), DEVMETHOD(device_shutdown, hpt_shutdown), - { 0, 0 } + DEVMETHOD_END }; static driver_t hpt_pci_driver = { From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 02:58:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2F80106564A; Sun, 29 Jan 2012 02:58:30 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 5E1918FC15; Sun, 29 Jan 2012 02:58:30 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id q0T2cjt6091949 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 28 Jan 2012 18:38:48 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4F24B17E.4050306@freebsd.org> Date: Sat, 28 Jan 2012 18:39:58 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.25) Gecko/20111213 Thunderbird/3.1.17 MIME-Version: 1.0 To: Bruce Evans References: <201201272204.q0RM4hRH062478@svn.freebsd.org> <20120128184815.L1114@besplex.bde.org> In-Reply-To: <20120128184815.L1114@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Marius Strobl , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230628 - head/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 02:58:31 -0000 On 1/28/12 12:23 AM, Bruce Evans wrote: > On Fri, 27 Jan 2012, Marius Strobl wrote: > >> Log: >> Mark cpu_{halt,reset}() as __dead2 as appropriate. >> >> Modified: >> head/sys/sparc64/include/cpu.h >> >> Modified: head/sys/sparc64/include/cpu.h >> ============================================================================== >> >> --- head/sys/sparc64/include/cpu.h Fri Jan 27 21:52:59 2012 >> (r230627) >> +++ head/sys/sparc64/include/cpu.h Fri Jan 27 22:04:43 2012 >> (r230628) >> @@ -53,8 +53,8 @@ extern char btext[]; >> extern char etext[]; >> >> void cheetah_init(u_int cpu_impl); >> -void cpu_halt(void); >> -void cpu_reset(void); >> +void cpu_halt(void) __dead2; >> +void cpu_reset(void) __dead2; >> void fork_trampoline(void); >> void swi_vm(void *v); >> void zeus_init(u_int cpu_impl); > > This reminds me that these functions and many others shouldn't be > in since they necessarily have a MI interface (so > that MI code can call them). A few interfaces in > need to be there so that the can be inlines or macros, but most > don't. Especially these 2. Since they are extremely non-time- > critical and not likely to be magical, they can be implemented as > a wrapper extern function even if the MD code prefers to use an > in inline or macro. Duplicating these 2 in ${N_ARCH} cpu.h files > mainly allows some of the files to forget to declare them as > __dead2. > > I put these in and didn't forget __dead2 for them. > systm.h already has prototypes for 11 functions named cpu_*. These > are unsorted of course. It also has prototypes for a few functions > that are misnamed (without a cpu_ as a prefix, or perhaps without > cpu_ or cpu at all) so that they are naturally unsorted and hard to > find. > > No MD declaration of these 2 in -current except the above has the > __dead2's. IIRC, I noticed that __dead2 was missing for them from > the style bug that code after calls to them has /* NOTREACHED */ > comments (shutdown_halt() still does, except in my version). > __dead2 should have made most of these comments go away 15-20 years > ago. > > A more important "cpu_" function whose comments annoy me is > cpu_throw(). This has always been declared in an MI file > (, which shows that we can't expect all these functions > to be declared in if they are MI). Calls to > cpu_throw() have the unnecessary comments /* doesn't return */ in > 2 places (lint won't understand these, so if you are going to > comment on the obvious then it should be /* NOTREACHED */), and a > bogus "teapot" panic and a /* NOTREACHED */ comment in another > place. The panic is so bogus that gcc removes it (as allowed by > cpu_throw() being declared __dead2). The first 2 places are > sched_throw() in 2 schedulers. This can't return, but isn't > declared as __dead2. The other place is thread_exit(). This is > one of very few extern functions that is declared as __dead2. > > Bruce > Bruce these comments are valid. please make use of your commit bit and make the appropriate changes! From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 04:42:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88991106564A; Sun, 29 Jan 2012 04:42:20 +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 7573A8FC08; Sun, 29 Jan 2012 04:42:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T4gKjg038081; Sun, 29 Jan 2012 04:42:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T4gKIt038079; Sun, 29 Jan 2012 04:42:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201290442.q0T4gKIt038079@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 29 Jan 2012 04:42:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230723 - stable/9/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 04:42:20 -0000 Author: kib Date: Sun Jan 29 04:42:19 2012 New Revision: 230723 URL: http://svn.freebsd.org/changeset/base/230723 Log: MFC r230460: Clarify the implementation-defined behaviour in case of close(2) returning error. Modified: stable/9/lib/libc/sys/close.2 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/sys/close.2 ============================================================================== --- stable/9/lib/libc/sys/close.2 Sun Jan 29 02:13:01 2012 (r230722) +++ stable/9/lib/libc/sys/close.2 Sun Jan 29 04:42:19 2012 (r230723) @@ -28,7 +28,7 @@ .\" @(#)close.2 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 4, 2006 +.Dd January 22, 2012 .Dt CLOSE 2 .Os .Sh NAME @@ -118,6 +118,10 @@ The underlying object did not fit, cache The underlying object was a stream socket that was shut down by the peer before all pending data was delivered. .El +.Pp +In case of any error except +.Er EBADF , +the supplied file descriptor is deallocated and therefore is no longer valid. .Sh SEE ALSO .Xr accept 2 , .Xr closefrom 2 , From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 04:44:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69FAD106564A; Sun, 29 Jan 2012 04:44:53 +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 58B168FC15; Sun, 29 Jan 2012 04:44:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T4irdS038968; Sun, 29 Jan 2012 04:44:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T4irn5038966; Sun, 29 Jan 2012 04:44:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201290444.q0T4irn5038966@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 29 Jan 2012 04:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230724 - stable/8/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 04:44:53 -0000 Author: kib Date: Sun Jan 29 04:44:52 2012 New Revision: 230724 URL: http://svn.freebsd.org/changeset/base/230724 Log: MFC r230460: Clarify the implementation-defined behaviour in case of close(2) returning error. Modified: stable/8/lib/libc/sys/close.2 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/sys/close.2 ============================================================================== --- stable/8/lib/libc/sys/close.2 Sun Jan 29 04:42:19 2012 (r230723) +++ stable/8/lib/libc/sys/close.2 Sun Jan 29 04:44:52 2012 (r230724) @@ -28,7 +28,7 @@ .\" @(#)close.2 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 4, 2006 +.Dd January 22, 2012 .Dt CLOSE 2 .Os .Sh NAME @@ -118,6 +118,10 @@ The underlying object did not fit, cache The underlying object was a stream socket that was shut down by the peer before all pending data was delivered. .El +.Pp +In case of any error except +.Er EBADF , +the supplied file descriptor is deallocated and therefore is no longer valid. .Sh SEE ALSO .Xr accept 2 , .Xr closefrom 2 , From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 06:25:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB681106566C; Sun, 29 Jan 2012 06:25:24 +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 6A89F8FC16; Sun, 29 Jan 2012 06:25:23 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q0T6NRqw069535 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 29 Jan 2012 08:23:27 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q0T6NRm1085316; Sun, 29 Jan 2012 08:23:27 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q0T6NRlw085315; Sun, 29 Jan 2012 08:23:27 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 29 Jan 2012 08:23:27 +0200 From: Kostik Belousov To: Bruce Evans , Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: <20120129062327.GK2726@deviant.kiev.zoral.com.ua> References: <201201261159.q0QBxma2086162@svn.freebsd.org> <20120126233110.C960@besplex.bde.org> <20120126153641.GA68112@FreeBSD.org> <20120127194612.H1547@besplex.bde.org> <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> <20120127194221.GA25723@zim.MIT.EDU> <20120128123748.GD2726@deviant.kiev.zoral.com.ua> <20120129001225.GA32220@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="iTgyUaBDSpHJk5wi" Content-Disposition: inline In-Reply-To: <20120129001225.GA32220@zim.MIT.EDU> 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=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 06:25:25 -0000 --iTgyUaBDSpHJk5wi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 28, 2012 at 07:12:25PM -0500, David Schultz wrote: > On Sat, Jan 28, 2012, Kostik Belousov wrote: > > On Fri, Jan 27, 2012 at 02:42:21PM -0500, David Schultz wrote: > > > On Fri, Jan 27, 2012, Kostik Belousov wrote: > > > > On Fri, Jan 27, 2012 at 07:50:30PM +1100, Bruce Evans wrote: > > > > > On Thu, 26 Jan 2012, Gleb Smirnoff wrote: > > > > >=20 > > > > > >On Thu, Jan 26, 2012 at 11:53:57PM +1100, Bruce Evans wrote: > > > > > >B> > @@ -1552,6 +1552,12 @@ aio_aqueue(struct thread *td, struct= aio > > > > > >B> > return (error); > > > > > >B> > } > > > > > >B> > > > > > > >B> > + /* XXX: aio_nbytes is later casted to signed types. */ > > > > > >B> > + if ((int)aiocbe->uaiocb.aio_nbytes < 0) { > > > > > >B> > > > > > >B> This should avoid implementation-defined behaviour by checkin= g if > > > > > >B> > > > > > >B> (uncast)aiocbe->uaiocb.aio_nbytes > INT_MAX. > > > > >=20 > > > > > >Is the attached patch okay? > > > > >=20 > > > > > Yes. It now matches the style used for read^Wsys_read() and frie= nds. > > > > > This used to have to fit the count in "int uio_resid". uio_resid= now > > > > > has type ssize_t, but for some reason the old INT_MAX limits rema= in. > > > >=20 > > > > Well, I can revive the patch. I still think it is good to get rid of > > > > the limit. > > >=20 > > > The correct limit on the maximum size of a single read/write is > > > SSIZE_MAX, but FreeBSD uses INT_MAX. It's not safe to raise the > > > limit yet, though, because of bugs in several filesystems. For > > > example, FFS copies uio_resid into a local variable of type int. > > > I have some old patches that fix some of these issues for FFS and > > > cd9660, but surely there are more places I didn't notice. > > >=20 > > Absolutely agree. > >=20 > > http://people.freebsd.org/~kib/misc/uio_resid.5.patch >=20 > Nice. You found a lot more than I've got in my tree, and you even > fixed the return values. There are at least a few more places to > fix. For instance, cd9660 and the NFS client pass uio_resid or > iov_len to min(), which operates on ints. (Incidentally, C11 > generics ought to make it possible to write type-generic min() > and max() functions.) Thank you, http://people.freebsd.org/~kib/misc/uio_resid.6.patch changed them to MIN(). --iTgyUaBDSpHJk5wi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8k5d4ACgkQC3+MBN1Mb4jDyQCfbguDD7yOxPRluuotCHbGqgSO lxkAn3g2D/BJcCizsR4MCUfG/dakso3R =ySBS -----END PGP SIGNATURE----- --iTgyUaBDSpHJk5wi-- From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 06:37:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 78C4A1065673; Sun, 29 Jan 2012 06:37:42 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 2F32A176A99; Sun, 29 Jan 2012 06:37:41 +0000 (UTC) Message-ID: <4F24E934.8020408@FreeBSD.org> Date: Sat, 28 Jan 2012 22:37:40 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120119 Thunderbird/9.0 MIME-Version: 1.0 To: Julian Elischer References: <201201272204.q0RM4hRH062478@svn.freebsd.org> <20120128184815.L1114@besplex.bde.org> <4F24B17E.4050306@freebsd.org> In-Reply-To: <4F24B17E.4050306@freebsd.org> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Marius Strobl , src-committers@freebsd.org, svn-src-all@freebsd.org, Bruce Evans Subject: Re: svn commit: r230628 - head/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 06:37:42 -0000 On 01/28/2012 18:39, Julian Elischer wrote: > Bruce these comments are valid. > please make use of your commit bit and make the appropriate changes! Completely aside from the pedantic value of having the person who broke it be the one to fix it; this line of reasoning is only going DIScourage people from pointing out problems. Are you sure that's what you want? Doug -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 08:03:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BED6C106564A; Sun, 29 Jan 2012 08:03:45 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A882C8FC14; Sun, 29 Jan 2012 08:03:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T83jwv091223; Sun, 29 Jan 2012 08:03:45 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T83jnM091202; Sun, 29 Jan 2012 08:03:45 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201201290803.q0T83jnM091202@svn.freebsd.org> From: Kirk McKusick Date: Sun, 29 Jan 2012 08:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230725 - in stable/9/sys: compat/freebsd32 fs/cd9660 fs/fdescfs fs/hpfs fs/msdosfs fs/nfsclient fs/ntfs fs/nwfs fs/portalfs fs/pseudofs fs/smbfs gnu/fs/reiserfs kern nfsclient sys ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 08:03:45 -0000 Author: mckusick Date: Sun Jan 29 08:03:45 2012 New Revision: 230725 URL: http://svn.freebsd.org/changeset/base/230725 Log: MFC r230249: Make sure all intermediate variables holding mount flags (mnt_flag) and that all internal kernel calls passing mount flags are declared as uint64_t so that flags in the top 32-bits are not lost. MFC r230250: There are several bugs/hangs when trying to take a snapshot on a UFS/FFS filesystem running with journaled soft updates. Until these problems have been tracked down, return ENOTSUPP when an attempt is made to take a snapshot on a filesystem running with journaled soft updates. Modified: stable/9/sys/compat/freebsd32/freebsd32_misc.c stable/9/sys/fs/cd9660/cd9660_vfsops.c stable/9/sys/fs/fdescfs/fdesc_vfsops.c stable/9/sys/fs/hpfs/hpfs_vfsops.c stable/9/sys/fs/msdosfs/msdosfs_vfsops.c stable/9/sys/fs/nfsclient/nfs_clvfsops.c stable/9/sys/fs/ntfs/ntfs_vfsops.c stable/9/sys/fs/nwfs/nwfs_vfsops.c stable/9/sys/fs/portalfs/portal_vfsops.c stable/9/sys/fs/pseudofs/pseudofs.c stable/9/sys/fs/pseudofs/pseudofs.h stable/9/sys/fs/smbfs/smbfs_vfsops.c stable/9/sys/gnu/fs/reiserfs/reiserfs_vfsops.c stable/9/sys/kern/vfs_mount.c stable/9/sys/kern/vfs_subr.c stable/9/sys/nfsclient/nfs_vfsops.c stable/9/sys/sys/mount.h stable/9/sys/ufs/ffs/ffs_snapshot.c stable/9/sys/ufs/ffs/ffs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_misc.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/compat/freebsd32/freebsd32_misc.c Sun Jan 29 08:03:45 2012 (r230725) @@ -2465,9 +2465,17 @@ freebsd32_nmount(struct thread *td, } */ *uap) { struct uio *auio; + uint64_t flags; int error; - AUDIT_ARG_FFLAGS(uap->flags); + /* + * Mount flags are now 64-bits. On 32-bit archtectures only + * 32-bits are passed in, but from here on everything handles + * 64-bit flags correctly. + */ + flags = uap->flags; + + AUDIT_ARG_FFLAGS(flags); /* * Filter out MNT_ROOTFS. We do not want clients of nmount() in @@ -2476,7 +2484,7 @@ freebsd32_nmount(struct thread *td, * MNT_ROOTFS should only be set by the kernel when mounting its * root file system. */ - uap->flags &= ~MNT_ROOTFS; + flags &= ~MNT_ROOTFS; /* * check that we have an even number of iovec's @@ -2488,7 +2496,7 @@ freebsd32_nmount(struct thread *td, error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio); if (error) return (error); - error = vfs_donmount(td, uap->flags, auio); + error = vfs_donmount(td, flags, auio); free(auio, M_IOV); return error; Modified: stable/9/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- stable/9/sys/fs/cd9660/cd9660_vfsops.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/fs/cd9660/cd9660_vfsops.c Sun Jan 29 08:03:45 2012 (r230725) @@ -95,7 +95,7 @@ static int iso_mountfs(struct vnode *dev */ static int -cd9660_cmount(struct mntarg *ma, void *data, int flags) +cd9660_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct iso_args args; struct export_args exp; Modified: stable/9/sys/fs/fdescfs/fdesc_vfsops.c ============================================================================== --- stable/9/sys/fs/fdescfs/fdesc_vfsops.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/fs/fdescfs/fdesc_vfsops.c Sun Jan 29 08:03:45 2012 (r230725) @@ -65,7 +65,7 @@ static vfs_root_t fdesc_root; * Compatibility shim for old mount(2) system call. */ int -fdesc_cmount(struct mntarg *ma, void *data, int flags) +fdesc_cmount(struct mntarg *ma, void *data, uint64_t flags) { return kernel_mount(ma, flags); } Modified: stable/9/sys/fs/hpfs/hpfs_vfsops.c ============================================================================== --- stable/9/sys/fs/hpfs/hpfs_vfsops.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/fs/hpfs/hpfs_vfsops.c Sun Jan 29 08:03:45 2012 (r230725) @@ -73,7 +73,7 @@ static int hpfs_cmount ( struct mntarg *ma, void *data, - int flags) + uint64_t flags) { struct hpfs_args args; struct export_args exp; Modified: stable/9/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Sun Jan 29 08:03:45 2012 (r230725) @@ -197,7 +197,7 @@ update_mp(struct mount *mp, struct threa } static int -msdosfs_cmount(struct mntarg *ma, void *data, int flags) +msdosfs_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct msdosfs_args args; struct export_args exp; Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Sun Jan 29 08:03:45 2012 (r230725) @@ -1131,7 +1131,7 @@ out: */ /* ARGSUSED */ static int -nfs_cmount(struct mntarg *ma, void *data, int flags) +nfs_cmount(struct mntarg *ma, void *data, uint64_t flags) { int error; struct nfs_args args; Modified: stable/9/sys/fs/ntfs/ntfs_vfsops.c ============================================================================== --- stable/9/sys/fs/ntfs/ntfs_vfsops.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/fs/ntfs/ntfs_vfsops.c Sun Jan 29 08:03:45 2012 (r230725) @@ -117,7 +117,7 @@ static int ntfs_cmount ( struct mntarg *ma, void *data, - int flags) + uint64_t flags) { struct ntfs_args args; struct export_args exp; Modified: stable/9/sys/fs/nwfs/nwfs_vfsops.c ============================================================================== --- stable/9/sys/fs/nwfs/nwfs_vfsops.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/fs/nwfs/nwfs_vfsops.c Sun Jan 29 08:03:45 2012 (r230725) @@ -123,7 +123,7 @@ nwfs_initnls(struct nwmount *nmp) { return 0; } -static int nwfs_cmount(struct mntarg *ma, void *data, int flags) +static int nwfs_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct nwfs_args args; /* will hold data from mount request */ int error; Modified: stable/9/sys/fs/portalfs/portal_vfsops.c ============================================================================== --- stable/9/sys/fs/portalfs/portal_vfsops.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/fs/portalfs/portal_vfsops.c Sun Jan 29 08:03:45 2012 (r230725) @@ -69,7 +69,7 @@ static const char *portal_opts[] = { }; static int -portal_cmount(struct mntarg *ma, void *data, int flags) +portal_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct portal_args args; int error; Modified: stable/9/sys/fs/pseudofs/pseudofs.c ============================================================================== --- stable/9/sys/fs/pseudofs/pseudofs.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/fs/pseudofs/pseudofs.c Sun Jan 29 08:03:45 2012 (r230725) @@ -330,7 +330,7 @@ pfs_mount(struct pfs_info *pi, struct mo * Compatibility shim for old mount(2) system call */ int -pfs_cmount(struct mntarg *ma, void *data, int flags) +pfs_cmount(struct mntarg *ma, void *data, uint64_t flags) { int error; Modified: stable/9/sys/fs/pseudofs/pseudofs.h ============================================================================== --- stable/9/sys/fs/pseudofs/pseudofs.h Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/fs/pseudofs/pseudofs.h Sun Jan 29 08:03:45 2012 (r230725) @@ -242,7 +242,7 @@ struct pfs_node { * VFS interface */ int pfs_mount (struct pfs_info *pi, struct mount *mp); -int pfs_cmount (struct mntarg *ma, void *data, int flags); +int pfs_cmount (struct mntarg *ma, void *data, uint64_t flags); int pfs_unmount (struct mount *mp, int mntflags); int pfs_root (struct mount *mp, int flags, struct vnode **vpp); Modified: stable/9/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- stable/9/sys/fs/smbfs/smbfs_vfsops.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/fs/smbfs/smbfs_vfsops.c Sun Jan 29 08:03:45 2012 (r230725) @@ -98,7 +98,7 @@ MODULE_DEPEND(smbfs, libmchain, 1, 1, 1) int smbfs_pbuf_freecnt = -1; /* start out unlimited */ static int -smbfs_cmount(struct mntarg *ma, void * data, int flags) +smbfs_cmount(struct mntarg *ma, void * data, uint64_t flags) { struct smbfs_args args; int error; Modified: stable/9/sys/gnu/fs/reiserfs/reiserfs_vfsops.c ============================================================================== --- stable/9/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Sun Jan 29 08:03:45 2012 (r230725) @@ -49,7 +49,7 @@ MALLOC_DEFINE(M_REISERFSNODE, "reiserfs_ * -------------------------------------------------------------------*/ static int -reiserfs_cmount(struct mntarg *ma, void *data, int flags) +reiserfs_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct reiserfs_args args; struct export_args exp; Modified: stable/9/sys/kern/vfs_mount.c ============================================================================== --- stable/9/sys/kern/vfs_mount.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/kern/vfs_mount.c Sun Jan 29 08:03:45 2012 (r230725) @@ -70,8 +70,8 @@ __FBSDID("$FreeBSD$"); #define VFS_MOUNTARG_SIZE_MAX (1024 * 64) -static int vfs_domount(struct thread *td, const char *fstype, - char *fspath, int fsflags, struct vfsoptlist **optlist); +static int vfs_domount(struct thread *td, const char *fstype, char *fspath, + uint64_t fsflags, struct vfsoptlist **optlist); static void free_mntarg(struct mntarg *ma); static int usermount = 0; @@ -376,10 +376,18 @@ sys_nmount(td, uap) struct uio *auio; int error; u_int iovcnt; + uint64_t flags; - AUDIT_ARG_FFLAGS(uap->flags); + /* + * Mount flags are now 64-bits. On 32-bit archtectures only + * 32-bits are passed in, but from here on everything handles + * 64-bit flags correctly. + */ + flags = uap->flags; + + AUDIT_ARG_FFLAGS(flags); CTR4(KTR_VFS, "%s: iovp %p with iovcnt %d and flags %d", __func__, - uap->iovp, uap->iovcnt, uap->flags); + uap->iovp, uap->iovcnt, flags); /* * Filter out MNT_ROOTFS. We do not want clients of nmount() in @@ -388,7 +396,7 @@ sys_nmount(td, uap) * MNT_ROOTFS should only be set by the kernel when mounting its * root file system. */ - uap->flags &= ~MNT_ROOTFS; + flags &= ~MNT_ROOTFS; iovcnt = uap->iovcnt; /* @@ -407,7 +415,7 @@ sys_nmount(td, uap) __func__, error); return (error); } - error = vfs_donmount(td, uap->flags, auio); + error = vfs_donmount(td, flags, auio); free(auio, M_IOV); return (error); @@ -518,7 +526,7 @@ vfs_mount_destroy(struct mount *mp) } int -vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions) +vfs_donmount(struct thread *td, uint64_t fsflags, struct uio *fsoptions) { struct vfsoptlist *optlist; struct vfsopt *opt, *tmp_opt; @@ -694,9 +702,17 @@ sys_mount(td, uap) char *fstype; struct vfsconf *vfsp = NULL; struct mntarg *ma = NULL; + uint64_t flags; int error; - AUDIT_ARG_FFLAGS(uap->flags); + /* + * Mount flags are now 64-bits. On 32-bit archtectures only + * 32-bits are passed in, but from here on everything handles + * 64-bit flags correctly. + */ + flags = uap->flags; + + AUDIT_ARG_FFLAGS(flags); /* * Filter out MNT_ROOTFS. We do not want clients of mount() in @@ -705,7 +721,7 @@ sys_mount(td, uap) * MNT_ROOTFS should only be set by the kernel when mounting its * root file system. */ - uap->flags &= ~MNT_ROOTFS; + flags &= ~MNT_ROOTFS; fstype = malloc(MFSNAMELEN, M_TEMP, M_WAITOK); error = copyinstr(uap->type, fstype, MFSNAMELEN, NULL); @@ -729,11 +745,11 @@ sys_mount(td, uap) ma = mount_argsu(ma, "fstype", uap->type, MNAMELEN); ma = mount_argsu(ma, "fspath", uap->path, MNAMELEN); - ma = mount_argb(ma, uap->flags & MNT_RDONLY, "noro"); - ma = mount_argb(ma, !(uap->flags & MNT_NOSUID), "nosuid"); - ma = mount_argb(ma, !(uap->flags & MNT_NOEXEC), "noexec"); + ma = mount_argb(ma, flags & MNT_RDONLY, "noro"); + ma = mount_argb(ma, !(flags & MNT_NOSUID), "nosuid"); + ma = mount_argb(ma, !(flags & MNT_NOEXEC), "noexec"); - error = vfsp->vfc_vfsops->vfs_cmount(ma, uap->data, uap->flags); + error = vfsp->vfc_vfsops->vfs_cmount(ma, uap->data, flags); mtx_unlock(&Giant); return (error); } @@ -747,7 +763,7 @@ vfs_domount_first( struct vfsconf *vfsp, /* File system type. */ char *fspath, /* Mount path. */ struct vnode *vp, /* Vnode to be covered. */ - int fsflags, /* Flags common to all filesystems. */ + uint64_t fsflags, /* Flags common to all filesystems. */ struct vfsoptlist **optlist /* Options local to the filesystem. */ ) { @@ -856,14 +872,15 @@ static int vfs_domount_update( struct thread *td, /* Calling thread. */ struct vnode *vp, /* Mount point vnode. */ - int fsflags, /* Flags common to all filesystems. */ + uint64_t fsflags, /* Flags common to all filesystems. */ struct vfsoptlist **optlist /* Options local to the filesystem. */ ) { struct oexport_args oexport; struct export_args export; struct mount *mp; - int error, export_error, flag; + int error, export_error; + uint64_t flag; mtx_assert(&Giant, MA_OWNED); ASSERT_VOP_ELOCKED(vp, __func__); @@ -1000,7 +1017,7 @@ vfs_domount( struct thread *td, /* Calling thread. */ const char *fstype, /* Filesystem type. */ char *fspath, /* Mount path. */ - int fsflags, /* Flags common to all filesystems. */ + uint64_t fsflags, /* Flags common to all filesystems. */ struct vfsoptlist **optlist /* Options local to the filesystem. */ ) { @@ -1182,7 +1199,7 @@ dounmount(mp, flags, td) { struct vnode *coveredvp, *fsrootvp; int error; - int async_flag; + uint64_t async_flag; int mnt_gen_r; mtx_assert(&Giant, MA_OWNED); @@ -1891,7 +1908,7 @@ free_mntarg(struct mntarg *ma) * Mount a filesystem */ int -kernel_mount(struct mntarg *ma, int flags) +kernel_mount(struct mntarg *ma, uint64_t flags) { struct uio auio; int error; Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/kern/vfs_subr.c Sun Jan 29 08:03:45 2012 (r230725) @@ -2836,6 +2836,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) struct statfs *sp; struct vnode *vp; char buf[512]; + uint64_t mflags; u_int flags; if (!have_addr) { @@ -2857,13 +2858,13 @@ DB_SHOW_COMMAND(mount, db_show_mount) mp->mnt_stat.f_mntonname, mp->mnt_stat.f_fstypename); buf[0] = '\0'; - flags = mp->mnt_flag; + mflags = mp->mnt_flag; #define MNT_FLAG(flag) do { \ - if (flags & (flag)) { \ + if (mflags & (flag)) { \ if (buf[0] != '\0') \ strlcat(buf, ", ", sizeof(buf)); \ strlcat(buf, (#flag) + 4, sizeof(buf)); \ - flags &= ~(flag); \ + mflags &= ~(flag); \ } \ } while (0) MNT_FLAG(MNT_RDONLY); @@ -2901,11 +2902,11 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_FLAG(MNT_SNAPSHOT); MNT_FLAG(MNT_BYFSID); #undef MNT_FLAG - if (flags != 0) { + if (mflags != 0) { if (buf[0] != '\0') strlcat(buf, ", ", sizeof(buf)); snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), - "0x%08x", flags); + "0x%016jx", mflags); } db_printf(" mnt_flag = %s\n", buf); Modified: stable/9/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/9/sys/nfsclient/nfs_vfsops.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/nfsclient/nfs_vfsops.c Sun Jan 29 08:03:45 2012 (r230725) @@ -1187,7 +1187,7 @@ out: */ /* ARGSUSED */ static int -nfs_cmount(struct mntarg *ma, void *data, int flags) +nfs_cmount(struct mntarg *ma, void *data, uint64_t flags) { int error; struct nfs_args args; Modified: stable/9/sys/sys/mount.h ============================================================================== --- stable/9/sys/sys/mount.h Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/sys/mount.h Sun Jan 29 08:03:45 2012 (r230725) @@ -557,7 +557,7 @@ struct nameidata; struct sysctl_req; struct mntarg; -typedef int vfs_cmount_t(struct mntarg *ma, void *data, int flags); +typedef int vfs_cmount_t(struct mntarg *ma, void *data, uint64_t flags); typedef int vfs_unmount_t(struct mount *mp, int mntflags); typedef int vfs_root_t(struct mount *mp, int flags, struct vnode **vpp); typedef int vfs_quotactl_t(struct mount *mp, int cmds, uid_t uid, void *arg); @@ -700,7 +700,7 @@ extern char *mountrootfsname; int dounmount(struct mount *, int, struct thread *); -int kernel_mount(struct mntarg *ma, int flags); +int kernel_mount(struct mntarg *ma, uint64_t flags); int kernel_vmount(int flags, ...); struct mntarg *mount_arg(struct mntarg *ma, const char *name, const void *val, int len); struct mntarg *mount_argb(struct mntarg *ma, int flag, const char *name); @@ -737,7 +737,8 @@ int vfs_export /* process mount expor (struct mount *, struct export_args *); void vfs_allocate_syncvnode(struct mount *); void vfs_deallocate_syncvnode(struct mount *); -int vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions); +int vfs_donmount(struct thread *td, uint64_t fsflags, + struct uio *fsoptions); void vfs_getnewfsid(struct mount *); struct cdev *vfs_getrootfsid(struct mount *); struct mount *vfs_getvfs(fsid_t *); /* return vfs given fsid */ Modified: stable/9/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_snapshot.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/ufs/ffs/ffs_snapshot.c Sun Jan 29 08:03:45 2012 (r230725) @@ -225,10 +225,18 @@ ffs_snapshot(mp, snapfile) ump = VFSTOUFS(mp); fs = ump->um_fs; sn = NULL; + /* + * At the moment, journaled soft updates cannot support + * taking snapshots. + */ + if (MOUNTEDSUJ(mp)) { + vfs_mount_error(mp, "%s: Snapshots are not yet supported when " + "running with journaled soft updates", fs->fs_fsmnt); + return (EOPNOTSUPP); + } MNT_ILOCK(mp); flag = mp->mnt_flag; MNT_IUNLOCK(mp); - /* * Need to serialize access to snapshot code per filesystem. */ Modified: stable/9/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vfsops.c Sun Jan 29 04:44:52 2012 (r230724) +++ stable/9/sys/ufs/ffs/ffs_vfsops.c Sun Jan 29 08:03:45 2012 (r230725) @@ -144,7 +144,7 @@ ffs_mount(struct mount *mp) struct fs *fs; pid_t fsckpid = 0; int error, flags; - u_int mntorflags; + uint64_t mntorflags; accmode_t accmode; struct nameidata ndp; char *fspec; @@ -564,7 +564,7 @@ ffs_mount(struct mount *mp) */ static int -ffs_cmount(struct mntarg *ma, void *data, int flags) +ffs_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct ufs_args args; struct export_args exp; From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 08:33:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5FD9106564A; Sun, 29 Jan 2012 08:33:34 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4DA68FC12; Sun, 29 Jan 2012 08:33:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T8XYZN099046; Sun, 29 Jan 2012 08:33:34 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T8XY7b099044; Sun, 29 Jan 2012 08:33:34 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201290833.q0T8XY7b099044@svn.freebsd.org> From: Hiroki Sato Date: Sun, 29 Jan 2012 08:33: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: r230726 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 08:33:35 -0000 Author: hrs Date: Sun Jan 29 08:33:34 2012 New Revision: 230726 URL: http://svn.freebsd.org/changeset/base/230726 Log: Perform IPv6 DAD only in ifn_start. Modified: head/etc/rc.d/netif Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Sun Jan 29 08:03:45 2012 (r230725) +++ head/etc/rc.d/netif Sun Jan 29 08:33:34 2012 (r230726) @@ -138,10 +138,12 @@ network_common() done # inet6 address configuration needs sleep for DAD. - if [ -n "${_dadwait}" ]; then + case ${_func}:${_dadwait} in + ifn_start:1) sleep `${SYSCTL_N} net.inet6.ip6.dad_count` sleep 1 - fi + ;; + esac _str= if [ -n "${_ok}" ]; then From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 09:12:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 639E8106564A; Sun, 29 Jan 2012 09:12:34 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 523048FC12; Sun, 29 Jan 2012 09:12:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T9CYCH009370; Sun, 29 Jan 2012 09:12:34 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T9CYVE009368; Sun, 29 Jan 2012 09:12:34 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201201290912.q0T9CYVE009368@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 29 Jan 2012 09:12: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: r230727 - head/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 09:12:34 -0000 Author: nyan Date: Sun Jan 29 09:12:34 2012 New Revision: 230727 URL: http://svn.freebsd.org/changeset/base/230727 Log: Fix build when RELEASE_CRUNCH is defined. Modified: head/sbin/camcontrol/Makefile Modified: head/sbin/camcontrol/Makefile ============================================================================== --- head/sbin/camcontrol/Makefile Sun Jan 29 08:33:34 2012 (r230726) +++ head/sbin/camcontrol/Makefile Sun Jan 29 09:12:34 2012 (r230727) @@ -1,9 +1,9 @@ # $FreeBSD$ PROG= camcontrol -SRCS= camcontrol.c fwdownload.c util.c +SRCS= camcontrol.c util.c .if !defined(RELEASE_CRUNCH) -SRCS+= modeedit.c +SRCS+= fwdownload.c modeedit.c .else CFLAGS+= -DMINIMALISTIC .endif From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 10:55:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37BFA1065670; Sun, 29 Jan 2012 10:55:20 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B9698FC0A; Sun, 29 Jan 2012 10:55:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TAtJ3N031537; Sun, 29 Jan 2012 10:55:19 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TAtJTl031536; Sun, 29 Jan 2012 10:55:19 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201201291055.q0TAtJTl031536@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sun, 29 Jan 2012 10:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230728 - stable/9/sbin/dhclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 10:55:20 -0000 Author: dumbbell Date: Sun Jan 29 10:55:19 2012 New Revision: 230728 URL: http://svn.freebsd.org/changeset/base/230728 Log: MFC r229002: Set svn:executable on dhclient-script Sponsored by: Yakaz (http://www.yakaz.com) Modified: Directory Properties: stable/9/sbin/dhclient/ (props changed) stable/9/sbin/dhclient/dhclient-script (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 11:00:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE6A11065670; Sun, 29 Jan 2012 11:00:00 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B69728FC08; Sun, 29 Jan 2012 11:00:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TB007g031727; Sun, 29 Jan 2012 11:00:00 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TB00rn031725; Sun, 29 Jan 2012 11:00:00 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201201291100.q0TB00rn031725@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sun, 29 Jan 2012 11:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230729 - stable/8/sbin/dhclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 11:00:01 -0000 Author: dumbbell Date: Sun Jan 29 11:00:00 2012 New Revision: 230729 URL: http://svn.freebsd.org/changeset/base/230729 Log: MFC r229002: Set svn:executable on dhclient-script Sponsored by: Yakaz (http://www.yakaz.com) Modified: Directory Properties: stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dhclient/dhclient-script (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:25:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4404A106566B; Sun, 29 Jan 2012 12:25:22 +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 168B68FC12; Sun, 29 Jan 2012 12:25:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TCPLXR034702; Sun, 29 Jan 2012 12:25:21 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TCPLeI034700; Sun, 29 Jan 2012 12:25:21 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201291225.q0TCPLeI034700@svn.freebsd.org> From: Martin Matuska Date: Sun, 29 Jan 2012 12:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230730 - stable/9/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:25:22 -0000 Author: mm Date: Sun Jan 29 12:25:21 2012 New Revision: 230730 URL: http://svn.freebsd.org/changeset/base/230730 Log: MFC r230449: Merge illumos revisions 13540, 13562: illumos rev 13540 [1]: Removal of pyzfs broke delegation for volumes illumos rev 13562 [2]: zfs allow arguments not parsed correctly after pyzfs removal References: https://www.illumos.org/issues/1726 [1] https://www.illumos.org/issues/1977 [2] Obtained from: illumos (issues #1726, #1977) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Jan 29 11:00:00 2012 (r230729) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Jan 29 12:25:21 2012 (r230730) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. @@ -4489,7 +4489,7 @@ parse_allow_args(int argc, char **argv, argc--; argv++; opts->dataset = munge_args(argc, argv, un, 2, &opts->perms); - } else if (argc == 1) { + } else if (argc == 1 && !un) { opts->prt_perms = B_TRUE; opts->dataset = argv[argc-1]; } else { @@ -4976,9 +4976,9 @@ zfs_do_allow_unallow_impl(int argc, char parse_allow_args(argc, argv, un, &opts); /* try to open the dataset */ - if ((zhp = zfs_open(g_zfs, opts.dataset, ZFS_TYPE_FILESYSTEM)) - == NULL) { - (void) fprintf(stderr, "Failed to open Dataset *%s*\n", + if ((zhp = zfs_open(g_zfs, opts.dataset, ZFS_TYPE_FILESYSTEM | + ZFS_TYPE_VOLUME)) == NULL) { + (void) fprintf(stderr, "Failed to open dataset: %s\n", opts.dataset); return (-1); } @@ -4988,7 +4988,7 @@ zfs_do_allow_unallow_impl(int argc, char fs_perm_set_init(&fs_perm_set); if (parse_fs_perm_set(&fs_perm_set, perm_nvl) != 0) { - (void) fprintf(stderr, "Failed to parse fsacl permissionsn"); + (void) fprintf(stderr, "Failed to parse fsacl permissions\n"); goto cleanup1; } From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:26:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3BAE10656FB; Sun, 29 Jan 2012 12:26:09 +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 C775A8FC1C; Sun, 29 Jan 2012 12:26:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TCQ9LX034764; Sun, 29 Jan 2012 12:26:09 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TCQ9Ue034762; Sun, 29 Jan 2012 12:26:09 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201291226.q0TCQ9Ue034762@svn.freebsd.org> From: Martin Matuska Date: Sun, 29 Jan 2012 12:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230731 - stable/8/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:26:10 -0000 Author: mm Date: Sun Jan 29 12:26:09 2012 New Revision: 230731 URL: http://svn.freebsd.org/changeset/base/230731 Log: MFC r230449: Merge illumos revisions 13540, 13562: illumos rev 13540 [1]: Removal of pyzfs broke delegation for volumes illumos rev 13562 [2]: zfs allow arguments not parsed correctly after pyzfs removal References: https://www.illumos.org/issues/1726 [1] https://www.illumos.org/issues/1977 [2] Obtained from: illumos (issues #1726, #1977) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Jan 29 12:25:21 2012 (r230730) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Jan 29 12:26:09 2012 (r230731) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. @@ -4489,7 +4489,7 @@ parse_allow_args(int argc, char **argv, argc--; argv++; opts->dataset = munge_args(argc, argv, un, 2, &opts->perms); - } else if (argc == 1) { + } else if (argc == 1 && !un) { opts->prt_perms = B_TRUE; opts->dataset = argv[argc-1]; } else { @@ -4976,9 +4976,9 @@ zfs_do_allow_unallow_impl(int argc, char parse_allow_args(argc, argv, un, &opts); /* try to open the dataset */ - if ((zhp = zfs_open(g_zfs, opts.dataset, ZFS_TYPE_FILESYSTEM)) - == NULL) { - (void) fprintf(stderr, "Failed to open Dataset *%s*\n", + if ((zhp = zfs_open(g_zfs, opts.dataset, ZFS_TYPE_FILESYSTEM | + ZFS_TYPE_VOLUME)) == NULL) { + (void) fprintf(stderr, "Failed to open dataset: %s\n", opts.dataset); return (-1); } @@ -4988,7 +4988,7 @@ zfs_do_allow_unallow_impl(int argc, char fs_perm_set_init(&fs_perm_set); if (parse_fs_perm_set(&fs_perm_set, perm_nvl) != 0) { - (void) fprintf(stderr, "Failed to parse fsacl permissionsn"); + (void) fprintf(stderr, "Failed to parse fsacl permissions\n"); goto cleanup1; } From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:37:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCDE51065672; Sun, 29 Jan 2012 12:37:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 039A18FC13; Sun, 29 Jan 2012 12:37:37 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0TCbUPf031570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 29 Jan 2012 23:37:33 +1100 Date: Sun, 29 Jan 2012 23:37:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kostik Belousov In-Reply-To: <20120129062327.GK2726@deviant.kiev.zoral.com.ua> Message-ID: <20120129223232.F925@besplex.bde.org> References: <201201261159.q0QBxma2086162@svn.freebsd.org> <20120126233110.C960@besplex.bde.org> <20120126153641.GA68112@FreeBSD.org> <20120127194612.H1547@besplex.bde.org> <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> <20120127194221.GA25723@zim.MIT.EDU> <20120128123748.GD2726@deviant.kiev.zoral.com.ua> <20120129001225.GA32220@zim.MIT.EDU> <20120129062327.GK2726@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:37:38 -0000 On Sun, 29 Jan 2012, Kostik Belousov wrote: > On Sat, Jan 28, 2012 at 07:12:25PM -0500, David Schultz wrote: >> On Sat, Jan 28, 2012, Kostik Belousov wrote: >>> On Fri, Jan 27, 2012 at 02:42:21PM -0500, David Schultz wrote: >>>> On Fri, Jan 27, 2012, Kostik Belousov wrote: >>>>> On Fri, Jan 27, 2012 at 07:50:30PM +1100, Bruce Evans wrote: >>>>>> On Thu, 26 Jan 2012, Gleb Smirnoff wrote: >>>>>> >>>>>>> On Thu, Jan 26, 2012 at 11:53:57PM +1100, Bruce Evans wrote: >>>>>>> B> > @@ -1552,6 +1552,12 @@ aio_aqueue(struct thread *td, struct aio >>>>>>> B> > return (error); >>>>>>> B> > } >>>>>>> B> > >>>>>>> B> > + /* XXX: aio_nbytes is later casted to signed types. */ >>>>>>> B> > + if ((int)aiocbe->uaiocb.aio_nbytes < 0) { >>>>>>> B> >>>>>>> B> This should avoid implementation-defined behaviour by checking if >>>>>>> B> >>>>>>> B> (uncast)aiocbe->uaiocb.aio_nbytes > INT_MAX. >>>>>> >>>>>>> Is the attached patch okay? >>>>>> >>>>>> Yes. It now matches the style used for read^Wsys_read() and friends. >>>>>> This used to have to fit the count in "int uio_resid". uio_resid now >>>>>> has type ssize_t, but for some reason the old INT_MAX limits remain. >>>>> >>>>> Well, I can revive the patch. I still think it is good to get rid of >>>>> the limit. >>>> >>>> The correct limit on the maximum size of a single read/write is >>>> SSIZE_MAX, but FreeBSD uses INT_MAX. It's not safe to raise the >>>> limit yet, though, because of bugs in several filesystems. For >>>> example, FFS copies uio_resid into a local variable of type int. >>>> I have some old patches that fix some of these issues for FFS and >>>> cd9660, but surely there are more places I didn't notice. >>>> >>> Absolutely agree. >>> >>> http://people.freebsd.org/~kib/misc/uio_resid.5.patch >> >> Nice. You found a lot more than I've got in my tree, and you even >> fixed the return values. There are at least a few more places to >> fix. For instance, cd9660 and the NFS client pass uio_resid or >> iov_len to min(), which operates on ints. (Incidentally, C11 >> generics ought to make it possible to write type-generic min() >> and max() functions.) So does gnu typeof(), and much more portably in practice (we're still waiting for a C99 compiler). > Thank you, http://people.freebsd.org/~kib/misc/uio_resid.6.patch > changed them to MIN(). Ugh, the existence of MIN() is API breakage (similarly for MAX()): - in FreeBSD-1 (and probably in Net/2), MIN() was min() in the kernel, where min() was an extern function with the same semantics as the current inline min(). This was quite broken, since MIN() is almost type-generic, while min() forces everything to u_int. min() was implemented in kern/subr_xxx.c. FreeBSD-1 (and maybe Net/2) also had imin/max(), lmin/max() and ulmin/max() there. - 4.4BSD completed removing MIN() in the kernel. It was left undefined. This was fragile, and probably still more broken than old code that used MIN(), since the conversions given by prototypes combined with no warnings for dangerous conversions tend to give even more sign extension and overflow bugs that the implicit conversions in MIN(). - MIN() remained intentionally left out in the kernel in FreeBSD-[2-4]. Some contribed code that didn't know the BSD API rolled its own MIN() and used that. There are no less than 38 home made definitions of MIN() in FreeBSD-4 to replace the one that is intentionally left out :-(. Some of these are ifdefed, but since the system doesn't have MIN(), they are always used. - the API was broken in FreeBSD-5 by removing the ifdef that left out MIN(). - even more code that doesn't know the old BSD API now uses MIN(). Now there are only 16 home made definitions of MIN(). Most of these are ifdefed. I have had (but not used) the following fairly type-generic and safe macros for min() since FreeBSD-~2.0: % Index: libkern.h % =================================================================== % RCS file: /home/ncvs/src/sys/sys/libkern.h,v % retrieving revision 1.45 % diff -u -2 -r1.45 libkern.h % --- libkern.h 7 Apr 2004 04:19:49 -0000 1.45 % +++ libkern.h 7 Apr 2004 11:31:02 -0000 % @@ -49,4 +51,74 @@ % #define hex2ascii(hex) (hex2ascii_data[hex]) % % +#if 0 % +#define __max(x, y) \ % +({ \ % + __typeof(x) __x = (x); \ % + __typeof(y) __y = (y); \ % + __x > __y ? __x : __y; \ % +}) % + % +#define __min(x, y) \ % +({ \ % + __typeof(x) __x = (x); \ % + __typeof(y) __y = (y); \ % + __x < __y ? __x : __y; \ % +}) % +#endif Normal use of gnu typeof() to write safe type-generic macros for things like this. This is almost verbatime from gcc.info. % + % +#define __max(x, y) \ % +( \ % + (sizeof(x) == 8 || sizeof(y) == 8) ? \ % + ((__typeof(x))-1 == -1 && (__typeof(y))-1 == -1) ? \ % + _qmax((x), (y)) \ % + : \ % + _uqmax((x), (y)) \ % + : \ % + ((__typeof(x))-1 == -1 && (__typeof(y))-1 == -1) ? \ % + _imax((x), (y)) \ % + : \ % + _max((x), (y)) \ % +) % + % +#define __min(x, y) \ % +( \ % + (sizeof(x) == 8 || sizeof(y) == 8) ? \ % + ((__typeof(x))-1 == -1 && (__typeof(y))-1 == -1) ? \ % + _qmin((x), (y)) \ % + : \ % + _uqmin((x), (y)) \ % + : \ % + ((__typeof(x))-1 == -1 && (__typeof(y))-1 == -1) ? \ % + _imin((x), (y)) \ % + : \ % + _min((x), (y)) \ % +) Since I didn't want to use gccisms back in FreeBSD-~2.0 before use of gccisms became ubiquitous, I tried to use typeof() just to select the correct inline function like the programmer should. Errors were then detected by the above picking a different one than the one used causing the object file to change (if I was lucky, the object file didn't change due to just the extra complexity in the above). I committed a few fixes for type errors found by this. % + % +#ifdef MACRO_MAX % +static __inline int _imax(int a, int b) { return (a > b ? a : b); } % +static __inline int _imin(int a, int b) { return (a < b ? a : b); } % +static __inline long lmax(long a, long b) { return (a > b ? a : b); } % +static __inline long lmin(long a, long b) { return (a < b ? a : b); } % +static __inline u_int _max(u_int a, u_int b) { return (a > b ? a : b); } % +static __inline u_int _min(u_int a, u_int b) { return (a < b ? a : b); } % +static __inline quad_t _qmax(quad_t a, quad_t b) { return (a > b ? a : b); } % +static __inline quad_t _qmin(quad_t a, quad_t b) { return (a < b ? a : b); } % +static __inline u_long ulmax(u_long a, u_long b) { return (a > b ? a : b); } % +static __inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); } % +static __inline u_quad_t _uqmax(u_quad_t a, u_quad_t b) { return (a > b ? a : b); } % +static __inline u_quad_t _uqmin(u_quad_t a, u_quad_t b) { return (a < b ? a : b); } Rename the inlines so that the top level API can use either them or the ones that do the selection. % + % +#define imax(a, b) __max((a), (b)) % +#define imin(a, b) __min((a), (b)) % +#define lmax(a, b) __max((a), (b)) % +#define lmin(a, b) __min((a), (b)) % +#define max(a, b) __max((a), (b)) % +#define min(a, b) __min((a), (b)) % +#define qmax(a, b) __max((a), (b)) % +#define qmin(a, b) __min((a), (b)) % +#define ulmax(a, b) __max((a), (b)) % +#define ulmin(a, b) __min((a), (b)) % +#else But normally, don't use any of the above additions. % +#ifdef __GNUC__ % static __inline int imax(int a, int b) { return (a > b ? a : b); } % static __inline int imin(int a, int b) { return (a < b ? a : b); } % @@ -63,4 +135,6 @@ % static __inline long labs(long a) { return (a < 0 ? -a : a); } % static __inline quad_t qabs(quad_t a) { return (a < 0 ? -a : a); } % +#endif % +#endif % % /* Prototypes for non-quad routines. */ What should happen is that everyone should use a type-generic safe macro named min() and not provide home made versions of it or MIN(), but the namespace has been horribly messed up by using min() for the u_int function. MIN() is not so broken, but since its name says that it is unsafe, careful users of it should be adding extra code in some cases to avoid multiple evaluations of its args, either for correctness or efficiency. I haven't noticed any problems from multiple evaluations for MIN(), but I noticed one for an mtx macro (most mtx APIs are macros, and are unsafe despite their name, and despite them copying a parameter to a local variable in a few places. Since they mostly return void, they can use the do-while hack to get a block with local variables, and don't require the extra unportability given by the gcc statement-expressions used in the above). Bruce From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:49:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B21C106566B; Sun, 29 Jan 2012 12:49:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 594F78FC0A; Sun, 29 Jan 2012 12:49:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TCnhfF035549; Sun, 29 Jan 2012 12:49:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TCnhCh035547; Sun, 29 Jan 2012 12:49:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291249.q0TCnhCh035547@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 12:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230732 - stable/8/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:49:43 -0000 Author: marius Date: Sun Jan 29 12:49:43 2012 New Revision: 230732 URL: http://svn.freebsd.org/changeset/base/230732 Log: MFC: r228005 Change another instance of amd(4) to esp(4) missed in r227006 (MFC'ed to stable/8 in r227306). Submitted by: Garrett Cooper Modified: stable/8/sys/mips/conf/OCTEON1 Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/mips/conf/OCTEON1 ============================================================================== --- stable/8/sys/mips/conf/OCTEON1 Sun Jan 29 12:26:09 2012 (r230731) +++ stable/8/sys/mips/conf/OCTEON1 Sun Jan 29 12:49:43 2012 (r230732) @@ -117,7 +117,7 @@ options AHC_REG_PRETTY_PRINT # Print re device ahd # AHA39320/29320 and onboard AIC79xx devices options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. -device amd # AMD 53C974 (Tekram DC-390(T)) +device esp # AMD Am53C974 (Tekram DC-390(T)) device hptiop # Highpoint RocketRaid 3xxx series device isp # Qlogic family #device ispfw # Firmware for QLogic HBAs- normally a module From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:50:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB6201065670; Sun, 29 Jan 2012 12:50:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9E568FC1F; Sun, 29 Jan 2012 12:50:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TCohYj035627; Sun, 29 Jan 2012 12:50:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TCohYl035625; Sun, 29 Jan 2012 12:50:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291250.q0TCohYl035625@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 12:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230733 - stable/9/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:50:44 -0000 Author: marius Date: Sun Jan 29 12:50:43 2012 New Revision: 230733 URL: http://svn.freebsd.org/changeset/base/230733 Log: MFC: r228005 Change another instance of amd(4) to esp(4) missed in r227006 (MFC'ed to stable/9 in r227305). Submitted by: Garrett Cooper Modified: stable/9/sys/mips/conf/OCTEON1 Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/mips/conf/OCTEON1 ============================================================================== --- stable/9/sys/mips/conf/OCTEON1 Sun Jan 29 12:49:43 2012 (r230732) +++ stable/9/sys/mips/conf/OCTEON1 Sun Jan 29 12:50:43 2012 (r230733) @@ -114,7 +114,7 @@ options AHC_REG_PRETTY_PRINT # Print re device ahd # AHA39320/29320 and onboard AIC79xx devices options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. -device amd # AMD 53C974 (Tekram DC-390(T)) +device esp # AMD Am53C974 (Tekram DC-390(T)) device hptiop # Highpoint RocketRaid 3xxx series device isp # Qlogic family #device ispfw # Firmware for QLogic HBAs- normally a module From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:52:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1F15106566C; Sun, 29 Jan 2012 12:52:34 +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 75CCA8FC14; Sun, 29 Jan 2012 12:52:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TCqYpD035754; Sun, 29 Jan 2012 12:52:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TCqYlR035752; Sun, 29 Jan 2012 12:52:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291252.q0TCqYlR035752@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 12:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230734 - stable/9/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:52:34 -0000 Author: marius Date: Sun Jan 29 12:52:34 2012 New Revision: 230734 URL: http://svn.freebsd.org/changeset/base/230734 Log: MFC: r228024 Update comment. Modified: stable/9/sys/sparc64/sparc64/ata_machdep.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/sparc64/ata_machdep.c ============================================================================== --- stable/9/sys/sparc64/sparc64/ata_machdep.c Sun Jan 29 12:50:43 2012 (r230733) +++ stable/9/sys/sparc64/sparc64/ata_machdep.c Sun Jan 29 12:52:34 2012 (r230734) @@ -36,14 +36,13 @@ sparc64_ata_disk_firmware_geom_adjust(st { /* - * The Sun disk label only uses 16-bit fields for cylinders, - * heads and sectors so the geometry of large IDE disks has - * to be adjusted. If the disk is > 32GB at 16 heads and 63 - * sectors, the sectors have to be adjusted to 255. If the - * the disk is even > 128GB, additionally adjust the heads - * to 255. - * XXX the OpenSolaris dad(7D) driver limits the mediasize - * to 128GB. + * The VTOC8 disk label only uses 16-bit fields for cylinders, heads + * and sectors so the geometry of large disks has to be adjusted. + * If the disk is > 32GB at 16 heads and 63 sectors, adjust to 255 + * sectors (this matches what the OpenSolaris dad(7D) driver does). + * If the the disk is even > 128GB, additionally adjust the heads to + * 255. This allows disks up to the 2TB limit of the extended VTOC8. + * XXX the OpenSolaris dad(7D) driver limits the mediasize to 128GB. */ if (disk->d_mediasize > (off_t)65535 * 16 * 63 * disk->d_sectorsize) disk->d_fwsectors = 255; From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:52:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 976911065674; Sun, 29 Jan 2012 12:52:36 +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 816998FC17; Sun, 29 Jan 2012 12:52:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TCqa3m035785; Sun, 29 Jan 2012 12:52:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TCqa9f035783; Sun, 29 Jan 2012 12:52:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291252.q0TCqa9f035783@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 12:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230735 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:52:36 -0000 Author: marius Date: Sun Jan 29 12:52:36 2012 New Revision: 230735 URL: http://svn.freebsd.org/changeset/base/230735 Log: MFC: r228024 Update comment. Modified: stable/8/sys/sparc64/sparc64/ata_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/sparc64/ata_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/ata_machdep.c Sun Jan 29 12:52:34 2012 (r230734) +++ stable/8/sys/sparc64/sparc64/ata_machdep.c Sun Jan 29 12:52:36 2012 (r230735) @@ -36,14 +36,13 @@ sparc64_ata_disk_firmware_geom_adjust(st { /* - * The Sun disk label only uses 16-bit fields for cylinders, - * heads and sectors so the geometry of large IDE disks has - * to be adjusted. If the disk is > 32GB at 16 heads and 63 - * sectors, the sectors have to be adjusted to 255. If the - * the disk is even > 128GB, additionally adjust the heads - * to 255. - * XXX the OpenSolaris dad(7D) driver limits the mediasize - * to 128GB. + * The VTOC8 disk label only uses 16-bit fields for cylinders, heads + * and sectors so the geometry of large disks has to be adjusted. + * If the disk is > 32GB at 16 heads and 63 sectors, adjust to 255 + * sectors (this matches what the OpenSolaris dad(7D) driver does). + * If the the disk is even > 128GB, additionally adjust the heads to + * 255. This allows disks up to the 2TB limit of the extended VTOC8. + * XXX the OpenSolaris dad(7D) driver limits the mediasize to 128GB. */ if (disk->d_mediasize > (off_t)65535 * 16 * 63 * disk->d_sectorsize) disk->d_fwsectors = 255; From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:54:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83162106566C; Sun, 29 Jan 2012 12:54:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 671DA8FC0A; Sun, 29 Jan 2012 12:54:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TCsV4q035909; Sun, 29 Jan 2012 12:54:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TCsVAg035905; Sun, 29 Jan 2012 12:54:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291254.q0TCsVAg035905@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 12:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230736 - in stable/9/sys: cam pc98/include pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:54:31 -0000 Author: marius Date: Sun Jan 29 12:54:31 2012 New Revision: 230736 URL: http://svn.freebsd.org/changeset/base/230736 Log: MFC: r228027 Move the scsi_da_bios_params() prototype from pc98_machdep.h to md_var.h where the prototype for pc98_ata_disk_firmware_geom_adjust() also lives in order to avoid an #ifdef'ed include in cam(4). Modified: stable/9/sys/cam/cam_xpt.c stable/9/sys/pc98/include/md_var.h stable/9/sys/pc98/pc98/pc98_machdep.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Sun Jan 29 12:52:36 2012 (r230735) +++ stable/9/sys/cam/cam_xpt.c Sun Jan 29 12:54:31 2012 (r230736) @@ -48,10 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef PC98 -#include /* geometry translation */ -#endif - #include #include #include Modified: stable/9/sys/pc98/include/md_var.h ============================================================================== --- stable/9/sys/pc98/include/md_var.h Sun Jan 29 12:52:36 2012 (r230735) +++ stable/9/sys/pc98/include/md_var.h Sun Jan 29 12:54:31 2012 (r230736) @@ -39,10 +39,10 @@ extern int need_pre_dma_flush; extern int need_post_dma_flush; /* - * The ad driver maps the IDE disk's actual geometry to the firmware's - * notion of geometry. However, PC98 machines need to do something - * different sometimes, so override the hook so we can do so. + * The geometry of disks might need adjustment on PC98 machines. */ +struct ccb_calc_geometry; +int scsi_da_bios_params(struct ccb_calc_geometry *); struct disk; void pc98_ata_disk_firmware_geom_adjust(struct disk *); #define ata_disk_firmware_geom_adjust(disk) \ Modified: stable/9/sys/pc98/pc98/pc98_machdep.h ============================================================================== --- stable/9/sys/pc98/pc98/pc98_machdep.h Sun Jan 29 12:52:36 2012 (r230735) +++ stable/9/sys/pc98/pc98/pc98_machdep.h Sun Jan 29 12:54:31 2012 (r230736) @@ -33,9 +33,6 @@ void pc98_init_dmac(void); unsigned int pc98_getmemsize(unsigned *, unsigned *); -struct ccb_calc_geometry; -int scsi_da_bios_params(struct ccb_calc_geometry *); - #define PC98_VECTOR_SIZE (0x400) #define PC98_SYSTEM_PARAMETER_SIZE (0x240) #define PC98_SAVE_AREA (0xa1000) From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:54:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64D9B1065757; Sun, 29 Jan 2012 12:54:37 +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 034188FC0C; Sun, 29 Jan 2012 12:54:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TCsadG035948; Sun, 29 Jan 2012 12:54:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TCsa3P035944; Sun, 29 Jan 2012 12:54:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291254.q0TCsa3P035944@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 12:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230737 - in stable/8/sys: cam pc98/include pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:54:43 -0000 Author: marius Date: Sun Jan 29 12:54:36 2012 New Revision: 230737 URL: http://svn.freebsd.org/changeset/base/230737 Log: MFC: r228027 Move the scsi_da_bios_params() prototype from pc98_machdep.h to md_var.h where the prototype for pc98_ata_disk_firmware_geom_adjust() also lives in order to avoid an #ifdef'ed include in cam(4). Modified: stable/8/sys/cam/cam_xpt.c stable/8/sys/pc98/include/md_var.h stable/8/sys/pc98/pc98/pc98_machdep.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Sun Jan 29 12:54:31 2012 (r230736) +++ stable/8/sys/cam/cam_xpt.c Sun Jan 29 12:54:36 2012 (r230737) @@ -49,10 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef PC98 -#include /* geometry translation */ -#endif - #include #include #include Modified: stable/8/sys/pc98/include/md_var.h ============================================================================== --- stable/8/sys/pc98/include/md_var.h Sun Jan 29 12:54:31 2012 (r230736) +++ stable/8/sys/pc98/include/md_var.h Sun Jan 29 12:54:36 2012 (r230737) @@ -39,10 +39,10 @@ extern int need_pre_dma_flush; extern int need_post_dma_flush; /* - * The ad driver maps the IDE disk's actual geometry to the firmware's - * notion of geometry. However, PC98 machines need to do something - * different sometimes, so override the hook so we can do so. + * The geometry of disks might need adjustment on PC98 machines. */ +struct ccb_calc_geometry; +int scsi_da_bios_params(struct ccb_calc_geometry *); struct disk; void pc98_ata_disk_firmware_geom_adjust(struct disk *); #define ata_disk_firmware_geom_adjust(disk) \ Modified: stable/8/sys/pc98/pc98/pc98_machdep.h ============================================================================== --- stable/8/sys/pc98/pc98/pc98_machdep.h Sun Jan 29 12:54:31 2012 (r230736) +++ stable/8/sys/pc98/pc98/pc98_machdep.h Sun Jan 29 12:54:36 2012 (r230737) @@ -33,9 +33,6 @@ void pc98_init_dmac(void); unsigned int pc98_getmemsize(unsigned *, unsigned *); -struct ccb_calc_geometry; -int scsi_da_bios_params(struct ccb_calc_geometry *); - #define PC98_VECTOR_SIZE (0x400) #define PC98_SYSTEM_PARAMETER_SIZE (0x240) #define PC98_SAVE_AREA (0xa1000) From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:56:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3B0E106567B; Sun, 29 Jan 2012 12:56:18 +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 B75008FC08; Sun, 29 Jan 2012 12:56:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TCuIvQ036078; Sun, 29 Jan 2012 12:56:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TCuIOb036076; Sun, 29 Jan 2012 12:56:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291256.q0TCuIOb036076@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 12:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230738 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:56:18 -0000 Author: marius Date: Sun Jan 29 12:56:18 2012 New Revision: 230738 URL: http://svn.freebsd.org/changeset/base/230738 Log: MFC: r228209 - In device_probe_child(9) check the return value of device_set_driver(9) when actually setting a driver as especially ENOMEM is fatal in these cases. - Annotate other calls to device_set_devclass(9) and device_set_driver(9) without the return value being checked and that are okay to fail. Reviewed by: yongari (slightly earlier version) Modified: stable/9/sys/kern/subr_bus.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/subr_bus.c ============================================================================== --- stable/9/sys/kern/subr_bus.c Sun Jan 29 12:54:36 2012 (r230737) +++ stable/9/sys/kern/subr_bus.c Sun Jan 29 12:56:18 2012 (r230738) @@ -1129,7 +1129,7 @@ devclass_driver_deleted(devclass_t buscl dev->parent->devclass == busclass) { if ((error = device_detach(dev)) != 0) return (error); - device_set_driver(dev, NULL); + (void)device_set_driver(dev, NULL); BUS_PROBE_NOMATCH(dev->parent, dev); devnomatch(dev); dev->flags |= DF_DONENOMATCH; @@ -2007,19 +2007,22 @@ device_probe_child(device_t dev, device_ for (dl = first_matching_driver(dc, child); dl; dl = next_matching_driver(dc, child, dl)) { - /* If this driver's pass is too high, then ignore it. */ if (dl->pass > bus_current_pass) continue; PDEBUG(("Trying %s", DRIVERNAME(dl->driver))); - device_set_driver(child, dl->driver); + result = device_set_driver(child, dl->driver); + if (result == ENOMEM) + return (result); + else if (result != 0) + continue; if (!hasclass) { if (device_set_devclass(child, dl->driver->name)) { printf("driver bug: Unable to set devclass (devname: %s)\n", (child ? device_get_name(child) : "no device")); - device_set_driver(child, NULL); + (void)device_set_driver(child, NULL); continue; } } @@ -2033,7 +2036,7 @@ device_probe_child(device_t dev, device_ /* Reset flags and devclass before the next probe. */ child->devflags = 0; if (!hasclass) - device_set_devclass(child, NULL); + (void)device_set_devclass(child, NULL); /* * If the driver returns SUCCESS, there can be @@ -2050,7 +2053,7 @@ device_probe_child(device_t dev, device_ * certainly doesn't match. */ if (result > 0) { - device_set_driver(child, NULL); + (void)device_set_driver(child, NULL); continue; } @@ -2113,7 +2116,9 @@ device_probe_child(device_t dev, device_ if (result != 0) return (result); } - device_set_driver(child, best->driver); + result = device_set_driver(child, best->driver); + if (result != 0) + return (result); resource_int_value(best->driver->name, child->unit, "flags", &child->devflags); @@ -2722,8 +2727,8 @@ device_attach(device_t dev) dev->driver->name, dev->unit, error); /* Unset the class; set in device_probe_child */ if (dev->devclass == NULL) - device_set_devclass(dev, NULL); - device_set_driver(dev, NULL); + (void)device_set_devclass(dev, NULL); + (void)device_set_driver(dev, NULL); device_sysctl_fini(dev); dev->state = DS_NOTPRESENT; return (error); @@ -2776,7 +2781,7 @@ device_detach(device_t dev) devclass_delete_device(dev->devclass, dev); dev->state = DS_NOTPRESENT; - device_set_driver(dev, NULL); + (void)device_set_driver(dev, NULL); device_set_desc(dev, NULL); device_sysctl_fini(dev); @@ -4613,7 +4618,6 @@ print_driver(driver_t *driver, int inden print_driver_short(driver, indent); } - static void print_driver_list(driver_list_t drivers, int indent) { From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:56:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70DB11065676; Sun, 29 Jan 2012 12:56:21 +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 549758FC18; Sun, 29 Jan 2012 12:56:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TCuL0Y036112; Sun, 29 Jan 2012 12:56:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TCuLL6036110; Sun, 29 Jan 2012 12:56:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291256.q0TCuLL6036110@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 12:56:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230739 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:56:21 -0000 Author: marius Date: Sun Jan 29 12:56:21 2012 New Revision: 230739 URL: http://svn.freebsd.org/changeset/base/230739 Log: MFC: r228209 - In device_probe_child(9) check the return value of device_set_driver(9) when actually setting a driver as especially ENOMEM is fatal in these cases. - Annotate other calls to device_set_devclass(9) and device_set_driver(9) without the return value being checked and that are okay to fail. Reviewed by: yongari (slightly earlier version) Modified: stable/8/sys/kern/subr_bus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Sun Jan 29 12:56:18 2012 (r230738) +++ stable/8/sys/kern/subr_bus.c Sun Jan 29 12:56:21 2012 (r230739) @@ -1165,7 +1165,7 @@ devclass_driver_deleted(devclass_t buscl dev->parent->devclass == busclass) { if ((error = device_detach(dev)) != 0) return (error); - device_set_driver(dev, NULL); + (void)device_set_driver(dev, NULL); BUS_PROBE_NOMATCH(dev->parent, dev); devnomatch(dev); dev->flags |= DF_DONENOMATCH; @@ -2010,19 +2010,22 @@ device_probe_child(device_t dev, device_ for (dl = first_matching_driver(dc, child); dl; dl = next_matching_driver(dc, child, dl)) { - /* If this driver's pass is too high, then ignore it. */ if (dl->pass > bus_current_pass) continue; PDEBUG(("Trying %s", DRIVERNAME(dl->driver))); - device_set_driver(child, dl->driver); + result = device_set_driver(child, dl->driver); + if (result == ENOMEM) + return (result); + else if (result != 0) + continue; if (!hasclass) { if (device_set_devclass(child, dl->driver->name)) { printf("driver bug: Unable to set devclass (devname: %s)\n", (child ? device_get_name(child) : "no device")); - device_set_driver(child, NULL); + (void)device_set_driver(child, NULL); continue; } } @@ -2036,7 +2039,7 @@ device_probe_child(device_t dev, device_ /* Reset flags and devclass before the next probe. */ child->devflags = 0; if (!hasclass) - device_set_devclass(child, NULL); + (void)device_set_devclass(child, NULL); /* * If the driver returns SUCCESS, there can be @@ -2053,7 +2056,7 @@ device_probe_child(device_t dev, device_ * certainly doesn't match. */ if (result > 0) { - device_set_driver(child, NULL); + (void)device_set_driver(child, NULL); continue; } @@ -2116,7 +2119,9 @@ device_probe_child(device_t dev, device_ if (result != 0) return (result); } - device_set_driver(child, best->driver); + result = device_set_driver(child, best->driver); + if (result != 0) + return (result); resource_int_value(best->driver->name, child->unit, "flags", &child->devflags); @@ -2725,8 +2730,8 @@ device_attach(device_t dev) dev->driver->name, dev->unit, error); /* Unset the class; set in device_probe_child */ if (dev->devclass == NULL) - device_set_devclass(dev, NULL); - device_set_driver(dev, NULL); + (void)device_set_devclass(dev, NULL); + (void)device_set_driver(dev, NULL); device_sysctl_fini(dev); dev->state = DS_NOTPRESENT; return (error); @@ -2779,7 +2784,7 @@ device_detach(device_t dev) devclass_delete_device(dev->devclass, dev); dev->state = DS_NOTPRESENT; - device_set_driver(dev, NULL); + (void)device_set_driver(dev, NULL); device_set_desc(dev, NULL); device_sysctl_fini(dev); @@ -4441,7 +4446,6 @@ print_driver(driver_t *driver, int inden print_driver_short(driver, indent); } - static void print_driver_list(driver_list_t drivers, int indent) { From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:57:42 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ADCE1065676; Sun, 29 Jan 2012 12:57:42 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id EC48D8FC18; Sun, 29 Jan 2012 12:57:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0TCvdpp026649; Sun, 29 Jan 2012 16:57:39 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0TCvdVI026648; Sun, 29 Jan 2012 16:57:39 +0400 (MSK) (envelope-from ache) Date: Sun, 29 Jan 2012 16:57:38 +0400 From: Andrey Chernov To: David Schultz , John Baldwin , Mark Murray , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20120129125738.GA26520@vniz.net> Mail-Followup-To: Andrey Chernov , David Schultz , John Baldwin , Mark Murray , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> <20120126165521.GA92622@vniz.net> <20120126175243.GA19199@zim.MIT.EDU> <20120126181340.GA93157@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20120126181340.GA93157@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:57:42 -0000 On Thu, Jan 26, 2012 at 10:13:41PM +0400, Andrey Chernov wrote: > On Thu, Jan 26, 2012 at 12:52:43PM -0500, David Schultz wrote: > > Why complicate things with atomics at all? A race might result in > > arc4random(9) being seeded multiple times, but that's harmless. >=20 > Multiply seeding in line is harmless, just waste of time and resources. > Other case is one missing seeding when variable is set concurrently with > its read. I see no complication using atomic. Latest version is even=20 > shorter than previous ones. Well, I almost forget about my special case: I have personal prohibition=20 =66rom @secteam (5 years old already) to commit anything to all RNG areas. So, the question is: could anyone of you commit some version from this=20 thread, please?=20 I don't insist of atomics in this sutuation, so you can peek any version=20 you like. --=20 http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:58:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C45E1065675; Sun, 29 Jan 2012 12:58:07 +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 BD0C68FC1F; Sun, 29 Jan 2012 12:58:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TCw6ut036229; Sun, 29 Jan 2012 12:58:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TCw616036227; Sun, 29 Jan 2012 12:58:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291258.q0TCw616036227@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 12:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230740 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:58:07 -0000 Author: marius Date: Sun Jan 29 12:58:06 2012 New Revision: 230740 URL: http://svn.freebsd.org/changeset/base/230740 Log: MFC: r228211 It doesn't make much sense to check whether child is NULL after already having dereferenced it. We either should generally check the device_t's supplied to bus functions before using them (which we seem to virtually never do) or just assume that they are not NULL. While at it make this code fit 78 columns. Found with: Coverity Prevent(tm) CID: 4230 Modified: stable/9/sys/kern/subr_bus.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/subr_bus.c ============================================================================== --- stable/9/sys/kern/subr_bus.c Sun Jan 29 12:56:21 2012 (r230739) +++ stable/9/sys/kern/subr_bus.c Sun Jan 29 12:58:06 2012 (r230740) @@ -2018,10 +2018,11 @@ device_probe_child(device_t dev, device_ else if (result != 0) continue; if (!hasclass) { - if (device_set_devclass(child, dl->driver->name)) { - printf("driver bug: Unable to set devclass (devname: %s)\n", - (child ? device_get_name(child) : - "no device")); + if (device_set_devclass(child, + dl->driver->name) != 0) { + printf("driver bug: Unable to set " + "devclass (devname: %s)\n", + device_get_name(child)); (void)device_set_driver(child, NULL); continue; } From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 12:58:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEF25106567B; Sun, 29 Jan 2012 12:58:07 +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 AAADB8FC26; Sun, 29 Jan 2012 12:58:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TCw7wq036259; Sun, 29 Jan 2012 12:58:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TCw7rH036257; Sun, 29 Jan 2012 12:58:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291258.q0TCw7rH036257@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 12:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230741 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 12:58:08 -0000 Author: marius Date: Sun Jan 29 12:58:07 2012 New Revision: 230741 URL: http://svn.freebsd.org/changeset/base/230741 Log: MFC: r228211 It doesn't make much sense to check whether child is NULL after already having dereferenced it. We either should generally check the device_t's supplied to bus functions before using them (which we seem to virtually never do) or just assume that they are not NULL. While at it make this code fit 78 columns. Found with: Coverity Prevent(tm) CID: 4230 Modified: stable/8/sys/kern/subr_bus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Sun Jan 29 12:58:06 2012 (r230740) +++ stable/8/sys/kern/subr_bus.c Sun Jan 29 12:58:07 2012 (r230741) @@ -2021,10 +2021,11 @@ device_probe_child(device_t dev, device_ else if (result != 0) continue; if (!hasclass) { - if (device_set_devclass(child, dl->driver->name)) { - printf("driver bug: Unable to set devclass (devname: %s)\n", - (child ? device_get_name(child) : - "no device")); + if (device_set_devclass(child, + dl->driver->name) != 0) { + printf("driver bug: Unable to set " + "devclass (devname: %s)\n", + device_get_name(child)); (void)device_set_driver(child, NULL); continue; } From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 14:52:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97745106566C; Sun, 29 Jan 2012 14:52:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 863C78FC0C; Sun, 29 Jan 2012 14:52:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TEqg7h040267; Sun, 29 Jan 2012 14:52:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TEqgBT040265; Sun, 29 Jan 2012 14:52:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201291452.q0TEqgBT040265@svn.freebsd.org> From: Eitan Adler Date: Sun, 29 Jan 2012 14:52: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: r230742 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 14:52:42 -0000 Author: eadler Date: Sun Jan 29 14:52:42 2012 New Revision: 230742 URL: http://svn.freebsd.org/changeset/base/230742 Log: GS105v3 exhibit the same behavior PR: docs/135999 Submitted by: Boris Kochergin No objection from: jfv Approved by: cperciva MFC after: 3 days Modified: head/sys/dev/e1000/README Modified: head/sys/dev/e1000/README ============================================================================== --- head/sys/dev/e1000/README Sun Jan 29 12:58:07 2012 (r230741) +++ head/sys/dev/e1000/README Sun Jan 29 14:52:42 2012 (r230742) @@ -354,6 +354,7 @@ Known Limitations include: Planex FXG-08TE I-O Data ETG-SH8 + Netgear GS105v3 The driver can be compiled with the following changes: From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 14:55:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CC7A106566B; Sun, 29 Jan 2012 14:55:21 +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 1129B8FC16; Sun, 29 Jan 2012 14:55:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TEtK46040399; Sun, 29 Jan 2012 14:55:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TEtKXJ040393; Sun, 29 Jan 2012 14:55:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291455.q0TEtKXJ040393@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 14:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230743 - in stable/9/usr.bin: . csup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 14:55:21 -0000 Author: marius Date: Sun Jan 29 14:55:20 2012 New Revision: 230743 URL: http://svn.freebsd.org/changeset/base/230743 Log: MFC: r228857 On FreeBSD just use the MD5 implementation of libmd rather than that of libcrypto so we don't need to relinquish csup when world is built without OpenSSL. Modified: stable/9/usr.bin/Makefile stable/9/usr.bin/csup/Makefile stable/9/usr.bin/csup/auth.c stable/9/usr.bin/csup/misc.c stable/9/usr.bin/csup/misc.h Directory Properties: stable/9/usr.bin/ (props changed) stable/9/usr.bin/ar/ (props changed) stable/9/usr.bin/calendar/ (props changed) stable/9/usr.bin/clang/ (props changed) stable/9/usr.bin/compress/ (props changed) stable/9/usr.bin/cpio/ (props changed) stable/9/usr.bin/csup/ (props changed) stable/9/usr.bin/du/ (props changed) stable/9/usr.bin/fetch/ (props changed) stable/9/usr.bin/gprof/ (props changed) stable/9/usr.bin/grep/ (props changed) stable/9/usr.bin/hexdump/ (props changed) stable/9/usr.bin/indent/ (props changed) stable/9/usr.bin/mail/ (props changed) stable/9/usr.bin/make/ (props changed) stable/9/usr.bin/mkesdb/ (props changed) stable/9/usr.bin/mt/ (props changed) stable/9/usr.bin/ncplist/ (props changed) stable/9/usr.bin/netstat/ (props changed) stable/9/usr.bin/procstat/ (props changed) stable/9/usr.bin/rctl/ (props changed) stable/9/usr.bin/rwho/ (props changed) stable/9/usr.bin/script/ (props changed) stable/9/usr.bin/sed/ (props changed) stable/9/usr.bin/tar/ (props changed) stable/9/usr.bin/truss/ (props changed) stable/9/usr.bin/usbhidaction/ (props changed) stable/9/usr.bin/usbhidctl/ (props changed) stable/9/usr.bin/vacation/ (props changed) stable/9/usr.bin/vmstat/ (props changed) stable/9/usr.bin/xlint/ (props changed) Modified: stable/9/usr.bin/Makefile ============================================================================== --- stable/9/usr.bin/Makefile Sun Jan 29 14:52:42 2012 (r230742) +++ stable/9/usr.bin/Makefile Sun Jan 29 14:55:20 2012 (r230743) @@ -250,10 +250,11 @@ SUBDIR+= bc SUBDIR+= chkey SUBDIR+= dc SUBDIR+= newkey +.endif + .if ${MK_LIBTHR} != "no" SUBDIR+= csup .endif -.endif .if ${MK_LOCATE} != "no" SUBDIR+= locate Modified: stable/9/usr.bin/csup/Makefile ============================================================================== --- stable/9/usr.bin/csup/Makefile Sun Jan 29 14:52:42 2012 (r230742) +++ stable/9/usr.bin/csup/Makefile Sun Jan 29 14:55:20 2012 (r230743) @@ -33,8 +33,8 @@ CFLAGS+= -I. -I${.CURDIR} CFLAGS+= -DHAVE_FFLAGS -DNDEBUG WARNS?= 1 -DPADD= ${LIBCRYPTO} ${LIBZ} ${LIBPTHREAD} -LDADD= -lcrypto -lz -lpthread +DPADD= ${LIBMD} ${LIBZ} ${LIBPTHREAD} +LDADD= -lmd -lz -lpthread SCRIPTS= cpasswd.sh MAN= csup.1 cpasswd.1 Modified: stable/9/usr.bin/csup/auth.c ============================================================================== --- stable/9/usr.bin/csup/auth.c Sun Jan 29 14:52:42 2012 (r230742) +++ stable/9/usr.bin/csup/auth.c Sun Jan 29 14:55:20 2012 (r230743) @@ -35,7 +35,6 @@ #include #include -#include #include #include #include Modified: stable/9/usr.bin/csup/misc.c ============================================================================== --- stable/9/usr.bin/csup/misc.c Sun Jan 29 14:52:42 2012 (r230742) +++ stable/9/usr.bin/csup/misc.c Sun Jan 29 14:55:20 2012 (r230743) @@ -28,7 +28,6 @@ #include #include -#include #include #include Modified: stable/9/usr.bin/csup/misc.h ============================================================================== --- stable/9/usr.bin/csup/misc.h Sun Jan 29 14:52:42 2012 (r230742) +++ stable/9/usr.bin/csup/misc.h Sun Jan 29 14:55:20 2012 (r230743) @@ -28,10 +28,18 @@ #ifndef _MISC_H_ #define _MISC_H_ -#include - #include +#ifdef __FreeBSD__ +#include +#define MD5_DIGEST_LENGTH 16 +#define MD5_Init MD5Init +#define MD5_Final MD5Final +#define MD5_Update MD5Update +#else +#include +#endif + /* If we're not compiling in a C99 environment, define the C99 types. */ #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 14:55:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF7D7106566C; Sun, 29 Jan 2012 14:55:38 +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 BA5498FC17; Sun, 29 Jan 2012 14:55:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TEtcxL040452; Sun, 29 Jan 2012 14:55:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TEtcdu040440; Sun, 29 Jan 2012 14:55:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291455.q0TEtcdu040440@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 14:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230744 - in stable/8/usr.bin: . chpass csup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 14:55:38 -0000 Author: marius Date: Sun Jan 29 14:55:38 2012 New Revision: 230744 URL: http://svn.freebsd.org/changeset/base/230744 Log: o MFC: r204556, r204628 Move csup away from contrib/ and into usr.bin/. Software is no longer contributed, and main development is happening in the FreeBSD repo. o MFC: r204558 Unmark authentication support as a TODO item. o MFC: r204629 Remove unused include path. o MFC: r204639 Include CURDIR in case the makefile is not run from the same directory. o MFC: r204664 Fix spelling. o MFC: r206621 Add and expand $FreeBSD$ keyword to allow committing to this file. o MFC: r206622 (partial) mdoc: order prologue macros consistently by Dd/Dt/Os Although groff_mdoc(7) gives another impression, this is the ordering most widely used and also required by mdocml/mandoc. o MFC: r208291 (partial) mdoc: consistently spell our email addresses o MFC: r210874 Don't point users at the old csup homepage. o MFC: r213300 If an RCS file is truncated, rcsfile_getdelta() will return NULL. Instead of faulting, check for NULL. However, returning an error would cause csup to just abort the entire update. Instead, break out of the loop and return ok. The attempts to update the file will trigger a MD5 failure which will cause csup to download the entire file as a fixup. o MFC: r213573 (partial) mdoc: drop redundant .Pp and .LP calls They have no effect when coming in pairs, or before .Bl/.Bd o MFC: r216370 (partial) Remove the advertising clause from UCB copyrighted files in usr.bin. This is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. o MFC: r216542 Signal that data should not be modified. o MFC: r217858 Remove dead code. o MFC: r225535 Fix csup to allow case insensitive server names in the auth file, just as advertised in the manpage. PR: 158652 o MFC: r225536 Fix typos in error messages. o MFC: r225979 Update the comment to reflect what is actually going on. o MFC: r225980 Handle the situation where fixups_close() has been called but more fixups are still available on the queue. o MFC: r228625 In usr.bin/csup/auth.c, use the correct number of bytes for zeroing the shared secret, and use long long format to snprintf a time_t. o MFC: r228626 In usr.bin/csup/proto.c, use the correct printf length modifier to print an off_t. o MFC: r228667 In usr.bin/csup/auth.c, cast time_t to intmax_t instead, and use the corresponding printf length modifier. o MFC: r228857 On FreeBSD just use the MD5 implementation of libmd rather than that of libcrypto so we don't need to relinquish csup when world is built without OpenSSL. Added: stable/8/usr.bin/csup/README - copied unchanged from r204556, head/usr.bin/csup/README stable/8/usr.bin/csup/TODO - copied, changed from r204556, head/usr.bin/csup/TODO stable/8/usr.bin/csup/attrstack.c - copied unchanged from r204556, head/usr.bin/csup/attrstack.c stable/8/usr.bin/csup/attrstack.h - copied unchanged from r204556, head/usr.bin/csup/attrstack.h stable/8/usr.bin/csup/auth.c - copied, changed from r204556, head/usr.bin/csup/auth.c stable/8/usr.bin/csup/auth.h - copied unchanged from r204556, head/usr.bin/csup/auth.h stable/8/usr.bin/csup/config.c - copied unchanged from r204556, head/usr.bin/csup/config.c stable/8/usr.bin/csup/config.h - copied unchanged from r204556, head/usr.bin/csup/config.h stable/8/usr.bin/csup/cpasswd.1 (contents, props changed) - copied, changed from r204556, head/usr.bin/csup/cpasswd.1 stable/8/usr.bin/csup/cpasswd.sh - copied unchanged from r204556, head/usr.bin/csup/cpasswd.sh stable/8/usr.bin/csup/csup.1 - copied, changed from r204556, head/usr.bin/csup/csup.1 stable/8/usr.bin/csup/detailer.c - copied unchanged from r204556, head/usr.bin/csup/detailer.c stable/8/usr.bin/csup/detailer.h - copied unchanged from r204556, head/usr.bin/csup/detailer.h stable/8/usr.bin/csup/diff.c - copied unchanged from r204556, head/usr.bin/csup/diff.c stable/8/usr.bin/csup/diff.h - copied unchanged from r204556, head/usr.bin/csup/diff.h stable/8/usr.bin/csup/fattr.c - copied unchanged from r204556, head/usr.bin/csup/fattr.c stable/8/usr.bin/csup/fattr.h - copied unchanged from r204556, head/usr.bin/csup/fattr.h stable/8/usr.bin/csup/fattr_bsd.h - copied unchanged from r204556, head/usr.bin/csup/fattr_bsd.h stable/8/usr.bin/csup/fattr_posix.h - copied unchanged from r204556, head/usr.bin/csup/fattr_posix.h stable/8/usr.bin/csup/fixups.c - copied, changed from r204556, head/usr.bin/csup/fixups.c stable/8/usr.bin/csup/fixups.h - copied unchanged from r204556, head/usr.bin/csup/fixups.h stable/8/usr.bin/csup/fnmatch.c - copied, changed from r204556, head/usr.bin/csup/fnmatch.c stable/8/usr.bin/csup/fnmatch.h - copied, changed from r204556, head/usr.bin/csup/fnmatch.h stable/8/usr.bin/csup/globtree.c - copied unchanged from r204556, head/usr.bin/csup/globtree.c stable/8/usr.bin/csup/globtree.h - copied unchanged from r204556, head/usr.bin/csup/globtree.h stable/8/usr.bin/csup/idcache.c - copied unchanged from r204556, head/usr.bin/csup/idcache.c stable/8/usr.bin/csup/idcache.h - copied unchanged from r204556, head/usr.bin/csup/idcache.h stable/8/usr.bin/csup/keyword.c - copied unchanged from r204556, head/usr.bin/csup/keyword.c stable/8/usr.bin/csup/keyword.h - copied unchanged from r204556, head/usr.bin/csup/keyword.h stable/8/usr.bin/csup/lex.rcs.c - copied unchanged from r204556, head/usr.bin/csup/lex.rcs.c stable/8/usr.bin/csup/lister.c - copied unchanged from r204556, head/usr.bin/csup/lister.c stable/8/usr.bin/csup/lister.h - copied unchanged from r204556, head/usr.bin/csup/lister.h stable/8/usr.bin/csup/main.c - copied, changed from r204556, head/usr.bin/csup/main.c stable/8/usr.bin/csup/main.h - copied unchanged from r204556, head/usr.bin/csup/main.h stable/8/usr.bin/csup/misc.c - copied, changed from r204556, head/usr.bin/csup/misc.c stable/8/usr.bin/csup/misc.h - copied, changed from r204556, head/usr.bin/csup/misc.h stable/8/usr.bin/csup/mux.c - copied unchanged from r204556, head/usr.bin/csup/mux.c stable/8/usr.bin/csup/mux.h - copied unchanged from r204556, head/usr.bin/csup/mux.h stable/8/usr.bin/csup/parse.y - copied unchanged from r204556, head/usr.bin/csup/parse.y stable/8/usr.bin/csup/pathcomp.c - copied unchanged from r204556, head/usr.bin/csup/pathcomp.c stable/8/usr.bin/csup/pathcomp.h - copied unchanged from r204556, head/usr.bin/csup/pathcomp.h stable/8/usr.bin/csup/proto.c - copied, changed from r204556, head/usr.bin/csup/proto.c stable/8/usr.bin/csup/proto.h - copied unchanged from r204556, head/usr.bin/csup/proto.h stable/8/usr.bin/csup/queue.h - copied unchanged from r204556, head/usr.bin/csup/queue.h stable/8/usr.bin/csup/rcsfile.c - copied, changed from r204556, head/usr.bin/csup/rcsfile.c stable/8/usr.bin/csup/rcsfile.h - copied, changed from r204556, head/usr.bin/csup/rcsfile.h stable/8/usr.bin/csup/rcsparse.c - copied, changed from r204556, head/usr.bin/csup/rcsparse.c stable/8/usr.bin/csup/rcsparse.h - copied unchanged from r204556, head/usr.bin/csup/rcsparse.h stable/8/usr.bin/csup/rcstokenizer.h - copied unchanged from r204556, head/usr.bin/csup/rcstokenizer.h stable/8/usr.bin/csup/rcstokenizer.l - copied unchanged from r204556, head/usr.bin/csup/rcstokenizer.l stable/8/usr.bin/csup/rsyncfile.c - copied unchanged from r204556, head/usr.bin/csup/rsyncfile.c stable/8/usr.bin/csup/rsyncfile.h - copied unchanged from r204556, head/usr.bin/csup/rsyncfile.h stable/8/usr.bin/csup/status.c - copied unchanged from r204556, head/usr.bin/csup/status.c stable/8/usr.bin/csup/status.h - copied unchanged from r204556, head/usr.bin/csup/status.h stable/8/usr.bin/csup/stream.c - copied unchanged from r204556, head/usr.bin/csup/stream.c stable/8/usr.bin/csup/stream.h - copied unchanged from r204556, head/usr.bin/csup/stream.h stable/8/usr.bin/csup/threads.c - copied unchanged from r204556, head/usr.bin/csup/threads.c stable/8/usr.bin/csup/threads.h - copied unchanged from r204556, head/usr.bin/csup/threads.h stable/8/usr.bin/csup/token.h - copied unchanged from r204556, head/usr.bin/csup/token.h stable/8/usr.bin/csup/token.l - copied unchanged from r204556, head/usr.bin/csup/token.l stable/8/usr.bin/csup/updater.c - copied, changed from r204556, head/usr.bin/csup/updater.c stable/8/usr.bin/csup/updater.h - copied unchanged from r204556, head/usr.bin/csup/updater.h Modified: stable/8/usr.bin/Makefile stable/8/usr.bin/csup/Makefile Directory Properties: stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/checknr/ (props changed) stable/8/usr.bin/chpass/Makefile (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/compress/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/cpuset/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/ipcs/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lastcomm/ (props changed) stable/8/usr.bin/ldd/ (props changed) stable/8/usr.bin/less/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/limits/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/locate/ (props changed) stable/8/usr.bin/lock/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/logger/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/m4/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/printf/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rlogin/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/rpcinfo/ (props changed) stable/8/usr.bin/rs/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/showmount/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/su/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tail/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/tip/ (props changed) stable/8/usr.bin/top/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/usbhidaction/ (props changed) stable/8/usr.bin/usbhidctl/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/wall/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xargs/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/xz/ (props changed) stable/8/usr.bin/yacc/ (props changed) Modified: stable/8/usr.bin/Makefile ============================================================================== --- stable/8/usr.bin/Makefile Sun Jan 29 14:55:20 2012 (r230743) +++ stable/8/usr.bin/Makefile Sun Jan 29 14:55:38 2012 (r230744) @@ -281,10 +281,11 @@ _hesinfo= hesinfo .if ${MK_OPENSSL} != "no" _chkey= chkey _newkey= newkey +.endif + .if ${MK_LIBTHR} != "no" _csup= csup .endif -.endif .if ${MK_LOCATE} != "no" _locate= locate Modified: stable/8/usr.bin/csup/Makefile ============================================================================== --- stable/8/usr.bin/csup/Makefile Sun Jan 29 14:55:20 2012 (r230743) +++ stable/8/usr.bin/csup/Makefile Sun Jan 29 14:55:38 2012 (r230744) @@ -1,9 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../contrib/csup - PROG= csup SRCS= attrstack.c \ + auth.c \ config.c \ detailer.c \ diff.c \ @@ -30,11 +29,14 @@ SRCS= attrstack.c \ token.l \ updater.c -CFLAGS+= -I. -I${.CURDIR}/../../contrib/csup +CFLAGS+= -I. -I${.CURDIR} CFLAGS+= -DHAVE_FFLAGS -DNDEBUG WARNS?= 1 -DPADD= ${LIBCRYPTO} ${LIBZ} ${LIBPTHREAD} -LDADD= -lcrypto -lz -lpthread +DPADD= ${LIBMD} ${LIBZ} ${LIBPTHREAD} +LDADD= -lmd -lz -lpthread + +SCRIPTS= cpasswd.sh +MAN= csup.1 cpasswd.1 .include Copied: stable/8/usr.bin/csup/README (from r204556, head/usr.bin/csup/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.bin/csup/README Sun Jan 29 14:55:38 2012 (r230744, copy of r204556, head/usr.bin/csup/README) @@ -0,0 +1,39 @@ +$FreeBSD$ + +Authors +------- + +CVSup was originally written in Modula-3 by + John Polstra . + +Csup is a rewrite of CVSup in C. It has been mostly written by + Maxime Henrion . + +A few contributors have helped him in his task and they are listed here in +alphabetical order : + + Olivier Houchard + Ulf Lilleengen + Christoph Mathys (Google SoC Project) + Etienne Vidal + + +Building & Installing +--------------------- + +Csup should build and run fine under any *BSD OS (that includes FreeBSD, +NetBSD, OpenBSD and DragonFlyBSD), as well as Linux and Darwin. If you +have a problem building from source, drop me a mail! + +There is one Makefile specifically tailored for *BSD systems named +Makefile and another one that is gmake-specific for Darwin and Linux +users named GNUmakefile. You don't really need to worry about that +since whatever your "make" command is, it should pick up the correct +Makefile. + +As usual, to build the source code, just run "make". Once this is done, +just run "make install" to install the binary and manual page. + +Be warned however that if the packaging system of your OS knows about +csup, it is certainly better to install it from there rather than by +hand, so that it can then be properly deinstalled. Copied and modified: stable/8/usr.bin/csup/TODO (from r204556, head/usr.bin/csup/TODO) ============================================================================== --- head/usr.bin/csup/TODO Tue Mar 2 07:26:07 2010 (r204556, copy source) +++ stable/8/usr.bin/csup/TODO Sun Jan 29 14:55:38 2012 (r230744) @@ -18,9 +18,8 @@ BUGS: MISSING FEATURES: - Add support for shell commands sent by the server. -- Add missing support for various CVSup options : -D, -a (requires - authentication support), -e and -E (requires shell commands support) - and the destDir parameter. +- Add missing support for various CVSup options : -D, -e and -E (requires + shell commands support) and the destDir parameter. - For now, this code should build fine on FreeBSD, NetBSD, OpenBSD, Linux and Darwin. Solaris support would also be nice at some point. - Implement some new useful options : the ability to generate CVS Copied: stable/8/usr.bin/csup/attrstack.c (from r204556, head/usr.bin/csup/attrstack.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.bin/csup/attrstack.c Sun Jan 29 14:55:38 2012 (r230744, copy of r204556, head/usr.bin/csup/attrstack.c) @@ -0,0 +1,90 @@ +/*- + * Copyright (c) 2006, Maxime Henrion + * 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. + * + * $Id$ + */ + +#include +#include + +#include "attrstack.h" +#include "fattr.h" +#include "misc.h" + +#define ATTRSTACK_DEFSIZE 16 /* Initial size of the stack. */ + +struct attrstack { + struct fattr **stack; + size_t cur; + size_t size; +}; + +struct attrstack * +attrstack_new(void) +{ + struct attrstack *as; + + as = xmalloc(sizeof(struct attrstack)); + as->stack = xmalloc(sizeof(struct fattr *) * ATTRSTACK_DEFSIZE); + as->size = ATTRSTACK_DEFSIZE; + as->cur = 0; + return (as); +} + +struct fattr * +attrstack_pop(struct attrstack *as) +{ + + assert(as->cur > 0); + return (as->stack[--as->cur]); +} + +void +attrstack_push(struct attrstack *as, struct fattr *fa) +{ + + if (as->cur >= as->size) { + as->size *= 2; + as->stack = xrealloc(as->stack, + sizeof(struct fattr *) * as->size); + } + as->stack[as->cur++] = fa; +} + +size_t +attrstack_size(struct attrstack *as) +{ + + return (as->cur); +} + +void +attrstack_free(struct attrstack *as) +{ + + assert(as->cur == 0); + free(as->stack); + free(as); +} Copied: stable/8/usr.bin/csup/attrstack.h (from r204556, head/usr.bin/csup/attrstack.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.bin/csup/attrstack.h Sun Jan 29 14:55:38 2012 (r230744, copy of r204556, head/usr.bin/csup/attrstack.h) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2006, Maxime Henrion + * 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. + * + * $Id$ + */ +#ifndef _ATTRSTACK_H_ +#define _ATTRSTACK_H_ + +struct fattr; +struct attrstack; + +struct attrstack *attrstack_new(void); +void attrstack_push(struct attrstack *, struct fattr *); +struct fattr *attrstack_pop(struct attrstack *); +size_t attrstack_size(struct attrstack *); +void attrstack_free(struct attrstack *); + +#endif /* !_ATTRSTACK_H_ */ Copied and modified: stable/8/usr.bin/csup/auth.c (from r204556, head/usr.bin/csup/auth.c) ============================================================================== --- head/usr.bin/csup/auth.c Tue Mar 2 07:26:07 2010 (r204556, copy source) +++ stable/8/usr.bin/csup/auth.c Sun Jan 29 14:55:38 2012 (r230744) @@ -35,7 +35,6 @@ #include #include -#include #include #include #include @@ -147,7 +146,7 @@ auth_domd5auth(struct config *config) lprintf(-1, "Server failed to authenticate itself to client\n"); return (STATUS_FAILURE); } - lprintf(2, "MD5 authentication successfull\n"); + lprintf(2, "MD5 authentication successful\n"); return (STATUS_SUCCESS); } if (strcmp(cmd, "!") == 0) { @@ -188,22 +187,22 @@ auth_lookuprecord(char *server, struct s error = auth_parsetoken(&line, auth->server, sizeof(auth->server)); if (error != STATUS_SUCCESS) { - lprintf(-1, "%s:%d Missng client name\n", authfile, linenum); + lprintf(-1, "%s:%d Missing client name\n", authfile, linenum); goto close; } /* Skip the rest of this line, it isn't what we are looking for. */ - if (strcmp(auth->server, server) != 0) + if (strcasecmp(auth->server, server) != 0) continue; error = auth_parsetoken(&line, auth->client, sizeof(auth->client)); if (error != STATUS_SUCCESS) { - lprintf(-1, "%s:%d Missng password\n", authfile, linenum); + lprintf(-1, "%s:%d Missing password\n", authfile, linenum); goto close; } error = auth_parsetoken(&line, auth->password, sizeof(auth->password)); if (error != STATUS_SUCCESS) { - lprintf(-1, "%s:%d Missng comment\n", authfile, linenum); + lprintf(-1, "%s:%d Missing comment\n", authfile, linenum); goto close; } stream_close(s); @@ -254,7 +253,7 @@ auth_makesecret(struct srvrecord *auth, MD5_Update(&md5, ":", 1); MD5_Update(&md5, auth->password, strlen(auth->password)); MD5_Final(md5sum, &md5); - memset(secret, 0, sizeof(secret)); + memset(secret, 0, MD5_CHARS_MAX); strcpy(secret, md5salt); auth_readablesum(md5sum, secret + strlen(md5salt)); } @@ -302,8 +301,9 @@ auth_makechallenge(struct config *config } gettimeofday(&tv, NULL); MD5_Init(&md5); - snprintf(buf, sizeof(buf), "%s:%ld:%ld:%ld:%d:%d", - inet_ntoa(laddr.sin_addr), tv.tv_sec, tv.tv_usec, random(), pid, ppid); + snprintf(buf, sizeof(buf), "%s:%jd:%ld:%ld:%d:%d", + inet_ntoa(laddr.sin_addr), (intmax_t)tv.tv_sec, tv.tv_usec, + random(), pid, ppid); MD5_Update(&md5, buf, strlen(buf)); MD5_Final(md5sum, &md5); auth_readablesum(md5sum, challenge); Copied: stable/8/usr.bin/csup/auth.h (from r204556, head/usr.bin/csup/auth.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.bin/csup/auth.h Sun Jan 29 14:55:38 2012 (r230744, copy of r204556, head/usr.bin/csup/auth.h) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2003-2007, Petar Zhivkov Petrov + * 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 _AUTH_H_ +#define _AUTH_H_ + +#define AUTHFILE ".csup/auth" /* user home relative */ + +struct config; + +int auth_login(struct config *); + +#endif /* !_AUTH_H_ */ + Copied: stable/8/usr.bin/csup/config.c (from r204556, head/usr.bin/csup/config.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.bin/csup/config.c Sun Jan 29 14:55:38 2012 (r230744, copy of r204556, head/usr.bin/csup/config.c) @@ -0,0 +1,579 @@ +/*- + * Copyright (c) 2003-2006, Maxime Henrion + * 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 +#include + +#include +#include +#include +#include +#include +#include + +#include "config.h" +#include "globtree.h" +#include "keyword.h" +#include "misc.h" +#include "parse.h" +#include "stream.h" +#include "token.h" + +static int config_parse_refusefiles(struct coll *); +static int config_parse_refusefile(struct coll *, char *); + +extern FILE *yyin; + +/* These are globals because I can't think of a better way with yacc. */ +static STAILQ_HEAD(, coll) colls; +static struct coll *cur_coll; +static struct coll *defaults; +static struct coll *ovcoll; +static int ovmask; +static const char *cfgfile; + +/* + * Extract all the configuration information from the config + * file and some command line parameters. + */ +struct config * +config_init(const char *file, struct coll *override, int overridemask) +{ + struct config *config; + struct coll *coll; + size_t slen; + char *prefix; + int error; + mode_t mask; + + config = xmalloc(sizeof(struct config)); + memset(config, 0, sizeof(struct config)); + STAILQ_INIT(&colls); + + defaults = coll_new(NULL); + /* Set the default umask. */ + mask = umask(0); + umask(mask); + defaults->co_umask = mask; + ovcoll = override; + ovmask = overridemask; + + /* Extract a list of collections from the configuration file. */ + cur_coll = coll_new(defaults); + yyin = fopen(file, "r"); + if (yyin == NULL) { + lprintf(-1, "Cannot open \"%s\": %s\n", file, strerror(errno)); + goto bad; + } + cfgfile = file; + error = yyparse(); + fclose(yyin); + if (error) + goto bad; + + memcpy(&config->colls, &colls, sizeof(colls)); + if (STAILQ_EMPTY(&config->colls)) { + lprintf(-1, "Empty supfile\n"); + goto bad; + } + + /* Fixup the list of collections. */ + STAILQ_FOREACH(coll, &config->colls, co_next) { + if (coll->co_base == NULL) + coll->co_base = xstrdup("/usr/local/etc/cvsup"); + if (coll->co_colldir == NULL) + coll->co_colldir = "sup"; + if (coll->co_prefix == NULL) { + coll->co_prefix = xstrdup(coll->co_base); + /* + * If prefix is not an absolute pathname, it is + * interpreted relative to base. + */ + } else if (coll->co_prefix[0] != '/') { + slen = strlen(coll->co_base); + if (slen > 0 && coll->co_base[slen - 1] != '/') + xasprintf(&prefix, "%s/%s", coll->co_base, + coll->co_prefix); + else + xasprintf(&prefix, "%s%s", coll->co_base, + coll->co_prefix); + free(coll->co_prefix); + coll->co_prefix = prefix; + } + coll->co_prefixlen = strlen(coll->co_prefix); + /* Determine whether to checksum RCS files or not. */ + if (coll->co_options & CO_EXACTRCS) + coll->co_options |= CO_CHECKRCS; + else + coll->co_options &= ~CO_CHECKRCS; + /* In recent versions, we always try to set the file modes. */ + coll->co_options |= CO_SETMODE; + coll->co_options |= CO_NORSYNC; + error = config_parse_refusefiles(coll); + if (error) + goto bad; + } + + coll_free(cur_coll); + coll_free(defaults); + config->host = STAILQ_FIRST(&config->colls)->co_host; + return (config); +bad: + coll_free(cur_coll); + coll_free(defaults); + config_free(config); + return (NULL); +} + +int +config_checkcolls(struct config *config) +{ + char linkname[4]; + struct stat sb; + struct coll *coll; + int error, numvalid, ret; + + numvalid = 0; + STAILQ_FOREACH(coll, &config->colls, co_next) { + error = stat(coll->co_prefix, &sb); + if (error || !S_ISDIR(sb.st_mode)) { + /* Skip this collection, and warn about it unless its + prefix is a symbolic link pointing to "SKIP". */ + coll->co_options |= CO_SKIP; + ret = readlink(coll->co_prefix, linkname, + sizeof(linkname)); + if (ret != 4 || memcmp(linkname, "SKIP", 4) != 0) { + lprintf(-1,"Nonexistent prefix \"%s\" for " + "%s/%s\n", coll->co_prefix, coll->co_name, + coll->co_release); + } + continue; + } + numvalid++; + } + return (numvalid); +} + +static int +config_parse_refusefiles(struct coll *coll) +{ + char *collstem, *suffix, *supdir, *path; + int error; + + if (coll->co_colldir[0] == '/') + supdir = xstrdup(coll->co_colldir); + else + xasprintf(&supdir, "%s/%s", coll->co_base, coll->co_colldir); + + /* First, the global refuse file that applies to all collections. */ + xasprintf(&path, "%s/refuse", supdir); + error = config_parse_refusefile(coll, path); + free(path); + if (error) { + free(supdir); + return (error); + } + + /* Next the per-collection refuse files that applies to all release/tag + combinations. */ + xasprintf(&collstem, "%s/%s/refuse", supdir, coll->co_name); + free(supdir); + error = config_parse_refusefile(coll, collstem); + if (error) { + free(collstem); + return (error); + } + + /* Finally, the per-release and per-tag refuse file. */ + suffix = coll_statussuffix(coll); + if (suffix != NULL) { + xasprintf(&path, "%s%s", collstem, suffix); + free(suffix); + error = config_parse_refusefile(coll, path); + free(path); + } + free(collstem); + return (error); +} + +/* + * Parses a "refuse" file, and records the relevant information in + * coll->co_refusals. If the file does not exist, it is silently + * ignored. + */ +static int +config_parse_refusefile(struct coll *coll, char *path) +{ + struct stream *rd; + char *cp, *line, *pat; + + rd = stream_open_file(path, O_RDONLY); + if (rd == NULL) + return (0); + while ((line = stream_getln(rd, NULL)) != NULL) { + pat = line; + for (;;) { + /* Trim leading whitespace. */ + pat += strspn(pat, " \t"); + if (pat[0] == '\0') + break; + cp = strpbrk(pat, " \t"); + if (cp != NULL) + *cp = '\0'; + pattlist_add(coll->co_refusals, pat); + if (cp == NULL) + break; + pat = cp + 1; + } + } + if (!stream_eof(rd)) { + stream_close(rd); + lprintf(-1, "Read failure from \"%s\": %s\n", path, + strerror(errno)); + return (-1); + } + stream_close(rd); + return (0); +} + +void +config_free(struct config *config) +{ + struct coll *coll; + + while (!STAILQ_EMPTY(&config->colls)) { + coll = STAILQ_FIRST(&config->colls); + STAILQ_REMOVE_HEAD(&config->colls, co_next); + coll_free(coll); + } + if (config->server != NULL) + stream_close(config->server); + if (config->laddr != NULL) + free(config->laddr); + free(config); +} + +/* Create a new collection, inheriting options from the default collection. */ +struct coll * +coll_new(struct coll *def) +{ + struct coll *new; + + new = xmalloc(sizeof(struct coll)); + memset(new, 0, sizeof(struct coll)); + if (def != NULL) { + new->co_options = def->co_options; + new->co_umask = def->co_umask; + if (def->co_host != NULL) + new->co_host = xstrdup(def->co_host); + if (def->co_base != NULL) + new->co_base = xstrdup(def->co_base); + if (def->co_date != NULL) + new->co_date = xstrdup(def->co_date); + if (def->co_prefix != NULL) + new->co_prefix = xstrdup(def->co_prefix); + if (def->co_release != NULL) + new->co_release = xstrdup(def->co_release); + if (def->co_tag != NULL) + new->co_tag = xstrdup(def->co_tag); + if (def->co_listsuffix != NULL) + new->co_listsuffix = xstrdup(def->co_listsuffix); + } else { + new->co_tag = xstrdup("."); + new->co_date = xstrdup("."); + } + new->co_keyword = keyword_new(); + new->co_accepts = pattlist_new(); + new->co_refusals = pattlist_new(); + new->co_attrignore = FA_DEV | FA_INODE; + return (new); +} + +void +coll_override(struct coll *coll, struct coll *from, int mask) +{ + size_t i; + int newoptions, oldoptions; + + newoptions = from->co_options & mask; + oldoptions = coll->co_options & (CO_MASK & ~mask); + + if (from->co_release != NULL) { + if (coll->co_release != NULL) + free(coll->co_release); + coll->co_release = xstrdup(from->co_release); + } + if (from->co_host != NULL) { + if (coll->co_host != NULL) + free(coll->co_host); + coll->co_host = xstrdup(from->co_host); + } + if (from->co_base != NULL) { + if (coll->co_base != NULL) + free(coll->co_base); + coll->co_base = xstrdup(from->co_base); + } + if (from->co_colldir != NULL) + coll->co_colldir = from->co_colldir; + if (from->co_prefix != NULL) { + if (coll->co_prefix != NULL) + free(coll->co_prefix); + coll->co_prefix = xstrdup(from->co_prefix); + } + if (newoptions & CO_CHECKOUTMODE) { + if (from->co_tag != NULL) { + if (coll->co_tag != NULL) + free(coll->co_tag); + coll->co_tag = xstrdup(from->co_tag); + } + if (from->co_date != NULL) { + if (coll->co_date != NULL) + free(coll->co_date); + coll->co_date = xstrdup(from->co_date); + } + } + if (from->co_listsuffix != NULL) { + if (coll->co_listsuffix != NULL) + free(coll->co_listsuffix); + coll->co_listsuffix = xstrdup(from->co_listsuffix); + } + for (i = 0; i < pattlist_size(from->co_accepts); i++) { + pattlist_add(coll->co_accepts, + pattlist_get(from->co_accepts, i)); + } + for (i = 0; i < pattlist_size(from->co_refusals); i++) { + pattlist_add(coll->co_refusals, + pattlist_get(from->co_refusals, i)); + } + coll->co_options = oldoptions | newoptions; +} + +char * +coll_statussuffix(struct coll *coll) +{ + const char *tag; + char *suffix; + + if (coll->co_listsuffix != NULL) { + xasprintf(&suffix, ".%s", coll->co_listsuffix); + } else if (coll->co_options & CO_USERELSUFFIX) { + if (coll->co_tag == NULL) + tag = "."; + else + tag = coll->co_tag; + if (coll->co_release != NULL) { + if (coll->co_options & CO_CHECKOUTMODE) { + xasprintf(&suffix, ".%s:%s", + coll->co_release, tag); + } else { + xasprintf(&suffix, ".%s", coll->co_release); + } + } else if (coll->co_options & CO_CHECKOUTMODE) { + xasprintf(&suffix, ":%s", tag); + } + } else + suffix = NULL; + return (suffix); +} + +char * +coll_statuspath(struct coll *coll) +{ + char *path, *suffix; + + suffix = coll_statussuffix(coll); + if (suffix != NULL) { + if (coll->co_colldir[0] == '/') + xasprintf(&path, "%s/%s/checkouts%s", coll->co_colldir, + coll->co_name, suffix); + else + xasprintf(&path, "%s/%s/%s/checkouts%s", coll->co_base, + coll->co_colldir, coll->co_name, suffix); + } else { + if (coll->co_colldir[0] == '/') + xasprintf(&path, "%s/%s/checkouts", coll->co_colldir, + coll->co_name); + else + xasprintf(&path, "%s/%s/%s/checkouts", coll->co_base, + coll->co_colldir, coll->co_name); + } + free(suffix); + return (path); +} + +void +coll_add(char *name) +{ + struct coll *coll; + + cur_coll->co_name = name; + coll_override(cur_coll, ovcoll, ovmask); + if (cur_coll->co_release == NULL) { + lprintf(-1, "Release not specified for collection " + "\"%s\"\n", cur_coll->co_name); + exit(1); + } + if (cur_coll->co_host == NULL) { + lprintf(-1, "Host not specified for collection " + "\"%s\"\n", cur_coll->co_name); + exit(1); + } + if (!STAILQ_EMPTY(&colls)) { + coll = STAILQ_LAST(&colls, coll, co_next); + if (strcmp(coll->co_host, cur_coll->co_host) != 0) { + lprintf(-1, "All \"host\" fields in the supfile " + "must be the same\n"); + exit(1); + } + } + STAILQ_INSERT_TAIL(&colls, cur_coll, co_next); + cur_coll = coll_new(defaults); +} + +void +coll_free(struct coll *coll) +{ + + if (coll == NULL) + return; + if (coll->co_host != NULL) + free(coll->co_host); + if (coll->co_base != NULL) + free(coll->co_base); + if (coll->co_date != NULL) + free(coll->co_date); + if (coll->co_prefix != NULL) + free(coll->co_prefix); + if (coll->co_release != NULL) + free(coll->co_release); + if (coll->co_tag != NULL) + free(coll->co_tag); + if (coll->co_cvsroot != NULL) + free(coll->co_cvsroot); + if (coll->co_name != NULL) + free(coll->co_name); + if (coll->co_listsuffix != NULL) + free(coll->co_listsuffix); + keyword_free(coll->co_keyword); + if (coll->co_dirfilter != NULL) + globtree_free(coll->co_dirfilter); + if (coll->co_dirfilter != NULL) + globtree_free(coll->co_filefilter); + if (coll->co_norsync != NULL) + globtree_free(coll->co_norsync); + if (coll->co_accepts != NULL) + pattlist_free(coll->co_accepts); + if (coll->co_refusals != NULL) + pattlist_free(coll->co_refusals); + free(coll); +} + +void +coll_setopt(int opt, char *value) +{ + struct coll *coll; + int error, mask; + + coll = cur_coll; + switch (opt) { + case PT_HOST: + if (coll->co_host != NULL) + free(coll->co_host); + coll->co_host = value; + break; + case PT_BASE: + if (coll->co_base != NULL) + free(coll->co_base); + coll->co_base = value; + break; + case PT_DATE: + if (coll->co_date != NULL) + free(coll->co_date); + coll->co_date = value; + coll->co_options |= CO_CHECKOUTMODE; + break; + case PT_PREFIX: + if (coll->co_prefix != NULL) + free(coll->co_prefix); + coll->co_prefix = value; + break; + case PT_RELEASE: + if (coll->co_release != NULL) + free(coll->co_release); + coll->co_release = value; + break; + case PT_TAG: + if (coll->co_tag != NULL) + free(coll->co_tag); + coll->co_tag = value; + coll->co_options |= CO_CHECKOUTMODE; + break; + case PT_LIST: + if (strchr(value, '/') != NULL) { + lprintf(-1, "Parse error in \"%s\": \"list\" suffix " + "must not contain slashes\n", cfgfile); + exit(1); + } + if (coll->co_listsuffix != NULL) + free(coll->co_listsuffix); + coll->co_listsuffix = value; + break; + case PT_UMASK: + error = asciitoint(value, &mask, 8); + free(value); + if (error) { + lprintf(-1, "Parse error in \"%s\": Invalid " + "umask value\n", cfgfile); + exit(1); + } + coll->co_umask = mask; + break; + case PT_USE_REL_SUFFIX: + coll->co_options |= CO_USERELSUFFIX; + break; + case PT_DELETE: + coll->co_options |= CO_DELETE | CO_EXACTRCS; + break; + case PT_COMPRESS: + coll->co_options |= CO_COMPRESS; + break; + case PT_NORSYNC: + coll->co_options |= CO_NORSYNC; + break; + } +} + +/* Set "coll" as being the default collection. */ +void +coll_setdef(void) +{ + + coll_free(defaults); + defaults = cur_coll; + cur_coll = coll_new(defaults); +} Copied: stable/8/usr.bin/csup/config.h (from r204556, head/usr.bin/csup/config.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.bin/csup/config.h Sun Jan 29 14:55:38 2012 (r230744, copy of r204556, head/usr.bin/csup/config.h) @@ -0,0 +1,127 @@ +/*- + * Copyright (c) 2003-2006, Maxime Henrion + * 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 _CONFIG_H_ +#define _CONFIG_H_ + +#include +#include + +#include + +#include "fattr.h" +#include "queue.h" +#include "misc.h" + +/* + * Collection options. + */ +#define CO_BACKUP 0x00000001 +#define CO_DELETE 0x00000002 +#define CO_KEEP 0x00000004 +#define CO_OLD 0x00000008 +#define CO_UNLINKBUSY 0x00000010 +#define CO_NOUPDATE 0x00000020 +#define CO_COMPRESS 0x00000040 +#define CO_USERELSUFFIX 0x00000080 +#define CO_EXACTRCS 0x00000100 +#define CO_CHECKRCS 0x00000200 +#define CO_SKIP 0x00000400 +#define CO_CHECKOUTMODE 0x00000800 +#define CO_NORSYNC 0x00001000 +#define CO_KEEPBADFILES 0x00002000 +#define CO_EXECUTE 0x00004000 +#define CO_SETOWNER 0x00008000 +#define CO_SETMODE 0x00010000 +#define CO_SETFLAGS 0x00020000 +#define CO_NORCS 0x00040000 +#define CO_STRICTCHECKRCS 0x00080000 +#define CO_TRUSTSTATUSFILE 0x00100000 +#define CO_DODELETESONLY 0x00200000 +#define CO_DETAILALLRCSFILES 0x00400000 + +#define CO_MASK 0x007fffff + +/* Options that the server is allowed to set. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 14:58:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B6E31065674; Sun, 29 Jan 2012 14:58:54 +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 6ECAD8FC16; Sun, 29 Jan 2012 14:58:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TEwsMF040592; Sun, 29 Jan 2012 14:58:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TEwsse040591; Sun, 29 Jan 2012 14:58:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291458.q0TEwsse040591@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 14:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230745 - in stable/8/contrib: bsnmp/snmpd csup top xz X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 14:58:54 -0000 Author: marius Date: Sun Jan 29 14:58:54 2012 New Revision: 230745 URL: http://svn.freebsd.org/changeset/base/230745 Log: MFC: r204556 Move csup away from contrib/ and into usr.bin/. Software is no longer contributed, and main development is happening in the FreeBSD repo. Deleted: stable/8/contrib/csup/ Modified: Directory Properties: stable/8/contrib/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/gperf/ (props changed) stable/8/contrib/ipfilter/ (props changed) stable/8/contrib/libarchive/ (props changed) stable/8/contrib/libarchive/cpio/ (props changed) stable/8/contrib/libarchive/libarchive/ (props changed) stable/8/contrib/libarchive/libarchive_fe/ (props changed) stable/8/contrib/libarchive/tar/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/libstdc++/ (props changed) stable/8/contrib/lukemftp/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/nvi/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/tcp_wrappers/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/telnet/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/contrib/xz/ (props changed) stable/8/contrib/xz/AUTHORS (props changed) stable/8/contrib/xz/COPYING (props changed) stable/8/contrib/xz/ChangeLog (props changed) stable/8/contrib/xz/FREEBSD-Xlist (props changed) stable/8/contrib/xz/FREEBSD-upgrade (props changed) stable/8/contrib/xz/README (props changed) stable/8/contrib/xz/THANKS (props changed) stable/8/contrib/xz/TODO (props changed) stable/8/contrib/xz/po/ (props changed) stable/8/contrib/xz/src/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 15:00:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F0B01065676; Sun, 29 Jan 2012 15:00:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D5748FC14; Sun, 29 Jan 2012 15:00:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TF0VJL040706; Sun, 29 Jan 2012 15:00:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TF0VEa040703; Sun, 29 Jan 2012 15:00:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291500.q0TF0VEa040703@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 15:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230746 - stable/9/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 15:00:31 -0000 Author: marius Date: Sun Jan 29 15:00:31 2012 New Revision: 230746 URL: http://svn.freebsd.org/changeset/base/230746 Log: MFC: r228858 Update a comment to reflect reality and explain why we're using the medany code model. Modified: stable/9/sys/conf/kern.mk Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/conf/kern.mk ============================================================================== --- stable/9/sys/conf/kern.mk Sun Jan 29 14:58:54 2012 (r230745) +++ stable/9/sys/conf/kern.mk Sun Jan 29 15:00:31 2012 (r230746) @@ -72,7 +72,8 @@ INLINE_LIMIT?= 15000 .endif # -# For sparc64 we want medlow code model, and we tell gcc to use floating +# For sparc64 we want the medany code model so modules may be located +# anywhere in the 64-bit address space. We also tell GCC to use floating # point emulation. This avoids using floating point registers for integer # operations which it has a tendency to do. # From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 15:00:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 532B4106566B; Sun, 29 Jan 2012 15:00:32 +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 412508FC12; Sun, 29 Jan 2012 15:00:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TF0WIj040736; Sun, 29 Jan 2012 15:00:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TF0WCo040734; Sun, 29 Jan 2012 15:00:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201291500.q0TF0WCo040734@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 15:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230747 - stable/8/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 15:00:32 -0000 Author: marius Date: Sun Jan 29 15:00:31 2012 New Revision: 230747 URL: http://svn.freebsd.org/changeset/base/230747 Log: MFC: r204556 Update a comment to reflect reality and explain why we're using the medany code model. Modified: stable/8/sys/conf/kern.mk Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/conf/kern.mk ============================================================================== --- stable/8/sys/conf/kern.mk Sun Jan 29 15:00:31 2012 (r230746) +++ stable/8/sys/conf/kern.mk Sun Jan 29 15:00:31 2012 (r230747) @@ -54,7 +54,8 @@ INLINE_LIMIT?= 15000 .endif # -# For sparc64 we want medlow code model, and we tell gcc to use floating +# For sparc64 we want the medany code model so modules may be located +# anywhere in the 64-bit address space. We also tell GCC to use floating # point emulation. This avoids using floating point registers for integer # operations which it has a tendency to do. # From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 15:41:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23E0B106566B; Sun, 29 Jan 2012 15:41:26 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 958938FC0A; Sun, 29 Jan 2012 15:41:25 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q0TFfOpt044454; Sun, 29 Jan 2012 16:41:24 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q0TFfOrW044453; Sun, 29 Jan 2012 16:41:24 +0100 (CET) (envelope-from marius) Date: Sun, 29 Jan 2012 16:41:24 +0100 From: Marius Strobl To: John Baldwin Message-ID: <20120129154124.GB18227@alchemy.franken.de> References: <200906091426.n59EQNRC074046@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200906091426.n59EQNRC074046@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: r193833 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 15:41:26 -0000 On Tue, Jun 09, 2009 at 02:26:23PM +0000, John Baldwin wrote: > Author: jhb > Date: Tue Jun 9 14:26:23 2009 > New Revision: 193833 > URL: http://svn.freebsd.org/changeset/base/193833 > > Log: > Add support for multiple passes of the device tree during the boot-time > probe. The current device order is unchanged. This commit just adds the > infrastructure and ABI changes so that it is easier to merge later changes > into 8.x. > - Driver attachments now have an associated pass level. Attachments are > not allowed to probe or attach to drivers until the system-wide pass level > is >= the attachment's pass level. By default driver attachments use the > "last" pass level (BUS_PASS_DEFAULT). Driver's that wish to probe during > an earlier pass use EARLY_DRIVER_MODULE() instead of DRIVER_MODULE() which > accepts the pass level as an additional parameter. > - A new method BUS_NEW_PASS has been added to the bus interface. This > method is invoked when the system-wide pass level is changed to kick off > a rescan of the device tree so that drivers that have just been made > "eligible" can probe and attach. > - The bus_generic_new_pass() function provides a default implementation of > BUS_NEW_PASS(). It first allows drivers that were just made eligible for > this pass to identify new child devices. Then it propogates the rescan to > child devices that already have an attached driver by invoking their > BUS_NEW_PASS() method. It also reprobes devices without a driver. > - BUS_PROBE_NOMATCH() is only invoked for devices that do not have > an attached driver after being scanned during the final pass. > - The bus_set_pass() function is used during boot to raise the pass level. > Currently it is only called once during root_bus_configure() to raise > the pass level to BUS_PASS_DEFAULT. This has the effect of probing all > devices in a single pass identical to previous behavior. > > Reviewed by: imp > Approved by: re (kib) > What would be necessary to finally enable support for multi-pass probing apart from the drivers also needing to set BUS_PASS_n if they want to take part earlier than BUS_PASS_DEFAULT)? My understanding is that this is should be as simple as changing root_bus_configure() to return BUS_PASS_ROOT instead of BUS_PASS_DEFAULT but the comment above that line actually talks about splitting the return value (?) up somehow ... Marius From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 18:54:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 269D6106564A; Sun, 29 Jan 2012 18:54:26 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CED38FC15; Sun, 29 Jan 2012 18:54:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TIsPVr048308; Sun, 29 Jan 2012 18:54:26 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TIsPjS048299; Sun, 29 Jan 2012 18:54:25 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201201291854.q0TIsPjS048299@svn.freebsd.org> From: Justin Hibbits Date: Sun, 29 Jan 2012 18:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230751 - in stable/9: etc/devd share/man/man4/man4.powerpc sys/conf sys/dev/adb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 18:54:26 -0000 Author: jhibbits Date: Sun Jan 29 18:54:25 2012 New Revision: 230751 URL: http://svn.freebsd.org/changeset/base/230751 Log: MFC r226449: Add support for special keys (volume/brightness/eject) on Apple laptops with ADB keyboards. Approved by: nwhitehorn (mentor) Added: stable/9/etc/devd/apple.conf - copied unchanged from r226449, head/etc/devd/apple.conf stable/9/share/man/man4/man4.powerpc/abtn.4 - copied unchanged from r226449, head/share/man/man4/man4.powerpc/abtn.4 stable/9/sys/dev/adb/adb_buttons.c - copied unchanged from r226449, head/sys/dev/adb/adb_buttons.c Modified: stable/9/etc/devd/Makefile stable/9/share/man/man4/man4.powerpc/Makefile stable/9/share/man/man4/man4.powerpc/akbd.4 stable/9/sys/conf/files.powerpc stable/9/sys/dev/adb/adb_kbd.c Directory Properties: stable/9/etc/ (props changed) stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/etc/devd/Makefile ============================================================================== --- stable/9/etc/devd/Makefile Sun Jan 29 16:44:21 2012 (r230750) +++ stable/9/etc/devd/Makefile Sun Jan 29 18:54:25 2012 (r230751) @@ -1,6 +1,14 @@ # $FreeBSD$ -FILES= asus.conf uath.conf usb.conf +FILES= uath.conf usb.conf + +.if ${MACHINE} == "powerpc" +FILES+= apple.conf +.endif + +.if ${MACHINE} == "amd64" || ${MACHINE} == "i386" +FILES+= asus.conf +.endif NO_OBJ= FILESDIR= /etc/devd Copied: stable/9/etc/devd/apple.conf (from r226449, head/etc/devd/apple.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/etc/devd/apple.conf Sun Jan 29 18:54:25 2012 (r230751, copy of r226449, head/etc/devd/apple.conf) @@ -0,0 +1,46 @@ +# $FreeBSD$ +# +# PowerPC Apple specific devd events + +# Keyboard power key +notify 0 { + match "system" "PMU"; + match "subsystem" "Button"; + match "notify" "0x0"; + action "shutdown -p now"; +}; + + +# The next blocks enable volume hotkeys that can be found on Apple laptops +notify 0 { + match "system" "PMU"; + match "subsystem" "keys"; + match "type" "mute"; + action "mixer 0"; +}; + +notify 0 { + match "system" "PMU"; + match "subsystem" "keys"; + match "type" "volume"; + match "notify" "down"; + action "mixer vol -10"; +}; + +notify 0 { + match "system" "PMU"; + match "subsystem" "keys"; + match "type" "volume"; + match "notify" "up"; + action "mixer vol +10"; +}; + +# Eject key +notify 0 { + match "system" "PMU"; + match "subsystem" "keys"; + match "type" "eject"; + action "camcontrol eject cd0"; +}; + + Modified: stable/9/share/man/man4/man4.powerpc/Makefile ============================================================================== --- stable/9/share/man/man4/man4.powerpc/Makefile Sun Jan 29 16:44:21 2012 (r230750) +++ stable/9/share/man/man4/man4.powerpc/Makefile Sun Jan 29 18:54:25 2012 (r230751) @@ -2,6 +2,7 @@ MAN= adb.4 \ akbd.4 \ + abtn.4 \ ams.4 \ bm.4 \ cuda.4 \ Copied: stable/9/share/man/man4/man4.powerpc/abtn.4 (from r226449, head/share/man/man4/man4.powerpc/abtn.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/man4.powerpc/abtn.4 Sun Jan 29 18:54:25 2012 (r230751, copy of r226449, head/share/man/man4/man4.powerpc/abtn.4) @@ -0,0 +1,115 @@ +.\"- +.\" Copyright (c) 2011 Justin Hibbits +.\" Copyright (c) 2009 Nathan Whitehorn +.\" 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$ +.\" +.Dd October 16, 2011 +.Dt ABTN 4 +.Os +.Sh NAME +.Nm abtn +.Nd ADB Keyboard Special Keys Driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device adb" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the extended Fn keys on Apple notebooks with an ADB +interface. +.Sh HARDWARE +The +.Nm +driver supports extended keyboard keys (special F-keys) on the following devices: +.Pp +.Bl -bullet -compact +.It +Apple iBook Keyboard +.It +Apple PowerBook Keyboard +.El +.Sh EVENTS +The +.Nm +driver sends events to +.Xr devd 8 +for the following events under the +.Cd PMU +system, and +.Cd keys +subsystem: +.Pp +.Bl -bullet -compact +.It +.Cd brightness +- Generates +.Cd up +and +.Cd down +notify types matching the pressed key. +.It +.Cd mute +.It +.Cd volume +- Generates +.Cd up +and +.Cd down +notify types matching the pressed key. +.It +.Cd eject +.El +.Pp +Examples are included in /etc/devd/apple.conf. +.Sh SEE ALSO +.Xr adb 4 , +.Xr akbd 4 , +.Xr cuda 4 , +.Xr pmu 4, +.Xr devd 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Nx 5.0 +and was ported to +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Tsubai Masanari +for +.Nx +and ported to +.Fx +by +.An Justin Hibbits . Modified: stable/9/share/man/man4/man4.powerpc/akbd.4 ============================================================================== --- stable/9/share/man/man4/man4.powerpc/akbd.4 Sun Jan 29 16:44:21 2012 (r230750) +++ stable/9/share/man/man4/man4.powerpc/akbd.4 Sun Jan 29 18:54:25 2012 (r230751) @@ -58,7 +58,36 @@ Apple iBook Keyboard .It Apple PowerBook Keyboard .El +.Sh EVENTS +The +.Nm +driver sends events to +.Xr devd 8 +for the following events under the +.Cd PMU +system: +.Pp +.Bl -bullet -compact +.It +Power button - +.Cd "Button" +subsystem, +.Cd "pressed" +type. +.El +.Sh SYSCTL VARIABLES +The +.Nm +driver supports the following sysctl variable for configuring the Fn keys: +.Bl -tag -width indent +.It Va dev.akbd.%d.fn_keys_function_as_primary +Set the Fn keys to be their F-key type as default. A value of 0 causes the +F-keys keys to work as special keys by default ( +.Xr abtn 4 ) +and a value of 1 sets them to behave as F-keys by default. +.El .Sh SEE ALSO +.Xr abtn 4 , .Xr adb 4 , .Xr cuda 4 , .Xr pmu 4 Modified: stable/9/sys/conf/files.powerpc ============================================================================== --- stable/9/sys/conf/files.powerpc Sun Jan 29 16:44:21 2012 (r230750) +++ stable/9/sys/conf/files.powerpc Sun Jan 29 18:54:25 2012 (r230751) @@ -22,6 +22,7 @@ dev/adb/adb_kbd.c optional adb dev/adb/adb_mouse.c optional adb dev/adb/adb_hb_if.m optional adb dev/adb/adb_if.m optional adb +dev/adb/adb_buttons.c optional adb dev/agp/agp_apple.c optional agp powermac dev/cfi/cfi_bus_fdt.c optional cfi fdt dev/fb/fb.c optional sc Copied: stable/9/sys/dev/adb/adb_buttons.c (from r226449, head/sys/dev/adb/adb_buttons.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/adb/adb_buttons.c Sun Jan 29 18:54:25 2012 (r230751, copy of r226449, head/sys/dev/adb/adb_buttons.c) @@ -0,0 +1,165 @@ +/*- + * Copyright (c) 2011, Justin Hibbits. + * Copyright (c) 2002, Miodrag Vallat. + * Copyright (C) 1999 Tsubai Masanari. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * + * OpenBSD: abtn.c,v 1.12 2009/01/10 18:00:59 robert Exp + * NetBSD: abtn.c,v 1.1 1999/07/12 17:48:26 tsubai Exp + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +#define ABTN_HANDLER_ID 31 + +struct abtn_softc { + device_t sc_dev; + + int handler_id; +}; + +static int abtn_probe(device_t dev); +static int abtn_attach(device_t dev); +static u_int abtn_receive_packet(device_t dev, u_char status, + u_char command, u_char reg, int len, u_char *data); + +static device_method_t abtn_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, abtn_probe), + DEVMETHOD(device_attach, abtn_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* ADB interface */ + DEVMETHOD(adb_receive_packet, abtn_receive_packet), + + { 0, 0 } +}; + +static driver_t abtn_driver = { + "abtn", + abtn_methods, + sizeof(struct abtn_softc), +}; + +static devclass_t abtn_devclass; + +DRIVER_MODULE(abtn, adb, abtn_driver, abtn_devclass, 0, 0); + +static int +abtn_probe(device_t dev) +{ + uint8_t type; + + type = adb_get_device_type(dev); + + if (type != ADB_DEVICE_MISC) + return (ENXIO); + + device_set_desc(dev, "ADB Brightness/Volume/Eject Buttons"); + return (0); +} + +static int +abtn_attach(device_t dev) +{ + struct abtn_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + sc->handler_id = adb_get_device_handler(dev); + + return 0; +} + +static u_int +abtn_receive_packet(device_t dev, u_char status, + u_char command, u_char reg, int len, u_char *data) +{ + u_int cmd; + + cmd = data[0]; + + switch (cmd) { + case 0x0a: /* decrease brightness */ + if (devctl_process_running()) + devctl_notify("PMU", "keys", "brightness", + "notify=down"); + break; + + case 0x09: /* increase brightness */ + if (devctl_process_running()) + devctl_notify("PMU", "keys", "brightness", "notify=up"); + break; + + case 0x08: /* mute */ + case 0x01: /* mute, AV hardware */ + if (devctl_process_running()) + devctl_notify("PMU", "keys", "mute", NULL); + break; + case 0x07: /* decrease volume */ + case 0x02: /* decrease volume, AV hardware */ + if (devctl_process_running()) + devctl_notify("PMU", "keys", "volume", "notify=down"); + break; + case 0x06: /* increase volume */ + case 0x03: /* increase volume, AV hardware */ + if (devctl_process_running()) + devctl_notify("PMU", "keys", "volume", "notify=up"); + break; + case 0x0c: /* mirror display key */ + /* Need callback to do something with this */ + break; + case 0x0b: /* eject tray */ + if (devctl_process_running()) + devctl_notify("PMU", "keys", "eject", NULL); + case 0x7f: /* numlock */ + /* Need callback to do something with this */ + break; + + default: +#ifdef DEBUG + if ((cmd & ~0x7f) == 0) + device_printf(dev, "unknown ADB button 0x%x\n", cmd); +#endif + break; + } + return 0; +} + Modified: stable/9/sys/dev/adb/adb_kbd.c ============================================================================== --- stable/9/sys/dev/adb/adb_kbd.c Sun Jan 29 16:44:21 2012 (r230750) +++ stable/9/sys/dev/adb/adb_kbd.c Sun Jan 29 18:54:25 2012 (r230751) @@ -35,12 +35,15 @@ #include #include #include +#include #include #include "opt_kbd.h" #include #include +#include +#include #include #include @@ -55,6 +58,7 @@ static int adb_kbd_probe(device_t dev); static int adb_kbd_attach(device_t dev); static int adb_kbd_detach(device_t dev); static void akbd_repeat(void *xsc); +static int adb_fn_keys(SYSCTL_HANDLER_ARGS); static u_int adb_kbd_receive_packet(device_t dev, u_char status, u_char command, u_char reg, int len, u_char *data); @@ -282,6 +286,8 @@ adb_kbd_attach(device_t dev) { struct adb_kbd_softc *sc; keyboard_switch_t *sw; + uint32_t fkeys; + phandle_t handle; sw = kbd_get_switch(KBD_DRIVER_NAME); if (sw == NULL) { @@ -333,6 +339,40 @@ adb_kbd_attach(device_t dev) adb_set_autopoll(dev,1); + handle = OF_finddevice("mac-io/via-pmu/adb/keyboard"); + if (handle != -1 && OF_getprop(handle, "AAPL,has-embedded-fn-keys", + &fkeys, sizeof(fkeys)) != -1) { + static const char *key_names[] = {"F1", "F2", "F3", "F4", "F5", + "F6", "F7", "F8", "F9", "F10", "F11", "F12"}; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + int i; + + if (bootverbose) + device_printf(dev, "Keyboard has embedded Fn keys\n"); + + for (i = 0; i < 12; i++) { + uint32_t keyval; + char buf[3]; + if (OF_getprop(handle, key_names[i], &keyval, + sizeof(keyval)) < 0) + continue; + buf[0] = 1; + buf[1] = i+1; + buf[2] = keyval; + adb_write_register(dev, 0, 3, buf); + } + adb_write_register(dev, 1, 2, &(uint16_t){0}); + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "fn_keys_function_as_primary", CTLTYPE_INT | CTLFLAG_RW, sc, + 0, adb_fn_keys, "I", + "Set the Fn keys to be their F-key type as default"); + } + return (0); } @@ -383,6 +423,13 @@ adb_kbd_receive_packet(device_t dev, u_c return (0); mtx_lock(&sc->sc_mutex); + /* 0x7f is always the power button */ + if (data[0] == 0x7f && devctl_process_running()) { + devctl_notify("PMU", "Button", "pressed", NULL); + return (0); + } else if (data[0] == 0xff) { + return (0); /* Ignore power button release. */ + } if ((data[0] & 0x7f) == 57 && sc->buffers < 7) { /* Fake the down/up cycle for caps lock */ sc->buffer[sc->buffers++] = data[0] & 0x7f; @@ -390,7 +437,6 @@ adb_kbd_receive_packet(device_t dev, u_c } else { sc->buffer[sc->buffers++] = data[0]; } - if (sc->buffer[sc->buffers-1] < 0xff) sc->last_press = sc->buffer[sc->buffers-1]; @@ -814,5 +860,29 @@ akbd_modevent(module_t mod, int type, vo return (0); } +static int +adb_fn_keys(SYSCTL_HANDLER_ARGS) +{ + struct adb_kbd_softc *sc = arg1; + int error; + uint16_t is_fn_enabled; + unsigned int is_fn_enabled_sysctl; + + adb_read_register(sc->sc_dev, 1, &is_fn_enabled); + is_fn_enabled &= 1; + is_fn_enabled_sysctl = is_fn_enabled; + error = sysctl_handle_int(oidp, &is_fn_enabled_sysctl, 0, req); + + if (error || !req->newptr) + return (error); + + is_fn_enabled = is_fn_enabled_sysctl; + if (is_fn_enabled != 1 && is_fn_enabled != 0) + return (EINVAL); + + adb_write_register(sc->sc_dev, 1, 2, &is_fn_enabled); + return (0); +} + DEV_MODULE(akbd, akbd_modevent, NULL); From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 19:35:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D23761065672; Sun, 29 Jan 2012 19:35:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD2EC8FC17; Sun, 29 Jan 2012 19:35:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TJZets049676; Sun, 29 Jan 2012 19:35:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TJZeZ9049674; Sun, 29 Jan 2012 19:35:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201291935.q0TJZeZ9049674@svn.freebsd.org> From: Adrian Chadd Date: Sun, 29 Jan 2012 19:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230752 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 19:35:40 -0000 Author: adrian Date: Sun Jan 29 19:35:40 2012 New Revision: 230752 URL: http://svn.freebsd.org/changeset/base/230752 Log: Missing code for receiving MESH PREP that should be part of r230409. Submitted by: Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Sun Jan 29 18:54:25 2012 (r230751) +++ head/sys/net80211/ieee80211_hwmp.c Sun Jan 29 19:35:40 2012 (r230752) @@ -1044,12 +1044,21 @@ hwmp_recv_prep(struct ieee80211vap *vap, * Sequence number validation. */ hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); - if (HWMP_SEQ_LEQ(prep->prep_targetseq, hr->hr_seq)) { - IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "discard PREP from %6D, old seq no %u <= %u", - prep->prep_targetaddr, ":", - prep->prep_targetseq, hr->hr_seq); - return; + if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID)) { + if (HWMP_SEQ_LT(prep->prep_targetseq, hr->hr_seq)) { + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "discard PREP from %6D, old seq no %u < %u", + prep->prep_targetaddr, ":", + prep->prep_targetseq, hr->hr_seq); + return; + } else if (HWMP_SEQ_LEQ(prep->prep_targetseq, hr->hr_seq) && + prep->prep_metric > rt->rt_metric) { + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "discard PREP from %6D, new metric %u > %u", + prep->prep_targetaddr, ":", + prep->prep_metric, rt->rt_metric); + return; + } } hr->hr_seq = prep->prep_targetseq; From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 20:39:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5771B1065675; Sun, 29 Jan 2012 20:39:43 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41CBA8FC0A; Sun, 29 Jan 2012 20:39:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TKdhOm051695; Sun, 29 Jan 2012 20:39:43 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TKdhA7051693; Sun, 29 Jan 2012 20:39:43 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201201292039.q0TKdhA7051693@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 29 Jan 2012 20:39: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: r230753 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 20:39:43 -0000 Author: trociny Date: Sun Jan 29 20:39:42 2012 New Revision: 230753 URL: http://svn.freebsd.org/changeset/base/230753 Log: Always return 0 if the sysctl failed. This fixes the bug: when procstat -xa was run and the sysctl for a process returned ESRCH or EPERM, for this process procstat output the result collected for the previous successful process. Modified: head/usr.bin/procstat/procstat_auxv.c Modified: head/usr.bin/procstat/procstat_auxv.c ============================================================================== --- head/usr.bin/procstat/procstat_auxv.c Sun Jan 29 19:35:40 2012 (r230752) +++ head/usr.bin/procstat/procstat_auxv.c Sun Jan 29 20:39:42 2012 (r230753) @@ -81,7 +81,7 @@ is_elf32(pid_t pid) static size_t retrieve_auxv32(pid_t pid) { - int error, name[4]; + int name[4]; size_t len, i; void *ptr; @@ -90,9 +90,9 @@ retrieve_auxv32(pid_t pid) name[2] = KERN_PROC_AUXV; name[3] = pid; len = sizeof(auxv32); - error = sysctl(name, 4, auxv32, &len, NULL, 0); - if (error < 0 && errno != ESRCH && errno != EPERM) { - warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); + if (sysctl(name, 4, auxv32, &len, NULL, 0) == -1) { + if (errno != ESRCH && errno != EPERM) + warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); return (0); } for (i = 0; i < len; i++) { @@ -117,7 +117,7 @@ retrieve_auxv32(pid_t pid) static size_t retrieve_auxv(pid_t pid) { - int error, name[4]; + int name[4]; size_t len; #if __ELF_WORD_SIZE == 64 @@ -129,9 +129,9 @@ retrieve_auxv(pid_t pid) name[2] = KERN_PROC_AUXV; name[3] = pid; len = sizeof(auxv); - error = sysctl(name, 4, auxv, &len, NULL, 0); - if (error < 0 && errno != ESRCH && errno != EPERM) { - warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); + if (sysctl(name, 4, auxv, &len, NULL, 0) == -1) { + if (errno != ESRCH && errno != EPERM) + warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); return (0); } return (len); From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 21:08:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54F791065686; Sun, 29 Jan 2012 21:08:25 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B5778FC08; Sun, 29 Jan 2012 21:08:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TL8PBL052695; Sun, 29 Jan 2012 21:08:25 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TL8O61052689; Sun, 29 Jan 2012 21:08:24 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201201292108.q0TL8O61052689@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 29 Jan 2012 21:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230754 - in stable/9/sys: compat/linprocfs fs/procfs kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 21:08:25 -0000 Author: trociny Date: Sun Jan 29 21:08:24 2012 New Revision: 230754 URL: http://svn.freebsd.org/changeset/base/230754 Log: MFC r227833, r227834, r227836, r227874, r227955, r228029, r228030, r228046, r228264, r228288, r228302, r228648, r228666, r230145, r230470, r230550: New kern.proc sysctls. r227833, r227874: Add new sysctls, KERN_PROC_ENV and KERN_PROC_AUXV, to return environment strings and ELF auxiliary vectors from a process stack. Make sysctl_kern_proc_args to read not cached arguments from the process stack. Export proc_getargv() and proc_getenvv() so they can be reused by procfs and linprocfs. Suggested by: kib Reviewed by: kib Discussed with: kib, rwatson, jilles Tested by: pho MFC r227834: In procfs_doproccmdline() if arguments are not cashed read them from the process stack. Suggested by: kib Reviewed by: kib Tested by: pho MFC r227836: Retire linprocfs_doargv(). Instead use new functions, proc_getargv() and proc_getenvv(), which were implemented using linprocfs_doargv() as a reference. Suggested by: kib Reviewed by: kib Approved by: des (linprocfs maintainer) r227955: Add sysctl to get process resource limits. Reviewed by: kib r228029: In sysctl_kern_proc_auxv the process was released too early: we still need to hold it when checking process sv_flags. r228030, r228046: Add sysctl to retrieve ps_strings structure location of another process. Suggested by: kib Reviewed by: kib r228264: In sysctl_kern_proc_ps_strings() there is no much sense in checking for P_WEXIT and P_SYSTEM flags. Reviewed by: kib r228288, r228302: Protect kern.proc.auxv and kern.proc.ps_strings sysctls with p_candebug(). Citing jilles: If we are ever going to do ASLR, the AUXV information tells an attacker where the stack, executable and RTLD are located, which defeats much of the point of randomizing the addresses in the first place. Given that the AUXV information seems to be used by debuggers only anyway, I think it would be good to move it to p_candebug() now. The full virtual memory maps (KERN_PROC_VMMAP, procstat -v) are already under p_candebug(). Suggested by: jilles Discussed with: rwatson r228648: On start most of sysctl_kern_proc functions use the same pattern: locate a process calling pfind() and do some additional checks like p_candebug(). To reduce this code duplication a new function pget() is introduced and used. As the function may be useful not only in kern_proc.c it is in the kernel name space. Suggested by: kib Reviewed by: kib r228666: Fix style and white spaces. MFC r230145: Abrogate nchr argument in proc_getargv() and proc_getenvv(): we always want to read strings completely to know the actual size. As a side effect it fixes the issue with kern.proc.args and kern.proc.env sysctls, which didn't return the size of available data when calling sysctl(3) with the NULL argument for oldp. Note, in get_ps_strings(), which does actual work for proc_getargv() and proc_getenvv(), we still have a safety limit on the size of data read in case of a corrupted procces stack. Suggested by: kib r230470: Change kern.proc.rlimit sysctl to: - retrive only one, specified limit for a process, not the whole array, as it was previously (the sysctl has been added recently and has not been backported to stable yet, so this change is ok); - allow to set a resource limit for another process. Submitted by: Andrey Zonov Discussed with: kib Reviewed by: kib r230550: Fix CTL flags in the declarations of KERN_PROC_ENV, AUXV and PS_STRINGS sysctls: they are read only. Modified: stable/9/sys/compat/linprocfs/linprocfs.c stable/9/sys/fs/procfs/procfs_status.c stable/9/sys/kern/kern_proc.c stable/9/sys/kern/kern_resource.c stable/9/sys/sys/proc.h stable/9/sys/sys/resourcevar.h stable/9/sys/sys/sysctl.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/9/sys/compat/linprocfs/linprocfs.c Sun Jan 29 20:39:42 2012 (r230753) +++ stable/9/sys/compat/linprocfs/linprocfs.c Sun Jan 29 21:08:24 2012 (r230754) @@ -919,150 +919,6 @@ linprocfs_doprocroot(PFS_FILL_ARGS) return (0); } -#define MAX_ARGV_STR 512 /* Max number of argv-like strings */ -#define UIO_CHUNK_SZ 256 /* Max chunk size (bytes) for uiomove */ - -static int -linprocfs_doargv(struct thread *td, struct proc *p, struct sbuf *sb, - void (*resolver)(const struct ps_strings, u_long *, int *)) -{ - struct iovec iov; - struct uio tmp_uio; - struct ps_strings pss; - int ret, i, n_elements, elm_len; - u_long addr, pbegin; - char **env_vector, *envp; - char env_string[UIO_CHUNK_SZ]; -#ifdef COMPAT_FREEBSD32 - struct freebsd32_ps_strings pss32; - uint32_t *env_vector32; -#endif - -#define UIO_HELPER(uio, iov, base, len, cnt, offset, sz, flg, rw, td) \ -do { \ - iov.iov_base = (caddr_t)(base); \ - iov.iov_len = (len); \ - uio.uio_iov = &(iov); \ - uio.uio_iovcnt = (cnt); \ - uio.uio_offset = (off_t)(offset); \ - uio.uio_resid = (sz); \ - uio.uio_segflg = (flg); \ - uio.uio_rw = (rw); \ - uio.uio_td = (td); \ -} while (0) - - env_vector = malloc(sizeof(char *) * MAX_ARGV_STR, M_TEMP, M_WAITOK); - -#ifdef COMPAT_FREEBSD32 - env_vector32 = NULL; - if (SV_PROC_FLAG(p, SV_ILP32) != 0) { - env_vector32 = malloc(sizeof(*env_vector32) * MAX_ARGV_STR, - M_TEMP, M_WAITOK); - elm_len = sizeof(int32_t); - envp = (char *)env_vector32; - - UIO_HELPER(tmp_uio, iov, &pss32, sizeof(pss32), 1, - (off_t)(p->p_sysent->sv_psstrings), - sizeof(pss32), UIO_SYSSPACE, UIO_READ, td); - ret = proc_rwmem(p, &tmp_uio); - if (ret != 0) - goto done; - pss.ps_argvstr = PTRIN(pss32.ps_argvstr); - pss.ps_nargvstr = pss32.ps_nargvstr; - pss.ps_envstr = PTRIN(pss32.ps_envstr); - pss.ps_nenvstr = pss32.ps_nenvstr; - } else { -#endif - elm_len = sizeof(char *); - envp = (char *)env_vector; - - UIO_HELPER(tmp_uio, iov, &pss, sizeof(pss), 1, - (off_t)(p->p_sysent->sv_psstrings), - sizeof(pss), UIO_SYSSPACE, UIO_READ, td); - ret = proc_rwmem(p, &tmp_uio); - if (ret != 0) - goto done; -#ifdef COMPAT_FREEBSD32 - } -#endif - - /* Get the array address and the number of elements */ - resolver(pss, &addr, &n_elements); - - /* Consistent with lib/libkvm/kvm_proc.c */ - if (n_elements > MAX_ARGV_STR) { - ret = E2BIG; - goto done; - } - - UIO_HELPER(tmp_uio, iov, envp, n_elements * elm_len, 1, - (vm_offset_t)(addr), iov.iov_len, UIO_SYSSPACE, UIO_READ, td); - ret = proc_rwmem(p, &tmp_uio); - if (ret != 0) - goto done; -#ifdef COMPAT_FREEBSD32 - if (env_vector32 != NULL) { - for (i = 0; i < n_elements; i++) - env_vector[i] = PTRIN(env_vector32[i]); - } -#endif - - /* Now we can iterate through the list of strings */ - for (i = 0; i < n_elements; i++) { - pbegin = (vm_offset_t)env_vector[i]; - for (;;) { - UIO_HELPER(tmp_uio, iov, env_string, sizeof(env_string), - 1, pbegin, iov.iov_len, UIO_SYSSPACE, UIO_READ, td); - ret = proc_rwmem(p, &tmp_uio); - if (ret != 0) - goto done; - - if (!strvalid(env_string, UIO_CHUNK_SZ)) { - /* - * We didn't find the end of the string. - * Add the string to the buffer and move - * the pointer. But do not allow strings - * of unlimited length. - */ - sbuf_bcat(sb, env_string, UIO_CHUNK_SZ); - if (sbuf_len(sb) >= ARG_MAX) { - ret = E2BIG; - goto done; - } - pbegin += UIO_CHUNK_SZ; - } else { - sbuf_cat(sb, env_string); - break; - } - } - sbuf_bcat(sb, "", 1); - } -#undef UIO_HELPER - -done: - free(env_vector, M_TEMP); -#ifdef COMPAT_FREEBSD32 - free(env_vector32, M_TEMP); -#endif - return (ret); -} - -static void -ps_string_argv(const struct ps_strings ps, u_long *addr, int *n) -{ - - *addr = (u_long) ps.ps_argvstr; - *n = ps.ps_nargvstr; -} - -static void -ps_string_env(const struct ps_strings ps, u_long *addr, int *n) -{ - - *addr = (u_long) ps.ps_envstr; - *n = ps.ps_nenvstr; -} - /* * Filler function for proc/pid/cmdline */ @@ -1090,9 +946,15 @@ linprocfs_doproccmdline(PFS_FILL_ARGS) PROC_UNLOCK(p); return (0); } + + if ((p->p_flag & P_SYSTEM) != 0) { + PROC_UNLOCK(p); + return (0); + } + PROC_UNLOCK(p); - ret = linprocfs_doargv(td, p, sb, ps_string_argv); + ret = proc_getargv(td, p, sb); return (ret); } @@ -1118,9 +980,15 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) PROC_UNLOCK(p); return (0); } + + if ((p->p_flag & P_SYSTEM) != 0) { + PROC_UNLOCK(p); + return (0); + } + PROC_UNLOCK(p); - ret = linprocfs_doargv(td, p, sb, ps_string_env); + ret = proc_getenvv(td, p, sb); return (ret); } Modified: stable/9/sys/fs/procfs/procfs_status.c ============================================================================== --- stable/9/sys/fs/procfs/procfs_status.c Sun Jan 29 20:39:42 2012 (r230753) +++ stable/9/sys/fs/procfs/procfs_status.c Sun Jan 29 21:08:24 2012 (r230754) @@ -170,15 +170,10 @@ procfs_doprocstatus(PFS_FILL_ARGS) int procfs_doproccmdline(PFS_FILL_ARGS) { - struct ps_strings pstr; - char **ps_argvstr; - int error, i; /* * If we are using the ps/cmdline caching, use that. Otherwise - * revert back to the old way which only implements full cmdline - * for the current process and just p->p_comm for all other - * processes. + * read argv from the process space. * Note that if the argv is no longer available, we deliberately * don't fall back on p->p_comm or return an error: the authentic * Linux behaviour is to return zero-length in this case. @@ -190,30 +185,13 @@ procfs_doproccmdline(PFS_FILL_ARGS) PROC_UNLOCK(p); return (0); } - PROC_UNLOCK(p); - if (p != td->td_proc) { - sbuf_printf(sb, "%.*s", MAXCOMLEN, p->p_comm); - } else { - error = copyin((void *)p->p_sysent->sv_psstrings, &pstr, - sizeof(pstr)); - if (error) - return (error); - if (pstr.ps_nargvstr > ARG_MAX) - return (E2BIG); - ps_argvstr = malloc(pstr.ps_nargvstr * sizeof(char *), - M_TEMP, M_WAITOK); - error = copyin((void *)pstr.ps_argvstr, ps_argvstr, - pstr.ps_nargvstr * sizeof(char *)); - if (error) { - free(ps_argvstr, M_TEMP); - return (error); - } - for (i = 0; i < pstr.ps_nargvstr; i++) { - sbuf_copyin(sb, ps_argvstr[i], 0); - sbuf_printf(sb, "%c", '\0'); - } - free(ps_argvstr, M_TEMP); + + if ((p->p_flag & P_SYSTEM) != 0) { + PROC_UNLOCK(p); + return (0); } - return (0); + PROC_UNLOCK(p); + + return (proc_getargv(td, p, sb)); } Modified: stable/9/sys/kern/kern_proc.c ============================================================================== --- stable/9/sys/kern/kern_proc.c Sun Jan 29 20:39:42 2012 (r230753) +++ stable/9/sys/kern/kern_proc.c Sun Jan 29 21:08:24 2012 (r230754) @@ -41,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -50,7 +52,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -326,6 +330,55 @@ pgfind(pgid) } /* + * Locate process and do additional manipulations, depending on flags. + */ +int +pget(pid_t pid, int flags, struct proc **pp) +{ + struct proc *p; + int error; + + p = pfind(pid); + if (p == NULL) + return (ESRCH); + if ((flags & PGET_CANSEE) != 0) { + error = p_cansee(curthread, p); + if (error != 0) + goto errout; + } + if ((flags & PGET_CANDEBUG) != 0) { + error = p_candebug(curthread, p); + if (error != 0) + goto errout; + } + if ((flags & PGET_ISCURRENT) != 0 && curproc != p) { + error = EPERM; + goto errout; + } + if ((flags & PGET_NOTWEXIT) != 0 && (p->p_flag & P_WEXIT) != 0) { + error = ESRCH; + goto errout; + } + if ((flags & PGET_NOTINEXEC) != 0 && (p->p_flag & P_INEXEC) != 0) { + /* + * XXXRW: Not clear ESRCH is the right error during proc + * execve(). + */ + error = ESRCH; + goto errout; + } + if ((flags & PGET_HOLD) != 0) { + _PHOLD(p); + PROC_UNLOCK(p); + } + *pp = p; + return (0); +errout: + PROC_UNLOCK(p); + return (error); +} + +/* * Create a new process group. * pgid must be equal to the pid of p. * Begin a new session if required. @@ -1153,7 +1206,7 @@ sysctl_out_proc(struct proc *p, struct s static int sysctl_kern_proc(SYSCTL_HANDLER_ARGS) { - int *name = (int*) arg1; + int *name = (int *)arg1; u_int namelen = arg2; struct proc *p; int flags, doingzomb, oid_number; @@ -1168,18 +1221,14 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) oid_number &= ~KERN_PROC_INC_THREAD; } if (oid_number == KERN_PROC_PID) { - if (namelen != 1) + if (namelen != 1) return (EINVAL); error = sysctl_wire_old_buffer(req, 0); if (error) - return (error); - p = pfind((pid_t)name[0]); - if (!p) - return (ESRCH); - if ((error = p_cansee(curthread, p))) { - PROC_UNLOCK(p); return (error); - } + error = pget((pid_t)name[0], PGET_CANSEE, &p); + if (error != 0) + return (error); error = sysctl_out_proc(p, req, flags); return (error); } @@ -1198,7 +1247,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) return (EINVAL); break; } - + if (!req->oldptr) { /* overestimate by 5 procs */ error = SYSCTL_OUT(req, 0, sizeof (struct kinfo_proc) * 5); @@ -1278,7 +1327,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) /* XXX proctree_lock */ SESS_LOCK(p->p_session); if (p->p_session->s_ttyp == NULL || - tty_udev(p->p_session->s_ttyp) != + tty_udev(p->p_session->s_ttyp) != (dev_t)name[0]) { SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); @@ -1358,6 +1407,290 @@ pargs_drop(struct pargs *pa) pargs_free(pa); } +static int +proc_read_mem(struct thread *td, struct proc *p, vm_offset_t offset, void* buf, + size_t len) +{ + struct iovec iov; + struct uio uio; + + iov.iov_base = (caddr_t)buf; + iov.iov_len = len; + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + uio.uio_offset = offset; + uio.uio_resid = (ssize_t)len; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = UIO_READ; + uio.uio_td = td; + + return (proc_rwmem(p, &uio)); +} + +static int +proc_read_string(struct thread *td, struct proc *p, const char *sptr, char *buf, + size_t len) +{ + size_t i; + int error; + + error = proc_read_mem(td, p, (vm_offset_t)sptr, buf, len); + /* + * Reading the chunk may validly return EFAULT if the string is shorter + * than the chunk and is aligned at the end of the page, assuming the + * next page is not mapped. So if EFAULT is returned do a fallback to + * one byte read loop. + */ + if (error == EFAULT) { + for (i = 0; i < len; i++, buf++, sptr++) { + error = proc_read_mem(td, p, (vm_offset_t)sptr, buf, 1); + if (error != 0) + return (error); + if (*buf == '\0') + break; + } + error = 0; + } + return (error); +} + +#define PROC_AUXV_MAX 256 /* Safety limit on auxv size. */ + +enum proc_vector_type { + PROC_ARG, + PROC_ENV, + PROC_AUX, +}; + +#ifdef COMPAT_FREEBSD32 +static int +get_proc_vector32(struct thread *td, struct proc *p, char ***proc_vectorp, + size_t *vsizep, enum proc_vector_type type) +{ + struct freebsd32_ps_strings pss; + Elf32_Auxinfo aux; + vm_offset_t vptr, ptr; + uint32_t *proc_vector32; + char **proc_vector; + size_t vsize, size; + int i, error; + + error = proc_read_mem(td, p, (vm_offset_t)(p->p_sysent->sv_psstrings), + &pss, sizeof(pss)); + if (error != 0) + return (error); + switch (type) { + case PROC_ARG: + vptr = (vm_offset_t)PTRIN(pss.ps_argvstr); + vsize = pss.ps_nargvstr; + if (vsize > ARG_MAX) + return (ENOEXEC); + size = vsize * sizeof(int32_t); + break; + case PROC_ENV: + vptr = (vm_offset_t)PTRIN(pss.ps_envstr); + vsize = pss.ps_nenvstr; + if (vsize > ARG_MAX) + return (ENOEXEC); + size = vsize * sizeof(int32_t); + break; + case PROC_AUX: + vptr = (vm_offset_t)PTRIN(pss.ps_envstr) + + (pss.ps_nenvstr + 1) * sizeof(int32_t); + if (vptr % 4 != 0) + return (ENOEXEC); + for (ptr = vptr, i = 0; i < PROC_AUXV_MAX; i++) { + error = proc_read_mem(td, p, ptr, &aux, sizeof(aux)); + if (error != 0) + return (error); + if (aux.a_type == AT_NULL) + break; + ptr += sizeof(aux); + } + if (aux.a_type != AT_NULL) + return (ENOEXEC); + vsize = i + 1; + size = vsize * sizeof(aux); + break; + default: + KASSERT(0, ("Wrong proc vector type: %d", type)); + return (EINVAL); + } + proc_vector32 = malloc(size, M_TEMP, M_WAITOK); + error = proc_read_mem(td, p, vptr, proc_vector32, size); + if (error != 0) + goto done; + if (type == PROC_AUX) { + *proc_vectorp = (char **)proc_vector32; + *vsizep = vsize; + return (0); + } + proc_vector = malloc(vsize * sizeof(char *), M_TEMP, M_WAITOK); + for (i = 0; i < (int)vsize; i++) + proc_vector[i] = PTRIN(proc_vector32[i]); + *proc_vectorp = proc_vector; + *vsizep = vsize; +done: + free(proc_vector32, M_TEMP); + return (error); +} +#endif + +static int +get_proc_vector(struct thread *td, struct proc *p, char ***proc_vectorp, + size_t *vsizep, enum proc_vector_type type) +{ + struct ps_strings pss; + Elf_Auxinfo aux; + vm_offset_t vptr, ptr; + char **proc_vector; + size_t vsize, size; + int error, i; + +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(p, SV_ILP32) != 0) + return (get_proc_vector32(td, p, proc_vectorp, vsizep, type)); +#endif + error = proc_read_mem(td, p, (vm_offset_t)(p->p_sysent->sv_psstrings), + &pss, sizeof(pss)); + if (error != 0) + return (error); + switch (type) { + case PROC_ARG: + vptr = (vm_offset_t)pss.ps_argvstr; + vsize = pss.ps_nargvstr; + if (vsize > ARG_MAX) + return (ENOEXEC); + size = vsize * sizeof(char *); + break; + case PROC_ENV: + vptr = (vm_offset_t)pss.ps_envstr; + vsize = pss.ps_nenvstr; + if (vsize > ARG_MAX) + return (ENOEXEC); + size = vsize * sizeof(char *); + break; + case PROC_AUX: + /* + * The aux array is just above env array on the stack. Check + * that the address is naturally aligned. + */ + vptr = (vm_offset_t)pss.ps_envstr + (pss.ps_nenvstr + 1) + * sizeof(char *); +#if __ELF_WORD_SIZE == 64 + if (vptr % sizeof(uint64_t) != 0) +#else + if (vptr % sizeof(uint32_t) != 0) +#endif + return (ENOEXEC); + /* + * We count the array size reading the aux vectors from the + * stack until AT_NULL vector is returned. So (to keep the code + * simple) we read the process stack twice: the first time here + * to find the size and the second time when copying the vectors + * to the allocated proc_vector. + */ + for (ptr = vptr, i = 0; i < PROC_AUXV_MAX; i++) { + error = proc_read_mem(td, p, ptr, &aux, sizeof(aux)); + if (error != 0) + return (error); + if (aux.a_type == AT_NULL) + break; + ptr += sizeof(aux); + } + /* + * If the PROC_AUXV_MAX entries are iterated over, and we have + * not reached AT_NULL, it is most likely we are reading wrong + * data: either the process doesn't have auxv array or data has + * been modified. Return the error in this case. + */ + if (aux.a_type != AT_NULL) + return (ENOEXEC); + vsize = i + 1; + size = vsize * sizeof(aux); + break; + default: + KASSERT(0, ("Wrong proc vector type: %d", type)); + return (EINVAL); /* In case we are built without INVARIANTS. */ + } + proc_vector = malloc(size, M_TEMP, M_WAITOK); + if (proc_vector == NULL) + return (ENOMEM); + error = proc_read_mem(td, p, vptr, proc_vector, size); + if (error != 0) { + free(proc_vector, M_TEMP); + return (error); + } + *proc_vectorp = proc_vector; + *vsizep = vsize; + + return (0); +} + +#define GET_PS_STRINGS_CHUNK_SZ 256 /* Chunk size (bytes) for ps_strings operations. */ + +static int +get_ps_strings(struct thread *td, struct proc *p, struct sbuf *sb, + enum proc_vector_type type) +{ + size_t done, len, nchr, vsize; + int error, i; + char **proc_vector, *sptr; + char pss_string[GET_PS_STRINGS_CHUNK_SZ]; + + PROC_ASSERT_HELD(p); + + /* + * We are not going to read more than 2 * (PATH_MAX + ARG_MAX) bytes. + */ + nchr = 2 * (PATH_MAX + ARG_MAX); + + error = get_proc_vector(td, p, &proc_vector, &vsize, type); + if (error != 0) + return (error); + for (done = 0, i = 0; i < (int)vsize && done < nchr; i++) { + /* + * The program may have scribbled into its argv array, e.g. to + * remove some arguments. If that has happened, break out + * before trying to read from NULL. + */ + if (proc_vector[i] == NULL) + break; + for (sptr = proc_vector[i]; ; sptr += GET_PS_STRINGS_CHUNK_SZ) { + error = proc_read_string(td, p, sptr, pss_string, + sizeof(pss_string)); + if (error != 0) + goto done; + len = strnlen(pss_string, GET_PS_STRINGS_CHUNK_SZ); + if (done + len >= nchr) + len = nchr - done - 1; + sbuf_bcat(sb, pss_string, len); + if (len != GET_PS_STRINGS_CHUNK_SZ) + break; + done += GET_PS_STRINGS_CHUNK_SZ; + } + sbuf_bcat(sb, "", 1); + done += len + 1; + } +done: + free(proc_vector, M_TEMP); + return (error); +} + +int +proc_getargv(struct thread *td, struct proc *p, struct sbuf *sb) +{ + + return (get_ps_strings(curthread, p, sb, PROC_ARG)); +} + +int +proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb) +{ + + return (get_ps_strings(curthread, p, sb, PROC_ENV)); +} + /* * This sysctl allows a process to retrieve the argument list or process * title for another process without groping around in the address space @@ -1367,35 +1700,42 @@ pargs_drop(struct pargs *pa) static int sysctl_kern_proc_args(SYSCTL_HANDLER_ARGS) { - int *name = (int*) arg1; + int *name = (int *)arg1; u_int namelen = arg2; struct pargs *newpa, *pa; struct proc *p; - int error = 0; + struct sbuf sb; + int flags, error = 0, error2; - if (namelen != 1) + if (namelen != 1) return (EINVAL); - p = pfind((pid_t)name[0]); - if (!p) - return (ESRCH); - - if ((error = p_cansee(curthread, p)) != 0) { - PROC_UNLOCK(p); + flags = PGET_CANSEE; + if (req->newptr != NULL) + flags |= PGET_ISCURRENT; + error = pget((pid_t)name[0], flags, &p); + if (error) return (error); - } - - if (req->newptr && curproc != p) { - PROC_UNLOCK(p); - return (EPERM); - } pa = p->p_args; - pargs_hold(pa); - PROC_UNLOCK(p); - if (pa != NULL) + if (pa != NULL) { + pargs_hold(pa); + PROC_UNLOCK(p); error = SYSCTL_OUT(req, pa->ar_args, pa->ar_length); - pargs_drop(pa); + pargs_drop(pa); + } else if ((p->p_flag & (P_WEXIT | P_SYSTEM)) == 0) { + _PHOLD(p); + PROC_UNLOCK(p); + sbuf_new_for_sysctl(&sb, NULL, GET_PS_STRINGS_CHUNK_SZ, req); + error = proc_getargv(curthread, p, &sb); + error2 = sbuf_finish(&sb); + PRELE(p); + sbuf_delete(&sb); + if (error == 0 && error2 != 0) + error = error2; + } else { + PROC_UNLOCK(p); + } if (error != 0 || req->newptr == NULL) return (error); @@ -1416,6 +1756,78 @@ sysctl_kern_proc_args(SYSCTL_HANDLER_ARG } /* + * This sysctl allows a process to retrieve environment of another process. + */ +static int +sysctl_kern_proc_env(SYSCTL_HANDLER_ARGS) +{ + int *name = (int *)arg1; + u_int namelen = arg2; + struct proc *p; + struct sbuf sb; + int error, error2; + + if (namelen != 1) + return (EINVAL); + + error = pget((pid_t)name[0], PGET_WANTREAD, &p); + if (error != 0) + return (error); + if ((p->p_flag & P_SYSTEM) != 0) { + PRELE(p); + return (0); + } + + sbuf_new_for_sysctl(&sb, NULL, GET_PS_STRINGS_CHUNK_SZ, req); + error = proc_getenvv(curthread, p, &sb); + error2 = sbuf_finish(&sb); + PRELE(p); + sbuf_delete(&sb); + return (error != 0 ? error : error2); +} + +/* + * This sysctl allows a process to retrieve ELF auxiliary vector of + * another process. + */ +static int +sysctl_kern_proc_auxv(SYSCTL_HANDLER_ARGS) +{ + int *name = (int *)arg1; + u_int namelen = arg2; + struct proc *p; + size_t vsize, size; + char **auxv; + int error; + + if (namelen != 1) + return (EINVAL); + + error = pget((pid_t)name[0], PGET_WANTREAD, &p); + if (error != 0) + return (error); + if ((p->p_flag & P_SYSTEM) != 0) { + PRELE(p); + return (0); + } + error = get_proc_vector(curthread, p, &auxv, &vsize, PROC_AUX); + if (error == 0) { +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(p, SV_ILP32) != 0) + size = vsize * sizeof(Elf32_Auxinfo); + else +#endif + size = vsize * sizeof(Elf_Auxinfo); + PRELE(p); + error = SYSCTL_OUT(req, auxv, size); + free(auxv, M_TEMP); + } else { + PRELE(p); + } + return (error); +} + +/* * This sysctl allows a process to retrieve the path of the executable for * itself or another process. */ @@ -1434,13 +1846,9 @@ sysctl_kern_proc_pathname(SYSCTL_HANDLER if (*pidp == -1) { /* -1 means this process */ p = req->td->td_proc; } else { - p = pfind(*pidp); - if (p == NULL) - return (ESRCH); - if ((error = p_cansee(curthread, p)) != 0) { - PROC_UNLOCK(p); + error = pget(*pidp, PGET_CANSEE, &p); + if (error != 0) return (error); - } } vp = p->p_textvp; @@ -1473,16 +1881,13 @@ sysctl_kern_proc_sv_name(SYSCTL_HANDLER_ int error; namelen = arg2; - if (namelen != 1) + if (namelen != 1) return (EINVAL); name = (int *)arg1; - if ((p = pfind((pid_t)name[0])) == NULL) - return (ESRCH); - if ((error = p_cansee(curthread, p))) { - PROC_UNLOCK(p); + error = pget((pid_t)name[0], PGET_CANSEE, &p); + if (error != 0) return (error); - } sv_name = p->p_sysent->sv_name; PROC_UNLOCK(p); return (sysctl_handle_string(oidp, sv_name, 0, req)); @@ -1509,18 +1914,9 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A struct vmspace *vm; name = (int *)arg1; - if ((p = pfind((pid_t)name[0])) == NULL) - return (ESRCH); - if (p->p_flag & P_WEXIT) { - PROC_UNLOCK(p); - return (ESRCH); - } - if ((error = p_candebug(curthread, p))) { - PROC_UNLOCK(p); + error = pget((pid_t)name[0], PGET_WANTREAD, &p); + if (error != 0) return (error); - } - _PHOLD(p); - PROC_UNLOCK(p); vm = vmspace_acquire_ref(p); if (vm == NULL) { PRELE(p); @@ -1687,18 +2083,9 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR vm_map_t map; name = (int *)arg1; - if ((p = pfind((pid_t)name[0])) == NULL) - return (ESRCH); - if (p->p_flag & P_WEXIT) { - PROC_UNLOCK(p); - return (ESRCH); - } - if ((error = p_candebug(curthread, p))) { - PROC_UNLOCK(p); + error = pget((pid_t)name[0], PGET_WANTREAD, &p); + if (error != 0) return (error); - } - _PHOLD(p); - PROC_UNLOCK(p); vm = vmspace_acquire_ref(p); if (vm == NULL) { PRELE(p); @@ -1872,19 +2259,9 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_A struct proc *p; name = (int *)arg1; - if ((p = pfind((pid_t)name[0])) == NULL) - return (ESRCH); - /* XXXRW: Not clear ESRCH is the right error during proc execve(). */ - if (p->p_flag & P_WEXIT || p->p_flag & P_INEXEC) { - PROC_UNLOCK(p); - return (ESRCH); - } - if ((error = p_candebug(curthread, p))) { - PROC_UNLOCK(p); + error = pget((pid_t)name[0], PGET_NOTINEXEC | PGET_WANTREAD, &p); + if (error != 0) return (error); - } - _PHOLD(p); - PROC_UNLOCK(p); kkstp = malloc(sizeof(*kkstp), M_TEMP, M_WAITOK); st = stack_create(); @@ -1979,13 +2356,9 @@ sysctl_kern_proc_groups(SYSCTL_HANDLER_A if (*pidp == -1) { /* -1 means this process */ p = req->td->td_proc; } else { - p = pfind(*pidp); - if (p == NULL) - return (ESRCH); - if ((error = p_cansee(curthread, p)) != 0) { - PROC_UNLOCK(p); + error = pget(*pidp, PGET_CANSEE, &p); + if (error != 0) return (error); - } } cred = crhold(p->p_ucred); @@ -1998,6 +2371,106 @@ sysctl_kern_proc_groups(SYSCTL_HANDLER_A return (error); } +/* + * This sysctl allows a process to retrieve or/and set the resource limit for + * another process. + */ +static int +sysctl_kern_proc_rlimit(SYSCTL_HANDLER_ARGS) +{ + int *name = (int *)arg1; + u_int namelen = arg2; + struct rlimit rlim; + struct proc *p; + u_int which; + int flags, error; + + if (namelen != 2) + return (EINVAL); + + which = (u_int)name[1]; + if (which >= RLIM_NLIMITS) + return (EINVAL); + + if (req->newptr != NULL && req->newlen != sizeof(rlim)) + return (EINVAL); + + flags = PGET_HOLD | PGET_NOTWEXIT; + if (req->newptr != NULL) + flags |= PGET_CANDEBUG; + else + flags |= PGET_CANSEE; + error = pget((pid_t)name[0], flags, &p); + if (error != 0) + return (error); + + /* + * Retrieve limit. + */ + if (req->oldptr != NULL) { + PROC_LOCK(p); + lim_rlimit(p, which, &rlim); + PROC_UNLOCK(p); + } + error = SYSCTL_OUT(req, &rlim, sizeof(rlim)); + if (error != 0) + goto errout; + + /* + * Set limit. + */ + if (req->newptr != NULL) { + error = SYSCTL_IN(req, &rlim, sizeof(rlim)); + if (error == 0) + error = kern_proc_setrlimit(curthread, p, which, &rlim); + } + +errout: + PRELE(p); + return (error); +} + +/* + * This sysctl allows a process to retrieve ps_strings structure location of + * another process. + */ +static int +sysctl_kern_proc_ps_strings(SYSCTL_HANDLER_ARGS) +{ + int *name = (int *)arg1; + u_int namelen = arg2; + struct proc *p; + vm_offset_t ps_strings; + int error; +#ifdef COMPAT_FREEBSD32 + uint32_t ps_strings32; +#endif + + if (namelen != 1) + return (EINVAL); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 21:13:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5DBC106566B; Sun, 29 Jan 2012 21:13:36 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F93C8FC0C; Sun, 29 Jan 2012 21:13:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TLDaeh052924; Sun, 29 Jan 2012 21:13:36 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TLDaZf052922; Sun, 29 Jan 2012 21:13:36 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201201292113.q0TLDaZf052922@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 29 Jan 2012 21:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230755 - stable/9/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 21:13:36 -0000 Author: trociny Date: Sun Jan 29 21:13:36 2012 New Revision: 230755 URL: http://svn.freebsd.org/changeset/base/230755 Log: MFC r228268: Protect process environment variables with p_candebug(). Discussed with: jilles, kib, rwatson Modified: stable/9/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/9/sys/compat/linprocfs/linprocfs.c Sun Jan 29 21:08:24 2012 (r230754) +++ stable/9/sys/compat/linprocfs/linprocfs.c Sun Jan 29 21:13:36 2012 (r230755) @@ -967,7 +967,7 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) int ret; PROC_LOCK(p); - if ((ret = p_cansee(td, p)) != 0) { + if ((ret = p_candebug(td, p)) != 0) { PROC_UNLOCK(p); return (ret); } From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 21:44:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74715106566B; Sun, 29 Jan 2012 21:44:26 +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 5F9D48FC12; Sun, 29 Jan 2012 21:44:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TLiQ0B054010; Sun, 29 Jan 2012 21:44:26 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TLiQvJ054008; Sun, 29 Jan 2012 21:44:26 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201201292144.q0TLiQvJ054008@svn.freebsd.org> From: Alan Cox Date: Sun, 29 Jan 2012 21:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230756 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 21:44:26 -0000 Author: alc Date: Sun Jan 29 21:44:25 2012 New Revision: 230756 URL: http://svn.freebsd.org/changeset/base/230756 Log: Welcome Davide Italiano (davide) as a src committer. Davide has been working on improvements to our hardware performance monitoring and virtual memory systems. Davide will be mentored by gnn@ and me. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sun Jan 29 21:13:36 2012 (r230755) +++ svnadmin/conf/access Sun Jan 29 21:44:25 2012 (r230756) @@ -58,6 +58,7 @@ darrenr das davidc davidch +davide davidxu dchagin dd From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 21:58:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C57A8106564A; Sun, 29 Jan 2012 21:58:18 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF91D8FC14; Sun, 29 Jan 2012 21:58:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TLwI9V054499; Sun, 29 Jan 2012 21:58:18 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TLwIVB054497; Sun, 29 Jan 2012 21:58:18 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201201292158.q0TLwIVB054497@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 29 Jan 2012 21:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230757 - stable/8/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 21:58:18 -0000 Author: trociny Date: Sun Jan 29 21:58:18 2012 New Revision: 230757 URL: http://svn.freebsd.org/changeset/base/230757 Log: MFC r228268: Protect process environment variables with p_candebug(). Discussed with: jilles, kib, rwatson Modified: stable/8/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/8/sys/compat/linprocfs/linprocfs.c Sun Jan 29 21:44:25 2012 (r230756) +++ stable/8/sys/compat/linprocfs/linprocfs.c Sun Jan 29 21:58:18 2012 (r230757) @@ -1102,7 +1102,7 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) int ret; PROC_LOCK(p); - if ((ret = p_cansee(td, p)) != 0) { + if ((ret = p_candebug(td, p)) != 0) { PROC_UNLOCK(p); return (ret); } From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 22:12:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91856106566C; Sun, 29 Jan 2012 22:12:49 +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 7CC9E8FC0A; Sun, 29 Jan 2012 22:12:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TMCnDc055014; Sun, 29 Jan 2012 22:12:49 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TMCn16055012; Sun, 29 Jan 2012 22:12:49 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201292212.q0TMCn16055012@svn.freebsd.org> From: Martin Matuska Date: Sun, 29 Jan 2012 22:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230758 - vendor/libarchive/dist/libarchive X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 22:12:49 -0000 Author: mm Date: Sun Jan 29 22:12:48 2012 New Revision: 230758 URL: http://svn.freebsd.org/changeset/base/230758 Log: Update to vendor revision 4183 Obtained from: http://libarchive.googlecode.com/svn/release/2.8 Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Sun Jan 29 21:58:18 2012 (r230757) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c Sun Jan 29 22:12:48 2012 (r230758) @@ -1775,6 +1775,19 @@ parse_file_info(struct archive_read *a, free(file); return (NULL); } + /* + * A file size of symbolic link files in ISO images + * made by makefs is not zero and its location is + * the same as those of next regular file. That is + * the same as hard like file and it causes unexpected + * error. + */ + if (file->size > 0 && + (file->mode & AE_IFMT) == AE_IFLNK) { + file->size = 0; + file->number = -1; + file->offset = -1; + } } else /* If there isn't SUSP, disable parsing * rock ridge extensions. */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 22:20:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09399106564A; Sun, 29 Jan 2012 22:20:29 +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 E86958FC12; Sun, 29 Jan 2012 22:20:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TMKSnQ055332; Sun, 29 Jan 2012 22:20:28 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TMKSXR055330; Sun, 29 Jan 2012 22:20:28 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201292220.q0TMKSXR055330@svn.freebsd.org> From: Martin Matuska Date: Sun, 29 Jan 2012 22:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230759 - head/contrib/libarchive/libarchive X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 22:20:29 -0000 Author: mm Date: Sun Jan 29 22:20:28 2012 New Revision: 230759 URL: http://svn.freebsd.org/changeset/base/230759 Log: Uupdate code to vendor rev. 4183 (release/2.8) Fixes vendor issue 224: "Mishandling CD9660 images with RockRidge extensions from FreeBSD makefs" References: http://code.google.com/p/libarchive/issues/detail?id=224 MFC after: 1 week Modified: head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Directory Properties: head/contrib/libarchive/ (props changed) head/contrib/libarchive/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Sun Jan 29 22:12:48 2012 (r230758) +++ head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Sun Jan 29 22:20:28 2012 (r230759) @@ -1778,6 +1778,19 @@ parse_file_info(struct archive_read *a, free(file); return (NULL); } + /* + * A file size of symbolic link files in ISO images + * made by makefs is not zero and its location is + * the same as those of next regular file. That is + * the same as hard like file and it causes unexpected + * error. + */ + if (file->size > 0 && + (file->mode & AE_IFMT) == AE_IFLNK) { + file->size = 0; + file->number = -1; + file->offset = -1; + } } else /* If there isn't SUSP, disable parsing * rock ridge extensions. */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 22:39:06 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B1F21065672; Sun, 29 Jan 2012 22:39:06 +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 EBF2A8FC13; Sun, 29 Jan 2012 22:39:05 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0TMd5d6038689; Sun, 29 Jan 2012 17:39:05 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0TMd4NT038688; Sun, 29 Jan 2012 17:39:04 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Sun, 29 Jan 2012 17:39:04 -0500 From: David Schultz To: Kostik Belousov Message-ID: <20120129223904.GA37483@zim.MIT.EDU> Mail-Followup-To: Kostik Belousov , Bruce Evans , Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201201261159.q0QBxma2086162@svn.freebsd.org> <20120126233110.C960@besplex.bde.org> <20120126153641.GA68112@FreeBSD.org> <20120127194612.H1547@besplex.bde.org> <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> <20120127194221.GA25723@zim.MIT.EDU> <20120128123748.GD2726@deviant.kiev.zoral.com.ua> <20120129001225.GA32220@zim.MIT.EDU> <20120129062327.GK2726@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120129062327.GK2726@deviant.kiev.zoral.com.ua> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Gleb Smirnoff , src-committers@FreeBSD.ORG, Bruce Evans Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 22:39:06 -0000 On Sun, Jan 29, 2012, Kostik Belousov wrote: > On Sat, Jan 28, 2012 at 07:12:25PM -0500, David Schultz wrote: > > On Sat, Jan 28, 2012, Kostik Belousov wrote: > > > On Fri, Jan 27, 2012 at 02:42:21PM -0500, David Schultz wrote: > > > > On Fri, Jan 27, 2012, Kostik Belousov wrote: > > > > > On Fri, Jan 27, 2012 at 07:50:30PM +1100, Bruce Evans wrote: > > > > > > On Thu, 26 Jan 2012, Gleb Smirnoff wrote: > > > > > > > > > > > > >On Thu, Jan 26, 2012 at 11:53:57PM +1100, Bruce Evans wrote: > > > > > > >B> > @@ -1552,6 +1552,12 @@ aio_aqueue(struct thread *td, struct aio > > > > > > >B> > return (error); > > > > > > >B> > } > > > > > > >B> > > > > > > > >B> > + /* XXX: aio_nbytes is later casted to signed types. */ > > > > > > >B> > + if ((int)aiocbe->uaiocb.aio_nbytes < 0) { > > > > > > >B> > > > > > > >B> This should avoid implementation-defined behaviour by checking if > > > > > > >B> > > > > > > >B> (uncast)aiocbe->uaiocb.aio_nbytes > INT_MAX. > > > > > > > > > > > > >Is the attached patch okay? > > > > > > > > > > > > Yes. It now matches the style used for read^Wsys_read() and friends. > > > > > > This used to have to fit the count in "int uio_resid". uio_resid now > > > > > > has type ssize_t, but for some reason the old INT_MAX limits remain. > > > > > > > > > > Well, I can revive the patch. I still think it is good to get rid of > > > > > the limit. > > > > > > > > The correct limit on the maximum size of a single read/write is > > > > SSIZE_MAX, but FreeBSD uses INT_MAX. It's not safe to raise the > > > > limit yet, though, because of bugs in several filesystems. For > > > > example, FFS copies uio_resid into a local variable of type int. > > > > I have some old patches that fix some of these issues for FFS and > > > > cd9660, but surely there are more places I didn't notice. > > > > > > > Absolutely agree. > > > > > > http://people.freebsd.org/~kib/misc/uio_resid.5.patch > > > > Nice. You found a lot more than I've got in my tree, and you even > > fixed the return values. There are at least a few more places to > > fix. For instance, cd9660 and the NFS client pass uio_resid or > > iov_len to min(), which operates on ints. (Incidentally, C11 > > generics ought to make it possible to write type-generic min() > > and max() functions.) > > Thank you, http://people.freebsd.org/~kib/misc/uio_resid.6.patch > changed them to MIN(). This looks good to me. I tried to think of other places that you might have missed, and the only one that occurred to me is the pipe code. sys_pipe.c has an `int orig_resid' and lots of bogus casts of iov_len and uio_resid to type u_int. Some look harmless, although it appears that writing a multiple of 2^32 bytes might result in pipe_build_write_buffer() allocating a 0-length buffer. My only reservation is that raising the limit could unmask a kernel buffer overflow if we missed something, but I guess we have to cross that bridge some day anyway. From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 22:43:32 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA2D9106566C; Sun, 29 Jan 2012 22:43:32 +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 889A78FC13; Sun, 29 Jan 2012 22:43:32 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0TMhVMH038755; Sun, 29 Jan 2012 17:43:31 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0TMhV8D038754; Sun, 29 Jan 2012 17:43:31 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Sun, 29 Jan 2012 17:43:31 -0500 From: David Schultz To: David Chisnall , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20120129224331.GA38740@zim.MIT.EDU> Mail-Followup-To: David Chisnall , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111201445.pAKEjgNR096676@svn.freebsd.org> <20120118190714.GA13375@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120118190714.GA13375@zim.MIT.EDU> Cc: Subject: Re: svn commit: r227753 - in head: contrib/gdtoa include lib/libc/gdtoa lib/libc/gen lib/libc/locale lib/libc/regex lib/libc/stdio lib/libc/stdlib lib/libc/stdtime lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 22:43:33 -0000 On Wed, Jan 18, 2012, David Schultz wrote: > On Sun, Nov 20, 2011, David Chisnall wrote: > > Author: theraven > > Date: Sun Nov 20 14:45:42 2011 > > New Revision: 227753 > > URL: http://svn.freebsd.org/changeset/base/227753 > > > > Log: > > Implement xlocale APIs from Darwin, mainly for use by libc++. This adds a > > load of _l suffixed versions of various standard library functions that use > > the global locale, making them take an explicit locale parameter. Also > > adds support for per-thread locales. This work was funded by the FreeBSD > > Foundation. > > > > Please test any code you have that uses the C standard locale functions! > > > > Reviewed by: das (gdtoa changes) > > Approved by: dim (mentor) > > This patch appears to cause a large performance regression. For > example, I measured a 78% slowdown for strtol(" 42", ...). > Furthermore, the resulting static binary for a trivial program > goes from 7k to 303k, due to pulling in malloc, stdio, and all the > pthread stubs. Presumably the capabilities of the non-xlocale > entry points aren't appreciably changed, so there ought to be a > way to avoid the overhead for them. Do you have any thoughts on this? > > Some more minor issues... > > It's also customary to document public APIs so that, for > instance, `man printf_l' pulls up a page with the prototype, > required #includes, and behavior. Aliasing manpages with > MLINKS as appropriate is fine; for instance, Darwin's manpages > on these functions look like a good example to follow. > > Finally, I'm not usually one to be picky about style, but could > you make a pass to clean things up a little bit to match the > surrounding code, wrap multiline comments to 80 columns, etc? > You've also added new copyright notices for one-line changes > (e.g., stdio/vdprintf.c, gdtoa/machdep_ldis?.c) and multiple > copyright notices in the same file (locale/collate.c), which > could be cleaned up concurrently. Any plans to look into this? From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 23:04:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DE4E1065670; Sun, 29 Jan 2012 23:04:30 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB3A58FC18; Sun, 29 Jan 2012 23:04:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0TN4THD056801; Sun, 29 Jan 2012 23:04:29 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0TN4TBG056799; Sun, 29 Jan 2012 23:04:29 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201201292304.q0TN4TBG056799@svn.freebsd.org> From: Kirk McKusick Date: Sun, 29 Jan 2012 23:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230760 - stable/9/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 23:04:30 -0000 Author: mckusick Date: Sun Jan 29 23:04:29 2012 New Revision: 230760 URL: http://svn.freebsd.org/changeset/base/230760 Log: MFC r230101: Convert FFS mount error messages from kernel printf's to using the vfs_mount_error error message facility provided by the nmount interface. Clean up formatting of mount warnings which still need to use kernel printf's since they do not return errors. Requested by: Craig Rodrigues Modified: stable/9/sys/ufs/ffs/ffs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vfsops.c Sun Jan 29 22:20:28 2012 (r230759) +++ stable/9/sys/ufs/ffs/ffs_vfsops.c Sun Jan 29 23:04:29 2012 (r230760) @@ -196,11 +196,13 @@ ffs_mount(struct mount *mp) if (mp->mnt_flag & MNT_UPDATE) { if (VFSTOUFS(mp)->um_fs->fs_ronly == 0 && vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) == 0) { - printf("Checker enable: Must be read-only\n"); + vfs_mount_error(mp, + "Checker enable: Must be read-only"); return (EINVAL); } } else if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) == 0) { - printf("Checker enable: Must be read-only\n"); + vfs_mount_error(mp, + "Checker enable: Must be read-only"); return (EINVAL); } /* Set to -1 if we are done */ @@ -210,8 +212,9 @@ ffs_mount(struct mount *mp) if (vfs_getopt(mp->mnt_optnew, "nfsv4acls", NULL, NULL) == 0) { if (mntorflags & MNT_ACLS) { - printf("WARNING: \"acls\" and \"nfsv4acls\" " - "options are mutually exclusive\n"); + vfs_mount_error(mp, + "\"acls\" and \"nfsv4acls\" options " + "are mutually exclusive"); return (EINVAL); } mntorflags |= MNT_NFS4ACLS; @@ -292,8 +295,8 @@ ffs_mount(struct mount *mp) } if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { - printf("%s: %s: blocks %jd files %d\n", - fs->fs_fsmnt, "update error", + printf("WARNING: %s Update error: blocks %jd " + "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; @@ -336,7 +339,8 @@ ffs_mount(struct mount *mp) * If we are running a checker, do not allow upgrade. */ if (ump->um_fsckpid > 0) { - printf("Active checker, cannot rw upgrade\n"); + vfs_mount_error(mp, + "Active checker, cannot upgrade to write"); return (EINVAL); } /* @@ -360,15 +364,16 @@ ffs_mount(struct mount *mp) ((fs->fs_flags & (FS_SUJ | FS_NEEDSFSCK)) == 0 && (fs->fs_flags & FS_DOSOFTDEP))) { - printf("WARNING: %s was not %s\n", - fs->fs_fsmnt, "properly dismounted"); + printf("WARNING: %s was not properly " + "dismounted\n", fs->fs_fsmnt); } else { - printf( -"WARNING: R/W mount of %s denied. Filesystem is not clean - run fsck\n", - fs->fs_fsmnt); - if (fs->fs_flags & FS_SUJ) - printf( -"WARNING: Forced mount will invalidate journal contents\n"); + vfs_mount_error(mp, + "R/W mount of %s denied. %s.%s", + fs->fs_fsmnt, + "Filesystem is not clean - run fsck", + (fs->fs_flags & FS_SUJ) == 0 ? "" : + " Forced mount will invalidate" + " journal contents"); return (EPERM); } } @@ -439,7 +444,8 @@ ffs_mount(struct mount *mp) */ if (fsckpid > 0) { if (ump->um_fsckpid != 0) { - printf("Active checker already running on %s\n", + vfs_mount_error(mp, + "Active checker already running on %s", fs->fs_fsmnt); return (EINVAL); } @@ -454,7 +460,8 @@ ffs_mount(struct mount *mp) g_topology_unlock(); PICKUP_GIANT(); if (error) { - printf("Checker activation failed on %s\n", + vfs_mount_error(mp, + "Checker activation failed on %s", fs->fs_fsmnt); return (error); } @@ -543,8 +550,8 @@ ffs_mount(struct mount *mp) g_topology_unlock(); PICKUP_GIANT(); if (error) { - printf("Checker activation failed on %s\n", - fs->fs_fsmnt); + printf("WARNING: %s: Checker activation " + "failed\n", fs->fs_fsmnt); } else { ump->um_fsckpid = fsckpid; if (fs->fs_snapinum[0] != 0) @@ -655,8 +662,8 @@ ffs_reload(struct mount *mp, struct thre ffs_oldfscompat_read(fs, VFSTOUFS(mp), sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { - printf("%s: reload pending error: blocks %jd files %d\n", - fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, + printf("WARNING: %s: reload pending error: blocks %jd " + "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; @@ -822,27 +829,25 @@ ffs_mountfs(devvp, mp, td) printf("WARNING: %s was not properly dismounted\n", fs->fs_fsmnt); } else { - printf( -"WARNING: R/W mount of %s denied. Filesystem is not clean - run fsck\n", - fs->fs_fsmnt); - if (fs->fs_flags & FS_SUJ) - printf( -"WARNING: Forced mount will invalidate journal contents\n"); + vfs_mount_error(mp, "R/W mount of %s denied. %s%s", + fs->fs_fsmnt, "Filesystem is not clean - run fsck.", + (fs->fs_flags & FS_SUJ) == 0 ? "" : + " Forced mount will invalidate journal contents"); error = EPERM; goto out; } if ((fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) && (mp->mnt_flag & MNT_FORCE)) { - printf("%s: lost blocks %jd files %d\n", fs->fs_fsmnt, - (intmax_t)fs->fs_pendingblocks, + printf("WARNING: %s: lost blocks %jd files %d\n", + fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; } } if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { - printf("%s: mount pending error: blocks %jd files %d\n", - fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, + printf("WARNING: %s: mount pending error: blocks %jd " + "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; @@ -862,16 +867,15 @@ ffs_mountfs(devvp, mp, td) mp->mnt_flag |= MNT_GJOURNAL; MNT_IUNLOCK(mp); } else { - printf( -"WARNING: %s: GJOURNAL flag on fs but no gjournal provider below\n", + printf("WARNING: %s: GJOURNAL flag on fs " + "but no gjournal provider below\n", mp->mnt_stat.f_mntonname); free(mp->mnt_gjprovider, M_UFSMNT); mp->mnt_gjprovider = NULL; } #else - printf( -"WARNING: %s: GJOURNAL flag on fs but no UFS_GJOURNAL support\n", - mp->mnt_stat.f_mntonname); + printf("WARNING: %s: GJOURNAL flag on fs but no " + "UFS_GJOURNAL support\n", mp->mnt_stat.f_mntonname); #endif } else { mp->mnt_gjprovider = NULL; @@ -955,9 +959,8 @@ ffs_mountfs(devvp, mp, td) mp->mnt_flag |= MNT_MULTILABEL; MNT_IUNLOCK(mp); #else - printf( -"WARNING: %s: multilabel flag on fs but no MAC support\n", - mp->mnt_stat.f_mntonname); + printf("WARNING: %s: multilabel flag on fs but " + "no MAC support\n", mp->mnt_stat.f_mntonname); #endif } if ((fs->fs_flags & FS_ACLS) != 0) { @@ -965,8 +968,9 @@ ffs_mountfs(devvp, mp, td) MNT_ILOCK(mp); if (mp->mnt_flag & MNT_NFS4ACLS) - printf("WARNING: ACLs flag on fs conflicts with " - "\"nfsv4acls\" mount option; option ignored\n"); + printf("WARNING: %s: ACLs flag on fs conflicts with " + "\"nfsv4acls\" mount option; option ignored\n", + mp->mnt_stat.f_mntonname); mp->mnt_flag &= ~MNT_NFS4ACLS; mp->mnt_flag |= MNT_ACLS; @@ -981,16 +985,16 @@ ffs_mountfs(devvp, mp, td) MNT_ILOCK(mp); if (mp->mnt_flag & MNT_ACLS) - printf("WARNING: NFSv4 ACLs flag on fs conflicts with " - "\"acls\" mount option; option ignored\n"); + printf("WARNING: %s: NFSv4 ACLs flag on fs conflicts " + "with \"acls\" mount option; option ignored\n", + mp->mnt_stat.f_mntonname); mp->mnt_flag &= ~MNT_ACLS; mp->mnt_flag |= MNT_NFS4ACLS; MNT_IUNLOCK(mp); #else - printf( -"WARNING: %s: NFSv4 ACLs flag on fs but no ACLs support\n", - mp->mnt_stat.f_mntonname); + printf("WARNING: %s: NFSv4 ACLs flag on fs but no " + "ACLs support\n", mp->mnt_stat.f_mntonname); #endif } if ((fs->fs_flags & FS_TRIM) != 0) { @@ -998,12 +1002,12 @@ ffs_mountfs(devvp, mp, td) if (g_io_getattr("GEOM::candelete", cp, &size, &ump->um_candelete) == 0) { if (!ump->um_candelete) - printf( -"WARNING: %s: TRIM flag on fs but disk does not support TRIM\n", + printf("WARNING: %s: TRIM flag on fs but disk " + "does not support TRIM\n", mp->mnt_stat.f_mntonname); } else { - printf( -"WARNING: %s: TRIM flag on fs but cannot get whether disk supports TRIM\n", + printf("WARNING: %s: TRIM flag on fs but disk does " + "not confirm that it supports TRIM\n", mp->mnt_stat.f_mntonname); ump->um_candelete = 0; } @@ -1210,15 +1214,16 @@ ffs_unmount(mp, mntflags) flags = 0; td = curthread; fs = ump->um_fs; + susp = 0; if (mntflags & MNT_FORCE) { flags |= FORCECLOSE; susp = fs->fs_ronly != 0; - } else - susp = 0; + } #ifdef UFS_EXTATTR if ((error = ufs_extattr_stop(mp, td))) { if (error != EOPNOTSUPP) - printf("ffs_unmount: ufs_extattr_stop returned %d\n", + printf("WARNING: unmount %s: ufs_extattr_stop " + "returned errno %d\n", mp->mnt_stat.f_mntonname, error); e_restart = 0; } else { @@ -1256,8 +1261,8 @@ ffs_unmount(mp, mntflags) UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { - printf("%s: unmount pending error: blocks %jd files %d\n", - fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, + printf("WARNING: unmount %s: pending error: blocks %jd " + "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; @@ -1433,10 +1438,9 @@ ffs_sync(mp, waitfor) td = curthread; fs = ump->um_fs; - if (fs->fs_fmod != 0 && fs->fs_ronly != 0 && ump->um_fsckpid == 0) { - printf("fs = %s\n", fs->fs_fsmnt); - panic("ffs_sync: rofs mod"); - } + if (fs->fs_fmod != 0 && fs->fs_ronly != 0 && ump->um_fsckpid == 0) + panic("%s: ffs_sync: modification on read-only filesystem", + fs->fs_fsmnt); /* * Write back each (modified) inode. */ @@ -1844,13 +1848,13 @@ ffs_sbupdate(ump, waitfor, suspended) bp = sbbp; if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_sblockloc != SBLOCK_UFS1 && (fs->fs_flags & FS_FLAGS_UPDATED) == 0) { - printf("%s: correcting fs_sblockloc from %jd to %d\n", + printf("WARNING: %s: correcting fs_sblockloc from %jd to %d\n", fs->fs_fsmnt, fs->fs_sblockloc, SBLOCK_UFS1); fs->fs_sblockloc = SBLOCK_UFS1; } if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_sblockloc != SBLOCK_UFS2 && (fs->fs_flags & FS_FLAGS_UPDATED) == 0) { - printf("%s: correcting fs_sblockloc from %jd to %d\n", + printf("WARNING: %s: correcting fs_sblockloc from %jd to %d\n", fs->fs_fsmnt, fs->fs_sblockloc, SBLOCK_UFS2); fs->fs_sblockloc = SBLOCK_UFS2; } From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 05:45:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B5BF106566B; Mon, 30 Jan 2012 05:45:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53D878FC15; Mon, 30 Jan 2012 05:45:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0U5jC7g069666; Mon, 30 Jan 2012 05:45:12 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0U5jCbV069664; Mon, 30 Jan 2012 05:45:12 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201201300545.q0U5jCbV069664@svn.freebsd.org> From: Kirk McKusick Date: Mon, 30 Jan 2012 05:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230762 - stable/8/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 05:45:12 -0000 Author: mckusick Date: Mon Jan 30 05:45:11 2012 New Revision: 230762 URL: http://svn.freebsd.org/changeset/base/230762 Log: MFC r230101: Convert FFS mount error messages from kernel printf's to using the vfs_mount_error error message facility provided by the nmount interface. Clean up formatting of mount warnings which still need to use kernel printf's since they do not return errors. Requested by: Craig Rodrigues Modified: stable/8/sys/ufs/ffs/ffs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_vfsops.c Mon Jan 30 00:27:02 2012 (r230761) +++ stable/8/sys/ufs/ffs/ffs_vfsops.c Mon Jan 30 05:45:11 2012 (r230762) @@ -188,8 +188,9 @@ ffs_mount(struct mount *mp) if (vfs_getopt(mp->mnt_optnew, "nfsv4acls", NULL, NULL) == 0) { if (mntorflags & MNT_ACLS) { - printf("WARNING: \"acls\" and \"nfsv4acls\" " - "options are mutually exclusive\n"); + vfs_mount_error(mp, + "\"acls\" and \"nfsv4acls\" options " + "are mutually exclusive"); return (EINVAL); } mntorflags |= MNT_NFS4ACLS; @@ -256,8 +257,8 @@ ffs_mount(struct mount *mp) } if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { - printf("%s: %s: blocks %jd files %d\n", - fs->fs_fsmnt, "update error", + printf("WARNING: %s Update error: blocks %jd " + "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; @@ -311,12 +312,13 @@ ffs_mount(struct mount *mp) if ((mp->mnt_flag & MNT_FORCE) || ((fs->fs_flags & FS_NEEDSFSCK) == 0 && (fs->fs_flags & FS_DOSOFTDEP))) { - printf("WARNING: %s was not %s\n", - fs->fs_fsmnt, "properly dismounted"); + printf("WARNING: %s was not properly " + "dismounted\n", fs->fs_fsmnt); } else { - printf( -"WARNING: R/W mount of %s denied. Filesystem is not clean - run fsck\n", - fs->fs_fsmnt); + vfs_mount_error(mp, + "R/W mount of %s denied. %s.", + fs->fs_fsmnt, + "Filesystem is not clean - run fsck"); return (EPERM); } } @@ -548,8 +550,8 @@ ffs_reload(struct mount *mp, struct thre ffs_oldfscompat_read(fs, VFSTOUFS(mp), sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { - printf("%s: reload pending error: blocks %jd files %d\n", - fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, + printf("WARNING: %s: reload pending error: blocks %jd " + "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; @@ -723,24 +725,23 @@ ffs_mountfs(devvp, mp, td) "WARNING: %s was not properly dismounted\n", fs->fs_fsmnt); } else { - printf( -"WARNING: R/W mount of %s denied. Filesystem is not clean - run fsck\n", - fs->fs_fsmnt); + vfs_mount_error(mp, "R/W mount of %s denied. %s.", + fs->fs_fsmnt, "Filesystem is not clean - run fsck"); error = EPERM; goto out; } if ((fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) && (mp->mnt_flag & MNT_FORCE)) { - printf("%s: lost blocks %jd files %d\n", fs->fs_fsmnt, - (intmax_t)fs->fs_pendingblocks, + printf("WARNING: %s: lost blocks %jd files %d\n", + fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; } } if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { - printf("%s: mount pending error: blocks %jd files %d\n", - fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, + printf("WARNING: %s: mount pending error: blocks %jd " + "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; @@ -760,16 +761,15 @@ ffs_mountfs(devvp, mp, td) mp->mnt_flag |= MNT_GJOURNAL; MNT_IUNLOCK(mp); } else { - printf( -"WARNING: %s: GJOURNAL flag on fs but no gjournal provider below\n", + printf("WARNING: %s: GJOURNAL flag on fs " + "but no gjournal provider below\n", mp->mnt_stat.f_mntonname); free(mp->mnt_gjprovider, M_UFSMNT); mp->mnt_gjprovider = NULL; } #else - printf( -"WARNING: %s: GJOURNAL flag on fs but no UFS_GJOURNAL support\n", - mp->mnt_stat.f_mntonname); + printf("WARNING: %s: GJOURNAL flag on fs but no " + "UFS_GJOURNAL support\n", mp->mnt_stat.f_mntonname); #endif } else { mp->mnt_gjprovider = NULL; @@ -853,9 +853,8 @@ ffs_mountfs(devvp, mp, td) mp->mnt_flag |= MNT_MULTILABEL; MNT_IUNLOCK(mp); #else - printf( -"WARNING: %s: multilabel flag on fs but no MAC support\n", - mp->mnt_stat.f_mntonname); + printf("WARNING: %s: multilabel flag on fs but " + "no MAC support\n", mp->mnt_stat.f_mntonname); #endif } if ((fs->fs_flags & FS_ACLS) != 0) { @@ -863,8 +862,9 @@ ffs_mountfs(devvp, mp, td) MNT_ILOCK(mp); if (mp->mnt_flag & MNT_NFS4ACLS) - printf("WARNING: ACLs flag on fs conflicts with " - "\"nfsv4acls\" mount option; option ignored\n"); + printf("WARNING: %s: ACLs flag on fs conflicts with " + "\"nfsv4acls\" mount option; option ignored\n", + mp->mnt_stat.f_mntonname); mp->mnt_flag &= ~MNT_NFS4ACLS; mp->mnt_flag |= MNT_ACLS; @@ -880,16 +880,16 @@ ffs_mountfs(devvp, mp, td) MNT_ILOCK(mp); if (mp->mnt_flag & MNT_ACLS) - printf("WARNING: NFSv4 ACLs flag on fs conflicts with " - "\"acls\" mount option; option ignored\n"); + printf("WARNING: %s: NFSv4 ACLs flag on fs conflicts " + "with \"acls\" mount option; option ignored\n", + mp->mnt_stat.f_mntonname); mp->mnt_flag &= ~MNT_ACLS; mp->mnt_flag |= MNT_NFS4ACLS; MNT_IUNLOCK(mp); #else - printf( -"WARNING: %s: NFSv4 ACLs flag on fs but no ACLs support\n", - mp->mnt_stat.f_mntonname); + printf("WARNING: %s: NFSv4 ACLs flag on fs but no " + "ACLs support\n", mp->mnt_stat.f_mntonname); #endif } if ((fs->fs_flags & FS_TRIM) != 0) { @@ -897,12 +897,12 @@ ffs_mountfs(devvp, mp, td) if (g_io_getattr("GEOM::candelete", cp, &size, &ump->um_candelete) == 0) { if (!ump->um_candelete) - printf( -"WARNING: %s: TRIM flag on fs but disk does not support TRIM\n", + printf("WARNING: %s: TRIM flag on fs but disk " + "does not support TRIM\n", mp->mnt_stat.f_mntonname); } else { - printf( -"WARNING: %s: TRIM flag on fs but cannot get whether disk supports TRIM\n", + printf("WARNING: %s: TRIM flag on fs but disk does " + "not confirm that it supports TRIM\n", mp->mnt_stat.f_mntonname); ump->um_candelete = 0; } @@ -1107,15 +1107,16 @@ ffs_unmount(mp, mntflags) flags = 0; td = curthread; fs = ump->um_fs; + susp = 0; if (mntflags & MNT_FORCE) { flags |= FORCECLOSE; susp = fs->fs_ronly != 0; - } else - susp = 0; + } #ifdef UFS_EXTATTR if ((error = ufs_extattr_stop(mp, td))) { if (error != EOPNOTSUPP) - printf("ffs_unmount: ufs_extattr_stop returned %d\n", + printf("WARNING: unmount %s: ufs_extattr_stop " + "returned errno %d\n", mp->mnt_stat.f_mntonname, error); e_restart = 0; } else { @@ -1153,8 +1154,8 @@ ffs_unmount(mp, mntflags) UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { - printf("%s: unmount pending error: blocks %jd files %d\n", - fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, + printf("WARNING: unmount %s: pending error: blocks %jd " + "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; @@ -1322,10 +1323,9 @@ ffs_sync(mp, waitfor) td = curthread; fs = ump->um_fs; - if (fs->fs_fmod != 0 && fs->fs_ronly != 0) { /* XXX */ - printf("fs = %s\n", fs->fs_fsmnt); - panic("ffs_sync: rofs mod"); - } + if (fs->fs_fmod != 0 && fs->fs_ronly != 0) + panic("%s: ffs_sync: modification on read-only filesystem", + fs->fs_fsmnt); /* * Write back each (modified) inode. */ @@ -1742,13 +1742,13 @@ ffs_sbupdate(mp, waitfor, suspended) bp = sbbp; if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_sblockloc != SBLOCK_UFS1 && (fs->fs_flags & FS_FLAGS_UPDATED) == 0) { - printf("%s: correcting fs_sblockloc from %jd to %d\n", + printf("WARNING: %s: correcting fs_sblockloc from %jd to %d\n", fs->fs_fsmnt, fs->fs_sblockloc, SBLOCK_UFS1); fs->fs_sblockloc = SBLOCK_UFS1; } if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_sblockloc != SBLOCK_UFS2 && (fs->fs_flags & FS_FLAGS_UPDATED) == 0) { - printf("%s: correcting fs_sblockloc from %jd to %d\n", + printf("WARNING: %s: correcting fs_sblockloc from %jd to %d\n", fs->fs_fsmnt, fs->fs_sblockloc, SBLOCK_UFS2); fs->fs_sblockloc = SBLOCK_UFS2; } From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 06:30:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C43B7106566B; Mon, 30 Jan 2012 06:30:40 +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 542058FC0A; Mon, 30 Jan 2012 06:30:39 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q0U6UYha032389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Jan 2012 08:30:34 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q0U6UYxg092198; Mon, 30 Jan 2012 08:30:34 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q0U6UYdd092197; Mon, 30 Jan 2012 08:30:34 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 30 Jan 2012 08:30:34 +0200 From: Kostik Belousov To: Bruce Evans , Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: <20120130063034.GU2726@deviant.kiev.zoral.com.ua> References: <201201261159.q0QBxma2086162@svn.freebsd.org> <20120126233110.C960@besplex.bde.org> <20120126153641.GA68112@FreeBSD.org> <20120127194612.H1547@besplex.bde.org> <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> <20120127194221.GA25723@zim.MIT.EDU> <20120128123748.GD2726@deviant.kiev.zoral.com.ua> <20120129001225.GA32220@zim.MIT.EDU> <20120129062327.GK2726@deviant.kiev.zoral.com.ua> <20120129223904.GA37483@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kf/S9EuyQTNnOWN+" Content-Disposition: inline In-Reply-To: <20120129223904.GA37483@zim.MIT.EDU> 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=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 06:30:40 -0000 --kf/S9EuyQTNnOWN+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 29, 2012 at 05:39:04PM -0500, David Schultz wrote: > On Sun, Jan 29, 2012, Kostik Belousov wrote: > > On Sat, Jan 28, 2012 at 07:12:25PM -0500, David Schultz wrote: > > > On Sat, Jan 28, 2012, Kostik Belousov wrote: > > > > On Fri, Jan 27, 2012 at 02:42:21PM -0500, David Schultz wrote: > > > > > On Fri, Jan 27, 2012, Kostik Belousov wrote: > > > > > > On Fri, Jan 27, 2012 at 07:50:30PM +1100, Bruce Evans wrote: > > > > > > > On Thu, 26 Jan 2012, Gleb Smirnoff wrote: > > > > > > >=20 > > > > > > > >On Thu, Jan 26, 2012 at 11:53:57PM +1100, Bruce Evans wrote: > > > > > > > >B> > @@ -1552,6 +1552,12 @@ aio_aqueue(struct thread *td, st= ruct aio > > > > > > > >B> > return (error); > > > > > > > >B> > } > > > > > > > >B> > > > > > > > > >B> > + /* XXX: aio_nbytes is later casted to signed types. */ > > > > > > > >B> > + if ((int)aiocbe->uaiocb.aio_nbytes < 0) { > > > > > > > >B> > > > > > > > >B> This should avoid implementation-defined behaviour by che= cking if > > > > > > > >B> > > > > > > > >B> (uncast)aiocbe->uaiocb.aio_nbytes > INT_MAX. > > > > > > >=20 > > > > > > > >Is the attached patch okay? > > > > > > >=20 > > > > > > > Yes. It now matches the style used for read^Wsys_read() and = friends. > > > > > > > This used to have to fit the count in "int uio_resid". uio_r= esid now > > > > > > > has type ssize_t, but for some reason the old INT_MAX limits = remain. > > > > > >=20 > > > > > > Well, I can revive the patch. I still think it is good to get r= id of > > > > > > the limit. > > > > >=20 > > > > > The correct limit on the maximum size of a single read/write is > > > > > SSIZE_MAX, but FreeBSD uses INT_MAX. It's not safe to raise the > > > > > limit yet, though, because of bugs in several filesystems. For > > > > > example, FFS copies uio_resid into a local variable of type int. > > > > > I have some old patches that fix some of these issues for FFS and > > > > > cd9660, but surely there are more places I didn't notice. > > > > >=20 > > > > Absolutely agree. > > > >=20 > > > > http://people.freebsd.org/~kib/misc/uio_resid.5.patch > > >=20 > > > Nice. You found a lot more than I've got in my tree, and you even > > > fixed the return values. There are at least a few more places to > > > fix. For instance, cd9660 and the NFS client pass uio_resid or > > > iov_len to min(), which operates on ints. (Incidentally, C11 > > > generics ought to make it possible to write type-generic min() > > > and max() functions.) > >=20 > > Thank you, http://people.freebsd.org/~kib/misc/uio_resid.6.patch > > changed them to MIN(). >=20 > This looks good to me. I tried to think of other places that you > might have missed, and the only one that occurred to me is the Might ? I think this is a blatant understate. > pipe code. sys_pipe.c has an `int orig_resid' and lots of bogus > casts of iov_len and uio_resid to type u_int. Some look harmless, > although it appears that writing a multiple of 2^32 bytes might > result in pipe_build_write_buffer() allocating a 0-length buffer. >=20 > My only reservation is that raising the limit could unmask a > kernel buffer overflow if we missed something, but I guess we have > to cross that bridge some day anyway. Yes, and it is an obvious reason why I am chicken to commit this for so long time. One more place, if this is reasonable to count as 'one' place, are the cdevsw methods. devfs passes uio down to the drivers. http://people.freebsd.org/~kib/misc/uio_resid.7.patch contains the sys_pipe.c changes. --kf/S9EuyQTNnOWN+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8mOQkACgkQC3+MBN1Mb4gyFACgwmM0edJpdiHSX0AkjYDFe/s4 MPkAn2qkORTyGrHonghDapF4hYmHfcKx =YclY -----END PGP SIGNATURE----- --kf/S9EuyQTNnOWN+-- From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 07:20:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D47D7106566C; Mon, 30 Jan 2012 07:20:52 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7FF58FC12; Mon, 30 Jan 2012 07:20:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0U7Kqm5072689; Mon, 30 Jan 2012 07:20:52 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0U7Kqeu072686; Mon, 30 Jan 2012 07:20:52 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201201300720.q0U7Kqeu072686@svn.freebsd.org> From: Don Lewis Date: Mon, 30 Jan 2012 07:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230763 - stable/9/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 07:20:52 -0000 Author: truckman Date: Mon Jan 30 07:20:52 2012 New Revision: 230763 URL: http://svn.freebsd.org/changeset/base/230763 Log: MFC r230064: Allow an MBR primary or extended Linux swap partition to be specified as the system dump device. This was already allowed for GPT. The Linux swap metadata at the beginning of the partition should not be disturbed because the crash dump is written at the end. Reviewed by: alfred, pjd, marcel Modified: stable/9/sys/geom/part/g_part_ebr.c stable/9/sys/geom/part/g_part_mbr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part_ebr.c ============================================================================== --- stable/9/sys/geom/part/g_part_ebr.c Mon Jan 30 05:45:11 2012 (r230762) +++ stable/9/sys/geom/part/g_part_ebr.c Mon Jan 30 07:20:52 2012 (r230763) @@ -333,9 +333,10 @@ g_part_ebr_dumpto(struct g_part_table *t { struct g_part_ebr_entry *entry; - /* Allow dumping to a FreeBSD partition only. */ + /* Allow dumping to a FreeBSD partition or Linux swap partition only. */ entry = (struct g_part_ebr_entry *)baseentry; - return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0); + return ((entry->ent.dp_typ == DOSPTYP_386BSD || + entry->ent.dp_typ == DOSPTYP_LINSWP) ? 1 : 0); } #if defined(GEOM_PART_EBR_COMPAT) Modified: stable/9/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/9/sys/geom/part/g_part_mbr.c Mon Jan 30 05:45:11 2012 (r230762) +++ stable/9/sys/geom/part/g_part_mbr.c Mon Jan 30 07:20:52 2012 (r230763) @@ -304,9 +304,10 @@ g_part_mbr_dumpto(struct g_part_table *t { struct g_part_mbr_entry *entry; - /* Allow dumping to a FreeBSD partition only. */ + /* Allow dumping to a FreeBSD partition or Linux swap partition only. */ entry = (struct g_part_mbr_entry *)baseentry; - return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0); + return ((entry->ent.dp_typ == DOSPTYP_386BSD || + entry->ent.dp_typ == DOSPTYP_LINSWP) ? 1 : 0); } static int From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 07:23:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A877106566B; Mon, 30 Jan 2012 07:23:53 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F2B48FC16; Mon, 30 Jan 2012 07:23:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0U7Nrm8072824; Mon, 30 Jan 2012 07:23:53 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0U7Nr4f072821; Mon, 30 Jan 2012 07:23:53 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201201300723.q0U7Nr4f072821@svn.freebsd.org> From: Don Lewis Date: Mon, 30 Jan 2012 07:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230764 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 07:23:53 -0000 Author: truckman Date: Mon Jan 30 07:23:53 2012 New Revision: 230764 URL: http://svn.freebsd.org/changeset/base/230764 Log: MFC r230064: Allow an MBR primary or extended Linux swap partition to be specified as the system dump device. This was already allowed for GPT. The Linux swap metadata at the beginning of the partition should not be disturbed because the crash dump is written at the end. Reviewed by: alfred, pjd, marcel Modified: stable/8/sys/geom/part/g_part_ebr.c stable/8/sys/geom/part/g_part_mbr.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/part/g_part_ebr.c ============================================================================== --- stable/8/sys/geom/part/g_part_ebr.c Mon Jan 30 07:20:52 2012 (r230763) +++ stable/8/sys/geom/part/g_part_ebr.c Mon Jan 30 07:23:53 2012 (r230764) @@ -326,9 +326,10 @@ g_part_ebr_dumpto(struct g_part_table *t { struct g_part_ebr_entry *entry; - /* Allow dumping to a FreeBSD partition only. */ + /* Allow dumping to a FreeBSD partition or Linux swap partition only. */ entry = (struct g_part_ebr_entry *)baseentry; - return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0); + return ((entry->ent.dp_typ == DOSPTYP_386BSD || + entry->ent.dp_typ == DOSPTYP_LINSWP) ? 1 : 0); } #if defined(GEOM_PART_EBR_COMPAT) Modified: stable/8/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/8/sys/geom/part/g_part_mbr.c Mon Jan 30 07:20:52 2012 (r230763) +++ stable/8/sys/geom/part/g_part_mbr.c Mon Jan 30 07:23:53 2012 (r230764) @@ -301,9 +301,10 @@ g_part_mbr_dumpto(struct g_part_table *t { struct g_part_mbr_entry *entry; - /* Allow dumping to a FreeBSD partition only. */ + /* Allow dumping to a FreeBSD partition or Linux swap partition only. */ entry = (struct g_part_mbr_entry *)baseentry; - return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0); + return ((entry->ent.dp_typ == DOSPTYP_386BSD || + entry->ent.dp_typ == DOSPTYP_LINSWP) ? 1 : 0); } static int From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 07:51:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84C0A106564A; Mon, 30 Jan 2012 07:51:52 +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 7334C8FC15; Mon, 30 Jan 2012 07:51:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0U7pqwQ073693; Mon, 30 Jan 2012 07:51:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0U7pq99073690; Mon, 30 Jan 2012 07:51:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201300751.q0U7pq99073690@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 30 Jan 2012 07:51: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: r230765 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 07:51:52 -0000 Author: kib Date: Mon Jan 30 07:51:52 2012 New Revision: 230765 URL: http://svn.freebsd.org/changeset/base/230765 Log: Synchronize the struct sigcontext definitions on x86 with mcontext_t. Pointed out by: bde MFC after: 1 month Modified: head/sys/amd64/include/signal.h head/sys/i386/include/signal.h Modified: head/sys/amd64/include/signal.h ============================================================================== --- head/sys/amd64/include/signal.h Mon Jan 30 07:23:53 2012 (r230764) +++ head/sys/amd64/include/signal.h Mon Jan 30 07:51:52 2012 (r230765) @@ -99,7 +99,10 @@ struct sigcontext { long sc_fsbase; long sc_gsbase; - long sc_spare[6]; + long sc_xfpustate; + long sc_xfpustate_len; + + long sc_spare[4]; }; #endif /* __BSD_VISIBLE */ Modified: head/sys/i386/include/signal.h ============================================================================== --- head/sys/i386/include/signal.h Mon Jan 30 07:23:53 2012 (r230764) +++ head/sys/i386/include/signal.h Mon Jan 30 07:51:52 2012 (r230765) @@ -115,13 +115,16 @@ struct sigcontext { */ int sc_fpformat; int sc_ownedfp; - int sc_spare1[1]; + int sc_flags; int sc_fpstate[128] __aligned(16); int sc_fsbase; int sc_gsbase; - int sc_spare2[6]; + int sc_xfpustate; + int sc_xfpustate_len; + + int sc_spare2[4]; }; #define sc_sp sc_esp From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 07:53:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1428E1065672; Mon, 30 Jan 2012 07:53:34 +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 EB9EE8FC12; Mon, 30 Jan 2012 07:53:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0U7rXDD073783; Mon, 30 Jan 2012 07:53:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0U7rXoL073780; Mon, 30 Jan 2012 07:53:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201300753.q0U7rXoL073780@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 30 Jan 2012 07:53: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: r230766 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 07:53:34 -0000 Author: kib Date: Mon Jan 30 07:53:33 2012 New Revision: 230766 URL: http://svn.freebsd.org/changeset/base/230766 Log: Move xrstor/xsave/xsetbv into fpu.c and reorder them. Requested by: bde MFC after: 1 month Modified: head/sys/amd64/amd64/fpu.c head/sys/amd64/include/cpufunc.h Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Mon Jan 30 07:51:52 2012 (r230765) +++ head/sys/amd64/amd64/fpu.c Mon Jan 30 07:53:33 2012 (r230766) @@ -78,6 +78,41 @@ __FBSDID("$FreeBSD$"); : : "n" (CR0_TS) : "ax") #define stop_emulating() __asm __volatile("clts") +static __inline void +xrstor(char *addr, uint64_t mask) +{ + uint32_t low, hi; + + low = mask; + hi = mask >> 32; + /* xrstor (%rdi) */ + __asm __volatile(".byte 0x0f,0xae,0x2f" : : + "a" (low), "d" (hi), "D" (addr)); +} + +static __inline void +xsave(char *addr, uint64_t mask) +{ + uint32_t low, hi; + + low = mask; + hi = mask >> 32; + /* xsave (%rdi) */ + __asm __volatile(".byte 0x0f,0xae,0x27" : : + "a" (low), "d" (hi), "D" (addr) : "memory"); +} + +static __inline void +xsetbv(uint32_t reg, uint64_t val) +{ + uint32_t low, hi; + + low = val; + hi = val >> 32; + __asm __volatile(".byte 0x0f,0x01,0xd1" : : + "c" (reg), "a" (low), "d" (hi)); +} + #else /* !(__GNUCLIKE_ASM && !lint) */ void fldcw(u_short cw); @@ -90,6 +125,9 @@ void fxrstor(caddr_t addr); void ldmxcsr(u_int csr); void start_emulating(void); void stop_emulating(void); +void xrstor(char *addr, uint64_t mask); +void xsave(char *addr, uint64_t mask); +void xsetbv(uint32_t reg, uint64_t val); #endif /* __GNUCLIKE_ASM && !lint */ Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Mon Jan 30 07:51:52 2012 (r230765) +++ head/sys/amd64/include/cpufunc.h Mon Jan 30 07:53:33 2012 (r230766) @@ -669,41 +669,6 @@ intr_restore(register_t rflags) write_rflags(rflags); } -static __inline void -xsave(char *addr, uint64_t mask) -{ - uint32_t low, hi; - - low = mask; - hi = mask >> 32; - /* xsave (%rdi) */ - __asm __volatile(".byte 0x0f,0xae,0x27" : : - "a" (low), "d" (hi), "D" (addr) : "memory"); -} - -static __inline void -xsetbv(uint32_t reg, uint64_t val) -{ - uint32_t low, hi; - - low = val; - hi = val >> 32; - __asm __volatile(".byte 0x0f,0x01,0xd1" : : - "c" (reg), "a" (low), "d" (hi)); -} - -static __inline void -xrstor(char *addr, uint64_t mask) -{ - uint32_t low, hi; - - low = mask; - hi = mask >> 32; - /* xrstor (%rdi) */ - __asm __volatile(".byte 0x0f,0xae,0x2f" : : - "a" (low), "d" (hi), "D" (addr)); -} - #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */ int breakpoint(void); @@ -768,9 +733,6 @@ u_int rgs(void); void wbinvd(void); void write_rflags(u_int rf); void wrmsr(u_int msr, uint64_t newval); -void xsave(char *addr, uint64_t mask); -void xsetbv(uint32_t reg, uint64_t val); -void xrstor(char *addr, uint64_t mask); #endif /* __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 07:56:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 766F1106564A; Mon, 30 Jan 2012 07:56:00 +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 5A10B8FC0A; Mon, 30 Jan 2012 07:56:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0U7u0VR073913; Mon, 30 Jan 2012 07:56:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0U7u0d6073908; Mon, 30 Jan 2012 07:56:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201300756.q0U7u0d6073908@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 30 Jan 2012 07:56: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: r230767 - in head/sys: i386/i386 kern powerpc/aim powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 07:56:00 -0000 Author: kib Date: Mon Jan 30 07:56:00 2012 New Revision: 230767 URL: http://svn.freebsd.org/changeset/base/230767 Log: Finally, try to enable the nxstacks on amd64 and powerpc64 for both 64bit and 32bit ABIs. Also try to enable nxstacks for PAE/i386 when supported, and some variants of powerpc32. MFC after: 2 months (if ever) Modified: head/sys/i386/i386/initcpu.c head/sys/kern/imgact_elf.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/machdep.c Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Mon Jan 30 07:53:33 2012 (r230766) +++ head/sys/i386/i386/initcpu.c Mon Jan 30 07:56:00 2012 (r230767) @@ -650,6 +650,8 @@ enable_sse(void) #endif } +extern int elf32_nxstack; + void initializecpu(void) { @@ -739,6 +741,7 @@ initializecpu(void) msr = rdmsr(MSR_EFER) | EFER_NXE; wrmsr(MSR_EFER, msr); pg_nx = PG_NX; + elf32_nxstack = 1; } #endif break; Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Mon Jan 30 07:53:33 2012 (r230766) +++ head/sys/kern/imgact_elf.c Mon Jan 30 07:56:00 2012 (r230767) @@ -118,7 +118,12 @@ static int elf_legacy_coredump = 0; SYSCTL_INT(_debug, OID_AUTO, __elfN(legacy_coredump), CTLFLAG_RW, &elf_legacy_coredump, 0, ""); -static int __elfN(nxstack) = 0; +int __elfN(nxstack) = +#if defined(__amd64__) || defined(__powerpc64__) /* both 64 and 32 bit */ + 1; +#else + 0; +#endif SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, nxstack, CTLFLAG_RW, &__elfN(nxstack), 0, __XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) ": enable non-executable stack"); Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Jan 30 07:53:33 2012 (r230766) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Jan 30 07:56:00 2012 (r230767) @@ -1445,6 +1445,8 @@ moea64_uma_page_alloc(uma_zone_t zone, i return (void *)va; } +extern int elf32_nxstack; + void moea64_init(mmu_t mmu) { @@ -1464,6 +1466,8 @@ moea64_init(mmu_t mmu) uma_zone_set_allocf(moea64_mpvo_zone,moea64_uma_page_alloc); } + elf32_nxstack = 1; + moea64_initialized = TRUE; } Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Mon Jan 30 07:53:33 2012 (r230766) +++ head/sys/powerpc/booke/machdep.c Mon Jan 30 07:56:00 2012 (r230767) @@ -192,6 +192,8 @@ void print_kernel_section_addr(void); void print_kenv(void); u_int booke_init(uint32_t, uint32_t); +extern int elf32_nxstack; + static void cpu_e500_startup(void *dummy) { @@ -227,6 +229,9 @@ cpu_e500_startup(void *dummy) /* Set up buffers, so they can be used to read disk labels. */ bufinit(); vm_pager_bufferinit(); + + /* Cpu supports execution permissions on the pages. */ + elf32_nxstack = 1; } static char * From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 09:41:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 31783106567B; Mon, 30 Jan 2012 09:41:51 +0000 (UTC) Date: Mon, 30 Jan 2012 09:41:51 +0000 From: Alexey Dokuchaev To: Doug Barton Message-ID: <20120130094151.GB41336@FreeBSD.org> References: <201201272204.q0RM4hRH062478@svn.freebsd.org> <20120128184815.L1114@besplex.bde.org> <4F24B17E.4050306@freebsd.org> <4F24E934.8020408@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <4F24E934.8020408@FreeBSD.org> User-Agent: Mutt/1.4.2.1i Cc: src-committers@freebsd.org, Marius Strobl , Bruce Evans , svn-src-head@freebsd.org, Julian Elischer , svn-src-all@freebsd.org Subject: Re: svn commit: r230628 - head/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 09:41:51 -0000 On Sat, Jan 28, 2012 at 10:37:40PM -0800, Doug Barton wrote: > On 01/28/2012 18:39, Julian Elischer wrote: > > Bruce these comments are valid. > > please make use of your commit bit and make the appropriate changes! > > Completely aside from the pedantic value of having the person who broke > it be the one to fix it; this line of reasoning is only going DIScourage > people from pointing out problems. Are you sure that's what you want? I believe we all want all the bright points of BdeBSD to be merged into our tree, no? At some point I was collecting Bruce's insights for future analysis and hope to work out patches, but quickly realized I do not have required technical background to be qualified for this work. Which brings me to the same conclusion as Julian: people should make you of their commit bits and make appropriate changes themslves! :-) ./danfe From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 09:59:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1797106564A; Mon, 30 Jan 2012 09:59:33 +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 902928FC18; Mon, 30 Jan 2012 09:59:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0U9xXx0077854; Mon, 30 Jan 2012 09:59:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0U9xXO8077852; Mon, 30 Jan 2012 09:59:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201300959.q0U9xXO8077852@svn.freebsd.org> From: Alexander Motin Date: Mon, 30 Jan 2012 09:59: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: r230768 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 09:59:33 -0000 Author: mav Date: Mon Jan 30 09:59:33 2012 New Revision: 230768 URL: http://svn.freebsd.org/changeset/base/230768 Log: Fix typo in comments. Modified: head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Mon Jan 30 07:56:00 2012 (r230767) +++ head/sys/dev/sound/pci/hda/hdac.h Mon Jan 30 09:59:33 2012 (r230768) @@ -320,7 +320,7 @@ #define HDA_CODEC_ALC899 HDA_CODEC_CONSTRUCT(REALTEK, 0x0899) #define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff) -/* Motorolla */ +/* Motorola */ #define MOTO_VENDORID 0x1057 #define HDA_CODEC_MOTOXXXX HDA_CODEC_CONSTRUCT(MOTO, 0xffff) From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 11:40:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1320F106566C for ; Mon, 30 Jan 2012 11:40:34 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [93.89.92.32]) by mx1.freebsd.org (Postfix) with ESMTP id C67518FC15 for ; Mon, 30 Jan 2012 11:40:33 +0000 (UTC) Received: from uucp by gromit.grondar.org with local-rmail (Exim 4.76 (FreeBSD)) (envelope-from ) id 1RrpVq-00093c-SF for svn-src-all@freebsd.org; Mon, 30 Jan 2012 11:35:06 +0000 Received: from localhost ([127.0.0.1] helo=groundzero.grondar.org) by groundzero.grondar.org with esmtp (Exim 4.77 (FreeBSD)) (envelope-from ) id 1RrpR9-0006D5-To; Mon, 30 Jan 2012 11:30:15 +0000 To: Andrey Chernov In-reply-to: <20120129125738.GA26520@vniz.net> References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> <20120126165521.GA92622@vniz.net> <20120126175243.GA19199@zim.MIT.EDU> <20120126181340.GA93157@vniz.net> <20120129125738.GA26520@vniz.net> From: Mark Murray From: Mark Murray Date: Mon, 30 Jan 2012 11:30:15 +0000 Message-Id: Cc: src-committers@FreeBSD.ORG, John Baldwin , svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, David Schultz , Mark Murray Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 11:40:34 -0000 Andrey Chernov writes: > On Thu, Jan 26, 2012 at 10:13:41PM +0400, Andrey Chernov wrote: > > On Thu, Jan 26, 2012 at 12:52:43PM -0500, David Schultz wrote: > > > Why complicate things with atomics at all? A race might result in > > > arc4random(9) being seeded multiple times, but that's harmless. > > > > Multiply seeding in line is harmless, just waste of time and resources. > > Other case is one missing seeding when variable is set concurrently with > > its read. I see no complication using atomic. Latest version is even > > shorter than previous ones. > > Well, I almost forget about my special case: I have personal prohibition > from @secteam (5 years old already) to commit anything to all RNG areas. > > So, the question is: could anyone of you commit some version from this > thread, please? Sure; I'll do it. Please give me your test code/cases. > I don't insist of atomics in this sutuation, so you can peek any version > you like. I'll need to clearly see what works. M -- Mark R V Murray Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open) Pi: 132511160 From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 12:10:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C4AC106564A; Mon, 30 Jan 2012 12:10:37 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59FBE8FC16; Mon, 30 Jan 2012 12:10:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UCAbGB084869; Mon, 30 Jan 2012 12:10:37 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UCAbhK084867; Mon, 30 Jan 2012 12:10:37 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201301210.q0UCAbhK084867@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 30 Jan 2012 12:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230769 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 12:10:37 -0000 Author: pluknet Date: Mon Jan 30 12:10:37 2012 New Revision: 230769 URL: http://svn.freebsd.org/changeset/base/230769 Log: MFC r230531: Remove unused variable. Modified: stable/9/sys/netinet6/nd6.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet6/nd6.c ============================================================================== --- stable/9/sys/netinet6/nd6.c Mon Jan 30 09:59:33 2012 (r230768) +++ stable/9/sys/netinet6/nd6.c Mon Jan 30 12:10:37 2012 (r230769) @@ -575,7 +575,6 @@ nd6_timer(void *arg) struct nd_defrouter *dr; struct nd_prefix *pr; struct in6_ifaddr *ia6, *nia6; - struct in6_addrlifetime *lt6; callout_reset(&V_nd6_timer_ch, V_nd6_prune * hz, nd6_timer, curvnet); @@ -605,7 +604,6 @@ nd6_timer(void *arg) addrloop: TAILQ_FOREACH_SAFE(ia6, &V_in6_ifaddrhead, ia_link, nia6) { /* check address lifetime */ - lt6 = &ia6->ia6_lifetime; if (IFA6_IS_INVALID(ia6)) { int regen = 0; From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 12:13:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E7011065704; Mon, 30 Jan 2012 12:13:51 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C35E8FC18; Mon, 30 Jan 2012 12:13:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UCDp6h085038; Mon, 30 Jan 2012 12:13:51 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UCDpXr085036; Mon, 30 Jan 2012 12:13:51 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201301213.q0UCDpXr085036@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 30 Jan 2012 12:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230770 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 12:13:51 -0000 Author: pluknet Date: Mon Jan 30 12:13:50 2012 New Revision: 230770 URL: http://svn.freebsd.org/changeset/base/230770 Log: MFC r230531: Remove unused variable. Modified: stable/8/sys/netinet6/nd6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Mon Jan 30 12:10:37 2012 (r230769) +++ stable/8/sys/netinet6/nd6.c Mon Jan 30 12:13:50 2012 (r230770) @@ -565,7 +565,6 @@ nd6_timer(void *arg) struct nd_defrouter *dr; struct nd_prefix *pr; struct in6_ifaddr *ia6, *nia6; - struct in6_addrlifetime *lt6; callout_reset(&V_nd6_timer_ch, V_nd6_prune * hz, nd6_timer, curvnet); @@ -595,7 +594,6 @@ nd6_timer(void *arg) addrloop: TAILQ_FOREACH_SAFE(ia6, &V_in6_ifaddrhead, ia_link, nia6) { /* check address lifetime */ - lt6 = &ia6->ia6_lifetime; if (IFA6_IS_INVALID(ia6)) { int regen = 0; From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 12:28:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC91D1065670; Mon, 30 Jan 2012 12:28:22 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A7628FC14; Mon, 30 Jan 2012 12:28:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UCSMEE085537; Mon, 30 Jan 2012 12:28:22 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UCSMI3085535; Mon, 30 Jan 2012 12:28:22 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201301228.q0UCSMI3085535@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 30 Jan 2012 12:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230771 - stable/9/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 12:28:22 -0000 Author: pluknet Date: Mon Jan 30 12:28:22 2012 New Revision: 230771 URL: http://svn.freebsd.org/changeset/base/230771 Log: MFC r230613: Remove a left-over reference to make.conf(5) for now-defunct -DVM_STACK Modified: stable/9/lib/libc/sys/mmap.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/stdtime/ (props changed) Modified: stable/9/lib/libc/sys/mmap.2 ============================================================================== --- stable/9/lib/libc/sys/mmap.2 Mon Jan 30 12:13:50 2012 (r230770) +++ stable/9/lib/libc/sys/mmap.2 Mon Jan 30 12:28:22 2012 (r230771) @@ -356,8 +356,7 @@ was specified and insufficient memory wa .Xr msync 2 , .Xr munlock 2 , .Xr munmap 2 , -.Xr getpagesize 3 , -.Xr make.conf 5 +.Xr getpagesize 3 .Sh BUGS The .Fa len From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 12:29:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB943106564A; Mon, 30 Jan 2012 12:29:51 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D97EF8FC08; Mon, 30 Jan 2012 12:29:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UCTpFW085621; Mon, 30 Jan 2012 12:29:51 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UCTpDW085619; Mon, 30 Jan 2012 12:29:51 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201301229.q0UCTpDW085619@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 30 Jan 2012 12:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230772 - stable/8/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 12:29:52 -0000 Author: pluknet Date: Mon Jan 30 12:29:51 2012 New Revision: 230772 URL: http://svn.freebsd.org/changeset/base/230772 Log: MFC r230613: Remove a left-over reference to make.conf(5) for now-defunct -DVM_STACK Modified: stable/8/lib/libc/sys/mmap.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sys/mmap.2 ============================================================================== --- stable/8/lib/libc/sys/mmap.2 Mon Jan 30 12:28:22 2012 (r230771) +++ stable/8/lib/libc/sys/mmap.2 Mon Jan 30 12:29:51 2012 (r230772) @@ -356,8 +356,7 @@ was specified and insufficient memory wa .Xr msync 2 , .Xr munlock 2 , .Xr munmap 2 , -.Xr getpagesize 3 , -.Xr make.conf 5 +.Xr getpagesize 3 .Sh BUGS The .Fa len From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 12:32:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2843106566C; Mon, 30 Jan 2012 12:32:22 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A03318FC0A; Mon, 30 Jan 2012 12:32:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UCWMEp085757; Mon, 30 Jan 2012 12:32:22 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UCWMKC085755; Mon, 30 Jan 2012 12:32:22 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201301232.q0UCWMKC085755@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 30 Jan 2012 12:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230773 - stable/7/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 12:32:22 -0000 Author: pluknet Date: Mon Jan 30 12:32:22 2012 New Revision: 230773 URL: http://svn.freebsd.org/changeset/base/230773 Log: MFC r230613: Remove a left-over reference to make.conf(5) for now-defunct -DVM_STACK Modified: stable/7/lib/libc/sys/mmap.2 Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/sys/mmap.2 ============================================================================== --- stable/7/lib/libc/sys/mmap.2 Mon Jan 30 12:29:51 2012 (r230772) +++ stable/7/lib/libc/sys/mmap.2 Mon Jan 30 12:32:22 2012 (r230773) @@ -342,8 +342,7 @@ sysctl. .Xr msync 2 , .Xr munlock 2 , .Xr munmap 2 , -.Xr getpagesize 3 , -.Xr make.conf 5 +.Xr getpagesize 3 .Sh BUGS The .Fa len From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 13:26:50 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 396521065676; Mon, 30 Jan 2012 13:26:50 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 98A5F8FC0C; Mon, 30 Jan 2012 13:26:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0UDQlpV059943; Mon, 30 Jan 2012 17:26:47 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0UDQkju059942; Mon, 30 Jan 2012 17:26:47 +0400 (MSK) (envelope-from ache) Date: Mon, 30 Jan 2012 17:26:46 +0400 From: Andrey Chernov To: Mark Murray , Mark Murray Message-ID: <20120130132645.GA59595@vniz.net> Mail-Followup-To: Andrey Chernov , Mark Murray , Mark Murray , David Schultz , John Baldwin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> <20120126165521.GA92622@vniz.net> <20120126175243.GA19199@zim.MIT.EDU> <20120126181340.GA93157@vniz.net> <20120129125738.GA26520@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, John Baldwin Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 13:26:50 -0000 On Mon, Jan 30, 2012 at 11:30:15AM +0000, Mark Murray wrote: > > Well, I almost forget about my special case: I have personal prohibition > > from @secteam (5 years old already) to commit anything to all RNG areas. > > > > So, the question is: could anyone of you commit some version from this > > thread, please? > > Sure; I'll do it. Please give me your test code/cases. > > > I don't insist of atomics in this sutuation, so you can peek any version > > you like. > > I'll need to clearly see what works. Both works:) Version with atomic cmpsets works 100% correct, but it seems people dislike it just for using atomics. Version without atomics works slightly incorrectly in edge cases, but no harm happens. Worst possible scenario for version without atomics: 1) Several arc4random() fired at once (i.e. concurrently) exact in the moment when random_yarrow_unblock() modifies this variable. 2) Such of them who catch the variable after modification and see that reseed is needed simultaneously put themselves into reseeding chain, because arc4_randomstir() is protected with mutex. There is no harm can be done to this PRNG by reseeding it many times sequentially, just waste of CPU & time. 3) Such of them who miss the modification skips this step, and PRNG will be reseded when any other arc4random() call happens afterwards. The rest of arc4rand() function code is protected by mutex too, so it will stay sequentially-aligned in any case. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 15:09:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 351E6106566B; Mon, 30 Jan 2012 15:09:04 +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 23FC08FC16; Mon, 30 Jan 2012 15:09:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UF94JS090769; Mon, 30 Jan 2012 15:09:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UF94IS090767; Mon, 30 Jan 2012 15:09:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201301509.q0UF94IS090767@svn.freebsd.org> From: John Baldwin Date: Mon, 30 Jan 2012 15:09: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: r230774 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 15:09:04 -0000 Author: jhb Date: Mon Jan 30 15:09:03 2012 New Revision: 230774 URL: http://svn.freebsd.org/changeset/base/230774 Log: Add a constant for the PCI-e surprise link down uncorrectable error. Modified: head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Mon Jan 30 12:32:22 2012 (r230773) +++ head/sys/dev/pci/pcireg.h Mon Jan 30 15:09:03 2012 (r230774) @@ -697,6 +697,7 @@ #define PCIR_AER_UC_STATUS 0x04 #define PCIM_AER_UC_TRAINING_ERROR 0x00000001 #define PCIM_AER_UC_DL_PROTOCOL_ERROR 0x00000010 +#define PCIM_AER_UC_SUPRISE_LINK_DOWN 0x00000020 #define PCIM_AER_UC_POISONED_TLP 0x00001000 #define PCIM_AER_UC_FC_PROTOCOL_ERROR 0x00002000 #define PCIM_AER_UC_COMPLETION_TIMEOUT 0x00004000 From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 16:42:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 040D6106566C; Mon, 30 Jan 2012 16:42:03 +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 E51A98FC12; Mon, 30 Jan 2012 16:42:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UGg2YI093710; Mon, 30 Jan 2012 16:42:02 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UGg2so093704; Mon, 30 Jan 2012 16:42:02 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201201301642.q0UGg2so093704@svn.freebsd.org> From: Jack F Vogel Date: Mon, 30 Jan 2012 16:42: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: r230775 - in head/sys: conf dev/ixgbe modules/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 16:42:03 -0000 Author: jfv Date: Mon Jan 30 16:42:02 2012 New Revision: 230775 URL: http://svn.freebsd.org/changeset/base/230775 Log: New hardware support: Intel X540 adapter support added. Some shared code reorganization along with the new adapter. Sync changes to OACTIVE in igb into this driver. Misc small fixes. Added: head/sys/dev/ixgbe/ixgbe_82598.h (contents, props changed) head/sys/dev/ixgbe/ixgbe_82599.h (contents, props changed) head/sys/dev/ixgbe/ixgbe_x540.c (contents, props changed) head/sys/dev/ixgbe/ixgbe_x540.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixgbe_82598.c head/sys/dev/ixgbe/ixgbe_82599.c head/sys/dev/ixgbe/ixgbe_api.c head/sys/dev/ixgbe/ixgbe_api.h head/sys/dev/ixgbe/ixgbe_common.c head/sys/dev/ixgbe/ixgbe_common.h head/sys/dev/ixgbe/ixgbe_mbx.c head/sys/dev/ixgbe/ixgbe_mbx.h head/sys/dev/ixgbe/ixgbe_osdep.h head/sys/dev/ixgbe/ixgbe_phy.c head/sys/dev/ixgbe/ixgbe_phy.h head/sys/dev/ixgbe/ixgbe_type.h head/sys/dev/ixgbe/ixgbe_vf.c head/sys/dev/ixgbe/ixgbe_vf.h head/sys/dev/ixgbe/ixv.c head/sys/dev/ixgbe/ixv.h head/sys/modules/ixgbe/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jan 30 15:09:03 2012 (r230774) +++ head/sys/conf/files Mon Jan 30 16:42:02 2012 (r230775) @@ -1395,6 +1395,8 @@ dev/ixgbe/ixgbe_82598.c optional ixgbe compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_82599.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_x540.c optional ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/jme/if_jme.c optional jme pci dev/joy/joy.c optional joy dev/joy/joy_isa.c optional joy isa Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Mon Jan 30 15:09:03 2012 (r230774) +++ head/sys/dev/ixgbe/ixgbe.c Mon Jan 30 16:42:02 2012 (r230775) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.3.11"; +char ixgbe_driver_version[] = "2.4.5"; /********************************************************************* * PCI Device ID Table @@ -81,6 +81,8 @@ static ixgbe_vendor_info_t ixgbe_vendor_ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BACKPLANE_FCOE, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} }; @@ -153,6 +155,7 @@ static void ixgbe_refresh_mbufs(struct r static int ixgbe_xmit(struct tx_ring *, struct mbuf **); static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS); static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS); +static int ixgbe_set_thermal_test(SYSCTL_HANDLER_ARGS); static int ixgbe_dma_malloc(struct adapter *, bus_size_t, struct ixgbe_dma_alloc *, int); static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); @@ -415,19 +418,29 @@ ixgbe_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "flow_control", CTLTYPE_INT | CTLFLAG_RW, + OID_AUTO, "fc", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_set_flowcntl, "I", "Flow Control"); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "advertise_gig", CTLTYPE_INT | CTLFLAG_RW, - adapter, 0, ixgbe_set_advertise, "I", "1G Link"); - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "enable_aim", CTLTYPE_INT|CTLFLAG_RW, &ixgbe_enable_aim, 1, "Interrupt Moderation"); + /* + ** Allow a kind of speed control by forcing the autoneg + ** advertised speed list to only a certain value, this + ** supports 1G on 82599 devices, and 100Mb on x540. + */ + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "advertise_speed", CTLTYPE_INT | CTLFLAG_RW, + adapter, 0, ixgbe_set_advertise, "I", "Link Speed"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "ts", CTLTYPE_INT | CTLFLAG_RW, adapter, + 0, ixgbe_set_thermal_test, "I", "Thermal Test"); + /* Set up the timer callout */ callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0); @@ -515,9 +528,10 @@ ixgbe_attach(device_t dev) /* Get Hardware Flow Control setting */ hw->fc.requested_mode = ixgbe_fc_full; + adapter->fc = hw->fc.requested_mode; hw->fc.pause_time = IXGBE_FC_PAUSE; hw->fc.low_water = IXGBE_FC_LO; - hw->fc.high_water = IXGBE_FC_HI; + hw->fc.high_water[0] = IXGBE_FC_HI; hw->fc.send_xon = TRUE; error = ixgbe_init_hw(hw); @@ -724,16 +738,20 @@ ixgbe_start_locked(struct tx_ring *txr, return; while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { + if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE) { + txr->queue_status |= IXGBE_QUEUE_DEPLETED; + break; + } IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; if (ixgbe_xmit(txr, &m_head)) { - if (m_head == NULL) - break; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + if (m_head != NULL) + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE) + txr->queue_status |= IXGBE_QUEUE_DEPLETED; break; } /* Send a copy of the frame to the BPF listener */ @@ -782,11 +800,14 @@ ixgbe_mq_start(struct ifnet *ifp, struct /* Which queue to use */ if ((m->m_flags & M_FLOWID) != 0) i = m->m_pkthdr.flowid % adapter->num_queues; + else + i = curcpu % adapter->num_queues; txr = &adapter->tx_rings[i]; que = &adapter->queues[i]; - if (IXGBE_TX_TRYLOCK(txr)) { + if (((txr->queue_status & IXGBE_QUEUE_DEPLETED) == 0) && + IXGBE_TX_TRYLOCK(txr)) { err = ixgbe_mq_start_locked(ifp, txr, m); IXGBE_TX_UNLOCK(txr); } else { @@ -804,8 +825,9 @@ ixgbe_mq_start_locked(struct ifnet *ifp, struct mbuf *next; int enqueued, err = 0; - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || adapter->link_active == 0) { + if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) || + (txr->queue_status == IXGBE_QUEUE_DEPLETED) || + adapter->link_active == 0) { if (m != NULL) err = drbr_enqueue(ifp, txr->br, m); return (err); @@ -837,7 +859,7 @@ ixgbe_mq_start_locked(struct ifnet *ifp, if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) ixgbe_txeof(txr); if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + txr->queue_status |= IXGBE_QUEUE_DEPLETED; break; } next = drbr_dequeue(ifp, txr->br); @@ -845,10 +867,13 @@ ixgbe_mq_start_locked(struct ifnet *ifp, if (enqueued > 0) { /* Set watchdog on */ - txr->queue_status = IXGBE_QUEUE_WORKING; + txr->queue_status |= IXGBE_QUEUE_WORKING; txr->watchdog_time = ticks; } + if (txr->tx_avail < IXGBE_TX_CLEANUP_THRESHOLD) + ixgbe_txeof(txr); + return (err); } @@ -916,8 +941,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c arp_ifinit(ifp, ifa); } else error = ether_ioctl(ifp, command, data); - break; #endif + break; case SIOCSIFMTU: IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)"); if (ifr->ifr_mtu > IXGBE_MAX_FRAME_SIZE - ETHER_HDR_LEN) { @@ -1087,10 +1112,14 @@ ixgbe_init_locked(struct adapter *adapte /* Enable Fan Failure Interrupt */ gpie |= IXGBE_SDP1_GPIEN; - /* Add for Thermal detection */ + /* Add for Module detection */ if (hw->mac.type == ixgbe_mac_82599EB) gpie |= IXGBE_SDP2_GPIEN; + /* Thermal Failure Detection */ + if (hw->mac.type == ixgbe_mac_X540) + gpie |= IXGBE_SDP0_GPIEN; + if (adapter->msix > 1) { /* Enable Enhanced MSIX mode */ gpie |= IXGBE_GPIE_MSIX_MODE; @@ -1196,8 +1225,12 @@ ixgbe_init_locked(struct adapter *adapte #ifdef IXGBE_FDIR /* Init Flow director */ - if (hw->mac.type != ixgbe_mac_82598EB) + if (hw->mac.type != ixgbe_mac_82598EB) { + u32 hdrm = 64 << fdir_pballoc; + + hw->mac.ops.setup_rxpba(hw, 0, hdrm, PBA_STRATEGY_EQUAL); ixgbe_init_fdir_signature_82599(&adapter->hw, fdir_pballoc); + } #endif /* @@ -1325,7 +1358,7 @@ ixgbe_handle_que(void *context, int pend ixgbe_start_locked(txr, ifp); #endif IXGBE_TX_UNLOCK(txr); - if (more) { + if (more || (ifp->if_drv_flags & IFF_DRV_OACTIVE)) { taskqueue_enqueue(que->tq, &que->que_task); return; } @@ -1405,6 +1438,7 @@ ixgbe_msix_que(void *arg) bool more_tx, more_rx; u32 newitr = 0; + ixgbe_disable_queue(adapter, que->msix); ++que->irqs; more_rx = ixgbe_rxeof(que, adapter->rx_process_limit); @@ -1539,6 +1573,15 @@ ixgbe_msix_link(void *arg) IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1); } + /* Check for over temp condition */ + if ((hw->mac.type == ixgbe_mac_X540) && + (reg_eicr & IXGBE_EICR_GPI_SDP0)) { + device_printf(adapter->dev, "\nCRITICAL: OVER TEMP!! " + "PHY IS SHUT DOWN!!\n"); + device_printf(adapter->dev, "System shutdown required\n"); + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP0); + } + IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); return; } @@ -1571,6 +1614,9 @@ ixgbe_media_status(struct ifnet * ifp, s ifmr->ifm_status |= IFM_ACTIVE; switch (adapter->link_speed) { + case IXGBE_LINK_SPEED_100_FULL: + ifmr->ifm_active |= IFM_100_TX | IFM_FDX; + break; case IXGBE_LINK_SPEED_1GB_FULL: ifmr->ifm_active |= IFM_1000_T | IFM_FDX; break; @@ -1606,7 +1652,9 @@ ixgbe_media_change(struct ifnet * ifp) switch (IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: adapter->hw.phy.autoneg_advertised = - IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_10GB_FULL; + IXGBE_LINK_SPEED_100_FULL | + IXGBE_LINK_SPEED_1GB_FULL | + IXGBE_LINK_SPEED_10GB_FULL; break; default: device_printf(adapter->dev, "Only auto media type\n"); @@ -1878,7 +1926,7 @@ ixgbe_set_multi(struct adapter *adapter) update_ptr = mta; ixgbe_update_mc_addr_list(&adapter->hw, - update_ptr, mcnt, ixgbe_mc_array_itr); + update_ptr, mcnt, ixgbe_mc_array_itr, TRUE); return; } @@ -1912,11 +1960,15 @@ ixgbe_mc_array_itr(struct ixgbe_hw *hw, static void ixgbe_local_timer(void *arg) { - struct adapter *adapter = arg; + struct adapter *adapter = arg; device_t dev = adapter->dev; - struct tx_ring *txr = adapter->tx_rings; + struct ifnet *ifp = adapter->ifp; + struct ix_queue *que = adapter->queues; + struct tx_ring *txr = adapter->tx_rings; + int hung, busy, paused; mtx_assert(&adapter->core_mtx, MA_OWNED); + hung = busy = paused = 0; /* Check for pluggable optics */ if (adapter->sfp_probe) @@ -1931,21 +1983,38 @@ ixgbe_local_timer(void *arg) * then don't do the watchdog check */ if (IXGBE_READ_REG(&adapter->hw, IXGBE_TFCS) & IXGBE_TFCS_TXOFF) - goto out; + paused = 1; /* - ** Check status on the TX queues for a hang - */ - for (int i = 0; i < adapter->num_queues; i++, txr++) - if (txr->queue_status == IXGBE_QUEUE_HUNG) - goto hung; + ** Check the TX queues status + ** - central locked handling of OACTIVE + ** - watchdog only if all queues show hung + */ + for (int i = 0; i < adapter->num_queues; i++, que++, txr++) { + if ((txr->queue_status & IXGBE_QUEUE_HUNG) && + (paused == 0)) + ++hung; + if (txr->queue_status & IXGBE_QUEUE_DEPLETED) + ++busy; + if ((txr->queue_status & IXGBE_QUEUE_IDLE) == 0) + taskqueue_enqueue(que->tq, &que->que_task); + } + /* Only truely watchdog if all queues show hung */ + if (hung == adapter->num_queues) + goto watchdog; + /* Only turn off the stack flow when ALL are depleted */ + if (busy == adapter->num_queues) + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + else if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) && + (busy < adapter->num_queues)) + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; out: ixgbe_rearm_queues(adapter, adapter->que_mask); callout_reset(&adapter->timer, hz, ixgbe_local_timer, adapter); return; -hung: +watchdog: device_printf(adapter->dev, "Watchdog timeout -- resetting\n"); device_printf(dev,"Queue(%d) tdh = %d, hw tdt = %d\n", txr->me, IXGBE_READ_REG(&adapter->hw, IXGBE_TDH(txr->me)), @@ -2015,9 +2084,11 @@ ixgbe_stop(void *arg) INIT_DEBUGOUT("ixgbe_stop: begin\n"); ixgbe_disable_intr(adapter); + callout_stop(&adapter->timer); - /* Tell the stack that the interface is no longer active */ - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + /* Let the stack know...*/ + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; ixgbe_reset_hw(hw); hw->adapter_stopped = FALSE; @@ -2025,7 +2096,6 @@ ixgbe_stop(void *arg) /* Turn off the laser */ if (hw->phy.multispeed_fiber) ixgbe_disable_tx_laser(hw); - callout_stop(&adapter->timer); /* reprogram the RAR[0] in case user changed it. */ ixgbe_set_rar(&adapter->hw, 0, adapter->hw.mac.addr, 0, IXGBE_RAH_AV); @@ -2079,35 +2149,41 @@ ixgbe_setup_optics(struct adapter *adapt int layer; layer = ixgbe_get_supported_physical_layer(hw); - switch (layer) { - case IXGBE_PHYSICAL_LAYER_10GBASE_T: - adapter->optics = IFM_10G_T; - break; - case IXGBE_PHYSICAL_LAYER_1000BASE_T: - adapter->optics = IFM_1000_T; - break; - case IXGBE_PHYSICAL_LAYER_10GBASE_LR: - case IXGBE_PHYSICAL_LAYER_10GBASE_LRM: - adapter->optics = IFM_10G_LR; - break; - case IXGBE_PHYSICAL_LAYER_10GBASE_SR: - adapter->optics = IFM_10G_SR; - break; - case IXGBE_PHYSICAL_LAYER_10GBASE_KX4: - case IXGBE_PHYSICAL_LAYER_10GBASE_CX4: - adapter->optics = IFM_10G_CX4; - break; - case IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU: - adapter->optics = IFM_10G_TWINAX; - break; - case IXGBE_PHYSICAL_LAYER_1000BASE_KX: - case IXGBE_PHYSICAL_LAYER_10GBASE_KR: - case IXGBE_PHYSICAL_LAYER_10GBASE_XAUI: - case IXGBE_PHYSICAL_LAYER_UNKNOWN: - default: - adapter->optics = IFM_ETHER | IFM_AUTO; - break; + + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) { + adapter->optics = IFM_10G_T; + return; + } + + if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_T) { + adapter->optics = IFM_1000_T; + return; } + + if (layer & (IXGBE_PHYSICAL_LAYER_10GBASE_LR | + IXGBE_PHYSICAL_LAYER_10GBASE_LRM)) { + adapter->optics = IFM_10G_LR; + return; + } + + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_SR) { + adapter->optics = IFM_10G_SR; + return; + } + + if (layer & IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU) { + adapter->optics = IFM_10G_TWINAX; + return; + } + + if (layer & (IXGBE_PHYSICAL_LAYER_10GBASE_KX4 | + IXGBE_PHYSICAL_LAYER_10GBASE_CX4)) { + adapter->optics = IFM_10G_CX4; + return; + } + + /* If we get here just set the default */ + adapter->optics = IFM_ETHER | IFM_AUTO; return; } @@ -2975,6 +3051,7 @@ ixgbe_initialize_transmit_units(struct a txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i)); break; case ixgbe_mac_82599EB: + case ixgbe_mac_X540: default: txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i)); break; @@ -2985,6 +3062,7 @@ ixgbe_initialize_transmit_units(struct a IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), txctrl); break; case ixgbe_mac_82599EB: + case ixgbe_mac_X540: default: IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(i), txctrl); break; @@ -3512,18 +3590,13 @@ ixgbe_txeof(struct tx_ring *txr) if ((!processed) && ((ticks - txr->watchdog_time) > IXGBE_WATCHDOG)) txr->queue_status = IXGBE_QUEUE_HUNG; - /* - * If we have enough room, clear IFF_DRV_OACTIVE to tell the stack that - * it is OK to send packets. If there are no pending descriptors, - * clear the timeout. Otherwise, if some descriptors have been freed, - * restart the timeout. - */ - if (txr->tx_avail > IXGBE_TX_CLEANUP_THRESHOLD) { - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - if (txr->tx_avail == adapter->num_tx_desc) { - txr->queue_status = IXGBE_QUEUE_IDLE; - return FALSE; - } + /* With a minimum free clear the depleted state bit. */ + if (txr->tx_avail > IXGBE_TX_CLEANUP_THRESHOLD) + txr->queue_status &= ~IXGBE_QUEUE_DEPLETED; + + if (txr->tx_avail == adapter->num_tx_desc) { + txr->queue_status = IXGBE_QUEUE_IDLE; + return (FALSE); } return TRUE; @@ -3923,6 +3996,7 @@ skip_head: rxr->rx_split_packets = 0; rxr->rx_bytes = 0; rxr->discard = FALSE; + rxr->vtag_strip = FALSE; bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -3930,7 +4004,7 @@ skip_head: /* ** Now set up the LRO interface: ** 82598 uses software LRO, the - ** 82599 uses a hardware assist. + ** 82599 and X540 use a hardware assist. */ if ((adapter->hw.mac.type != ixgbe_mac_82598EB) && (ifp->if_capenable & IFCAP_RXCSUM) && @@ -4028,7 +4102,8 @@ ixgbe_initialize_receive_units(struct ad hlreg &= ~IXGBE_HLREG0_JUMBOEN; IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg); - bufsz = (adapter->rx_mbuf_sz + BSIZEPKT_ROUNDUP) >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; + bufsz = (adapter->rx_mbuf_sz + + BSIZEPKT_ROUNDUP) >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 rdba = rxr->rxdma.dma_paddr; @@ -4314,7 +4389,8 @@ ixgbe_rxeof(struct ix_queue *que, int co for (i = rxr->next_to_check; count != 0;) { struct mbuf *sendmp, *mh, *mp; u32 rsc, ptype; - u16 hlen, plen, hdr, vtag; + u16 hlen, plen, hdr; + u16 vtag = 0; bool eop; /* Sync the ring. */ @@ -4342,9 +4418,12 @@ ixgbe_rxeof(struct ix_queue *que, int co ptype = le32toh(cur->wb.lower.lo_dword.data) & IXGBE_RXDADV_PKTTYPE_MASK; hdr = le16toh(cur->wb.lower.lo_dword.hs_rss.hdr_info); - vtag = le16toh(cur->wb.upper.vlan); eop = ((staterr & IXGBE_RXD_STAT_EOP) != 0); + /* Process vlan info */ + if ((rxr->vtag_strip) && (staterr & IXGBE_RXD_STAT_VP)) + vtag = le16toh(cur->wb.upper.vlan); + /* Make sure bad packets are discarded */ if (((staterr & IXGBE_RXDADV_ERR_FRAME_ERR_MASK) != 0) || (rxr->discard)) { @@ -4445,8 +4524,8 @@ ixgbe_rxeof(struct ix_queue *que, int co } else { /* Singlet, prepare to send */ sendmp = mh; - if ((adapter->num_vlans) && - (staterr & IXGBE_RXD_STAT_VP)) { + /* If hardware handled vtag */ + if (vtag) { sendmp->m_pkthdr.ether_vtag = vtag; sendmp->m_flags |= M_VLANTAG; } @@ -4655,6 +4734,7 @@ ixgbe_setup_vlan_hw_support(struct adapt { struct ifnet *ifp = adapter->ifp; struct ixgbe_hw *hw = &adapter->hw; + struct rx_ring *rxr; u32 ctrl; @@ -4686,13 +4766,17 @@ ixgbe_setup_vlan_hw_support(struct adapt ctrl |= IXGBE_VLNCTRL_VME; IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, ctrl); - /* On 82599 the VLAN enable is per/queue in RXDCTL */ - if (hw->mac.type != ixgbe_mac_82598EB) - for (int i = 0; i < adapter->num_queues; i++) { + /* Setup the queues for vlans */ + for (int i = 0; i < adapter->num_queues; i++) { + rxr = &adapter->rx_rings[i]; + /* On 82599 the VLAN enable is per/queue in RXDCTL */ + if (hw->mac.type != ixgbe_mac_82598EB) { ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); - ctrl |= IXGBE_RXDCTL_VME; + ctrl |= IXGBE_RXDCTL_VME; IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl); } + rxr->vtag_strip = TRUE; + } } static void @@ -4708,6 +4792,7 @@ ixgbe_enable_intr(struct adapter *adapte mask |= IXGBE_EIMS_GPI_SDP1; else { mask |= IXGBE_EIMS_ECC; + mask |= IXGBE_EIMS_GPI_SDP0; mask |= IXGBE_EIMS_GPI_SDP1; mask |= IXGBE_EIMS_GPI_SDP2; #ifdef IXGBE_FDIR @@ -4805,6 +4890,7 @@ ixgbe_set_ivar(struct adapter *adapter, break; case ixgbe_mac_82599EB: + case ixgbe_mac_X540: if (type == -1) { /* MISC IVAR */ index = (entry & 1) * 8; ivar = IXGBE_READ_REG(hw, IXGBE_IVAR_MISC); @@ -5492,24 +5578,23 @@ ixgbe_add_hw_stats(struct adapter *adapt static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) { - int error; - int last = ixgbe_flow_control; - struct adapter *adapter; + int error, last; + struct adapter *adapter = (struct adapter *) arg1; - error = sysctl_handle_int(oidp, &ixgbe_flow_control, 0, req); - if (error) + last = adapter->fc; + error = sysctl_handle_int(oidp, &adapter->fc, 0, req); + if ((error) || (req->newptr == NULL)) return (error); /* Don't bother if it's not changed */ - if (ixgbe_flow_control == last) + if (adapter->fc == last) return (0); - adapter = (struct adapter *) arg1; - switch (ixgbe_flow_control) { + switch (adapter->fc) { case ixgbe_fc_rx_pause: case ixgbe_fc_tx_pause: case ixgbe_fc_full: - adapter->hw.fc.requested_mode = ixgbe_flow_control; + adapter->hw.fc.requested_mode = adapter->fc; break; case ixgbe_fc_none: default: @@ -5534,16 +5619,19 @@ ixgbe_add_rx_process_limit(struct adapte ** Control link advertise speed: ** 0 - normal ** 1 - advertise only 1G +** 2 - advertise 100Mb */ static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) { int error = 0; struct adapter *adapter; + device_t dev; struct ixgbe_hw *hw; ixgbe_link_speed speed, last; adapter = (struct adapter *) arg1; + dev = adapter->dev; hw = &adapter->hw; last = hw->phy.autoneg_advertised; @@ -5556,8 +5644,15 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) (hw->phy.multispeed_fiber))) return (error); + if ((adapter->advertise == 2) && (hw->mac.type != ixgbe_mac_X540)) { + device_printf(dev, "Set Advertise: 100Mb on X540 only\n"); + return (error); + } + if (adapter->advertise == 1) speed = IXGBE_LINK_SPEED_1GB_FULL; + else if (adapter->advertise == 2) + speed = IXGBE_LINK_SPEED_100_FULL; else speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_10GB_FULL; @@ -5570,3 +5665,31 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) return (error); } + +/* +** Thermal Shutdown Trigger +** - cause a Thermal Overtemp IRQ +*/ +static int +ixgbe_set_thermal_test(SYSCTL_HANDLER_ARGS) +{ + int error, fire = 0; + struct adapter *adapter = (struct adapter *) arg1; + struct ixgbe_hw *hw = &adapter->hw; + + + if (hw->mac.type != ixgbe_mac_X540) + return (0); + + error = sysctl_handle_int(oidp, &fire, 0, req); + if ((error) || (req->newptr == NULL)) + return (error); + + if (fire) { + u32 reg = IXGBE_READ_REG(hw, IXGBE_EICS); + reg |= IXGBE_EICR_TS; + IXGBE_WRITE_REG(hw, IXGBE_EICS, reg); + } + + return (0); +} Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Mon Jan 30 15:09:03 2012 (r230774) +++ head/sys/dev/ixgbe/ixgbe.h Mon Jan 30 16:42:02 2012 (r230775) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -184,9 +184,11 @@ #define IXGBE_RX_HDR 128 #define IXGBE_VFTA_SIZE 128 #define IXGBE_BR_SIZE 4096 -#define IXGBE_QUEUE_IDLE 0 -#define IXGBE_QUEUE_WORKING 1 -#define IXGBE_QUEUE_HUNG 2 +#define IXGBE_QUEUE_MIN_FREE 32 +#define IXGBE_QUEUE_IDLE 1 +#define IXGBE_QUEUE_WORKING 2 +#define IXGBE_QUEUE_HUNG 4 +#define IXGBE_QUEUE_DEPLETED 8 /* Offload bits in mbuf flag */ #if __FreeBSD_version >= 800000 @@ -323,6 +325,7 @@ struct rx_ring { bool hdr_split; bool hw_rsc; bool discard; + bool vtag_strip; u32 next_to_refresh; u32 next_to_check; char mtx_name[16]; @@ -387,6 +390,7 @@ struct adapter { /* Info about the interface */ u32 optics; + u32 fc; /* local flow ctrl setting */ int advertise; /* link speeds */ bool link_active; u16 max_frame_size; Modified: head/sys/dev/ixgbe/ixgbe_82598.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_82598.c Mon Jan 30 15:09:03 2012 (r230774) +++ head/sys/dev/ixgbe/ixgbe_82598.c Mon Jan 30 16:42:02 2012 (r230775) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -33,46 +33,33 @@ /*$FreeBSD$*/ #include "ixgbe_type.h" +#include "ixgbe_82598.h" #include "ixgbe_api.h" #include "ixgbe_common.h" #include "ixgbe_phy.h" -u32 ixgbe_get_pcie_msix_count_82598(struct ixgbe_hw *hw); -s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw); static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, - ixgbe_link_speed *speed, - bool *autoneg); + ixgbe_link_speed *speed, + bool *autoneg); static enum ixgbe_media_type ixgbe_get_media_type_82598(struct ixgbe_hw *hw); -s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num); static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw, - bool autoneg_wait_to_complete); + bool autoneg_wait_to_complete); static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, - ixgbe_link_speed *speed, bool *link_up, - bool link_up_wait_to_complete); + ixgbe_link_speed *speed, bool *link_up, + bool link_up_wait_to_complete); static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, - ixgbe_link_speed speed, - bool autoneg, - bool autoneg_wait_to_complete); + ixgbe_link_speed speed, + bool autoneg, + bool autoneg_wait_to_complete); static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw, - ixgbe_link_speed speed, - bool autoneg, - bool autoneg_wait_to_complete); + ixgbe_link_speed speed, + bool autoneg, + bool autoneg_wait_to_complete); static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw); -s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw); -void ixgbe_enable_relaxed_ordering_82598(struct ixgbe_hw *hw); -s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq); static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq); -s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, - u32 vind, bool vlan_on); static s32 ixgbe_clear_vfta_82598(struct ixgbe_hw *hw); -s32 ixgbe_read_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 *val); -s32 ixgbe_write_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 val); -s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset, - u8 *eeprom_data); -u32 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw); -s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw); -void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw); -void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw); +static void ixgbe_set_rxpba_82598(struct ixgbe_hw *hw, int num_pb, + u32 headroom, int strategy); /** * ixgbe_set_pcie_completion_timeout - set pci-e completion timeout @@ -131,7 +118,7 @@ u32 ixgbe_get_pcie_msix_count_82598(stru if (hw->mac.msix_vectors_from_pcie) { msix_count = IXGBE_READ_PCIE_WORD(hw, - IXGBE_PCIE_MSIX_82598_CAPS); + IXGBE_PCIE_MSIX_82598_CAPS); msix_count &= IXGBE_PCIE_MSIX_TBL_SZ_MASK; /* MSI-X count is zero-based in HW, so increment to give @@ -168,7 +155,7 @@ s32 ixgbe_init_ops_82598(struct ixgbe_hw mac->ops.reset_hw = &ixgbe_reset_hw_82598; mac->ops.get_media_type = &ixgbe_get_media_type_82598; mac->ops.get_supported_physical_layer = - &ixgbe_get_supported_physical_layer_82598; + &ixgbe_get_supported_physical_layer_82598; mac->ops.read_analog_reg8 = &ixgbe_read_analog_reg8_82598; mac->ops.write_analog_reg8 = &ixgbe_write_analog_reg8_82598; mac->ops.set_lan_id = &ixgbe_set_lan_id_multi_port_pcie_82598; @@ -177,18 +164,19 @@ s32 ixgbe_init_ops_82598(struct ixgbe_hw mac->ops.set_vmdq = &ixgbe_set_vmdq_82598; mac->ops.clear_vmdq = &ixgbe_clear_vmdq_82598; mac->ops.set_vfta = &ixgbe_set_vfta_82598; + mac->ops.set_vlvf = NULL; mac->ops.clear_vfta = &ixgbe_clear_vfta_82598; /* Flow Control */ mac->ops.fc_enable = &ixgbe_fc_enable_82598; - mac->mcft_size = 128; - mac->vft_size = 128; - mac->num_rar_entries = 16; - mac->rx_pb_size = 512; - mac->max_tx_queues = 32; - mac->max_rx_queues = 64; - mac->max_msix_vectors = ixgbe_get_pcie_msix_count_82598(hw); + mac->mcft_size = 128; + mac->vft_size = 128; + mac->num_rar_entries = 16; + mac->rx_pb_size = 512; + mac->max_tx_queues = 32; + mac->max_rx_queues = 64; + mac->max_msix_vectors = ixgbe_get_pcie_msix_count_82598(hw); /* SFP+ Module */ phy->ops.read_i2c_eeprom = &ixgbe_read_i2c_eeprom_82598; @@ -197,8 +185,11 @@ s32 ixgbe_init_ops_82598(struct ixgbe_hw mac->ops.check_link = &ixgbe_check_mac_link_82598; mac->ops.setup_link = &ixgbe_setup_mac_link_82598; mac->ops.flap_tx_laser = NULL; - mac->ops.get_link_capabilities = - &ixgbe_get_link_capabilities_82598; + mac->ops.get_link_capabilities = &ixgbe_get_link_capabilities_82598; + mac->ops.setup_rxpba = &ixgbe_set_rxpba_82598; + + /* Manageability interface */ + mac->ops.set_fw_drv_ver = NULL; return ret_val; } @@ -228,7 +219,7 @@ s32 ixgbe_init_phy_ops_82598(struct ixgb if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) { mac->ops.setup_link = &ixgbe_setup_copper_link_82598; mac->ops.get_link_capabilities = - &ixgbe_get_copper_link_capabilities_generic; + &ixgbe_get_copper_link_capabilities_generic; } switch (hw->phy.type) { @@ -236,11 +227,7 @@ s32 ixgbe_init_phy_ops_82598(struct ixgb phy->ops.setup_link = &ixgbe_setup_phy_link_tnx; phy->ops.check_link = &ixgbe_check_phy_link_tnx; phy->ops.get_firmware_version = - &ixgbe_get_phy_firmware_version_tnx; - break; - case ixgbe_phy_aq: - phy->ops.get_firmware_version = - &ixgbe_get_phy_firmware_version_generic; + &ixgbe_get_phy_firmware_version_tnx; break; case ixgbe_phy_nl: phy->ops.reset = &ixgbe_reset_phy_nl; @@ -256,8 +243,8 @@ s32 ixgbe_init_phy_ops_82598(struct ixgb /* Check to see if SFP+ module is supported */ ret_val = ixgbe_get_sfp_init_sequence_offsets(hw, - &list_offset, - &data_offset); + &list_offset, + &data_offset); if (ret_val != IXGBE_SUCCESS) { ret_val = IXGBE_ERR_SFP_NOT_SUPPORTED; goto out; @@ -301,7 +288,7 @@ s32 ixgbe_start_hw_82598(struct ixgbe_hw (i < IXGBE_DCA_MAX_QUEUES_82598)); i++) { regval = IXGBE_READ_REG(hw, IXGBE_DCA_RXCTRL(i)); regval &= ~(IXGBE_DCA_RXCTRL_DESC_WRO_EN | - IXGBE_DCA_RXCTRL_DESC_HSRO_EN); + IXGBE_DCA_RXCTRL_DESC_HSRO_EN); IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(i), regval); } @@ -321,8 +308,8 @@ s32 ixgbe_start_hw_82598(struct ixgbe_hw * Determines the link capabilities by reading the AUTOC register. **/ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, - ixgbe_link_speed *speed, - bool *autoneg) + ixgbe_link_speed *speed, + bool *autoneg) { s32 status = IXGBE_SUCCESS; u32 autoc = 0; @@ -389,7 +376,6 @@ static enum ixgbe_media_type ixgbe_get_m switch (hw->phy.type) { case ixgbe_phy_cu_unknown: case ixgbe_phy_tn: - case ixgbe_phy_aq: media_type = ixgbe_media_type_copper; goto out; default: @@ -440,7 +426,6 @@ s32 ixgbe_fc_enable_82598(struct ixgbe_h u32 fctrl_reg; u32 rmcs_reg; u32 reg; - u32 rx_pba_size; u32 link_speed = 0; bool link_up; @@ -532,16 +517,13 @@ s32 ixgbe_fc_enable_82598(struct ixgbe_h /* Set up and enable Rx high/low water mark thresholds, enable XON. */ if (hw->fc.current_mode & ixgbe_fc_tx_pause) { - rx_pba_size = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(packetbuf_num)); - rx_pba_size >>= IXGBE_RXPBSIZE_SHIFT; - - reg = (rx_pba_size - hw->fc.low_water) << 6; + reg = hw->fc.low_water << 6; if (hw->fc.send_xon) reg |= IXGBE_FCRTL_XONE; IXGBE_WRITE_REG(hw, IXGBE_FCRTL(packetbuf_num), reg); - reg = (rx_pba_size - hw->fc.high_water) << 6; + reg = hw->fc.high_water[packetbuf_num] << 6; reg |= IXGBE_FCRTH_FCEN; IXGBE_WRITE_REG(hw, IXGBE_FCRTH(packetbuf_num), reg); @@ -569,7 +551,7 @@ out: * Restarts the link. Performs autonegotiation if needed. **/ static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw, - bool autoneg_wait_to_complete) + bool autoneg_wait_to_complete) { u32 autoc_reg; u32 links_reg; @@ -627,7 +609,7 @@ static s32 ixgbe_validate_link_ready(str for (timeout = 0; timeout < IXGBE_VALIDATE_LINK_READY_TIMEOUT; timeout++) { hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &an_reg); + IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &an_reg); if ((an_reg & IXGBE_MII_AUTONEG_COMPLETE) && (an_reg & IXGBE_MII_AUTONEG_LINK_UP)) @@ -654,8 +636,8 @@ static s32 ixgbe_validate_link_ready(str * Reads the links register to determine if link is up and the current speed **/ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, - ixgbe_link_speed *speed, bool *link_up, - bool link_up_wait_to_complete) + ixgbe_link_speed *speed, bool *link_up, + bool link_up_wait_to_complete) { u32 links_reg; u32 i; @@ -673,7 +655,7 @@ static s32 ixgbe_check_mac_link_82598(st hw->phy.ops.read_reg(hw, 0xC79F, IXGBE_TWINAX_DEV, &link_reg); hw->phy.ops.read_reg(hw, 0xC79F, IXGBE_TWINAX_DEV, &link_reg); hw->phy.ops.read_reg(hw, 0xC00C, IXGBE_TWINAX_DEV, - &adapt_comp_reg); + &adapt_comp_reg); if (link_up_wait_to_complete) { for (i = 0; i < IXGBE_LINK_UP_TIME; i++) { if ((link_reg & 1) && @@ -685,11 +667,11 @@ static s32 ixgbe_check_mac_link_82598(st } msec_delay(100); hw->phy.ops.read_reg(hw, 0xC79F, - IXGBE_TWINAX_DEV, - &link_reg); + IXGBE_TWINAX_DEV, + &link_reg); hw->phy.ops.read_reg(hw, 0xC00C, - IXGBE_TWINAX_DEV, - &adapt_comp_reg); + IXGBE_TWINAX_DEV, + &adapt_comp_reg); } } else { if ((link_reg & 1) && ((adapt_comp_reg & 1) == 0)) @@ -730,11 +712,6 @@ static s32 ixgbe_check_mac_link_82598(st (ixgbe_validate_link_ready(hw) != IXGBE_SUCCESS)) *link_up = FALSE; - /* if link is down, zero out the current_mode */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 18:28:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63DD31065670; Mon, 30 Jan 2012 18:28:57 +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 52AF48FC0C; Mon, 30 Jan 2012 18:28:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UISvvp097258; Mon, 30 Jan 2012 18:28:57 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UISvhb097256; Mon, 30 Jan 2012 18:28:57 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201201301828.q0UISvhb097256@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 30 Jan 2012 18: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: r230777 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 18:28:57 -0000 Author: jkim Date: Mon Jan 30 18:28:56 2012 New Revision: 230777 URL: http://svn.freebsd.org/changeset/base/230777 Log: Naturally align a newly added wakeup_fpusave. Modified: head/sys/amd64/acpica/acpi_wakecode.S Modified: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- head/sys/amd64/acpica/acpi_wakecode.S Mon Jan 30 17:17:31 2012 (r230776) +++ head/sys/amd64/acpica/acpi_wakecode.S Mon Jan 30 18:28:56 2012 (r230777) @@ -267,11 +267,11 @@ wakeup_ctx: .quad 0 wakeup_pcb: .quad 0 +wakeup_fpusave: + .quad 0 wakeup_gdt: .word 0 .quad 0 -wakeup_fpusave: - .quad 0 ALIGN_DATA wakeup_efer: From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 18:44:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFCA21065670; Mon, 30 Jan 2012 18:44:25 +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 8D21A8FC12; Mon, 30 Jan 2012 18:44:25 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 2598E46B0D; Mon, 30 Jan 2012 13:44:25 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8F24AB99F; Mon, 30 Jan 2012 13:44:24 -0500 (EST) From: John Baldwin To: Marius Strobl Date: Mon, 30 Jan 2012 09:32:06 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <200906091426.n59EQNRC074046@svn.freebsd.org> <20120129154124.GB18227@alchemy.franken.de> In-Reply-To: <20120129154124.GB18227@alchemy.franken.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201201300932.06243.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 30 Jan 2012 13:44:24 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193833 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 18:44:26 -0000 On Sunday, January 29, 2012 10:41:24 am Marius Strobl wrote: > On Tue, Jun 09, 2009 at 02:26:23PM +0000, John Baldwin wrote: > > Author: jhb > > Date: Tue Jun 9 14:26:23 2009 > > New Revision: 193833 > > URL: http://svn.freebsd.org/changeset/base/193833 > > > > Log: > > Add support for multiple passes of the device tree during the boot-time > > probe. The current device order is unchanged. This commit just adds the > > infrastructure and ABI changes so that it is easier to merge later changes > > into 8.x. > > - Driver attachments now have an associated pass level. Attachments are > > not allowed to probe or attach to drivers until the system-wide pass level > > is >= the attachment's pass level. By default driver attachments use the > > "last" pass level (BUS_PASS_DEFAULT). Driver's that wish to probe during > > an earlier pass use EARLY_DRIVER_MODULE() instead of DRIVER_MODULE() which > > accepts the pass level as an additional parameter. > > - A new method BUS_NEW_PASS has been added to the bus interface. This > > method is invoked when the system-wide pass level is changed to kick off > > a rescan of the device tree so that drivers that have just been made > > "eligible" can probe and attach. > > - The bus_generic_new_pass() function provides a default implementation of > > BUS_NEW_PASS(). It first allows drivers that were just made eligible for > > this pass to identify new child devices. Then it propogates the rescan to > > child devices that already have an attached driver by invoking their > > BUS_NEW_PASS() method. It also reprobes devices without a driver. > > - BUS_PROBE_NOMATCH() is only invoked for devices that do not have > > an attached driver after being scanned during the final pass. > > - The bus_set_pass() function is used during boot to raise the pass level. > > Currently it is only called once during root_bus_configure() to raise > > the pass level to BUS_PASS_DEFAULT. This has the effect of probing all > > devices in a single pass identical to previous behavior. > > > > Reviewed by: imp > > Approved by: re (kib) > > > > What would be necessary to finally enable support for multi-pass > probing apart from the drivers also needing to set BUS_PASS_n if > they want to take part earlier than BUS_PASS_DEFAULT)? My > understanding is that this is should be as simple as changing > root_bus_configure() to return BUS_PASS_ROOT instead of > BUS_PASS_DEFAULT but the comment above that line actually talks > about splitting the return value (?) up somehow ... It will already work now without needing any changes. I have some older patches to make x86 probe ACPI and PCI busses and bridges early and they required no changes to the root bus. The reason for the comment is that I eventually imagine the multiple passes being split up so that we can do other actions after various passes are complete. For example, we might rewrite root_bus_configure() so that it looks something like: void root_bus_configure(void) { /* Enumerate the device tree and reserve static resources. */ bus_set_pass(BUS_PASS_RESOURCE); /* * Now scan devices to allocate dynamic resources, possibly * rewriting BARs, etc. */ /* some code that doesn't exist yet */ /* Now probe interrupt controllers. */ bus_set_pass(BUS_PASS_INTERRUPT); /* Now kick off interrupt routing via some new bus method. */ /* not written yet */ /* Finish probing everything else. */ bus_set_pass(BUS_PASS_DEFAULT); } This works because bus_set_pass() will do multiple scans of the tree, one per configured pass level, to raise the system's pass level up to the requested level. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 19:05:18 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1D3E106566C; Mon, 30 Jan 2012 19:05:18 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id 4D44A8FC16; Mon, 30 Jan 2012 19:05:17 +0000 (UTC) Received: from [192.168.0.2] (cpc1-cwma8-2-0-cust257.7-3.cable.virginmedia.com [82.20.153.2]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id q0UJ5Go1003483 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 30 Jan 2012 19:05:17 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: <20120118190714.GA13375@zim.MIT.EDU> Date: Mon, 30 Jan 2012 19:05:11 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <318F6CAA-D37E-49E9-A147-E21DE803EFB7@FreeBSD.org> References: <201111201445.pAKEjgNR096676@svn.freebsd.org> <20120118190714.GA13375@zim.MIT.EDU> To: David Schultz X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r227753 - in head: contrib/gdtoa include lib/libc/gdtoa lib/libc/gen lib/libc/locale lib/libc/regex lib/libc/stdio lib/libc/stdlib lib/libc/stdtime lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 19:05:18 -0000 On 18 Jan 2012, at 19:07, David Schultz wrote: > This patch appears to cause a large performance regression. For > example, I measured a 78% slowdown for strtol(" 42", ...). That's definitely worth taking a closer look at. I think we can cache = some things in TLS and avoid some pthread_getspecific calls. The = current code is the 'make it work' version. The 'make it fast' version = is planned... > Furthermore, the resulting static binary for a trivial program > goes from 7k to 303k, due to pulling in malloc, stdio, and all the > pthread stubs. =20 That's not ideal, but I'm not sure if it's avoidable. Is statically = linking libc something people regularly do? > Presumably the capabilities of the non-xlocale > entry points aren't appreciably changed, Well... actually they are. All of them now use the per-thread locale if = one is set, and only fall back to the global one if it isn't. The = behaviour is only unchanged if nothing in the program calls uselocale(). > so there ought to be a > way to avoid the overhead for them. Do you have any thoughts on this? Yup. A quick-and-dirty hack would be to add a flag that was set on the = first call to uselocale() and to always use the global locale if this is = not set. That should remove a lot of the overhead in cases where no one = uses the per-thread locales. =20 We can also probably store the locale in TLS, which (on platforms with = fast TLS) should speed up the lookup a bit. =20 > Some more minor issues... >=20 > It's also customary to document public APIs so that, for > instance, `man printf_l' pulls up a page with the prototype, > required #includes, and behavior. Aliasing manpages with > MLINKS as appropriate is fine; for instance, Darwin's manpages > on these functions look like a good example to follow. Yup, all of the foo_l manpages are missing. They're on my TODO, unless = any docs people want to get there first... > Finally, I'm not usually one to be picky about style, but could > you make a pass to clean things up a little bit to match the > surrounding code, wrap multiline comments to 80 columns, etc? > You've also added new copyright notices for one-line changes > (e.g., stdio/vdprintf.c, gdtoa/machdep_ldis?.c) and multiple > copyright notices in the same file (locale/collate.c), which > could be cleaned up concurrently. I'll take a look. David= From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 19:07:04 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D931C106564A; Mon, 30 Jan 2012 19:07:04 +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 A6AF28FC0A; Mon, 30 Jan 2012 19:07:04 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0UJ73j1044841; Mon, 30 Jan 2012 14:07:03 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0UJ73xx044840; Mon, 30 Jan 2012 14:07:03 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Mon, 30 Jan 2012 14:07:03 -0500 From: David Schultz To: Kostik Belousov Message-ID: <20120130190703.GA44663@zim.MIT.EDU> Mail-Followup-To: Kostik Belousov , Bruce Evans , Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <20120126233110.C960@besplex.bde.org> <20120126153641.GA68112@FreeBSD.org> <20120127194612.H1547@besplex.bde.org> <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> <20120127194221.GA25723@zim.MIT.EDU> <20120128123748.GD2726@deviant.kiev.zoral.com.ua> <20120129001225.GA32220@zim.MIT.EDU> <20120129062327.GK2726@deviant.kiev.zoral.com.ua> <20120129223904.GA37483@zim.MIT.EDU> <20120130063034.GU2726@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120130063034.GU2726@deviant.kiev.zoral.com.ua> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Gleb Smirnoff , src-committers@FreeBSD.ORG, Bruce Evans Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 19:07:04 -0000 On Mon, Jan 30, 2012, Kostik Belousov wrote: > On Sun, Jan 29, 2012 at 05:39:04PM -0500, David Schultz wrote: > > On Sun, Jan 29, 2012, Kostik Belousov wrote: > > > On Sat, Jan 28, 2012 at 07:12:25PM -0500, David Schultz wrote: > > > > On Sat, Jan 28, 2012, Kostik Belousov wrote: > > > > > On Fri, Jan 27, 2012 at 02:42:21PM -0500, David Schultz wrote: > > > > > > The correct limit on the maximum size of a single read/write is > > > > > > SSIZE_MAX, but FreeBSD uses INT_MAX. It's not safe to raise the > > > > > > limit yet, though, because of bugs in several filesystems. For > > > > > > example, FFS copies uio_resid into a local variable of type int. > > > > > > I have some old patches that fix some of these issues for FFS and > > > > > > cd9660, but surely there are more places I didn't notice. > > > > > > > > > > > Absolutely agree. > > > > > > > > > > http://people.freebsd.org/~kib/misc/uio_resid.5.patch > > > > > > > > Nice. You found a lot more than I've got in my tree, and you even > > > > fixed the return values. There are at least a few more places to > > > > fix. For instance, cd9660 and the NFS client pass uio_resid or > > > > iov_len to min(), which operates on ints. (Incidentally, C11 > > > > generics ought to make it possible to write type-generic min() > > > > and max() functions.) > > > > > > Thank you, http://people.freebsd.org/~kib/misc/uio_resid.6.patch > > > changed them to MIN(). > > > > This looks good to me. I tried to think of other places that you > > might have missed, and the only one that occurred to me is the > Might ? I think this is a blatant understate. > > > pipe code. sys_pipe.c has an `int orig_resid' and lots of bogus > > casts of iov_len and uio_resid to type u_int. Some look harmless, > > although it appears that writing a multiple of 2^32 bytes might > > result in pipe_build_write_buffer() allocating a 0-length buffer. > > > > My only reservation is that raising the limit could unmask a > > kernel buffer overflow if we missed something, but I guess we have > > to cross that bridge some day anyway. > Yes, and it is an obvious reason why I am chicken to commit this for > so long time. One more place, if this is reasonable to count as 'one' > place, are the cdevsw methods. devfs passes uio down to the drivers. That's why I'm glad I'm not committing it. :) A more conservative change (also known as "kicking the can down the road") would be to add a VFS flag, e.g., VFCF_LONGIO, and only set it on file systems that have been thoroughly reviewed. The VFS layer could cap the size at INT_MAX for file systems without the flag. > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c > index 9edcb74..332ec37 100644 > --- a/sys/kern/sys_pipe.c > +++ b/sys/kern/sys_pipe.c [...] > @@ -757,14 +757,14 @@ pipe_build_write_buffer(wpipe, uio) > struct pipe *wpipe; > struct uio *uio; > { > - u_int size; > + size_t size; > int i; > > PIPE_LOCK_ASSERT(wpipe, MA_NOTOWNED); > KASSERT(wpipe->pipe_state & PIPE_DIRECTW, > ("Clone attempt on non-direct write pipe!")); > > - size = (u_int) uio->uio_iov->iov_len; > + size = uio->uio_iov->iov_len; > if (size > wpipe->pipe_buffer.size) > size = wpipe->pipe_buffer.size; The transfer can't be bigger than the max pipe buffer size (64k), so `size = (int)MIN(uio->uio_iov->iov_len, wpipe->pipe_buffer.size)' should suffice. The same comment applies elsewhere in the file. From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 19:19:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15D01106564A; Mon, 30 Jan 2012 19:19:23 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0450A8FC1F; Mon, 30 Jan 2012 19:19:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UJJMxF098784; Mon, 30 Jan 2012 19:19:22 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UJJMKk098781; Mon, 30 Jan 2012 19:19:22 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <201201301919.q0UJJMKk098781@svn.freebsd.org> From: Doug Ambrisko Date: Mon, 30 Jan 2012 19:19: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: r230778 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 19:19:23 -0000 Author: ambrisko Date: Mon Jan 30 19:19:22 2012 New Revision: 230778 URL: http://svn.freebsd.org/changeset/base/230778 Log: When detaching an AIO or LIO requests grab the lock and tell knlist_remove that we have the lock now. This cleans up a locking panic ASSERT when knlist_empty is called without a lock when INVARIANTS etc. are turned. Reviewed by: kib jhb MFC after: 1 week Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Mon Jan 30 18:28:56 2012 (r230777) +++ head/sys/kern/vfs_aio.c Mon Jan 30 19:19:22 2012 (r230778) @@ -2535,10 +2535,13 @@ filt_aioattach(struct knote *kn) static void filt_aiodetach(struct knote *kn) { - struct aiocblist *aiocbe = kn->kn_ptr.p_aio; + struct knlist *knl; - if (!knlist_empty(&aiocbe->klist)) - knlist_remove(&aiocbe->klist, kn, 0); + knl = &kn->kn_ptr.p_aio->klist; + knl->kl_lock(knl->kl_lockarg); + if (!knlist_empty(knl)) + knlist_remove(knl, kn, 1); + knl->kl_unlock(knl->kl_lockarg); } /* kqueue filter function */ @@ -2580,10 +2583,13 @@ filt_lioattach(struct knote *kn) static void filt_liodetach(struct knote *kn) { - struct aioliojob * lj = kn->kn_ptr.p_lio; + struct knlist *knl; - if (!knlist_empty(&lj->klist)) - knlist_remove(&lj->klist, kn, 0); + knl = &kn->kn_ptr.p_lio->klist; + knl->kl_lock(knl->kl_lockarg); + if (!knlist_empty(knl)) + knlist_remove(knl, kn, 1); + knl->kl_unlock(knl->kl_lockarg); } /* kqueue filter function */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 19:31:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CAEB106566B; Mon, 30 Jan 2012 19:31:18 +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 1BA9B8FC0A; Mon, 30 Jan 2012 19:31:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UJVHf0099194; Mon, 30 Jan 2012 19:31:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UJVHw1099192; Mon, 30 Jan 2012 19:31:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201301931.q0UJVHw1099192@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 30 Jan 2012 19:31: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: r230779 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 19:31:18 -0000 Author: kib Date: Mon Jan 30 19:31:17 2012 New Revision: 230779 URL: http://svn.freebsd.org/changeset/base/230779 Log: Fix build for the case of powerpc64 kernel without COMPAT_FREEBSD32. MFC after: 2 months Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Jan 30 19:19:22 2012 (r230778) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Jan 30 19:31:17 2012 (r230779) @@ -114,6 +114,7 @@ __FBSDID("$FreeBSD$"); * correct. */ +#include "opt_compat.h" #include "opt_kstack_pages.h" #include @@ -1466,7 +1467,9 @@ moea64_init(mmu_t mmu) uma_zone_set_allocf(moea64_mpvo_zone,moea64_uma_page_alloc); } +#ifdef COMPAT_FREEBSD32 elf32_nxstack = 1; +#endif moea64_initialized = TRUE; } From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 19:32:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26DE2106564A; Mon, 30 Jan 2012 19:32:34 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13B598FC12; Mon, 30 Jan 2012 19:32:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UJWXrk099266; Mon, 30 Jan 2012 19:32:33 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UJWXLo099263; Mon, 30 Jan 2012 19:32:33 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201201301932.q0UJWXLo099263@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 30 Jan 2012 19:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230780 - stable/9/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 19:32:34 -0000 Author: trociny Date: Mon Jan 30 19:32:33 2012 New Revision: 230780 URL: http://svn.freebsd.org/changeset/base/230780 Log: MFC r227839, r230146: r227839: Now kvm_getenvv() and kvm_getargv() don't need procfs(5). r230146: In kvm_argv(), the case when the supplied buffer was too short to hold the requested value was handled incorrectly, and the function retuned NULL instead of the truncated result. Fix this and also remove unnecessary check for buf != NULL, which alway retuns true. Modified: stable/9/lib/libkvm/kvm_getprocs.3 stable/9/lib/libkvm/kvm_proc.c Directory Properties: stable/9/lib/libkvm/ (props changed) Modified: stable/9/lib/libkvm/kvm_getprocs.3 ============================================================================== --- stable/9/lib/libkvm/kvm_getprocs.3 Mon Jan 30 19:31:17 2012 (r230779) +++ stable/9/lib/libkvm/kvm_getprocs.3 Mon Jan 30 19:32:33 2012 (r230780) @@ -32,7 +32,7 @@ .\" @(#)kvm_getprocs.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 27, 2003 +.Dd November 22, 2011 .Dt KVM_GETPROCS 3 .Os .Sh NAME @@ -172,10 +172,3 @@ on failure. .Xr kvm_write 3 .Sh BUGS These routines do not belong in the kvm interface. -.Pp -In order for -.Xr kvm_getenvv 3 -to function correctly, -.Xr procfs 5 -must be mounted on -.Pa /proc . Modified: stable/9/lib/libkvm/kvm_proc.c ============================================================================== --- stable/9/lib/libkvm/kvm_proc.c Mon Jan 30 19:31:17 2012 (r230779) +++ stable/9/lib/libkvm/kvm_proc.c Mon Jan 30 19:32:33 2012 (r230780) @@ -72,9 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include #include @@ -623,276 +620,16 @@ _kvm_realloc(kvm_t *kd, void *p, size_t return (np); } -#ifndef MAX -#define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - -/* - * Read in an argument vector from the user address space of process kp. - * addr if the user-space base address of narg null-terminated contiguous - * strings. This is used to read in both the command arguments and - * environment strings. Read at most maxcnt characters of strings. - */ -static char ** -kvm_argv(kvm_t *kd, const struct kinfo_proc *kp, u_long addr, int narg, - int maxcnt) -{ - char *np, *cp, *ep, *ap; - u_long oaddr = -1; - int len, cc; - char **argv; - - /* - * Check that there aren't an unreasonable number of arguments, - * and that the address is in user space. Special test for - * VM_MIN_ADDRESS as it evaluates to zero, but is not a simple zero - * constant for some archs. We cannot use the pre-processor here and - * for some archs the compiler would trigger a signedness warning. - */ - if (narg > 512 || addr + 1 < VM_MIN_ADDRESS + 1 || addr >= VM_MAXUSER_ADDRESS) - return (0); - - /* - * kd->argv : work space for fetching the strings from the target - * process's space, and is converted for returning to caller - */ - if (kd->argv == 0) { - /* - * Try to avoid reallocs. - */ - kd->argc = MAX(narg + 1, 32); - kd->argv = (char **)_kvm_malloc(kd, kd->argc * - sizeof(*kd->argv)); - if (kd->argv == 0) - return (0); - } else if (narg + 1 > kd->argc) { - kd->argc = MAX(2 * kd->argc, narg + 1); - kd->argv = (char **)_kvm_realloc(kd, kd->argv, kd->argc * - sizeof(*kd->argv)); - if (kd->argv == 0) - return (0); - } - /* - * kd->argspc : returned to user, this is where the kd->argv - * arrays are left pointing to the collected strings. - */ - if (kd->argspc == 0) { - kd->argspc = (char *)_kvm_malloc(kd, PAGE_SIZE); - if (kd->argspc == 0) - return (0); - kd->arglen = PAGE_SIZE; - } - /* - * kd->argbuf : used to pull in pages from the target process. - * the strings are copied out of here. - */ - if (kd->argbuf == 0) { - kd->argbuf = (char *)_kvm_malloc(kd, PAGE_SIZE); - if (kd->argbuf == 0) - return (0); - } - - /* Pull in the target process'es argv vector */ - cc = sizeof(char *) * narg; - if (kvm_uread(kd, kp, addr, (char *)kd->argv, cc) != cc) - return (0); - /* - * ap : saved start address of string we're working on in kd->argspc - * np : pointer to next place to write in kd->argspc - * len: length of data in kd->argspc - * argv: pointer to the argv vector that we are hunting around the - * target process space for, and converting to addresses in - * our address space (kd->argspc). - */ - ap = np = kd->argspc; - argv = kd->argv; - len = 0; - /* - * Loop over pages, filling in the argument vector. - * Note that the argv strings could be pointing *anywhere* in - * the user address space and are no longer contiguous. - * Note that *argv is modified when we are going to fetch a string - * that crosses a page boundary. We copy the next part of the string - * into to "np" and eventually convert the pointer. - */ - while (argv < kd->argv + narg && *argv != 0) { - - /* get the address that the current argv string is on */ - addr = (u_long)*argv & ~(PAGE_SIZE - 1); - - /* is it the same page as the last one? */ - if (addr != oaddr) { - if (kvm_uread(kd, kp, addr, kd->argbuf, PAGE_SIZE) != - PAGE_SIZE) - return (0); - oaddr = addr; - } - - /* offset within the page... kd->argbuf */ - addr = (u_long)*argv & (PAGE_SIZE - 1); - - /* cp = start of string, cc = count of chars in this chunk */ - cp = kd->argbuf + addr; - cc = PAGE_SIZE - addr; - - /* dont get more than asked for by user process */ - if (maxcnt > 0 && cc > maxcnt - len) - cc = maxcnt - len; - - /* pointer to end of string if we found it in this page */ - ep = memchr(cp, '\0', cc); - if (ep != 0) - cc = ep - cp + 1; - /* - * at this point, cc is the count of the chars that we are - * going to retrieve this time. we may or may not have found - * the end of it. (ep points to the null if the end is known) - */ - - /* will we exceed the malloc/realloced buffer? */ - if (len + cc > kd->arglen) { - int off; - char **pp; - char *op = kd->argspc; - - kd->arglen *= 2; - kd->argspc = (char *)_kvm_realloc(kd, kd->argspc, - kd->arglen); - if (kd->argspc == 0) - return (0); - /* - * Adjust argv pointers in case realloc moved - * the string space. - */ - off = kd->argspc - op; - for (pp = kd->argv; pp < argv; pp++) - *pp += off; - ap += off; - np += off; - } - /* np = where to put the next part of the string in kd->argspc*/ - /* np is kinda redundant.. could use "kd->argspc + len" */ - memcpy(np, cp, cc); - np += cc; /* inc counters */ - len += cc; - - /* - * if end of string found, set the *argv pointer to the - * saved beginning of string, and advance. argv points to - * somewhere in kd->argv.. This is initially relative - * to the target process, but when we close it off, we set - * it to point in our address space. - */ - if (ep != 0) { - *argv++ = ap; - ap = np; - } else { - /* update the address relative to the target process */ - *argv += cc; - } - - if (maxcnt > 0 && len >= maxcnt) { - /* - * We're stopping prematurely. Terminate the - * current string. - */ - if (ep == 0) { - *np = '\0'; - *argv++ = ap; - } - break; - } - } - /* Make sure argv is terminated. */ - *argv = 0; - return (kd->argv); -} - -static void -ps_str_a(struct ps_strings *p, u_long *addr, int *n) -{ - *addr = (u_long)p->ps_argvstr; - *n = p->ps_nargvstr; -} - -static void -ps_str_e (struct ps_strings *p, u_long *addr, int *n) -{ - *addr = (u_long)p->ps_envstr; - *n = p->ps_nenvstr; -} - /* - * Determine if the proc indicated by p is still active. - * This test is not 100% foolproof in theory, but chances of - * being wrong are very low. + * Get the command args or environment. */ -static int -proc_verify(const struct kinfo_proc *curkp) -{ - struct kinfo_proc newkp; - int mib[4]; - size_t len; - - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_PID; - mib[3] = curkp->ki_pid; - len = sizeof(newkp); - if (sysctl(mib, 4, &newkp, &len, NULL, 0) == -1) - return (0); - return (curkp->ki_pid == newkp.ki_pid && - (newkp.ki_stat != SZOMB || curkp->ki_stat == SZOMB)); -} - static char ** -kvm_doargv(kvm_t *kd, const struct kinfo_proc *kp, int nchr, - void (*info)(struct ps_strings *, u_long *, int *)) -{ - char **ap; - u_long addr; - int cnt; - static struct ps_strings arginfo; - static u_long ps_strings; - size_t len; - - if (ps_strings == 0) { - len = sizeof(ps_strings); - if (sysctlbyname("kern.ps_strings", &ps_strings, &len, NULL, - 0) == -1) - ps_strings = PS_STRINGS; - } - - /* - * Pointers are stored at the top of the user stack. - */ - if (kp->ki_stat == SZOMB || - kvm_uread(kd, kp, ps_strings, (char *)&arginfo, - sizeof(arginfo)) != sizeof(arginfo)) - return (0); - - (*info)(&arginfo, &addr, &cnt); - if (cnt == 0) - return (0); - ap = kvm_argv(kd, kp, addr, cnt, nchr); - /* - * For live kernels, make sure this process didn't go away. - */ - if (ap != 0 && ISALIVE(kd) && !proc_verify(kp)) - ap = 0; - return (ap); -} - -/* - * Get the command args. This code is now machine independent. - */ -char ** -kvm_getargv(kvm_t *kd, const struct kinfo_proc *kp, int nchr) +kvm_argv(kvm_t *kd, const struct kinfo_proc *kp, int env, int nchr) { int oid[4]; int i; size_t bufsz; - static unsigned long buflen; + static int buflen; static char *buf, *p; static char **bufp; static int argc; @@ -903,102 +640,66 @@ kvm_getargv(kvm_t *kd, const struct kinf return (0); } - if (!buflen) { - bufsz = sizeof(buflen); - i = sysctlbyname("kern.ps_arg_cache_limit", - &buflen, &bufsz, NULL, 0); - if (i == -1) { - buflen = 0; - } else { - buf = malloc(buflen); - if (buf == NULL) - buflen = 0; - argc = 32; - bufp = malloc(sizeof(char *) * argc); - } - } - if (buf != NULL) { - oid[0] = CTL_KERN; - oid[1] = KERN_PROC; - oid[2] = KERN_PROC_ARGS; - oid[3] = kp->ki_pid; - bufsz = buflen; - i = sysctl(oid, 4, buf, &bufsz, 0, 0); - if (i == 0 && bufsz > 0) { - i = 0; - p = buf; - do { - bufp[i++] = p; - p += strlen(p) + 1; - if (i >= argc) { - argc += argc; - bufp = realloc(bufp, - sizeof(char *) * argc); - } - } while (p < buf + bufsz); - bufp[i++] = 0; - return (bufp); - } + if (nchr == 0 || nchr > ARG_MAX) + nchr = ARG_MAX; + if (buflen == 0) { + buf = malloc(nchr); + if (buf == NULL) { + _kvm_err(kd, kd->program, "cannot allocate memory"); + return (0); + } + buflen = nchr; + argc = 32; + bufp = malloc(sizeof(char *) * argc); + } else if (nchr > buflen) { + p = realloc(buf, nchr); + if (p != NULL) { + buf = p; + buflen = nchr; + } + } + oid[0] = CTL_KERN; + oid[1] = KERN_PROC; + oid[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; + oid[3] = kp->ki_pid; + bufsz = buflen; + if (sysctl(oid, 4, buf, &bufsz, 0, 0) == -1) { + /* + * If the supplied buf is too short to hold the requested + * value the sysctl returns with ENOMEM. The buf is filled + * with the truncated value and the returned bufsz is equal + * to the requested len. + */ + if (errno != ENOMEM || bufsz != (size_t)buflen) + return (0); + buf[bufsz - 1] = '\0'; + errno = 0; + } else if (bufsz == 0) { + return (0); } - if (kp->ki_flag & P_SYSTEM) - return (NULL); - return (kvm_doargv(kd, kp, nchr, ps_str_a)); + i = 0; + p = buf; + do { + bufp[i++] = p; + p += strlen(p) + 1; + if (i >= argc) { + argc += argc; + bufp = realloc(bufp, + sizeof(char *) * argc); + } + } while (p < buf + bufsz); + bufp[i++] = 0; + return (bufp); } char ** -kvm_getenvv(kvm_t *kd, const struct kinfo_proc *kp, int nchr) +kvm_getargv(kvm_t *kd, const struct kinfo_proc *kp, int nchr) { - return (kvm_doargv(kd, kp, nchr, ps_str_e)); + return (kvm_argv(kd, kp, 0, nchr)); } -/* - * Read from user space. The user context is given by p. - */ -ssize_t -kvm_uread(kvm_t *kd, const struct kinfo_proc *kp, u_long uva, char *buf, - size_t len) +char ** +kvm_getenvv(kvm_t *kd, const struct kinfo_proc *kp, int nchr) { - char *cp; - char procfile[MAXPATHLEN]; - ssize_t amount; - int fd; - - if (!ISALIVE(kd)) { - _kvm_err(kd, kd->program, - "cannot read user space from dead kernel"); - return (0); - } - - sprintf(procfile, "/proc/%d/mem", kp->ki_pid); - fd = open(procfile, O_RDONLY, 0); - if (fd < 0) { - _kvm_err(kd, kd->program, "cannot open %s", procfile); - return (0); - } - - cp = buf; - while (len > 0) { - errno = 0; - if (lseek(fd, (off_t)uva, 0) == -1 && errno != 0) { - _kvm_err(kd, kd->program, "invalid address (%lx) in %s", - uva, procfile); - break; - } - amount = read(fd, cp, len); - if (amount < 0) { - _kvm_syserr(kd, kd->program, "error reading %s", - procfile); - break; - } - if (amount == 0) { - _kvm_err(kd, kd->program, "EOF reading %s", procfile); - break; - } - cp += amount; - uva += amount; - len -= amount; - } - - close(fd); - return ((ssize_t)(cp - buf)); + return (kvm_argv(kd, kp, 1, nchr)); } From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 19:34:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0B62106566C; Mon, 30 Jan 2012 19:34:41 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B49A98FC17; Mon, 30 Jan 2012 19:34:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UJYfO3099375; Mon, 30 Jan 2012 19:34:41 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UJYfii099372; Mon, 30 Jan 2012 19:34:41 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201201301934.q0UJYfii099372@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 30 Jan 2012 19:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230781 - stable/9/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 19:34:42 -0000 Author: trociny Date: Mon Jan 30 19:34:41 2012 New Revision: 230781 URL: http://svn.freebsd.org/changeset/base/230781 Log: MFC r227840, r227846: r227840: No need in procfs(5). r227846 Remove yet another outdated note about procfs(5) being required. Spotted by: arundel Modified: stable/9/bin/ps/ps.1 stable/9/bin/ps/ps.c Directory Properties: stable/9/bin/ps/ (props changed) Modified: stable/9/bin/ps/ps.1 ============================================================================== --- stable/9/bin/ps/ps.1 Mon Jan 30 19:32:33 2012 (r230780) +++ stable/9/bin/ps/ps.1 Mon Jan 30 19:34:41 2012 (r230781) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 1, 2011 +.Dd November 22, 2011 .Dt PS 1 .Os .Sh NAME @@ -98,12 +98,6 @@ The default output format includes, for controlling terminal, state, CPU time (including both user and system time) and associated command. .Pp -The process file system (see -.Xr procfs 5 ) -should be mounted when -.Nm -is executed, otherwise not all information will be available. -.Pp The options are as follows: .Bl -tag -width indent .It Fl a @@ -682,9 +676,6 @@ attempts to automatically determine the .Bl -tag -width ".Pa /boot/kernel/kernel" -compact .It Pa /boot/kernel/kernel default system namelist -.It Pa /proc -the mount point of -.Xr procfs 5 .El .Sh SEE ALSO .Xr kill 1 , Modified: stable/9/bin/ps/ps.c ============================================================================== --- stable/9/bin/ps/ps.c Mon Jan 30 19:32:33 2012 (r230780) +++ stable/9/bin/ps/ps.c Mon Jan 30 19:34:41 2012 (r230781) @@ -132,7 +132,6 @@ struct listinfo { } l; }; -static int check_procfs(void); static int addelem_gid(struct listinfo *, const char *); static int addelem_pid(struct listinfo *, const char *); static int addelem_tty(struct listinfo *, const char *); @@ -412,14 +411,6 @@ main(int argc, char *argv[]) argv += optind; /* - * If the user specified ps -e then they want a copy of the process - * environment kvm_getenvv(3) attempts to open /proc//mem. - * Check to make sure that procfs is mounted on /proc, otherwise - * print a warning informing the user that output will be incomplete. - */ - if (needenv == 1 && check_procfs() == 0) - warnx("Process environment requires procfs(5)"); - /* * If there arguments after processing all the options, attempt * to treat them as a list of process ids. */ @@ -1317,18 +1308,6 @@ kludge_oldps_options(const char *optlist return (newopts); } -static int -check_procfs(void) -{ - struct statfs mnt; - - if (statfs("/proc", &mnt) < 0) - return (0); - if (strcmp(mnt.f_fstypename, "procfs") != 0) - return (0); - return (1); -} - static void usage(void) { From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 19:35:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C1621065677; Mon, 30 Jan 2012 19:35:16 +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 7B2D58FC19; Mon, 30 Jan 2012 19:35:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UJZGcD099428; Mon, 30 Jan 2012 19:35:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UJZGW7099426; Mon, 30 Jan 2012 19:35:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201301935.q0UJZGW7099426@svn.freebsd.org> From: John Baldwin Date: Mon, 30 Jan 2012 19:35: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: r230782 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 19:35:16 -0000 Author: jhb Date: Mon Jan 30 19:35:15 2012 New Revision: 230782 URL: http://svn.freebsd.org/changeset/base/230782 Log: Refine the implementation of POSIX_FADV_NOREUSE for the read(2) case such that instead of using direct I/O it allows read-ahead similar to POSIX_FADV_NORMAL, but invokes VOP_ADVISE(POSIX_FADV_DONTNEED) after the read(2) has completed to purge just-read data. The write(2) path continues to use direct I/O for POSIX_FADV_NOREUSE for now. Note that NOREUSE works optimally if an application reads and writes full fs blocks. Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Mon Jan 30 19:34:41 2012 (r230781) +++ head/sys/kern/vfs_vnops.c Mon Jan 30 19:35:15 2012 (r230782) @@ -519,6 +519,7 @@ vn_read(fp, uio, active_cred, flags, td) int error, ioflag; struct mtx *mtxp; int advice, vfslocked; + off_t offset; KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); @@ -558,19 +559,14 @@ vn_read(fp, uio, active_cred, flags, td) switch (advice) { case POSIX_FADV_NORMAL: case POSIX_FADV_SEQUENTIAL: + case POSIX_FADV_NOREUSE: ioflag |= sequential_heuristic(uio, fp); break; case POSIX_FADV_RANDOM: /* Disable read-ahead for random I/O. */ break; - case POSIX_FADV_NOREUSE: - /* - * Request the underlying FS to discard the buffers - * and pages after the I/O is complete. - */ - ioflag |= IO_DIRECT; - break; } + offset = uio->uio_offset; #ifdef MAC error = mac_vnode_check_read(active_cred, fp->f_cred, vp); @@ -587,6 +583,10 @@ vn_read(fp, uio, active_cred, flags, td) } fp->f_nextoff = uio->uio_offset; VOP_UNLOCK(vp, 0); + if (error == 0 && advice == POSIX_FADV_NOREUSE && + offset != uio->uio_offset) + error = VOP_ADVISE(vp, offset, uio->uio_offset - 1, + POSIX_FADV_DONTNEED); VFS_UNLOCK_GIANT(vfslocked); return (error); } From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 19:45:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 257FE1065687; Mon, 30 Jan 2012 19:45:41 +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 C97538FC08; Mon, 30 Jan 2012 19:45:40 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id D98FCC3849; Mon, 30 Jan 2012 20:27:38 +0100 (CET) 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 YgY2JXBCWTzi; Mon, 30 Jan 2012 20:27:38 +0100 (CET) Received: from [10.0.0.112] (nat3-133.ghnet.pl [91.150.222.133]) by smtp.semihalf.com (Postfix) with ESMTPSA id 28CE0C3847; Mon, 30 Jan 2012 20:27:38 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <201201271829.q0RIT4Xq051545@svn.freebsd.org> Date: Mon, 30 Jan 2012 20:27:36 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201201271829.q0RIT4Xq051545@svn.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230622 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 19:45:41 -0000 On 2012-01-27, at 19:29, Dimitry Andric wrote: > Author: dim > Date: Fri Jan 27 18:29:03 2012 > New Revision: 230622 > URL: http://svn.freebsd.org/changeset/base/230622 >=20 > Log: > When the buildkernel stage 2.3 (build tools) runs, the PATH is still = set > to the default from the top-level Makefile. Therefore, invocations = of > lex and yacc (used during building of aicasm) will use the = executables > in /usr/bin, not those optionally built during the previous = buildworld > or kernel-toolchain. This makes kernel builds from older FreeBSD > releases more difficult than necessary. >=20 > Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the > bootstrap tools directories are searched before the regular ones. Is this supposed to work for cross building as well? I'm still = encountering problems on a 7.3 host build: 1. Cross world builds fine make -j 8 buildworld TARGET_ARCH=3Darm 2. Kernel fails w/ the aicasm make buildkernel TARGET_ARCH=3Darm KERNCONF=3DSHEEVAPLUG [...] cc -O2 -pipe -nostdinc -I/usr/include -I. = -I/home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm -std=3Dgnu99 = -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter = -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type = -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter = -Wcast-align -Wno-pointer-sign -c aicasm_scan.c cc1: warnings being treated as errors /home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm/aicasm_scan.l:837: = warning: function declaration isn't a prototype *** Error code 1 Stop in = /home/raj/work/obj/arm.arm/home/raj/work/svn/base/head/sys/SHEEVAPLUG. *** Error code 1 Stop in /home/raj/work/svn/base/head. *** Error code 1 Stop in /home/raj/work/svn/base/head. Do you know any workarounds to this? Rafal From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 19:50:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 183921065673; Mon, 30 Jan 2012 19:50:14 +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 077B98FC13; Mon, 30 Jan 2012 19:50:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UJoDYT099933; Mon, 30 Jan 2012 19:50:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UJoDPb099931; Mon, 30 Jan 2012 19:50:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201301950.q0UJoDPb099931@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 30 Jan 2012 19:50: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: r230783 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 19:50:14 -0000 Author: kib Date: Mon Jan 30 19:50:13 2012 New Revision: 230783 URL: http://svn.freebsd.org/changeset/base/230783 Log: Add definition for PT_GNU_RELRO. MFC after: 3 days Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Mon Jan 30 19:35:15 2012 (r230782) +++ head/sys/sys/elf_common.h Mon Jan 30 19:50:13 2012 (r230783) @@ -328,6 +328,7 @@ typedef struct { #define PT_SUNW_UNWIND 0x6464e550 /* amd64 UNWIND program header */ #define PT_GNU_EH_FRAME 0x6474e550 #define PT_GNU_STACK 0x6474e551 +#define PT_GNU_RELRO 0x6474e552 #define PT_LOSUNW 0x6ffffffa #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ #define PT_SUNWSTACK 0x6ffffffb /* describes the stack segment */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 19:52:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00CBF106566B; Mon, 30 Jan 2012 19:52:18 +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 E3A098FC0C; Mon, 30 Jan 2012 19:52:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UJqHA7000135; Mon, 30 Jan 2012 19:52:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UJqHTs000131; Mon, 30 Jan 2012 19:52:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201301952.q0UJqHTs000131@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 30 Jan 2012 19:52: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: r230784 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 19:52:18 -0000 Author: kib Date: Mon Jan 30 19:52:17 2012 New Revision: 230784 URL: http://svn.freebsd.org/changeset/base/230784 Log: Add support for GNU RELRO. Submitted by: John Marino MFC after: 2 weeks Modified: head/libexec/rtld-elf/map_object.c head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Mon Jan 30 19:50:13 2012 (r230783) +++ head/libexec/rtld-elf/map_object.c Mon Jan 30 19:52:17 2012 (r230784) @@ -84,6 +84,8 @@ map_object(int fd, const char *path, con Elf_Addr bss_vlimit; caddr_t bss_addr; Elf_Word stack_flags; + Elf_Addr relro_page; + size_t relro_size; hdr = get_elf_header(fd, path); if (hdr == NULL) @@ -100,6 +102,8 @@ map_object(int fd, const char *path, con nsegs = -1; phdyn = phinterp = phtls = NULL; phdr_vaddr = 0; + relro_page = 0; + relro_size = 0; segs = alloca(sizeof(segs[0]) * hdr->e_phnum); stack_flags = RTLD_DEFAULT_STACK_PF_EXEC | PF_R | PF_W; while (phdr < phlimit) { @@ -134,6 +138,11 @@ map_object(int fd, const char *path, con case PT_GNU_STACK: stack_flags = phdr->p_flags; break; + + case PT_GNU_RELRO: + relro_page = phdr->p_vaddr; + relro_size = phdr->p_memsz; + break; } ++phdr; @@ -269,6 +278,9 @@ map_object(int fd, const char *path, con obj->tlsinit = mapbase + phtls->p_vaddr; } obj->stack_flags = stack_flags; + obj->relro_page = obj->relocbase + trunc_page(relro_page); + obj->relro_size = round_page(relro_size); + return obj; } Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Jan 30 19:50:13 2012 (r230783) +++ head/libexec/rtld-elf/rtld.c Mon Jan 30 19:52:17 2012 (r230784) @@ -1114,6 +1114,11 @@ digest_phdr(const Elf_Phdr *phdr, int ph case PT_GNU_STACK: obj->stack_flags = ph->p_flags; break; + + case PT_GNU_RELRO: + obj->relro_page = obj->relocbase + trunc_page(ph->p_vaddr); + obj->relro_size = round_page(ph->p_memsz); + break; } } if (nsegs < 1) { @@ -2007,6 +2012,14 @@ relocate_objects(Obj_Entry *first, bool if (reloc_jmpslots(obj, lockstate) == -1) return -1; + if (obj->relro_size > 0) { + if (mprotect(obj->relro_page, obj->relro_size, PROT_READ) == -1) { + _rtld_error("%s: Cannot enforce relro protection: %s", + obj->path, strerror(errno)); + return -1; + } + } + /* * Set up the magic number and version in the Obj_Entry. These * were checked in the crt1.o from the original ElfKit, so we Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Mon Jan 30 19:50:13 2012 (r230783) +++ head/libexec/rtld-elf/rtld.h Mon Jan 30 19:52:17 2012 (r230784) @@ -168,6 +168,9 @@ typedef struct Struct_Obj_Entry { size_t tlsoffset; /* Offset of static TLS block for this module */ size_t tlsalign; /* Alignment of static TLS block */ + caddr_t relro_page; + size_t relro_size; + /* Items from the dynamic section. */ Elf_Addr *pltgot; /* PLT or GOT, depending on architecture */ const Elf_Rel *rel; /* Relocation entries */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 20:00:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0C5C106564A; Mon, 30 Jan 2012 20:00:29 +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 BFB9E8FC08; Mon, 30 Jan 2012 20:00:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UK0Tli000441; Mon, 30 Jan 2012 20:00:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UK0TBZ000439; Mon, 30 Jan 2012 20:00:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201302000.q0UK0TBZ000439@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 30 Jan 2012 20:00: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: r230785 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 20:00:29 -0000 Author: kib Date: Mon Jan 30 20:00:29 2012 New Revision: 230785 URL: http://svn.freebsd.org/changeset/base/230785 Log: A debugger which requested PT_FOLLOW_FORK should get the notification about new child not only when doing PT_TO_SCX, but also for PT_CONTINUE. If TDB_FORK flag is set, always issue a stop, the same as is done for TDB_EXEC. Reported by: Dmitry Mikulin MFC after: 1 week Modified: head/sys/kern/subr_syscall.c Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Mon Jan 30 19:52:17 2012 (r230784) +++ head/sys/kern/subr_syscall.c Mon Jan 30 20:00:29 2012 (r230785) @@ -212,7 +212,8 @@ syscallret(struct thread *td, int error, * executes. If debugger requested tracing of syscall * returns, do it now too. */ - if (traced && ((td->td_dbgflags & TDB_EXEC) != 0 || + if (traced && + ((td->td_dbgflags & (TDB_FORK | TDB_EXEC)) != 0 || (p->p_stops & S_PT_SCX) != 0)) ptracestop(td, SIGTRAP); td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 20:08:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A37031065675; Mon, 30 Jan 2012 20:08:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6259D8FC0A; Mon, 30 Jan 2012 20:08:46 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:2059:d200:251:990d] (unknown [IPv6:2001:7b8:3a7:0:2059:d200:251:990d]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 85BD05C59; Mon, 30 Jan 2012 21:08:44 +0100 (CET) Message-ID: <4F26F8C9.3080807@FreeBSD.org> Date: Mon, 30 Jan 2012 21:08:41 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120124 Thunderbird/10.0 MIME-Version: 1.0 To: Rafal Jaworowski References: <201201271829.q0RIT4Xq051545@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: r230622 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 20:08:46 -0000 On 2012-01-30 20:27, Rafal Jaworowski wrote: ... >> Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the >> bootstrap tools directories are searched before the regular ones. > > Is this supposed to work for cross building as well? I'm still encountering problems on a 7.3 host build: > > 1. Cross world builds fine > make -j 8 buildworld TARGET_ARCH=arm > > 2. Kernel fails w/ the aicasm > make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG > [...] > cc -O2 -pipe -nostdinc -I/usr/include -I. -I/home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wno-pointer-sign -c aicasm_scan.c > cc1: warnings being treated as errors > /home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm/aicasm_scan.l:837: warning: function declaration isn't a prototype Can you please try doing "make buildenv TARGET_ARCH=arm", then run "which lex" and "which yacc"? From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 20:12:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D758106567D; Mon, 30 Jan 2012 20:12:31 +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 655888FC1A; Mon, 30 Jan 2012 20:12:31 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 1F4EF46B0C; Mon, 30 Jan 2012 15:12:31 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 95E99B915; Mon, 30 Jan 2012 15:12:30 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Date: Mon, 30 Jan 2012 15:12:30 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201301935.q0UJZGW7099426@svn.freebsd.org> In-Reply-To: <201201301935.q0UJZGW7099426@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201301512.30116.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 30 Jan 2012 15:12:30 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230782 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 20:12:31 -0000 On Monday, January 30, 2012 2:35:16 pm John Baldwin wrote: > Author: jhb > Date: Mon Jan 30 19:35:15 2012 > New Revision: 230782 > URL: http://svn.freebsd.org/changeset/base/230782 > > Log: > Refine the implementation of POSIX_FADV_NOREUSE for the read(2) case such > that instead of using direct I/O it allows read-ahead similar to > POSIX_FADV_NORMAL, but invokes VOP_ADVISE(POSIX_FADV_DONTNEED) after the > read(2) has completed to purge just-read data. The write(2) path continues > to use direct I/O for POSIX_FADV_NOREUSE for now. Note that NOREUSE works > optimally if an application reads and writes full fs blocks. Oops, forgot: Tested by: jilles The NOREUSE bits may still need further refinement. For example, if we allow something along the lines of 'POSIX_FADV_NOREUSE | POSIX_FADV_SEQUENTIAL', then we could change the VOP_ADVISE() here to use 0 as the starting offset which should do a better job of not leaving data in RAM due to reading partial blocks. Also, sequentially reading a file on unaligned block offsets with NOREUSE can result in extraneous reads currently, and we could possibly alleviate those by changing DONTNEED to only flush wholly contained-blocks rather than wholly-contained pages from the backing VM object. However, without the previous change I suggested that will exacerbate the problem of NOREUSE not actually purging any data from RAM. The problem with the | approach though is that it is not portable, so it is not likely that portable programs like vlc will use it. HP/UX had an extended variant of fadvise() that allowed multiple policies to be set on a range, apparently to handle exactly this case (sequential and noreuse). The problem seems to be that noreuse is really orthogonal to the other access-pattern hints (normal vs random vs sequential). Finally, I've wondered if POSIX_FADV_SEQUENTIAL shouldn't just mandate the maximum read-ahead and write-clustering rather than using the heuristics. It's not completely clear if we did that what the "right" thing to do if an application does posix_fadvise(POSIX_FADV_SEQUENTIAL) followed by fcntl(F_READAHEAD) with a different size, esp. given that posix_fadvise() can theoretically only apply to a range of the file descriptor whereas F_READAHEAD applies globally to the file descriptor. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 20:17:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30D071065674; Mon, 30 Jan 2012 20:17:59 +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 D1D648FC14; Mon, 30 Jan 2012 20:17:58 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id ABE81C3849; Mon, 30 Jan 2012 21:17:57 +0100 (CET) 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 VUVt8U9VXcGX; Mon, 30 Jan 2012 21:17:57 +0100 (CET) Received: from [10.0.0.112] (nat3-133.ghnet.pl [91.150.222.133]) by smtp.semihalf.com (Postfix) with ESMTPSA id E0207C3847; Mon, 30 Jan 2012 21:17:56 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <4F26F8C9.3080807@FreeBSD.org> Date: Mon, 30 Jan 2012 21:17:56 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201201271829.q0RIT4Xq051545@svn.freebsd.org> <4F26F8C9.3080807@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230622 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 20:17:59 -0000 On 2012-01-30, at 21:08, Dimitry Andric wrote: > On 2012-01-30 20:27, Rafal Jaworowski wrote: > ... >>> Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the >>> bootstrap tools directories are searched before the regular ones. >>=20 >> Is this supposed to work for cross building as well? I'm still = encountering problems on a 7.3 host build: >>=20 >> 1. Cross world builds fine >> make -j 8 buildworld TARGET_ARCH=3Darm >>=20 >> 2. Kernel fails w/ the aicasm >> make buildkernel TARGET_ARCH=3Darm KERNCONF=3DSHEEVAPLUG >> [...] >> cc -O2 -pipe -nostdinc -I/usr/include -I. = -I/home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm -std=3Dgnu99 = -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter = -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type = -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter = -Wcast-align -Wno-pointer-sign -c aicasm_scan.c >> cc1: warnings being treated as errors >> = /home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm/aicasm_scan.l:837: = warning: function declaration isn't a prototype >=20 > Can you please try doing "make buildenv TARGET_ARCH=3Darm", then run > "which lex" and "which yacc"? make buildenv TARGET_ARCH=3Darm Entering world for arm:arm $ which lex = /home/raj/work/obj//arm.arm/home/raj/work/svn/base/head/tmp/legacy/usr/bin= /lex $ which yacc = /home/raj/work/obj//arm.arm/home/raj/work/svn/base/head/tmp/legacy/usr/bin= /yacc $=20 They seem freshly built (from the earlier buildworld run). Rafal From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 20:19:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F914106566C; Mon, 30 Jan 2012 20:19:29 +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 F327F8FC0A; Mon, 30 Jan 2012 20:19:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UKJSXx001421; Mon, 30 Jan 2012 20:19:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UKJSG1001419; Mon, 30 Jan 2012 20:19:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201201302019.q0UKJSG1001419@svn.freebsd.org> From: Warner Losh Date: Mon, 30 Jan 2012 20:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230786 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 20:19:29 -0000 Author: imp Date: Mon Jan 30 20:19:28 2012 New Revision: 230786 URL: http://svn.freebsd.org/changeset/base/230786 Log: Allow specification of build shell for the buildenv target. Submitted by: ian lepore Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jan 30 20:00:29 2012 (r230785) +++ head/Makefile.inc1 Mon Jan 30 20:19:28 2012 (r230786) @@ -19,6 +19,7 @@ # list # TARGET="machine" to crossbuild world for a different machine type # TARGET_ARCH= may be required when a TARGET supports multiple endians +# BUILDENV_SHELL= shell to launch for the buildenv target (def:/bin/sh) # # The intended user-driven targets are: @@ -108,6 +109,8 @@ CLEANDIR= cleandir LOCAL_TOOL_DIRS?= +BUILDENV_SHELL?=/bin/sh + CVS?= cvs CVSFLAGS?= -A -P -d -I! SVN?= svn @@ -558,7 +561,7 @@ buildenvvars: buildenv: @echo Entering world for ${TARGET_ARCH}:${TARGET} - @cd ${.CURDIR} && env ${WMAKEENV} sh || true + @cd ${.CURDIR} && env ${WMAKEENV} ${BUILDENV_SHELL} || true TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild32} toolchain: ${TOOLCHAIN_TGTS} From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 21:01:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CD771065672 for ; Mon, 30 Jan 2012 21:01:34 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from qmta07.emeryville.ca.mail.comcast.net (qmta07.emeryville.ca.mail.comcast.net [76.96.30.64]) by mx1.freebsd.org (Postfix) with ESMTP id 3F8968FC15 for ; Mon, 30 Jan 2012 21:01:33 +0000 (UTC) Received: from omta04.emeryville.ca.mail.comcast.net ([76.96.30.35]) by qmta07.emeryville.ca.mail.comcast.net with comcast id Twcf1i0060lTkoCA7woQXd; Mon, 30 Jan 2012 20:48:24 +0000 Received: from damnhippie.dyndns.org ([24.8.232.202]) by omta04.emeryville.ca.mail.comcast.net with comcast id TwoN1i01A4NgCEG8QwoPfc; Mon, 30 Jan 2012 20:48:24 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q0UKmLX0019418; Mon, 30 Jan 2012 13:48:21 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: Dimitry Andric In-Reply-To: <4F26F8C9.3080807@FreeBSD.org> References: <201201271829.q0RIT4Xq051545@svn.freebsd.org> <4F26F8C9.3080807@FreeBSD.org> Content-Type: text/plain Date: Mon, 30 Jan 2012 13:48:21 -0700 Message-Id: <1327956501.1662.13.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.26.0 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Rafal Jaworowski , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230622 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 21:01:34 -0000 On Mon, 2012-01-30 at 21:08 +0100, Dimitry Andric wrote: > On 2012-01-30 20:27, Rafal Jaworowski wrote: > ... > >> Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the > >> bootstrap tools directories are searched before the regular ones. > > > > Is this supposed to work for cross building as well? I'm still encountering problems on a 7.3 host build: > > > > 1. Cross world builds fine > > make -j 8 buildworld TARGET_ARCH=arm > > > > 2. Kernel fails w/ the aicasm > > make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG > > [...] > > cc -O2 -pipe -nostdinc -I/usr/include -I. -I/home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wno-pointer-sign -c aicasm_scan.c > > cc1: warnings being treated as errors > > /home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm/aicasm_scan.l:837: warning: function declaration isn't a prototype > > Can you please try doing "make buildenv TARGET_ARCH=arm", then run > "which lex" and "which yacc"? Shouldn't lex and yacc be listed in the Makefile.inc1 bootstrap-tools target for this to be fully effective? It looks like neither is in RELENG_7 and lex is only conditionally listed in RELENG_8. -- Ian From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 21:02:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9960106564A; Mon, 30 Jan 2012 21:02:25 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADCE18FC17; Mon, 30 Jan 2012 21:02:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UL2PjP002821; Mon, 30 Jan 2012 21:02:25 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UL2PlA002817; Mon, 30 Jan 2012 21:02:25 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201201302102.q0UL2PlA002817@svn.freebsd.org> From: Christian Brueffer Date: Mon, 30 Jan 2012 21:02: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: r230787 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 21:02:26 -0000 Author: brueffer Date: Mon Jan 30 21:02:25 2012 New Revision: 230787 URL: http://svn.freebsd.org/changeset/base/230787 Log: Manpages for the buf_ring and drbr interfaces. Submitted by: kmacy (aeons ago) MFC after: 1 week Added: head/share/man/man9/buf_ring.9 (contents, props changed) head/share/man/man9/drbr.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Jan 30 20:19:28 2012 (r230786) +++ head/share/man/man9/Makefile Mon Jan 30 21:02:25 2012 (r230787) @@ -12,6 +12,7 @@ MAN= accept_filter.9 \ boot.9 \ bpf.9 \ buf.9 \ + buf_ring.9 \ BUF_ISLOCKED.9 \ BUF_LOCK.9 \ BUF_LOCKFREE.9 \ @@ -99,6 +100,7 @@ MAN= accept_filter.9 \ devtoname.9 \ disk.9 \ domain.9 \ + drbr.9 \ driver.9 \ DRIVER_MODULE.9 \ EVENTHANDLER.9 \ @@ -410,6 +412,16 @@ MLINKS+=bpf.9 bpfattach.9 \ bpf.9 bpf_tap.9 \ bpf.9 bpf_validate.9 MLINKS+=buf.9 bp.9 +MLINKS+=buf_ring.9 buf_ring_alloc.9 \ + buf_ring.9 buf_ring_free.9 \ + buf_ring.9 buf_ring_enqueue.9 \ + buf_ring.9 buf_ring_enqueue_bytes.9 \ + buf_ring.9 buf_ring_dequeue_mc.9 \ + buf_ring.9 buf_ring_dequeue_sc.9 \ + buf_ring.9 buf_ring_count.9 \ + buf_ring.9 buf_ring_empty.9 \ + buf_ring.9 buf_ring_full.9 \ + buf_ring.9 buf_ring_peek.9 MLINKS+=bus_activate_resource.9 bus_deactivate_resource.9 MLINKS+=bus_alloc_resource.9 bus_alloc_resource_any.9 MLINKS+=BUS_BIND_INTR.9 bus_bind_intr.9 @@ -608,6 +620,14 @@ MLINKS+=domain.9 DOMAIN_SET.9 \ domain.9 pfctlinput2.9 \ domain.9 pffindproto.9 \ domain.9 pffindtype.9 +MLINKS+=drbr.9 drbr_free.9 \ + drbr.9 drbr_enqueue.9 \ + drbr.9 drbr_dequeue.9 \ + drbr.9 drbr_dequeue_cond.9 \ + drbr.9 drbr_flush.9 \ + drbr.9 drbr_empty.9 \ + drbr.9 drbr_inuse.9 \ + drbr.9 drbr_stats_update.9 MLINKS+=EVENTHANDLER.9 EVENTHANDLER_DECLARE.9 \ EVENTHANDLER.9 EVENTHANDLER_DEREGISTER.9 \ EVENTHANDLER.9 eventhandler_deregister.9 \ Added: head/share/man/man9/buf_ring.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/buf_ring.9 Mon Jan 30 21:02:25 2012 (r230787) @@ -0,0 +1,144 @@ +.\" Copyright (c) 2009 Bitgravity Inc +.\" Written by: Kip Macy +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 30, 2012 +.Dt BUF_RING 9 +.Os +.Sh NAME +.Nm buf_ring , +.Nm buf_ring_alloc , +.Nm buf_ring_free , +.Nm buf_ring_enqueue , +.Nm buf_ring_enqueue_bytes , +.Nm buf_ring_dequeue_mc , +.Nm buf_ring_dequeue_sc , +.Nm buf_ring_count , +.Nm buf_ring_empty , +.Nm buf_ring_full , +.Nm buf_ring_peek , +.Nd multi-producer, {single, multi}-consumer lock-less ring buffer +.Sh SYNOPSIS +.In sys/param.h +.In sys/buf_ring.h +.Ft struct buf_ring * +.Fn buf_ring_alloc "int count" "struct malloc_type *type" "int flags" "struct mtx *sc_lock" +.Ft void +.Fn buf_ring_free "struct buf_ring *br" "struct malloc_type *type" +.Ft int +.Fn buf_ring_enqueue "struct buf_ring *br" "void *buf" +.Ft int +.Fn buf_ring_enqueue_bytes "struct buf_ring *br" "void *buf" "int bytes" +.Ft void * +.Fn buf_ring_dequeue_mc "struct buf_ring *br" +.Ft void * +.Fn buf_ring_dequeue_sc "struct buf_ring *br" +.Ft int +.Fn buf_ring_count "struct buf_ring *br" +.Ft int +.Fn buf_ring_empty "struct buf_ring *br" +.Ft int +.Fn buf_ring_full "struct buf_ring *br" +.Ft void * +.Fn buf_ring_peek "struct buf_ring *br" +.Sh DESCRIPTION +The +.Nm +functions provide a lock-less multi-producer and lock-less multi-consumer as +well as single-consumer ring buffer. +.Pp +The +.Fn buf_ring_alloc +function is used to allocate a buf_ring ring buffer with +.Fa count +slots using malloc_type +.Fa type +and memory flags +.Fa flags . +The single consumer interface is protected by +.Fa sc_lock . +.Pp +The +.Fn buf_ring_free +function is used to free a buf_ring. +The user is responsible for freeing any enqueued items. +.Pp +The +.Fn buf_ring_enqueue +function is used to enqueue a buffer to a buf_ring. +.Pp +The +.Fn buf_ring_enqueue_bytes +function is used to enqueue a buffer to a buf_ring and increment the +number of bytes enqueued by +.Fa bytes . +.Pp +The +.Fn buf_ring_dequeue_mc +function is a multi-consumer safe way of dequeueing elements from a buf_ring. +.Pp +The +.Fn buf_ring_dequeue_sc +function is a single-consumer interface to dequeue elements - requiring +the user to serialize accesses with a lock. +.Pp +The +.Fn buf_ring_count +function returns the number of elements in a buf_ring. +.Pp +The +.Fn buf_ring_empty +function returns +.Dv TRUE +if the buf_ring is empty, +.Dv FALSE +otherwise. +.Pp +The +.Fn buf_ring_full +function returns +.Dv TRUE +if no more items can be enqueued, +.Dv FALSE +otherwise. +.Pp +The +.Fn buf_ring_peek +function returns a pointer to the last element in the buf_ring if the +buf_ring is not empty, +.Dv NULL +otherwise. +.Sh RETURN VALUES +The +.Fn buf_ring_enqueue +and +.Fn buf_ring_enqueue_bytes +functions return +.Er ENOBUFS +if there are no available slots in the buf_ring. +.Sh HISTORY +These functions were introduced in +.Fx 8.0 . Added: head/share/man/man9/drbr.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/drbr.9 Mon Jan 30 21:02:25 2012 (r230787) @@ -0,0 +1,147 @@ +.\" Copyright (c) 2009 Bitgravity Inc +.\" Written by: Kip Macy +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 30, 2012 +.Dt DRBR 9 +.Os +.Sh NAME +.Nm drbr , +.Nm drbr_free , +.Nm drbr_enqueue , +.Nm drbr_dequeue , +.Nm drbr_dequeue_cond , +.Nm drbr_flush , +.Nm drbr_empty , +.Nm drbr_inuse , +.Nm drbr_stats_update , +.Nd network driver interface to buf_ring +.Sh SYNOPSIS +.In sys/param.h +.In net/if.h +.In net/if_var.h +.Ft void +.Fn drbr_free "struct buf_ring *br" "struct malloc_type *type" +.Ft int +.Fn drbr_enqueue "struct ifnet *ifp" "struct buf_ring *br" "struct mbuf *m" +.Ft struct mbuf * +.Fn drbr_dequeue "struct ifnet *ifp" "struct buf_ring *br" +.Ft struct mbuf * +.Fn drbr_dequeue_cond "struct ifnet *ifp" "struct buf_ring *br" "int (*func) (struct mbuf *, void *)" "void *arg" +.Ft void +.Fn drbr_flush "struct ifnet *ifp" "struct buf_ring *br" +.Ft int +.Fn drbr_empty "struct ifnet *ifp" "struct buf_ring *br" +.Ft int +.Fn drbr_inuse "struct ifnet *ifp" "struct buf_ring *br" +.Ft void +.Fn drbr_stats_update "struct ifnet *ifp" "int len" "int mflags" +.Sh DESCRIPTION +The +.Nm +functions provide an API to network drivers for using +.Xr buf_ring 9 +for enqueueing and dequeueing packets. +This is meant as a replacement for the IFQ interface for packet queuing. +It allows a packet to be enqueued with a single atomic and packet +dequeue to be done without any per-packet atomics as it is protected +by the driver's tx queue lock. +If +.Dv INVARIANTS +is enabled, +.Fn drbr_dequeue +will assert that the tx queue lock is held when it is called. +.Pp +The +.Fn drbr_free +function frees all the enqueued mbufs and then frees the buf_ring. +.Pp +The +.Fn drbr_enqueue +function is used to enqueue an mbuf to a buf_ring, falling back to the +ifnet's IFQ if +.Xr ALTQ 4 +is enabled. +.Pp +The +.Fn drbr_dequeue +function is used to dequeue an mbuf from a buf_ring or, if +.Xr ALTQ 4 +is enabled, from the ifnet's IFQ. +.Pp +The +.Fn drbr_dequeue_cond +function is used to conditionally dequeue an mbuf from a buf_ring based +on whether +.Fa func +returns +.Dv TRUE +or +.Dv FALSE . +.Pp +The +.Fn drbr_flush +function frees all mbufs enqueued in the buf_ring and the ifnet's IFQ. +.Pp +The +.Fn drbr_empty +function returns +.Dv TRUE +if there are no mbufs enqueued, +.Dv FALSE +otherwise. +.Pp +The +.Fn drbr_inuse +function returns the number of mbufs enqueued. +Note to users that this is intrinsically racy as there is no guarantee that +there will not be more mbufs when +.Fn drbr_dequeue +is actually called. +Provided the tx queue lock is held there will not be less. +.Pp +The +.Fn drbr_stats_update +function updates the number of bytes and the number of multicast packets sent. +.Sh RETURN VALUES +The +.Fn drbr_enqueue +function returns +.Er ENOBUFS +if there are no slots available in the buf_ring and +.Dv 0 +on success. +.Pp +The +.Fn drbr_dequeue +and +.Fn drbr_dequeue_cond +functions return an mbuf on success and +.Dv NULL +if the buf_ring is empty. +.Sh HISTORY +These functions were introduced in +.Fx 8.0 . From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 21:26:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 602AE106566B; Mon, 30 Jan 2012 21:26:32 +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 067FA8FC13; Mon, 30 Jan 2012 21:26:31 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0ULQVH1045463; Mon, 30 Jan 2012 16:26:31 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0ULQVqc045462; Mon, 30 Jan 2012 16:26:31 -0500 (EST) (envelope-from das@freebsd.org) Date: Mon, 30 Jan 2012 16:26:31 -0500 From: David Schultz To: David Chisnall Message-ID: <20120130212631.GA45106@zim.MIT.EDU> Mail-Followup-To: David Chisnall , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111201445.pAKEjgNR096676@svn.freebsd.org> <20120118190714.GA13375@zim.MIT.EDU> <318F6CAA-D37E-49E9-A147-E21DE803EFB7@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <318F6CAA-D37E-49E9-A147-E21DE803EFB7@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227753 - in head: contrib/gdtoa include lib/libc/gdtoa lib/libc/gen lib/libc/locale lib/libc/regex lib/libc/stdio lib/libc/stdlib lib/libc/stdtime lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 21:26:32 -0000 On Mon, Jan 30, 2012, David Chisnall wrote: > On 18 Jan 2012, at 19:07, David Schultz wrote: > > > This patch appears to cause a large performance regression. For > > example, I measured a 78% slowdown for strtol(" 42", ...). > > That's definitely worth taking a closer look at. I think we can cache some things in TLS and avoid some pthread_getspecific calls. The current code is the 'make it work' version. The 'make it fast' version is planned... Sounds good; I look forward to it. > > Furthermore, the resulting static binary for a trivial program > > goes from 7k to 303k, due to pulling in malloc, stdio, and all the > > pthread stubs. > > That's not ideal, but I'm not sure if it's avoidable. Is statically linking libc something people regularly do? Aside from bde, probably not many. This is definitely a second-order concern. FreeBSD has a set of statically linked binaries in /rescue for situations where /lib gets screwed up. Space is an issue there because the root partition is historically sized quite small. Embedded folks might also care, but I'll let them speak for themselves. I did get a request several years ago from an embedded developer to unbreak the NO_FLOATING_POINT option in libc, and you could imagine perhaps a NO_LOCALE option as well. > Yup. A quick-and-dirty hack would be to add a flag that was set on the first call to uselocale() and to always use the global locale if this is not set. That should remove a lot of the overhead in cases where no one uses the per-thread locales. > > We can also probably store the locale in TLS, which (on platforms with fast TLS) should speed up the lookup a bit. I thought that's what thread_(get|set)_locale already did. Actually, it's counterintuitive that it would be significantly slower to access per-thread state than global state. Any idea why? Maybe it says something about our pthread_getspecific() implementation. I will run the code through a profiler some day, but I don't have the cycles right now. From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 21:44:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB204106566B for ; Mon, 30 Jan 2012 21:44:33 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from qmta10.emeryville.ca.mail.comcast.net (qmta10.emeryville.ca.mail.comcast.net [76.96.30.17]) by mx1.freebsd.org (Postfix) with ESMTP id BAC1B8FC08 for ; Mon, 30 Jan 2012 21:44:33 +0000 (UTC) Received: from omta14.emeryville.ca.mail.comcast.net ([76.96.30.60]) by qmta10.emeryville.ca.mail.comcast.net with comcast id Txjw1i0031HpZEsAAxkZeP; Mon, 30 Jan 2012 21:44:33 +0000 Received: from damnhippie.dyndns.org ([24.8.232.202]) by omta14.emeryville.ca.mail.comcast.net with comcast id TxkY1i0034NgCEG8axkYW3; Mon, 30 Jan 2012 21:44:33 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q0ULiUfM019472; Mon, 30 Jan 2012 14:44:30 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: David Schultz In-Reply-To: <20120130212631.GA45106@zim.MIT.EDU> References: <201111201445.pAKEjgNR096676@svn.freebsd.org> <20120118190714.GA13375@zim.MIT.EDU> <318F6CAA-D37E-49E9-A147-E21DE803EFB7@FreeBSD.org> <20120130212631.GA45106@zim.MIT.EDU> Content-Type: text/plain Date: Mon, 30 Jan 2012 14:44:30 -0700 Message-Id: <1327959870.1662.59.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.26.0 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Chisnall Subject: Re: svn commit: r227753 - in head: contrib/gdtoa include lib/libc/gdtoa lib/libc/gen lib/libc/locale lib/libc/regex lib/libc/stdio lib/libc/stdlib lib/libc/stdtime lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 21:44:33 -0000 On Mon, 2012-01-30 at 16:26 -0500, David Schultz wrote: > On Mon, Jan 30, 2012, David Chisnall wrote: > > On 18 Jan 2012, at 19:07, David Schultz wrote: > > > > > This patch appears to cause a large performance regression. For > > > example, I measured a 78% slowdown for strtol(" 42", ...). > > > > That's definitely worth taking a closer look at. I think we can cache some things in TLS and avoid some pthread_getspecific calls. The current code is the 'make it work' version. The 'make it fast' version is planned... > > Sounds good; I look forward to it. > > > > Furthermore, the resulting static binary for a trivial program > > > goes from 7k to 303k, due to pulling in malloc, stdio, and all the > > > pthread stubs. > > > > That's not ideal, but I'm not sure if it's avoidable. Is statically linking libc something people regularly do? > > Aside from bde, probably not many. This is definitely a > second-order concern. > > FreeBSD has a set of statically linked binaries in /rescue for > situations where /lib gets screwed up. Space is an issue there > because the root partition is historically sized quite small. > > Embedded folks might also care, but I'll let them speak for > themselves. I did get a request several years ago from an > embedded developer to unbreak the NO_FLOATING_POINT option in > libc, and you could imagine perhaps a NO_LOCALE option as well. > If locale support starts adding a lot of cycles or memory, then we embedded folks might like a NO_LOCALE option. 100k here, 200k there, and before you know it you're cursing some hardware designer who was sure that you'd never use all of the 64MB of ram he generously gave you. -- Ian From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 21:56:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4497D106564A; Mon, 30 Jan 2012 21:56:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 007B88FC1B; Mon, 30 Jan 2012 21:56:33 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:2059:d200:251:990d] (unknown [IPv6:2001:7b8:3a7:0:2059:d200:251:990d]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 2AF725C59; Mon, 30 Jan 2012 22:56:33 +0100 (CET) Message-ID: <4F27120E.5000207@FreeBSD.org> Date: Mon, 30 Jan 2012 22:56:30 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120124 Thunderbird/10.0 MIME-Version: 1.0 To: Ian Lepore References: <201201271829.q0RIT4Xq051545@svn.freebsd.org> <4F26F8C9.3080807@FreeBSD.org> <1327956501.1662.13.camel@revolution.hippie.lan> In-Reply-To: <1327956501.1662.13.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Rafal Jaworowski , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230622 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 21:56:34 -0000 On 2012-01-30 21:48, Ian Lepore wrote: > On Mon, 2012-01-30 at 21:08 +0100, Dimitry Andric wrote: >> On 2012-01-30 20:27, Rafal Jaworowski wrote: >> ... >>>> Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the >>>> bootstrap tools directories are searched before the regular ones. >>> >>> Is this supposed to work for cross building as well? I'm still encountering problems on a 7.3 host build: >>> >>> 1. Cross world builds fine >>> make -j 8 buildworld TARGET_ARCH=arm >>> >>> 2. Kernel fails w/ the aicasm >>> make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG >>> [...] >>> cc -O2 -pipe -nostdinc -I/usr/include -I. -I/home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wno-pointer-sign -c aicasm_scan.c >>> cc1: warnings being treated as errors >>> /home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm/aicasm_scan.l:837: warning: function declaration isn't a prototype >> >> Can you please try doing "make buildenv TARGET_ARCH=arm", then run >> "which lex" and "which yacc"? > > Shouldn't lex and yacc be listed in the Makefile.inc1 bootstrap-tools > target for this to be fully effective? It looks like neither is in > RELENG_7 and lex is only conditionally listed in RELENG_8. It is, for head at least (but I think I will MFC this change, if it turns out to work correctly). Look in Makefile.inc1, around line 1030: .if ${BOOTSTRAPPING} < 900006 _lex= usr.bin/lex _yacc= usr.bin/yacc .endif I have assumed Rafal is building a head checkout on 7.3 release. Since BOOTSTRAPPING will most likely be 703000, the lex and yacc targets are built during the bootstrap-tools stage. That said, I still don't understand why the generated aicasm_scan.c file is still defining the input() function. Rafal, just to be sure, can you please paste the file that was generated during your buildkernel? From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 22:28:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE8A6106564A; Mon, 30 Jan 2012 22:28:03 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id BAB2B8FC13; Mon, 30 Jan 2012 22:28:03 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.5/8.14.5) with ESMTP id q0UMS3OW032331; Mon, 30 Jan 2012 14:28:03 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.5/8.14.5/Submit) id q0UMS3SK032330; Mon, 30 Jan 2012 14:28:03 -0800 (PST) (envelope-from sgk) Date: Mon, 30 Jan 2012 14:28:03 -0800 From: Steve Kargl To: David Chisnall , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120130222803.GA32068@troutmask.apl.washington.edu> References: <201111201445.pAKEjgNR096676@svn.freebsd.org> <20120118190714.GA13375@zim.MIT.EDU> <318F6CAA-D37E-49E9-A147-E21DE803EFB7@FreeBSD.org> <20120130212631.GA45106@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120130212631.GA45106@zim.MIT.EDU> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: svn commit: r227753 - in head: contrib/gdtoa include lib/libc/gdtoa lib/libc/gen lib/libc/locale lib/libc/regex lib/libc/stdio lib/libc/stdlib lib/libc/stdtime lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 22:28:04 -0000 On Mon, Jan 30, 2012 at 04:26:31PM -0500, David Schultz wrote: > > FreeBSD has a set of statically linked binaries in /rescue for > situations where /lib gets screwed up. Space is an issue there > because the root partition is historically sized quite small. /rescue is a single binary created with crunchgen and 137 hard links. There's also one 9K script. BTW, I known of someone besides bde who creates statically linked binaries; particularly when he's debugging and profiling the his code. :-) -- Steve From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 22:32:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E189106568E; Mon, 30 Jan 2012 22:32:55 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 130F28FC18; Mon, 30 Jan 2012 22:32:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UMWson005553; Mon, 30 Jan 2012 22:32:54 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UMWsjE005549; Mon, 30 Jan 2012 22:32:54 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201201302232.q0UMWsjE005549@svn.freebsd.org> From: Justin Hibbits Date: Mon, 30 Jan 2012 22:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230788 - in stable/9: etc/devd sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 22:32:55 -0000 Author: jhibbits Date: Mon Jan 30 22:32:54 2012 New Revision: 230788 URL: http://svn.freebsd.org/changeset/base/230788 Log: MFC r228270,228277: Add a devd notification for closing/opening the lid on PowerBooks and iBooks. Approved by: nwhitehorn (mentor) Modified: stable/9/etc/devd/apple.conf stable/9/sys/powerpc/powermac/pmu.c stable/9/sys/powerpc/powermac/pmuvar.h Directory Properties: stable/9/etc/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/etc/devd/apple.conf ============================================================================== --- stable/9/etc/devd/apple.conf Mon Jan 30 21:02:25 2012 (r230787) +++ stable/9/etc/devd/apple.conf Mon Jan 30 22:32:54 2012 (r230788) @@ -11,6 +11,16 @@ notify 0 { }; +# PowerBook and iBook lid close. +notify 0 { + match "system" "PMU"; + match "subsystem" "lid"; + match "type" "close"; + match "notify" "0x0"; + action "shutdown -p now"; +}; + + # The next blocks enable volume hotkeys that can be found on Apple laptops notify 0 { match "system" "PMU"; Modified: stable/9/sys/powerpc/powermac/pmu.c ============================================================================== --- stable/9/sys/powerpc/powermac/pmu.c Mon Jan 30 21:02:25 2012 (r230787) +++ stable/9/sys/powerpc/powermac/pmu.c Mon Jan 30 22:32:54 2012 (r230788) @@ -701,6 +701,20 @@ pmu_intr(void *arg) adb_receive_raw_packet(sc->adb_bus,resp[1],resp[2], len - 3,&resp[3]); } + if (resp[1] & PMU_INT_ENVIRONMENT) { + /* if the lid was just closed, notify devd. */ + if ((resp[2] & PMU_ENV_LID_CLOSED) && (!sc->lid_closed)) { + sc->lid_closed = 1; + if (devctl_process_running()) + devctl_notify("PMU", "lid", "close", NULL); + } + else if (!(resp[2] & PMU_ENV_LID_CLOSED) && (sc->lid_closed)) { + /* if the lid was just opened, notify devd. */ + if (devctl_process_running()) + devctl_notify("PMU", "lid", "open", NULL); + sc->lid_closed = 0; + } + } } static u_int Modified: stable/9/sys/powerpc/powermac/pmuvar.h ============================================================================== --- stable/9/sys/powerpc/powermac/pmuvar.h Mon Jan 30 21:02:25 2012 (r230787) +++ stable/9/sys/powerpc/powermac/pmuvar.h Mon Jan 30 22:32:54 2012 (r230788) @@ -160,6 +160,7 @@ struct pmu_softc { volatile int sc_autopoll; int sc_batteries; struct cdev *sc_leddev; + int lid_closed; }; struct pmu_battstate { From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 22:47:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 947B41065670; Mon, 30 Jan 2012 22:47:03 +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 839128FC0A; Mon, 30 Jan 2012 22:47:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UMl3L5006020; Mon, 30 Jan 2012 22:47:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UMl3co006018; Mon, 30 Jan 2012 22:47:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201201302247.q0UMl3co006018@svn.freebsd.org> From: Warner Losh Date: Mon, 30 Jan 2012 22:47: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: r230789 - head/sys/dev/fe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 22:47:03 -0000 Author: imp Date: Mon Jan 30 22:47:02 2012 New Revision: 230789 URL: http://svn.freebsd.org/changeset/base/230789 Log: Improve media status reporting, when the driver knows... Modified: head/sys/dev/fe/if_fe.c Modified: head/sys/dev/fe/if_fe.c ============================================================================== --- head/sys/dev/fe/if_fe.c Mon Jan 30 22:32:54 2012 (r230788) +++ head/sys/dev/fe/if_fe.c Mon Jan 30 22:47:02 2012 (r230789) @@ -2255,6 +2255,7 @@ fe_medchange (struct ifnet *ifp) static void fe_medstat (struct ifnet *ifp, struct ifmediareq *ifmr) { - (void)ifp; - (void)ifmr; + struct fe_softc *sc = ifp->if_softc; + + ifmr->ifm_active = sc->media.ifm_media; } From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 23:03:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82334106566B; Mon, 30 Jan 2012 23:03:22 +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 6DA9F8FC1C; Mon, 30 Jan 2012 23:03:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UN3MgH006563; Mon, 30 Jan 2012 23:03:22 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UN3MYN006561; Mon, 30 Jan 2012 23:03:22 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201201302303.q0UN3MYN006561@svn.freebsd.org> From: Jack F Vogel Date: Mon, 30 Jan 2012 23:03: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: r230790 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 23:03:22 -0000 Author: jfv Date: Mon Jan 30 23:03:21 2012 New Revision: 230790 URL: http://svn.freebsd.org/changeset/base/230790 Log: Wrap the bool typedef Modified: head/sys/dev/ixgbe/ixgbe_osdep.h Modified: head/sys/dev/ixgbe/ixgbe_osdep.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_osdep.h Mon Jan 30 22:47:02 2012 (r230789) +++ head/sys/dev/ixgbe/ixgbe_osdep.h Mon Jan 30 23:03:21 2012 (r230790) @@ -106,7 +106,9 @@ typedef uint16_t u16; typedef uint32_t u32; typedef int32_t s32; typedef uint64_t u64; +#ifndef __bool_true_false_are_defined typedef boolean_t bool; +#endif #define le16_to_cpu From owner-svn-src-all@FreeBSD.ORG Mon Jan 30 23:07:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2886106566B; Mon, 30 Jan 2012 23:07:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1EC08FC0C; Mon, 30 Jan 2012 23:07:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0UN7RL2006724; Mon, 30 Jan 2012 23:07:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0UN7Rvl006718; Mon, 30 Jan 2012 23:07:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201302307.q0UN7Rvl006718@svn.freebsd.org> From: Adrian Chadd Date: Mon, 30 Jan 2012 23:07: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: r230791 - in head/sys/dev/ath/ath_hal: ar5210 ar5211 ar5212 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 23:07:28 -0000 Author: adrian Date: Mon Jan 30 23:07:27 2012 New Revision: 230791 URL: http://svn.freebsd.org/changeset/base/230791 Log: Radar API related fixes. * For legacy NICs, the combined RSSI should be used. For earlier AR5416 NICs, use control chain 0 RSSI rather than combined RSSI. For AR5416 > version 2.1, use the combined RSSI again. * Add in a missing AR5212 HAL method (get11nextbusy) which may be called by radar code. This serves no functional change for what's currently in FreeBSD. Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Mon Jan 30 23:03:21 2012 (r230790) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Mon Jan 30 23:07:27 2012 (r230791) @@ -359,6 +359,12 @@ ar5210FillCapabilityInfo(struct ath_hal pCap->halChanHalfRate = AH_FALSE; pCap->halChanQuarterRate = AH_FALSE; + /* + * RSSI uses the combined field; some 11n NICs may use + * the control chain RSSI. + */ + pCap->halUseCombinedRadarRssi = AH_TRUE; + if (ath_hal_eepromGetFlag(ah, AR_EEP_RFKILL)) { /* * Setup initial rfsilent settings based on the EEPROM Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Mon Jan 30 23:03:21 2012 (r230790) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Mon Jan 30 23:07:27 2012 (r230791) @@ -494,6 +494,12 @@ ar5211FillCapabilityInfo(struct ath_hal pCap->halChanHalfRate = AH_FALSE; pCap->halChanQuarterRate = AH_FALSE; + /* + * RSSI uses the combined field; some 11n NICs may use + * the control chain RSSI. + */ + pCap->halUseCombinedRadarRssi = AH_TRUE; + if (ath_hal_eepromGetFlag(ah, AR_EEP_RFKILL) && ath_hal_eepromGet(ah, AR_EEP_RFSILENT, &ahpriv->ah_rfsilent) == HAL_OK) { /* NB: enabled by default */ Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Jan 30 23:03:21 2012 (r230790) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Jan 30 23:07:27 2012 (r230791) @@ -628,5 +628,6 @@ extern HAL_BOOL ar5212ProcessRadarEvent( struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, HAL_DFS_EVENT *event); extern HAL_BOOL ar5212IsFastClockEnabled(struct ath_hal *ah); +extern uint32_t ar5212Get11nExtBusy(struct ath_hal *ah); #endif /* _ATH_AR5212_H_ */ Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Mon Jan 30 23:03:21 2012 (r230790) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Mon Jan 30 23:07:27 2012 (r230791) @@ -134,6 +134,7 @@ static const struct ath_hal_private ar52 .ah_getDfsThresh = ar5212GetDfsThresh, .ah_procRadarEvent = ar5212ProcessRadarEvent, .ah_isFastClockEnabled = ar5212IsFastClockEnabled, + .ah_get11nExtBusy = ar5212Get11nExtBusy, /* Key Cache Functions */ .ah_getKeyCacheSize = ar5212GetKeyCacheSize, @@ -839,6 +840,12 @@ ar5212FillCapabilityInfo(struct ath_hal pCap->halChanHalfRate = AH_TRUE; pCap->halChanQuarterRate = AH_TRUE; + /* + * RSSI uses the combined field; some 11n NICs may use + * the control chain RSSI. + */ + pCap->halUseCombinedRadarRssi = AH_TRUE; + if (ath_hal_eepromGetFlag(ah, AR_EEP_RFKILL) && ath_hal_eepromGet(ah, AR_EEP_RFSILENT, &ahpriv->ah_rfsilent) == HAL_OK) { /* NB: enabled by default */ Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Mon Jan 30 23:03:21 2012 (r230790) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Mon Jan 30 23:07:27 2012 (r230791) @@ -1233,3 +1233,13 @@ ar5212IsFastClockEnabled(struct ath_hal { return AH_FALSE; } + +/* + * Return what percentage of the extension channel is busy. + * This is always disabled for AR5212 series NICs. + */ +uint32_t +ar5212Get11nExtBusy(struct ath_hal *ah) +{ + return 0; +} From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 00:03:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 034D91065672; Tue, 31 Jan 2012 00:03:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E137D8FC0C; Tue, 31 Jan 2012 00:03:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0V03nGE008574; Tue, 31 Jan 2012 00:03:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0V03nXG008570; Tue, 31 Jan 2012 00:03:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201310003.q0V03nXG008570@svn.freebsd.org> From: Adrian Chadd Date: Tue, 31 Jan 2012 00:03: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: r230793 - in head/sys: conf net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 00:03:50 -0000 Author: adrian Date: Tue Jan 31 00:03:49 2012 New Revision: 230793 URL: http://svn.freebsd.org/changeset/base/230793 Log: Add a DFS debugging mode which is useful when doing automated DFS compliance testing. In order to allow for radar pattern matching to occur, the DFS CAC/NOL handling needs to be made configurable. This commit introduces a new sysctl, "net.wlan.dfs_debug", which controls which DFS debug mode net80211 is in. * 0 = default, CSA/NOL handling as per normal. * 1 = announce a CSA, but don't add the channel to the non-occupy list (NOL.) * 2 = disable both CSA and NOL - only print that a radar event occured. This code is not compiled/enabled by default as it breaks regulatory handling. A user must enable IEEE80211_DFS_DEBUG in their kernel configuration file for this option to become available. Obtained from: Atheros Modified: head/sys/conf/options head/sys/net80211/ieee80211_dfs.c head/sys/net80211/ieee80211_dfs.h Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Jan 30 23:37:17 2012 (r230792) +++ head/sys/conf/options Tue Jan 31 00:03:49 2012 (r230793) @@ -845,6 +845,7 @@ IEEE80211_SUPPORT_MESH opt_wlan.h IEEE80211_SUPPORT_SUPERG opt_wlan.h IEEE80211_SUPPORT_TDMA opt_wlan.h IEEE80211_ALQ opt_wlan.h +IEEE80211_DFS_DEBUG opt_wlan.h # 802.11 TDMA support TDMA_SLOTLEN_DEFAULT opt_tdma.h Modified: head/sys/net80211/ieee80211_dfs.c ============================================================================== --- head/sys/net80211/ieee80211_dfs.c Mon Jan 30 23:37:17 2012 (r230792) +++ head/sys/net80211/ieee80211_dfs.c Tue Jan 31 00:03:49 2012 (r230793) @@ -64,6 +64,28 @@ SYSCTL_INT(_net_wlan, OID_AUTO, cac_time &ieee80211_cac_timeout, 0, "CAC timeout (secs)"); #define CAC_TIMEOUT msecs_to_ticks(ieee80211_cac_timeout*1000) +/* + DFS* In order to facilitate debugging, a couple of operating + * modes aside from the default are needed. + * + * 0 - default CAC/NOL behaviour - ie, start CAC, place + * channel on NOL list. + * 1 - send CAC, but don't change channel or add the channel + * to the NOL list. + * 2 - just match on radar, don't send CAC or place channel in + * the NOL list. + */ +static int ieee80211_dfs_debug = DFS_DBG_NONE; + +/* + * This option must not be included in the default kernel + * as it allows users to plainly disable CAC/NOL handling. + */ +#ifdef IEEE80211_DFS_DEBUG +SYSCTL_INT(_net_wlan, OID_AUTO, dfs_debug, CTLFLAG_RW, + &ieee80211_dfs_debug, 0, "DFS debug behaviour"); +#endif + static int null_set_quiet(struct ieee80211_node *ni, u_int8_t *quiet_elm) { @@ -278,24 +300,44 @@ ieee80211_dfs_notify_radar(struct ieee80 IEEE80211_LOCK_ASSERT(ic); /* - * Mark all entries with this frequency. Notify user - * space and arrange for notification when the radar - * indication is cleared. Then kick the NOL processing - * thread if not already running. + * If doing DFS debugging (mode 2), don't bother + * running the rest of this function. + * + * Simply announce the presence of the radar and continue + * along merrily. */ - now = ticks; - for (i = 0; i < ic->ic_nchans; i++) { - struct ieee80211_channel *c = &ic->ic_channels[i]; - if (c->ic_freq == chan->ic_freq) { - c->ic_state &= ~IEEE80211_CHANSTATE_CACDONE; - c->ic_state |= IEEE80211_CHANSTATE_RADAR; - dfs->nol_event[i] = now; + if (ieee80211_dfs_debug == DFS_DBG_NOCSANOL) { + announce_radar(ic->ic_ifp, chan, chan); + ieee80211_notify_radar(ic, chan); + return; + } + + /* + * Don't mark the channel and don't put it into NOL + * if we're doing DFS debugging. + */ + if (ieee80211_dfs_debug == DFS_DBG_NONE) { + /* + * Mark all entries with this frequency. Notify user + * space and arrange for notification when the radar + * indication is cleared. Then kick the NOL processing + * thread if not already running. + */ + now = ticks; + for (i = 0; i < ic->ic_nchans; i++) { + struct ieee80211_channel *c = &ic->ic_channels[i]; + if (c->ic_freq == chan->ic_freq) { + c->ic_state &= ~IEEE80211_CHANSTATE_CACDONE; + c->ic_state |= IEEE80211_CHANSTATE_RADAR; + dfs->nol_event[i] = now; + } } + ieee80211_notify_radar(ic, chan); + chan->ic_state |= IEEE80211_CHANSTATE_NORADAR; + if (!callout_pending(&dfs->nol_timer)) + callout_reset(&dfs->nol_timer, NOL_TIMEOUT, + dfs_timeout, ic); } - ieee80211_notify_radar(ic, chan); - chan->ic_state |= IEEE80211_CHANSTATE_NORADAR; - if (!callout_pending(&dfs->nol_timer)) - callout_reset(&dfs->nol_timer, NOL_TIMEOUT, dfs_timeout, ic); /* * If radar is detected on the bss channel while @@ -310,7 +352,15 @@ ieee80211_dfs_notify_radar(struct ieee80 */ if (chan == ic->ic_bsschan) { /* XXX need a way to defer to user app */ - dfs->newchan = ieee80211_dfs_pickchannel(ic); + + /* + * Don't flip over to a new channel if + * we are currently doing DFS debugging. + */ + if (ieee80211_dfs_debug == DFS_DBG_NONE) + dfs->newchan = ieee80211_dfs_pickchannel(ic); + else + dfs->newchan = chan; announce_radar(ic->ic_ifp, chan, dfs->newchan); Modified: head/sys/net80211/ieee80211_dfs.h ============================================================================== --- head/sys/net80211/ieee80211_dfs.h Mon Jan 30 23:37:17 2012 (r230792) +++ head/sys/net80211/ieee80211_dfs.h Tue Jan 31 00:03:49 2012 (r230793) @@ -31,6 +31,12 @@ * 802.11h/DFS definitions. */ +typedef enum { + DFS_DBG_NONE = 0, + DFS_DBG_NONOL = 1, + DFS_DBG_NOCSANOL = 2 +} dfs_debug_t; + struct ieee80211_dfs_state { int nol_event[IEEE80211_CHAN_MAX]; struct callout nol_timer; /* NOL list processing */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 00:32:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D8661065672; Tue, 31 Jan 2012 00:32:38 +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 15DC18FC12; Tue, 31 Jan 2012 00:32:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0V0WcD6009715; Tue, 31 Jan 2012 00:32:38 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0V0Wb4i009706; Tue, 31 Jan 2012 00:32:37 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201201310032.q0V0Wb4i009706@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 31 Jan 2012 00:32: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: r230795 - in head/usr.sbin/makefs: . cd9660 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 00:32:38 -0000 Author: jkim Date: Tue Jan 31 00:32:37 2012 New Revision: 230795 URL: http://svn.freebsd.org/changeset/base/230795 Log: Allow contents of multiple directories to be merged to the current image. Note this patch was submitted to NetBSD and they already adopted it. http://mail-index.netbsd.org/source-changes/2012/01/28/msg031078.html MFC after: 1 week Modified: head/usr.sbin/makefs/cd9660.c head/usr.sbin/makefs/cd9660.h head/usr.sbin/makefs/cd9660/cd9660_write.c head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/makefs.8 head/usr.sbin/makefs/makefs.c head/usr.sbin/makefs/makefs.h head/usr.sbin/makefs/walk.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Tue Jan 31 00:12:51 2012 (r230794) +++ head/usr.sbin/makefs/cd9660.c Tue Jan 31 00:32:37 2012 (r230795) @@ -472,8 +472,6 @@ cd9660_makefs(const char *image, const c return; } - diskStructure.rootFilesystemPath = dir; - if (diskStructure.verbose_level > 0) printf("cd9660_makefs: image %s directory %s root %p\n", image, dir, root); @@ -1568,24 +1566,15 @@ cd9660_generate_path_table(void) } void -cd9660_compute_full_filename(cd9660node *node, char *buf, int level) +cd9660_compute_full_filename(cd9660node *node, char *buf) { - cd9660node *parent; - - parent = (node->rr_real_parent == NULL ? - node->parent : node->rr_real_parent); - if (parent != NULL) { - cd9660_compute_full_filename(parent, buf, level + 1); - strcat(buf, node->node->name); - } else { - /* We are at the root */ - strcat(buf, diskStructure.rootFilesystemPath); - if (buf[strlen(buf) - 1] == '/') - buf[strlen(buf) - 1] = '\0'; - } + int len; - if (level != 0) - strcat(buf, "/"); + len = CD9660MAXPATH + 1; + len = snprintf(buf, len, "%s/%s/%s", node->node->root, + node->node->path, node->node->name); + if (len > CD9660MAXPATH) + errx(1, "Pathname too long."); } /* NEW filename conversion method */ Modified: head/usr.sbin/makefs/cd9660.h ============================================================================== --- head/usr.sbin/makefs/cd9660.h Tue Jan 31 00:12:51 2012 (r230794) +++ head/usr.sbin/makefs/cd9660.h Tue Jan 31 00:32:37 2012 (r230795) @@ -244,8 +244,6 @@ typedef struct _iso9660_disk { cd9660node *rootNode; - const char *rootFilesystemPath; - /* Important sector numbers here */ /* primaryDescriptor.type_l_path_table*/ int64_t primaryBigEndianTableSector; @@ -345,7 +343,7 @@ int cd9660_setup_boot_volume_descriptor( int cd9660_write_image(const char *image); int cd9660_copy_file(FILE *, off_t, const char *); -void cd9660_compute_full_filename(cd9660node *, char *, int); +void cd9660_compute_full_filename(cd9660node *, char *); int cd9660_compute_record_size(cd9660node *); /* Debugging functions */ Modified: head/usr.sbin/makefs/cd9660/cd9660_write.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_write.c Tue Jan 31 00:12:51 2012 (r230794) +++ head/usr.sbin/makefs/cd9660/cd9660_write.c Tue Jan 31 00:32:37 2012 (r230795) @@ -296,7 +296,7 @@ cd9660_write_file(FILE *fd, cd9660node * inode->flags |= FI_WRITTEN; if (writenode->node->contents == NULL) cd9660_compute_full_filename(writenode, - temp_file_name, 0); + temp_file_name); ret = cd9660_copy_file(fd, writenode->fileDataSector, (writenode->node->contents != NULL) ? writenode->node->contents : temp_file_name); Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Tue Jan 31 00:12:51 2012 (r230794) +++ head/usr.sbin/makefs/ffs.c Tue Jan 31 00:32:37 2012 (r230795) @@ -780,8 +780,8 @@ ffs_populate_dir(const char *dir, fsnode cur->inode->flags |= FI_WRITTEN; if (cur->contents == NULL) { - if (snprintf(path, sizeof(path), "%s/%s", dir, - cur->name) >= sizeof(path)) + if (snprintf(path, sizeof(path), "%s/%s/%s", cur->root, + cur->path, cur->name) >= (int)sizeof(path)) errx(1, "Pathname too long."); } Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Tue Jan 31 00:12:51 2012 (r230794) +++ head/usr.sbin/makefs/makefs.8 Tue Jan 31 00:32:37 2012 (r230795) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 10, 2009 +.Dd January 30, 2012 .Dt MAKEFS 8 .Os .Sh NAME @@ -58,6 +58,7 @@ .Op Fl t Ar fs-type .Ar image-file .Ar directory | manifest +.Op Ar extra-directory ... .Sh DESCRIPTION The utility .Nm @@ -67,6 +68,15 @@ from the directory tree .Ar directory or from the mtree manifest .Ar manifest . +If optional directory tree +.Ar extra-directory +is passed, then the directory tree of each argument will be merged +into the +.Ar directory +or +.Ar manifest +first before creating +.Ar image-file . No special devices or privileges are required to perform this task. .Pp The options are as follows: Modified: head/usr.sbin/makefs/makefs.c ============================================================================== --- head/usr.sbin/makefs/makefs.c Tue Jan 31 00:12:51 2012 (r230794) +++ head/usr.sbin/makefs/makefs.c Tue Jan 31 00:32:37 2012 (r230795) @@ -87,7 +87,7 @@ main(int argc, char *argv[]) fstype_t *fstype; fsinfo_t fsoptions; fsnode *root; - int ch, len; + int ch, i, len; char *subtree; char *specfile; @@ -241,7 +241,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (argc != 2) + if (argc < 2) usage(); /* -x must be accompanied by -F */ @@ -260,7 +260,7 @@ main(int argc, char *argv[]) case S_IFDIR: /* walk the tree */ subtree = argv[1]; TIMER_START(start); - root = walk_dir(subtree, NULL); + root = walk_dir(subtree, ".", NULL, NULL); TIMER_RESULTS(start, "walk_dir"); break; case S_IFREG: /* read the manifest file */ @@ -274,6 +274,17 @@ main(int argc, char *argv[]) /* NOTREACHED */ } + /* append extra directory */ + for (i = 2; i < argc; i++) { + if (stat(argv[i], &sb) == -1) + err(1, "Can't stat `%s'", argv[i]); + if (!S_ISDIR(sb.st_mode)) + errx(1, "%s: not a directory", argv[i]); + TIMER_START(start); + root = walk_dir(argv[i], ".", NULL, root); + TIMER_RESULTS(start, "walk_dir2"); + } + if (specfile) { /* apply a specfile */ TIMER_START(start); apply_specfile(specfile, subtree, root, fsoptions.onlyspec); @@ -282,7 +293,7 @@ main(int argc, char *argv[]) if (debug & DEBUG_DUMP_FSNODES) { printf("\nparent: %s\n", subtree); - dump_fsnodes(".", root); + dump_fsnodes(root); putchar('\n'); } @@ -336,7 +347,7 @@ usage(void) "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n" "\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x]\n" -"\t[-N userdb-dir] image-file directory | manifest\n", +"\t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", prog); exit(1); } Modified: head/usr.sbin/makefs/makefs.h ============================================================================== --- head/usr.sbin/makefs/makefs.h Tue Jan 31 00:12:51 2012 (r230794) +++ head/usr.sbin/makefs/makefs.h Tue Jan 31 00:32:37 2012 (r230795) @@ -94,6 +94,8 @@ typedef struct _fsnode { fsinode *inode; /* actual inode data */ char *symlink; /* symlink target */ char *contents; /* file to provide contents */ + const char *root; /* root path */ + char *path; /* directory name */ char *name; /* file name */ int flags; /* misc flags */ } fsnode; @@ -147,11 +149,11 @@ typedef struct { void apply_specfile(const char *, const char *, fsnode *, int); -void dump_fsnodes(const char *, fsnode *); +void dump_fsnodes(fsnode *); const char * inode_type(mode_t); fsnode * read_mtree(const char *, fsnode *); int set_option(option_t *, const char *, const char *); -fsnode * walk_dir(const char *, fsnode *); +fsnode * walk_dir(const char *, const char *, fsnode *, fsnode *); void free_fsnodes(fsnode *); void ffs_prep_opts(fsinfo_t *); Modified: head/usr.sbin/makefs/walk.c ============================================================================== --- head/usr.sbin/makefs/walk.c Tue Jan 31 00:12:51 2012 (r230794) +++ head/usr.sbin/makefs/walk.c Tue Jan 31 00:32:37 2012 (r230795) @@ -57,40 +57,70 @@ __FBSDID("$FreeBSD$"); static void apply_specdir(const char *, NODE *, fsnode *, int); static void apply_specentry(const char *, NODE *, fsnode *); -static fsnode *create_fsnode(const char *, struct stat *); +static fsnode *create_fsnode(const char *, const char *, const char *, + struct stat *); static fsinode *link_check(fsinode *); /* * walk_dir -- - * build a tree of fsnodes from `dir', with a parent fsnode of `parent' - * (which may be NULL for the root of the tree). + * build a tree of fsnodes from `root' and `dir', with a parent + * fsnode of `parent' (which may be NULL for the root of the tree). + * append the tree to a fsnode of `join' if it is not NULL. * each "level" is a directory, with the "." entry guaranteed to be * at the start of the list, and without ".." entries. */ fsnode * -walk_dir(const char *dir, fsnode *parent) +walk_dir(const char *root, const char *dir, fsnode *parent, fsnode *join) { - fsnode *first, *cur, *prev; + fsnode *first, *cur, *prev, *last; DIR *dirp; struct dirent *dent; char path[MAXPATHLEN + 1]; struct stat stbuf; + char *name, *rp; + int dot, len; + assert(root != NULL); assert(dir != NULL); + len = snprintf(path, sizeof(path), "%s/%s", root, dir); + if (len >= (int)sizeof(path)) + errx(1, "Pathname too long."); if (debug & DEBUG_WALK_DIR) - printf("walk_dir: %s %p\n", dir, parent); - if ((dirp = opendir(dir)) == NULL) - err(1, "Can't opendir `%s'", dir); - first = prev = NULL; + printf("walk_dir: %s %p\n", path, parent); + if ((dirp = opendir(path)) == NULL) + err(1, "Can't opendir `%s'", path); + rp = path + strlen(root) + 1; + if (join != NULL) { + first = cur = join; + while (cur->next != NULL) + cur = cur->next; + prev = cur; + } else + first = prev = NULL; + last = prev; while ((dent = readdir(dirp)) != NULL) { - if (strcmp(dent->d_name, "..") == 0) - continue; + name = dent->d_name; + dot = 0; + if (name[0] == '.') + switch (name[1]) { + case '\0': /* "." */ + if (join != NULL) + continue; + dot = 1; + break; + case '.': /* ".." */ + if (name[2] == '\0') + continue; + /* FALLTHROUGH */ + default: + dot = 0; + } if (debug & DEBUG_WALK_DIR_NODE) - printf("scanning %s/%s\n", dir, dent->d_name); - if (snprintf(path, sizeof(path), "%s/%s", dir, dent->d_name) - >= sizeof(path)) + printf("scanning %s/%s/%s\n", root, dir, name); + if (snprintf(path + len, sizeof(path) - len, "/%s", name) >= + (int)sizeof(path) - len) errx(1, "Pathname too long."); if (lstat(path, &stbuf) == -1) err(1, "Can't lstat `%s'", path); @@ -102,22 +132,51 @@ walk_dir(const char *dir, fsnode *parent } #endif - cur = create_fsnode(dent->d_name, &stbuf); + if (join != NULL) { + cur = join->next; + for (;;) { + if (cur == NULL || strcmp(cur->name, name) == 0) + break; + if (cur == last) { + cur = NULL; + break; + } + cur = cur->next; + } + if (cur != NULL) { + if (S_ISDIR(cur->type) && + S_ISDIR(stbuf.st_mode)) { + if (debug & DEBUG_WALK_DIR_NODE) + printf("merging %s with %p\n", + path, cur->child); + cur->child = walk_dir(root, rp, cur, + cur->child); + continue; + } + errx(1, "Can't merge %s `%s' with existing %s", + inode_type(stbuf.st_mode), path, + inode_type(cur->type)); + } + } + + cur = create_fsnode(root, dir, name, &stbuf); cur->parent = parent; - if (strcmp(dent->d_name, ".") == 0) { + if (dot) { /* ensure "." is at the start of the list */ cur->next = first; first = cur; if (! prev) prev = cur; + cur->first = first; } else { /* not "." */ if (prev) prev->next = cur; prev = cur; if (!first) first = cur; + cur->first = first; if (S_ISDIR(cur->type)) { - cur->child = walk_dir(path, cur); + cur->child = walk_dir(root, rp, cur, NULL); continue; } } @@ -147,22 +206,27 @@ walk_dir(const char *dir, fsnode *parent err(1, "Memory allocation error"); } } - for (cur = first; cur != NULL; cur = cur->next) - cur->first = first; + assert(first != NULL); + if (join == NULL) + for (cur = first->next; cur != NULL; cur = cur->next) + cur->first = first; if (closedir(dirp) == -1) - err(1, "Can't closedir `%s'", dir); + err(1, "Can't closedir `%s/%s'", root, dir); return (first); } static fsnode * -create_fsnode(const char *name, struct stat *stbuf) +create_fsnode(const char *root, const char *path, const char *name, + struct stat *stbuf) { fsnode *cur; if ((cur = calloc(1, sizeof(fsnode))) == NULL || + (cur->path = strdup(path)) == NULL || (cur->name = strdup(name)) == NULL || (cur->inode = calloc(1, sizeof(fsinode))) == NULL) err(1, "Memory allocation error"); + cur->root = root; cur->type = stbuf->st_mode & S_IFMT; cur->inode->nlink = 1; cur->inode->st = *stbuf; @@ -211,6 +275,7 @@ free_fsnodes(fsnode *node) free(cur->inode); if (cur->symlink) free(cur->symlink); + free(cur->path); free(cur->name); free(cur); } @@ -388,14 +453,16 @@ apply_specdir(const char *dir, NODE *spe stbuf.st_mtimensec = stbuf.st_atimensec = stbuf.st_ctimensec = start_time.tv_nsec; #endif - curfsnode = create_fsnode(curnode->name, &stbuf); + curfsnode = create_fsnode(".", ".", curnode->name, + &stbuf); curfsnode->parent = dirnode->parent; curfsnode->first = dirnode; curfsnode->next = dirnode->next; dirnode->next = curfsnode; if (curfsnode->type == S_IFDIR) { /* for dirs, make "." entry as well */ - curfsnode->child = create_fsnode(".", &stbuf); + curfsnode->child = create_fsnode(".", ".", ".", + &stbuf); curfsnode->child->parent = curfsnode; curfsnode->child->first = curfsnode->child; } @@ -503,19 +570,18 @@ apply_specentry(const char *dir, NODE *s /* * dump_fsnodes -- - * dump the fsnodes from `cur', based in the directory `dir' + * dump the fsnodes from `cur' */ void -dump_fsnodes(const char *dir, fsnode *root) +dump_fsnodes(fsnode *root) { fsnode *cur; char path[MAXPATHLEN + 1]; - assert (dir != NULL); - printf("dump_fsnodes: %s %p\n", dir, root); + printf("dump_fsnodes: %s %p\n", root->path, root); for (cur = root; cur != NULL; cur = cur->next) { - if (snprintf(path, sizeof(path), "%s/%s", dir, cur->name) - >= sizeof(path)) + if (snprintf(path, sizeof(path), "%s/%s", cur->path, + cur->name) >= (int)sizeof(path)) errx(1, "Pathname too long."); if (debug & DEBUG_DUMP_FSNODES_VERBOSE) @@ -534,10 +600,10 @@ dump_fsnodes(const char *dir, fsnode *ro if (cur->child) { assert (cur->type == S_IFDIR); - dump_fsnodes(path, cur->child); + dump_fsnodes(cur->child); } } - printf("dump_fsnodes: finished %s\n", dir); + printf("dump_fsnodes: finished %s/%s\n", root->path, root->name); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 00:49:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C283106568A; Tue, 31 Jan 2012 00:49:05 +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 855338FC14; Tue, 31 Jan 2012 00:49:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0V0n5TR010538; Tue, 31 Jan 2012 00:49:05 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0V0n57A010535; Tue, 31 Jan 2012 00:49:05 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201201310049.q0V0n57A010535@svn.freebsd.org> From: Doug Barton Date: Tue, 31 Jan 2012 00:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230796 - in stable/8/lib/bind: . isc/isc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 00:49:05 -0000 Author: dougb Date: Tue Jan 31 00:49:04 2012 New Revision: 230796 URL: http://svn.freebsd.org/changeset/base/230796 Log: MFC r217071 and r217213: Make the setting of the BIND CFLAG -DWORDS_BIGENDIAN conditional on the TARGET_ENDIANNESS knob from bsd.endian.mk so that we can avoid having to special-case each arch. MFC r224093 (in part): Stop claiming that we support atomic ops except on arches where we know that they work. Many users have reported problems on the other arches, so until they can get fixed we'll take the safe route. Modified: stable/8/lib/bind/config.mk stable/8/lib/bind/isc/isc/platform.h Directory Properties: stable/8/lib/bind/ (props changed) Modified: stable/8/lib/bind/config.mk ============================================================================== --- stable/8/lib/bind/config.mk Tue Jan 31 00:32:37 2012 (r230795) +++ stable/8/lib/bind/config.mk Tue Jan 31 00:49:04 2012 (r230796) @@ -1,6 +1,7 @@ # $FreeBSD$ .include +.include # BIND version number .if defined(BIND_DIR) && exists(${BIND_DIR}/version) @@ -45,7 +46,7 @@ CFLAGS+= -DOPENSSL CFLAGS+= -DUSE_MD5 # Endianness -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64" +.if ${TARGET_ENDIANNESS} == 4321 CFLAGS+= -DWORDS_BIGENDIAN .endif @@ -66,8 +67,10 @@ CFLAGS+= -I${LIB_BIND_DIR} # Use the right version of the atomic.h file from lib/isc .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" ISC_ATOMIC_ARCH= x86_32 +.elif ${MACHINE_ARCH} == "ia64" +ISC_ATOMIC_ARCH= ia64 .else -ISC_ATOMIC_ARCH= ${MACHINE_ARCH} +ISC_ATOMIC_ARCH= noatomic .endif # Optional features Modified: stable/8/lib/bind/isc/isc/platform.h ============================================================================== --- stable/8/lib/bind/isc/isc/platform.h Tue Jan 31 00:32:37 2012 (r230795) +++ stable/8/lib/bind/isc/isc/platform.h Tue Jan 31 00:49:04 2012 (r230796) @@ -252,7 +252,14 @@ * If the "xadd" operation is available on this architecture, * ISC_PLATFORM_HAVEXADD will be defined. */ +/* + * FreeBSD local modification, preserve this over upgrades + */ +#if defined (__i386__) || defined (__amd64__) || defined (__ia64__) #define ISC_PLATFORM_HAVEXADD 1 +#else +#undef ISC_PLATFORM_HAVEXADD +#endif /* * If the "xaddq" operation (64bit xadd) is available on this architecture, @@ -271,18 +278,39 @@ * If the "atomic swap" operation is available on this architecture, * ISC_PLATFORM_HAVEATOMICSTORE" will be defined. */ +/* + * FreeBSD local modification, preserve this over upgrades + */ +#if defined (__i386__) || defined (__amd64__) || defined (__ia64__) #define ISC_PLATFORM_HAVEATOMICSTORE 1 +#else +#undef ISC_PLATFORM_HAVEATOMICSTORE +#endif /* * If the "compare-and-exchange" operation is available on this architecture, * ISC_PLATFORM_HAVECMPXCHG will be defined. */ +/* + * FreeBSD local modification, preserve this over upgrades + */ +#if defined (__i386__) || defined (__amd64__) || defined (__ia64__) #define ISC_PLATFORM_HAVECMPXCHG 1 +#else +#undef ISC_PLATFORM_HAVECMPXCHG +#endif /* * Define if gcc ASM extension is available */ +/* + * FreeBSD local modification, preserve this over upgrades + */ +#if defined (__i386__) || defined (__amd64__) || defined (__ia64__) #define ISC_PLATFORM_USEGCCASM 1 +#else +#undef ISC_PLATFORM_USEGCCASM +#endif /* * Define if Tru64 style ASM syntax must be used. From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 00:49:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6335106564A; Tue, 31 Jan 2012 00:49:34 +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 A00008FC1B; Tue, 31 Jan 2012 00:49:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0V0nYQT010587; Tue, 31 Jan 2012 00:49:34 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0V0nY4q010584; Tue, 31 Jan 2012 00:49:34 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201201310049.q0V0nY4q010584@svn.freebsd.org> From: Doug Barton Date: Tue, 31 Jan 2012 00:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230797 - in stable/7/lib/bind: . isc/isc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 00:49:34 -0000 Author: dougb Date: Tue Jan 31 00:49:34 2012 New Revision: 230797 URL: http://svn.freebsd.org/changeset/base/230797 Log: MFC r217071 and r217213: Make the setting of the BIND CFLAG -DWORDS_BIGENDIAN conditional on the TARGET_ENDIANNESS knob from bsd.endian.mk so that we can avoid having to special-case each arch. MFC r224093 (in part): Stop claiming that we support atomic ops except on arches where we know that they work. Many users have reported problems on the other arches, so until they can get fixed we'll take the safe route. Modified: stable/7/lib/bind/config.mk stable/7/lib/bind/isc/isc/platform.h Directory Properties: stable/7/lib/bind/ (props changed) Modified: stable/7/lib/bind/config.mk ============================================================================== --- stable/7/lib/bind/config.mk Tue Jan 31 00:49:04 2012 (r230796) +++ stable/7/lib/bind/config.mk Tue Jan 31 00:49:34 2012 (r230797) @@ -1,6 +1,7 @@ # $FreeBSD$ .include +.include # BIND version number .if defined(BIND_DIR) && exists(${BIND_DIR}/version) @@ -45,7 +46,7 @@ CFLAGS+= -DOPENSSL CFLAGS+= -DUSE_MD5 # Endianness -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64" +.if ${TARGET_ENDIANNESS} == 4321 CFLAGS+= -DWORDS_BIGENDIAN .endif @@ -66,8 +67,10 @@ CFLAGS+= -I${LIB_BIND_DIR} # Use the right version of the atomic.h file from lib/isc .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" ISC_ATOMIC_ARCH= x86_32 +.elif ${MACHINE_ARCH} == "ia64" +ISC_ATOMIC_ARCH= ia64 .else -ISC_ATOMIC_ARCH= ${MACHINE_ARCH} +ISC_ATOMIC_ARCH= noatomic .endif # Link against BIND libraries Modified: stable/7/lib/bind/isc/isc/platform.h ============================================================================== --- stable/7/lib/bind/isc/isc/platform.h Tue Jan 31 00:49:04 2012 (r230796) +++ stable/7/lib/bind/isc/isc/platform.h Tue Jan 31 00:49:34 2012 (r230797) @@ -238,24 +238,52 @@ * If the "xadd" operation is available on this architecture, * ISC_PLATFORM_HAVEXADD will be defined. */ +/* + * FreeBSD local modification, preserve this over upgrades + */ +#if defined (__i386__) || defined (__amd64__) || defined (__ia64__) #define ISC_PLATFORM_HAVEXADD 1 +#else +#undef ISC_PLATFORM_HAVEXADD +#endif /* * If the "atomic swap" operation is available on this architecture, * ISC_PLATFORM_HAVEATOMICSTORE" will be defined. */ +/* + * FreeBSD local modification, preserve this over upgrades + */ +#if defined (__i386__) || defined (__amd64__) || defined (__ia64__) #define ISC_PLATFORM_HAVEATOMICSTORE 1 +#else +#undef ISC_PLATFORM_HAVEATOMICSTORE +#endif /* * If the "compare-and-exchange" operation is available on this architecture, * ISC_PLATFORM_HAVECMPXCHG will be defined. */ +/* + * FreeBSD local modification, preserve this over upgrades + */ +#if defined (__i386__) || defined (__amd64__) || defined (__ia64__) #define ISC_PLATFORM_HAVECMPXCHG 1 +#else +#undef ISC_PLATFORM_HAVECMPXCHG +#endif /* * Define if gcc ASM extension is available */ +/* + * FreeBSD local modification, preserve this over upgrades + */ +#if defined (__i386__) || defined (__amd64__) || defined (__ia64__) #define ISC_PLATFORM_USEGCCASM 1 +#else +#undef ISC_PLATFORM_USEGCCASM +#endif /* * Define if Tru64 style ASM syntax must be used. From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 01:43:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A05D106566B; Tue, 31 Jan 2012 01:43:04 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52D328FC13; Tue, 31 Jan 2012 01:43:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0V1h4C6012222; Tue, 31 Jan 2012 01:43:04 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0V1h4mw012220; Tue, 31 Jan 2012 01:43:04 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201201310143.q0V1h4mw012220@svn.freebsd.org> From: Warren Block Date: Tue, 31 Jan 2012 01:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230798 - stable/8/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 01:43:04 -0000 Author: wblock (doc committer) Date: Tue Jan 31 01:43:03 2012 New Revision: 230798 URL: http://svn.freebsd.org/changeset/base/230798 Log: MFC r217314 (ae): Fix up the grammar. MFC r217342 (maxim): o Typo fixes. MFC r217343 (maxim): o Start each sentence on a new line. No content changes. MFC r222359 (ae): Add example how to create MBR and BSD schemes and install boot code. MFC r222495 (ae): Document kern.geom.part.check_integrity sysctl variable. MFC r222599 (uqs): mdoc: fix markup MFC r222646 (ru): Generally clean up markup. MFC r222778 (gavin): Rework parts of this man page to improve grammar. MFC r225003 (ae): Add new section "BOOTSTRAPPING" to the gpart(8), that describes bootstrap code images used to boot from MBR, GPT, BSD and VTOC8 schemes. MFC r227774: Add a section that explicitly describes partitioning schemes. Modify existing sections to refer to the new one. Rearrange partitioning scheme list so MBR and EBR types are together. Also add several corrections for grammar, clarity, and consistency. MFC r227777: Fix date. MFC r227800: Correct and expand BSD partitioning scheme description. Correct GUID to GPT in RECOVERING section. MFC r229838: Clarity improvements. MFC r229847: Whitespace-only fix. Approved by: gjb (mentor) Modified: stable/8/sbin/geom/class/part/gpart.8 Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) Modified: stable/8/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/8/sbin/geom/class/part/gpart.8 Tue Jan 31 00:49:34 2012 (r230797) +++ stable/8/sbin/geom/class/part/gpart.8 Tue Jan 31 01:43:03 2012 (r230798) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 19, 2011 +.Dd January 8, 2012 .Dt GPART 8 .Os .Sh NAME @@ -33,55 +33,25 @@ .Sh SYNOPSIS To add support for the disk partitioning GEOM class, place one or more of the following -lines in your kernel configuration file: +lines in the kernel configuration file: .Bd -ragged -offset indent .Cd "options GEOM_PART_APM" .Cd "options GEOM_PART_BSD" -.Cd "options GEOM_PART_EBR" -.Cd "options GEOM_PART_EBR_COMPAT" .Cd "options GEOM_PART_GPT" .Cd "options GEOM_PART_MBR" +.Cd "options GEOM_PART_EBR" +.Cd "options GEOM_PART_EBR_COMPAT" .Cd "options GEOM_PART_PC98" .Cd "options GEOM_PART_VTOC8" .Ed .Pp -The -.Dv GEOM_PART_APM -option adds support for the Apple Partition Map (APM) -found on Apple Macintosh computers. -The -.Dv GEOM_PART_BSD -option adds support for the traditional -.Bx -disklabel. -The -.Dv GEOM_PART_EBR -option adds support for the Extended Boot Record (EBR), -which is used to define a logical partition. -The -.Dv GEOM_PART_EBR_COMPAT -option enables backward compatibility for partition names -in the EBR scheme. Also it makes impossible any types of actions -with such partitions. -The -.Dv GEOM_PART_GPT -option adds support for the GUID Partition Table (GPT) -found on Intel Itanium computers and Intel-based Macintosh computers. -The -.Dv GEOM_PART_MBR -option adds support for the Master Boot Record (MBR) -found on PCs and used on many removable media. -The -.Dv GEOM_PART_PC98 -option adds support for the MBR variant as used on -NEC PC-98 computers. -The -.Dv GEOM_PART_VTOC8 -option adds support for Sun's SMI VTOC8 label as -found on computers based on -.Tn SPARC64 -and -.Tn UltraSPARC. +These options provide support for the various types of partitioning +schemes supported by the +.Ns Nm +utility. +See +.Sx "PARTITIONING SCHEMES" +below for more details. .Pp Usage of the .Ns Nm @@ -129,7 +99,7 @@ utility: .\" ==== DESTROY ==== .Nm .Cm destroy -.Op Fl F +.Op Fl F .Op Fl f Ar flags .Ar geom .\" ==== MODIFY ==== @@ -170,7 +140,8 @@ utility: .\" ==== SHOW ==== .Nm .Cm show -.Op Fl lrp +.Op Fl l | r +.Op Fl p .Op Ar geom ... .\" ==== UNDO ==== .Nm @@ -188,7 +159,7 @@ utility: The .Nm utility is used to partition GEOM providers, normally disks. -The first argument of which is the action to be taken: +The first argument is the action to be taken: .Bl -tag -width ".Cm bootcode" .\" ==== ADD ==== .It Cm add @@ -199,11 +170,14 @@ The partition begins on the logical bloc option. Its size is given by the .Fl s Ar size -option. SI unit suffixes are allowed. One or both +option. +SI unit suffixes are allowed. +One or both .Fl b and .Fl s -options can be ommitted. If so they are automatically calculated. +options can be omitted. +If so they are automatically calculated. The type of the partition is given by the .Fl t Ar type option. @@ -240,7 +214,7 @@ about its use. .El .\" ==== BACKUP ==== .It Cm backup -Dump a partition table to standard output in special format used by +Dump a partition table to standard output in a special format used by the .Cm restore action. .\" ==== BOOTCODE ==== @@ -285,18 +259,17 @@ about its use. .It Cm commit Commit any pending changes for geom .Ar geom . -All actions are being committed by default and will not result in +All actions are committed by default and will not result in pending changes. Actions can be modified with the .Fl f Ar flags -option so that they are not being committed by default. -As such, they become pending. +option so that they are not committed, but become pending. Pending changes are reflected by the geom and the .Nm utility, but they are not actually written to disk. The .Cm commit -action will write any and all pending changes to disk. +action will write all pending changes to disk. .\" ==== CREATE ==== .It Cm create Create a new partitioning scheme on a provider given by @@ -304,16 +277,16 @@ Create a new partitioning scheme on a pr The .Fl s Ar scheme option determines the scheme to use. -The kernel needs to have support for a particular scheme before +The kernel must have support for a particular scheme before that scheme can be used to partition a disk. .Pp Additional options include: .Bl -tag -width 10n .It Fl n Ar entries The number of entries in the partition table. -Every partitioning scheme has a minimum and a maximum number of entries -and this option allows tables to be created with the number of entries -that lies anywhere between the minimum and the maximum. +Every partitioning scheme has a minimum and maximum number of entries. +This option allows tables to be created with a number of entries +that is within the limits. Some schemes have a maximum equal to the minimum and some schemes have a maximum large enough to be considered unlimited. By default, partition tables are created with the minimum number of @@ -350,8 +323,8 @@ Destroy the partitioning scheme as imple .Pp Additional options include: .Bl -tag -width 10n -.It Fl F -Forced destroying of the partition table even if it is not empty. +.It Fl F +Forced destroying of the partition table even if it is not empty. .It Fl f Ar flags Additional operational flags. See the section entitled @@ -387,10 +360,10 @@ about its use. .El .\" ==== RECOVER ==== .It Cm recover -Recover corrupt partition's scheme metadata on the geom +Recover a corrupt partition's scheme metadata on the geom .Ar geom . See the section entitled -.Sx "RECOVERING" +.Sx RECOVERING below for the additional information. .Pp Additional options include: @@ -410,7 +383,7 @@ and further identified by the .Fl i Ar index option. New partition size is expressed in logical block -numbers and can be given by the +numbers and can be given by the .Fl s Ar size option. If @@ -438,13 +411,13 @@ about its use. .El .\" ==== RESTORE ==== .It Cm restore -Restore the partition table from backup previously created by +Restore the partition table from a backup previously created by the .Cm backup -action and given from standard input. -Only partition table may be restored. -This action does not affect content of partitions. -This mean that you should copy your data from backup after restoring -partition table and write bootcode again if it is needed. +action and read from standard input. +Only the partition table is restored. +This action does not affect the content of partitions. +After restoring the partition table and writing bootcode if needed, +user data must be restored from backup. .Pp Additional options include: .Bl -tag -width 10n @@ -465,7 +438,7 @@ about its use. .It Cm set Set the named attribute on the partition entry. See the section entitled -.Sx "ATTRIBUTES" +.Sx ATTRIBUTES below for a list of available attributes. .Pp Additional options include: @@ -484,7 +457,7 @@ or all geoms if none are specified. Additional options include: .Bl -tag -width 10n .It Fl l -For partition schemes that support partition labels print them +For partitioning schemes that support partition labels, print them instead of partition type. .It Fl p Show provider names instead of partition indexes. @@ -502,7 +475,7 @@ action and can be used to undo any chang .It Cm unset Clear the named attribute on the partition entry. See the section entitled -.Sx "ATTRIBUTES" +.Sx ATTRIBUTES below for a list of available attributes. .Pp Additional options include: @@ -515,39 +488,95 @@ below for a discussion about its use. .El .El -.\" +.Sh PARTITIONING SCHEMES +Several partitioning schemes are supported by the +.Nm +utility: +.Bl -tag -width ".Cm VTOC8" +.It Cm APM +Apple Partition Map, used by PowerPC(R) Macintosh(R) computers. +Requires the +.Cd GEOM_PART_APM +kernel option. +.It Cm BSD +Traditional BSD disklabel, usually used to subdivide MBR partitions. +.Po +This scheme can also be used as the sole partitioning method, without +an MBR. +Partition editing tools from other operating systems often do not +understand the bare disklabel partition layout, so this is sometimes +called +.Dq dangerously dedicated . +.Pc +Requires the +.Cm GEOM_PART_BSD +kernel option. +.It Cm GPT +GUID Partition Table is used on Intel-based Macintosh computers and +gradually replacing MBR on most PCs and other systems. +Requires the +.Cm GEOM_PART_GPT +kernel option. +.It Cm MBR +Master Boot Record is used on PCs and removable media. +Requires the +.Cm GEOM_PART_MBR +kernel option. +The +.Cm GEOM_PART_EBR +option adds support for the Extended Boot Record (EBR), +which is used to define a logical partition. +The +.Cm GEOM_PART_EBR_COMPAT +option enables backward compatibility for partition names +in the EBR scheme. +It also prevents any type of actions on such partitions. +.It Cm PC98 +An MBR variant for NEC PC-98 and compatible computers. +Requires the +.Cm GEOM_PART_PC98 +kernel option. +.It Cm VTOC8 +Sun's SMI Volume Table Of Contents, used by +.Tn SPARC64 +and +.Tn UltraSPARC +computers. +Requires the +.Cm GEOM_PART_VTOC8 +kernel option. +.El .Sh PARTITION TYPES Partition types are identified on disk by particular strings or magic values. The .Nm -utility uses symbolic names for common partition types to avoid the -user needing to know these values or other details of the partitioning +utility uses symbolic names for common partition types so the user +does not need to know these values or other details of the partitioning scheme in question. The .Nm utility also allows the user to specify scheme-specific partition types for partition types that do not have symbolic names. -The symbolic names currently understood are: +Symbolic names currently understood are: .Bl -tag -width ".Cm freebsd-vinum" .It Cm bios-boot The system partition dedicated to second stage of the boot loader program. -Usually it used by GRUB 2 loader when the partition table is GPT. +Usually it is used by the GRUB 2 loader for GPT partitioning schemes. The scheme-specific type is .Qq Li "!21686148-6449-6E6F-744E-656564454649" . .It Cm efi The system partition for computers that use the Extensible Firmware Interface (EFI). -In such cases, the GPT partitioning scheme is being used and the +In such cases, the GPT partitioning scheme is used and the actual partition type for the system partition can also be specified as .Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab" . .It Cm freebsd A .Fx -partition that uses the +partition subdivided into filesystems with a .Bx -disklabel to sub-divide the -partition into file systems. +disklabel. This is a legacy partition type and should not be used for the APM or GPT schemes. The scheme-specific types are @@ -576,7 +605,7 @@ for GPT, and tag 0x0901 for VTOC8. .It Cm freebsd-ufs A .Fx -partition that contains a UFS or UFS2 file system. +partition that contains a UFS or UFS2 filesystem. The scheme-specific types are .Qq Li "!FreeBSD-UFS" for APM, @@ -601,82 +630,82 @@ for APM, .Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT, and 0x0904 for VTOC8. .It Cm mbr -A partition that is sub-partitioned by a master boot record (MBR). +A partition that is sub-partitioned by a Master Boot Record (MBR). This type is known as .Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. .El .Sh ATTRIBUTES The scheme-specific attributes for EBR: -.Bl -tag -width ".Ar active" -.It Ar active +.Bl -tag -width ".Cm active" +.It Cm active .El .Pp The scheme-specific attributes for GPT: -.Bl -tag -width ".Ar bootfailed" -.It Ar bootme +.Bl -tag -width ".Cm bootfailed" +.It Cm bootme When set, the .Nm gptboot stage 1 boot loader will try to boot the system from this partition. Multiple partitions might be marked with the -.Ar bootme +.Cm bootme attribute. In such scenario the .Nm gptboot will try all -.Ar bootme +.Cm bootme partitions one by one, until the next boot stage is successfully entered. -.It Ar bootonce +.It Cm bootonce Setting this attribute automatically sets the -.Ar bootme +.Cm bootme attribute. When set, the .Nm gptboot stage 1 boot loader will try to boot the system from this partition only once. Partitions with both -.Ar bootonce +.Cm bootonce and -.Ar bootme +.Cm bootme attributes are tried before partitions with only the -.Ar bootme +.Cm bootme attribute. Before -.Ar bootonce +.Cm bootonce partition is tried, the .Nm gptboot removes the -.Ar bootme +.Cm bootme attribute and tries to execute the next boot stage. If it fails, the -.Ar bootonce +.Cm bootonce attribute that is now alone is replaced with the -.Ar bootfailed +.Cm bootfailed attribute. If the execution of the next boot stage succeeds, but the system is not fully booted, the .Nm gptboot will look for -.Ar bootonce +.Cm bootonce attributes alone (without the -.Ar bootme +.Cm bootme attribute) on the next system boot and will replace those with the -.Ar bootfailed +.Cm bootfailed attribute. If the system is fully booted, the .Pa /etc/rc.d/gptboot start-up script will look for partition with the -.Ar bootonce +.Cm bootonce attribute alone, will remove the attribute and log that the system was successfully booted from this partition. There should be at most one -.Ar bootonce +.Cm bootonce partition when system is successfully booted. Multiple partitions might be marked with the -.Ar bootonce +.Cm bootonce and -.Ar bootme +.Cm bootme attribute pairs. -.It Ar bootfailed +.It Cm bootfailed This attribute should not be manually managed. It is managed by the .Nm gptboot @@ -684,50 +713,51 @@ stage 1 boot loader and the .Pa /etc/rc.d/gptboot start-up script. This attribute is used to mark partitions that had the -.Ar bootonce +.Cm bootonce attribute set, but we failed to boot from them. Once we successfully boot, the .Pa /etc/rc.d/gptboot script will log all the partitions we failed to boot from and will remove the -.Ar bootfailed +.Cm bootfailed attributes. .El .Pp The scheme-specific attributes for MBR: -.Bl -tag -width ".Ar active" -.It Ar active +.Bl -tag -width ".Cm active" +.It Cm active .El .Pp The scheme-specific attributes for PC98: -.Bl -tag -width ".Ar bootable" -.It Ar active -.It Ar bootable +.Bl -tag -width ".Cm bootable" +.It Cm active +.It Cm bootable .El .Sh BOOTSTRAPPING .Fx supports several partitioning schemes and each scheme uses different bootstrap code. -The bootstrap code is located in the specific disk area for each partitioning -scheme and also it might have different size. +The bootstrap code is located in a specific disk area for each partitioning +scheme, and may vary in size for different schemes. .Pp -The bootstrap code could be separated into two types. -The first one is embedded in the partitioning scheme's metadata, the second -type is located on the specific partition. -The embedding bootstrap code should be done only with the +Bootstrap code can be separated into two types. +The first type is embedded in the partitioning scheme's metadata, while the +second type is located on a specific partition. +Embedding bootstrap code should only be done with the .Cm gpart bootcode -command with +command with the .Fl b Ar bootcode option. -The GEOM PART class has knowlege on how to embed bootstrap code into specific -partitioning scheme metadata without damage. +The GEOM PART class knows how to safely embed bootstrap code into +specific partitioning scheme metadata without causing any damage. .Pp -The Master Boot Record (MBR) uses 512-bytes bootstrap code image, embedded into -partition table's metadata area. +The Master Boot Record (MBR) uses a 512-byte bootstrap code image, embedded +into the partition table's metadata area. There are two variants of this bootstrap code: .Pa /boot/mbr and .Pa /boot/boot0 . -The first one searches partition with +.Pa /boot/mbr +searches for a partition with the .Cm active attribute (see the .Sx ATTRIBUTES @@ -735,9 +765,10 @@ section) in the partition table. Then it runs next bootstrap stage. The .Pa /boot/boot0 -image contains a boot manager with some additional interactive functions. +image contains a boot manager with some additional interactive functions +for multi-booting from a user-selected partition. .Pp -The BSD disklabel is usually created on top of the MBR partition (slice) +A BSD disklabel is usually created inside an MBR partition (slice) with type .Cm freebsd (see the @@ -745,17 +776,17 @@ with type section). It uses 8 KB size bootstrap code image .Pa /boot/boot , -embedded into partition table's metadata area. +embedded into the partition table's metadata area. .Pp Both types of bootstrap code are used to boot from the GUID Partition Table. -First of all, a protective MBR is embedded into first disk sector from the +First, a protective MBR is embedded into the first disk sector from the .Pa /boot/pmbr image. -It searches the +It searches the GPT .Cm freebsd-boot partition (see the .Sx "PARTITION TYPES" -section) in the GPT and runs next bootstrap stage from it. +section) in the GPT and runs the next bootstrap stage from it. The .Cm freebsd-boot partition should be smaller than 545 KB. @@ -763,37 +794,39 @@ There are two variants of bootstrap code .Pa /boot/gptboot and .Pa /boot/gptzfsboot . -The first one is used to boot from UFS. -It searches in the GPT partition with type -.Cm freebsd-ufs , -and it runs the third bootstrap stage ( -.Pa /boot/loader ) -if it is found. +.Pa /boot/gptboot +is used to boot from UFS. +It searches +.Cm freebsd-ufs +GPT partitions and starts +.Pa /boot/loader +.Pq the third bootstrap stage +if found. The .Pa /boot/gptzfsboot is used to boot from ZFS. -It searches partition with type +It searches .Cm freebsd-zfs -and starts +GPT partitions and starts .Pa /boot/zfsloader -from it. +if found. .Pp The VTOC8 scheme does not support embedding bootstrap code. Instead, the 8 KBytes bootstrap code image .Pa /boot/boot1 -should be written with +should be written with the .Cm gpart bootcode -command with +command with the .Fl p Ar bootcode option to all sufficiently large VTOC8 partitions. To do this the .Fl i Ar index -option could be ommited. +option could be omitted. .Pp The APM scheme also does not support embedding bootstrap code. Instead, the 800 KBytes bootstrap code image .Pa /boot/boot1.hfs -should be written with +should be written with the .Cm gpart bootcode command to a partition of type .Cm freebsd-boot , @@ -824,21 +857,22 @@ action or reverted with the action. .Sh RECOVERING The GEOM PART class supports recovering of partition tables only for GPT. -The GUID partition table has a primary and secondary (backup) copy of -metadata for redundance, these are stored at the begining and the end -of the device respectively. -As a result of having two copies, it is acceptable to have some corruption -within the metadata that is not fatal to the working of GPT. -When the kernel detects corrupt metadata it marks this table as corrupt and -reports the corruption. -Any operations on corrupt tables are prohibited except for +The GPT primary metadata is stored at the beginning of the device. +For redundancy, a secondary +.Pq backup +copy of the metadata is stored at the end of the device. +As a result of having two copies, some corruption of metadata is not +fatal to the working of GPT. +When the kernel detects corrupt metadata, it marks this table as corrupt +and reports the problem. .Cm destroy and -.Cm recover . +.Cm recover +are the only operations allowed on corrupt tables. .Pp If the first sector of a provider is corrupt, the kernel can not detect GPT -even if partition table itself is not corrupt. -You can rewrite the protective MBR using the +even if the partition table itself is not corrupt. +The protective MBR can be rewritten using the .Xr dd 1 command, to restore the ability to detect the GPT. The copy of the protective MBR is usually located in the @@ -869,7 +903,7 @@ will report about corrupt tables. If the size of the device has changed (e.g.\& volume expansion) the secondary GPT header will no longer be located in the last sector. This is not a metadata corruption, but it is dangerous because any -corruption of the primary GPT will lead to loss of partition table. +corruption of the primary GPT will lead to loss of the partition table. This problem is reported by the kernel with the message: .Bd -literal -offset indent GEOM: provider: the secondary GPT header is not in the last LBA. @@ -887,16 +921,34 @@ different GEOM providers, and some of th Be careful when choosing a provider for recovery. If you choose incorrectly you can destroy the metadata of another GEOM class, e.g.\& GEOM MIRROR or GEOM LABEL. +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variables can be used to control the behavior of the +.Nm PART +GEOM class. +The default value is shown next to each variable. +.Bl -tag -width indent +.It Va kern.geom.part.check_integrity : No 1 +This variable controls the behaviour of metadata integrity checks. +When integrity checks are enabled, the +.Nm PART +GEOM class verifies all generic partition parameters obtained from the +disk metadata. +If some inconsistency is detected, the partition table will be +rejected with a diagnostic message: +.Sy "GEOM_PART: Integrity check failed (provider, scheme)" . +.El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES -Create GPT scheme on -.Pa ad0 . +Create a GPT scheme on +.Pa ad0 : .Bd -literal -offset indent /sbin/gpart create -s GPT ad0 .Ed .Pp -Embed GPT bootstrap code into protective MBR. +Embed GPT bootstrap code into a protective MBR: .Bd -literal -offset indent /sbin/gpart bootcode -b /boot/pmbr ad0 .Ed @@ -912,9 +964,11 @@ This partition must be larger than .Pa /boot/gptboot , or the GPT boot you are planning to write, but smaller than 545 KB. A size of 15 blocks (7680 bytes) would be sufficient for -booting from UFS but let's use 128 blocks (64 KB) here in -this example, in order to reserve some space for potential -future need (e.g.\& from a ZFS partition). +booting from UFS but 128 blocks (64 KB) is used in +this example to reserve some space for potential +future need (e.g.\& a larger +.Pa /boot/gptzfsboot +for booting from a ZFS partition). .Bd -literal -offset indent /sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0 /sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 @@ -922,54 +976,91 @@ future need (e.g.\& from a ZFS partition .Pp Create a 512MB-sized .Cm freebsd-ufs -partition that would contain UFS where the system boots from. +partition to contain a UFS filesystem from which the system can boot. .Bd -literal -offset indent /sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 .Ed .Pp -Create VTOC8 scheme on -.Pa da0 . +Create an MBR scheme on +.Pa ada0 , +then create a 30GB-sized +.Fx +slice, mark it active and +install the +.Nm boot0 +boot manager: +.Bd -literal -offset indent +/sbin/gpart create -s MBR ada0 +/sbin/gpart add -t freebsd -s 30G ada0 +/sbin/gpart set -a active -i 1 ada0 +/sbin/gpart bootcode -b /boot/boot0 ada0 +.Ed +.Pp +Now create a +.Bx +scheme +.Pf ( Bx +label) with space for up to 20 partitions: +.Bd -literal -offset indent +/sbin/gpart create -s BSD -n 20 ada0s1 +.Ed +.Pp +Create a 1GB-sized UFS partition and a 4GB-sized swap partition: +.Bd -literal -offset indent +/sbin/gpart add -t freebsd-ufs -s 1G ada0s1 +/sbin/gpart add -t freebsd-swap -s 4G ada0s1 +.Ed +.Pp +Install bootstrap code for the +.Bx +label: +.Bd -literal -offset indent +/sbin/gpart bootcode -b /boot/boot ada0s1 +.Ed +.Pp +Create a VTOC8 scheme on +.Pa da0 : .Bd -literal -offset indent /sbin/gpart create -s VTOC8 da0 .Ed .Pp Create a 512MB-sized .Cm freebsd-ufs -partition that would contain UFS where the system boots from. +partition to contain a UFS filesystem from which the system can boot. .Bd -literal -offset indent /sbin/gpart add -s 512M -t freebsd-ufs da0 .Ed .Pp Create a 15GB-sized .Cm freebsd-ufs -partition that would contain UFS and aligned on 4KB boundaries: +partition to contain a UFS filesystem and aligned on 4KB boundaries: .Bd -literal -offset indent /sbin/gpart add -s 15G -t freebsd-ufs -a 4k da0 .Ed .Pp -After having created all required partitions, embed bootstrap code into them. +After creating all required partitions, embed bootstrap code into them: .Bd -literal -offset indent /sbin/gpart bootcode -p /boot/boot1 da0 .Ed .Pp -Create backup of partition table from -.Pa da0 +Create a backup of the partition table from +.Pa da0 : .Bd -literal -offset indent /sbin/gpart backup da0 > da0.backup .Ed .Pp -Restore partition table from backup to -.Pa da0 +Restore the partition table from the backup to +.Pa da0 : .Bd -literal -offset indent /sbin/gpart restore -l da0 < /mnt/da0.backup .Ed .Pp -Clone partition table from -.Pa ada0 -to -.Pa ada1 -and -.Pa ada2 +Clone the partition table from +.Pa ada0 +to +.Pa ada1 +and +.Pa ada2 : .Bd -literal -offset indent /sbin/gpart backup ada0 | /sbin/gpart restore -F ada1 ada2 .Ed From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 01:45:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6D1A106566B; Tue, 31 Jan 2012 01:45:20 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D7D48FC0C; Tue, 31 Jan 2012 01:45:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0V1jKPS012362; Tue, 31 Jan 2012 01:45:20 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0V1jKx7012357; Tue, 31 Jan 2012 01:45:20 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201201310145.q0V1jKx7012357@svn.freebsd.org> From: Attilio Rao Date: Tue, 31 Jan 2012 01:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230799 - in stable/9/sys: dev/ppbus sys vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 01:45:21 -0000 Author: attilio Date: Tue Jan 31 01:45:20 2012 New Revision: 230799 URL: http://svn.freebsd.org/changeset/base/230799 Log: MFC r227758,227759,227788: Introduce macro stubs in the mutex and sxlock implementation that will be always defined and will allow consumers, willing to provide options, file and line to locking requests, to not worry about options redefining the interfaces. This is typically useful when there is the need to build another locking interface on top of the mutex one. Requested by: kib Modified: stable/9/sys/dev/ppbus/ppb_base.c stable/9/sys/sys/mutex.h stable/9/sys/sys/sx.h stable/9/sys/vm/vm_map.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/ppbus/ppb_base.c ============================================================================== --- stable/9/sys/dev/ppbus/ppb_base.c Tue Jan 31 01:43:03 2012 (r230798) +++ stable/9/sys/dev/ppbus/ppb_base.c Tue Jan 31 01:45:20 2012 (r230799) @@ -236,11 +236,8 @@ ppb_unlock(device_t bus) void _ppb_assert_locked(device_t bus, const char *file, int line) { -#ifdef INVARIANTS - struct ppb_data *ppb = DEVTOSOFTC(bus); - _mtx_assert(ppb->ppc_lock, MA_OWNED, file, line); -#endif + mtx_assert_(DEVTOSOFTC(bus)->ppc_lock, MA_OWNED, file, line); } void Modified: stable/9/sys/sys/mutex.h ============================================================================== --- stable/9/sys/sys/mutex.h Tue Jan 31 01:43:03 2012 (r230798) +++ stable/9/sys/sys/mutex.h Tue Jan 31 01:45:20 2012 (r230799) @@ -81,6 +81,10 @@ * of the kernel via macros, thus allowing us to use the cpp LOCK_FILE * and LOCK_LINE. These functions should not be called directly by any * code using the API. Their macros cover their functionality. + * Functions with a `_' suffix are the entrypoint for the common + * KPI covering both compat shims and fast path case. These can be + * used by consumers willing to pass options, file and line + * informations, in an option-independent way. * * [See below for descriptions] * @@ -109,6 +113,11 @@ void _mtx_assert(struct mtx *m, int what #endif void _thread_lock_flags(struct thread *, int, const char *, int); +#define mtx_trylock_flags_(m, opts, file, line) \ + _mtx_trylock((m), (opts), (file), (line)) + +#define thread_lock_flags_(tdp, opts, file, line) \ + _thread_lock_flags((tdp), (opts), (file), (line)) #define thread_lock(tdp) \ _thread_lock_flags((tdp), 0, __FILE__, __LINE__) #define thread_lock_flags(tdp, opt) \ @@ -290,27 +299,48 @@ extern struct mtx_pool *mtxpool_sleep; #error LOCK_DEBUG not defined, include before #endif #if LOCK_DEBUG > 0 || defined(MUTEX_NOINLINE) -#define mtx_lock_flags(m, opts) \ - _mtx_lock_flags((m), (opts), LOCK_FILE, LOCK_LINE) -#define mtx_unlock_flags(m, opts) \ - _mtx_unlock_flags((m), (opts), LOCK_FILE, LOCK_LINE) -#define mtx_lock_spin_flags(m, opts) \ - _mtx_lock_spin_flags((m), (opts), LOCK_FILE, LOCK_LINE) -#define mtx_unlock_spin_flags(m, opts) \ - _mtx_unlock_spin_flags((m), (opts), LOCK_FILE, LOCK_LINE) +#define mtx_lock_flags_(m, opts, file, line) \ + _mtx_lock_flags((m), (opts), (file), (line)) +#define mtx_unlock_flags_(m, opts, file, line) \ + _mtx_unlock_flags((m), (opts), (file), (line)) +#define mtx_lock_spin_flags_(m, opts, file, line) \ + _mtx_lock_spin_flags((m), (opts), (file), (line)) +#define mtx_unlock_spin_flags_(m, opts, file, line) \ + _mtx_unlock_spin_flags((m), (opts), (file), (line)) #else /* LOCK_DEBUG == 0 && !MUTEX_NOINLINE */ +#define mtx_lock_flags_(m, opts, file, line) \ + __mtx_lock((m), curthread, (opts), (file), (line)) +#define mtx_unlock_flags_(m, opts, file, line) \ + __mtx_unlock((m), curthread, (opts), (file), (line)) +#define mtx_lock_spin_flags_(m, opts, file, line) \ + __mtx_lock_spin((m), curthread, (opts), (file), (line)) +#define mtx_unlock_spin_flags_(m, opts, file, line) \ + __mtx_unlock_spin((m)) +#endif /* LOCK_DEBUG > 0 || MUTEX_NOINLINE */ + +#ifdef INVARIANTS +#define mtx_assert_(m, what, file, line) \ + _mtx_assert((m), (what), (file), (line)) + +#define GIANT_REQUIRED mtx_assert_(&Giant, MA_OWNED, __FILE__, __LINE__) + +#else /* INVARIANTS */ +#define mtx_assert_(m, what, file, line) (void)0 +#define GIANT_REQUIRED +#endif /* INVARIANTS */ + #define mtx_lock_flags(m, opts) \ - __mtx_lock((m), curthread, (opts), LOCK_FILE, LOCK_LINE) + mtx_lock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_unlock_flags(m, opts) \ - __mtx_unlock((m), curthread, (opts), LOCK_FILE, LOCK_LINE) + mtx_unlock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_lock_spin_flags(m, opts) \ - __mtx_lock_spin((m), curthread, (opts), LOCK_FILE, LOCK_LINE) + mtx_lock_spin_flags_((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_unlock_spin_flags(m, opts) \ - __mtx_unlock_spin((m)) -#endif /* LOCK_DEBUG > 0 || MUTEX_NOINLINE */ - + mtx_unlock_spin_flags_((m), (opts), LOCK_FILE, LOCK_LINE) #define mtx_trylock_flags(m, opts) \ - _mtx_trylock((m), (opts), LOCK_FILE, LOCK_LINE) + mtx_trylock_flags_((m), (opts), LOCK_FILE, LOCK_LINE) +#define mtx_assert(m, what) \ + mtx_assert_((m), (what), __FILE__, __LINE__) #define mtx_sleep(chan, mtx, pri, wmesg, timo) \ _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), (timo)) @@ -398,17 +428,6 @@ struct mtx_args { #define MA_NOTRECURSED LA_NOTRECURSED #endif -#ifdef INVARIANTS -#define mtx_assert(m, what) \ - _mtx_assert((m), (what), __FILE__, __LINE__) - -#define GIANT_REQUIRED mtx_assert(&Giant, MA_OWNED) - -#else /* INVARIANTS */ -#define mtx_assert(m, what) (void)0 -#define GIANT_REQUIRED -#endif /* INVARIANTS */ - /* * Common lock type names. */ Modified: stable/9/sys/sys/sx.h ============================================================================== --- stable/9/sys/sys/sx.h Tue Jan 31 01:43:03 2012 (r230798) +++ stable/9/sys/sys/sx.h Tue Jan 31 01:45:20 2012 (r230799) @@ -115,6 +115,15 @@ void _sx_assert(struct sx *sx, int what, int sx_chain(struct thread *td, struct thread **ownerp); #endif +#define sx_downgrade_(sx, file, line) \ + _sx_downgrade((sx), (file), (line)) +#define sx_try_slock_(sx, file, line) \ + _sx_try_slock((sx), (file), (line)) +#define sx_try_xlock_(sx, file, line) \ + _sx_try_xlock((sx), (file), (line)) +#define sx_try_upgrade_(sx, file, line) \ + _sx_try_upgrade((sx), (file), (line)) + struct sx_args { struct sx *sa_sx; const char *sa_desc; @@ -208,30 +217,50 @@ __sx_sunlock(struct sx *sx, const char * #error "LOCK_DEBUG not defined, include before " #endif #if (LOCK_DEBUG > 0) || defined(SX_NOINLINE) -#define sx_xlock(sx) (void)_sx_xlock((sx), 0, LOCK_FILE, LOCK_LINE) -#define sx_xlock_sig(sx) \ - _sx_xlock((sx), SX_INTERRUPTIBLE, LOCK_FILE, LOCK_LINE) -#define sx_xunlock(sx) _sx_xunlock((sx), LOCK_FILE, LOCK_LINE) -#define sx_slock(sx) (void)_sx_slock((sx), 0, LOCK_FILE, LOCK_LINE) -#define sx_slock_sig(sx) \ - _sx_slock((sx), SX_INTERRUPTIBLE, LOCK_FILE, LOCK_LINE) -#define sx_sunlock(sx) _sx_sunlock((sx), LOCK_FILE, LOCK_LINE) +#define sx_xlock_(sx, file, line) \ + (void)_sx_xlock((sx), 0, (file), (line)) +#define sx_xlock_sig_(sx, file, line) \ + _sx_xlock((sx), SX_INTERRUPTIBLE, (file), (line)) +#define sx_xunlock_(sx, file, line) \ + _sx_xunlock((sx), (file), (line)) +#define sx_slock_(sx, file, line) \ + (void)_sx_slock((sx), 0, (file), (line)) +#define sx_slock_sig_(sx, file, line) \ + _sx_slock((sx), SX_INTERRUPTIBLE, (file) , (line)) +#define sx_sunlock_(sx, file, line) \ + _sx_sunlock((sx), (file), (line)) #else -#define sx_xlock(sx) \ - (void)__sx_xlock((sx), curthread, 0, LOCK_FILE, LOCK_LINE) -#define sx_xlock_sig(sx) \ - __sx_xlock((sx), curthread, SX_INTERRUPTIBLE, LOCK_FILE, LOCK_LINE) -#define sx_xunlock(sx) \ - __sx_xunlock((sx), curthread, LOCK_FILE, LOCK_LINE) -#define sx_slock(sx) (void)__sx_slock((sx), 0, LOCK_FILE, LOCK_LINE) -#define sx_slock_sig(sx) \ - __sx_slock((sx), SX_INTERRUPTIBLE, LOCK_FILE, LOCK_LINE) -#define sx_sunlock(sx) __sx_sunlock((sx), LOCK_FILE, LOCK_LINE) +#define sx_xlock_(sx, file, line) \ + (void)__sx_xlock((sx), curthread, 0, (file), (line)) +#define sx_xlock_sig_(sx, file, line) \ + __sx_xlock((sx), curthread, SX_INTERRUPTIBLE, (file), (line)) +#define sx_xunlock_(sx, file, line) \ + __sx_xunlock((sx), curthread, (file), (line)) +#define sx_slock_(sx, file, line) \ + (void)__sx_slock((sx), 0, (file), (line)) +#define sx_slock_sig_(sx, file, line) \ + __sx_slock((sx), SX_INTERRUPTIBLE, (file), (line)) +#define sx_sunlock_(sx, file, line) \ + __sx_sunlock((sx), (file), (line)) #endif /* LOCK_DEBUG > 0 || SX_NOINLINE */ -#define sx_try_slock(sx) _sx_try_slock((sx), LOCK_FILE, LOCK_LINE) -#define sx_try_xlock(sx) _sx_try_xlock((sx), LOCK_FILE, LOCK_LINE) -#define sx_try_upgrade(sx) _sx_try_upgrade((sx), LOCK_FILE, LOCK_LINE) -#define sx_downgrade(sx) _sx_downgrade((sx), LOCK_FILE, LOCK_LINE) +#define sx_try_slock(sx) sx_try_slock_((sx), LOCK_FILE, LOCK_LINE) +#define sx_try_xlock(sx) sx_try_xlock_((sx), LOCK_FILE, LOCK_LINE) +#define sx_try_upgrade(sx) sx_try_upgrade_((sx), LOCK_FILE, LOCK_LINE) +#define sx_downgrade(sx) sx_downgrade_((sx), LOCK_FILE, LOCK_LINE) +#ifdef INVARIANTS +#define sx_assert_(sx, what, file, line) \ + _sx_assert((sx), (what), (file), (line)) +#else +#define sx_assert_(sx, what, file, line) (void)0 +#endif + +#define sx_xlock(sx) sx_xlock_((sx), LOCK_FILE, LOCK_LINE) +#define sx_xlock_sig(sx) sx_xlock_sig_((sx), LOCK_FILE, LOCK_LINE) +#define sx_xunlock(sx) sx_xunlock_((sx), LOCK_FILE, LOCK_LINE) +#define sx_slock(sx) sx_slock_((sx), LOCK_FILE, LOCK_LINE) +#define sx_slock_sig(sx) sx_slock_sig_((sx), LOCK_FILE, LOCK_LINE) +#define sx_sunlock(sx) sx_sunlock_((sx), LOCK_FILE, LOCK_LINE) +#define sx_assert(sx, what) sx_assert_((sx), (what), __FILE__, __LINE__) /* * Return a pointer to the owning thread if the lock is exclusively @@ -245,13 +274,15 @@ __sx_sunlock(struct sx *sx, const char * (((sx)->sx_lock & ~(SX_LOCK_FLAGMASK & ~SX_LOCK_SHARED)) == \ (uintptr_t)curthread) -#define sx_unlock(sx) do { \ +#define sx_unlock_(sx, file, line) do { \ if (sx_xlocked(sx)) \ - sx_xunlock(sx); \ + sx_xunlock_(sx, file, line); \ else \ - sx_sunlock(sx); \ + sx_sunlock_(sx, file, line); \ } while (0) +#define sx_unlock(sx) sx_unlock_((sx), LOCK_FILE, LOCK_LINE) + #define sx_sleep(chan, sx, pri, wmesg, timo) \ _sleep((chan), &(sx)->lock_object, (pri), (wmesg), (timo)) @@ -287,12 +318,6 @@ __sx_sunlock(struct sx *sx, const char * #define SX_NOTRECURSED LA_NOTRECURSED #endif -#ifdef INVARIANTS -#define sx_assert(sx, what) _sx_assert((sx), (what), LOCK_FILE, LOCK_LINE) -#else -#define sx_assert(sx, what) (void)0 -#endif - #endif /* _KERNEL */ #endif /* !_SYS_SX_H_ */ Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Tue Jan 31 01:43:03 2012 (r230798) +++ stable/9/sys/vm/vm_map.c Tue Jan 31 01:45:20 2012 (r230799) @@ -464,9 +464,9 @@ _vm_map_lock(vm_map_t map, const char *f { if (map->system_map) - _mtx_lock_flags(&map->system_mtx, 0, file, line); + mtx_lock_flags_(&map->system_mtx, 0, file, line); else - (void)_sx_xlock(&map->lock, 0, file, line); + sx_xlock_(&map->lock, file, line); map->timestamp++; } @@ -489,9 +489,9 @@ _vm_map_unlock(vm_map_t map, const char { if (map->system_map) - _mtx_unlock_flags(&map->system_mtx, 0, file, line); + mtx_unlock_flags_(&map->system_mtx, 0, file, line); else { - _sx_xunlock(&map->lock, file, line); + sx_xunlock_(&map->lock, file, line); vm_map_process_deferred(); } } @@ -501,9 +501,9 @@ _vm_map_lock_read(vm_map_t map, const ch { if (map->system_map) - _mtx_lock_flags(&map->system_mtx, 0, file, line); + mtx_lock_flags_(&map->system_mtx, 0, file, line); else - (void)_sx_slock(&map->lock, 0, file, line); + sx_slock_(&map->lock, file, line); } void @@ -511,9 +511,9 @@ _vm_map_unlock_read(vm_map_t map, const { if (map->system_map) - _mtx_unlock_flags(&map->system_mtx, 0, file, line); + mtx_unlock_flags_(&map->system_mtx, 0, file, line); else { - _sx_sunlock(&map->lock, file, line); + sx_sunlock_(&map->lock, file, line); vm_map_process_deferred(); } } @@ -524,8 +524,8 @@ _vm_map_trylock(vm_map_t map, const char int error; error = map->system_map ? - !_mtx_trylock(&map->system_mtx, 0, file, line) : - !_sx_try_xlock(&map->lock, file, line); + !mtx_trylock_flags_(&map->system_mtx, 0, file, line) : + !sx_try_xlock_(&map->lock, file, line); if (error == 0) map->timestamp++; return (error == 0); @@ -537,8 +537,8 @@ _vm_map_trylock_read(vm_map_t map, const int error; error = map->system_map ? - !_mtx_trylock(&map->system_mtx, 0, file, line) : - !_sx_try_slock(&map->lock, file, line); + !mtx_trylock_flags_(&map->system_mtx, 0, file, line) : + !sx_try_slock_(&map->lock, file, line); return (error == 0); } @@ -558,21 +558,19 @@ _vm_map_lock_upgrade(vm_map_t map, const unsigned int last_timestamp; if (map->system_map) { -#ifdef INVARIANTS - _mtx_assert(&map->system_mtx, MA_OWNED, file, line); -#endif + mtx_assert_(&map->system_mtx, MA_OWNED, file, line); } else { - if (!_sx_try_upgrade(&map->lock, file, line)) { + if (!sx_try_upgrade_(&map->lock, file, line)) { last_timestamp = map->timestamp; - _sx_sunlock(&map->lock, file, line); + sx_sunlock_(&map->lock, file, line); vm_map_process_deferred(); /* * If the map's timestamp does not change while the * map is unlocked, then the upgrade succeeds. */ - (void)_sx_xlock(&map->lock, 0, file, line); + sx_xlock_(&map->lock, file, line); if (last_timestamp != map->timestamp) { - _sx_xunlock(&map->lock, file, line); + sx_xunlock_(&map->lock, file, line); return (1); } } @@ -586,11 +584,9 @@ _vm_map_lock_downgrade(vm_map_t map, con { if (map->system_map) { -#ifdef INVARIANTS - _mtx_assert(&map->system_mtx, MA_OWNED, file, line); -#endif + mtx_assert_(&map->system_mtx, MA_OWNED, file, line); } else - _sx_downgrade(&map->lock, file, line); + sx_downgrade_(&map->lock, file, line); } /* @@ -615,30 +611,15 @@ _vm_map_assert_locked(vm_map_t map, cons { if (map->system_map) - _mtx_assert(&map->system_mtx, MA_OWNED, file, line); - else - _sx_assert(&map->lock, SA_XLOCKED, file, line); -} - -#if 0 -static void -_vm_map_assert_locked_read(vm_map_t map, const char *file, int line) -{ - - if (map->system_map) - _mtx_assert(&map->system_mtx, MA_OWNED, file, line); + mtx_assert_(&map->system_mtx, MA_OWNED, file, line); else - _sx_assert(&map->lock, SA_SLOCKED, file, line); + sx_assert_(&map->lock, SA_XLOCKED, file, line); } -#endif #define VM_MAP_ASSERT_LOCKED(map) \ _vm_map_assert_locked(map, LOCK_FILE, LOCK_LINE) -#define VM_MAP_ASSERT_LOCKED_READ(map) \ - _vm_map_assert_locked_read(map, LOCK_FILE, LOCK_LINE) #else #define VM_MAP_ASSERT_LOCKED(map) -#define VM_MAP_ASSERT_LOCKED_READ(map) #endif /* @@ -661,9 +642,9 @@ _vm_map_unlock_and_wait(vm_map_t map, in mtx_lock(&map_sleep_mtx); if (map->system_map) - _mtx_unlock_flags(&map->system_mtx, 0, file, line); + mtx_unlock_flags_(&map->system_mtx, 0, file, line); else - _sx_xunlock(&map->lock, file, line); + sx_xunlock_(&map->lock, file, line); return (msleep(&map->root, &map_sleep_mtx, PDROP | PVM, "vmmaps", timo)); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 01:51:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D49E106564A; Tue, 31 Jan 2012 01:51:31 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 076178FC18; Tue, 31 Jan 2012 01:51:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0V1pUgf012597; Tue, 31 Jan 2012 01:51:30 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0V1pUaZ012592; Tue, 31 Jan 2012 01:51:30 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201201310151.q0V1pUaZ012592@svn.freebsd.org> From: Attilio Rao Date: Tue, 31 Jan 2012 01:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230800 - stable/9/sys/dev/ppbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 01:51:31 -0000 Author: attilio Date: Tue Jan 31 01:51:30 2012 New Revision: 230800 URL: http://svn.freebsd.org/changeset/base/230800 Log: MFC r227814: - Use ppb_assert_locked() rather than using explicit mtx_assert call - Make ppbus code agnostic in regard of INVARIANTS option Modified: stable/9/sys/dev/ppbus/lpt.c stable/9/sys/dev/ppbus/ppb_base.c stable/9/sys/dev/ppbus/ppb_msq.c stable/9/sys/dev/ppbus/vpo.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/ppbus/lpt.c ============================================================================== --- stable/9/sys/dev/ppbus/lpt.c Tue Jan 31 01:45:20 2012 (r230799) +++ stable/9/sys/dev/ppbus/lpt.c Tue Jan 31 01:51:30 2012 (r230800) @@ -447,10 +447,9 @@ lptout(void *arg) { struct lpt_data *sc = arg; device_t dev = sc->sc_dev; -#if defined(INVARIANTS) || defined(LPT_DEBUG) - device_t ppbus = device_get_parent(dev); -#endif + device_t ppbus; + ppbus = device_get_parent(dev); ppb_assert_locked(ppbus); lprintf(("T %x ", ppb_rstr(ppbus))); if (sc->sc_state & OPEN) { Modified: stable/9/sys/dev/ppbus/ppb_base.c ============================================================================== --- stable/9/sys/dev/ppbus/ppb_base.c Tue Jan 31 01:45:20 2012 (r230799) +++ stable/9/sys/dev/ppbus/ppb_base.c Tue Jan 31 01:51:30 2012 (r230800) @@ -60,7 +60,7 @@ ppb_poll_bus(device_t bus, int max, int i, j, error; char r; - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); /* try at least up to 10ms */ for (j = 0; j < ((how & PPB_POLL) ? max : 1); j++) { @@ -96,12 +96,9 @@ ppb_poll_bus(device_t bus, int max, int ppb_get_epp_protocol(device_t bus) { -#ifdef INVARIANTS - struct ppb_data *ppb = DEVTOSOFTC(bus); -#endif uintptr_t protocol; - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); BUS_READ_IVAR(device_get_parent(bus), bus, PPC_IVAR_EPP_PROTO, &protocol); return (protocol); @@ -117,7 +114,7 @@ ppb_get_mode(device_t bus) struct ppb_data *ppb = DEVTOSOFTC(bus); /* XXX yet device mode = ppbus mode = chipset mode */ - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); return (ppb->mode); } @@ -132,7 +129,7 @@ ppb_set_mode(device_t bus, int mode) struct ppb_data *ppb = DEVTOSOFTC(bus); int old_mode = ppb_get_mode(bus); - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); if (PPBUS_SETMODE(device_get_parent(bus), mode)) return (-1); @@ -150,11 +147,8 @@ ppb_set_mode(device_t bus, int mode) int ppb_write(device_t bus, char *buf, int len, int how) { -#ifdef INVARIANTS - struct ppb_data *ppb = DEVTOSOFTC(bus); -#endif - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); return (PPBUS_WRITE(device_get_parent(bus), buf, len, how)); } @@ -166,11 +160,8 @@ ppb_write(device_t bus, char *buf, int l int ppb_reset_epp_timeout(device_t bus) { -#ifdef INVARIANTS - struct ppb_data *ppb = DEVTOSOFTC(bus); -#endif - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); return(PPBUS_RESET_EPP(device_get_parent(bus))); } @@ -182,11 +173,8 @@ ppb_reset_epp_timeout(device_t bus) int ppb_ecp_sync(device_t bus) { -#ifdef INVARIANTS - struct ppb_data *ppb = DEVTOSOFTC(bus); -#endif - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); return (PPBUS_ECP_SYNC(device_get_parent(bus))); } @@ -198,12 +186,9 @@ ppb_ecp_sync(device_t bus) int ppb_get_status(device_t bus, struct ppb_status *status) { -#ifdef INVARIANTS - struct ppb_data *ppb = DEVTOSOFTC(bus); -#endif register char r; - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); r = status->status = ppb_rstr(bus); Modified: stable/9/sys/dev/ppbus/ppb_msq.c ============================================================================== --- stable/9/sys/dev/ppbus/ppb_msq.c Tue Jan 31 01:45:20 2012 (r230799) +++ stable/9/sys/dev/ppbus/ppb_msq.c Tue Jan 31 01:51:30 2012 (r230800) @@ -117,13 +117,10 @@ mode2xfer(device_t bus, struct ppb_devic int ppb_MS_init(device_t bus, device_t dev, struct ppb_microseq *loop, int opcode) { -#ifdef INVARIANTS - struct ppb_data *ppb = device_get_softc(bus); -#endif struct ppb_device *ppbdev = (struct ppb_device *)device_get_ivars(dev); struct ppb_xfer *xfer = mode2xfer(bus, ppbdev, opcode); - mtx_assert(ppb->ppc_lock, MA_OWNED); + ppb_assert_locked(bus); xfer->loop = loop; return (0); Modified: stable/9/sys/dev/ppbus/vpo.c ============================================================================== --- stable/9/sys/dev/ppbus/vpo.c Tue Jan 31 01:45:20 2012 (r230799) +++ stable/9/sys/dev/ppbus/vpo.c Tue Jan 31 01:51:30 2012 (r230800) @@ -298,11 +298,8 @@ static void vpo_action(struct cam_sim *sim, union ccb *ccb) { struct vpo_data *vpo = (struct vpo_data *)sim->softc; -#ifdef INVARIANTS - device_t ppbus = device_get_parent(vpo->vpo_dev); - ppb_assert_locked(ppbus); -#endif + ppb_assert_locked(device_get_parent(vpo->vpo_dev)); switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: { From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 02:11:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B00BF106566B; Tue, 31 Jan 2012 02:11:05 +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 99F858FC12; Tue, 31 Jan 2012 02:11:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0V2B54g013412; Tue, 31 Jan 2012 02:11:05 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0V2B5u8013410; Tue, 31 Jan 2012 02:11:05 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201310211.q0V2B5u8013410@svn.freebsd.org> From: Rick Macklem Date: Tue, 31 Jan 2012 02:11: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: r230801 - head/sys/nlm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 02:11:05 -0000 Author: rmacklem Date: Tue Jan 31 02:11:05 2012 New Revision: 230801 URL: http://svn.freebsd.org/changeset/base/230801 Log: jwd@ reported a problem via email to freebsd-fs@ on Aug 25, 2011 under the subject "F_RDLCK lock to FreeBSD NFS fails to R/O target file". This occurred because the server side NLM always checked for VWRITE access, irrespective of the type of lock request. This patch replaces VOP_ACCESS(..VWRITE..) with one appropriate to the lock operation. It allows unlock and lock cancellation to be done without a check of VOP_ACCESS(), so that files can't be left locked indefinitely after the file permissions have been changed. Discussed with: zack Submitted by: jwd (earlier version) Reviewed by: dfr MFC after: 2 weeks Modified: head/sys/nlm/nlm_prot_impl.c Modified: head/sys/nlm/nlm_prot_impl.c ============================================================================== --- head/sys/nlm/nlm_prot_impl.c Tue Jan 31 01:51:30 2012 (r230800) +++ head/sys/nlm/nlm_prot_impl.c Tue Jan 31 02:11:05 2012 (r230801) @@ -1775,10 +1775,10 @@ struct vfs_state { static int nlm_get_vfs_state(struct nlm_host *host, struct svc_req *rqstp, - fhandle_t *fhp, struct vfs_state *vs) + fhandle_t *fhp, struct vfs_state *vs, accmode_t accmode) { int error, exflags; - struct ucred *cred = NULL, *credanon; + struct ucred *cred = NULL, *credanon = NULL; memset(vs, 0, sizeof(*vs)); @@ -1788,14 +1788,19 @@ nlm_get_vfs_state(struct nlm_host *host, } vs->vs_vfslocked = VFS_LOCK_GIANT(vs->vs_mp); - error = VFS_CHECKEXP(vs->vs_mp, (struct sockaddr *)&host->nh_addr, - &exflags, &credanon, NULL, NULL); - if (error) - goto out; + /* accmode == 0 means don't check, since it is an unlock. */ + if (accmode != 0) { + error = VFS_CHECKEXP(vs->vs_mp, + (struct sockaddr *)&host->nh_addr, &exflags, &credanon, + NULL, NULL); + if (error) + goto out; - if (exflags & MNT_EXRDONLY || (vs->vs_mp->mnt_flag & MNT_RDONLY)) { - error = EROFS; - goto out; + if (exflags & MNT_EXRDONLY || + (vs->vs_mp->mnt_flag & MNT_RDONLY)) { + error = EROFS; + goto out; + } } error = VFS_FHTOVP(vs->vs_mp, &fhp->fh_fid, LK_EXCLUSIVE, &vs->vs_vp); @@ -1803,22 +1808,31 @@ nlm_get_vfs_state(struct nlm_host *host, goto out; vs->vs_vnlocked = TRUE; - if (!svc_getcred(rqstp, &cred, NULL)) { - error = EINVAL; - goto out; - } - if (cred->cr_uid == 0 || (exflags & MNT_EXPORTANON)) { - crfree(cred); - cred = credanon; - credanon = NULL; - } + if (accmode != 0) { + if (!svc_getcred(rqstp, &cred, NULL)) { + error = EINVAL; + goto out; + } + if (cred->cr_uid == 0 || (exflags & MNT_EXPORTANON)) { + crfree(cred); + cred = credanon; + credanon = NULL; + } - /* - * Check cred. - */ - error = VOP_ACCESS(vs->vs_vp, VWRITE, cred, curthread); - if (error) - goto out; + /* + * Check cred. + */ + error = VOP_ACCESS(vs->vs_vp, accmode, cred, curthread); + /* + * If this failed and accmode != VWRITE, try again with + * VWRITE to maintain backwards compatibility with the + * old code that always used VWRITE. + */ + if (error != 0 && accmode != VWRITE) + error = VOP_ACCESS(vs->vs_vp, VWRITE, cred, curthread); + if (error) + goto out; + } #if __FreeBSD_version < 800011 VOP_UNLOCK(vs->vs_vp, 0, curthread); @@ -1872,6 +1886,7 @@ nlm_do_test(nlm4_testargs *argp, nlm4_te struct nlm_host *host, *bhost; int error, sysid; struct flock fl; + accmode_t accmode; memset(result, 0, sizeof(*result)); memset(&vs, 0, sizeof(vs)); @@ -1897,7 +1912,8 @@ nlm_do_test(nlm4_testargs *argp, nlm4_te goto out; } - error = nlm_get_vfs_state(host, rqstp, &fh, &vs); + accmode = argp->exclusive ? VWRITE : VREAD; + error = nlm_get_vfs_state(host, rqstp, &fh, &vs, accmode); if (error) { result->stat.stat = nlm_convert_error(error); goto out; @@ -1968,6 +1984,7 @@ nlm_do_lock(nlm4_lockargs *argp, nlm4_re struct nlm_host *host; int error, sysid; struct flock fl; + accmode_t accmode; memset(result, 0, sizeof(*result)); memset(&vs, 0, sizeof(vs)); @@ -2002,7 +2019,8 @@ nlm_do_lock(nlm4_lockargs *argp, nlm4_re goto out; } - error = nlm_get_vfs_state(host, rqstp, &fh, &vs); + accmode = argp->exclusive ? VWRITE : VREAD; + error = nlm_get_vfs_state(host, rqstp, &fh, &vs, accmode); if (error) { result->stat.stat = nlm_convert_error(error); goto out; @@ -2181,7 +2199,7 @@ nlm_do_cancel(nlm4_cancargs *argp, nlm4_ goto out; } - error = nlm_get_vfs_state(host, rqstp, &fh, &vs); + error = nlm_get_vfs_state(host, rqstp, &fh, &vs, (accmode_t)0); if (error) { result->stat.stat = nlm_convert_error(error); goto out; @@ -2270,7 +2288,7 @@ nlm_do_unlock(nlm4_unlockargs *argp, nlm goto out; } - error = nlm_get_vfs_state(host, rqstp, &fh, &vs); + error = nlm_get_vfs_state(host, rqstp, &fh, &vs, (accmode_t)0); if (error) { result->stat.stat = nlm_convert_error(error); goto out; From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 02:30:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0AE91065679; Tue, 31 Jan 2012 02:30:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABD488FC18; Tue, 31 Jan 2012 02:30:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0V2UlPY014297; Tue, 31 Jan 2012 02:30:47 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0V2UlRu014295; Tue, 31 Jan 2012 02:30:47 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201201310230.q0V2UlRu014295@svn.freebsd.org> From: Justin Hibbits Date: Tue, 31 Jan 2012 02:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230802 - stable/9/etc/devd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 02:30:47 -0000 Author: jhibbits Date: Tue Jan 31 02:30:47 2012 New Revision: 230802 URL: http://svn.freebsd.org/changeset/base/230802 Log: MFC r230640: Remove the notify match from a couple devd apple events, the events don't include notify tags. Approved by: nwhitehorn (mentor) Modified: stable/9/etc/devd/apple.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/devd/apple.conf ============================================================================== --- stable/9/etc/devd/apple.conf Tue Jan 31 02:11:05 2012 (r230801) +++ stable/9/etc/devd/apple.conf Tue Jan 31 02:30:47 2012 (r230802) @@ -6,7 +6,6 @@ notify 0 { match "system" "PMU"; match "subsystem" "Button"; - match "notify" "0x0"; action "shutdown -p now"; }; @@ -16,7 +15,6 @@ notify 0 { match "system" "PMU"; match "subsystem" "lid"; match "type" "close"; - match "notify" "0x0"; action "shutdown -p now"; }; From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 03:58:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5682B106564A; Tue, 31 Jan 2012 03:58:27 +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 25F248FC08; Tue, 31 Jan 2012 03:58:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0V3wRj2017272; Tue, 31 Jan 2012 03:58:27 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0V3wQDt017269; Tue, 31 Jan 2012 03:58:26 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201310358.q0V3wQDt017269@svn.freebsd.org> From: Rick Macklem Date: Tue, 31 Jan 2012 03:58: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: r230803 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 03:58:27 -0000 Author: rmacklem Date: Tue Jan 31 03:58:26 2012 New Revision: 230803 URL: http://svn.freebsd.org/changeset/base/230803 Log: When a "mount -u" switches an NFS mount point from TCP to UDP, any thread doing an I/O RPC with a transfer size greater than NFS_UDPMAXDATA will be hung indefinitely, retrying the RPC. After a discussion on freebsd-fs@, I decided to add a warning message for this case, as suggested by Jeremy Chadwick. Suggested by: freebsd at jdc.parodius.com (Jeremy Chadwick) MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/nfsclient/nfs_vfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Tue Jan 31 02:30:47 2012 (r230802) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Tue Jan 31 03:58:26 2012 (r230803) @@ -999,6 +999,19 @@ nfs_mount(struct mount *mp) error = EIO; goto out; } + + /* + * If a change from TCP->UDP is done and there are thread(s) + * that have I/O RPC(s) in progress with a tranfer size + * greater than NFS_MAXDGRAMDATA, those thread(s) will be + * hung, retrying the RPC(s) forever. Usually these threads + * will be seen doing an uninterruptible sleep on wait channel + * "newnfsreq" (truncated to "newnfsre" by procstat). + */ + if (args.sotype == SOCK_DGRAM && nmp->nm_sotype == SOCK_STREAM) + tprintf(td->td_proc, LOG_WARNING, + "Warning: mount -u that changes TCP->UDP can result in hung threads\n"); + /* * When doing an update, we can't change version, * security, switch lockd strategies or change cookie Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Tue Jan 31 02:30:47 2012 (r230802) +++ head/sys/nfsclient/nfs_vfsops.c Tue Jan 31 03:58:26 2012 (r230803) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1116,6 +1117,19 @@ nfs_mount(struct mount *mp) error = EIO; goto out; } + + /* + * If a change from TCP->UDP is done and there are thread(s) + * that have I/O RPC(s) in progress with a tranfer size + * greater than NFS_MAXDGRAMDATA, those thread(s) will be + * hung, retrying the RPC(s) forever. Usually these threads + * will be seen doing an uninterruptible sleep on wait channel + * "newnfsreq" (truncated to "newnfsre" by procstat). + */ + if (args.sotype == SOCK_DGRAM && nmp->nm_sotype == SOCK_STREAM) + tprintf(curthread->td_proc, LOG_WARNING, + "Warning: mount -u that changes TCP->UDP can result in hung threads\n"); + /* * When doing an update, we can't change from or to * v3, switch lockd strategies or change cookie translation From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 05:49:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8054D1065670; Tue, 31 Jan 2012 05:49:50 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B7118FC08; Tue, 31 Jan 2012 05:49:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0V5noIN020640; Tue, 31 Jan 2012 05:49:50 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0V5noKI020638; Tue, 31 Jan 2012 05:49:50 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201310549.q0V5noKI020638@svn.freebsd.org> From: Kevin Lo Date: Tue, 31 Jan 2012 05:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230804 - head/usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 05:49:50 -0000 Author: kevlo Date: Tue Jan 31 05:49:49 2012 New Revision: 230804 URL: http://svn.freebsd.org/changeset/base/230804 Log: Fix a whitespace nit Reviewed by: bz Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 ============================================================================== --- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Tue Jan 31 03:58:26 2012 (r230803) +++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Tue Jan 31 05:49:49 2012 (r230804) @@ -73,7 +73,7 @@ exec 3>&- echo $INTERFACE $IF_CONFIG | awk -v prefix="$IFCONFIG_PREFIX" '{ - printf("ifconfig_%s=\"%s inet %s netmask %s\"\n", $1, prefix, $2, $3); + printf("ifconfig_%s=\"%s\inet %s netmask %s\"\n", $1, prefix, $2, $3); printf("defaultrouter=\"%s\"\n", $4); }' >> $BSDINSTALL_TMPETC/._rc.conf.net From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 06:21:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 938CB106564A for ; Tue, 31 Jan 2012 06:21:53 +0000 (UTC) (envelope-from perl-win32-users-bounces@listserv.ActiveState.com) Received: from mx.activestate.com (mx.activestate.com [204.244.102.3]) by mx1.freebsd.org (Postfix) with ESMTP id 741C78FC1A for ; Tue, 31 Jan 2012 06:21:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by mx.activestate.com (Postfix) with ESMTP id 75F621801E for ; Mon, 30 Jan 2012 21:48:48 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit From: perl-win32-users-bounces@listserv.ActiveState.com To: svn-src-all@freebsd.org Message-ID: Date: Mon, 30 Jan 2012 21:48:47 -0800 Precedence: bulk X-BeenThere: perl-win32-users@listserv.ActiveState.com X-Mailman-Version: 2.1.8 X-List-Administrivia: yes Sender: perl-win32-users-bounces@listserv.ActiveState.com Errors-To: perl-win32-users-bounces@listserv.ActiveState.com Subject: Your message to Perl-Win32-Users awaits moderator approval X-BeenThere: svn-src-all@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 06:21:53 -0000 Your mail to 'Perl-Win32-Users' with the subject Returned mail: Data format error Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will receive notification of the moderator's decision. If you would like to cancel this posting, please visit the following URL: http://listserv.ActiveState.com/mailman/confirm/perl-win32-users/7bd90b9a44fdfe5210af6eca0fedc10befda91b7 From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 10:46:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0D121065675; Tue, 31 Jan 2012 10:46:51 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E97E8FC08; Tue, 31 Jan 2012 10:46:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VAkpgs031833; Tue, 31 Jan 2012 10:46:51 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VAkpWD031831; Tue, 31 Jan 2012 10:46:51 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201311046.q0VAkpWD031831@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 31 Jan 2012 10:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230805 - stable/7/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 10:46:51 -0000 Author: pluknet Date: Tue Jan 31 10:46:51 2012 New Revision: 230805 URL: http://svn.freebsd.org/changeset/base/230805 Log: MFC r230531: Remove unused variable. Modified: stable/7/sys/netinet6/nd6.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet6/nd6.c ============================================================================== --- stable/7/sys/netinet6/nd6.c Tue Jan 31 05:49:49 2012 (r230804) +++ stable/7/sys/netinet6/nd6.c Tue Jan 31 10:46:51 2012 (r230805) @@ -534,7 +534,6 @@ nd6_timer(void *ignored_arg) struct nd_defrouter *dr; struct nd_prefix *pr; struct in6_ifaddr *ia6, *nia6; - struct in6_addrlifetime *lt6; callout_reset(&nd6_timer_ch, nd6_prune * hz, nd6_timer, NULL); @@ -563,7 +562,6 @@ nd6_timer(void *ignored_arg) for (ia6 = in6_ifaddr; ia6; ia6 = nia6) { nia6 = ia6->ia_next; /* check address lifetime */ - lt6 = &ia6->ia6_lifetime; if (IFA6_IS_INVALID(ia6)) { int regen = 0; From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 10:54:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D3531065670; Tue, 31 Jan 2012 10:54:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 25E988FC08; Tue, 31 Jan 2012 10:54:40 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q0VAsXTo033843 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 31 Jan 2012 12:54:33 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q0VAsWqD046948; Tue, 31 Jan 2012 12:54:32 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q0VAsVqk046946; Tue, 31 Jan 2012 12:54:31 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 31 Jan 2012 12:54:31 +0200 From: Konstantin Belousov To: Bruce Evans , Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: <20120131105431.GB3283@deviant.kiev.zoral.com.ua> References: <20120126153641.GA68112@FreeBSD.org> <20120127194612.H1547@besplex.bde.org> <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> <20120127194221.GA25723@zim.MIT.EDU> <20120128123748.GD2726@deviant.kiev.zoral.com.ua> <20120129001225.GA32220@zim.MIT.EDU> <20120129062327.GK2726@deviant.kiev.zoral.com.ua> <20120129223904.GA37483@zim.MIT.EDU> <20120130063034.GU2726@deviant.kiev.zoral.com.ua> <20120130190703.GA44663@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dc+cDN39EJAMEtIO" Content-Disposition: inline In-Reply-To: <20120130190703.GA44663@zim.MIT.EDU> 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=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 10:54:41 -0000 --dc+cDN39EJAMEtIO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 30, 2012 at 02:07:03PM -0500, David Schultz wrote: > On Mon, Jan 30, 2012, Kostik Belousov wrote: > > On Sun, Jan 29, 2012 at 05:39:04PM -0500, David Schultz wrote: > > > On Sun, Jan 29, 2012, Kostik Belousov wrote: > > > > On Sat, Jan 28, 2012 at 07:12:25PM -0500, David Schultz wrote: > > > > > On Sat, Jan 28, 2012, Kostik Belousov wrote: > > > > > > On Fri, Jan 27, 2012 at 02:42:21PM -0500, David Schultz wrote: > > > > > > > The correct limit on the maximum size of a single read/write = is > > > > > > > SSIZE_MAX, but FreeBSD uses INT_MAX. It's not safe to raise = the > > > > > > > limit yet, though, because of bugs in several filesystems. F= or > > > > > > > example, FFS copies uio_resid into a local variable of type i= nt. > > > > > > > I have some old patches that fix some of these issues for FFS= and > > > > > > > cd9660, but surely there are more places I didn't notice. > > > > > > >=20 > > > > > > Absolutely agree. > > > > > >=20 > > > > > > http://people.freebsd.org/~kib/misc/uio_resid.5.patch > > > > >=20 > > > > > Nice. You found a lot more than I've got in my tree, and you even > > > > > fixed the return values. There are at least a few more places to > > > > > fix. For instance, cd9660 and the NFS client pass uio_resid or > > > > > iov_len to min(), which operates on ints. (Incidentally, C11 > > > > > generics ought to make it possible to write type-generic min() > > > > > and max() functions.) > > > >=20 > > > > Thank you, http://people.freebsd.org/~kib/misc/uio_resid.6.patch > > > > changed them to MIN(). > > >=20 > > > This looks good to me. I tried to think of other places that you > > > might have missed, and the only one that occurred to me is the > > Might ? I think this is a blatant understate. > >=20 > > > pipe code. sys_pipe.c has an `int orig_resid' and lots of bogus > > > casts of iov_len and uio_resid to type u_int. Some look harmless, > > > although it appears that writing a multiple of 2^32 bytes might > > > result in pipe_build_write_buffer() allocating a 0-length buffer. > > >=20 > > > My only reservation is that raising the limit could unmask a > > > kernel buffer overflow if we missed something, but I guess we have > > > to cross that bridge some day anyway. > > Yes, and it is an obvious reason why I am chicken to commit this for > > so long time. One more place, if this is reasonable to count as 'one' > > place, are the cdevsw methods. devfs passes uio down to the drivers. >=20 > That's why I'm glad I'm not committing it. :) A more conservative > change (also known as "kicking the can down the road") would be to > add a VFS flag, e.g., VFCF_LONGIO, and only set it on file systems > that have been thoroughly reviewed. The VFS layer could cap the size > at INT_MAX for file systems without the flag. At least I will get more mail after the commit, I hope. I disagree with the VFCF_LONGIO approach. It will cause much head-scratching for unsuspecting user who would try to use > 4GB transfers. What I can do, is to commit all changes except removals of the checks for INT_MAX. After type changes settle, I can try to gather enough bravery to flip the checks in HEAD, possibly with temporary sysctl to return to old behaviour for emergency (AKA hole). >=20 > > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c > > index 9edcb74..332ec37 100644 > > --- a/sys/kern/sys_pipe.c > > +++ b/sys/kern/sys_pipe.c > [...] > > @@ -757,14 +757,14 @@ pipe_build_write_buffer(wpipe, uio) > > struct pipe *wpipe; > > struct uio *uio; > > { > > - u_int size; > > + size_t size; > > int i; > > =20 > > PIPE_LOCK_ASSERT(wpipe, MA_NOTOWNED); > > KASSERT(wpipe->pipe_state & PIPE_DIRECTW, > > ("Clone attempt on non-direct write pipe!")); > > =20 > > - size =3D (u_int) uio->uio_iov->iov_len; > > + size =3D uio->uio_iov->iov_len; > > if (size > wpipe->pipe_buffer.size) > > size =3D wpipe->pipe_buffer.size; >=20 > The transfer can't be bigger than the max pipe buffer size (64k), > so `size =3D (int)MIN(uio->uio_iov->iov_len, wpipe->pipe_buffer.size)' > should suffice. The same comment applies elsewhere in the file. True. If you much prefer this version, I will change the patch. But I do think that my changes are cleaner. --dc+cDN39EJAMEtIO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk8nyGcACgkQC3+MBN1Mb4iczwCghrxW6CzT7e+FZ7RLjtaDwvb9 RgoAnjbSiz/CPNXyIC4SgFmYvLhPlT8+ =fiGf -----END PGP SIGNATURE----- --dc+cDN39EJAMEtIO-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 11:00:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 567AE1065672; Tue, 31 Jan 2012 11:00:34 +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 447A68FC20; Tue, 31 Jan 2012 11:00:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VB0YHd032314; Tue, 31 Jan 2012 11:00:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VB0YXN032312; Tue, 31 Jan 2012 11:00:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201311100.q0VB0YXN032312@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 31 Jan 2012 11:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230806 - stable/9/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 11:00:34 -0000 Author: kib Date: Tue Jan 31 11:00:33 2012 New Revision: 230806 URL: http://svn.freebsd.org/changeset/base/230806 Log: MFC r227698: Update the manpage for r227697. Modified: stable/9/share/man/man9/VOP_VPTOCNP.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/VOP_VPTOCNP.9 ============================================================================== --- stable/9/share/man/man9/VOP_VPTOCNP.9 Tue Jan 31 10:46:51 2012 (r230805) +++ stable/9/share/man/man9/VOP_VPTOCNP.9 Tue Jan 31 11:00:33 2012 (r230806) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 7, 2008 +.Dd November 19, 2011 .Dt VOP_VPTOCNP 9 .Os .Sh NAME @@ -65,9 +65,9 @@ is not a directory, then .Nm returns ENOENT. .Sh LOCKS -The vnode should be locked on entry and will still be locked on exit. The -parent directory vnode will be unlocked on a successful exit. However, it -will have its hold count incremented. +The vnode should be locked on entry and will still be locked on exit. +The parent directory vnode will be unlocked on a successful exit. +However, it will have its use count incremented. .Sh RETURN VALUES Zero is returned on success, otherwise an error code is returned. .Sh ERRORS From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 12:57:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32E891065670; Tue, 31 Jan 2012 12:57:22 +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 21A9D8FC0A; Tue, 31 Jan 2012 12:57:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VCvM9d036629; Tue, 31 Jan 2012 12:57:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VCvMS4036627; Tue, 31 Jan 2012 12:57:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201311257.q0VCvMS4036627@svn.freebsd.org> From: Alexander Motin Date: Tue, 31 Jan 2012 12:57: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: r230807 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 12:57:22 -0000 Author: mav Date: Tue Jan 31 12:57:21 2012 New Revision: 230807 URL: http://svn.freebsd.org/changeset/base/230807 Log: Just in case, clear stream interrupts before enabling them. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Tue Jan 31 11:00:33 2012 (r230806) +++ head/sys/dev/sound/pci/hda/hdac.c Tue Jan 31 12:57:21 2012 (r230807) @@ -1921,6 +1921,8 @@ hdac_stream_start(device_t dev, device_t ctl |= 1 << ss; HDAC_WRITE_4(&sc->mem, HDAC_INTCTL, ctl); + HDAC_WRITE_1(&sc->mem, off + HDAC_SDSTS, + HDAC_SDSTS_DESE | HDAC_SDSTS_FIFOE | HDAC_SDSTS_BCIS); ctl = HDAC_READ_1(&sc->mem, off + HDAC_SDCTL0); ctl |= HDAC_SDCTL_IOCE | HDAC_SDCTL_FEIE | HDAC_SDCTL_DEIE | HDAC_SDCTL_RUN; From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 13:00:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B1FF106564A; Tue, 31 Jan 2012 13:00:40 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69BF28FC0C; Tue, 31 Jan 2012 13:00:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VD0eMW036784; Tue, 31 Jan 2012 13:00:40 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VD0eWM036780; Tue, 31 Jan 2012 13:00:40 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201311300.q0VD0eWM036780@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 31 Jan 2012 13:00: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: r230808 - in head/sys: dev/ie sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 13:00:40 -0000 Author: pluknet Date: Tue Jan 31 13:00:40 2012 New Revision: 230808 URL: http://svn.freebsd.org/changeset/base/230808 Log: Isolate v_caddr_t in the ie driver. Submitted by: Bruce Evans on net@ Modified: head/sys/dev/ie/if_ie.c head/sys/sys/types.h Modified: head/sys/dev/ie/if_ie.c ============================================================================== --- head/sys/dev/ie/if_ie.c Tue Jan 31 12:57:21 2012 (r230807) +++ head/sys/dev/ie/if_ie.c Tue Jan 31 13:00:40 2012 (r230808) @@ -157,6 +157,9 @@ static int ie_debug = IED_RNR; #define IE_BUF_LEN ETHER_MAX_LEN /* length of transmit buffer */ +/* XXX this driver uses `volatile' and `caddr_t' to a fault. */ +typedef volatile char *v_caddr_t; /* core address, pointer to volatile */ + /* Forward declaration */ struct ie_softc; Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Tue Jan 31 12:57:21 2012 (r230807) +++ head/sys/sys/types.h Tue Jan 31 13:00:40 2012 (r230808) @@ -73,7 +73,6 @@ typedef quad_t * qaddr_t; typedef char * caddr_t; /* core address */ typedef const char * c_caddr_t; /* core address, pointer to const */ -typedef __volatile char *v_caddr_t; /* core address, pointer to volatile */ #ifndef _BLKSIZE_T_DECLARED typedef __blksize_t blksize_t; From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 13:07:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4DE81065676; Tue, 31 Jan 2012 13:07:47 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 731778FC08; Tue, 31 Jan 2012 13:07:47 +0000 (UTC) Received: by obcwo16 with SMTP id wo16so7806247obc.13 for ; Tue, 31 Jan 2012 05:07:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=IoIIp0NH3vOfn+wqGbsWYNVbxRUA7e+veTiluEoK1PI=; b=w8z77vcOey3OvRbmQtgaD2Suxpm62E5NEyUeu6cuiWm9LpHDNBxH+nodXSyDxqrXsq fxOKU1efdsP0FZWylrCe28r9wn24w7vy4rzdr9js8Kr+KR7m6FZo8YbEzfkpqx2nFrs5 Ut6FT0bCix0spAlzRvsOHhNg+WvkZTp0Ejg98= MIME-Version: 1.0 Received: by 10.182.75.65 with SMTP id a1mr35214979obw.32.1328015266886; Tue, 31 Jan 2012 05:07:46 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.182.74.167 with HTTP; Tue, 31 Jan 2012 05:07:46 -0800 (PST) In-Reply-To: <201201311300.q0VD0eWM036780@svn.freebsd.org> References: <201201311300.q0VD0eWM036780@svn.freebsd.org> Date: Tue, 31 Jan 2012 16:07:46 +0300 X-Google-Sender-Auth: ZgQA7taZ4SINJfruWncXPRHQRNg Message-ID: From: Sergey Kandaurov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r230808 - in head/sys: dev/ie sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 13:07:47 -0000 On 31 January 2012 17:00, Sergey Kandaurov wrote: > Author: pluknet > Date: Tue Jan 31 13:00:40 2012 > New Revision: 230808 > URL: http://svn.freebsd.org/changeset/base/230808 > > Log: > =A0Isolate v_caddr_t in the ie driver. ie is the only consumer in the entire tree. I'm not quite sure if this worth MFC'ing at the cost of breaking some hypothetical out-of-tree consumers... --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 13:20:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 444911065673; Tue, 31 Jan 2012 13:20:50 +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 E1B1F8FC14; Tue, 31 Jan 2012 13:20:48 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id E2F54C3847; Tue, 31 Jan 2012 14:20:47 +0100 (CET) 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 xFCjba5w-4QE; Tue, 31 Jan 2012 14:20:47 +0100 (CET) Received: from [10.0.0.22] (cardhu.semihalf.com [213.17.239.108]) by smtp.semihalf.com (Postfix) with ESMTPSA id 1FCF5C3843; Tue, 31 Jan 2012 14:20:47 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <4F27120E.5000207@FreeBSD.org> Date: Tue, 31 Jan 2012 14:20:46 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <9DAB4777-9799-49E3-8EBC-E7A567414D2A@semihalf.com> References: <201201271829.q0RIT4Xq051545@svn.freebsd.org> <4F26F8C9.3080807@FreeBSD.org> <1327956501.1662.13.camel@revolution.hippie.lan> <4F27120E.5000207@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230622 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 13:20:50 -0000 On 2012-01-30, at 22:56, Dimitry Andric wrote: > On 2012-01-30 21:48, Ian Lepore wrote: >> On Mon, 2012-01-30 at 21:08 +0100, Dimitry Andric wrote: >>> On 2012-01-30 20:27, Rafal Jaworowski wrote: >>> ... >>>>> Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so = the >>>>> bootstrap tools directories are searched before the regular = ones. >>>>=20 >>>> Is this supposed to work for cross building as well? I'm still = encountering problems on a 7.3 host build: >>>>=20 >>>> 1. Cross world builds fine >>>> make -j 8 buildworld TARGET_ARCH=3Darm >>>>=20 >>>> 2. Kernel fails w/ the aicasm >>>> make buildkernel TARGET_ARCH=3Darm KERNCONF=3DSHEEVAPLUG >>>> [...] >>>> cc -O2 -pipe -nostdinc -I/usr/include -I. = -I/home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm -std=3Dgnu99 = -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter = -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type = -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter = -Wcast-align -Wno-pointer-sign -c aicasm_scan.c >>>> cc1: warnings being treated as errors >>>> = /home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm/aicasm_scan.l:837: = warning: function declaration isn't a prototype >>>=20 >>> Can you please try doing "make buildenv TARGET_ARCH=3Darm", then run >>> "which lex" and "which yacc"? >>=20 >> Shouldn't lex and yacc be listed in the Makefile.inc1 bootstrap-tools >> target for this to be fully effective? It looks like neither is in >> RELENG_7 and lex is only conditionally listed in RELENG_8. >=20 > It is, for head at least (but I think I will MFC this change, if it > turns out to work correctly). Look in Makefile.inc1, around line = 1030: >=20 > .if ${BOOTSTRAPPING} < 900006 > _lex=3D usr.bin/lex > _yacc=3D usr.bin/yacc > .endif >=20 > I have assumed Rafal is building a head checkout on 7.3 release. = Since > BOOTSTRAPPING will most likely be 703000, the lex and yacc targets are > built during the bootstrap-tools stage. >=20 > That said, I still don't understand why the generated aicasm_scan.c = file > is still defining the input() function. Rafal, just to be sure, can = you > please paste the file that was generated during your buildkernel? Problem identified: the auto-gen'd aicasm files would not get updated in = the preexisting kernel OBJ subdir. After wiping out the OBJ sub dir = entirely make buildkernel works fine. Do you know why would the generated aicasm* files not get a refresh in = the kernel OBJ dir? Rafal From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 13:25:39 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87354106564A; Tue, 31 Jan 2012 13:25:39 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw13.york.ac.uk (mail-gw13.york.ac.uk [144.32.129.163]) by mx1.freebsd.org (Postfix) with ESMTP id 3F2378FC12; Tue, 31 Jan 2012 13:25:39 +0000 (UTC) Received: from buffy-128.york.ac.uk ([144.32.128.160]:10875 helo=buffy.york.ac.uk) by mail-gw13.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1RsDWV-0001HI-5J; Tue, 31 Jan 2012 13:13:23 +0000 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.5/8.14.5) with ESMTP id q0VDDMBk097376; Tue, 31 Jan 2012 13:13:22 GMT (envelope-from gavin@FreeBSD.org) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.5/8.14.5/Submit) id q0VDDMUA097375; Tue, 31 Jan 2012 13:13:22 GMT (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson To: Jung-uk Kim In-Reply-To: <201201301828.q0UISvhb097256@svn.freebsd.org> References: <201201301828.q0UISvhb097256@svn.freebsd.org> Content-Type: text/plain; charset="ASCII" Content-Transfer-Encoding: quoted-printable Date: Tue, 31 Jan 2012 13:13:22 +0000 Message-ID: <1328015602.96718.19.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230777 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 13:25:39 -0000 On Mon, 2012-01-30 at 18:28 +0000, Jung-uk Kim wrote: > Author: jkim > Date: Mon Jan 30 18:28:56 2012 > New Revision: 230777 > URL: http://svn.freebsd.org/changeset/base/230777 >=20 > Log: > Naturally align a newly added wakeup_fpusave. I hadn't noticed this change when it went in initially. Out of interest, is the save/restore of the FPU state over suspend/resume likely to fix the panics some people see over a suspend/resume if they have run VirtualBox or similar before suspend? I've been assuming that it was related to some CPU state not being saved/restored, but never dug into it myself. Thanks, Gavin From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 13:53:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23CBB106564A; Tue, 31 Jan 2012 13:53:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id D29CD8FC08; Tue, 31 Jan 2012 13:53:52 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:4dd4:e805:cea2:78dc] (unknown [IPv6:2001:7b8:3a7:0:4dd4:e805:cea2:78dc]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 9BBF65C59; Tue, 31 Jan 2012 14:53:51 +0100 (CET) Message-ID: <4F27F26F.8080107@FreeBSD.org> Date: Tue, 31 Jan 2012 14:53:51 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120124 Thunderbird/10.0 MIME-Version: 1.0 To: Rafal Jaworowski References: <201201271829.q0RIT4Xq051545@svn.freebsd.org> <4F26F8C9.3080807@FreeBSD.org> <1327956501.1662.13.camel@revolution.hippie.lan> <4F27120E.5000207@FreeBSD.org> <9DAB4777-9799-49E3-8EBC-E7A567414D2A@semihalf.com> In-Reply-To: <9DAB4777-9799-49E3-8EBC-E7A567414D2A@semihalf.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230622 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 13:53:53 -0000 On 2012-01-31 14:20, Rafal Jaworowski wrote: > On 2012-01-30, at 22:56, Dimitry Andric wrote: ... >> That said, I still don't understand why the generated aicasm_scan.c file >> is still defining the input() function. Rafal, just to be sure, can you >> please paste the file that was generated during your buildkernel? > > Problem identified: the auto-gen'd aicasm files would not get updated in the preexisting kernel OBJ subdir. After wiping out the OBJ sub dir entirely make buildkernel works fine. > > Do you know why would the generated aicasm* files not get a refresh in the kernel OBJ dir? Well, in general, incremental building is difficult to get working for all corner cases, like this particular one. The lexer and scanner .c files are generated from .l and .y files, so if the latter did not get an updated timestamp, the .c files will not be regenerated either. The only way to fix this would be to add a dependency on the actual lex and yacc executables. But that is probably overkill: if you wanted to be consistent, you would also have to relink every executable if ld gets updated, recompile every object file if cc gets updated, and so on. It's probably easier to just clean out your object tree, and build from scratch. :) From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 14:21:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCDA41065673; Tue, 31 Jan 2012 14:21:18 +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 6A6C88FC19; Tue, 31 Jan 2012 14:21:18 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 6CF51C3CB6; Tue, 31 Jan 2012 15:21:17 +0100 (CET) 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 V6el3qg-nhRU; Tue, 31 Jan 2012 15:21:16 +0100 (CET) Received: from [10.0.0.22] (cardhu.semihalf.com [213.17.239.108]) by smtp.semihalf.com (Postfix) with ESMTPSA id C5557C3849; Tue, 31 Jan 2012 15:21:16 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <4F27F26F.8080107@FreeBSD.org> Date: Tue, 31 Jan 2012 15:21:16 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <95928C11-96DD-4C54-8327-B499E213E80E@semihalf.com> References: <201201271829.q0RIT4Xq051545@svn.freebsd.org> <4F26F8C9.3080807@FreeBSD.org> <1327956501.1662.13.camel@revolution.hippie.lan> <4F27120E.5000207@FreeBSD.org> <9DAB4777-9799-49E3-8EBC-E7A567414D2A@semihalf.com> <4F27F26F.8080107@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230622 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 14:21:18 -0000 On 2012-01-31, at 14:53, Dimitry Andric wrote: > On 2012-01-31 14:20, Rafal Jaworowski wrote: >> On 2012-01-30, at 22:56, Dimitry Andric wrote: > ... >>> That said, I still don't understand why the generated aicasm_scan.c = file >>> is still defining the input() function. Rafal, just to be sure, can = you >>> please paste the file that was generated during your buildkernel? >>=20 >> Problem identified: the auto-gen'd aicasm files would not get updated = in the preexisting kernel OBJ subdir. After wiping out the OBJ sub dir = entirely make buildkernel works fine. >>=20 >> Do you know why would the generated aicasm* files not get a refresh = in the kernel OBJ dir? >=20 > Well, in general, incremental building is difficult to get working for > all corner cases, like this particular one. The lexer and scanner .c > files are generated from .l and .y files, so if the latter did not get > an updated timestamp, the .c files will not be regenerated either. >=20 > The only way to fix this would be to add a dependency on the actual = lex > and yacc executables. But that is probably overkill: if you wanted to > be consistent, you would also have to relink every executable if ld = gets > updated, recompile every object file if cc gets updated, and so on. >=20 > It's probably easier to just clean out your object tree, and build = from > scratch. :) Sure, I was just curious. Thanks for help! Rafal From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 15:20:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D8011065670; Tue, 31 Jan 2012 15:20:10 +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 C56238FC19; Tue, 31 Jan 2012 15:20:09 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0VFK6Fi003512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 1 Feb 2012 02:20:07 +1100 Date: Wed, 1 Feb 2012 02:20:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <20120131105431.GB3283@deviant.kiev.zoral.com.ua> Message-ID: <20120201013621.V2889@besplex.bde.org> References: <20120126153641.GA68112@FreeBSD.org> <20120127194612.H1547@besplex.bde.org> <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> <20120127194221.GA25723@zim.MIT.EDU> <20120128123748.GD2726@deviant.kiev.zoral.com.ua> <20120129001225.GA32220@zim.MIT.EDU> <20120129062327.GK2726@deviant.kiev.zoral.com.ua> <20120129223904.GA37483@zim.MIT.EDU> <20120130063034.GU2726@deviant.kiev.zoral.com.ua> <20120130190703.GA44663@zim.MIT.EDU> <20120131105431.GB3283@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 15:20:10 -0000 On Tue, 31 Jan 2012, Konstantin Belousov wrote: > On Mon, Jan 30, 2012 at 02:07:03PM -0500, David Schultz wrote: >> That's why I'm glad I'm not committing it. :) A more conservative >> change (also known as "kicking the can down the road") would be to >> add a VFS flag, e.g., VFCF_LONGIO, and only set it on file systems >> that have been thoroughly reviewed. The VFS layer could cap the size >> at INT_MAX for file systems without the flag. > At least I will get more mail after the commit, I hope. > > I disagree with the VFCF_LONGIO approach. It will cause much head-scratching > for unsuspecting user who would try to use > 4GB transfers. No one cared when this was broken for almost 10 years by 4.4BSD changing the type of iov_len from int to size_t. You can almost equally safely break it again :(. Previously (in FreeBSD-1 and presumably in Net/2) iov_len had the same type as uio_resid, and the code in readv(), etc., depended on this and also on benign undefined behaviour on overflow to detect overflow (after it gave undefined behaviour by occurring) when adding up iov_len's to get uio_resid. The bug didn't require passing a buffer of size > INT_MAX to reach -- it just required a single or multiple iov_len whose total size exceeded INT_MAX. FreeBSD fixed this in 2003. size_t for iov_len is bogus even if the limit is SSIZE max. It allows a single iov to have a size that cannot work, and n iov's to have a size almost 2*n times too large to work. Unfortunately, POSIX standardizes the type of iov_len as size_t. It is interesting that POSIX says "shall fail" for readv() when the sum of the iov_len values overflowed [sic] an ssize_t. For read(), the behaviour when the count exceeds {SSIZE_MAX} is implementation-defined. This gives the silly possibility that read() can work for a size that is almost twice as large as readv(), using a single count instead of an array of counts. It is also strange that readv() refers to ssize_t while read() refers to {SSIZE_MAX}. POSIX standardizes the bug that {SSIZE_MAX} is the limit of the type, although that may be unrelated to sizes that can work. If these APIs had been correctly designed, then the limit would be {READ_MAX} and unrelated to any size type (except that the type must be large enough to represent {READ_MAX}). It would normally be INT_MAX or much smaller. readv() also has the bogus specification that if iovcnt is <= 0 or > {IOV_MAX}, then failure is optional. So failure is optional for a hard error like iovcnt > {IOV_MAX}, but is required for a condition that is not required to be an error for a similar API (count > {SSIZE_MAX}). I only checked a 2001 draft for this. Maybe some of these bugs have been fixed. > What I can do, is to commit all changes except removals of the checks > for INT_MAX. After type changes settle, I can try to gather enough > bravery to flip the checks in HEAD, possibly with temporary sysctl > to return to old behaviour for emergency (AKA hole). > >> >>> diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c >>> index 9edcb74..332ec37 100644 >>> --- a/sys/kern/sys_pipe.c >>> +++ b/sys/kern/sys_pipe.c >> [...] >>> @@ -757,14 +757,14 @@ pipe_build_write_buffer(wpipe, uio) >>> struct pipe *wpipe; >>> struct uio *uio; >>> { >>> - u_int size; >>> + size_t size; >>> int i; >>> >>> PIPE_LOCK_ASSERT(wpipe, MA_NOTOWNED); >>> KASSERT(wpipe->pipe_state & PIPE_DIRECTW, >>> ("Clone attempt on non-direct write pipe!")); >>> >>> - size = (u_int) uio->uio_iov->iov_len; >>> + size = uio->uio_iov->iov_len; >>> if (size > wpipe->pipe_buffer.size) >>> size = wpipe->pipe_buffer.size; >> >> The transfer can't be bigger than the max pipe buffer size (64k), >> so `size = (int)MIN(uio->uio_iov->iov_len, wpipe->pipe_buffer.size)' >> should suffice. The same comment applies elsewhere in the file. > > True. If you much prefer this version, I will change the patch. But I do > think that my changes are cleaner. size_t is a bogus type for `size', since it must still be a u_int to work. For example, when it is assigned to the u_int wpipe->pipe_map.cnt. This shouldn't be "fixed" by bloating the type to size_t throughout (any global change should be to int to give suitably undefined behaviour on overflow). There must be an implicit or explicit check on it somewhere that it fits. This check is provided by the comparison with wpipe->pipe_buffer.size. But the above is a bad way to write it -- it should be checked before assignment, to avoid any possibility of overflow or sign extension of either operand before the check: u_int size; if (uio->uio_iov->iov_len > wpipe->pipe_buffer.size) size = wpipe->pipe_buffer.size; else size = uio->uio_iov->iov_len; This is the same as the MIN() expression (without a bogus cast). I think I want to write it out verbosely like this and not use MIN(), even if MIN() were not a style bug, to make it clear that this is a correct bounds check. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 15:32:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A73991065674; Tue, 31 Jan 2012 15:32:05 +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 95C9F8FC12; Tue, 31 Jan 2012 15:32:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VFW5NX042081; Tue, 31 Jan 2012 15:32:05 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VFW5Kd042078; Tue, 31 Jan 2012 15:32:05 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201201311532.q0VFW5Kd042078@svn.freebsd.org> From: Ed Maste Date: Tue, 31 Jan 2012 15:32: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: r230812 - head/sbin/reboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 15:32:05 -0000 Author: emaste Date: Tue Jan 31 15:32:05 2012 New Revision: 230812 URL: http://svn.freebsd.org/changeset/base/230812 Log: Add -e to set arbitrary kernel environment variables. Nextboot(8) can now set any combination of kernel name (-k), kernel options (-o), and environment strings (-e). As a result of this change -k also becomes optional. Reviewed by: freebsd-current (Ian Lepore, pluknet@, jhb@) Modified: head/sbin/reboot/nextboot.8 head/sbin/reboot/nextboot.sh Modified: head/sbin/reboot/nextboot.8 ============================================================================== --- head/sbin/reboot/nextboot.8 Tue Jan 31 15:25:00 2012 (r230811) +++ head/sbin/reboot/nextboot.8 Tue Jan 31 15:32:05 2012 (r230812) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2002 +.Dd January 31, 2012 .Dt NEXTBOOT 8 .Os .Sh NAME @@ -32,15 +32,17 @@ .Nd "specify an alternate kernel and boot flags for the next reboot" .Sh SYNOPSIS .Nm +.Op Fl e Ar variable=value .Op Fl f +.Op Fl k Ar kernel .Op Fl o Ar options -.Fl k Ar kernel .Nm .Fl D .Sh DESCRIPTION The .Nm -utility allows specifying an alternate kernel and/or boot flags for the +utility allows specifying some combination of an alternate kernel, boot flags +and kernel environment for the next time the machine is booted. Once the .Xr loader 8 @@ -58,6 +60,11 @@ with this option removes an existing .Nm configuration. +.It Fl e Ar variable=value +This option adds the provided variable and value to the kernel environment. +The value is quoted when written to the +.Nm +configuration. .It Fl f This option disables the sanity checking which checks if the kernel really exists Modified: head/sbin/reboot/nextboot.sh ============================================================================== --- head/sbin/reboot/nextboot.sh Tue Jan 31 15:25:00 2012 (r230811) +++ head/sbin/reboot/nextboot.sh Tue Jan 31 15:32:05 2012 (r230812) @@ -2,31 +2,59 @@ # # Copyright 2002. Gordon Tetlow. # gordon@FreeBSD.org +# Copyright (c) 2012 Sandvine Incorporated. All rights reserved. # # $FreeBSD$ delete="NO" +kenv= force="NO" nextboot_file="/boot/nextboot.conf" +add_kenv() +{ + local var value + + var=$1 + # strip literal quotes if passed in + value=${2%\"*} + value=${value#*\"} + + if [ -n "${kenv}" ]; then + kenv="${kenv} +" + fi + kenv="${kenv}${var}=\"${value}\"" +} + display_usage() { - echo "Usage: nextboot [-f] [-o options] -k kernel" + echo "Usage: nextboot [-e variable=value] [-f] [-k kernel] [-o options]" echo " nextboot -D" } -while getopts "Dfk:o:" argument ; do +while getopts "De:fk:o:" argument ; do case "${argument}" in D) delete="YES" ;; + e) + var=${OPTARG%%=*} + value=${OPTARG#*=} + if [ -z "$var" -o -z "$value" ]; then + display_usage + exit 1 + fi + add_kenv "$var" "$value" + ;; f) force="YES" ;; k) kernel="${OPTARG}" + add_kenv kernel "$kernel" ;; o) - kernel_options="${OPTARG}" + add_kenv kernel_options "${OPTARG}" ;; *) display_usage @@ -40,12 +68,12 @@ if [ ${delete} = "YES" ]; then exit 0 fi -if [ "xxx${kernel}" = "xxx" ]; then +if [ -z "${kenv}" ]; then display_usage exit 1 fi -if [ ${force} = "NO" -a ! -d /boot/${kernel} ]; then +if [ -n "${kernel}" -a ${force} = "NO" -a ! -d /boot/${kernel} ]; then echo "Error: /boot/${kernel} doesn't exist. Use -f to override." exit 1 fi @@ -60,6 +88,5 @@ done cat > ${nextboot_file} << EOF nextboot_enable="YES" -kernel="${kernel}" -kernel_options="${kernel_options}" +$kenv EOF From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 15:48:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 655A31065785; Tue, 31 Jan 2012 15:48: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 525D58FC14; Tue, 31 Jan 2012 15:48:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VFmeEF043011; Tue, 31 Jan 2012 15:48:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VFme2N043009; Tue, 31 Jan 2012 15:48:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201311548.q0VFme2N043009@svn.freebsd.org> From: John Baldwin Date: Tue, 31 Jan 2012 15:48: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: r230822 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 15:48:40 -0000 Author: jhb Date: Tue Jan 31 15:48:40 2012 New Revision: 230822 URL: http://svn.freebsd.org/changeset/base/230822 Log: Fix a spelling mistake in the surprise link down error constant. Submitted by: glebius Modified: head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Tue Jan 31 15:48:33 2012 (r230821) +++ head/sys/dev/pci/pcireg.h Tue Jan 31 15:48:40 2012 (r230822) @@ -697,7 +697,7 @@ #define PCIR_AER_UC_STATUS 0x04 #define PCIM_AER_UC_TRAINING_ERROR 0x00000001 #define PCIM_AER_UC_DL_PROTOCOL_ERROR 0x00000010 -#define PCIM_AER_UC_SUPRISE_LINK_DOWN 0x00000020 +#define PCIM_AER_UC_SURPRISE_LINK_DOWN 0x00000020 #define PCIM_AER_UC_POISONED_TLP 0x00001000 #define PCIM_AER_UC_FC_PROTOCOL_ERROR 0x00002000 #define PCIM_AER_UC_COMPLETION_TIMEOUT 0x00004000 From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 15:48:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C5BC10657A7; Tue, 31 Jan 2012 15:48:47 +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 076358FC17; Tue, 31 Jan 2012 15:48:46 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0VFmiQY005074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 1 Feb 2012 02:48:44 +1100 Date: Wed, 1 Feb 2012 02:48:44 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sergey Kandaurov In-Reply-To: <201201311300.q0VD0eWM036780@svn.freebsd.org> Message-ID: <20120201022150.N2889@besplex.bde.org> References: <201201311300.q0VD0eWM036780@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230808 - in head/sys: dev/ie sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 15:48:47 -0000 On Tue, 31 Jan 2012, Sergey Kandaurov wrote: > Log: > Isolate v_caddr_t in the ie driver. > > Submitted by: Bruce Evans on net@ Thanks. > ... > Modified: head/sys/sys/types.h > ============================================================================== > --- head/sys/sys/types.h Tue Jan 31 12:57:21 2012 (r230807) > +++ head/sys/sys/types.h Tue Jan 31 13:00:40 2012 (r230808) > @@ -73,7 +73,6 @@ typedef quad_t * qaddr_t; > > typedef char * caddr_t; /* core address */ > typedef const char * c_caddr_t; /* core address, pointer to const */ > -typedef __volatile char *v_caddr_t; /* core address, pointer to volatile */ > > #ifndef _BLKSIZE_T_DECLARED > typedef __blksize_t blksize_t; c_caddr_t is a bit harder to fix or isolate. I removed it, then fixed the things that broke, but only the ones that were used in my normal kernel (or perhaps GENERIC). These are most mchain and its uses: - mbchain.9, mchain.9 (these also have a bogus include of uio.h) - nwfs_subr.c (remove the bogus casts to c_caddr_t and also many more to caddr_t, after fixing APIs). This is barely maintained, and might go away for other reasons (it needs Giant?). - subr_mchain.c, and headers: change APIs to use const void * instead of c_caddr_t, and void * instead of caddr_t; add casts to const char * or char * to access or do pointer arithmetic on these void *. - subr_mbuf.c: like subr_mchain.c, but only 1 place to unbreak. - ncp_rq.c: like nwfs_subr.c, but less to change. - smb_subr.c: change just 1 API to take const void * and void * instead of c_caddr_t etc., and add casts. The casts are now to const char ** and char **. That's 1 more star than before, so I don't see how this worked or works. - linker.h: the same bugs affect the "opaque" symbol linker_sym_t. We have to peer inside it to know that it is a pointer and modify it to make it a pointer to const. We use c_linker_sym_t for the latter, and since it is bogusly a caddr_t, we used c_caddr_t for the latter. I changed the latter to use const char *, but didn't try to fix the bogus opaqueness. - mchain.h: one of the headers affected. Also add a forward declaration of struct uio to it, so that uio.h isn't prerequisite, and fix the unsorting of the forward declarations. - types.h: remove c_caddr_t. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 17:10:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id A6397106564A; Tue, 31 Jan 2012 17:10:17 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Gavin Atkinson Date: Tue, 31 Jan 2012 12:10:06 -0500 User-Agent: KMail/1.6.2 References: <201201301828.q0UISvhb097256@svn.freebsd.org> <1328015602.96718.19.camel@buffy.york.ac.uk> In-Reply-To: <1328015602.96718.19.camel@buffy.york.ac.uk> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201201311210.09506.jkim@FreeBSD.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r230777 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 17:10:17 -0000 On Tuesday 31 January 2012 08:13 am, Gavin Atkinson wrote: > On Mon, 2012-01-30 at 18:28 +0000, Jung-uk Kim wrote: > > Author: jkim > > Date: Mon Jan 30 18:28:56 2012 > > New Revision: 230777 > > URL: http://svn.freebsd.org/changeset/base/230777 > > > > Log: > > Naturally align a newly added wakeup_fpusave. > > I hadn't noticed this change when it went in initially. Out of > interest, is the save/restore of the FPU state over suspend/resume > likely to fix the panics some people see over a suspend/resume if > they have run VirtualBox or similar before suspend? I've been > assuming that it was related to some CPU state not being > saved/restored, but never dug into it myself. I am actually not sure but FPU state won't be problem. Probably VirtualBox device drivers don't implement suspend/resume methods. In fact, something broke suspend/resume for my desktop recently but I don't have enough free time to dig into it myself. :-( Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 17:22:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81C7D106566C; Tue, 31 Jan 2012 17:22:08 +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 6DFFE8FC12; Tue, 31 Jan 2012 17:22:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VHM8tA046738; Tue, 31 Jan 2012 17:22:08 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VHM80m046723; Tue, 31 Jan 2012 17:22:08 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201201311722.q0VHM80m046723@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 31 Jan 2012 17:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230828 - in vendor/libpcap/dist: . Win32/Include Win32/Prj Win32/Src bpf/net packaging pcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 17:22:08 -0000 Author: gnn Date: Tue Jan 31 17:22:07 2012 New Revision: 230828 URL: http://svn.freebsd.org/changeset/base/230828 Log: Update sources to 1.2.1 Submitted by: wxs@ Modified: vendor/libpcap/dist/CHANGES vendor/libpcap/dist/CREDITS vendor/libpcap/dist/Makefile.in vendor/libpcap/dist/README vendor/libpcap/dist/README.linux vendor/libpcap/dist/VERSION vendor/libpcap/dist/Win32/Include/bittypes.h vendor/libpcap/dist/Win32/Prj/libpcap.dsp vendor/libpcap/dist/Win32/Src/gai_strerror.c vendor/libpcap/dist/Win32/Src/getaddrinfo.c vendor/libpcap/dist/aclocal.m4 vendor/libpcap/dist/bpf/net/bpf_filter.c vendor/libpcap/dist/config.h.in vendor/libpcap/dist/configure vendor/libpcap/dist/configure.in vendor/libpcap/dist/ethertype.h vendor/libpcap/dist/fad-getad.c vendor/libpcap/dist/gencode.c vendor/libpcap/dist/gencode.h vendor/libpcap/dist/grammar.y vendor/libpcap/dist/inet.c vendor/libpcap/dist/packaging/pcap.spec.in vendor/libpcap/dist/pcap-bpf.c vendor/libpcap/dist/pcap-bt-linux.c vendor/libpcap/dist/pcap-common.c vendor/libpcap/dist/pcap-config.in vendor/libpcap/dist/pcap-dag.c vendor/libpcap/dist/pcap-dlpi.c vendor/libpcap/dist/pcap-filter.manmisc.in vendor/libpcap/dist/pcap-int.h vendor/libpcap/dist/pcap-libdlpi.c vendor/libpcap/dist/pcap-linktype.manmisc.in vendor/libpcap/dist/pcap-linux.c vendor/libpcap/dist/pcap-stdinc.h vendor/libpcap/dist/pcap-usb-linux.c vendor/libpcap/dist/pcap-win32.c vendor/libpcap/dist/pcap.3pcap.in vendor/libpcap/dist/pcap.c vendor/libpcap/dist/pcap/bpf.h vendor/libpcap/dist/pcap/pcap.h vendor/libpcap/dist/pcap_activate.3pcap vendor/libpcap/dist/pcap_can_set_rfmon.3pcap vendor/libpcap/dist/pcap_compile.3pcap.in vendor/libpcap/dist/pcap_datalink.3pcap.in vendor/libpcap/dist/pcap_datalink_name_to_val.3pcap vendor/libpcap/dist/pcap_datalink_val_to_name.3pcap vendor/libpcap/dist/pcap_fileno.3pcap vendor/libpcap/dist/pcap_findalldevs.3pcap vendor/libpcap/dist/pcap_free_datalinks.3pcap vendor/libpcap/dist/pcap_freealldevs.3pcap vendor/libpcap/dist/pcap_get_selectable_fd.3pcap vendor/libpcap/dist/pcap_list_datalinks.3pcap.in vendor/libpcap/dist/pcap_loop.3pcap vendor/libpcap/dist/pcap_major_version.3pcap vendor/libpcap/dist/pcap_next_ex.3pcap vendor/libpcap/dist/pcap_open_live.3pcap vendor/libpcap/dist/pcap_set_datalink.3pcap vendor/libpcap/dist/savefile.c vendor/libpcap/dist/scanner.l vendor/libpcap/dist/sf-pcap-ng.c vendor/libpcap/dist/sf-pcap.c Modified: vendor/libpcap/dist/CHANGES ============================================================================== --- vendor/libpcap/dist/CHANGES Tue Jan 31 15:53:54 2012 (r230827) +++ vendor/libpcap/dist/CHANGES Tue Jan 31 17:22:07 2012 (r230828) @@ -1,3 +1,77 @@ +Friday December 9, 2011. guy@alum.mit.edu. +Summary for 1.2.1 libpcap release + Update README file. + Fix typoes in README.linux file. + Clean up some compiler warnings. + Fix Linux compile problems and tests for ethtool.h. + Treat Debian/kFreeBSD and GNU/Hurd as systems with GNU + toolchains. + Support 802.1 QinQ as a form of VLAN in filters. + Treat "carp" as equivalent to "vrrp" in filters. + Fix code generated for "ip6 protochain". + Add some new link-layer header types. + Support capturing NetFilter log messages on Linux. + Clean up some error messages. + Turn off monitor mode on exit for mac80211 interfaces on Linux. + Fix problems turning monitor mode on for non-mac80211 interfaces + on Linux. + Properly fail if /sys/class/net or /proc/net/dev exist but can't + be opened. + Fail if pcap_activate() is called on an already-activated + pcap_t, and add a test program for that. + Fix filtering in pcap-ng files. + Don't build for PowerPC on Mac OS X Lion. + Simplify handling of new DLT_/LINKTYPE_ values. + Expand pcap(3PCAP) man page. + +Sunday July 24, 2011. mcr@sandelman.ca. +Summary for 1.2 libpcap release + All of the changes listed below for 1.1.1 and 1.1.2. + Changes to error handling for pcap_findalldevs(). + Fix the calculation of the frame size in memory-mapped captures. + Add a link-layer header type for STANAG 5066 D_PDUs. + Add a link-layer type for a variant of 3GPP TS 27.010. + Noted real nature of LINKTYPE_ARCNET. + Add a link-layer type for DVB-CI. + Fix configure-script discovery of VLAN acceleration support. + see http://netoptimizer.blogspot.com/2010/09/tcpdump-vs-vlan-tags.html + Linux, HP-UX, AIX, NetBSD and OpenBSD compilation/conflict fixes. + Protect against including AIX 5.x's having been included. + Add DLT_DBUS, for raw D-Bus messages. + Treat either EPERM or EACCES as "no soup for you". + Changes to permissions on DLPI systems. + Add DLT_IEEE802_15_4_NOFCS for 802.15.4 interfaces. + +Fri. August 6, 2010. guy@alum.mit.edu. +Summary for 1.1.2 libpcap release + Return DLT_ values, not raw LINKTYPE_ values from + pcap_datalink() when reading pcap-ng files + Add support for "wlan ra" and "wlan ta", to check the RA and TA + of WLAN frames that have them + Don't crash if "wlan addr{1,2,3,4}" are used without 802.11 + headers + Do filtering on USB and Bluetooth capturing + On FreeBSD/SPARC64, use -fPIC - it's apparently necessary + Check for valid port numbers (fit in a 16-bit unsigned field) in + "port" filters + Reject attempts to put savefiles into non-blocking mode + Check for "no such device" for the "get the media types" ioctl + in *BSD + Improve error messages from bpf_open(), and let it do the error + handling + Return more specific errors from pcap_can_set_rfmon(); fix + documentation + Update description fetching code for FreeBSD, fix code for + OpenBSD + Ignore /sys/net/dev files if we get ENODEV for them, not just + ENXIO; fixes handling of bonding devices on Linux + Fix check for a constant 0 argument to BPF_DIV + Use the right version of ar when cross-building + Free any filter set on a savefile when the savefile is closed + Include the CFLAGS setting when configure was run in the + compiler flags + Add support for 802.15.4 interfaces on Linux + Thu. April 1, 2010. guy@alum.mit.edu. Summary for 1.1.1 libpcap release Update CHANGES to reflect more of the changes in 1.1.0. Modified: vendor/libpcap/dist/CREDITS ============================================================================== --- vendor/libpcap/dist/CREDITS Tue Jan 31 15:53:54 2012 (r230827) +++ vendor/libpcap/dist/CREDITS Tue Jan 31 17:22:07 2012 (r230828) @@ -1,145 +1,154 @@ This file lists people who have contributed to libpcap: The current maintainers: - Bill Fenner - Fulvio Risso - Guy Harris - Hannes Gredler - Michael Richardson + Bill Fenner + Fulvio Risso + Guy Harris + Hannes Gredler + Michael Richardson Additional people who have contributed patches: - Alan Bawden - Albert Chin - Alexander 'Leo' Bergolth - Alexey Kuznetsov - Alon Bar-Lev - Andrew Brown - Antti Kantee - Arien Vijn - Arkadiusz Miskiewicz - Armando L. Caro Jr. - Assar Westerlund - Brian Ginsbach - Charles M. Hannum - Chris G. Demetriou - Chris Lightfoot - Chris Maynard - Chris Pepper - Christian Bell - Christian Peron - Daniele Orlandi - Darren Reed - David Kaelbling - David Young - Dean Gaudet - Don Ebright - Dug Song - Dustin Spicuzza - Eric Anderson - Erik de Castro Lopo - Felix Obenhuber - Florent Drouin - Franz Schaefer - Fulko Hew - Fumiyuki Shimizu - Gianluca Varenni - Gilbert Hoyek - Gisle Vanem - Graeme Hewson - Greg Stark - Greg Troxel - Gregor Maier - Guillaume Pelat - Hagen Paul Pfeifer - Hyung Sik Yoon - Igor Khristophorov - Jan-Philip Velders - Jason R. Thorpe - Javier Achirica - Jean Tourrilhes - Jean-Louis Charton - Jefferson Ogata - Jesper Peterson - Joerg Mayer - John Bankier - Jon Lindgren - Jon Smirl - Juergen Schoenwaelder - Jung-uk Kim - Kazushi Sugyo - Klaus Klein - Koryn Grant - Kris Katterjohn - Krzysztof Halasa - Lorenzo Cavallaro - Loris Degioanni - Love Hörnquist-Åstrand - Luis Martin Garcia - Maciej W. Rozycki - Marcus Felipe Pereira - Mark C. Brown - Mark Pizzolato - Markus Mayer - Martin Husemann - Márton Németh - Matthew Luckie - Max Laier - Mike Frysinger - Mike Kershaw - Mike Wiacek - Monroe Williams - N. Leiten - Nicolas Dade - Octavian Cerna - Olaf Kirch - Ollie Wild - Onno van der Linden - Paolo Abeni - Patrick Marie - Patrick McHardy - Paul Mundt - Pavel Kankovsky - Pawel Pokrywka - Peter Fales - Peter Jeremy - Peter Volkov - Phil Wood - Rafal Maszkowski - - Richard Stearn - Rick Jones - Robert Edmonds - Roberto Mariani - Romain Francoise - Sagun Shakya - Scott Barron - Scott Gifford - Sebastian Krahmer - Sebastien Roy - Sepherosa Ziehau - Shaun Clowes - Solomon Peachy - Stefan Hudson - Stephen Donnelly - Takashi Yamamoto - Tanaka Shin-ya - Tobias Poschwatta - Tony Li - Torsten Landschoff - Uns Lider - Uwe Girlich - Wesley Shields - Xianjie Zhang - Xin Li - Yen Yen Lim - Yvan Vanhullebus - Yoann Vandoorselaere + Alan Bawden + Albert Chin + Alexander 'Leo' Bergolth + Alexey Kuznetsov + Alon Bar-Lev + Andrew Brown + + Antti Kantee + Arien Vijn + Arkadiusz Miskiewicz + Armando L. Caro Jr. + Assar Westerlund + Brian Ginsbach + Charles M. Hannum + Chris G. Demetriou + Chris Lightfoot + Chris Maynard + Chris Pepper + Christian Bell + Christian Peron + Daniele Orlandi + Darren Reed + David Kaelbling + David Young + Dean Gaudet + Don Ebright + Dug Song + Dustin Spicuzza + Eric Anderson + Erik de Castro Lopo + Felix Obenhuber + Florent Drouin + Franz Schaefer + frederich + Fulko Hew + Fumiyuki Shimizu + Garrett Cooper + Gianluca Varenni + Gilbert Hoyek + Gisle Vanem + Graeme Hewson + Greg Stark + Greg Troxel + Gregor Maier + Guillaume Pelat + Hagen Paul Pfeifer + Henri Doreau + Hyung Sik Yoon + Igor Khristophorov + Jan-Philip Velders + Jason R. Thorpe + Javier Achirica + Jean Tourrilhes + Jean-Louis Charton + Jefferson Ogata + Jesper Dangaard Brouer + Jesper Peterson + Joerg Mayer + John Bankier + Jon Lindgren + Jon Smirl + Juergen Schoenwaelder + Julien Moutinho + Jung-uk Kim + Kazushi Sugyo + Klaus Klein + Koryn Grant + Kris Katterjohn + Krzysztof Halasa + Lorenzo Cavallaro + Loris Degioanni + Love Hörnquist-Åstrand + Luis MartinGarcia + Maciej W. Rozycki + Marcus Felipe Pereira + Mark C. Brown + Mark Pizzolato + Markus Mayer + Martin Husemann + Márton Németh + Matthew Luckie + Max Laier + Mike Frysinger + Mike Kershaw + Mike Wiacek + Miroslav Lichvar + Monroe Williams + + N. Leiten + Nicolas Dade + Octavian Cerna + Olaf Kirch + Ollie Wild + Onno van der Linden + Paolo Abeni + Patrick Marie + Patrick McHardy + Paul Mundt + Pavel Kankovsky + Pawel Pokrywka + Peter Fales + Peter Jeremy + Peter Volkov + Phil Wood + Rafal Maszkowski + + Richard Stearn + Rick Jones + Robert Edmonds + Roberto Mariani + Romain Francoise + Sagun Shakya + Scott Barron + Scott Gifford + Scott Mcmillan + Sebastian Krahmer + Sebastien Roy + Sepherosa Ziehau + Shaun Clowes + Solomon Peachy + Stefan Hudson + Stephen Donnelly + Takashi Yamamoto + Tanaka Shin-ya + Tobias Poschwatta + Tony Li + Torsten Landschoff + Uns Lider + Uwe Girlich + Wesley Shields + Xianjie Zhang + Xin Li + Yen Yen Lim + Yvan Vanhullebus + Yoann Vandoorselaere The original LBL crew: - Steve McCanne - Craig Leres - Van Jacobson + Steve McCanne + Craig Leres + Van Jacobson Past maintainers: - Jun-ichiro itojun Hagino + Jun-ichiro itojun Hagino Modified: vendor/libpcap/dist/Makefile.in ============================================================================== --- vendor/libpcap/dist/Makefile.in Tue Jan 31 15:53:54 2012 (r230827) +++ vendor/libpcap/dist/Makefile.in Tue Jan 31 17:22:07 2012 (r230828) @@ -46,19 +46,21 @@ VPATH = @srcdir@ LD = /usr/bin/ld CC = @CC@ +AR = @AR@ CCOPT = @V_CCOPT@ INCLS = -I. @V_INCLS@ DEFS = @DEFS@ @V_DEFS@ ADDLOBJS = @ADDLOBJS@ ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@ LIBS = @LIBS@ +CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ DYEXT = @DYEXT@ V_RPATH_OPT = @V_RPATH_OPT@ PROG=libpcap # Standard CFLAGS -CFLAGS = $(CCOPT) $(INCLS) $(DEFS) +FULL_CFLAGS = $(CCOPT) $(INCLS) $(DEFS) $(CFLAGS) INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -78,9 +80,9 @@ YACC = @V_YACC@ # problem if you don't own the file but can write to the directory. .c.o: @rm -f $@ - $(CC) $(CFLAGS) -c $(srcdir)/$*.c + $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c -PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ +PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ @NETFILTER_SRC@ FSRC = fad-@V_FINDALLDEVS@.c SSRC = @SSRC@ CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c \ @@ -123,14 +125,29 @@ HDR = $(PUBHDR) \ sf-pcap-ng.h \ sunatmpos.h +TESTS = \ + filtertest \ + findalldevstest \ + nonblocktest \ + opentest \ + selpolltest + +TESTS_SRC = \ + tests/filtertest.c \ + tests/findalldevstest.c \ + tests/nonblocktest.c \ + tests/opentest.c \ + tests/reactivatetest.c \ + tests/selpolltest.c + GENHDR = \ scanner.h tokdefs.h version.h TAGFILES = \ $(SRC) $(HDR) -CLEANFILES = $(OBJ) libpcap.* filtertest findalldevstest selpolltest \ - opentest $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \ +CLEANFILES = $(OBJ) libpcap.* $(TESTS) \ + $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \ lex.yy.c pcap-config MAN1 = pcap-config.1 @@ -141,8 +158,10 @@ MAN3PCAP_EXPAND = \ pcap_datalink.3pcap.in \ pcap_dump_open.3pcap.in \ pcap_list_datalinks.3pcap.in \ + pcap_list_tstamp_types.3pcap.in \ pcap_open_dead.3pcap.in \ - pcap_open_offline.3pcap.in + pcap_open_offline.3pcap.in \ + pcap_set_tstamp_type.3pcap.in MAN3PCAP_NOEXPAND = \ pcap_activate.3pcap \ @@ -160,9 +179,7 @@ MAN3PCAP_NOEXPAND = \ pcap_file.3pcap \ pcap_fileno.3pcap \ pcap_findalldevs.3pcap \ - pcap_freealldevs.3pcap \ pcap_freecode.3pcap \ - pcap_free_datalinks.3pcap \ pcap_get_selectable_fd.3pcap \ pcap_geterr.3pcap \ pcap_inject.3pcap \ @@ -187,7 +204,9 @@ MAN3PCAP_NOEXPAND = \ pcap_snapshot.3pcap \ pcap_stats.3pcap \ pcap_statustostr.3pcap \ - pcap_strerror.3pcap + pcap_strerror.3pcap \ + pcap_tstamp_type_name_to_val.3pcap \ + pcap_tstamp_type_val_to_name.3pcap MAN3PCAP = $(MAN3PCAP_NOEXPAND) $(MAN3PCAP_EXPAND:.in=) @@ -196,9 +215,11 @@ MANFILE = \ MANMISC = \ pcap-filter.manmisc.in \ - pcap-linktype.manmisc.in + pcap-linktype.manmisc.in \ + pcap-tstamp.manmisc.in EXTRA_DIST = \ + $(TESTS_SRC) \ CHANGES \ ChmodBPF/ChmodBPF \ ChmodBPF/StartupParameters.plist \ @@ -237,8 +258,6 @@ EXTRA_DIST = \ fad-null.c \ fad-sita.c \ fad-win32.c \ - filtertest.c \ - findalldevstest.c \ grammar.y \ install-sh \ lbl/os-aix4.h \ @@ -263,7 +282,6 @@ EXTRA_DIST = \ msdos/pktdrvr.c \ msdos/pktdrvr.h \ msdos/readme.dos \ - opentest.c \ org.tcpdump.chmod_bpf.plist \ packaging/pcap.spec.in \ pcap-bpf.c \ @@ -282,6 +300,8 @@ EXTRA_DIST = \ pcap-libdlpi.c \ pcap-linux.c \ pcap-namedb.h \ + pcap-netfilter-linux.c \ + pcap-netfilter-linux.h \ pcap-nit.c \ pcap-null.c \ pcap-pf.c \ @@ -299,7 +319,6 @@ EXTRA_DIST = \ pcap-win32.c \ runlex.sh \ scanner.l \ - selpolltest.c \ Win32/Include/Gnuc.h \ Win32/Include/addrinfo.h \ Win32/Include/bittypes.h \ @@ -328,7 +347,7 @@ all: libpcap.a shared pcap-config libpcap.a: $(OBJ) @rm -f $@ - ar rc $@ $(OBJ) $(ADDLARCHIVEOBJS) + $(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS) $(RANLIB) $@ shared: libpcap.$(DYEXT) @@ -401,7 +420,7 @@ libpcap.sl: $(OBJ) libpcap.shareda: $(OBJ) @rm -f $@ shr.o $(CC) @V_SHLIB_OPT@ -o shr.o $(OBJ) $(ADDLOBJS) $(LDFLAGS) $(LIBS) - ar rc $@ shr.o + $(AR) rc $@ shr.o # # For platforms that don't support shared libraries (or on which we @@ -414,7 +433,7 @@ scanner.c: $(srcdir)/scanner.l $(srcdir)/runlex.sh $(LEX) -o$@ $< scanner.o: scanner.c tokdefs.h - $(CC) $(CFLAGS) -c scanner.c + $(CC) $(FULL_CFLAGS) -c scanner.c pcap.o: version.h @@ -427,13 +446,13 @@ grammar.c: $(srcdir)/grammar.y grammar.o: grammar.c @rm -f $@ - $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c + $(CC) $(FULL_CFLAGS) -Dyylval=pcap_lval -c grammar.c version.o: version.c - $(CC) $(CFLAGS) -c version.c + $(CC) $(FULL_CFLAGS) -c version.c snprintf.o: $(srcdir)/missing/snprintf.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c version.c: $(srcdir)/VERSION @rm -f $@ @@ -467,35 +486,47 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c bpf_filter.o: bpf_filter.c - $(CC) $(CFLAGS) -c bpf_filter.c + $(CC) $(FULL_CFLAGS) -c bpf_filter.c # # Generate the pcap-config script. # -pcap-config: $(srcdir)/pcap-config.in +# Some Makes, e.g. AIX Make and Solaris Make, can't handle "--file=$@.tmp:$<"; +# for example, the Solaris 9 make man page says +# +# Because make assigns $< and $* as it would for implicit rules +# (according to the suffixes list and the directory contents), +# they may be unreliable when used within explicit target entries. +# +# and this is an explicit target entry. +# +# Therefore, instead of using $<, we explicitly put in $(srcdir)/pcap-config.in. +# +pcap-config: $(srcdir)/pcap-config.in ./config.status @rm -f $@ $@.tmp - sed -e 's|@includedir[@]|$(includedir)|g' \ - -e 's|@libdir[@]|$(libdir)|g' \ - -e 's|@LIBS[@]|$(LIBS)|g' \ - -e 's|@V_RPATH_OPT[@]|$(V_RPATH_OPT)|g' \ - $(srcdir)/pcap-config.in >$@.tmp + ./config.status --file=$@.tmp:$(srcdir)/pcap-config.in mv $@.tmp $@ chmod a+x $@ # # Test programs - not built by default, and not installed. # -filtertest: filtertest.c libpcap.a - $(CC) $(CFLAGS) -I. -L. -o filtertest $(srcdir)/filtertest.c libpcap.a $(LIBS) +tests: $(TESTS) + +filtertest: tests/filtertest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o filtertest $(srcdir)/tests/filtertest.c libpcap.a $(LIBS) + +findalldevstest: tests/findalldevstest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o findalldevstest $(srcdir)/tests/findalldevstest.c libpcap.a $(LIBS) -findalldevstest: findalldevstest.c libpcap.a - $(CC) $(CFLAGS) -I. -L. -o findalldevstest $(srcdir)/findalldevstest.c libpcap.a $(LIBS) +nonblocktest: tests/nonblocktest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o nonblocktest $(srcdir)/tests/nonblocktest.c libpcap.a $(LIBS) -selpolltest: selpolltest.c libpcap.a - $(CC) $(CFLAGS) -I. -L. -o selpolltest $(srcdir)/selpolltest.c libpcap.a $(LIBS) +opentest: tests/opentest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o opentest $(srcdir)/tests/opentest.c libpcap.a $(LIBS) -opentest: opentest.c libpcap.a - $(CC) $(CFLAGS) -I. -L. -o opentest $(srcdir)/opentest.c libpcap.a $(LIBS) +selpolltest: tests/selpolltest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o selpolltest $(srcdir)/tests/selpolltest.c libpcap.a $(LIBS) install: install-shared install-archive pcap-config [ -d $(DESTDIR)$(libdir) ] || \ @@ -533,12 +564,21 @@ install: install-shared install-archive rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3pcap \ $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap + ln $(DESTDIR)$(mandir)/man3/pcap_findalldevs.3pcap \ + $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3pcap \ $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap ln $(DESTDIR)$(mandir)/man3/pcap_inject.3pcap \ $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap + ln $(DESTDIR)$(mandir)/man3/pcap_list_datalinks.3pcap \ + $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap + ln $(DESTDIR)$(mandir)/man3/pcap_list_tstamp_types.3pcap \ + $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap ln $(DESTDIR)$(mandir)/man3/pcap_loop.3pcap \ $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap @@ -622,8 +662,11 @@ uninstall: uninstall-shared rm -f $(DESTDIR)$(mandir)/man3/$$i; done rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap @@ -660,7 +703,7 @@ clean: distclean: clean rm -f Makefile config.cache config.log config.status \ - config.h gnuc.h os-proto.h bpf_filter.c pcap-config \ + config.h gnuc.h net os-proto.h bpf_filter.c pcap-config \ stamp-h stamp-h.in rm -f $(MAN3PCAP_EXPAND:.in=) $(MANFILE:.in=) $(MANMISC:.in=) rm -rf autom4te.cache Modified: vendor/libpcap/dist/README ============================================================================== --- vendor/libpcap/dist/README Tue Jan 31 15:53:54 2012 (r230827) +++ vendor/libpcap/dist/README Tue Jan 31 17:22:07 2012 (r230828) @@ -63,13 +63,14 @@ added overhead (especially, for selectiv would translate BPF filters into a filter program that is compatible with the underlying kernel subsystem, but this is not yet implemented. -BPF is standard in 4.4BSD, BSD/OS, NetBSD, FreeBSD, and OpenBSD. DEC -OSF/1/Digital UNIX/Tru64 UNIX uses the packetfilter interface but has -been extended to accept BPF filters (which libpcap utilizes). Also, you -can add BPF filter support to Ultrix using the kernel source and/or -object patches available in: +BPF is standard in 4.4BSD, BSD/OS, NetBSD, FreeBSD, OpenBSD, DragonFly +BSD, and Mac OS X; an older, modified and undocumented version is +standard in AIX. {DEC OSF/1, Digital UNIX, Tru64 UNIX} uses the +packetfilter interface but has been extended to accept BPF filters +(which libpcap utilizes). Also, you can add BPF filter support to +Ultrix using the kernel source and/or object patches available in: - ftp://gatekeeper.dec.com/pub/DEC/net/bpfext42.tar.Z. + http://www.tcpdump.org/other/bpfext42.tar.Z Linux, in the 2.2 kernel and later kernels, has a "Socket Filter" mechanism that accepts BPF filters; see the README.linux file for Modified: vendor/libpcap/dist/README.linux ============================================================================== --- vendor/libpcap/dist/README.linux Tue Jan 31 15:53:54 2012 (r230827) +++ vendor/libpcap/dist/README.linux Tue Jan 31 17:22:07 2012 (r230828) @@ -97,12 +97,12 @@ reported by pcap_stats on Linux are as f 2.2.x ===== ps_recv Number of packets that were accepted by the pcap filter -ps_drops Always 0, this statistic is not gatherd on this platform +ps_drop Always 0, this statistic is not gatherd on this platform 2.4.x ===== -ps_rec Number of packets that were accepted by the pcap filter -ps_drops Number of packets that had passed filtering but were not +ps_recv Number of packets that were accepted by the pcap filter +ps_drop Number of packets that had passed filtering but were not passed on to pcap due to things like buffer shortage, etc. - This is useful because these are packets you are interested in - but won't be reported by, for example, tcpdump output. + This is useful because these are packets you are interested in + but won't be reported by, for example, tcpdump output. Modified: vendor/libpcap/dist/VERSION ============================================================================== --- vendor/libpcap/dist/VERSION Tue Jan 31 15:53:54 2012 (r230827) +++ vendor/libpcap/dist/VERSION Tue Jan 31 17:22:07 2012 (r230828) @@ -1 +1 @@ -1.1.1 +1.2.1 Modified: vendor/libpcap/dist/Win32/Include/bittypes.h ============================================================================== --- vendor/libpcap/dist/Win32/Include/bittypes.h Tue Jan 31 15:53:54 2012 (r230827) +++ vendor/libpcap/dist/Win32/Include/bittypes.h Tue Jan 31 17:22:07 2012 (r230828) @@ -30,78 +30,28 @@ #define _BITTYPES_H #ifndef HAVE_U_INT8_T - -#if SIZEOF_CHAR == 1 typedef unsigned char u_int8_t; typedef signed char int8_t; -#elif SIZEOF_INT == 1 -typedef unsigned int u_int8_t; -typedef signed int int8_t; -#else /* XXX */ -#error "there's no appropriate type for u_int8_t" -#endif -#define HAVE_U_INT8_T 1 -#define HAVE_INT8_T 1 - #endif /* HAVE_U_INT8_T */ #ifndef HAVE_U_INT16_T - -#if SIZEOF_SHORT == 2 typedef unsigned short u_int16_t; typedef signed short int16_t; -#elif SIZEOF_INT == 2 -typedef unsigned int u_int16_t; -typedef signed int int16_t; -#elif SIZEOF_CHAR == 2 -typedef unsigned char u_int16_t; -typedef signed char int16_t; -#else /* XXX */ -#error "there's no appropriate type for u_int16_t" -#endif -#define HAVE_U_INT16_T 1 -#define HAVE_INT16_T 1 - #endif /* HAVE_U_INT16_T */ #ifndef HAVE_U_INT32_T - -#if SIZEOF_INT == 4 typedef unsigned int u_int32_t; typedef signed int int32_t; -#elif SIZEOF_LONG == 4 -typedef unsigned long u_int32_t; -typedef signed long int32_t; -#elif SIZEOF_SHORT == 4 -typedef unsigned short u_int32_t; -typedef signed short int32_t; -#else /* XXX */ -#error "there's no appropriate type for u_int32_t" -#endif -#define HAVE_U_INT32_T 1 -#define HAVE_INT32_T 1 - #endif /* HAVE_U_INT32_T */ #ifndef HAVE_U_INT64_T -#if SIZEOF_LONG_LONG == 8 -typedef unsigned long long u_int64_t; -typedef long long int64_t; -#elif defined(_MSC_EXTENSIONS) +#ifdef _MSC_EXTENSIONS typedef unsigned _int64 u_int64_t; typedef _int64 int64_t; -#elif SIZEOF_INT == 8 -typedef unsigned int u_int64_t; -#elif SIZEOF_LONG == 8 -typedef unsigned long u_int64_t; -#elif SIZEOF_SHORT == 8 -typedef unsigned short u_int64_t; -#else /* XXX */ -#error "there's no appropriate type for u_int64_t" -#endif -#define HAVE_U_INT64_T 1 -#define HAVE_INT64_T 1 - +#else /* _MSC_EXTENSIONS */ +typedef unsigned long long u_int64_t; +typedef long long int64_t; +#endif /* _MSC_EXTENSIONS */ #endif /* HAVE_U_INT64_T */ #ifndef PRId64 Modified: vendor/libpcap/dist/Win32/Prj/libpcap.dsp ============================================================================== --- vendor/libpcap/dist/Win32/Prj/libpcap.dsp Tue Jan 31 15:53:54 2012 (r230827) +++ vendor/libpcap/dist/Win32/Prj/libpcap.dsp Tue Jan 31 17:22:07 2012 (r230828) @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../lbl/" /I "../../bpf/" /I "../include/" /I "../../../../common" /I "../../../../dag/include" /I "../../../../dag/drv/windows" /D "NDEBUG" /D "YY_NEVER_INTERACTIVE" /D yylval=pcap_lval /D "_USRDLL" /D "LIBPCAP_EXPORTS" /D "HAVE_STRERROR" /D "__STDC__" /D "INET6" /D "_WINDOWS" /D "_MBCS" /D SIZEOF_CHAR=1 /D SIZEOF_SHORT=2 /D SIZEOF_INT=4 /D "HAVE_ADDRINFO" /D "WIN32" /D _U_= /D "HAVE_SNPRINTF" /D "HAVE_VSNPRINTF" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../lbl/" /I "../../bpf/" /I "../include/" /I "../../../../common" /I "../../../../dag/include" /I "../../../../dag/drv/windows" /D "NDEBUG" /D "YY_NEVER_INTERACTIVE" /D yylval=pcap_lval /D "_USRDLL" /D "LIBPCAP_EXPORTS" /D "HAVE_STRERROR" /D "__STDC__" /D "INET6" /D "_WINDOWS" /D "_MBCS" /D "HAVE_ADDRINFO" /D "WIN32" /D _U_= /D "HAVE_SNPRINTF" /D "HAVE_VSNPRINTF" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -64,7 +64,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../lbl/" /I "../../bpf/" /I "../include/" /I "../../../../common" /I "../../../../dag/include" /I "../../../../dag/drv/windows" /D "_DEBUG" /D "YY_NEVER_INTERACTIVE" /D yylval=pcap_lval /D "_USRDLL" /D "LIBPCAP_EXPORTS" /D "HAVE_STRERROR" /D "__STDC__" /D "INET6" /D "_WINDOWS" /D "_MBCS" /D SIZEOF_CHAR=1 /D SIZEOF_SHORT=2 /D SIZEOF_INT=4 /D "HAVE_ADDRINFO" /D "WIN32" /D _U_= /D "HAVE_SNPRINTF" /D "HAVE_VSNPRINTF" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../lbl/" /I "../../bpf/" /I "../include/" /I "../../../../common" /I "../../../../dag/include" /I "../../../../dag/drv/windows" /D "_DEBUG" /D "YY_NEVER_INTERACTIVE" /D yylval=pcap_lval /D "_USRDLL" /D "LIBPCAP_EXPORTS" /D "HAVE_STRERROR" /D "__STDC__" /D "INET6" /D "_WINDOWS" /D "_MBCS" /D "HAVE_ADDRINFO" /D "WIN32" /D _U_= /D "HAVE_SNPRINTF" /D "HAVE_VSNPRINTF" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe Modified: vendor/libpcap/dist/Win32/Src/gai_strerror.c ============================================================================== --- vendor/libpcap/dist/Win32/Src/gai_strerror.c Tue Jan 31 15:53:54 2012 (r230827) +++ vendor/libpcap/dist/Win32/Src/gai_strerror.c Tue Jan 31 17:22:07 2012 (r230828) @@ -80,4 +80,4 @@ WSAAPI gai_strerrorA(int ecode) return "Unknown error"; } -#endif /* gai_strerror */ \ No newline at end of file +#endif /* gai_strerror */ Modified: vendor/libpcap/dist/Win32/Src/getaddrinfo.c ============================================================================== --- vendor/libpcap/dist/Win32/Src/getaddrinfo.c Tue Jan 31 15:53:54 2012 (r230827) +++ vendor/libpcap/dist/Win32/Src/getaddrinfo.c Tue Jan 31 17:22:07 2012 (r230828) @@ -45,6 +45,12 @@ * in ai_flags? */ +/* + * Mingw64 has its own implementation of getaddrinfo, mingw32 no + */ +#ifndef __MINGW64__ + + #ifdef HAVE_CONFIG_H #include #endif @@ -85,7 +91,7 @@ static const char rcsid[] _U_ = #ifdef NEED_ADDRINFO_H #include "addrinfo.h" #ifdef WIN32 -#include "IP6_misc.h" +#include "ip6_misc.h" #endif #endif @@ -1118,3 +1124,6 @@ find_afd(af) } return NULL; } + + +#endif /*__MING64__*/ Modified: vendor/libpcap/dist/aclocal.m4 ============================================================================== --- vendor/libpcap/dist/aclocal.m4 Tue Jan 31 15:53:54 2012 (r230827) +++ vendor/libpcap/dist/aclocal.m4 Tue Jan 31 17:22:07 2012 (r230828) @@ -245,7 +245,24 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT, # or accepts command-line arguments like # those the GNU linker accepts. # - V_CCOPT="$V_CCOPT -fpic" + # Some instruction sets require -fPIC on some + # operating systems. Check for them. If you + # have a combination that requires it, add it + # here. + # + PIC_OPT=-fpic + case "$host_cpu" in + + sparc64*) + case "$host_os" in + + freebsd*) + PIC_OPT=-fPIC + ;; + esac + ;; + esac + V_CCOPT="$V_CCOPT $PIC_OPT" V_SONAME_OPT="-Wl,-soname," V_RPATH_OPT="-Wl,-rpath," ;; @@ -978,8 +995,9 @@ dnl code that would use that member, or dnl AC_DEFUN(AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI, [AC_MSG_CHECKING(if tpacket_auxdata struct has tp_vlan_tci member) - AC_CACHE_VAL(ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1, + AC_CACHE_VAL(ac_cv_lbl_linux_tpacket_auxdata_tp_vlan_tci, AC_TRY_COMPILE([ +# include # include ], [u_int i = sizeof(((struct tpacket_auxdata *)0)->tp_vlan_tci)], ac_cv_lbl_linux_tpacket_auxdata_tp_vlan_tci=yes, Modified: vendor/libpcap/dist/bpf/net/bpf_filter.c ============================================================================== --- vendor/libpcap/dist/bpf/net/bpf_filter.c Tue Jan 31 15:53:54 2012 (r230827) +++ vendor/libpcap/dist/bpf/net/bpf_filter.c Tue Jan 31 17:22:07 2012 (r230828) @@ -405,7 +405,18 @@ bpf_filter(pc, p, wirelen, buflen) continue; case BPF_JMP|BPF_JA: +#if defined(KERNEL) || defined(_KERNEL) + /* + * No backward jumps allowed. + */ pc += pc->k; +#else + /* + * XXX - we currently implement "ip6 protochain" + * with backward jumps, so sign-extend pc->k. + */ + pc += (bpf_int32)pc->k; +#endif continue; case BPF_JMP|BPF_JGT|BPF_K: @@ -608,7 +619,7 @@ bpf_validate(f, len) /* * Check for constant division by 0. */ - if (BPF_RVAL(p->code) == BPF_K && p->k == 0) + if (BPF_SRC(p->code) == BPF_K && p->k == 0) return 0; break; default: Modified: vendor/libpcap/dist/config.h.in ============================================================================== --- vendor/libpcap/dist/config.h.in Tue Jan 31 15:53:54 2012 (r230827) +++ vendor/libpcap/dist/config.h.in Tue Jan 31 17:22:07 2012 (r230828) @@ -18,6 +18,9 @@ /* define if you have streams capable DAG API */ #undef HAVE_DAG_STREAMS_API +/* define if you have vdag_set_device_info() */ +#undef HAVE_DAG_VDAG + /* Define to 1 if you have the declaration of `ether_hostton', and to 0 if you don't. */ #undef HAVE_DECL_ETHER_HOSTTON @@ -52,12 +55,30 @@ /* if libnl exists */ #undef HAVE_LIBNL +/* if libnl exists and is version 2.x */ +#undef HAVE_LIBNL_2_x + /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_COMPILER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_ETHTOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IF_PACKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_NET_TSTAMP_H + /* if tp_vlan_tci exists */ #undef HAVE_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_TYPES_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_USBDEVICE_FS_H @@ -73,6 +94,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IF_ETHER_H +/* Define to 1 if you have the header file. */ +#undef HAVE_NETPACKET_IF_PACKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETPACKET_PACKET_H + /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_MEDIA_H @@ -217,6 +244,9 @@ /* target host supports CAN sniffing */ #undef PCAP_SUPPORT_CAN +/* target host supports netfilter sniffing */ +#undef PCAP_SUPPORT_NETFILTER + /* target host supports USB sniffing */ #undef PCAP_SUPPORT_USB *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 17:24:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76BE5106566B; Tue, 31 Jan 2012 17:24:09 +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 4B1B78FC08; Tue, 31 Jan 2012 17:24:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VHO9sG046828; Tue, 31 Jan 2012 17:24:09 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VHO9F9046827; Tue, 31 Jan 2012 17:24:09 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201201311724.q0VHO9F9046827@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 31 Jan 2012 17:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230829 - vendor/libpcap/1.2.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 17:24:09 -0000 Author: gnn Date: Tue Jan 31 17:24:08 2012 New Revision: 230829 URL: http://svn.freebsd.org/changeset/base/230829 Log: Create a tag for version 1.2.1 of libpcap. Added: vendor/libpcap/1.2.1/ - copied from r230828, vendor/libpcap/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 17:48:50 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90919106566B; Tue, 31 Jan 2012 17:48:50 +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 5CE868FC08; Tue, 31 Jan 2012 17:48:50 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0VHmnOM050461; Tue, 31 Jan 2012 12:48:49 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0VHmnJv050460; Tue, 31 Jan 2012 12:48:49 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Tue, 31 Jan 2012 12:48:49 -0500 From: David Schultz To: Konstantin Belousov Message-ID: <20120131174849.GA50386@zim.MIT.EDU> Mail-Followup-To: Konstantin Belousov , Bruce Evans , Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <20120127194612.H1547@besplex.bde.org> <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> <20120127194221.GA25723@zim.MIT.EDU> <20120128123748.GD2726@deviant.kiev.zoral.com.ua> <20120129001225.GA32220@zim.MIT.EDU> <20120129062327.GK2726@deviant.kiev.zoral.com.ua> <20120129223904.GA37483@zim.MIT.EDU> <20120130063034.GU2726@deviant.kiev.zoral.com.ua> <20120130190703.GA44663@zim.MIT.EDU> <20120131105431.GB3283@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120131105431.GB3283@deviant.kiev.zoral.com.ua> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Gleb Smirnoff , src-committers@FreeBSD.ORG, Bruce Evans Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 17:48:50 -0000 On Tue, Jan 31, 2012, Konstantin Belousov wrote: > On Mon, Jan 30, 2012 at 02:07:03PM -0500, David Schultz wrote: > > On Mon, Jan 30, 2012, Kostik Belousov wrote: > > > On Sun, Jan 29, 2012 at 05:39:04PM -0500, David Schultz wrote: > > > > On Sun, Jan 29, 2012, Kostik Belousov wrote: > > > > > On Sat, Jan 28, 2012 at 07:12:25PM -0500, David Schultz wrote: > > > > > > On Sat, Jan 28, 2012, Kostik Belousov wrote: > > > > > > > On Fri, Jan 27, 2012 at 02:42:21PM -0500, David Schultz wrote: > > > > > > > > The correct limit on the maximum size of a single read/write is > > > > > > > > SSIZE_MAX, but FreeBSD uses INT_MAX. It's not safe to raise the > > > > > > > > limit yet, though, because of bugs in several filesystems. For > > > > > > > > example, FFS copies uio_resid into a local variable of type int. > > > > > > > > I have some old patches that fix some of these issues for FFS and > > > > > > > > cd9660, but surely there are more places I didn't notice. > > > > > > > > > > > > > > > Absolutely agree. > > > > > > > > > > > > > > http://people.freebsd.org/~kib/misc/uio_resid.5.patch > > > > > > > > > > > > Nice. You found a lot more than I've got in my tree, and you even > > > > > > fixed the return values. There are at least a few more places to > > > > > > fix. For instance, cd9660 and the NFS client pass uio_resid or > > > > > > iov_len to min(), which operates on ints. (Incidentally, C11 > > > > > > generics ought to make it possible to write type-generic min() > > > > > > and max() functions.) > > > > > > > > > > Thank you, http://people.freebsd.org/~kib/misc/uio_resid.6.patch > > > > > changed them to MIN(). > > > > > > > > This looks good to me. I tried to think of other places that you > > > > might have missed, and the only one that occurred to me is the > > > Might ? I think this is a blatant understate. > > > > > > > pipe code. sys_pipe.c has an `int orig_resid' and lots of bogus > > > > casts of iov_len and uio_resid to type u_int. Some look harmless, > > > > although it appears that writing a multiple of 2^32 bytes might > > > > result in pipe_build_write_buffer() allocating a 0-length buffer. > > > > > > > > My only reservation is that raising the limit could unmask a > > > > kernel buffer overflow if we missed something, but I guess we have > > > > to cross that bridge some day anyway. > > > Yes, and it is an obvious reason why I am chicken to commit this for > > > so long time. One more place, if this is reasonable to count as 'one' > > > place, are the cdevsw methods. devfs passes uio down to the drivers. > > > > That's why I'm glad I'm not committing it. :) A more conservative > > change (also known as "kicking the can down the road") would be to > > add a VFS flag, e.g., VFCF_LONGIO, and only set it on file systems > > that have been thoroughly reviewed. The VFS layer could cap the size > > at INT_MAX for file systems without the flag. > At least I will get more mail after the commit, I hope. > > I disagree with the VFCF_LONGIO approach. It will cause much head-scratching > for unsuspecting user who would try to use > 4GB transfers. > > What I can do, is to commit all changes except removals of the checks > for INT_MAX. After type changes settle, I can try to gather enough > bravery to flip the checks in HEAD, possibly with temporary sysctl > to return to old behaviour for emergency (AKA hole). That sounds like a good plan to me. As an aside, I wonder if we could convince the clang folks to add a warning similar to `lint -a', which complains about every long->int narrowing conversion that doesn't have an explicit cast. Modern languages such as Java and C# require casts for narrowing conversions, and I'd be a lot more confident about this change if we did the same for the FreeBSD kernel. > > > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c > > > index 9edcb74..332ec37 100644 > > > --- a/sys/kern/sys_pipe.c > > > +++ b/sys/kern/sys_pipe.c > > [...] > > > @@ -757,14 +757,14 @@ pipe_build_write_buffer(wpipe, uio) > > > struct pipe *wpipe; > > > struct uio *uio; > > > { > > > - u_int size; > > > + size_t size; > > > int i; > > > > > > PIPE_LOCK_ASSERT(wpipe, MA_NOTOWNED); > > > KASSERT(wpipe->pipe_state & PIPE_DIRECTW, > > > ("Clone attempt on non-direct write pipe!")); > > > > > > - size = (u_int) uio->uio_iov->iov_len; > > > + size = uio->uio_iov->iov_len; > > > if (size > wpipe->pipe_buffer.size) > > > size = wpipe->pipe_buffer.size; > > > > The transfer can't be bigger than the max pipe buffer size (64k), > > so `size = (int)MIN(uio->uio_iov->iov_len, wpipe->pipe_buffer.size)' > > should suffice. The same comment applies elsewhere in the file. > > True. If you much prefer this version, I will change the patch. But I do > think that my changes are cleaner. I don't mind either way. I haven't touched anything remotely close to that code in years. From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 17:51:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C017106566C; Tue, 31 Jan 2012 17:51:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 006168FC08; Tue, 31 Jan 2012 17:51:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VHpUDr047669; Tue, 31 Jan 2012 17:51:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VHpUoB047665; Tue, 31 Jan 2012 17:51:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201201311751.q0VHpUoB047665@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 31 Jan 2012 17:51: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: r230830 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 17:51:31 -0000 Author: jkim Date: Tue Jan 31 17:51:30 2012 New Revision: 230830 URL: http://svn.freebsd.org/changeset/base/230830 Log: - Restore XCR0 before restoring extended FPU states. - Update my copyright dates. Reviewed by: kib Modified: head/sys/amd64/acpica/acpi_switch.S head/sys/amd64/acpica/acpi_wakecode.S head/sys/amd64/acpica/acpi_wakeup.c Modified: head/sys/amd64/acpica/acpi_switch.S ============================================================================== --- head/sys/amd64/acpica/acpi_switch.S Tue Jan 31 17:24:08 2012 (r230829) +++ head/sys/amd64/acpica/acpi_switch.S Tue Jan 31 17:51:30 2012 (r230830) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2001 Takanori Watanabe * Copyright (c) 2001 Mitsuru IWASAKI - * Copyright (c) 2008-2010 Jung-uk Kim + * Copyright (c) 2008-2012 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -95,7 +95,6 @@ ENTRY(acpi_restorecpu) /* Restore CR0 except for FPU mode. */ movq PCB_CR0(%rdi), %rax - movq %rax, %rcx andq $~(CR0_EM | CR0_TS), %rax movq %rax, %cr0 @@ -146,21 +145,26 @@ ENTRY(acpi_restorecpu) /* Restore FPU state. */ fninit - movq WAKEUP_CTX(fpusave),%rdi - cmpl $0,use_xsave - jne 1f - fxrstor (%rdi) + movq WAKEUP_CTX(xsmask), %rax + testq %rax, %rax + jz 1f + movq %rax, %rdx + shrq $32, %rdx + movl $XCR0, %ecx +/* xsetbv */ + .byte 0x0f, 0x01, 0xd1 + movq WAKEUP_CTX(fpusave), %rcx +/* xrstor (%rcx) */ + .byte 0x0f, 0xae, 0x29 jmp 2f -1: movl xsave_mask,%eax - movl xsave_mask+4,%edx -/* xrstor (%rdi) */ - .byte 0x0f,0xae,0x2f +1: + movq WAKEUP_CTX(fpusave), %rcx + fxrstor (%rcx) 2: /* Reload CR0. */ - movq %rcx, %cr0 - - movq WAKEUP_CTX(pcb),%rdi + movq PCB_CR0(%rdi), %rax + movq %rax, %cr0 /* Restore return address. */ movq PCB_RIP(%rdi), %rax Modified: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- head/sys/amd64/acpica/acpi_wakecode.S Tue Jan 31 17:24:08 2012 (r230829) +++ head/sys/amd64/acpica/acpi_wakecode.S Tue Jan 31 17:51:30 2012 (r230830) @@ -2,7 +2,7 @@ * Copyright (c) 2001 Takanori Watanabe * Copyright (c) 2001 Mitsuru IWASAKI * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2008-2010 Jung-uk Kim + * Copyright (c) 2008-2012 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -284,6 +284,8 @@ wakeup_cstar: .quad 0 wakeup_sfmask: .quad 0 +wakeup_xsmask: + .quad 0 wakeup_cpu: .long 0 dummy: Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Tue Jan 31 17:24:08 2012 (r230829) +++ head/sys/amd64/acpica/acpi_wakeup.c Tue Jan 31 17:51:30 2012 (r230830) @@ -2,7 +2,7 @@ * Copyright (c) 2001 Takanori Watanabe * Copyright (c) 2001 Mitsuru IWASAKI * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2008-2010 Jung-uk Kim + * Copyright (c) 2008-2012 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -386,6 +386,7 @@ acpi_install_wakeup_handler(struct acpi_ WAKECODE_FIXUP(wakeup_lstar, uint64_t, rdmsr(MSR_LSTAR)); WAKECODE_FIXUP(wakeup_cstar, uint64_t, rdmsr(MSR_CSTAR)); WAKECODE_FIXUP(wakeup_sfmask, uint64_t, rdmsr(MSR_SF_MASK)); + WAKECODE_FIXUP(wakeup_xsmask, uint64_t, xsave_mask); /* Build temporary page tables below realmode code. */ pt4 = wakeaddr; From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 18:13:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 710F5106566B; Tue, 31 Jan 2012 18:13:50 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E7908FC08; Tue, 31 Jan 2012 18:13:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VIDodF048408; Tue, 31 Jan 2012 18:13:50 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VIDoGV048406; Tue, 31 Jan 2012 18:13:50 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201201311813.q0VIDoGV048406@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 31 Jan 2012 18:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230831 - stable/8/sys/dev/xen/netfront X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 18:13:50 -0000 Author: gibbs Date: Tue Jan 31 18:13:49 2012 New Revision: 230831 URL: http://svn.freebsd.org/changeset/base/230831 Log: MFC r225708 into stable/8: Modify the netfront driver so it can successfully attach to PV devices with the ioemu attribute set. sys/dev/xen/netfront/netfront.c: o If a mac address for the interface cannot be found in the front-side XenStore tree, look for an entry in the back-side tree. With ioemu devices, the emulator does not populate the front side tree and neither does Xend. o Return an error rather than panic when an attach attempt fails. Reported by: Janne Snabb (fix inspired by patch provided) PR: kern/154302 Modified: stable/8/sys/dev/xen/netfront/netfront.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/8/sys/dev/xen/netfront/netfront.c Tue Jan 31 17:51:30 2012 (r230830) +++ stable/8/sys/dev/xen/netfront/netfront.c Tue Jan 31 18:13:49 2012 (r230831) @@ -402,11 +402,33 @@ xen_net_read_mac(device_t dev, uint8_t m { int error, i; char *s, *e, *macstr; + const char *path; - error = xs_read(XST_NIL, xenbus_get_node(dev), "mac", NULL, - (void **) &macstr); - if (error) + path = xenbus_get_node(dev); + error = xs_read(XST_NIL, path, "mac", NULL, (void **) &macstr); + if (error == ENOENT) { + /* + * Deal with missing mac XenStore nodes on devices with + * HVM emulation (the 'ioemu' configuration attribute) + * enabled. + * + * The HVM emulator may execute in a stub device model + * domain which lacks the permission, only given to Dom0, + * to update the guest's XenStore tree. For this reason, + * the HVM emulator doesn't even attempt to write the + * front-side mac node, even when operating in Dom0. + * However, there should always be a mac listed in the + * backend tree. Fallback to this version if our query + * of the front side XenStore location doesn't find + * anything. + */ + path = xenbus_get_otherend_path(dev); + error = xs_read(XST_NIL, path, "mac", NULL, (void **) &macstr); + } + if (error != 0) { + xenbus_dev_fatal(dev, error, "parsing %s/mac", path); return (error); + } s = macstr; for (i = 0; i < ETHER_ADDR_LEN; i++) { @@ -447,7 +469,7 @@ netfront_attach(device_t dev) err = create_netdev(dev); if (err) { xenbus_dev_fatal(dev, err, "creating netdev"); - return err; + return (err); } #if __FreeBSD_version >= 700000 @@ -457,7 +479,7 @@ netfront_attach(device_t dev) &xn_enable_lro, 0, "Large Receive Offload"); #endif - return 0; + return (0); } @@ -2020,11 +2042,8 @@ create_netdev(device_t dev) } err = xen_net_read_mac(dev, np->mac); - if (err) { - xenbus_dev_fatal(dev, err, "parsing %s/mac", - xenbus_get_node(dev)); + if (err) goto out; - } /* Set up ifnet structure */ ifp = np->xn_ifp = if_alloc(IFT_ETHER); @@ -2066,8 +2085,7 @@ create_netdev(device_t dev) exit: gnttab_free_grant_references(np->gref_tx_head); out: - panic("do something smart"); - + return (err); } /** From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 18:24:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 872A6106566C; Tue, 31 Jan 2012 18:24:26 +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 73CE28FC08; Tue, 31 Jan 2012 18:24:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VIOQxf048786; Tue, 31 Jan 2012 18:24:26 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VIOQGe048776; Tue, 31 Jan 2012 18:24:26 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201201311824.q0VIOQGe048776@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 31 Jan 2012 18:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230832 - in vendor/libpcap/dist: . test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 18:24:26 -0000 Author: gnn Date: Tue Jan 31 18:24:25 2012 New Revision: 230832 URL: http://svn.freebsd.org/changeset/base/230832 Log: Add, remove and move files for the 1.2.1 import of libpcap Submitted by: wxs Added: vendor/libpcap/dist/pcap-netfilter-linux.c (contents, props changed) vendor/libpcap/dist/pcap-netfilter-linux.h (contents, props changed) vendor/libpcap/dist/pcap-tstamp.manmisc.in (contents, props changed) vendor/libpcap/dist/pcap_list_tstamp_types.3pcap.in (contents, props changed) vendor/libpcap/dist/pcap_set_tstamp_type.3pcap.in (contents, props changed) vendor/libpcap/dist/pcap_tstamp_type_name_to_val.3pcap vendor/libpcap/dist/pcap_tstamp_type_val_to_name.3pcap vendor/libpcap/dist/test/ vendor/libpcap/dist/test/filtertest.c - copied unchanged from r230831, vendor/libpcap/dist/filtertest.c vendor/libpcap/dist/test/findalldevstest.c - copied unchanged from r230831, vendor/libpcap/dist/findalldevstest.c vendor/libpcap/dist/test/nonblocktest.c (contents, props changed) vendor/libpcap/dist/test/opentest.c - copied unchanged from r230831, vendor/libpcap/dist/opentest.c vendor/libpcap/dist/test/reactivatetest.c (contents, props changed) vendor/libpcap/dist/test/selpolltest.c - copied unchanged from r230831, vendor/libpcap/dist/selpolltest.c Deleted: vendor/libpcap/dist/filtertest.c vendor/libpcap/dist/findalldevstest.c vendor/libpcap/dist/opentest.c vendor/libpcap/dist/pcap_free_datalinks.3pcap vendor/libpcap/dist/pcap_freealldevs.3pcap vendor/libpcap/dist/selpolltest.c Added: vendor/libpcap/dist/pcap-netfilter-linux.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libpcap/dist/pcap-netfilter-linux.c Tue Jan 31 18:24:25 2012 (r230832) @@ -0,0 +1,468 @@ +/* + * Copyright (c) 2011 Jakub Zawadzki + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT + * OWNER 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "pcap-int.h" + +#ifdef NEED_STRERROR_H +#include "strerror.h" +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "pcap-netfilter-linux.h" + +#define HDR_LENGTH (NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct nfgenmsg)))) + +#define NFLOG_IFACE "nflog" + +static int +nflog_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *user) +{ + const unsigned char *buf; + int count = 0; + int len; + + /* ignore interrupt system call error */ + do { + len = recv(handle->fd, handle->buffer, handle->bufsize, 0); + if (handle->break_loop) { + handle->break_loop = 0; + return -2; + } + } while ((len == -1) && (errno == EINTR)); + + if (len < 0) { + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't receive packet %d:%s", errno, pcap_strerror(errno)); + return -1; + } + + buf = handle->buffer; + while (len >= NLMSG_SPACE(0)) { + const struct nlmsghdr *nlh = (const struct nlmsghdr *) buf; + u_int32_t msg_len; + + if (nlh->nlmsg_len < sizeof(struct nlmsghdr) || len < nlh->nlmsg_len) { + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Message truncated: (got: %d) (nlmsg_len: %u)", len, nlh->nlmsg_len); + return -1; + } + + if (NFNL_SUBSYS_ID(nlh->nlmsg_type) == NFNL_SUBSYS_ULOG && + NFNL_MSG_TYPE(nlh->nlmsg_type) == NFULNL_MSG_PACKET) + { + const unsigned char *payload = NULL; + struct pcap_pkthdr pkth; + + if (handle->linktype != DLT_NFLOG) { + const struct nfattr *payload_attr = NULL; + + if (nlh->nlmsg_len < HDR_LENGTH) { + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Malformed message: (nlmsg_len: %u)", nlh->nlmsg_len); + return -1; + } + + if (nlh->nlmsg_len > HDR_LENGTH) { + struct nfattr *attr = NFM_NFA(NLMSG_DATA(nlh)); + int attr_len = nlh->nlmsg_len - NLMSG_ALIGN(HDR_LENGTH); + + while (NFA_OK(attr, attr_len)) { + switch (NFA_TYPE(attr)) { + case NFULA_PAYLOAD: + payload_attr = attr; + break; + } + attr = NFA_NEXT(attr, attr_len); + } + } + + if (payload_attr) { + payload = NFA_DATA(payload_attr); + pkth.len = pkth.caplen = NFA_PAYLOAD(payload_attr); + } + + } else { + payload = NLMSG_DATA(nlh); + pkth.caplen = pkth.len = nlh->nlmsg_len-NLMSG_ALIGN(sizeof(struct nlmsghdr)); + } + + if (payload) { + /* pkth.caplen = min (payload_len, handle->snapshot); */ + + gettimeofday(&pkth.ts, NULL); + if (handle->fcode.bf_insns == NULL || + bpf_filter(handle->fcode.bf_insns, payload, pkth.len, pkth.caplen)) + { + handle->md.packets_read++; + callback(user, &pkth, payload); + count++; + } + } + } + + msg_len = NLMSG_ALIGN(nlh->nlmsg_len); + if (msg_len > len) + msg_len = len; + + len -= msg_len; + buf += msg_len; + } + return count; +} + +static int +netfilter_set_datalink(pcap_t *handle, int dlt) +{ + handle->linktype = dlt; + return 0; +} + +static int +netfilter_stats_linux(pcap_t *handle, struct pcap_stat *stats) +{ + stats->ps_recv = handle->md.packets_read; + stats->ps_drop = 0; + stats->ps_ifdrop = 0; + return 0; +} + +static int +netfilter_inject_linux(pcap_t *handle, const void *buf, size_t size) +{ + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "inject not supported on netfilter devices"); + return (-1); +} + +struct my_nfattr { + u_int16_t nfa_len; + u_int16_t nfa_type; + void *data; +}; + +static int +nflog_send_config_msg(const pcap_t *handle, u_int8_t family, u_int16_t res_id, const struct my_nfattr *mynfa) +{ + char buf[1024] __attribute__ ((aligned)); + + struct nlmsghdr *nlh = (struct nlmsghdr *) buf; + struct nfgenmsg *nfg = (struct nfgenmsg *) (buf + sizeof(struct nlmsghdr)); + + struct sockaddr_nl snl; + static unsigned int seq_id; + + if (!seq_id) + seq_id = time(NULL); + ++seq_id; + + nlh->nlmsg_len = NLMSG_LENGTH(sizeof(struct nfgenmsg)); + nlh->nlmsg_type = (NFNL_SUBSYS_ULOG << 8) | NFULNL_MSG_CONFIG; + nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; + nlh->nlmsg_pid = 0; /* to kernel */ + nlh->nlmsg_seq = seq_id; + + nfg->nfgen_family = family; + nfg->version = NFNETLINK_V0; + nfg->res_id = htons(res_id); + + if (mynfa) { + struct nfattr *nfa = (struct nfattr *) (buf + NLMSG_ALIGN(nlh->nlmsg_len)); + + nfa->nfa_type = mynfa->nfa_type; + nfa->nfa_len = NFA_LENGTH(mynfa->nfa_len); + memcpy(NFA_DATA(nfa), mynfa->data, mynfa->nfa_len); + nlh->nlmsg_len = NLMSG_ALIGN(nlh->nlmsg_len) + NFA_ALIGN(nfa->nfa_len); + } + + memset(&snl, 0, sizeof(snl)); + snl.nl_family = AF_NETLINK; + + if (sendto(handle->fd, nlh, nlh->nlmsg_len, 0, (struct sockaddr *) &snl, sizeof(snl)) == -1) + return -1; + + /* waiting for reply loop */ + do { + socklen_t addrlen = sizeof(snl); + int len; + + /* ignore interrupt system call error */ + do { + len = recvfrom(handle->fd, buf, sizeof(buf), 0, (struct sockaddr *) &snl, &addrlen); + } while ((len == -1) && (errno == EINTR)); + + if (len <= 0) + return len; + + if (addrlen != sizeof(snl) || snl.nl_family != AF_NETLINK) { + errno = EINVAL; + return -1; + } + + nlh = (struct nlmsghdr *) buf; + if (snl.nl_pid != 0 || seq_id != nlh->nlmsg_seq) /* if not from kernel or wrong sequence skip */ + continue; + + while (len >= NLMSG_SPACE(0) && NLMSG_OK(nlh, len)) { + if (nlh->nlmsg_type == NLMSG_ERROR || (nlh->nlmsg_type == NLMSG_DONE && nlh->nlmsg_flags & NLM_F_MULTI)) { + if (nlh->nlmsg_len < NLMSG_ALIGN(sizeof(struct nlmsgerr))) { + errno = EBADMSG; + return -1; + } + errno = -(*((int *)NLMSG_DATA(nlh))); + return (errno == 0) ? 0 : -1; + } + nlh = NLMSG_NEXT(nlh, len); + } + } while (1); + + return -1; /* never here */ +} + +static int +nflog_send_config_cmd(const pcap_t *handle, u_int16_t group_id, u_int8_t cmd, u_int8_t family) +{ + struct nfulnl_msg_config_cmd msg; + struct my_nfattr nfa; + + msg.command = cmd; + + nfa.data = &msg; + nfa.nfa_type = NFULA_CFG_CMD; + nfa.nfa_len = sizeof(msg); + + return nflog_send_config_msg(handle, family, group_id, &nfa); +} + +static int +nflog_send_config_mode(const pcap_t *handle, u_int16_t group_id, u_int8_t copy_mode, u_int32_t copy_range) +{ + struct nfulnl_msg_config_mode msg; + struct my_nfattr nfa; + + msg.copy_range = htonl(copy_range); + msg.copy_mode = copy_mode; + + nfa.data = &msg; + nfa.nfa_type = NFULA_CFG_MODE; + nfa.nfa_len = sizeof(msg); + + return nflog_send_config_msg(handle, AF_UNSPEC, group_id, &nfa); +} + +static int +nflog_activate(pcap_t* handle) +{ + const char *dev = handle->opt.source; + unsigned short groups[32]; + int group_count = 0; + int i; + + if (strncmp(dev, NFLOG_IFACE, strlen(NFLOG_IFACE)) == 0) { + dev += strlen(NFLOG_IFACE); + + /* nflog:30,33,42 looks nice, allow it */ + if (*dev == ':') + dev++; + + while (*dev) { + long int group_id; + char *end_dev; + + if (group_count == 32) { + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, + "Maximum 32 netfilter groups! dev: %s", + handle->opt.source); + return PCAP_ERROR; + } + + group_id = strtol(dev, &end_dev, 0); + if (end_dev != dev) { + if (group_id < 0 || group_id > 65535) { + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, + "Netfilter group range from 0 to 65535 (got %ld)", + group_id); + return PCAP_ERROR; + } + + groups[group_count++] = (unsigned short) group_id; + dev = end_dev; + } + if (*dev != ',') + break; + dev++; + } + } + + if (*dev) { + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, + "Can't get netfilter group(s) index from %s", + handle->opt.source); + return PCAP_ERROR; + } + + /* if no groups, add default: 0 */ + if (!group_count) { + groups[0] = 0; + group_count = 1; + } + + /* Initialize some components of the pcap structure. */ + handle->bufsize = 128 + handle->snapshot; + handle->offset = 0; + handle->linktype = DLT_NFLOG; + handle->read_op = nflog_read_linux; + handle->inject_op = netfilter_inject_linux; + handle->setfilter_op = install_bpf_program; /* no kernel filtering */ + handle->setdirection_op = NULL; + handle->set_datalink_op = NULL; + handle->set_datalink_op = netfilter_set_datalink; + handle->getnonblock_op = pcap_getnonblock_fd; + handle->setnonblock_op = pcap_setnonblock_fd; + handle->stats_op = netfilter_stats_linux; + + /* Create netlink socket */ + handle->fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER); + if (handle->fd < 0) { + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't create raw socket %d:%s", errno, pcap_strerror(errno)); + return PCAP_ERROR; + } + + handle->dlt_list = (u_int *) malloc(sizeof(u_int) * 2); + if (handle->dlt_list != NULL) { + handle->dlt_list[0] = DLT_NFLOG; + handle->dlt_list[1] = DLT_IPV4; + handle->dlt_count = 2; + } + + handle->buffer = malloc(handle->bufsize); + if (!handle->buffer) { + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't allocate dump buffer: %s", pcap_strerror(errno)); + goto close_fail; + } + + if (nflog_send_config_cmd(handle, 0, NFULNL_CFG_CMD_PF_UNBIND, AF_INET) < 0) { + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "NFULNL_CFG_CMD_PF_UNBIND: %s", pcap_strerror(errno)); + goto close_fail; + } + + if (nflog_send_config_cmd(handle, 0, NFULNL_CFG_CMD_PF_BIND, AF_INET) < 0) { + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "NFULNL_CFG_CMD_PF_BIND: %s", pcap_strerror(errno)); + goto close_fail; + } + + /* Bind socket to the nflog groups */ + for (i = 0; i < group_count; i++) { + if (nflog_send_config_cmd(handle, groups[i], NFULNL_CFG_CMD_BIND, AF_UNSPEC) < 0) { + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't listen on group group index: %s", pcap_strerror(errno)); + goto close_fail; + } + + if (nflog_send_config_mode(handle, groups[i], NFULNL_COPY_PACKET, handle->snapshot) < 0) { + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "NFULNL_COPY_PACKET: %s", pcap_strerror(errno)); + goto close_fail; + } + } + + if (handle->opt.rfmon) { + /* + * Monitor mode doesn't apply to netfilter devices. + */ + pcap_cleanup_live_common(handle); + return PCAP_ERROR_RFMON_NOTSUP; + } + + if (handle->opt.buffer_size != 0) { + /* + * Set the socket buffer size to the specified value. + */ + if (setsockopt(handle->fd, SOL_SOCKET, SO_RCVBUF, &handle->opt.buffer_size, sizeof(handle->opt.buffer_size)) == -1) { + snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "SO_RCVBUF: %s", pcap_strerror(errno)); + goto close_fail; + } + } + + handle->selectable_fd = handle->fd; + return 0; + +close_fail: + pcap_cleanup_live_common(handle); + return PCAP_ERROR; +} + +pcap_t * +nflog_create(const char *device, char *ebuf) +{ + pcap_t *p; + + p = pcap_create_common(device, ebuf); + if (p == NULL) + return (NULL); + + p->activate_op = nflog_activate; + return (p); +} + +int +netfilter_platform_finddevs(pcap_if_t **alldevsp, char *err_str) +{ + pcap_if_t *found_dev = *alldevsp; + int sock; + + sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER); + if (sock < 0) { + /* if netlink is not supported this this is not fatal */ + if (errno == EAFNOSUPPORT) + return 0; + snprintf(err_str, PCAP_ERRBUF_SIZE, "Can't open netlink socket %d:%s", + errno, pcap_strerror(errno)); + return -1; + } + close(sock); + + if (pcap_add_if(&found_dev, NFLOG_IFACE, 0, "Linux netfilter log (NFLOG) interface", err_str) < 0) + return -1; + return 0; +} + Added: vendor/libpcap/dist/pcap-netfilter-linux.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libpcap/dist/pcap-netfilter-linux.h Tue Jan 31 18:24:25 2012 (r230832) @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2011 Jakub Zawadzki + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT + * OWNER 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. + */ + +/* + * Prototypes for netlink-related functions + */ +int netfilter_platform_finddevs(pcap_if_t **alldevsp, char *err_str); +pcap_t *nflog_create(const char *device, char *ebuf); Added: vendor/libpcap/dist/pcap-tstamp.manmisc.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libpcap/dist/pcap-tstamp.manmisc.in Tue Jan 31 18:24:25 2012 (r230832) @@ -0,0 +1,132 @@ +.\" +.\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997 +.\" The Regents of the University of California. All rights reserved. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that: (1) source code distributions +.\" retain the above copyright notice and this paragraph in its entirety, (2) +.\" distributions including binary code include the above copyright notice and +.\" this paragraph in its entirety in the documentation or other materials +.\" provided with the distribution, and (3) all advertising materials mentioning +.\" features or use of this software display the following acknowledgement: +.\" ``This product includes software developed by the University of California, +.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of +.\" the University nor the names of its contributors may be used to endorse +.\" or promote products derived from this software without specific prior +.\" written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.TH PCAP-TSTAMP @MAN_MISC_INFO@ "22 August 2010" +.SH NAME +pcap-tstamp \- packet time stamps in libpcap +.SH DESCRIPTION +When capturing traffic, each packet is given a time stamp representing, +for incoming packets, the arrival time of the packet and, for outgoing +packets, the transmission time of the packet. This time is an +approximation of the arrival or transmission time. If it is supplied by +the operating system running on the host on which the capture is being +done, there are several reasons why it might not precisely represent the +arrival or transmission time: +.IP +if the time stamp is applied to the packet when the networking stack +receives the packet, the networking stack might not see the packet until +an interrupt is delivered for the packet or a timer event causes the +networking device driver to poll for packets, and the time stamp might +not be applied until the packet has had some processing done by other +code in the networking stack, so there might be a significant delay +between the time when the last bit of the packet is received by the +capture device and when the networking stack time-stamps the packet; +.IP +the timer used to generate the time stamps might have low resolution, +for example, it might be a timer updated once per host operating system +timer tick, with the host operating system timer ticking once every few +milliseconds; +.IP +a high-resolution timer might use a counter that runs at a rate +dependent on the processor clock speed, and that clock speed might be +adjusted upwards or downwards over time and the timer might not be able +to compensate for all those adjustments; +.IP +the host operating system's clock might be adjusted over time to match a +time standard to which the host is being synchronized, which might be +done by temporarily slowing down or speeding up the clock or by making a +single adjustment; +.IP +different CPU cores on a multi-core or multi-processor system might be +running at different speeds, or might not have time counters all +synchronized, so packets time-stamped by different cores might not have +consistent time stamps. +.LP +In addition, packets time-stamped by different cores might be +time-stamped in one order and added to the queue of packets for libpcap +to read in another order, so time stamps might not be monotonically +increasing. +.LP +Some capture devices on some platforms can provide time stamps for +packets; those time stamps are usually high-resolution time stamps, and +are usually applied to the packet when the first or last bit of the +packet arrives, and are thus more accurate than time stamps provided by +the host operating system. Those time stamps might not, however, be +synchronized with the host operating system's clock, so that, for +example, the time stamp of a packet might not correspond to the time +stamp of an event on the host triggered by the arrival of that packet. +.LP +Depending on the capture device and the software on the host, libpcap +might allow different types of time stamp to be used. The +.BR pcap_list_tstamp_types (3PCAP) +routine provides, for a packet capture handle created by +.BR pcap_create (3PCAP) +but not yet activated by +.BR pcap_activate (3PCAP), +a list of time stamp types supported by the capture device for that +handle. +The list might be empty, in which case no choice of time stamp type is +offered for that capture device. If the list is not empty, the +.BR pcap_set_tstamp_type (3PCAP) +routine can be used after a +.B pcap_create() +call and before a +.B pcap_activate() +call to specify the type of time stamp to be used on the device. +The time stamp types are listed here; the first value is the #define to +use in code, the second value is the value returned by +.B pcap_tstamp_type_val_to_name() +and accepted by +.BR pcap_tstamp_name_to_val() . +.RS 5 +.TP 5 +.BR PCAP_TSTAMP_HOST " - " host +Time stamp provided by the host on which the capture is being done. The +precision of this time stamp is unspecified; it might or might not be +synchronized with the host operating system's clock. +.TP 5 +.BR PCAP_TSTAMP_HOST_LOWPREC " - " host_lowprec +Time stamp provided by the host on which the capture is being done. +This is a low-precision time stamp, synchronized with the host operating +system's clock. +.TP 5 +.BR PCAP_TSTAMP_HOST_HIPREC " - " host_hiprec +Time stamp provided by the host on which the capture is being done. +This is a high-precision time stamp; it might or might not be +synchronized with the host operating system's clock. It might be more +expensive to fetch than +.BR PCAP_TSTAMP_HOST_LOWPREC . +.TP 5 +.BR PCAP_TSTAMP_ADAPTER " - " adapter +Time stamp provided by the network adapter on which the capture is being +done. This is a high-precision time stamp, synchronized with the host +operating system's clock. +.TP 5 +.BR PCAP_TSTAMP_ADAPTER_UNSYNCED " - " adapter_unsynced +Time stamp provided by the network adapter on which the capture is being +done. This is a high-precision time stamp; it is not synchronized with +the host operating system's clock. +.RE +.SH SEE ALSO +pcap_set_tstamp_type(3PCAP), +pcap_list_tstamp_types(3PCAP), +pcap_tstamp_type_val_to_name(3PCAP), +pcap_tstamp_name_to_val(3PCAP) Added: vendor/libpcap/dist/pcap_list_tstamp_types.3pcap.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libpcap/dist/pcap_list_tstamp_types.3pcap.in Tue Jan 31 18:24:25 2012 (r230832) @@ -0,0 +1,70 @@ +.\" +.\" Copyright (c) 1994, 1996, 1997 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that: (1) source code distributions +.\" retain the above copyright notice and this paragraph in its entirety, (2) +.\" distributions including binary code include the above copyright notice and +.\" this paragraph in its entirety in the documentation or other materials +.\" provided with the distribution, and (3) all advertising materials mentioning +.\" features or use of this software display the following acknowledgement: +.\" ``This product includes software developed by the University of California, +.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of +.\" the University nor the names of its contributors may be used to endorse +.\" or promote products derived from this software without specific prior +.\" written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.TH PCAP_LIST_TSTAMP_TYPES 3PCAP "21 August 2010" +.SH NAME +pcap_list_tstamp_types, pcap_free_tstamp_types \- get a list of time +stamp types supported by a capture device, and free that list +.SH SYNOPSIS +.nf +.ft B +#include +.ft +.LP +.ft B +int pcap_list_tstamp_types(pcap_t *p, int **tstamp_typesp); +void pcap_free_tstamp_types(int *tstamp_types); +.ft +.fi +.SH DESCRIPTION +.B pcap_list_tstamp_types() +is used to get a list of the supported time stamp types of the interface +associated with the pcap descriptor. +.B pcap_list_tstamp_types() +allocates an array to hold the list and sets +.I *tstamp_typesp +to point to the array. +See +.BR pcap-tstamp (@MAN_MISC_INFO@) +for a list of all the time stamp types. +.PP +The caller is responsible for freeing the array with +.BR pcap_free_tstamp_types() , +which frees the list pointed to by +.IR tstamp_types . +.SH RETURN VALUE +.B pcap_list_tstamp_types() +returns the number of time stamp types in the array on success and +.B PCAP_ERROR +on failure. +A return value of zero means that you cannot specify a time stamp type; +you are limited to the capture device's default time stamp type. +If +.B PCAP_ERROR +is returned, +.B pcap_geterr() +or +.B pcap_perror() +may be called with +.I p +as an argument to fetch or display the error text. +.SH SEE ALSO +pcap(3PCAP), pcap_geterr(3PCAP), pcap_tstamp_type_val_to_name(3PCAP), +pcap-tstamp(@MAN_MISC_INFO@) Added: vendor/libpcap/dist/pcap_set_tstamp_type.3pcap.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libpcap/dist/pcap_set_tstamp_type.3pcap.in Tue Jan 31 18:24:25 2012 (r230832) @@ -0,0 +1,65 @@ +.\" +.\" Copyright (c) 1994, 1996, 1997 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that: (1) source code distributions +.\" retain the above copyright notice and this paragraph in its entirety, (2) +.\" distributions including binary code include the above copyright notice and +.\" this paragraph in its entirety in the documentation or other materials +.\" provided with the distribution, and (3) all advertising materials mentioning +.\" features or use of this software display the following acknowledgement: +.\" ``This product includes software developed by the University of California, +.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of +.\" the University nor the names of its contributors may be used to endorse +.\" or promote products derived from this software without specific prior +.\" written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.TH PCAP_SET_TSTAMP_TYPE 3PCAP "21 August 2010" +.SH NAME +pcap_set_tstamp_type \- set the time stamp type to be used by a +capture device +.SH SYNOPSIS +.nf +.ft B +#include +.ft +.LP +.ft B +int pcap_set_tstamp_type(pcap_t *p, int tstamp_type); +.ft +.fi +.SH DESCRIPTION +.B pcap_set_tstamp_type() +sets the the type of time stamp desired for packets captured on the pcap +descriptor to the type specified by +.IR tstamp_type . +It must be called on a pcap descriptor created by +.B pcap_create() +that has not yet been activated by +.BR pcap_activate() . +.B pcap_list_tstamp_types() +will give a list of the time stamp types supported by a given capture +device. +See +.BR pcap-tstamp (@MAN_MISC_INFO@) +for a list of all the time stamp types. +.SH RETURN VALUE +.B pcap_set_tstamp_type() +returns 0 on success if the specified time stamp type is expected to be +supported by the capture device, +.B PCAP_WARNING_TSTAMP_TYPE_NOTSUP +on success if the specified time stamp type is not supported by the +capture device, +.B PCAP_ERROR_ACTIVATED +if called on a capture handle that has been activated, and +.B PCAP_ERROR_CANTSET_TSTAMP_TYPE +if the capture device doesn't support setting the time stamp type. +.SH SEE ALSO +pcap(3PCAP), +pcap_list_tstamp_types(3PCAP), +pcap_tstamp_type_name_to_val(3PCAP), +pcap-tstamp(@MAN_MISC_INFO@) Added: vendor/libpcap/dist/pcap_tstamp_type_name_to_val.3pcap ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libpcap/dist/pcap_tstamp_type_name_to_val.3pcap Tue Jan 31 18:24:25 2012 (r230832) @@ -0,0 +1,45 @@ +.\" +.\" Copyright (c) 1994, 1996, 1997 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that: (1) source code distributions +.\" retain the above copyright notice and this paragraph in its entirety, (2) +.\" distributions including binary code include the above copyright notice and +.\" this paragraph in its entirety in the documentation or other materials +.\" provided with the distribution, and (3) all advertising materials mentioning +.\" features or use of this software display the following acknowledgement: +.\" ``This product includes software developed by the University of California, +.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of +.\" the University nor the names of its contributors may be used to endorse +.\" or promote products derived from this software without specific prior +.\" written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.TH PCAP_TSTAMP_TYPE_NAME_TO_VAL 3PCAP "21 August 2010" +.SH NAME +pcap_tstamp_type_name_to_val \- get the time stamp type value +corresponding to a time stamp type name +.SH SYNOPSIS +.nf +.ft B +#include +.ft +.LP +.ft B +int pcap_tstamp_type_name_to_val(const char *name); +.ft +.fi +.SH DESCRIPTION +.B pcap_tstamp_type_name_to_val() +translates a time stamp type name to the corresponding time stamp type +value. The translation is case-insensitive. +.SH RETURN VALUE +.B pcap_tstamp_type_name_to_val() +returns 0 on success and +.B PCAP_ERROR +on failure. +.SH SEE ALSO +pcap(3PCAP), pcap_tstamp_type_val_to_name(3PCAP) Added: vendor/libpcap/dist/pcap_tstamp_type_val_to_name.3pcap ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libpcap/dist/pcap_tstamp_type_val_to_name.3pcap Tue Jan 31 18:24:25 2012 (r230832) @@ -0,0 +1,45 @@ +.\" +.\" Copyright (c) 1994, 1996, 1997 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that: (1) source code distributions +.\" retain the above copyright notice and this paragraph in its entirety, (2) +.\" distributions including binary code include the above copyright notice and +.\" this paragraph in its entirety in the documentation or other materials +.\" provided with the distribution, and (3) all advertising materials mentioning +.\" features or use of this software display the following acknowledgement: +.\" ``This product includes software developed by the University of California, +.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of +.\" the University nor the names of its contributors may be used to endorse +.\" or promote products derived from this software without specific prior +.\" written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.TH PCAP_TSTAMP_TYPE_VAL_TO_NAME 3PCAP "21 August 2010" +.SH NAME +pcap_tstamp_type_val_to_name, pcap_tstamp_type_val_to_description \- get +a name or description for a time stamp type value +.SH SYNOPSIS +.nf +.ft B +#include +.ft +.LP +.ft B +const char *pcap_tstamp_type_val_to_name(int tstamp_type); +const char *pcap_tstamp_type_val_to_description(int tstamp_type); +.ft +.fi +.SH DESCRIPTION +.B pcap_tstamp_type_val_to_name() +translates a time stamp type value to the corresponding time stamp type +name. NULL is returned on failure. +.PP +.B pcap_tstamp_type_val_to_description() +translates a time stamp type value to a short description of that time +stamp type. NULL is returned on failure. +.SH SEE ALSO +pcap(3PCAP), pcap_tstamp_type_name_to_val(3PCAP) Copied: vendor/libpcap/dist/test/filtertest.c (from r230831, vendor/libpcap/dist/filtertest.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libpcap/dist/test/filtertest.c Tue Jan 31 18:24:25 2012 (r230832, copy of r230831, vendor/libpcap/dist/filtertest.c) @@ -0,0 +1,266 @@ +/* + * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that: (1) source code distributions + * retain the above copyright notice and this paragraph in its entirety, (2) + * distributions including binary code include the above copyright notice and + * this paragraph in its entirety in the documentation or other materials + * provided with the distribution, and (3) all advertising materials mentioning + * features or use of this software display the following acknowledgement: + * ``This product includes software developed by the University of California, + * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of + * the University nor the names of its contributors may be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef lint +static const char copyright[] _U_ = + "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\ +The Regents of the University of California. All rights reserved.\n"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/libpcap/filtertest.c,v 1.2 2005-08-08 17:50:13 guy Exp $ (LBL)"; +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef HAVE___ATTRIBUTE__ +#define __attribute__(x) +#endif + +static char *program_name; + +/* Forwards */ +static void usage(void) __attribute__((noreturn)); +static void error(const char *, ...) + __attribute__((noreturn, format (printf, 1, 2))); + +extern int optind; +extern int opterr; +extern char *optarg; + +/* + * On Windows, we need to open the file in binary mode, so that + * we get all the bytes specified by the size we get from "fstat()". + * On UNIX, that's not necessary. O_BINARY is defined on Windows; + * we define it as 0 if it's not defined, so it does nothing. + */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static char * +read_infile(char *fname) +{ + register int i, fd, cc; + register char *cp; + struct stat buf; + + fd = open(fname, O_RDONLY|O_BINARY); + if (fd < 0) + error("can't open %s: %s", fname, pcap_strerror(errno)); + + if (fstat(fd, &buf) < 0) + error("can't stat %s: %s", fname, pcap_strerror(errno)); + + cp = malloc((u_int)buf.st_size + 1); + if (cp == NULL) + error("malloc(%d) for %s: %s", (u_int)buf.st_size + 1, + fname, pcap_strerror(errno)); + cc = read(fd, cp, (u_int)buf.st_size); + if (cc < 0) + error("read %s: %s", fname, pcap_strerror(errno)); + if (cc != buf.st_size) + error("short read %s (%d != %d)", fname, cc, (int)buf.st_size); + + close(fd); + /* replace "# comment" with spaces */ + for (i = 0; i < cc; i++) { + if (cp[i] == '#') + while (i < cc && cp[i] != '\n') + cp[i++] = ' '; + } + cp[cc] = '\0'; + return (cp); +} + +/* VARARGS */ +static void +error(const char *fmt, ...) +{ + va_list ap; + + (void)fprintf(stderr, "%s: ", program_name); + va_start(ap, fmt); + (void)vfprintf(stderr, fmt, ap); + va_end(ap); + if (*fmt) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 18:24:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43F071065702; Tue, 31 Jan 2012 18:24:52 +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 181A98FC12; Tue, 31 Jan 2012 18:24:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VIOpil048839; Tue, 31 Jan 2012 18:24:51 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VIOpnq048838; Tue, 31 Jan 2012 18:24:51 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201201311824.q0VIOpnq048838@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 31 Jan 2012 18:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230833 - vendor/libpcap/1.2.1/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 18:24:52 -0000 Author: gnn Date: Tue Jan 31 18:24:51 2012 New Revision: 230833 URL: http://svn.freebsd.org/changeset/base/230833 Log: Retag the 1.2.1 import to get the adds/removes correct. Added: vendor/libpcap/1.2.1/dist/ - copied from r230832, vendor/libpcap/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 18:36:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E0B41065674; Tue, 31 Jan 2012 18:36:43 +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 0B6D18FC08; Tue, 31 Jan 2012 18:36:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VIagvd049404; Tue, 31 Jan 2012 18:36:42 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VIagxO049403; Tue, 31 Jan 2012 18:36:42 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201201311836.q0VIagxO049403@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 31 Jan 2012 18:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230834 - vendor/libpcap/1.2.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 18:36:43 -0000 Author: gnn Date: Tue Jan 31 18:36:42 2012 New Revision: 230834 URL: http://svn.freebsd.org/changeset/base/230834 Log: Remove a broken import/tag so we can re do it. Deleted: vendor/libpcap/1.2.1/ From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 18:37:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83AAF106564A; Tue, 31 Jan 2012 18:37:27 +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 57D1C8FC14; Tue, 31 Jan 2012 18:37:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VIbREC049462; Tue, 31 Jan 2012 18:37:27 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VIbRQW049461; Tue, 31 Jan 2012 18:37:27 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201201311837.q0VIbRQW049461@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 31 Jan 2012 18:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230835 - vendor/libpcap/1.2.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 18:37:27 -0000 Author: gnn Date: Tue Jan 31 18:37:26 2012 New Revision: 230835 URL: http://svn.freebsd.org/changeset/base/230835 Log: Create a new tag for 1.2.1 to clear up the issues with the previously botched tag. Added: vendor/libpcap/1.2.1/ - copied from r230834, vendor/libpcap/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 18:42:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4C6F1065672; Tue, 31 Jan 2012 18:42:22 +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 994508FC08; Tue, 31 Jan 2012 18:42:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VIgMDX049650; Tue, 31 Jan 2012 18:42:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VIgMIZ049647; Tue, 31 Jan 2012 18:42:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201311842.q0VIgMIZ049647@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 31 Jan 2012 18:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230836 - stable/9/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 18:42:22 -0000 Author: kib Date: Tue Jan 31 18:42:22 2012 New Revision: 230836 URL: http://svn.freebsd.org/changeset/base/230836 Log: MFC r228133: Hide the internals of vm_page_lock(9) from the loadable modules. Modified: stable/9/sys/vm/vm_page.c stable/9/sys/vm/vm_page.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_page.c ============================================================================== --- stable/9/sys/vm/vm_page.c Tue Jan 31 18:37:26 2012 (r230835) +++ stable/9/sys/vm/vm_page.c Tue Jan 31 18:42:22 2012 (r230836) @@ -2642,6 +2642,36 @@ vm_page_test_dirty(vm_page_t m) vm_page_dirty(m); } +void +vm_page_lock_KBI(vm_page_t m, const char *file, int line) +{ + + mtx_lock_flags_(vm_page_lockptr(m), 0, file, line); +} + +void +vm_page_unlock_KBI(vm_page_t m, const char *file, int line) +{ + + mtx_unlock_flags_(vm_page_lockptr(m), 0, file, line); +} + +int +vm_page_trylock_KBI(vm_page_t m, const char *file, int line) +{ + + return (mtx_trylock_flags_(vm_page_lockptr(m), 0, file, line)); +} + +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +void +vm_page_lock_assert_KBI(vm_page_t m, int a, const char *file, int line) +{ + + mtx_assert_(vm_page_lockptr(m), a, file, line); +} +#endif + int so_zerocp_fullpage = 0; /* Modified: stable/9/sys/vm/vm_page.h ============================================================================== --- stable/9/sys/vm/vm_page.h Tue Jan 31 18:37:26 2012 (r230835) +++ stable/9/sys/vm/vm_page.h Tue Jan 31 18:42:22 2012 (r230836) @@ -218,11 +218,23 @@ extern struct vpglocks pa_lock[]; #define PA_LOCK_ASSERT(pa, a) mtx_assert(PA_LOCKPTR(pa), (a)) +#ifdef KLD_MODULE +#define vm_page_lock(m) vm_page_lock_KBI((m), LOCK_FILE, LOCK_LINE) +#define vm_page_unlock(m) vm_page_unlock_KBI((m), LOCK_FILE, LOCK_LINE) +#define vm_page_trylock(m) vm_page_trylock_KBI((m), LOCK_FILE, LOCK_LINE) +#if defined(INVARIANTS) +#define vm_page_lock_assert(m, a) \ + vm_page_lock_assert_KBI((m), (a), __FILE__, __LINE__) +#else +#define vm_page_lock_assert(m, a) +#endif +#else /* !KLD_MODULE */ #define vm_page_lockptr(m) (PA_LOCKPTR(VM_PAGE_TO_PHYS((m)))) #define vm_page_lock(m) mtx_lock(vm_page_lockptr((m))) #define vm_page_unlock(m) mtx_unlock(vm_page_lockptr((m))) #define vm_page_trylock(m) mtx_trylock(vm_page_lockptr((m))) #define vm_page_lock_assert(m, a) mtx_assert(vm_page_lockptr((m)), (a)) +#endif #define vm_page_queue_free_mtx vm_page_queue_free_lock.data /* @@ -403,6 +415,13 @@ void vm_page_cowfault (vm_page_t); int vm_page_cowsetup(vm_page_t); void vm_page_cowclear (vm_page_t); +void vm_page_lock_KBI(vm_page_t m, const char *file, int line); +void vm_page_unlock_KBI(vm_page_t m, const char *file, int line); +int vm_page_trylock_KBI(vm_page_t m, const char *file, int line); +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +void vm_page_lock_assert_KBI(vm_page_t m, int a, const char *file, int line); +#endif + #ifdef INVARIANTS void vm_page_object_lock_assert(vm_page_t m); #define VM_PAGE_OBJECT_LOCK_ASSERT(m) vm_page_object_lock_assert(m) From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 18:43:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED933106564A; Tue, 31 Jan 2012 18:43:19 +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 DAAB78FC16; Tue, 31 Jan 2012 18:43:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VIhJ1A049724; Tue, 31 Jan 2012 18:43:19 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VIhJcv049714; Tue, 31 Jan 2012 18:43:19 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201201311843.q0VIhJcv049714@svn.freebsd.org> From: Xin LI Date: Tue, 31 Jan 2012 18:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230837 - in vendor/libz/dist: . contrib/asm686 doc test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 18:43:20 -0000 Author: delphij Date: Tue Jan 31 18:43:19 2012 New Revision: 230837 URL: http://svn.freebsd.org/changeset/base/230837 Log: Vendor import of zlib 1.2.6. Added: vendor/libz/dist/test/ vendor/libz/dist/test/example.c vendor/libz/dist/test/infcover.c vendor/libz/dist/test/minigzip.c Deleted: vendor/libz/dist/example.c vendor/libz/dist/minigzip.c Modified: vendor/libz/dist/ChangeLog vendor/libz/dist/FAQ vendor/libz/dist/README vendor/libz/dist/adler32.c vendor/libz/dist/contrib/asm686/match.S vendor/libz/dist/crc32.c vendor/libz/dist/crc32.h vendor/libz/dist/deflate.c vendor/libz/dist/deflate.h vendor/libz/dist/doc/algorithm.txt vendor/libz/dist/gzguts.h vendor/libz/dist/gzlib.c vendor/libz/dist/gzread.c vendor/libz/dist/gzwrite.c vendor/libz/dist/infback.c vendor/libz/dist/inffixed.h vendor/libz/dist/inflate.c vendor/libz/dist/inftrees.c vendor/libz/dist/trees.c vendor/libz/dist/zconf.h vendor/libz/dist/zlib.3 vendor/libz/dist/zlib.h vendor/libz/dist/zutil.c vendor/libz/dist/zutil.h Modified: vendor/libz/dist/ChangeLog ============================================================================== --- vendor/libz/dist/ChangeLog Tue Jan 31 18:42:22 2012 (r230836) +++ vendor/libz/dist/ChangeLog Tue Jan 31 18:43:19 2012 (r230837) @@ -1,12 +1,151 @@ ChangeLog file for zlib +Changes in 1.2.6 (29 Jan 2012) +- Update the Pascal interface in contrib/pascal +- Fix function numbers for gzgetc_ in zlibvc.def files +- Fix configure.ac for contrib/minizip [Schiffer] +- Fix large-entry detection in minizip on 64-bit systems [Schiffer] +- Have ./configure use the compiler return code for error indication +- Fix CMakeLists.txt for cross compilation [McClure] +- Fix contrib/minizip/zip.c for 64-bit architectures [Dalsnes] +- Fix compilation of contrib/minizip on FreeBSD [Marquez] +- Correct suggested usages in win32/Makefile.msc [Shachar, Horvath] +- Include io.h for Turbo C / Borland C on all platforms [Truta] +- Make version explicit in contrib/minizip/configure.ac [Bosmans] +- Avoid warning for no encryption in contrib/minizip/zip.c [Vollant] +- Minor cleanup up contrib/minizip/unzip.c [Vollant] +- Fix bug when compiling minizip with C++ [Vollant] +- Protect for long name and extra fields in contrib/minizip [Vollant] +- Avoid some warnings in contrib/minizip [Vollant] +- Add -I../.. -L../.. to CFLAGS for minizip and miniunzip +- Add missing libs to minizip linker command +- Add support for VPATH builds in contrib/minizip +- Add an --enable-demos option to contrib/minizip/configure +- Add the generation of configure.log by ./configure +- Exit when required parameters not provided to win32/Makefile.gcc +- Have gzputc return the character written instead of the argument +- Use the -m option on ldconfig for BSD systems [Tobias] +- Correct in zlib.map when deflateResetKeep was added + +Changes in 1.2.5.3 (15 Jan 2012) +- Restore gzgetc function for binary compatibility +- Do not use _lseeki64 under Borland C++ [Truta] +- Update win32/Makefile.msc to build test/*.c [Truta] +- Remove old/visualc6 given CMakefile and other alternatives +- Update AS400 build files and documentation [Monnerat] +- Update win32/Makefile.gcc to build test/*.c [Truta] +- Permit stronger flushes after Z_BLOCK flushes +- Avoid extraneous empty blocks when doing empty flushes +- Permit Z_NULL arguments to deflatePending +- Allow deflatePrime() to insert bits in the middle of a stream +- Remove second empty static block for Z_PARTIAL_FLUSH +- Write out all of the available bits when using Z_BLOCK +- Insert the first two strings in the hash table after a flush + +Changes in 1.2.5.2 (17 Dec 2011) +- fix ld error: unable to find version dependency 'ZLIB_1.2.5' +- use relative symlinks for shared libs +- Avoid searching past window for Z_RLE strategy +- Assure that high-water mark initialization is always applied in deflate +- Add assertions to fill_window() in deflate.c to match comments +- Update python link in README +- Correct spelling error in gzread.c +- Fix bug in gzgets() for a concatenated empty gzip stream +- Correct error in comment for gz_make() +- Change gzread() and related to ignore junk after gzip streams +- Allow gzread() and related to continue after gzclearerr() +- Allow gzrewind() and gzseek() after a premature end-of-file +- Simplify gzseek() now that raw after gzip is ignored +- Change gzgetc() to a macro for speed (~40% speedup in testing) +- Fix gzclose() to return the actual error last encountered +- Always add large file support for windows +- Include zconf.h for windows large file support +- Include zconf.h.cmakein for windows large file support +- Update zconf.h.cmakein on make distclean +- Merge vestigial vsnprintf determination from zutil.h to gzguts.h +- Clarify how gzopen() appends in zlib.h comments +- Correct documentation of gzdirect() since junk at end now ignored +- Add a transparent write mode to gzopen() when 'T' is in the mode +- Update python link in zlib man page +- Get inffixed.h and MAKEFIXED result to match +- Add a ./config --solo option to make zlib subset with no libary use +- Add undocumented inflateResetKeep() function for CAB file decoding +- Add --cover option to ./configure for gcc coverage testing +- Add #define ZLIB_CONST option to use const in the z_stream interface +- Add comment to gzdopen() in zlib.h to use dup() when using fileno() +- Note behavior of uncompress() to provide as much data as it can +- Add files in contrib/minizip to aid in building libminizip +- Split off AR options in Makefile.in and configure +- Change ON macro to Z_ARG to avoid application conflicts +- Facilitate compilation with Borland C++ for pragmas and vsnprintf +- Include io.h for Turbo C / Borland C++ +- Move example.c and minigzip.c to test/ +- Simplify incomplete code table filling in inflate_table() +- Remove code from inflate.c and infback.c that is impossible to execute +- Test the inflate code with full coverage +- Allow deflateSetDictionary, inflateSetDictionary at any time (in raw) +- Add deflateResetKeep and fix inflateResetKeep to retain dictionary +- Fix gzwrite.c to accommodate reduced memory zlib compilation +- Have inflate() with Z_FINISH avoid the allocation of a window +- Do not set strm->adler when doing raw inflate +- Fix gzeof() to behave just like feof() when read is not past end of file +- Fix bug in gzread.c when end-of-file is reached +- Avoid use of Z_BUF_ERROR in gz* functions except for premature EOF +- Document gzread() capability to read concurrently written files +- Remove hard-coding of resource compiler in CMakeLists.txt [Blammo] + +Changes in 1.2.5.1 (10 Sep 2011) +- Update FAQ entry on shared builds (#13) +- Avoid symbolic argument to chmod in Makefile.in +- Fix bug and add consts in contrib/puff [Oberhumer] +- Update contrib/puff/zeros.raw test file to have all block types +- Add full coverage test for puff in contrib/puff/Makefile +- Fix static-only-build install in Makefile.in +- Fix bug in unzGetCurrentFileInfo() in contrib/minizip [Kuno] +- Add libz.a dependency to shared in Makefile.in for parallel builds +- Spell out "number" (instead of "nb") in zlib.h for total_in, total_out +- Replace $(...) with `...` in configure for non-bash sh [Bowler] +- Add darwin* to Darwin* and solaris* to SunOS\ 5* in configure [Groffen] +- Add solaris* to Linux* in configure to allow gcc use [Groffen] +- Add *bsd* to Linux* case in configure [Bar-Lev] +- Add inffast.obj to dependencies in win32/Makefile.msc +- Correct spelling error in deflate.h [Kohler] +- Change libzdll.a again to libz.dll.a (!) in win32/Makefile.gcc +- Add test to configure for GNU C looking for gcc in output of $cc -v +- Add zlib.pc generation to win32/Makefile.gcc [Weigelt] +- Fix bug in zlib.h for _FILE_OFFSET_BITS set and _LARGEFILE64_SOURCE not +- Add comment in zlib.h that adler32_combine with len2 < 0 makes no sense +- Make NO_DIVIDE option in adler32.c much faster (thanks to John Reiser) +- Make stronger test in zconf.h to include unistd.h for LFS +- Apply Darwin patches for 64-bit file offsets to contrib/minizip [Slack] +- Fix zlib.h LFS support when Z_PREFIX used +- Add updated as400 support (removed from old) [Monnerat] +- Avoid deflate sensitivity to volatile input data +- Avoid division in adler32_combine for NO_DIVIDE +- Clarify the use of Z_FINISH with deflateBound() amount of space +- Set binary for output file in puff.c +- Use u4 type for crc_table to avoid conversion warnings +- Apply casts in zlib.h to avoid conversion warnings +- Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller] +- Improve inflateSync() documentation to note indeterminancy +- Add deflatePending() function to return the amount of pending output +- Correct the spelling of "specification" in FAQ [Randers-Pehrson] +- Add a check in configure for stdarg.h, use for gzprintf() +- Check that pointers fit in ints when gzprint() compiled old style +- Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler] +- Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt] +- Add debug records in assmebler code [Londer] +- Update RFC references to use http://tools.ietf.org/html/... [Li] +- Add --archs option, use of libtool to configure for Mac OS X [Borstel] + Changes in 1.2.5 (19 Apr 2010) - Disable visibility attribute in win32/Makefile.gcc [Bar-Lev] - Default to libdir as sharedlibdir in configure [Nieder] - Update copyright dates on modified source files - Update trees.c to be able to generate modified trees.h - Exit configure for MinGW, suggesting win32/Makefile.gcc +- Check for NULL path in gz_open [Homurlu] Changes in 1.2.4.5 (18 Apr 2010) - Set sharedlibdir in configure [Torok] @@ -261,7 +400,7 @@ Changes in 1.2.3.4 (21 Dec 2009) - Clear bytes after deflate lookahead to avoid use of uninitialized data - Change a limit in inftrees.c to be more transparent to Coverity Prevent - Update win32/zlib.def with exported symbols from zlib.h -- Correct spelling error in zlib.h [Willem] +- Correct spelling errors in zlib.h [Willem, Sobrado] - Allow Z_BLOCK for deflate() to force a new block - Allow negative bits in inflatePrime() to delete existing bit buffer - Add Z_TREES flush option to inflate() to return at end of trees Modified: vendor/libz/dist/FAQ ============================================================================== --- vendor/libz/dist/FAQ Tue Jan 31 18:42:22 2012 (r230836) +++ vendor/libz/dist/FAQ Tue Jan 31 18:43:19 2012 (r230837) @@ -44,8 +44,8 @@ The lastest zlib FAQ is at http://zlib.n 6. Where's the zlib documentation (man pages, etc.)? - It's in zlib.h . Examples of zlib usage are in the files example.c and - minigzip.c, with more in examples/ . + It's in zlib.h . Examples of zlib usage are in the files test/example.c + and test/minigzip.c, with more in examples/ . 7. Why don't you use GNU autoconf or libtool or ...? @@ -84,8 +84,10 @@ The lastest zlib FAQ is at http://zlib.n 13. How can I make a Unix shared library? - make clean - ./configure -s + By default a shared (and a static) library is built for Unix. So: + + make distclean + ./configure make 14. How do I install a shared zlib library on Unix? @@ -325,7 +327,7 @@ The lastest zlib FAQ is at http://zlib.n correctly points to the zlib specification in RFC 1950 for the "deflate" transfer encoding, there have been reports of servers and browsers that incorrectly produce or expect raw deflate data per the deflate - specficiation in RFC 1951, most notably Microsoft. So even though the + specification in RFC 1951, most notably Microsoft. So even though the "deflate" transfer encoding using the zlib format would be the more efficient approach (and in fact exactly what the zlib format was designed for), using the "gzip" transfer encoding is probably more reliable due to Modified: vendor/libz/dist/README ============================================================================== --- vendor/libz/dist/README Tue Jan 31 18:42:22 2012 (r230836) +++ vendor/libz/dist/README Tue Jan 31 18:43:19 2012 (r230837) @@ -1,22 +1,22 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.5 is a general purpose data compression library. All the code is +zlib 1.2.6 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files -http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) -and rfc1952.txt (gzip format). +http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and +rfc1952 (gzip format). All functions of the compression library are documented in the file zlib.h (volunteer to write man pages welcome, contact zlib@gzip.org). A usage example -of the library is given in the file example.c which also tests that the library -is working correctly. Another example is given in the file minigzip.c. The -compression library itself is composed of all source files except example.c and -minigzip.c. +of the library is given in the file test/example.c which also tests that +the library is working correctly. Another example is given in the file +test/minigzip.c. The compression library itself is composed of all source +files in the root directory. To compile all files and run the test program, follow the instructions given at the top of Makefile.in. In short "./configure; make test", and if that goes -well, "make install" should work for most flavors of Unix. For Windows, use one -of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use +well, "make install" should work for most flavors of Unix. For Windows, use +one of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use make_vms.com. Questions about zlib should be sent to , or to Gilles Vollant @@ -31,7 +31,7 @@ Mark Nelson wrote an ar issue of Dr. Dobb's Journal; a copy of the article is available at http://marknelson.us/1997/01/01/zlib-engine/ . -The changes made in version 1.2.5 are documented in the file ChangeLog. +The changes made in version 1.2.6 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . @@ -44,7 +44,7 @@ http://search.cpan.org/~pmqs/IO-Compress A Python interface to zlib written by A.M. Kuchling is available in Python 1.5 and later versions, see -http://www.python.org/doc/lib/module-zlib.html . +http://docs.python.org/library/zlib.html . zlib is built into tcl: http://wiki.tcl.tk/4610 . @@ -84,7 +84,7 @@ Acknowledgments: Copyright notice: - (C) 1995-2010 Jean-loup Gailly and Mark Adler + (C) 1995-2012 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages Modified: vendor/libz/dist/adler32.c ============================================================================== --- vendor/libz/dist/adler32.c Tue Jan 31 18:42:22 2012 (r230836) +++ vendor/libz/dist/adler32.c Tue Jan 31 18:43:19 2012 (r230837) @@ -1,5 +1,5 @@ /* adler32.c -- compute the Adler-32 checksum of a data stream - * Copyright (C) 1995-2007 Mark Adler + * Copyright (C) 1995-2011 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,9 +9,9 @@ #define local static -local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2); +local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); -#define BASE 65521UL /* largest prime smaller than 65536 */ +#define BASE 65521 /* largest prime smaller than 65536 */ #define NMAX 5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ @@ -21,39 +21,44 @@ local uLong adler32_combine_(uLong adler #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); #define DO16(buf) DO8(buf,0); DO8(buf,8); -/* use NO_DIVIDE if your processor does not do division in hardware */ +/* use NO_DIVIDE if your processor does not do division in hardware -- + try it both ways to see which is faster */ #ifdef NO_DIVIDE -# define MOD(a) \ +/* note that this assumes BASE is 65521, where 65536 % 65521 == 15 + (thank you to John Reiser for pointing this out) */ +# define CHOP(a) \ + do { \ + unsigned long tmp = a >> 16; \ + a &= 0xffffUL; \ + a += (tmp << 4) - tmp; \ + } while (0) +# define MOD28(a) \ do { \ - if (a >= (BASE << 16)) a -= (BASE << 16); \ - if (a >= (BASE << 15)) a -= (BASE << 15); \ - if (a >= (BASE << 14)) a -= (BASE << 14); \ - if (a >= (BASE << 13)) a -= (BASE << 13); \ - if (a >= (BASE << 12)) a -= (BASE << 12); \ - if (a >= (BASE << 11)) a -= (BASE << 11); \ - if (a >= (BASE << 10)) a -= (BASE << 10); \ - if (a >= (BASE << 9)) a -= (BASE << 9); \ - if (a >= (BASE << 8)) a -= (BASE << 8); \ - if (a >= (BASE << 7)) a -= (BASE << 7); \ - if (a >= (BASE << 6)) a -= (BASE << 6); \ - if (a >= (BASE << 5)) a -= (BASE << 5); \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ + CHOP(a); \ if (a >= BASE) a -= BASE; \ } while (0) -# define MOD4(a) \ +# define MOD(a) \ do { \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ + CHOP(a); \ + MOD28(a); \ + } while (0) +# define MOD63(a) \ + do { /* this assumes a is not negative */ \ + z_off64_t tmp = a >> 32; \ + a &= 0xffffffffL; \ + a += (tmp << 8) - (tmp << 5) + tmp; \ + tmp = a >> 16; \ + a &= 0xffffL; \ + a += (tmp << 4) - tmp; \ + tmp = a >> 16; \ + a &= 0xffffL; \ + a += (tmp << 4) - tmp; \ if (a >= BASE) a -= BASE; \ } while (0) #else # define MOD(a) a %= BASE -# define MOD4(a) a %= BASE +# define MOD28(a) a %= BASE +# define MOD63(a) a %= BASE #endif /* ========================================================================= */ @@ -92,7 +97,7 @@ uLong ZEXPORT adler32(adler, buf, len) } if (adler >= BASE) adler -= BASE; - MOD4(sum2); /* only added so many BASE's */ + MOD28(sum2); /* only added so many BASE's */ return adler | (sum2 << 16); } @@ -137,8 +142,13 @@ local uLong adler32_combine_(adler1, adl unsigned long sum2; unsigned rem; + /* for negative len, return invalid adler32 as a clue for debugging */ + if (len2 < 0) + return 0xffffffffUL; + /* the derivation of this formula is left as an exercise for the reader */ - rem = (unsigned)(len2 % BASE); + MOD63(len2); /* assumes len2 >= 0 */ + rem = (unsigned)len2; sum1 = adler1 & 0xffff; sum2 = rem * sum1; MOD(sum2); Modified: vendor/libz/dist/contrib/asm686/match.S ============================================================================== --- vendor/libz/dist/contrib/asm686/match.S Tue Jan 31 18:42:22 2012 (r230836) +++ vendor/libz/dist/contrib/asm686/match.S Tue Jan 31 18:43:19 2012 (r230837) @@ -83,17 +83,25 @@ .text /* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */ +.cfi_sections .debug_frame longest_match: +.cfi_startproc /* Save registers that the compiler may be using, and adjust %esp to */ /* make room for our stack frame. */ pushl %ebp + .cfi_def_cfa_offset 8 + .cfi_offset ebp, -8 pushl %edi + .cfi_def_cfa_offset 12 pushl %esi + .cfi_def_cfa_offset 16 pushl %ebx + .cfi_def_cfa_offset 20 subl $LocalVarsSize, %esp + .cfi_def_cfa_offset LocalVarsSize+20 /* Retrieve the function arguments. %ecx will hold cur_match */ /* throughout the entire function. %edx will hold the pointer to the */ @@ -108,7 +116,7 @@ longest_match: /* if (s->prev_length >= s->good_match) { */ /* chain_length >>= 2; */ /* } */ - + movl dsPrevLen(%edx), %eax movl dsGoodMatch(%edx), %ebx cmpl %ebx, %eax @@ -336,8 +344,14 @@ LookaheadRet: /* Restore the stack and return from whence we came. */ addl $LocalVarsSize, %esp + .cfi_def_cfa_offset 20 popl %ebx + .cfi_def_cfa_offset 16 popl %esi + .cfi_def_cfa_offset 12 popl %edi + .cfi_def_cfa_offset 8 popl %ebp + .cfi_def_cfa_offset 4 +.cfi_endproc match_init: ret Modified: vendor/libz/dist/crc32.c ============================================================================== --- vendor/libz/dist/crc32.c Tue Jan 31 18:42:22 2012 (r230836) +++ vendor/libz/dist/crc32.c Tue Jan 31 18:43:19 2012 (r230837) @@ -1,5 +1,5 @@ /* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995-2006, 2010 Mark Adler + * Copyright (C) 1995-2006, 2010, 2011 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h * * Thanks to Rodney Brown for his contribution of faster @@ -17,6 +17,8 @@ of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should first call get_crc_table() to initialize the tables before allowing more than one thread to use crc32(). + + DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h. */ #ifdef MAKECRCH @@ -53,6 +55,7 @@ /* Definitions for doing the crc four data bytes at a time. */ #ifdef BYFOUR + typedef u4 crc_table_t; # define REV(w) ((((w)>>24)&0xff)+(((w)>>8)&0xff00)+ \ (((w)&0xff00)<<8)+(((w)&0xff)<<24)) local unsigned long crc32_little OF((unsigned long, @@ -61,6 +64,7 @@ const unsigned char FAR *, unsigned)); # define TBLS 8 #else + typedef unsigned long crc_table_t; # define TBLS 1 #endif /* BYFOUR */ @@ -68,16 +72,16 @@ local unsigned long gf2_matrix_times OF((unsigned long *mat, unsigned long vec)); local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat)); -local uLong crc32_combine_(uLong crc1, uLong crc2, z_off64_t len2); +local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2)); #ifdef DYNAMIC_CRC_TABLE local volatile int crc_table_empty = 1; -local unsigned long FAR crc_table[TBLS][256]; +local crc_table_t FAR crc_table[TBLS][256]; local void make_crc_table OF((void)); #ifdef MAKECRCH - local void write_table OF((FILE *, const unsigned long FAR *)); + local void write_table OF((FILE *, const crc_table_t FAR *)); #endif /* MAKECRCH */ /* Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: @@ -107,9 +111,9 @@ local void make_crc_table OF((void)); */ local void make_crc_table() { - unsigned long c; + crc_table_t c; int n, k; - unsigned long poly; /* polynomial exclusive-or pattern */ + crc_table_t poly; /* polynomial exclusive-or pattern */ /* terms of polynomial defining this crc (except x^32): */ static volatile int first = 1; /* flag to limit concurrent making */ static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; @@ -121,13 +125,13 @@ local void make_crc_table() first = 0; /* make exclusive-or pattern from polynomial (0xedb88320UL) */ - poly = 0UL; - for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) - poly |= 1UL << (31 - p[n]); + poly = 0; + for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++) + poly |= (crc_table_t)1 << (31 - p[n]); /* generate a crc for every 8-bit value */ for (n = 0; n < 256; n++) { - c = (unsigned long)n; + c = (crc_table_t)n; for (k = 0; k < 8; k++) c = c & 1 ? poly ^ (c >> 1) : c >> 1; crc_table[0][n] = c; @@ -164,7 +168,7 @@ local void make_crc_table() if (out == NULL) return; fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n"); fprintf(out, " * Generated automatically by crc32.c\n */\n\n"); - fprintf(out, "local const unsigned long FAR "); + fprintf(out, "local const crc_table_t FAR "); fprintf(out, "crc_table[TBLS][256] =\n{\n {\n"); write_table(out, crc_table[0]); # ifdef BYFOUR @@ -184,12 +188,13 @@ local void make_crc_table() #ifdef MAKECRCH local void write_table(out, table) FILE *out; - const unsigned long FAR *table; + const crc_table_t FAR *table; { int n; for (n = 0; n < 256; n++) - fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", table[n], + fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", + (unsigned long)(table[n]), n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", ")); } #endif /* MAKECRCH */ Modified: vendor/libz/dist/crc32.h ============================================================================== --- vendor/libz/dist/crc32.h Tue Jan 31 18:42:22 2012 (r230836) +++ vendor/libz/dist/crc32.h Tue Jan 31 18:43:19 2012 (r230837) @@ -2,7 +2,7 @@ * Generated automatically by crc32.c */ -local const unsigned long FAR crc_table[TBLS][256] = +local const crc_table_t FAR crc_table[TBLS][256] = { { 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, Modified: vendor/libz/dist/deflate.c ============================================================================== --- vendor/libz/dist/deflate.c Tue Jan 31 18:42:22 2012 (r230836) +++ vendor/libz/dist/deflate.c Tue Jan 31 18:43:19 2012 (r230837) @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -37,7 +37,7 @@ * REFERENCES * * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification". - * Available in http://www.ietf.org/rfc/rfc1951.txt + * Available in http://tools.ietf.org/html/rfc1951 * * A description of the Rabin and Karp algorithm is given in the book * "Algorithms" by R. Sedgewick, Addison-Wesley, p252. @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.5 Copyright 1995-2010 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.6 Copyright 1995-2012 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -155,6 +155,9 @@ local const config configuration_table[1 struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ #endif +/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */ +#define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0)) + /* =========================================================================== * Update a hash value with the given input byte * IN assertion: all calls to to UPDATE_HASH are made with consecutive @@ -235,10 +238,19 @@ int ZEXPORT deflateInit2_(strm, level, m strm->msg = Z_NULL; if (strm->zalloc == (alloc_func)0) { +#ifdef Z_SOLO + return Z_STREAM_ERROR; +#else strm->zalloc = zcalloc; strm->opaque = (voidpf)0; +#endif } - if (strm->zfree == (free_func)0) strm->zfree = zcfree; + if (strm->zfree == (free_func)0) +#ifdef Z_SOLO + return Z_STREAM_ERROR; +#else + strm->zfree = zcfree; +#endif #ifdef FASTEST if (level != 0) level = 1; @@ -314,43 +326,70 @@ int ZEXPORT deflateSetDictionary (strm, uInt dictLength; { deflate_state *s; - uInt length = dictLength; - uInt n; - IPos hash_head = 0; - - if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL || - strm->state->wrap == 2 || - (strm->state->wrap == 1 && strm->state->status != INIT_STATE)) - return Z_STREAM_ERROR; + uInt str, n; + int wrap; + unsigned avail; + unsigned char *next; + if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL) + return Z_STREAM_ERROR; s = strm->state; - if (s->wrap) + wrap = s->wrap; + if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead) + return Z_STREAM_ERROR; + + /* when using zlib wrappers, compute Adler-32 for provided dictionary */ + if (wrap == 1) strm->adler = adler32(strm->adler, dictionary, dictLength); + s->wrap = 0; /* avoid computing Adler-32 in read_buf */ - if (length < MIN_MATCH) return Z_OK; - if (length > s->w_size) { - length = s->w_size; - dictionary += dictLength - length; /* use the tail of the dictionary */ - } - zmemcpy(s->window, dictionary, length); - s->strstart = length; - s->block_start = (long)length; - - /* Insert all strings in the hash table (except for the last two bytes). - * s->lookahead stays null, so s->ins_h will be recomputed at the next - * call of fill_window. - */ - s->ins_h = s->window[0]; - UPDATE_HASH(s, s->ins_h, s->window[1]); - for (n = 0; n <= length - MIN_MATCH; n++) { - INSERT_STRING(s, n, hash_head); - } - if (hash_head) hash_head = 0; /* to make compiler happy */ + /* if dictionary would fill window, just replace the history */ + if (dictLength >= s->w_size) { + if (wrap == 0) { /* already empty otherwise */ + CLEAR_HASH(s); + s->strstart = 0; + s->block_start = 0L; + s->insert = 0; + } + dictionary += dictLength - s->w_size; /* use the tail */ + dictLength = s->w_size; + } + + /* insert dictionary into window and hash */ + avail = strm->avail_in; + next = strm->next_in; + strm->avail_in = dictLength; + strm->next_in = (Bytef *)dictionary; + fill_window(s); + while (s->lookahead >= MIN_MATCH) { + str = s->strstart; + n = s->lookahead - (MIN_MATCH-1); + do { + UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); +#ifndef FASTEST + s->prev[str & s->w_mask] = s->head[s->ins_h]; +#endif + s->head[s->ins_h] = (Pos)str; + str++; + } while (--n); + s->strstart = str; + s->lookahead = MIN_MATCH-1; + fill_window(s); + } + s->strstart += s->lookahead; + s->block_start = (long)s->strstart; + s->insert = s->lookahead; + s->lookahead = 0; + s->match_length = s->prev_length = MIN_MATCH-1; + s->match_available = 0; + strm->next_in = next; + strm->avail_in = avail; + s->wrap = wrap; return Z_OK; } /* ========================================================================= */ -int ZEXPORT deflateReset (strm) +int ZEXPORT deflateResetKeep (strm) z_streamp strm; { deflate_state *s; @@ -380,12 +419,23 @@ int ZEXPORT deflateReset (strm) s->last_flush = Z_NO_FLUSH; _tr_init(s); - lm_init(s); return Z_OK; } /* ========================================================================= */ +int ZEXPORT deflateReset (strm) + z_streamp strm; +{ + int ret; + + ret = deflateResetKeep(strm); + if (ret == Z_OK) + lm_init(strm->state); + return ret; +} + +/* ========================================================================= */ int ZEXPORT deflateSetHeader (strm, head) z_streamp strm; gz_headerp head; @@ -397,14 +447,42 @@ int ZEXPORT deflateSetHeader (strm, head } /* ========================================================================= */ +int ZEXPORT deflatePending (strm, pending, bits) + unsigned *pending; + int *bits; + z_streamp strm; +{ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (pending != Z_NULL) + *pending = strm->state->pending; + if (bits != Z_NULL) + *bits = strm->state->bi_valid; + return Z_OK; +} + +/* ========================================================================= */ int ZEXPORT deflatePrime (strm, bits, value) z_streamp strm; int bits; int value; { + deflate_state *s; + int put; + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - strm->state->bi_valid = bits; - strm->state->bi_buf = (ush)(value & ((1 << bits) - 1)); + s = strm->state; + if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3)) + return Z_BUF_ERROR; + do { + put = Buf_size - s->bi_valid; + if (put > bits) + put = bits; + s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid); + s->bi_valid += put; + _tr_flush_bits(s); + value >>= put; + bits -= put; + } while (bits); return Z_OK; } @@ -562,19 +640,22 @@ local void putShortMSB (s, b) local void flush_pending(strm) z_streamp strm; { - unsigned len = strm->state->pending; + unsigned len; + deflate_state *s = strm->state; + _tr_flush_bits(s); + len = s->pending; if (len > strm->avail_out) len = strm->avail_out; if (len == 0) return; - zmemcpy(strm->next_out, strm->state->pending_out, len); + zmemcpy(strm->next_out, s->pending_out, len); strm->next_out += len; - strm->state->pending_out += len; + s->pending_out += len; strm->total_out += len; strm->avail_out -= len; - strm->state->pending -= len; - if (strm->state->pending == 0) { - strm->state->pending_out = strm->state->pending_buf; + s->pending -= len; + if (s->pending == 0) { + s->pending_out = s->pending_buf; } } @@ -801,7 +882,7 @@ int ZEXPORT deflate (strm, flush) * flushes. For repeated and useless calls with Z_FINISH, we keep * returning Z_STREAM_END instead of Z_BUF_ERROR. */ - } else if (strm->avail_in == 0 && flush <= old_flush && + } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) && flush != Z_FINISH) { ERR_RETURN(strm, Z_BUF_ERROR); } @@ -850,6 +931,7 @@ int ZEXPORT deflate (strm, flush) if (s->lookahead == 0) { s->strstart = 0; s->block_start = 0L; + s->insert = 0; } } } @@ -945,12 +1027,12 @@ int ZEXPORT deflateCopy (dest, source) ss = source->state; - zmemcpy(dest, source, sizeof(z_stream)); + zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream)); ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); if (ds == Z_NULL) return Z_MEM_ERROR; dest->state = (struct internal_state FAR *) ds; - zmemcpy(ds, ss, sizeof(deflate_state)); + zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state)); ds->strm = dest; ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); @@ -966,8 +1048,8 @@ int ZEXPORT deflateCopy (dest, source) } /* following zmemcpy do not work for 16-bit MSDOS */ zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); - zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos)); - zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos)); + zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos)); + zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos)); zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); @@ -1001,15 +1083,15 @@ local int read_buf(strm, buf, size) strm->avail_in -= len; + zmemcpy(buf, strm->next_in, len); if (strm->state->wrap == 1) { - strm->adler = adler32(strm->adler, strm->next_in, len); + strm->adler = adler32(strm->adler, buf, len); } #ifdef GZIP else if (strm->state->wrap == 2) { - strm->adler = crc32(strm->adler, strm->next_in, len); + strm->adler = crc32(strm->adler, buf, len); } #endif - zmemcpy(buf, strm->next_in, len); strm->next_in += len; strm->total_in += len; @@ -1036,6 +1118,7 @@ local void lm_init (s) s->strstart = 0; s->block_start = 0L; s->lookahead = 0; + s->insert = 0; s->match_length = s->prev_length = MIN_MATCH-1; s->match_available = 0; s->ins_h = 0; @@ -1310,6 +1393,8 @@ local void fill_window(s) unsigned more; /* Amount of free space at the end of the window. */ uInt wsize = s->w_size; + Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + do { more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); @@ -1362,7 +1447,7 @@ local void fill_window(s) #endif more += wsize; } - if (s->strm->avail_in == 0) return; + if (s->strm->avail_in == 0) break; /* If there was no sliding: * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && @@ -1381,12 +1466,24 @@ local void fill_window(s) s->lookahead += n; /* Initialize the hash value now that we have some input: */ - if (s->lookahead >= MIN_MATCH) { - s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); + if (s->lookahead + s->insert >= MIN_MATCH) { + uInt str = s->strstart - s->insert; + s->ins_h = s->window[str]; + UPDATE_HASH(s, s->ins_h, s->window[str + 1]); #if MIN_MATCH != 3 Call UPDATE_HASH() MIN_MATCH-3 more times #endif + while (s->insert) { + UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); +#ifndef FASTEST + s->prev[str & s->w_mask] = s->head[s->ins_h]; +#endif + s->head[s->ins_h] = (Pos)str; + str++; + s->insert--; + if (s->lookahead + s->insert < MIN_MATCH) + break; + } } /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, * but this is not important since only literal bytes will be emitted. @@ -1427,6 +1524,9 @@ local void fill_window(s) s->high_water += init; } } + + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "not enough room for search"); } /* =========================================================================== @@ -1506,8 +1606,14 @@ local block_state deflate_stored(s, flus FLUSH_BLOCK(s, 0); } } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; + s->insert = 0; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if ((long)s->strstart > s->block_start) + FLUSH_BLOCK(s, 0); + return block_done; } /* =========================================================================== @@ -1603,8 +1709,14 @@ local block_state deflate_fast(s, flush) } if (bflush) FLUSH_BLOCK(s, 0); } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; + s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; } #ifndef FASTEST @@ -1728,8 +1840,14 @@ local block_state deflate_slow(s, flush) _tr_tally_lit(s, s->window[s->strstart-1], bflush); s->match_available = 0; } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; + s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; } #endif /* FASTEST */ @@ -1749,11 +1867,11 @@ local block_state deflate_rle(s, flush) for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes - * for the longest encodable run. + * for the longest run, plus one for the unrolled loop. */ - if (s->lookahead < MAX_MATCH) { + if (s->lookahead <= MAX_MATCH) { fill_window(s); - if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) { + if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) { return need_more; } if (s->lookahead == 0) break; /* flush the current block */ @@ -1776,6 +1894,7 @@ local block_state deflate_rle(s, flush) if (s->match_length > s->lookahead) s->match_length = s->lookahead; } + Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 18:44:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7A7E10656D5; Tue, 31 Jan 2012 18:44:02 +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 9C1458FC1A; Tue, 31 Jan 2012 18:44:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VIi29i049791; Tue, 31 Jan 2012 18:44:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VIi2Wb049790; Tue, 31 Jan 2012 18:44:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201201311844.q0VIi2Wb049790@svn.freebsd.org> From: Xin LI Date: Tue, 31 Jan 2012 18:44:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230838 - vendor/libz/1.2.6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 18:44:02 -0000 Author: delphij Date: Tue Jan 31 18:44:01 2012 New Revision: 230838 URL: http://svn.freebsd.org/changeset/base/230838 Log: Tag 1.2.6. Added: vendor/libz/1.2.6/ - copied from r230837, vendor/libz/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 19:00:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B598106564A; Tue, 31 Jan 2012 19:00:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E99B8FC0A; Tue, 31 Jan 2012 19:00:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VJ02Ea050410; Tue, 31 Jan 2012 19:00:02 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VJ02rm050407; Tue, 31 Jan 2012 19:00:02 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201311900.q0VJ02rm050407@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 31 Jan 2012 19:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230840 - stable/9/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 19:00:02 -0000 Author: glebius Date: Tue Jan 31 19:00:01 2012 New Revision: 230840 URL: http://svn.freebsd.org/changeset/base/230840 Log: Merge r228499: Update this page to describe modern interfaces. Modified: stable/9/share/man/man9/rtalloc.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/rtalloc.9 ============================================================================== --- stable/9/share/man/man9/rtalloc.9 Tue Jan 31 18:48:54 2012 (r230839) +++ stable/9/share/man/man9/rtalloc.9 Tue Jan 31 19:00:01 2012 (r230840) @@ -28,160 +28,163 @@ .\" .\" $FreeBSD$ .\" -.Dd December 11, 2008 +.Dd December 14, 2011 .Dt RTALLOC 9 .Os .Sh NAME -.Nm rtalloc , -.Nm rtalloc_ign , -.Nm rtalloc1 , -.Nm rtfree +.Nm rtalloc1_fib , +.Nm rtalloc_ign_fib , +.Nm rtalloc_fib .Nd look up a route in the kernel routing table .Sh SYNOPSIS .In sys/types.h .In sys/socket.h .In net/route.h -.Ft void -.Fn rtalloc "struct route *ro" -.Ft void -.Fn rtalloc_ign "struct route *ro" "u_long flags" .Ft "struct rtentry *" -.Fn rtalloc1 "struct sockaddr *sa" "int report" "u_long flags" +.Fn rtalloc1_fib "struct sockaddr *dst" "int report" "u_long flags" "u_int fibnum" .Ft void -.Fn rtfree "struct rt_entry *rt" +.Fn rtalloc_fib "struct route *ro" "u_int fibnum" +.Ft void +.Fn rtalloc_ign_fib "struct route *ro" "u_long flags" "u_int fibnum" +.Fn RTFREE_LOCKED "struct rt_entry *rt" .Fn RTFREE "struct rt_entry *rt" .Fn RT_LOCK "struct rt_entry *rt" .Fn RT_UNLOCK "struct rt_entry *rt" .Fn RT_ADDREF "struct rt_entry *rt" .Fn RT_REMREF "struct rt_entry *rt" +.Ft void +.Fn rtfree "struct rt_entry *rt" +.Ft "struct rtentry *" +.Fn rtalloc1 "struct sockaddr *dst" "int report" "u_long flags" +.Ft void +.Fn rtalloc "struct route *ro" +.Ft void +.Fn rtalloc_ign "struct route *ro" "u_long flags" +.Pp +.Cd options RADIX_MPATH .Sh DESCRIPTION The kernel uses a radix tree structure to manage routes for the networking subsystem. +If compiled with +.Cd options RADIX_MPATH +kernel may maintain several independent forwarding information databases (FIBs). The .Fn rtalloc -family of routines is used by protocols to query this structure for a +family of routines is used by protocols to query these structures for a route corresponding to a particular end-node address, and to cause certain protocol\- and interface-specific actions to take place. -.\" XXX - -mdoc should contain a standard request for getting em and -.\" en dashes. .Pp -.Dv RTF_PRCLONING -flag is obsolete and thus ignored by facility. -If the -.Dv RTF_XRESOLVE -flag is set, then the -.Dv RTM_RESOLVE -message is sent instead on the -.Xr route 4 -socket interface, requesting that an external program resolve the -address in question and modify the route appropriately. -.Pp -The default interface is -.Fn rtalloc . -Its only argument is +The +.Fn rtalloc1_fib +function is the most general form of +.Fn rtalloc , +and all of the other forms are implemented as calls to it. +It takes a +.Fa "struct sockaddr *" +directly as the +.Fa dst +argument. +The second argument, +.Fa report , +controls whether the routing sockets are notified when a lookup fails. +The third argument, +.Fa flags , +is a combination of +the following values: +.Bl -item -offset indent +.It +.Dv RTF_RNH_LOCKED +indicates that the radix tree lock is already held +.El +.Pp +The last argument +.Fa fibnum +specifies number of forwarding information database (FIB) on which +the lookup should be performed. +In case of success the +.Fn rtalloc1_fib +function returns a pointer to a locked +.Vt "struct rtentry" +with an additional reference. +.Pp +The +.Fn rtalloc_fib +is the most simple variant. +Its main argument is .Fa ro , a pointer to a -.Dq Li "struct route" , +.Fa "struct route" , which is defined as follows: .Bd -literal -offset indent struct route { - struct sockaddr ro_dst; struct rtentry *ro_rt; + struct llentry *ro_lle; + struct sockaddr ro_dst; }; .Ed .Pp Thus, this function can only be used for address families which are smaller than the default -.Dq Li "struct sockaddr" . +.Ft "struct sockaddr" . Before calling -.Fn rtalloc +.Fn rtalloc_fib for the first time, callers should ensure that unused bits of the structure are set to zero. +The second argument +.Fa fibnum +is FIB number. +In case of success of the +.Fn rtalloc_fib +the +.Fa ro_rt +points to a valid and unlocked +.Xr rtentry 9 , +which has an additional reference put on it, freeing which is +responsibility of the caller. On subsequent calls, -.Fn rtalloc +.Fn rtalloc_fib returns without performing a lookup if .Fa ro->ro_rt is non-null and the .Dv RTF_UP -flag is set in the route's -.Li rt_flags +flag is set in the rtentry's +.Fa rt_flags field. .Pp The -.Fn rtalloc_ign -interface can be used when the caller does not want to receive -the returned -.Fa rtentry -locked. -The -.Fa ro -argument is the same as -.Fn rtalloc , -but there is additionally a +.Fn rtalloc_ign_fib +function is the same as the +.Fn rtalloc_fib , +but there is additional .Fa flags -argument, which is now only used to pass -.Dv RTF_RNH_LOCKED -indicating that the radix tree lock is already held. -Both -.Fn rtalloc -and -.Fn rtalloc_ign -functions return a pointer to an unlocked -.Vt "struct rtentry" . -.Pp -The -.Fn rtalloc1 -function is the most general form of -.Fn rtalloc -(and both of the other forms are implemented as calls to rtalloc1). -It does not use the -.Dq Li "struct route" , -and is therefore suitable for address families which require more -space than is in a traditional -.Dq Li "struct sockaddr" . -Instead, it takes a -.Dq Li "struct sockaddr *" -directly as the -.Fa sa -argument. -The second argument, -.Fa report , -controls whether the lower layers are notified when a lookup fails. -The third argument, -.Fa flags , -is a set of flags to ignore, as in -.Fn rtalloc_ign . -The -.Fn rtalloc1 -function returns a pointer to a locked -.Vt "struct rtentry" . +argument, which is same as in +.Fn rtalloc1_fib . .Pp The -.Fn rtfree -function frees a locked route entry, e.g., a previously allocated by -.Fn rtalloc1 . +.Fn RTFREE_LOCKED +macro is used to unref and possibly free a locked routing entry +with one our reference, for example previously allocated by +.Fn rtalloc1_fib . .Pp The .Fn RTFREE -macro is used to free unlocked route entries, previously allocated by -.Fn rtalloc +macro is used to unref and possibly free an unlocked route entries with +one our reference, for example previously allocated by +.Fn rtalloc_fib or -.Fn rtalloc_ign . -The -.Fn RTFREE -macro decrements the reference count on the routing table entry (see below), -and frees it if the reference count has reached zero. +.Fn rtalloc_ign_fib . .Pp -The preferred usage is allocating a route using -.Fn rtalloc -or -.Fn rtalloc_ign -and freeing using -.Fn RTFREE . +Both +.Fn RTFREE_LOCKED +and +.Fn RTFREE +macros decrement the reference count on the routing table entry, +and proceed with actual freeing if the reference count has reached zero. .Pp The .Fn RT_LOCK macro is used to lock a routing table entry. +.Pp The .Fn RT_UNLOCK macro is used to unlock a routing table entry. @@ -189,20 +192,53 @@ macro is used to unlock a routing table The .Fn RT_ADDREF macro increments the reference count on a previously locked route entry. +It should be used whenever a reference to an +.Xr rtentry 9 +is going to be stored outside the routing table. +.Pp The .Fn RT_REMREF macro decrements the reference count on a previously locked route entry. -.Sh RETURN VALUES +Its usage is contrary to +.Fn RT_ADDREF . +.Pp The -.Fn rtalloc , -.Fn rtalloc_ign -and .Fn rtfree -functions do not return a value. +function does the actual free of the routing table entry, and shouldn't +be called directly by facilities, that just perform routing table lookups. +.Sh LEGACY INTERFACE +Prior to introduction of multiple routing tables functions did not +require the +.Fa "u_int fibnum" +argument. +Legacy +.Fn rtalloc1 , +.Fn rtalloc +and +.Fn rtalloc_ign +functions are kept for compatibility, and are equivalent to +calling new interface with +.Fa fibnum +argument equal to +.Va 0 , +which implies default forwarding table. +.Sh RETURN VALUES The -.Fn rtalloc1 -function returns a pointer to a routing-table entry if it succeeds, +.Fn rtalloc1_fib +function returns a pointer to a locked routing-table entry if it succeeds, otherwise a null pointer. +The +.Fn rtalloc_fib +and +.Fn rtalloc_ign_fib +functions do not return a value, but they fill in the +.Fa *ro_rt +member of the +.Fa *ro +argument with a pointer to an unlocked routing-table entry if they +succeed, otherwise a null pointer. +In a case of success all functions put a reference on the +routing-table entry, freeing of which is responsibility of the caller. Lack of a route should in most cases be translated to the .Xr errno 2 @@ -213,7 +249,7 @@ value .Xr rtentry 9 .Sh HISTORY The -.Nm +.Nm rtalloc facility first appeared in .Bx 4.2 , although with much different internals. @@ -227,14 +263,11 @@ first appeared in .Fx 2.0 . Routing table locking was introduced in .Fx 5.2 . +Multiple routing tables were introduced in +.Fx 8.0 . .Sh AUTHORS -This manual page was written by -.An Garrett Wollman , -as were the changes to implement -.Dv RTF_PRCLONING -and the -.Fn rtalloc_ign -function and the -.Fa flags -argument to -.Fn rtalloc1 . +The original version of this manual page was written by +.An -nosplit +.An "Garrett Wollman" . +It was significantly updated by +.An "Gleb Smirnoff" . From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 19:02:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 446EF1065672; Tue, 31 Jan 2012 19:02:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 324888FC0A; Tue, 31 Jan 2012 19:02:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VJ2YhT050550; Tue, 31 Jan 2012 19:02:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VJ2YwP050548; Tue, 31 Jan 2012 19:02:34 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201311902.q0VJ2YwP050548@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 31 Jan 2012 19:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230841 - stable/9/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 19:02:34 -0000 Author: glebius Date: Tue Jan 31 19:02:33 2012 New Revision: 230841 URL: http://svn.freebsd.org/changeset/base/230841 Log: Merge 228500: More MLINKS for rtalloc.9 Modified: stable/9/share/man/man9/Makefile Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Tue Jan 31 19:00:01 2012 (r230840) +++ stable/9/share/man/man9/Makefile Tue Jan 31 19:02:33 2012 (r230841) @@ -1033,8 +1033,12 @@ MLINKS+=rmlock.9 rm_destroy.9 \ rmlock.9 rm_wunlock.9 MLINKS+=rtalloc.9 rtalloc1.9 \ rtalloc.9 rtalloc_ign.9 \ + rtalloc.9 RTFREE_LOCKED.9 \ rtalloc.9 RTFREE.9 \ - rtalloc.9 rtfree.9 + rtalloc.9 rtfree.9 \ + rtalloc.9 rtalloc1_fib.9 \ + rtalloc.9 rtalloc_ign_fib.9 \ + rtalloc.9 rtalloc_fib.9 MLINKS+=runqueue.9 choosethread.9 \ runqueue.9 procrunnable.9 \ runqueue.9 remrunqueue.9 \ From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 19:07:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BF08106564A; Tue, 31 Jan 2012 19:07:09 +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 6A1808FC08; Tue, 31 Jan 2012 19:07:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VJ79Ix050774; Tue, 31 Jan 2012 19:07:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VJ79K6050772; Tue, 31 Jan 2012 19:07:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201311907.q0VJ79K6050772@svn.freebsd.org> From: John Baldwin Date: Tue, 31 Jan 2012 19:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230842 - stable/8/lib/libc/stdtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 19:07:09 -0000 Author: jhb Date: Tue Jan 31 19:07:08 2012 New Revision: 230842 URL: http://svn.freebsd.org/changeset/base/230842 Log: MFC 226828: Fix a memory leak in tzload(). Modified: stable/8/lib/libc/stdtime/localtime.c Directory Properties: stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/stdtime/localtime.c ============================================================================== --- stable/8/lib/libc/stdtime/localtime.c Tue Jan 31 19:02:33 2012 (r230841) +++ stable/8/lib/libc/stdtime/localtime.c Tue Jan 31 19:07:08 2012 (r230842) @@ -457,6 +457,7 @@ register const int doextend; _close(fid); return -1; } + free(fullname); } u = malloc(sizeof(*u)); if (u == NULL) From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 19:38:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AA14106566C; Tue, 31 Jan 2012 19:38:19 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7615D8FC0C; Tue, 31 Jan 2012 19:38:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VJcJcA051835; Tue, 31 Jan 2012 19:38:19 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VJcJfv051822; Tue, 31 Jan 2012 19:38:19 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201201311938.q0VJcJfv051822@svn.freebsd.org> From: Jim Harris Date: Tue, 31 Jan 2012 19:38: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: r230843 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/isci sys/i386/conf sys/modules sys/modules/isci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 19:38:19 -0000 Author: jimharris Date: Tue Jan 31 19:38:18 2012 New Revision: 230843 URL: http://svn.freebsd.org/changeset/base/230843 Log: Add isci(4) driver for amd64 and i386 targets. The isci driver is for the integrated SAS controller in the Intel C600 (Patsburg) chipset. Source files in sys/dev/isci directory are FreeBSD-specific, and sys/dev/isci/scil subdirectory contains an OS-agnostic library (SCIL) published by Intel to control the SAS controller. This library is used primarily as-is in this driver, with some post-processing to better integrate into the kernel build environment. isci.4 and a README in the sys/dev/isci directory contain a few additional details. This driver is only built for amd64 and i386 targets. Sponsored by: Intel Reviewed by: scottl Approved by: scottl Added: head/share/man/man4/isci.4 - copied unchanged from r230794, user/jimharris/isci/share/man/man4/isci.4 head/sys/dev/isci/ - copied from r230794, user/jimharris/isci/sys/dev/isci/ head/sys/modules/isci/ - copied from r230794, user/jimharris/isci/sys/modules/isci/ Modified: head/MAINTAINERS (contents, props changed) head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/options.amd64 head/sys/conf/options.i386 head/sys/i386/conf/GENERIC head/sys/i386/conf/NOTES head/sys/modules/Makefile Directory Properties: head/share/man/man4/ (props changed) head/sys/ (props changed) Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Jan 31 19:07:08 2012 (r230842) +++ head/MAINTAINERS Tue Jan 31 19:38:18 2012 (r230843) @@ -124,6 +124,7 @@ usr.sbin/zic edwin Heads-up appreciat lib/libc/stdtime edwin Heads-up appreciated, since parts of this code is maintained by a third party source. sbin/routed bms Pre-commit review; notify vendor at rhyolite.com +isci(4) jimharris Pre-commit review requested. Following are the entries from the Makefiles, and a few other sources. Please remove stale entries from both their origin, and this file. Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Jan 31 19:07:08 2012 (r230842) +++ head/share/man/man4/Makefile Tue Jan 31 19:38:18 2012 (r230843) @@ -182,6 +182,7 @@ MAN= aac.4 \ ipsec.4 \ ipw.4 \ ipwfw.4 \ + isci.4 \ iscsi_initiator.4 \ isp.4 \ ispfw.4 \ Copied: head/share/man/man4/isci.4 (from r230794, user/jimharris/isci/share/man/man4/isci.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/isci.4 Tue Jan 31 19:38:18 2012 (r230843, copy of r230794, user/jimharris/isci/share/man/man4/isci.4) @@ -0,0 +1,110 @@ +.\" +.\" Copyright (c) 2012 Intel Corporation +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\" substantially similar to the "NO WARRANTY" disclaimer below +.\" ("Disclaimer") and any redistribution must be conditioned upon +.\" including a substantially similar Disclaimer requirement for further +.\" binary redistribution. +.\" +.\" NO WARRANTY +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR +.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGES. +.\" +.\" isci driver man page. +.\" +.\" Author: Jim Harris +.\" +.\" $FreeBSD$ +.\" +.Dd January 23, 2012 +.Dt ISCI 4 +.Os +.Sh NAME +.Nm isci +.Nd Intel C600 Serial Attached SCSI driver +.Sh SYNOPSIS +To compile this driver into your kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device scbus" +.Cd "device isci" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +isci_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for Intel C600 +.Tn SAS +controller. +.Sh CONFIGURATION +To force legacy interrupts for all +.Nm +driver instances, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.isci.force_legacy_interrupts=1 +.Ed +.Sh DEBUGGING +To enable debugging prints from the +.Nm +driver, set the +.Bd -literal -offset indent +hw.isci.debug_level +.Ed +.Pp +variable to a value between 1 and 4 in +.Xr loader.conf 5 . +.Pp +The hardware layer in the isci driver has extensive logging capabilities +which are disabled by default for performance reasons. These can be enabled +by adding +.Bd -literal -offset indent +options ISCI_LOGGING +.Ed +.Pp +to the kernel configuration file. +.Sh SEE ALSO +.Xr cd 4 , +.Xr ch 4 , +.Xr da 4 , +.Xr pci 4 , +.Xr sa 4 , +.Xr scsi 4 . +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was developed by Intel and originally written by +.An Jim Harris Aq jimharris@FreeBSD.org +with contributions from Sohaib Ahsan and input from +.An Scott Long Aq scottl@FreeBSD.org . +.Pp +This man page was written by +.An Jim Harris Aq jimharris@FreeBSD.org . Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Jan 31 19:07:08 2012 (r230842) +++ head/sys/amd64/conf/GENERIC Tue Jan 31 19:38:18 2012 (r230843) @@ -123,6 +123,7 @@ device adv # Advansys SCSI adapters device adw # Advansys wide SCSI adapters device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. device bt # Buslogic/Mylex MultiMaster SCSI adapters +device isci # Intel C600 SAS controller # ATA/SCSI peripherals device scbus # SCSI bus (required for ATA/SCSI) Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Jan 31 19:07:08 2012 (r230842) +++ head/sys/amd64/conf/NOTES Tue Jan 31 19:38:18 2012 (r230843) @@ -409,6 +409,11 @@ device hptiop device ips # +# Intel C600 (Patsburg) integrated SAS controller +device isci +options ISCI_LOGGING # enable debugging in isci HAL + +# # SafeNet crypto driver: can be moved to the MI NOTES as soon as # it's tested on a big-endian machine # Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Jan 31 19:07:08 2012 (r230842) +++ head/sys/conf/files.amd64 Tue Jan 31 19:38:18 2012 (r230843) @@ -271,6 +271,115 @@ dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_amd64.c optional uart dev/viawd/viawd.c optional viawd dev/wpi/if_wpi.c optional wpi +dev/isci/isci.c optional isci +dev/isci/isci_controller.c optional isci +dev/isci/isci_domain.c optional isci +dev/isci/isci_interrupt.c optional isci +dev/isci/isci_io_request.c optional isci +dev/isci/isci_logger.c optional isci +dev/isci/isci_oem_parameters.c optional isci +dev/isci/isci_remote_device.c optional isci +dev/isci/isci_sysctl.c optional isci +dev/isci/isci_task_request.c optional isci +dev/isci/isci_timer.c optional isci +dev/isci/scil/sati.c optional isci +dev/isci/scil/sati_abort_task_set.c optional isci +dev/isci/scil/sati_atapi.c optional isci +dev/isci/scil/sati_device.c optional isci +dev/isci/scil/sati_inquiry.c optional isci +dev/isci/scil/sati_log_sense.c optional isci +dev/isci/scil/sati_lun_reset.c optional isci +dev/isci/scil/sati_mode_pages.c optional isci +dev/isci/scil/sati_mode_select.c optional isci +dev/isci/scil/sati_mode_sense.c optional isci +dev/isci/scil/sati_mode_sense_10.c optional isci +dev/isci/scil/sati_mode_sense_6.c optional isci +dev/isci/scil/sati_move.c optional isci +dev/isci/scil/sati_passthrough.c optional isci +dev/isci/scil/sati_read.c optional isci +dev/isci/scil/sati_read_buffer.c optional isci +dev/isci/scil/sati_read_capacity.c optional isci +dev/isci/scil/sati_reassign_blocks.c optional isci +dev/isci/scil/sati_report_luns.c optional isci +dev/isci/scil/sati_request_sense.c optional isci +dev/isci/scil/sati_start_stop_unit.c optional isci +dev/isci/scil/sati_synchronize_cache.c optional isci +dev/isci/scil/sati_test_unit_ready.c optional isci +dev/isci/scil/sati_unmap.c optional isci +dev/isci/scil/sati_util.c optional isci +dev/isci/scil/sati_verify.c optional isci +dev/isci/scil/sati_write.c optional isci +dev/isci/scil/sati_write_and_verify.c optional isci +dev/isci/scil/sati_write_buffer.c optional isci +dev/isci/scil/sati_write_long.c optional isci +dev/isci/scil/sci_abstract_list.c optional isci +dev/isci/scil/sci_base_controller.c optional isci +dev/isci/scil/sci_base_domain.c optional isci +dev/isci/scil/sci_base_iterator.c optional isci +dev/isci/scil/sci_base_library.c optional isci +dev/isci/scil/sci_base_logger.c optional isci +dev/isci/scil/sci_base_memory_descriptor_list.c optional isci +dev/isci/scil/sci_base_memory_descriptor_list_decorator.c optional isci +dev/isci/scil/sci_base_object.c optional isci +dev/isci/scil/sci_base_observer.c optional isci +dev/isci/scil/sci_base_phy.c optional isci +dev/isci/scil/sci_base_port.c optional isci +dev/isci/scil/sci_base_remote_device.c optional isci +dev/isci/scil/sci_base_request.c optional isci +dev/isci/scil/sci_base_state_machine.c optional isci +dev/isci/scil/sci_base_state_machine_logger.c optional isci +dev/isci/scil/sci_base_state_machine_observer.c optional isci +dev/isci/scil/sci_base_subject.c optional isci +dev/isci/scil/sci_util.c optional isci +dev/isci/scil/scic_sds_controller.c optional isci +dev/isci/scil/scic_sds_library.c optional isci +dev/isci/scil/scic_sds_pci.c optional isci +dev/isci/scil/scic_sds_phy.c optional isci +dev/isci/scil/scic_sds_port.c optional isci +dev/isci/scil/scic_sds_port_configuration_agent.c optional isci +dev/isci/scil/scic_sds_remote_device.c optional isci +dev/isci/scil/scic_sds_remote_node_context.c optional isci +dev/isci/scil/scic_sds_remote_node_table.c optional isci +dev/isci/scil/scic_sds_request.c optional isci +dev/isci/scil/scic_sds_sgpio.c optional isci +dev/isci/scil/scic_sds_smp_remote_device.c optional isci +dev/isci/scil/scic_sds_smp_request.c optional isci +dev/isci/scil/scic_sds_ssp_request.c optional isci +dev/isci/scil/scic_sds_stp_packet_request.c optional isci +dev/isci/scil/scic_sds_stp_remote_device.c optional isci +dev/isci/scil/scic_sds_stp_request.c optional isci +dev/isci/scil/scic_sds_unsolicited_frame_control.c optional isci +dev/isci/scil/scif_sas_controller.c optional isci +dev/isci/scil/scif_sas_controller_state_handlers.c optional isci +dev/isci/scil/scif_sas_controller_states.c optional isci +dev/isci/scil/scif_sas_domain.c optional isci +dev/isci/scil/scif_sas_domain_state_handlers.c optional isci +dev/isci/scil/scif_sas_domain_states.c optional isci +dev/isci/scil/scif_sas_high_priority_request_queue.c optional isci +dev/isci/scil/scif_sas_internal_io_request.c optional isci +dev/isci/scil/scif_sas_io_request.c optional isci +dev/isci/scil/scif_sas_io_request_state_handlers.c optional isci +dev/isci/scil/scif_sas_io_request_states.c optional isci +dev/isci/scil/scif_sas_library.c optional isci +dev/isci/scil/scif_sas_remote_device.c optional isci +dev/isci/scil/scif_sas_remote_device_ready_substate_handlers.c optional isci +dev/isci/scil/scif_sas_remote_device_ready_substates.c optional isci +dev/isci/scil/scif_sas_remote_device_starting_substate_handlers.c optional isci +dev/isci/scil/scif_sas_remote_device_starting_substates.c optional isci +dev/isci/scil/scif_sas_remote_device_state_handlers.c optional isci +dev/isci/scil/scif_sas_remote_device_states.c optional isci +dev/isci/scil/scif_sas_request.c optional isci +dev/isci/scil/scif_sas_smp_activity_clear_affiliation.c optional isci +dev/isci/scil/scif_sas_smp_io_request.c optional isci +dev/isci/scil/scif_sas_smp_phy.c optional isci +dev/isci/scil/scif_sas_smp_remote_device.c optional isci +dev/isci/scil/scif_sas_stp_io_request.c optional isci +dev/isci/scil/scif_sas_stp_remote_device.c optional isci +dev/isci/scil/scif_sas_stp_task_request.c optional isci +dev/isci/scil/scif_sas_task_request.c optional isci +dev/isci/scil/scif_sas_task_request_state_handlers.c optional isci +dev/isci/scil/scif_sas_task_request_states.c optional isci +dev/isci/scil/scif_sas_timer.c optional isci isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/kern_clocksource.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Jan 31 19:07:08 2012 (r230842) +++ head/sys/conf/files.i386 Tue Jan 31 19:38:18 2012 (r230843) @@ -248,6 +248,115 @@ dev/viawd/viawd.c optional viawd dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard dev/wpi/if_wpi.c optional wpi +dev/isci/isci.c optional isci +dev/isci/isci_controller.c optional isci +dev/isci/isci_domain.c optional isci +dev/isci/isci_interrupt.c optional isci +dev/isci/isci_io_request.c optional isci +dev/isci/isci_logger.c optional isci +dev/isci/isci_oem_parameters.c optional isci +dev/isci/isci_remote_device.c optional isci +dev/isci/isci_sysctl.c optional isci +dev/isci/isci_task_request.c optional isci +dev/isci/isci_timer.c optional isci +dev/isci/scil/sati.c optional isci +dev/isci/scil/sati_abort_task_set.c optional isci +dev/isci/scil/sati_atapi.c optional isci +dev/isci/scil/sati_device.c optional isci +dev/isci/scil/sati_inquiry.c optional isci +dev/isci/scil/sati_log_sense.c optional isci +dev/isci/scil/sati_lun_reset.c optional isci +dev/isci/scil/sati_mode_pages.c optional isci +dev/isci/scil/sati_mode_select.c optional isci +dev/isci/scil/sati_mode_sense.c optional isci +dev/isci/scil/sati_mode_sense_10.c optional isci +dev/isci/scil/sati_mode_sense_6.c optional isci +dev/isci/scil/sati_move.c optional isci +dev/isci/scil/sati_passthrough.c optional isci +dev/isci/scil/sati_read.c optional isci +dev/isci/scil/sati_read_buffer.c optional isci +dev/isci/scil/sati_read_capacity.c optional isci +dev/isci/scil/sati_reassign_blocks.c optional isci +dev/isci/scil/sati_report_luns.c optional isci +dev/isci/scil/sati_request_sense.c optional isci +dev/isci/scil/sati_start_stop_unit.c optional isci +dev/isci/scil/sati_synchronize_cache.c optional isci +dev/isci/scil/sati_test_unit_ready.c optional isci +dev/isci/scil/sati_unmap.c optional isci +dev/isci/scil/sati_util.c optional isci +dev/isci/scil/sati_verify.c optional isci +dev/isci/scil/sati_write.c optional isci +dev/isci/scil/sati_write_and_verify.c optional isci +dev/isci/scil/sati_write_buffer.c optional isci +dev/isci/scil/sati_write_long.c optional isci +dev/isci/scil/sci_abstract_list.c optional isci +dev/isci/scil/sci_base_controller.c optional isci +dev/isci/scil/sci_base_domain.c optional isci +dev/isci/scil/sci_base_iterator.c optional isci +dev/isci/scil/sci_base_library.c optional isci +dev/isci/scil/sci_base_logger.c optional isci +dev/isci/scil/sci_base_memory_descriptor_list.c optional isci +dev/isci/scil/sci_base_memory_descriptor_list_decorator.c optional isci +dev/isci/scil/sci_base_object.c optional isci +dev/isci/scil/sci_base_observer.c optional isci +dev/isci/scil/sci_base_phy.c optional isci +dev/isci/scil/sci_base_port.c optional isci +dev/isci/scil/sci_base_remote_device.c optional isci +dev/isci/scil/sci_base_request.c optional isci +dev/isci/scil/sci_base_state_machine.c optional isci +dev/isci/scil/sci_base_state_machine_logger.c optional isci +dev/isci/scil/sci_base_state_machine_observer.c optional isci +dev/isci/scil/sci_base_subject.c optional isci +dev/isci/scil/sci_util.c optional isci +dev/isci/scil/scic_sds_controller.c optional isci +dev/isci/scil/scic_sds_library.c optional isci +dev/isci/scil/scic_sds_pci.c optional isci +dev/isci/scil/scic_sds_phy.c optional isci +dev/isci/scil/scic_sds_port.c optional isci +dev/isci/scil/scic_sds_port_configuration_agent.c optional isci +dev/isci/scil/scic_sds_remote_device.c optional isci +dev/isci/scil/scic_sds_remote_node_context.c optional isci +dev/isci/scil/scic_sds_remote_node_table.c optional isci +dev/isci/scil/scic_sds_request.c optional isci +dev/isci/scil/scic_sds_sgpio.c optional isci +dev/isci/scil/scic_sds_smp_remote_device.c optional isci +dev/isci/scil/scic_sds_smp_request.c optional isci +dev/isci/scil/scic_sds_ssp_request.c optional isci +dev/isci/scil/scic_sds_stp_packet_request.c optional isci +dev/isci/scil/scic_sds_stp_remote_device.c optional isci +dev/isci/scil/scic_sds_stp_request.c optional isci +dev/isci/scil/scic_sds_unsolicited_frame_control.c optional isci +dev/isci/scil/scif_sas_controller.c optional isci +dev/isci/scil/scif_sas_controller_state_handlers.c optional isci +dev/isci/scil/scif_sas_controller_states.c optional isci +dev/isci/scil/scif_sas_domain.c optional isci +dev/isci/scil/scif_sas_domain_state_handlers.c optional isci +dev/isci/scil/scif_sas_domain_states.c optional isci +dev/isci/scil/scif_sas_high_priority_request_queue.c optional isci +dev/isci/scil/scif_sas_internal_io_request.c optional isci +dev/isci/scil/scif_sas_io_request.c optional isci +dev/isci/scil/scif_sas_io_request_state_handlers.c optional isci +dev/isci/scil/scif_sas_io_request_states.c optional isci +dev/isci/scil/scif_sas_library.c optional isci +dev/isci/scil/scif_sas_remote_device.c optional isci +dev/isci/scil/scif_sas_remote_device_ready_substate_handlers.c optional isci +dev/isci/scil/scif_sas_remote_device_ready_substates.c optional isci +dev/isci/scil/scif_sas_remote_device_starting_substate_handlers.c optional isci +dev/isci/scil/scif_sas_remote_device_starting_substates.c optional isci +dev/isci/scil/scif_sas_remote_device_state_handlers.c optional isci +dev/isci/scil/scif_sas_remote_device_states.c optional isci +dev/isci/scil/scif_sas_request.c optional isci +dev/isci/scil/scif_sas_smp_activity_clear_affiliation.c optional isci +dev/isci/scil/scif_sas_smp_io_request.c optional isci +dev/isci/scil/scif_sas_smp_phy.c optional isci +dev/isci/scil/scif_sas_smp_remote_device.c optional isci +dev/isci/scil/scif_sas_stp_io_request.c optional isci +dev/isci/scil/scif_sas_stp_remote_device.c optional isci +dev/isci/scil/scif_sas_stp_task_request.c optional isci +dev/isci/scil/scif_sas_task_request.c optional isci +dev/isci/scil/scif_sas_task_request_state_handlers.c optional isci +dev/isci/scil/scif_sas_task_request_states.c optional isci +dev/isci/scil/scif_sas_timer.c optional isci i386/acpica/acpi_machdep.c optional acpi acpi_wakecode.o optional acpi \ dependency "$S/i386/acpica/acpi_wakecode.S assym.s" \ Modified: head/sys/conf/options.amd64 ============================================================================== --- head/sys/conf/options.amd64 Tue Jan 31 19:07:08 2012 (r230842) +++ head/sys/conf/options.amd64 Tue Jan 31 19:38:18 2012 (r230843) @@ -65,3 +65,6 @@ KDTRACE_FRAME opt_kdtrace.h BPF_JITTER opt_bpf.h XENHVM opt_global.h + +# options for the Intel C600 SAS driver (isci) +ISCI_LOGGING opt_isci.h Modified: head/sys/conf/options.i386 ============================================================================== --- head/sys/conf/options.i386 Tue Jan 31 19:07:08 2012 (r230842) +++ head/sys/conf/options.i386 Tue Jan 31 19:38:18 2012 (r230843) @@ -119,3 +119,6 @@ BPF_JITTER opt_bpf.h NATIVE opt_global.h XEN opt_global.h XENHVM opt_global.h + +# options for the Intel C600 SAS driver (isci) +ISCI_LOGGING opt_isci.h Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Tue Jan 31 19:07:08 2012 (r230842) +++ head/sys/i386/conf/GENERIC Tue Jan 31 19:38:18 2012 (r230843) @@ -130,6 +130,7 @@ device bt # Buslogic/Mylex MultiMaster device ncv # NCR 53C500 device nsp # Workbit Ninja SCSI-3 device stg # TMC 18C30/18C50 +device isci # Intel C600 SAS controller # ATA/SCSI peripherals device scbus # SCSI bus (required for ATA/SCSI) Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Tue Jan 31 19:07:08 2012 (r230842) +++ head/sys/i386/conf/NOTES Tue Jan 31 19:38:18 2012 (r230843) @@ -727,6 +727,11 @@ device hptiop device ips # +# Intel C600 (Patsburg) integrated SAS controller +device isci +options ISCI_LOGGING # enable debugging in isci HAL + +# # SafeNet crypto driver: can be moved to the MI NOTES as soon as # it's tested on a big-endian machine # Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Jan 31 19:07:08 2012 (r230842) +++ head/sys/modules/Makefile Tue Jan 31 19:38:18 2012 (r230843) @@ -145,6 +145,7 @@ SUBDIR= ${_3dfx} \ ${_ips} \ ${_ipw} \ ${_ipwfw} \ + ${_isci} \ iscsi \ isp \ ispfw \ @@ -521,6 +522,7 @@ _ipmi= ipmi _ips= ips _ipw= ipw _ipwfw= ipwfw +_isci= isci _iwi= iwi _iwifw= iwifw _iwn= iwn @@ -602,6 +604,7 @@ _ipmi= ipmi _ips= ips _ipw= ipw _ipwfw= ipwfw +_isci= isci _iwi= iwi _iwifw= iwifw _iwn= iwn From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 21:46:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1118106564A; Tue, 31 Jan 2012 21:46:28 +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 AF3F58FC0C; Tue, 31 Jan 2012 21:46:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VLkSZq055886; Tue, 31 Jan 2012 21:46:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VLkSwN055882; Tue, 31 Jan 2012 21:46:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201312146.q0VLkSwN055882@svn.freebsd.org> From: Alexander Motin Date: Tue, 31 Jan 2012 21:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230845 - head/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 21:46:28 -0000 Author: mav Date: Tue Jan 31 21:46:28 2012 New Revision: 230845 URL: http://svn.freebsd.org/changeset/base/230845 Log: Make sound(4) more flexible in setting soft buffer and block sizes when hardware imposes strict limitations on hard buffer and block sizes. Previous code set soft buffer to be no smaller then hard buffer. On some cards with fixed 64K physical buffer that caused up to 800ms play latency. New code allows to set soft buffer size down to just two blocks of the hard buffer and to not write more then that size ahead to the hardware buffer. As result of that change I was able to reduce full practically measured record-playback loop delay in those conditions down to only about 115ms with theoretical playback latency of only about 50ms. New code works fine for both vchans and direct cases. In both cases sound(4) tries to follow hw.snd.latency_profile and hw.snd.latency values and application-requested buffer and block sizes as much as limitation of two hardware blocks allows. Reviewed by: silence on multimedia@ Modified: head/sys/dev/sound/pcm/buffer.c head/sys/dev/sound/pcm/buffer.h head/sys/dev/sound/pcm/channel.c Modified: head/sys/dev/sound/pcm/buffer.c ============================================================================== --- head/sys/dev/sound/pcm/buffer.c Tue Jan 31 19:45:32 2012 (r230844) +++ head/sys/dev/sound/pcm/buffer.c Tue Jan 31 21:46:28 2012 (r230845) @@ -301,6 +301,15 @@ sndbuf_fillsilence(struct snd_dbuf *b) b->rl = b->bufsize; } +void +sndbuf_fillsilence_rl(struct snd_dbuf *b, u_int rl) +{ + if (b->bufsize > 0) + memset(sndbuf_getbuf(b), sndbuf_zerodata(b->fmt), b->bufsize); + b->rp = 0; + b->rl = min(b->bufsize, rl); +} + /** * @brief Reset buffer w/o flushing statistics * Modified: head/sys/dev/sound/pcm/buffer.h ============================================================================== --- head/sys/dev/sound/pcm/buffer.h Tue Jan 31 19:45:32 2012 (r230844) +++ head/sys/dev/sound/pcm/buffer.h Tue Jan 31 21:46:28 2012 (r230845) @@ -74,6 +74,7 @@ int sndbuf_remalloc(struct snd_dbuf *b, void sndbuf_reset(struct snd_dbuf *b); void sndbuf_clear(struct snd_dbuf *b, unsigned int length); void sndbuf_fillsilence(struct snd_dbuf *b); +void sndbuf_fillsilence_rl(struct snd_dbuf *b, u_int rl); void sndbuf_softreset(struct snd_dbuf *b); void sndbuf_clearshadow(struct snd_dbuf *b); Modified: head/sys/dev/sound/pcm/channel.c ============================================================================== --- head/sys/dev/sound/pcm/channel.c Tue Jan 31 19:45:32 2012 (r230844) +++ head/sys/dev/sound/pcm/channel.c Tue Jan 31 21:46:28 2012 (r230845) @@ -395,24 +395,28 @@ chn_wrfeed(struct pcm_channel *c) { struct snd_dbuf *b = c->bufhard; struct snd_dbuf *bs = c->bufsoft; - unsigned int amt; + unsigned int amt, want, wasfree; CHN_LOCKASSERT(c); if ((c->flags & CHN_F_MMAP) && !(c->flags & CHN_F_CLOSING)) sndbuf_acquire(bs, NULL, sndbuf_getfree(bs)); - amt = sndbuf_getfree(b); + wasfree = sndbuf_getfree(b); + want = min(sndbuf_getsize(b), + imax(0, sndbuf_xbytes(sndbuf_getsize(bs), bs, b) - + sndbuf_getready(b))); + amt = min(wasfree, want); if (amt > 0) sndbuf_feed(bs, b, c, c->feeder, amt); /* * Possible xruns. There should be no empty space left in buffer. */ - if (sndbuf_getfree(b) > 0) + if (sndbuf_getready(b) < want) c->xruns++; - if (sndbuf_getfree(b) < amt) + if (sndbuf_getfree(b) < wasfree) chn_wakeup(c); } @@ -721,7 +725,8 @@ chn_start(struct pcm_channel *c, int for } if (c->parentchannel == NULL) { if (c->direction == PCMDIR_PLAY) - sndbuf_fillsilence(b); + sndbuf_fillsilence_rl(b, + sndbuf_xbytes(sndbuf_getsize(bs), bs, b)); if (snd_verbose > 3) device_printf(c->dev, "%s(): %s starting! (%s/%s) " @@ -1728,7 +1733,7 @@ chn_resizebuf(struct pcm_channel *c, int int blkcnt, int blksz) { struct snd_dbuf *b, *bs, *pb; - int sblksz, sblkcnt, hblksz, hblkcnt, limit = 1; + int sblksz, sblkcnt, hblksz, hblkcnt, limit = 0, nsblksz, nsblkcnt; int ret; CHN_LOCKASSERT(c); @@ -1748,7 +1753,6 @@ chn_resizebuf(struct pcm_channel *c, int return EINVAL; else { c->latency = latency; - limit = 0; } bs = c->bufsoft; @@ -1783,19 +1787,22 @@ chn_resizebuf(struct pcm_channel *c, int */ sblksz = round_blksz(blksz, sndbuf_getalign(bs)); sblkcnt = round_pow2(blkcnt); - limit = 0; } if (c->parentchannel != NULL) { - pb = CHN_BUF_PARENT(c, NULL); + pb = c->parentchannel->bufsoft; CHN_UNLOCK(c); CHN_LOCK(c->parentchannel); chn_notify(c->parentchannel, CHN_N_BLOCKSIZE); CHN_UNLOCK(c->parentchannel); CHN_LOCK(c); - limit = (limit != 0 && pb != NULL) ? - sndbuf_xbytes(sndbuf_getsize(pb), pb, bs) : 0; - c->timeout = c->parentchannel->timeout; + if (c->direction == PCMDIR_PLAY) { + limit = (pb != NULL) ? + sndbuf_xbytes(sndbuf_getsize(pb), pb, bs) : 0; + } else { + limit = (pb != NULL) ? + sndbuf_xbytes(sndbuf_getblksz(pb), pb, bs) * 2 : 0; + } } else { hblkcnt = 2; if (c->flags & CHN_F_HAS_SIZE) { @@ -1836,21 +1843,22 @@ chn_resizebuf(struct pcm_channel *c, int CHN_LOCK(c); if (!CHN_EMPTY(c, children)) { - sblksz = round_blksz( - sndbuf_xbytes(sndbuf_getsize(b) >> 1, b, bs), + nsblksz = round_blksz( + sndbuf_xbytes(sndbuf_getblksz(b), b, bs), sndbuf_getalign(bs)); - sblkcnt = 2; + nsblkcnt = sndbuf_getblkcnt(b); + if (c->direction == PCMDIR_PLAY) { + do { + nsblkcnt--; + } while (nsblkcnt >= 2 && + nsblksz * nsblkcnt >= sblksz * sblkcnt); + nsblkcnt++; + } + sblksz = nsblksz; + sblkcnt = nsblkcnt; limit = 0; - } else if (limit != 0) - limit = sndbuf_xbytes(sndbuf_getsize(b), b, bs); - - /* - * Interrupt timeout - */ - c->timeout = ((u_int64_t)hz * sndbuf_getsize(b)) / - ((u_int64_t)sndbuf_getspd(b) * sndbuf_getalign(b)); - if (c->timeout < 1) - c->timeout = 1; + } else + limit = sndbuf_xbytes(sndbuf_getblksz(b), b, bs) * 2; } if (limit > CHN_2NDBUFMAXSIZE) @@ -1887,6 +1895,16 @@ chn_resizebuf(struct pcm_channel *c, int } /* + * Interrupt timeout + */ + c->timeout = ((u_int64_t)hz * sndbuf_getsize(bs)) / + ((u_int64_t)sndbuf_getspd(bs) * sndbuf_getalign(bs)); + if (c->parentchannel != NULL) + c->timeout = min(c->timeout, c->parentchannel->timeout); + if (c->timeout < 1) + c->timeout = 1; + + /* * OSSv4 docs: "By default OSS will set the low water level equal * to the fragment size which is optimal in most cases." */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 22:27:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58D0A1065673; Tue, 31 Jan 2012 22:27:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47D008FC14; Tue, 31 Jan 2012 22:27:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VMRaX1057677; Tue, 31 Jan 2012 22:27:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VMRaNK057675; Tue, 31 Jan 2012 22:27:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201312227.q0VMRaNK057675@svn.freebsd.org> From: Adrian Chadd Date: Tue, 31 Jan 2012 22:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230846 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 22:27:36 -0000 Author: adrian Date: Tue Jan 31 22:27:35 2012 New Revision: 230846 URL: http://svn.freebsd.org/changeset/base/230846 Log: Correctly fetch the TX/RX stream count from the HAL. Pointy hat to: me Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jan 31 21:46:28 2012 (r230845) +++ head/sys/dev/ath/if_ath.c Tue Jan 31 22:27:35 2012 (r230846) @@ -678,8 +678,8 @@ ath_attach(u_int16_t devid, struct ath_s * negotiating which MCS rates it'll receive and * what MCS rates are available for TX. */ - (void) ath_hal_getcapability(ah, HAL_CAP_STREAMS, 0, &rxs); - (void) ath_hal_getcapability(ah, HAL_CAP_STREAMS, 1, &txs); + (void) ath_hal_getcapability(ah, HAL_CAP_STREAMS, 0, &txs); + (void) ath_hal_getcapability(ah, HAL_CAP_STREAMS, 1, &rxs); ath_hal_getrxchainmask(ah, &sc->sc_rxchainmask); ath_hal_gettxchainmask(ah, &sc->sc_txchainmask); From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 22:31:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A84BC106566B; Tue, 31 Jan 2012 22:31:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C6AA8FC16; Tue, 31 Jan 2012 22:31:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VMVHn1057882; Tue, 31 Jan 2012 22:31:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VMVHY1057879; Tue, 31 Jan 2012 22:31:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201312231.q0VMVHY1057879@svn.freebsd.org> From: Adrian Chadd Date: Tue, 31 Jan 2012 22:31: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: r230847 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 22:31:17 -0000 Author: adrian Date: Tue Jan 31 22:31:16 2012 New Revision: 230847 URL: http://svn.freebsd.org/changeset/base/230847 Log: Support AR9281/AR5B91 - a 1x2 stream device based on the AR9280. * Override the TX/RX stream count if the EEPROM reports a single RX or TX stream, rather than assuming the device will always be a 2x2 strea device. * For AR9280 devices, don't hard-code 2x2 stream. Instead, allow the ar5416FillCapabilityInfo() routine to correctly determine things. The latter should be done for all 11n chips now that ar5416FillCapabilityInfo() will set the TX/RX stream count based on the active TX/RX chainmask in the EEPROM. Thanks to Maciej Milewski for donating some AR9281 NICs to me for testing. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Jan 31 22:27:35 2012 (r230846) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Jan 31 22:31:16 2012 (r230847) @@ -884,6 +884,15 @@ ar5416FillCapabilityInfo(struct ath_hal /* AR5416 may have 3 antennas but is a 2x2 stream device */ pCap->halTxStreams = 2; pCap->halRxStreams = 2; + /* + * If the TX or RX chainmask has less than 2 chains active, + * mark it as a 1-stream device for the relevant stream. + */ + if (owl_get_ntxchains(pCap->halTxChainMask) == 1) + pCap->halTxStreams = 1; + /* XXX Eww */ + if (owl_get_ntxchains(pCap->halRxChainMask) == 1) + pCap->halRxStreams = 1; pCap->halRtsAggrLimit = 8*1024; /* Owl 2.0 limit */ pCap->halMbssidAggrSupport = AH_FALSE; /* Broken on Owl */ pCap->halForcePpmSupport = AH_TRUE; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Jan 31 22:27:35 2012 (r230846) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Jan 31 22:31:16 2012 (r230847) @@ -822,10 +822,6 @@ ar9280FillCapabilityInfo(struct ath_hal #if 0 pCap->halWowMatchPatternDword = AH_TRUE; #endif - /* AR9280 is a 2x2 stream device */ - pCap->halTxStreams = 2; - pCap->halRxStreams = 2; - pCap->halCSTSupport = AH_TRUE; pCap->halRifsRxSupport = AH_TRUE; pCap->halRifsTxSupport = AH_TRUE; From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 22:47:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61704106564A; Tue, 31 Jan 2012 22:47:11 +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 4EA978FC14; Tue, 31 Jan 2012 22:47:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VMlBxg058561; Tue, 31 Jan 2012 22:47:11 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VMlBA1058553; Tue, 31 Jan 2012 22:47:11 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201201312247.q0VMlBA1058553@svn.freebsd.org> From: Jack F Vogel Date: Tue, 31 Jan 2012 22:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230848 - stable/8/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 22:47:11 -0000 Author: jfv Date: Tue Jan 31 22:47:10 2012 New Revision: 230848 URL: http://svn.freebsd.org/changeset/base/230848 Log: MFC of e1000 drivers The following revs are merged: 212303,212304,213234,214363,214441,217556,219902,221505, 223676,226436,227309,228386,228387,228405,228415,228788, 228803,229606,229767,230023,230024,230742 Modified: stable/8/sys/dev/e1000/README stable/8/sys/dev/e1000/e1000_80003es2lan.c stable/8/sys/dev/e1000/e1000_80003es2lan.h stable/8/sys/dev/e1000/e1000_82540.c stable/8/sys/dev/e1000/e1000_82541.c stable/8/sys/dev/e1000/e1000_82543.c stable/8/sys/dev/e1000/e1000_82571.c stable/8/sys/dev/e1000/e1000_82575.c stable/8/sys/dev/e1000/e1000_82575.h stable/8/sys/dev/e1000/e1000_api.c stable/8/sys/dev/e1000/e1000_api.h stable/8/sys/dev/e1000/e1000_defines.h stable/8/sys/dev/e1000/e1000_hw.h stable/8/sys/dev/e1000/e1000_ich8lan.c stable/8/sys/dev/e1000/e1000_ich8lan.h stable/8/sys/dev/e1000/e1000_mac.c stable/8/sys/dev/e1000/e1000_nvm.c stable/8/sys/dev/e1000/e1000_nvm.h stable/8/sys/dev/e1000/e1000_osdep.c stable/8/sys/dev/e1000/e1000_phy.c stable/8/sys/dev/e1000/e1000_phy.h stable/8/sys/dev/e1000/e1000_regs.h stable/8/sys/dev/e1000/e1000_vf.c stable/8/sys/dev/e1000/if_em.c stable/8/sys/dev/e1000/if_em.h stable/8/sys/dev/e1000/if_igb.c stable/8/sys/dev/e1000/if_igb.h stable/8/sys/dev/e1000/if_lem.c stable/8/sys/dev/e1000/if_lem.h Directory Properties: stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/e1000/README ============================================================================== --- stable/8/sys/dev/e1000/README Tue Jan 31 22:31:16 2012 (r230847) +++ stable/8/sys/dev/e1000/README Tue Jan 31 22:47:10 2012 (r230848) @@ -354,6 +354,7 @@ Known Limitations include: Planex FXG-08TE I-O Data ETG-SH8 + Netgear GS105v3 The driver can be compiled with the following changes: Modified: stable/8/sys/dev/e1000/e1000_80003es2lan.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_80003es2lan.c Tue Jan 31 22:31:16 2012 (r230847) +++ stable/8/sys/dev/e1000/e1000_80003es2lan.c Tue Jan 31 22:47:10 2012 (r230848) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2011, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -47,18 +47,18 @@ static void e1000_release_phy_80003es2la static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw); static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw); static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, - u32 offset, - u16 *data); + u32 offset, + u16 *data); static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, - u32 offset, - u16 data); + u32 offset, + u16 data); static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset, - u16 words, u16 *data); + u16 words, u16 *data); static s32 e1000_get_cfg_done_80003es2lan(struct e1000_hw *hw); static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw); static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw); static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed, - u16 *duplex); + u16 *duplex); static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw); static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw); static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw); @@ -68,9 +68,9 @@ static s32 e1000_cfg_kmrn_10_100_80003e static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw); static s32 e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw); static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, - u16 *data); + u16 *data); static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, - u16 data); + u16 data); static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw); static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw); static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask); @@ -85,8 +85,8 @@ static void e1000_power_down_phy_copper_ static const u16 e1000_gg82563_cable_length_table[] = { 0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF }; #define GG82563_CABLE_LENGTH_TABLE_SIZE \ - (sizeof(e1000_gg82563_cable_length_table) / \ - sizeof(e1000_gg82563_cable_length_table[0])) + (sizeof(e1000_gg82563_cable_length_table) / \ + sizeof(e1000_gg82563_cable_length_table[0])) /** * e1000_init_phy_params_80003es2lan - Init ESB2 PHY func ptrs. @@ -100,34 +100,34 @@ static s32 e1000_init_phy_params_80003es DEBUGFUNC("e1000_init_phy_params_80003es2lan"); if (hw->phy.media_type != e1000_media_type_copper) { - phy->type = e1000_phy_none; + phy->type = e1000_phy_none; goto out; } else { phy->ops.power_up = e1000_power_up_phy_copper; phy->ops.power_down = e1000_power_down_phy_copper_80003es2lan; } - phy->addr = 1; - phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; - phy->reset_delay_us = 100; - phy->type = e1000_phy_gg82563; - - phy->ops.acquire = e1000_acquire_phy_80003es2lan; - phy->ops.check_polarity = e1000_check_polarity_m88; - phy->ops.check_reset_block = e1000_check_reset_block_generic; - phy->ops.commit = e1000_phy_sw_reset_generic; - phy->ops.get_cfg_done = e1000_get_cfg_done_80003es2lan; - phy->ops.get_info = e1000_get_phy_info_m88; - phy->ops.release = e1000_release_phy_80003es2lan; - phy->ops.reset = e1000_phy_hw_reset_generic; - phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic; + phy->addr = 1; + phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; + phy->reset_delay_us = 100; + phy->type = e1000_phy_gg82563; + + phy->ops.acquire = e1000_acquire_phy_80003es2lan; + phy->ops.check_polarity = e1000_check_polarity_m88; + phy->ops.check_reset_block = e1000_check_reset_block_generic; + phy->ops.commit = e1000_phy_sw_reset_generic; + phy->ops.get_cfg_done = e1000_get_cfg_done_80003es2lan; + phy->ops.get_info = e1000_get_phy_info_m88; + phy->ops.release = e1000_release_phy_80003es2lan; + phy->ops.reset = e1000_phy_hw_reset_generic; + phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic; phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_80003es2lan; - phy->ops.get_cable_length = e1000_get_cable_length_80003es2lan; - phy->ops.read_reg = e1000_read_phy_reg_gg82563_80003es2lan; - phy->ops.write_reg = e1000_write_phy_reg_gg82563_80003es2lan; + phy->ops.get_cable_length = e1000_get_cable_length_80003es2lan; + phy->ops.read_reg = e1000_read_phy_reg_gg82563_80003es2lan; + phy->ops.write_reg = e1000_write_phy_reg_gg82563_80003es2lan; - phy->ops.cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan; + phy->ops.cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan; /* This can only be done after all function pointers are setup. */ ret_val = e1000_get_phy_id(hw); @@ -154,19 +154,19 @@ static s32 e1000_init_nvm_params_80003es DEBUGFUNC("e1000_init_nvm_params_80003es2lan"); - nvm->opcode_bits = 8; - nvm->delay_usec = 1; + nvm->opcode_bits = 8; + nvm->delay_usec = 1; switch (nvm->override) { case e1000_nvm_override_spi_large: - nvm->page_size = 32; + nvm->page_size = 32; nvm->address_bits = 16; break; case e1000_nvm_override_spi_small: - nvm->page_size = 8; + nvm->page_size = 8; nvm->address_bits = 8; break; default: - nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; + nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8; break; } @@ -174,7 +174,7 @@ static s32 e1000_init_nvm_params_80003es nvm->type = e1000_nvm_eeprom_spi; size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> - E1000_EECD_SIZE_EX_SHIFT); + E1000_EECD_SIZE_EX_SHIFT); /* * Added to a constant, "size" becomes the left-shift value @@ -185,16 +185,16 @@ static s32 e1000_init_nvm_params_80003es /* EEPROM access above 16k is unsupported */ if (size > 14) size = 14; - nvm->word_size = 1 << size; + nvm->word_size = 1 << size; /* Function Pointers */ - nvm->ops.acquire = e1000_acquire_nvm_80003es2lan; - nvm->ops.read = e1000_read_nvm_eerd; - nvm->ops.release = e1000_release_nvm_80003es2lan; - nvm->ops.update = e1000_update_nvm_checksum_generic; + nvm->ops.acquire = e1000_acquire_nvm_80003es2lan; + nvm->ops.read = e1000_read_nvm_eerd; + nvm->ops.release = e1000_release_nvm_80003es2lan; + nvm->ops.update = e1000_update_nvm_checksum_generic; nvm->ops.valid_led_default = e1000_valid_led_default_generic; - nvm->ops.validate = e1000_validate_nvm_checksum_generic; - nvm->ops.write = e1000_write_nvm_80003es2lan; + nvm->ops.validate = e1000_validate_nvm_checksum_generic; + nvm->ops.write = e1000_write_nvm_80003es2lan; return E1000_SUCCESS; } @@ -215,13 +215,13 @@ static s32 e1000_init_mac_params_80003es hw->phy.media_type = e1000_media_type_internal_serdes; mac->ops.check_for_link = e1000_check_for_serdes_link_generic; mac->ops.setup_physical_interface = - e1000_setup_fiber_serdes_link_generic; + e1000_setup_fiber_serdes_link_generic; break; default: hw->phy.media_type = e1000_media_type_copper; mac->ops.check_for_link = e1000_check_for_copper_link_generic; mac->ops.setup_physical_interface = - e1000_setup_copper_link_80003es2lan; + e1000_setup_copper_link_80003es2lan; break; } @@ -234,9 +234,8 @@ static s32 e1000_init_mac_params_80003es /* FWSM register */ mac->has_fwsm = TRUE; /* ARC supported; valid only if manageability features are enabled. */ - mac->arc_subsystem_valid = - (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK) - ? TRUE : FALSE; + mac->arc_subsystem_valid = (E1000_READ_REG(hw, E1000_FWSM) & + E1000_FWSM_MODE_MASK) ? TRUE : FALSE; /* Adaptive IFS not supported */ mac->adaptive_ifs = FALSE; @@ -330,7 +329,7 @@ static void e1000_release_phy_80003es2la } /** - * e1000_acquire_mac_csr_80003es2lan - Acquire rights to access Kumeran register + * e1000_acquire_mac_csr_80003es2lan - Acquire right to access Kumeran register * @hw: pointer to the HW structure * * Acquire the semaphore to access the Kumeran interface. @@ -348,7 +347,7 @@ static s32 e1000_acquire_mac_csr_80003es } /** - * e1000_release_mac_csr_80003es2lan - Release rights to access Kumeran Register + * e1000_release_mac_csr_80003es2lan - Release right to access Kumeran Register * @hw: pointer to the HW structure * * Release the semaphore used to access the Kumeran interface @@ -488,7 +487,7 @@ static void e1000_release_swfw_sync_8000 * Read the GG82563 PHY register. **/ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, - u32 offset, u16 *data) + u32 offset, u16 *data) { s32 ret_val; u32 page_select; @@ -538,14 +537,14 @@ static s32 e1000_read_phy_reg_gg82563_80 usec_delay(200); ret_val = e1000_read_phy_reg_mdic(hw, - MAX_PHY_REG_ADDRESS & offset, - data); + MAX_PHY_REG_ADDRESS & offset, + data); usec_delay(200); } else { ret_val = e1000_read_phy_reg_mdic(hw, - MAX_PHY_REG_ADDRESS & offset, - data); + MAX_PHY_REG_ADDRESS & offset, + data); } e1000_release_phy_80003es2lan(hw); @@ -563,7 +562,7 @@ out: * Write to the GG82563 PHY register. **/ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, - u32 offset, u16 data) + u32 offset, u16 data) { s32 ret_val; u32 page_select; @@ -613,14 +612,14 @@ static s32 e1000_write_phy_reg_gg82563_8 usec_delay(200); ret_val = e1000_write_phy_reg_mdic(hw, - MAX_PHY_REG_ADDRESS & offset, - data); + MAX_PHY_REG_ADDRESS & offset, + data); usec_delay(200); } else { ret_val = e1000_write_phy_reg_mdic(hw, - MAX_PHY_REG_ADDRESS & offset, - data); + MAX_PHY_REG_ADDRESS & offset, + data); } e1000_release_phy_80003es2lan(hw); @@ -639,7 +638,7 @@ out: * Write "words" of data to the ESB2 NVM. **/ static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset, - u16 words, u16 *data) + u16 words, u16 *data) { DEBUGFUNC("e1000_write_nvm_80003es2lan"); @@ -729,11 +728,10 @@ static s32 e1000_phy_force_speed_duplex_ usec_delay(1); if (hw->phy.autoneg_wait_to_complete) { - DEBUGOUT("Waiting for forced speed/duplex link " - "on GG82563 phy.\n"); + DEBUGOUT("Waiting for forced speed/duplex link on GG82563 phy.\n"); ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT, - 100000, &link); + 100000, &link); if (ret_val) goto out; @@ -749,12 +747,13 @@ static s32 e1000_phy_force_speed_duplex_ /* Try once more */ ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT, - 100000, &link); + 100000, &link); if (ret_val) goto out; } - ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, &phy_data); + ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, + &phy_data); if (ret_val) goto out; @@ -773,7 +772,8 @@ static s32 e1000_phy_force_speed_duplex_ * duplex. */ phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX; - ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, phy_data); + ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, + phy_data); out: return ret_val; @@ -826,21 +826,20 @@ out: * Retrieve the current speed and duplex configuration. **/ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed, - u16 *duplex) + u16 *duplex) { s32 ret_val; DEBUGFUNC("e1000_get_link_up_info_80003es2lan"); if (hw->phy.media_type == e1000_media_type_copper) { - ret_val = e1000_get_speed_and_duplex_copper_generic(hw, - speed, - duplex); + ret_val = e1000_get_speed_and_duplex_copper_generic(hw, speed, + duplex); hw->phy.ops.cfg_on_link_up(hw); } else { ret_val = e1000_get_speed_and_duplex_fiber_serdes_generic(hw, - speed, - duplex); + speed, + duplex); } return ret_val; @@ -939,21 +938,21 @@ static s32 e1000_init_hw_80003es2lan(str /* Disable IBIST slave mode (far-end loopback) */ e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, - &kum_reg_data); + &kum_reg_data); kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, - kum_reg_data); + kum_reg_data); /* Set the transmit descriptor write-back policy */ reg_data = E1000_READ_REG(hw, E1000_TXDCTL(0)); reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) | - E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC; + E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC; E1000_WRITE_REG(hw, E1000_TXDCTL(0), reg_data); /* ...for both queues. */ reg_data = E1000_READ_REG(hw, E1000_TXDCTL(1)); reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) | - E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC; + E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC; E1000_WRITE_REG(hw, E1000_TXDCTL(1), reg_data); /* Enable retransmit on late collisions */ @@ -981,9 +980,9 @@ static s32 e1000_init_hw_80003es2lan(str hw->dev_spec._80003es2lan.mdic_wa_enable = TRUE; ret_val = e1000_read_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET >> - E1000_KMRNCTRLSTA_OFFSET_SHIFT, - &i); + E1000_KMRNCTRLSTA_OFFSET >> + E1000_KMRNCTRLSTA_OFFSET_SHIFT, + &i); if (!ret_val) { if ((i & E1000_KMRNCTRLSTA_OPMODE_MASK) == E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO) @@ -1056,11 +1055,7 @@ static s32 e1000_copper_link_setup_gg825 DEBUGFUNC("e1000_copper_link_setup_gg82563_80003es2lan"); - if (phy->reset_disable) - goto skip_reset; - - ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, - &data); + ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, &data); if (ret_val) goto out; @@ -1068,8 +1063,7 @@ static s32 e1000_copper_link_setup_gg825 /* Use 25MHz for both link down and 1000Base-T for Tx clock. */ data |= GG82563_MSCR_TX_CLK_1000MBPS_25; - ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, - data); + ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, data); if (ret_val) goto out; @@ -1122,7 +1116,6 @@ static s32 e1000_copper_link_setup_gg825 goto out; } -skip_reset: /* Bypass Rx and Tx FIFO's */ ret_val = e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL, @@ -1132,14 +1125,12 @@ skip_reset: goto out; ret_val = e1000_read_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE, - &data); + E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE, &data); if (ret_val) goto out; data |= E1000_KMRNCTRLSTA_OPMODE_E_IDLE; ret_val = e1000_write_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE, - data); + E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE, data); if (ret_val) goto out; @@ -1169,18 +1160,18 @@ skip_reset: /* Enable Electrical Idle on the PHY */ data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE; ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_PWR_MGMT_CTRL, - data); + data); if (ret_val) goto out; ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, - &data); + &data); if (ret_val) goto out; data &= ~GG82563_KMCR_PASS_FALSE_CARRIER; ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, - data); + data); if (ret_val) goto out; } @@ -1228,27 +1219,25 @@ static s32 e1000_setup_copper_link_80003 * polling the phy; this fixes erroneous timeouts at 10Mbps. */ ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 4), - 0xFFFF); + 0xFFFF); if (ret_val) goto out; ret_val = e1000_read_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9), - ®_data); + ®_data); if (ret_val) goto out; reg_data |= 0x3F; ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9), - reg_data); + reg_data); if (ret_val) goto out; ret_val = e1000_read_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, - ®_data); + E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, ®_data); if (ret_val) goto out; reg_data |= E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING; ret_val = e1000_write_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, - reg_data); + E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, reg_data); if (ret_val) goto out; @@ -1279,9 +1268,8 @@ static s32 e1000_cfg_on_link_up_80003es2 DEBUGFUNC("e1000_configure_on_link_up"); if (hw->phy.media_type == e1000_media_type_copper) { - ret_val = e1000_get_speed_and_duplex_copper_generic(hw, - &speed, - &duplex); + ret_val = e1000_get_speed_and_duplex_copper_generic(hw, &speed, + &duplex); if (ret_val) goto out; @@ -1314,8 +1302,8 @@ static s32 e1000_cfg_kmrn_10_100_80003es reg_data = E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT; ret_val = e1000_write_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_HD_CTRL, - reg_data); + E1000_KMRNCTRLSTA_OFFSET_HD_CTRL, + reg_data); if (ret_val) goto out; @@ -1327,12 +1315,12 @@ static s32 e1000_cfg_kmrn_10_100_80003es do { ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, - ®_data); + ®_data); if (ret_val) goto out; ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, - ®_data2); + ®_data2); if (ret_val) goto out; i++; @@ -1343,7 +1331,8 @@ static s32 e1000_cfg_kmrn_10_100_80003es else reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER; - ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data); + ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, + reg_data); out: return ret_val; @@ -1367,8 +1356,7 @@ static s32 e1000_cfg_kmrn_1000_80003es2l reg_data = E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT; ret_val = e1000_write_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_HD_CTRL, - reg_data); + E1000_KMRNCTRLSTA_OFFSET_HD_CTRL, reg_data); if (ret_val) goto out; @@ -1380,19 +1368,20 @@ static s32 e1000_cfg_kmrn_1000_80003es2l do { ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, - ®_data); + ®_data); if (ret_val) goto out; ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, - ®_data2); + ®_data2); if (ret_val) goto out; i++; } while ((reg_data != reg_data2) && (i < GG82563_MAX_KMRN_RETRY)); reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER; - ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data); + ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, + reg_data); out: return ret_val; @@ -1409,7 +1398,7 @@ out: * Release the semaphore before exiting. **/ static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, - u16 *data) + u16 *data) { u32 kmrnctrlsta; s32 ret_val = E1000_SUCCESS; @@ -1421,8 +1410,9 @@ static s32 e1000_read_kmrn_reg_80003es2l goto out; kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) & - E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN; + E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN; E1000_WRITE_REG(hw, E1000_KMRNCTRLSTA, kmrnctrlsta); + E1000_WRITE_FLUSH(hw); usec_delay(2); @@ -1446,7 +1436,7 @@ out: * before exiting. **/ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, - u16 data) + u16 data) { u32 kmrnctrlsta; s32 ret_val = E1000_SUCCESS; @@ -1458,8 +1448,9 @@ static s32 e1000_write_kmrn_reg_80003es2 goto out; kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) & - E1000_KMRNCTRLSTA_OFFSET) | data; + E1000_KMRNCTRLSTA_OFFSET) | data; E1000_WRITE_REG(hw, E1000_KMRNCTRLSTA, kmrnctrlsta); + E1000_WRITE_FLUSH(hw); usec_delay(2); Modified: stable/8/sys/dev/e1000/e1000_80003es2lan.h ============================================================================== --- stable/8/sys/dev/e1000/e1000_80003es2lan.h Tue Jan 31 22:31:16 2012 (r230847) +++ stable/8/sys/dev/e1000/e1000_80003es2lan.h Tue Jan 31 22:47:10 2012 (r230848) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2011, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -35,48 +35,47 @@ #ifndef _E1000_80003ES2LAN_H_ #define _E1000_80003ES2LAN_H_ -#define E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL 0x00 -#define E1000_KMRNCTRLSTA_OFFSET_INB_CTRL 0x02 -#define E1000_KMRNCTRLSTA_OFFSET_HD_CTRL 0x10 -#define E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE 0x1F - -#define E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS 0x0008 -#define E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS 0x0800 -#define E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING 0x0010 +#define E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL 0x00 +#define E1000_KMRNCTRLSTA_OFFSET_INB_CTRL 0x02 +#define E1000_KMRNCTRLSTA_OFFSET_HD_CTRL 0x10 +#define E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE 0x1F + +#define E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS 0x0008 +#define E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS 0x0800 +#define E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING 0x0010 #define E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT 0x0004 -#define E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT 0x0000 -#define E1000_KMRNCTRLSTA_OPMODE_E_IDLE 0x2000 +#define E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT 0x0000 +#define E1000_KMRNCTRLSTA_OPMODE_E_IDLE 0x2000 -#define E1000_KMRNCTRLSTA_OPMODE_MASK 0x000C -#define E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO 0x0004 +#define E1000_KMRNCTRLSTA_OPMODE_MASK 0x000C +#define E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO 0x0004 #define E1000_TCTL_EXT_GCEX_MASK 0x000FFC00 /* Gigabit Carry Extend Padding */ -#define DEFAULT_TCTL_EXT_GCEX_80003ES2LAN 0x00010000 +#define DEFAULT_TCTL_EXT_GCEX_80003ES2LAN 0x00010000 -#define DEFAULT_TIPG_IPGT_1000_80003ES2LAN 0x8 -#define DEFAULT_TIPG_IPGT_10_100_80003ES2LAN 0x9 +#define DEFAULT_TIPG_IPGT_1000_80003ES2LAN 0x8 +#define DEFAULT_TIPG_IPGT_10_100_80003ES2LAN 0x9 /* GG82563 PHY Specific Status Register (Page 0, Register 16 */ -#define GG82563_PSCR_POLARITY_REVERSAL_DISABLE 0x0002 /* 1=Reversal Disabled */ -#define GG82563_PSCR_CROSSOVER_MODE_MASK 0x0060 -#define GG82563_PSCR_CROSSOVER_MODE_MDI 0x0000 /* 00=Manual MDI */ -#define GG82563_PSCR_CROSSOVER_MODE_MDIX 0x0020 /* 01=Manual MDIX */ -#define GG82563_PSCR_CROSSOVER_MODE_AUTO 0x0060 /* 11=Auto crossover */ +#define GG82563_PSCR_POLARITY_REVERSAL_DISABLE 0x0002 /* 1=Reversal Disabled */ +#define GG82563_PSCR_CROSSOVER_MODE_MASK 0x0060 +#define GG82563_PSCR_CROSSOVER_MODE_MDI 0x0000 /* 00=Manual MDI */ +#define GG82563_PSCR_CROSSOVER_MODE_MDIX 0x0020 /* 01=Manual MDIX */ +#define GG82563_PSCR_CROSSOVER_MODE_AUTO 0x0060 /* 11=Auto crossover */ /* PHY Specific Control Register 2 (Page 0, Register 26) */ -#define GG82563_PSCR2_REVERSE_AUTO_NEG 0x2000 - /* 1=Reverse Auto-Negotiation */ +#define GG82563_PSCR2_REVERSE_AUTO_NEG 0x2000 /* 1=Reverse Auto-Nego */ /* MAC Specific Control Register (Page 2, Register 21) */ /* Tx clock speed for Link Down and 1000BASE-T for the following speeds */ -#define GG82563_MSCR_TX_CLK_MASK 0x0007 -#define GG82563_MSCR_TX_CLK_10MBPS_2_5 0x0004 -#define GG82563_MSCR_TX_CLK_100MBPS_25 0x0005 -#define GG82563_MSCR_TX_CLK_1000MBPS_2_5 0x0006 -#define GG82563_MSCR_TX_CLK_1000MBPS_25 0x0007 +#define GG82563_MSCR_TX_CLK_MASK 0x0007 +#define GG82563_MSCR_TX_CLK_10MBPS_2_5 0x0004 +#define GG82563_MSCR_TX_CLK_100MBPS_25 0x0005 +#define GG82563_MSCR_TX_CLK_1000MBPS_2_5 0x0006 +#define GG82563_MSCR_TX_CLK_1000MBPS_25 0x0007 -#define GG82563_MSCR_ASSERT_CRS_ON_TX 0x0010 /* 1=Assert */ +#define GG82563_MSCR_ASSERT_CRS_ON_TX 0x0010 /* 1=Assert */ /* DSP Distance Register (Page 5, Register 26) */ /* @@ -86,19 +85,19 @@ * 3 = 110-140M * 4 = >140M */ -#define GG82563_DSPD_CABLE_LENGTH 0x0007 +#define GG82563_DSPD_CABLE_LENGTH 0x0007 /* Kumeran Mode Control Register (Page 193, Register 16) */ -#define GG82563_KMCR_PASS_FALSE_CARRIER 0x0800 +#define GG82563_KMCR_PASS_FALSE_CARRIER 0x0800 /* Max number of times Kumeran read/write should be validated */ -#define GG82563_MAX_KMRN_RETRY 0x5 +#define GG82563_MAX_KMRN_RETRY 0x5 /* Power Management Control Register (Page 193, Register 20) */ -#define GG82563_PMCR_ENABLE_ELECTRICAL_IDLE 0x0001 - /* 1=Enable SERDES Electrical Idle */ +/* 1=Enable SERDES Electrical Idle */ +#define GG82563_PMCR_ENABLE_ELECTRICAL_IDLE 0x0001 /* In-Band Control Register (Page 194, Register 18) */ -#define GG82563_ICR_DIS_PADDING 0x0010 /* Disable Padding */ +#define GG82563_ICR_DIS_PADDING 0x0010 /* Disable Padding */ #endif Modified: stable/8/sys/dev/e1000/e1000_82540.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_82540.c Tue Jan 31 22:31:16 2012 (r230847) +++ stable/8/sys/dev/e1000/e1000_82540.c Tue Jan 31 22:47:10 2012 (r230848) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2011, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -68,23 +68,23 @@ static s32 e1000_init_phy_params_82540(s struct e1000_phy_info *phy = &hw->phy; s32 ret_val = E1000_SUCCESS; - phy->addr = 1; - phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; - phy->reset_delay_us = 10000; - phy->type = e1000_phy_m88; + phy->addr = 1; + phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; + phy->reset_delay_us = 10000; + phy->type = e1000_phy_m88; /* Function Pointers */ - phy->ops.check_polarity = e1000_check_polarity_m88; - phy->ops.commit = e1000_phy_sw_reset_generic; - phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; - phy->ops.get_cable_length = e1000_get_cable_length_m88; - phy->ops.get_cfg_done = e1000_get_cfg_done_generic; - phy->ops.read_reg = e1000_read_phy_reg_m88; - phy->ops.reset = e1000_phy_hw_reset_generic; - phy->ops.write_reg = e1000_write_phy_reg_m88; - phy->ops.get_info = e1000_get_phy_info_m88; - phy->ops.power_up = e1000_power_up_phy_copper; - phy->ops.power_down = e1000_power_down_phy_copper_82540; + phy->ops.check_polarity = e1000_check_polarity_m88; + phy->ops.commit = e1000_phy_sw_reset_generic; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; + phy->ops.get_cable_length = e1000_get_cable_length_m88; + phy->ops.get_cfg_done = e1000_get_cfg_done_generic; + phy->ops.read_reg = e1000_read_phy_reg_m88; + phy->ops.reset = e1000_phy_hw_reset_generic; + phy->ops.write_reg = e1000_write_phy_reg_m88; + phy->ops.get_info = e1000_get_phy_info_m88; + phy->ops.power_up = e1000_power_up_phy_copper; + phy->ops.power_down = e1000_power_down_phy_copper_82540; ret_val = e1000_get_phy_id(hw); if (ret_val) @@ -121,32 +121,32 @@ static s32 e1000_init_nvm_params_82540(s DEBUGFUNC("e1000_init_nvm_params_82540"); - nvm->type = e1000_nvm_eeprom_microwire; - nvm->delay_usec = 50; - nvm->opcode_bits = 3; + nvm->type = e1000_nvm_eeprom_microwire; + nvm->delay_usec = 50; + nvm->opcode_bits = 3; switch (nvm->override) { case e1000_nvm_override_microwire_large: - nvm->address_bits = 8; - nvm->word_size = 256; + nvm->address_bits = 8; + nvm->word_size = 256; break; case e1000_nvm_override_microwire_small: - nvm->address_bits = 6; - nvm->word_size = 64; + nvm->address_bits = 6; + nvm->word_size = 64; break; default: - nvm->address_bits = eecd & E1000_EECD_SIZE ? 8 : 6; - nvm->word_size = eecd & E1000_EECD_SIZE ? 256 : 64; + nvm->address_bits = eecd & E1000_EECD_SIZE ? 8 : 6; + nvm->word_size = eecd & E1000_EECD_SIZE ? 256 : 64; break; } /* Function Pointers */ - nvm->ops.acquire = e1000_acquire_nvm_generic; - nvm->ops.read = e1000_read_nvm_microwire; - nvm->ops.release = e1000_release_nvm_generic; - nvm->ops.update = e1000_update_nvm_checksum_generic; - nvm->ops.valid_led_default = e1000_valid_led_default_generic; - nvm->ops.validate = e1000_validate_nvm_checksum_generic; - nvm->ops.write = e1000_write_nvm_microwire; + nvm->ops.acquire = e1000_acquire_nvm_generic; + nvm->ops.read = e1000_read_nvm_microwire; + nvm->ops.release = e1000_release_nvm_generic; + nvm->ops.update = e1000_update_nvm_checksum_generic; + nvm->ops.valid_led_default = e1000_valid_led_default_generic; + nvm->ops.validate = e1000_validate_nvm_checksum_generic; + nvm->ops.write = e1000_write_nvm_microwire; return E1000_SUCCESS; } @@ -198,9 +198,9 @@ static s32 e1000_init_mac_params_82540(s mac->ops.setup_link = e1000_setup_link_generic; /* physical interface setup */ mac->ops.setup_physical_interface = - (hw->phy.media_type == e1000_media_type_copper) - ? e1000_setup_copper_link_82540 - : e1000_setup_fiber_serdes_link_82540; + (hw->phy.media_type == e1000_media_type_copper) + ? e1000_setup_copper_link_82540 + : e1000_setup_fiber_serdes_link_82540; /* check for link */ switch (hw->phy.media_type) { case e1000_media_type_copper: @@ -219,9 +219,9 @@ static s32 e1000_init_mac_params_82540(s } /* link info */ mac->ops.get_link_up_info = - (hw->phy.media_type == e1000_media_type_copper) - ? e1000_get_speed_and_duplex_copper_generic - : e1000_get_speed_and_duplex_fiber_serdes_generic; + (hw->phy.media_type == e1000_media_type_copper) + ? e1000_get_speed_and_duplex_copper_generic + : e1000_get_speed_and_duplex_fiber_serdes_generic; /* multicast address update */ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic; /* writing VFTA */ @@ -374,7 +374,7 @@ static s32 e1000_init_hw_82540(struct e1 txdctl = E1000_READ_REG(hw, E1000_TXDCTL(0)); txdctl = (txdctl & ~E1000_TXDCTL_WTHRESH) | - E1000_TXDCTL_FULL_TX_DESC_WB; + E1000_TXDCTL_FULL_TX_DESC_WB; E1000_WRITE_REG(hw, E1000_TXDCTL(0), txdctl); /* @@ -427,11 +427,13 @@ static s32 e1000_setup_copper_link_82540 if (hw->mac.type == e1000_82545_rev_3 || hw->mac.type == e1000_82546_rev_3) { - ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &data); + ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, + &data); if (ret_val) goto out; data |= 0x00000008; - ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, data); + ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, + data); if (ret_val) goto out; } @@ -508,9 +510,8 @@ static s32 e1000_adjust_serdes_amplitude if (nvm_data != NVM_RESERVED_WORD) { /* Adjust serdes output amplitude only. */ nvm_data &= NVM_SERDES_AMPLITUDE_MASK; - ret_val = hw->phy.ops.write_reg(hw, - M88E1000_PHY_EXT_CTRL, - nvm_data); + ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_EXT_CTRL, + nvm_data); if (ret_val) goto out; } @@ -535,9 +536,8 @@ static s32 e1000_set_vco_speed_82540(str /* Set PHY register 30, page 5, bit 8 to 0 */ - ret_val = hw->phy.ops.read_reg(hw, - M88E1000_PHY_PAGE_SELECT, - &default_page); + ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_PAGE_SELECT, + &default_page); if (ret_val) goto out; @@ -570,7 +570,7 @@ static s32 e1000_set_vco_speed_82540(str goto out; ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, - default_page); + default_page); out: return ret_val; @@ -587,7 +587,6 @@ out: **/ static s32 e1000_set_phy_mode_82540(struct e1000_hw *hw) { - struct e1000_phy_info *phy = &hw->phy; s32 ret_val = E1000_SUCCESS; u16 nvm_data; @@ -604,20 +603,18 @@ static s32 e1000_set_phy_mode_82540(stru if ((nvm_data != NVM_RESERVED_WORD) && (nvm_data & NVM_PHY_CLASS_A)) { ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, - 0x000B); + 0x000B); if (ret_val) { ret_val = -E1000_ERR_PHY; goto out; } - ret_val = hw->phy.ops.write_reg(hw, - M88E1000_PHY_GEN_CONTROL, - 0x8104); + ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, + 0x8104); if (ret_val) { ret_val = -E1000_ERR_PHY; goto out; } - phy->reset_disable = FALSE; } out: Modified: stable/8/sys/dev/e1000/e1000_82541.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_82541.c Tue Jan 31 22:31:16 2012 (r230847) +++ stable/8/sys/dev/e1000/e1000_82541.c Tue Jan 31 22:47:10 2012 (r230848) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2011, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -300,7 +300,7 @@ void e1000_init_function_pointers_82541( **/ static s32 e1000_reset_hw_82541(struct e1000_hw *hw) { - u32 ledctl, ctrl, manc; + u32 ledctl, ctrl, icr, manc; DEBUGFUNC("e1000_reset_hw_82541"); @@ -364,7 +364,7 @@ static s32 e1000_reset_hw_82541(struct e E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF); /* Clear any pending interrupt events. */ - E1000_READ_REG(hw, E1000_ICR); + icr = E1000_READ_REG(hw, E1000_ICR); return E1000_SUCCESS; } @@ -390,7 +390,7 @@ static s32 e1000_init_hw_82541(struct e1 DEBUGOUT("Error initializing identification LED\n"); /* This is not fatal and we should not stop init due to this */ } - + /* Storing the Speed Power Down value for later use */ ret_val = hw->phy.ops.read_reg(hw, IGP01E1000_GMII_FIFO, @@ -549,8 +549,6 @@ static s32 e1000_setup_copper_link_82541 ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); E1000_WRITE_REG(hw, E1000_CTRL, ctrl); - hw->phy.reset_disable = FALSE; - /* Earlier revs of the IGP phy require us to force MDI. */ if (hw->mac.type == e1000_82541 || hw->mac.type == e1000_82547) { dev_spec->dsp_config = e1000_dsp_config_disabled; Modified: stable/8/sys/dev/e1000/e1000_82543.c ============================================================================== --- stable/8/sys/dev/e1000/e1000_82543.c Tue Jan 31 22:31:16 2012 (r230847) +++ stable/8/sys/dev/e1000/e1000_82543.c Tue Jan 31 22:47:10 2012 (r230848) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2010, Intel Corporation *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 23:04:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 029561065674; Tue, 31 Jan 2012 23:04:59 +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 E3A4F8FC0C; Tue, 31 Jan 2012 23:04:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VN4wOH059177; Tue, 31 Jan 2012 23:04:58 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VN4wqR059171; Tue, 31 Jan 2012 23:04:58 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201312304.q0VN4wqR059171@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 31 Jan 2012 23:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230849 - in stable/9/sys/cam: . scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 23:04:59 -0000 Author: ken Date: Tue Jan 31 23:04:58 2012 New Revision: 230849 URL: http://svn.freebsd.org/changeset/base/230849 Log: MFC: 230000, 230544 Fix a race condition in CAM peripheral free handling, locking in the CAM XPT bus traversal code, and a number of other periph level issues. r230544 | ken | 2012-01-25 10:58:47 -0700 (Wed, 25 Jan 2012) | 9 lines Fix a bug introduced in r230000. We were eliminating all LUNs on a target in response to CAM_DEV_NOT_THERE, instead of just the LUN in question. This will now just eliminate the specified LUN in response to CAM_DEV_NOT_THERE. Reported by: Richard Todd r230000 | ken | 2012-01-11 17:41:48 -0700 (Wed, 11 Jan 2012) | 72 lines Fix a race condition in CAM peripheral free handling, locking in the CAM XPT bus traversal code, and a number of other periph level issues. cam_periph.h, cam_periph.c: Modify cam_periph_acquire() to test the CAM_PERIPH_INVALID flag prior to allowing a reference count to be gained on a peripheral. Callers of this function will receive CAM_REQ_CMP_ERR status in the situation of attempting to reference an invalidated periph. This guarantees that a peripheral scheduled for a deferred free will not be accessed during its wait for destruction. Panic during attempts to drop a reference count on a peripheral that already has a zero reference count. In cam_periph_list(), use a local sbuf with SBUF_FIXEDLEN set so that mallocs do not occur while the xpt topology lock is held, regardless of the allocation policy of the passed in sbuf. Add a new routine, cam_periph_release_locked_buses(), that can be called when the caller already holds the CAM topology lock. Add some extra debugging for duplicate peripheral allocations in cam_periph_alloc(). Treat CAM_DEV_NOT_THERE much the same as a selection timeout (AC_LOST_DEVICE is emitted), but forgo retries. cam_xpt.c: Revamp the way the EDT traversal code does locking and reference counting. This was broken, since it assumed that the EDT would not change during traversal, but that assumption is no longer valid. So, to prevent devices from going away while we traverse the EDT, make sure we properly lock everything and hold references on devices that we are using. The two peripheral driver traversal routines should be examined. xptpdperiphtraverse() holds the topology lock for the entire time it runs. xptperiphtraverse() is now locked properly, but only holds the topology lock while it is traversing the list, and not while the traversal function is running. The bus locking code in xptbustraverse() should also be revisited at a later time, since it is complex and should probably be simplified. scsi_da.c: Pay attention to the return value from cam_periph_acquire(). Return 0 always from daclose() even if the disk is now gone. Add some rudimentary error injection support. scsi_sg.c: Fix reference counting in the sg(4) driver. The sg driver was calling cam_periph_release() on close, but never called cam_periph_acquire() (which increments the reference count) on open. The periph code correctly complained that the sg(4) driver was trying to decrement the refcount when it was already 0. Sponsored by: Spectra Logic Modified: stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_periph.h stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/cam/scsi/scsi_sg.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Tue Jan 31 22:47:10 2012 (r230848) +++ stable/9/sys/cam/cam_periph.c Tue Jan 31 23:04:58 2012 (r230849) @@ -171,14 +171,16 @@ cam_periph_alloc(periph_ctor_t *periph_c return (CAM_REQ_INPROG); } else { printf("cam_periph_alloc: attempt to re-allocate " - "valid device %s%d rejected\n", - periph->periph_name, periph->unit_number); + "valid device %s%d rejected flags %#x " + "refcount %d\n", periph->periph_name, + periph->unit_number, periph->flags, + periph->refcount); } return (CAM_REQ_INVALID); } periph = (struct cam_periph *)malloc(sizeof(*periph), M_CAMPERIPH, - M_NOWAIT); + M_NOWAIT|M_ZERO); if (periph == NULL) return (CAM_RESRC_UNAVAIL); @@ -190,7 +192,6 @@ cam_periph_alloc(periph_ctor_t *periph_c path_id = xpt_path_path_id(path); target_id = xpt_path_target_id(path); lun_id = xpt_path_lun_id(path); - bzero(periph, sizeof(*periph)); cam_init_pinfo(&periph->pinfo); periph->periph_start = periph_start; periph->periph_dtor = periph_dtor; @@ -305,17 +306,20 @@ cam_periph_find(struct cam_path *path, c } /* - * Find a peripheral structure with the specified path, target, lun, - * and (optionally) type. If the name is NULL, this function will return - * the first peripheral driver that matches the specified path. + * Find peripheral driver instances attached to the specified path. */ int cam_periph_list(struct cam_path *path, struct sbuf *sb) { + struct sbuf local_sb; struct periph_driver **p_drv; struct cam_periph *periph; int count; + int sbuf_alloc_len; + sbuf_alloc_len = 16; +retry: + sbuf_new(&local_sb, NULL, sbuf_alloc_len, SBUF_FIXEDLEN); count = 0; xpt_lock_buses(); for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) { @@ -324,49 +328,71 @@ cam_periph_list(struct cam_path *path, s if (xpt_path_comp(periph->path, path) != 0) continue; - if (sbuf_len(sb) != 0) - sbuf_cat(sb, ","); + if (sbuf_len(&local_sb) != 0) + sbuf_cat(&local_sb, ","); - sbuf_printf(sb, "%s%d", periph->periph_name, + sbuf_printf(&local_sb, "%s%d", periph->periph_name, periph->unit_number); + + if (sbuf_error(&local_sb) == ENOMEM) { + sbuf_alloc_len *= 2; + xpt_unlock_buses(); + sbuf_delete(&local_sb); + goto retry; + } count++; } } xpt_unlock_buses(); + sbuf_finish(&local_sb); + sbuf_cpy(sb, sbuf_data(&local_sb)); + sbuf_delete(&local_sb); return (count); } cam_status cam_periph_acquire(struct cam_periph *periph) { + cam_status status; + status = CAM_REQ_CMP_ERR; if (periph == NULL) - return(CAM_REQ_CMP_ERR); + return (status); xpt_lock_buses(); - periph->refcount++; + if ((periph->flags & CAM_PERIPH_INVALID) == 0) { + periph->refcount++; + status = CAM_REQ_CMP; + } xpt_unlock_buses(); - return(CAM_REQ_CMP); + return (status); } void -cam_periph_release_locked(struct cam_periph *periph) +cam_periph_release_locked_buses(struct cam_periph *periph) { - - if (periph == NULL) - return; - - xpt_lock_buses(); if (periph->refcount != 0) { periph->refcount--; } else { - xpt_print(periph->path, "%s: release %p when refcount is zero\n ", __func__, periph); + panic("%s: release of %p when refcount is zero\n ", __func__, + periph); } if (periph->refcount == 0 && (periph->flags & CAM_PERIPH_INVALID)) { camperiphfree(periph); } +} + +void +cam_periph_release_locked(struct cam_periph *periph) +{ + + if (periph == NULL) + return; + + xpt_lock_buses(); + cam_periph_release_locked_buses(periph); xpt_unlock_buses(); } @@ -1812,9 +1838,6 @@ cam_periph_error(union ccb *ccb, cam_fla error = EIO; break; case CAM_SEL_TIMEOUT: - { - struct cam_path *newpath; - if ((camflags & CAM_RETRY_SELTO) != 0) { if (ccb->ccb_h.retry_count > 0 && (periph->flags & CAM_PERIPH_INVALID) == 0) { @@ -1837,12 +1860,30 @@ cam_periph_error(union ccb *ccb, cam_fla } action_string = "Retries exhausted"; } + /* FALLTHROUGH */ + case CAM_DEV_NOT_THERE: + { + struct cam_path *newpath; + lun_id_t lun_id; + error = ENXIO; + + /* + * For a selection timeout, we consider all of the LUNs on + * the target to be gone. If the status is CAM_DEV_NOT_THERE, + * then we only get rid of the device(s) specified by the + * path in the original CCB. + */ + if (status == CAM_DEV_NOT_THERE) + lun_id = xpt_path_lun_id(ccb->ccb_h.path); + else + lun_id = CAM_LUN_WILDCARD; + /* Should we do more if we can't create the path?? */ if (xpt_create_path(&newpath, periph, xpt_path_path_id(ccb->ccb_h.path), xpt_path_target_id(ccb->ccb_h.path), - CAM_LUN_WILDCARD) != CAM_REQ_CMP) + lun_id) != CAM_REQ_CMP) break; /* @@ -1855,7 +1896,6 @@ cam_periph_error(union ccb *ccb, cam_fla } case CAM_REQ_INVALID: case CAM_PATH_INVALID: - case CAM_DEV_NOT_THERE: case CAM_NO_HBA: case CAM_PROVIDE_FAIL: case CAM_REQ_TOO_BIG: Modified: stable/9/sys/cam/cam_periph.h ============================================================================== --- stable/9/sys/cam/cam_periph.h Tue Jan 31 22:47:10 2012 (r230848) +++ stable/9/sys/cam/cam_periph.h Tue Jan 31 23:04:58 2012 (r230849) @@ -119,6 +119,7 @@ struct cam_periph { #define CAM_PERIPH_NEW_DEV_FOUND 0x10 #define CAM_PERIPH_RECOVERY_INPROG 0x20 #define CAM_PERIPH_SENSE_INPROG 0x40 +#define CAM_PERIPH_FREE 0x80 u_int32_t immediate_priority; u_int32_t refcount; SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */ @@ -146,6 +147,7 @@ int cam_periph_list(struct cam_path *, cam_status cam_periph_acquire(struct cam_periph *periph); void cam_periph_release(struct cam_periph *periph); void cam_periph_release_locked(struct cam_periph *periph); +void cam_periph_release_locked_buses(struct cam_periph *periph); int cam_periph_hold(struct cam_periph *periph, int priority); void cam_periph_unhold(struct cam_periph *periph); void cam_periph_invalidate(struct cam_periph *periph); Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Tue Jan 31 22:47:10 2012 (r230848) +++ stable/9/sys/cam/cam_xpt.c Tue Jan 31 23:04:58 2012 (r230849) @@ -2026,12 +2026,24 @@ xptbustraverse(struct cam_eb *start_bus, for (bus = (start_bus ? start_bus : TAILQ_FIRST(&xsoftc.xpt_busses)); bus != NULL; bus = next_bus) { - next_bus = TAILQ_NEXT(bus, links); + bus->refcount++; + + /* + * XXX The locking here is obviously very complex. We + * should work to simplify it. + */ mtx_unlock(&xsoftc.xpt_topo_lock); CAM_SIM_LOCK(bus->sim); retval = tr_func(bus, arg); CAM_SIM_UNLOCK(bus->sim); + + mtx_lock(&xsoftc.xpt_topo_lock); + next_bus = TAILQ_NEXT(bus, links); + mtx_unlock(&xsoftc.xpt_topo_lock); + + xpt_release_bus(bus); + if (retval == 0) return(retval); mtx_lock(&xsoftc.xpt_topo_lock); @@ -2086,10 +2098,14 @@ xpttargettraverse(struct cam_eb *bus, st TAILQ_FIRST(&bus->et_entries)); target != NULL; target = next_target) { - next_target = TAILQ_NEXT(target, links); + target->refcount++; retval = tr_func(target, arg); + next_target = TAILQ_NEXT(target, links); + + xpt_release_target(target); + if (retval == 0) return(retval); } @@ -2110,10 +2126,22 @@ xptdevicetraverse(struct cam_et *target, device != NULL; device = next_device) { - next_device = TAILQ_NEXT(device, links); + /* + * Hold a reference so the current device does not go away + * on us. + */ + device->refcount++; retval = tr_func(device, arg); + /* + * Grab our next pointer before we release the current + * device. + */ + next_device = TAILQ_NEXT(device, links); + + xpt_release_device(device); + if (retval == 0) return(retval); } @@ -2130,18 +2158,57 @@ xptperiphtraverse(struct cam_ed *device, retval = 1; + xpt_lock_buses(); for (periph = (start_periph ? start_periph : SLIST_FIRST(&device->periphs)); periph != NULL; periph = next_periph) { - next_periph = SLIST_NEXT(periph, periph_links); + + /* + * In this case, we want to show peripherals that have been + * invalidated, but not peripherals that are scheduled to + * be freed. So instead of calling cam_periph_acquire(), + * which will fail if the periph has been invalidated, we + * just check for the free flag here. If it is free, we + * skip to the next periph. + */ + if (periph->flags & CAM_PERIPH_FREE) { + next_periph = SLIST_NEXT(periph, periph_links); + continue; + } + + /* + * Acquire a reference to this periph while we call the + * traversal function, so it can't go away. + */ + periph->refcount++; + + xpt_unlock_buses(); retval = tr_func(periph, arg); + + /* + * We need the lock for list traversal. + */ + xpt_lock_buses(); + + /* + * Grab the next peripheral before we release this one, so + * our next pointer is still valid. + */ + next_periph = SLIST_NEXT(periph, periph_links); + + cam_periph_release_locked_buses(periph); + if (retval == 0) - return(retval); + goto bailout_done; } +bailout_done: + + xpt_unlock_buses(); + return(retval); } @@ -2188,15 +2255,48 @@ xptpdperiphtraverse(struct periph_driver TAILQ_FIRST(&(*pdrv)->units)); periph != NULL; periph = next_periph) { - next_periph = TAILQ_NEXT(periph, unit_links); - retval = tr_func(periph, arg); - if (retval == 0) { - xpt_unlock_buses(); - return(retval); + /* + * In this case, we want to show peripherals that have been + * invalidated, but not peripherals that are scheduled to + * be freed. So instead of calling cam_periph_acquire(), + * which will fail if the periph has been invalidated, we + * just check for the free flag here. If it is free, we + * skip to the next periph. + */ + if (periph->flags & CAM_PERIPH_FREE) { + next_periph = TAILQ_NEXT(periph, unit_links); + continue; } + + /* + * Acquire a reference to this periph while we call the + * traversal function, so it can't go away. + */ + periph->refcount++; + + /* + * XXX KDM we have the toplogy lock here, but in + * xptperiphtraverse(), we drop it before calling the + * traversal function. Which is correct? + */ + retval = tr_func(periph, arg); + + /* + * Grab the next peripheral before we release this one, so + * our next pointer is still valid. + */ + next_periph = TAILQ_NEXT(periph, unit_links); + + cam_periph_release_locked_buses(periph); + + if (retval == 0) + goto bailout_done; } +bailout_done: + xpt_unlock_buses(); + return(retval); } Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Tue Jan 31 22:47:10 2012 (r230848) +++ stable/9/sys/cam/scsi/scsi_da.c Tue Jan 31 23:04:58 2012 (r230849) @@ -122,6 +122,7 @@ struct da_softc { da_flags flags; da_quirks quirks; int minimum_cmd_size; + int error_inject; int ordered_tag_count; int outstanding_cmds; struct disk_params params; @@ -658,7 +659,7 @@ daopen(struct disk *dp) } if (cam_periph_acquire(periph) != CAM_REQ_CMP) { - return(ENXIO); + return (ENXIO); } cam_periph_lock(periph); @@ -717,13 +718,13 @@ daclose(struct disk *dp) periph = (struct cam_periph *)dp->d_drv1; if (periph == NULL) - return (ENXIO); + return (0); cam_periph_lock(periph); if ((error = cam_periph_hold(periph, PRIBIO)) != 0) { cam_periph_unlock(periph); cam_periph_release(periph); - return (error); + return (0); } softc = (struct da_softc *)periph->softc; @@ -998,8 +999,8 @@ daoninvalidate(struct cam_periph *periph bioq_flush(&softc->bio_queue, NULL, ENXIO); disk_gone(softc->disk); - xpt_print(periph->path, "lost device - %d outstanding\n", - softc->outstanding_cmds); + xpt_print(periph->path, "lost device - %d outstanding, %d refs\n", + softc->outstanding_cmds, periph->refcount); } static void @@ -1145,6 +1146,16 @@ dasysctlinit(void *context, int pending) &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); + SYSCTL_ADD_INT(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, + "error_inject", + CTLFLAG_RW, + &softc->error_inject, + 0, + "error_inject leaf"); + + /* * Add some addressing info. */ @@ -1663,6 +1674,13 @@ dadone(struct cam_periph *periph, union bp->bio_resid = csio->resid; if (csio->resid > 0) bp->bio_flags |= BIO_ERROR; + if (softc->error_inject != 0) { + bp->bio_error = softc->error_inject; + bp->bio_resid = bp->bio_bcount; + bp->bio_flags |= BIO_ERROR; + softc->error_inject = 0; + } + } /* @@ -1850,13 +1868,20 @@ dadone(struct cam_periph *periph, union } free(csio->data_ptr, M_SCSIDA); if (announce_buf[0] != '\0') { - xpt_announce_periph(periph, announce_buf); /* * Create our sysctl variables, now that we know * we have successfully attached. */ - (void) cam_periph_acquire(periph); /* increase the refcount */ - taskqueue_enqueue(taskqueue_thread,&softc->sysctl_task); + /* increase the refcount */ + if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + taskqueue_enqueue(taskqueue_thread, + &softc->sysctl_task); + xpt_announce_periph(periph, announce_buf); + } else { + xpt_print(periph->path, "fatal error, " + "could not acquire reference count\n"); + } + } softc->state = DA_STATE_NORMAL; /* Modified: stable/9/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_sg.c Tue Jan 31 22:47:10 2012 (r230848) +++ stable/9/sys/cam/scsi/scsi_sg.c Tue Jan 31 23:04:58 2012 (r230849) @@ -399,18 +399,24 @@ sgopen(struct cdev *dev, int flags, int if (periph == NULL) return (ENXIO); + if (cam_periph_acquire(periph) != CAM_REQ_CMP) + return (ENXIO); + /* * Don't allow access when we're running at a high securelevel. */ error = securelevel_gt(td->td_ucred, 1); - if (error) + if (error) { + cam_periph_release(periph); return (error); + } cam_periph_lock(periph); softc = (struct sg_softc *)periph->softc; if (softc->flags & SG_FLAG_INVALID) { cam_periph_unlock(periph); + cam_periph_release(periph); return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 23:09:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D3DB106564A; Tue, 31 Jan 2012 23:09:28 +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 EE8058FC15; Tue, 31 Jan 2012 23:09:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VN9Rs6059368; Tue, 31 Jan 2012 23:09:27 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VN9Rew059362; Tue, 31 Jan 2012 23:09:27 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201312309.q0VN9Rew059362@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 31 Jan 2012 23:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230850 - in stable/8/sys/cam: . scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 23:09:28 -0000 Author: ken Date: Tue Jan 31 23:09:27 2012 New Revision: 230850 URL: http://svn.freebsd.org/changeset/base/230850 Log: MFC: 230000, 230544 Fix a race condition in CAM peripheral free handling, locking in the CAM XPT bus traversal code, and a number of other periph level issues. r230544 | ken | 2012-01-25 10:58:47 -0700 (Wed, 25 Jan 2012) | 9 lines Fix a bug introduced in r230000. We were eliminating all LUNs on a target in response to CAM_DEV_NOT_THERE, instead of just the LUN in question. This will now just eliminate the specified LUN in response to CAM_DEV_NOT_THERE. Reported by: Richard Todd r230000 | ken | 2012-01-11 17:41:48 -0700 (Wed, 11 Jan 2012) | 72 lines Fix a race condition in CAM peripheral free handling, locking in the CAM XPT bus traversal code, and a number of other periph level issues. cam_periph.h, cam_periph.c: Modify cam_periph_acquire() to test the CAM_PERIPH_INVALID flag prior to allowing a reference count to be gained on a peripheral. Callers of this function will receive CAM_REQ_CMP_ERR status in the situation of attempting to reference an invalidated periph. This guarantees that a peripheral scheduled for a deferred free will not be accessed during its wait for destruction. Panic during attempts to drop a reference count on a peripheral that already has a zero reference count. In cam_periph_list(), use a local sbuf with SBUF_FIXEDLEN set so that mallocs do not occur while the xpt topology lock is held, regardless of the allocation policy of the passed in sbuf. Add a new routine, cam_periph_release_locked_buses(), that can be called when the caller already holds the CAM topology lock. Add some extra debugging for duplicate peripheral allocations in cam_periph_alloc(). Treat CAM_DEV_NOT_THERE much the same as a selection timeout (AC_LOST_DEVICE is emitted), but forgo retries. cam_xpt.c: Revamp the way the EDT traversal code does locking and reference counting. This was broken, since it assumed that the EDT would not change during traversal, but that assumption is no longer valid. So, to prevent devices from going away while we traverse the EDT, make sure we properly lock everything and hold references on devices that we are using. The two peripheral driver traversal routines should be examined. xptpdperiphtraverse() holds the topology lock for the entire time it runs. xptperiphtraverse() is now locked properly, but only holds the topology lock while it is traversing the list, and not while the traversal function is running. The bus locking code in xptbustraverse() should also be revisited at a later time, since it is complex and should probably be simplified. scsi_da.c: Pay attention to the return value from cam_periph_acquire(). Return 0 always from daclose() even if the disk is now gone. Add some rudimentary error injection support. scsi_sg.c: Fix reference counting in the sg(4) driver. The sg driver was calling cam_periph_release() on close, but never called cam_periph_acquire() (which increments the reference count) on open. The periph code correctly complained that the sg(4) driver was trying to decrement the refcount when it was already 0. Sponsored by: Spectra Logic Modified: stable/8/sys/cam/cam_periph.c stable/8/sys/cam/cam_periph.h stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/scsi/scsi_da.c stable/8/sys/cam/scsi/scsi_sg.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cam/cam_periph.c ============================================================================== --- stable/8/sys/cam/cam_periph.c Tue Jan 31 23:04:58 2012 (r230849) +++ stable/8/sys/cam/cam_periph.c Tue Jan 31 23:09:27 2012 (r230850) @@ -170,14 +170,16 @@ cam_periph_alloc(periph_ctor_t *periph_c return (CAM_REQ_INPROG); } else { printf("cam_periph_alloc: attempt to re-allocate " - "valid device %s%d rejected\n", - periph->periph_name, periph->unit_number); + "valid device %s%d rejected flags %#x " + "refcount %d\n", periph->periph_name, + periph->unit_number, periph->flags, + periph->refcount); } return (CAM_REQ_INVALID); } periph = (struct cam_periph *)malloc(sizeof(*periph), M_CAMPERIPH, - M_NOWAIT); + M_NOWAIT|M_ZERO); if (periph == NULL) return (CAM_RESRC_UNAVAIL); @@ -189,7 +191,6 @@ cam_periph_alloc(periph_ctor_t *periph_c path_id = xpt_path_path_id(path); target_id = xpt_path_target_id(path); lun_id = xpt_path_lun_id(path); - bzero(periph, sizeof(*periph)); cam_init_pinfo(&periph->pinfo); periph->periph_start = periph_start; periph->periph_dtor = periph_dtor; @@ -306,34 +307,46 @@ cam_periph_find(struct cam_path *path, c cam_status cam_periph_acquire(struct cam_periph *periph) { + cam_status status; + status = CAM_REQ_CMP_ERR; if (periph == NULL) - return(CAM_REQ_CMP_ERR); + return (status); xpt_lock_buses(); - periph->refcount++; + if ((periph->flags & CAM_PERIPH_INVALID) == 0) { + periph->refcount++; + status = CAM_REQ_CMP; + } xpt_unlock_buses(); - return(CAM_REQ_CMP); + return (status); } void -cam_periph_release_locked(struct cam_periph *periph) +cam_periph_release_locked_buses(struct cam_periph *periph) { - - if (periph == NULL) - return; - - xpt_lock_buses(); if (periph->refcount != 0) { periph->refcount--; } else { - xpt_print(periph->path, "%s: release %p when refcount is zero\n ", __func__, periph); + panic("%s: release of %p when refcount is zero\n ", __func__, + periph); } if (periph->refcount == 0 && (periph->flags & CAM_PERIPH_INVALID)) { camperiphfree(periph); } +} + +void +cam_periph_release_locked(struct cam_periph *periph) +{ + + if (periph == NULL) + return; + + xpt_lock_buses(); + cam_periph_release_locked_buses(periph); xpt_unlock_buses(); } @@ -1732,9 +1745,6 @@ cam_periph_error(union ccb *ccb, cam_fla error = EIO; break; case CAM_SEL_TIMEOUT: - { - struct cam_path *newpath; - if ((camflags & CAM_RETRY_SELTO) != 0) { if (ccb->ccb_h.retry_count > 0 && (periph->flags & CAM_PERIPH_INVALID) == 0) { @@ -1757,12 +1767,30 @@ cam_periph_error(union ccb *ccb, cam_fla } action_string = "Retries exhausted"; } + /* FALLTHROUGH */ + case CAM_DEV_NOT_THERE: + { + struct cam_path *newpath; + lun_id_t lun_id; + error = ENXIO; + + /* + * For a selection timeout, we consider all of the LUNs on + * the target to be gone. If the status is CAM_DEV_NOT_THERE, + * then we only get rid of the device(s) specified by the + * path in the original CCB. + */ + if (status == CAM_DEV_NOT_THERE) + lun_id = xpt_path_lun_id(ccb->ccb_h.path); + else + lun_id = CAM_LUN_WILDCARD; + /* Should we do more if we can't create the path?? */ if (xpt_create_path(&newpath, periph, xpt_path_path_id(ccb->ccb_h.path), xpt_path_target_id(ccb->ccb_h.path), - CAM_LUN_WILDCARD) != CAM_REQ_CMP) + lun_id) != CAM_REQ_CMP) break; /* @@ -1775,7 +1803,6 @@ cam_periph_error(union ccb *ccb, cam_fla } case CAM_REQ_INVALID: case CAM_PATH_INVALID: - case CAM_DEV_NOT_THERE: case CAM_NO_HBA: case CAM_PROVIDE_FAIL: case CAM_REQ_TOO_BIG: Modified: stable/8/sys/cam/cam_periph.h ============================================================================== --- stable/8/sys/cam/cam_periph.h Tue Jan 31 23:04:58 2012 (r230849) +++ stable/8/sys/cam/cam_periph.h Tue Jan 31 23:09:27 2012 (r230850) @@ -119,6 +119,7 @@ struct cam_periph { #define CAM_PERIPH_NEW_DEV_FOUND 0x10 #define CAM_PERIPH_RECOVERY_INPROG 0x20 #define CAM_PERIPH_SENSE_INPROG 0x40 +#define CAM_PERIPH_FREE 0x80 u_int32_t immediate_priority; u_int32_t refcount; SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */ @@ -145,6 +146,7 @@ struct cam_periph *cam_periph_find(struc cam_status cam_periph_acquire(struct cam_periph *periph); void cam_periph_release(struct cam_periph *periph); void cam_periph_release_locked(struct cam_periph *periph); +void cam_periph_release_locked_buses(struct cam_periph *periph); int cam_periph_hold(struct cam_periph *periph, int priority); void cam_periph_unhold(struct cam_periph *periph); void cam_periph_invalidate(struct cam_periph *periph); Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Tue Jan 31 23:04:58 2012 (r230849) +++ stable/8/sys/cam/cam_xpt.c Tue Jan 31 23:09:27 2012 (r230850) @@ -1975,12 +1975,24 @@ xptbustraverse(struct cam_eb *start_bus, for (bus = (start_bus ? start_bus : TAILQ_FIRST(&xsoftc.xpt_busses)); bus != NULL; bus = next_bus) { - next_bus = TAILQ_NEXT(bus, links); + bus->refcount++; + + /* + * XXX The locking here is obviously very complex. We + * should work to simplify it. + */ mtx_unlock(&xsoftc.xpt_topo_lock); CAM_SIM_LOCK(bus->sim); retval = tr_func(bus, arg); CAM_SIM_UNLOCK(bus->sim); + + mtx_lock(&xsoftc.xpt_topo_lock); + next_bus = TAILQ_NEXT(bus, links); + mtx_unlock(&xsoftc.xpt_topo_lock); + + xpt_release_bus(bus); + if (retval == 0) return(retval); mtx_lock(&xsoftc.xpt_topo_lock); @@ -2035,10 +2047,14 @@ xpttargettraverse(struct cam_eb *bus, st TAILQ_FIRST(&bus->et_entries)); target != NULL; target = next_target) { - next_target = TAILQ_NEXT(target, links); + target->refcount++; retval = tr_func(target, arg); + next_target = TAILQ_NEXT(target, links); + + xpt_release_target(target); + if (retval == 0) return(retval); } @@ -2059,10 +2075,22 @@ xptdevicetraverse(struct cam_et *target, device != NULL; device = next_device) { - next_device = TAILQ_NEXT(device, links); + /* + * Hold a reference so the current device does not go away + * on us. + */ + device->refcount++; retval = tr_func(device, arg); + /* + * Grab our next pointer before we release the current + * device. + */ + next_device = TAILQ_NEXT(device, links); + + xpt_release_device(device); + if (retval == 0) return(retval); } @@ -2079,18 +2107,57 @@ xptperiphtraverse(struct cam_ed *device, retval = 1; + xpt_lock_buses(); for (periph = (start_periph ? start_periph : SLIST_FIRST(&device->periphs)); periph != NULL; periph = next_periph) { - next_periph = SLIST_NEXT(periph, periph_links); + + /* + * In this case, we want to show peripherals that have been + * invalidated, but not peripherals that are scheduled to + * be freed. So instead of calling cam_periph_acquire(), + * which will fail if the periph has been invalidated, we + * just check for the free flag here. If it is free, we + * skip to the next periph. + */ + if (periph->flags & CAM_PERIPH_FREE) { + next_periph = SLIST_NEXT(periph, periph_links); + continue; + } + + /* + * Acquire a reference to this periph while we call the + * traversal function, so it can't go away. + */ + periph->refcount++; + + xpt_unlock_buses(); retval = tr_func(periph, arg); + + /* + * We need the lock for list traversal. + */ + xpt_lock_buses(); + + /* + * Grab the next peripheral before we release this one, so + * our next pointer is still valid. + */ + next_periph = SLIST_NEXT(periph, periph_links); + + cam_periph_release_locked_buses(periph); + if (retval == 0) - return(retval); + goto bailout_done; } +bailout_done: + + xpt_unlock_buses(); + return(retval); } @@ -2137,15 +2204,48 @@ xptpdperiphtraverse(struct periph_driver TAILQ_FIRST(&(*pdrv)->units)); periph != NULL; periph = next_periph) { - next_periph = TAILQ_NEXT(periph, unit_links); - retval = tr_func(periph, arg); - if (retval == 0) { - xpt_unlock_buses(); - return(retval); + /* + * In this case, we want to show peripherals that have been + * invalidated, but not peripherals that are scheduled to + * be freed. So instead of calling cam_periph_acquire(), + * which will fail if the periph has been invalidated, we + * just check for the free flag here. If it is free, we + * skip to the next periph. + */ + if (periph->flags & CAM_PERIPH_FREE) { + next_periph = TAILQ_NEXT(periph, unit_links); + continue; } + + /* + * Acquire a reference to this periph while we call the + * traversal function, so it can't go away. + */ + periph->refcount++; + + /* + * XXX KDM we have the toplogy lock here, but in + * xptperiphtraverse(), we drop it before calling the + * traversal function. Which is correct? + */ + retval = tr_func(periph, arg); + + /* + * Grab the next peripheral before we release this one, so + * our next pointer is still valid. + */ + next_periph = TAILQ_NEXT(periph, unit_links); + + cam_periph_release_locked_buses(periph); + + if (retval == 0) + goto bailout_done; } +bailout_done: + xpt_unlock_buses(); + return(retval); } Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Tue Jan 31 23:04:58 2012 (r230849) +++ stable/8/sys/cam/scsi/scsi_da.c Tue Jan 31 23:09:27 2012 (r230850) @@ -121,6 +121,7 @@ struct da_softc { da_flags flags; da_quirks quirks; int minimum_cmd_size; + int error_inject; int ordered_tag_count; int outstanding_cmds; struct disk_params params; @@ -656,7 +657,7 @@ daopen(struct disk *dp) } if (cam_periph_acquire(periph) != CAM_REQ_CMP) { - return(ENXIO); + return (ENXIO); } cam_periph_lock(periph); @@ -715,13 +716,13 @@ daclose(struct disk *dp) periph = (struct cam_periph *)dp->d_drv1; if (periph == NULL) - return (ENXIO); + return (0); cam_periph_lock(periph); if ((error = cam_periph_hold(periph, PRIBIO)) != 0) { cam_periph_unlock(periph); cam_periph_release(periph); - return (error); + return (0); } softc = (struct da_softc *)periph->softc; @@ -976,7 +977,8 @@ daoninvalidate(struct cam_periph *periph bioq_flush(&softc->bio_queue, NULL, ENXIO); disk_gone(softc->disk); - xpt_print(periph->path, "lost device\n"); + xpt_print(periph->path, "lost device - %d outstanding, %d refs\n", + softc->outstanding_cmds, periph->refcount); } static void @@ -1579,6 +1581,13 @@ dadone(struct cam_periph *periph, union bp->bio_resid = csio->resid; if (csio->resid > 0) bp->bio_flags |= BIO_ERROR; + if (softc->error_inject != 0) { + bp->bio_error = softc->error_inject; + bp->bio_resid = bp->bio_bcount; + bp->bio_flags |= BIO_ERROR; + softc->error_inject = 0; + } + } /* @@ -1760,13 +1769,20 @@ dadone(struct cam_periph *periph, union } free(csio->data_ptr, M_SCSIDA); if (announce_buf[0] != '\0') { - xpt_announce_periph(periph, announce_buf); /* * Create our sysctl variables, now that we know * we have successfully attached. */ - (void) cam_periph_acquire(periph); /* increase the refcount */ - taskqueue_enqueue(taskqueue_thread,&softc->sysctl_task); + /* increase the refcount */ + if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + taskqueue_enqueue(taskqueue_thread, + &softc->sysctl_task); + xpt_announce_periph(periph, announce_buf); + } else { + xpt_print(periph->path, "fatal error, " + "could not acquire reference count\n"); + } + } softc->state = DA_STATE_NORMAL; /* Modified: stable/8/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_sg.c Tue Jan 31 23:04:58 2012 (r230849) +++ stable/8/sys/cam/scsi/scsi_sg.c Tue Jan 31 23:09:27 2012 (r230850) @@ -399,18 +399,24 @@ sgopen(struct cdev *dev, int flags, int if (periph == NULL) return (ENXIO); + if (cam_periph_acquire(periph) != CAM_REQ_CMP) + return (ENXIO); + /* * Don't allow access when we're running at a high securelevel. */ error = securelevel_gt(td->td_ucred, 1); - if (error) + if (error) { + cam_periph_release(periph); return (error); + } cam_periph_lock(periph); softc = (struct sg_softc *)periph->softc; if (softc->flags & SG_FLAG_INVALID) { cam_periph_unlock(periph); + cam_periph_release(periph); return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 23:20:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1E681065672; Tue, 31 Jan 2012 23:20:14 +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 903AA8FC0A; Tue, 31 Jan 2012 23:20:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VNKEcB059799; Tue, 31 Jan 2012 23:20:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VNKEqC059797; Tue, 31 Jan 2012 23:20:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201312320.q0VNKEqC059797@svn.freebsd.org> From: Marius Strobl Date: Tue, 31 Jan 2012 23:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230851 - stable/8/sys/sun4v/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 23:20:14 -0000 Author: marius Date: Tue Jan 31 23:20:14 2012 New Revision: 230851 URL: http://svn.freebsd.org/changeset/base/230851 Log: Add more sparc64 compatibility macros for the shared loader. This is a direct commit to stable/8 in order to unbreak the build with r224370 in place. Modified: stable/8/sys/sun4v/include/tlb.h Modified: stable/8/sys/sun4v/include/tlb.h ============================================================================== --- stable/8/sys/sun4v/include/tlb.h Tue Jan 31 23:09:27 2012 (r230850) +++ stable/8/sys/sun4v/include/tlb.h Tue Jan 31 23:20:14 2012 (r230851) @@ -43,7 +43,20 @@ (TD_V | TD_4M | (TLB_DIRECT_ADDRESS_MASK - TLB_DIRECT_PAGE_MASK)) #define TLB_DAR_SLOT_SHIFT (3) -#define TLB_DAR_SLOT(slot) ((slot) << TLB_DAR_SLOT_SHIFT) + +/* + * sparc64 compatibility for the loader + */ +#define TLB_DAR_TLB_SHIFT (16) +#define TLB_DAR_SLOT(tlb, slot) \ + ((tlb) << TLB_DAR_TLB_SHIFT | (slot) << TLB_DAR_SLOT_SHIFT) +#define TLB_DAR_T16 (0) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_T32 (0) /* US-I, II{,e,i} */ +#define TLB_DAR_DT512_0 (2) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_DT512_1 (3) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_IT128 (2) /* US-III{,i,+}, IV */ +#define TLB_DAR_IT512 (2) /* US-IV+ */ +#define TLB_DAR_FTLB (0) /* SPARC64 V, VI, VII, VIIIfx */ #define TAR_VPN_SHIFT (13) #define TAR_CTX_MASK ((1 << TAR_VPN_SHIFT) - 1) From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 23:20:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA77A1065670; Tue, 31 Jan 2012 23:20:17 +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 B8A988FC12; Tue, 31 Jan 2012 23:20:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VNKHHe059836; Tue, 31 Jan 2012 23:20:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VNKHw8059834; Tue, 31 Jan 2012 23:20:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201312320.q0VNKHw8059834@svn.freebsd.org> From: Marius Strobl Date: Tue, 31 Jan 2012 23:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230852 - stable/7/sys/sun4v/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 23:20:17 -0000 Author: marius Date: Tue Jan 31 23:20:17 2012 New Revision: 230852 URL: http://svn.freebsd.org/changeset/base/230852 Log: Add more sparc64 compatibility macros for the shared loader. This is a direct commit to stable/7 in order to unbreak the build with 224371 in place. Modified: stable/7/sys/sun4v/include/tlb.h Modified: stable/7/sys/sun4v/include/tlb.h ============================================================================== --- stable/7/sys/sun4v/include/tlb.h Tue Jan 31 23:20:14 2012 (r230851) +++ stable/7/sys/sun4v/include/tlb.h Tue Jan 31 23:20:17 2012 (r230852) @@ -43,7 +43,21 @@ (TD_V | TD_4M | (TLB_DIRECT_ADDRESS_MASK - TLB_DIRECT_PAGE_MASK)) #define TLB_DAR_SLOT_SHIFT (3) -#define TLB_DAR_SLOT(slot) ((slot) << TLB_DAR_SLOT_SHIFT) + +/* + * sparc64 compatibility for the loader + */ +#define TLB_DAR_TLB_SHIFT (16) +#define TLB_DAR_SLOT(tlb, slot) \ + ((tlb) << TLB_DAR_TLB_SHIFT | (slot) << TLB_DAR_SLOT_SHIFT) +#define TLB_DAR_T16 (0) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_T32 (0) /* US-I, II{,e,i} */ +#define TLB_DAR_DT512_0 (2) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_DT512_1 (3) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_IT128 (2) /* US-III{,i,+}, IV */ +#define TLB_DAR_IT512 (2) /* US-IV+ */ +#define TLB_DAR_FTLB (0) /* SPARC64 V, VI, VII, VIIIfx */ +#define TLB_DAR_STLB (2) /* SPARC64 V, VI, VII, VIIIfx */ #define TAR_VPN_SHIFT (13) #define TAR_CTX_MASK ((1 << TAR_VPN_SHIFT) - 1) From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 23:24:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 924F7106566C; Tue, 31 Jan 2012 23:24:47 +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 2C67F8FC14; Tue, 31 Jan 2012 23:24:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0VNOlsE060008; Tue, 31 Jan 2012 23:24:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0VNOkZF060005; Tue, 31 Jan 2012 23:24:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201312324.q0VNOkZF060005@svn.freebsd.org> From: Marius Strobl Date: Tue, 31 Jan 2012 23:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230853 - in stable/8/sys: conf sun4v/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 23:24:47 -0000 Author: marius Date: Tue Jan 31 23:24:46 2012 New Revision: 230853 URL: http://svn.freebsd.org/changeset/base/230853 Log: - Hook up VTOC8 geometry adjustments. - Remove some unused externs. This is a direct commit to stable/8 in order to unbreak the build with r230666 in place. Modified: stable/8/sys/conf/files.sun4v stable/8/sys/sun4v/include/md_var.h Modified: stable/8/sys/conf/files.sun4v ============================================================================== --- stable/8/sys/conf/files.sun4v Tue Jan 31 23:20:17 2012 (r230852) +++ stable/8/sys/conf/files.sun4v Tue Jan 31 23:24:46 2012 (r230853) @@ -39,8 +39,10 @@ sparc64/ebus/ebus.c optional ebus sparc64/isa/isa.c optional isa sparc64/isa/isa_dma.c optional isa sparc64/isa/ofw_isa.c optional ebus | isa +sparc64/sparc64/ata_machdep.c optional ada | atadisk | da sparc64/sparc64/autoconf.c standard sun4v/sun4v/bus_machdep.c standard +sparc64/sparc64/cam_machdep.c optional scbus sun4v/sun4v/clock.c standard sparc64/sparc64/db_disasm.c optional ddb sun4v/sun4v/db_interface.c optional ddb Modified: stable/8/sys/sun4v/include/md_var.h ============================================================================== --- stable/8/sys/sun4v/include/md_var.h Tue Jan 31 23:20:17 2012 (r230852) +++ stable/8/sys/sun4v/include/md_var.h Tue Jan 31 23:24:46 2012 (r230853) @@ -54,10 +54,15 @@ struct md_utrap *utrap_alloc(void); void utrap_free(struct md_utrap *ut); struct md_utrap *utrap_hold(struct md_utrap *ut); - -extern cpu_block_copy_t *cpu_block_copy; -extern cpu_block_zero_t *cpu_block_zero; - - +/* + * Given that the VTOC8 disk label only uses 16-bit fields for cylinders, + * heads and sectors we might need to adjust the geometry of large disks. + */ +struct ccb_calc_geometry; +int scsi_da_bios_params(struct ccb_calc_geometry *ccg); +struct disk; +void sparc64_ata_disk_firmware_geom_adjust(struct disk *disk); +#define ata_disk_firmware_geom_adjust(disk) \ + sparc64_ata_disk_firmware_geom_adjust(disk) #endif /* !_MACHINE_MD_VAR_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 31 23:28:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A424D106566C; Tue, 31 Jan 2012 23:28:18 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 4F5578FC17; Tue, 31 Jan 2012 23:28:17 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q0VNSG6T066392; Wed, 1 Feb 2012 00:28:16 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q0VNSGJp066391; Wed, 1 Feb 2012 00:28:16 +0100 (CET) (envelope-from marius) Date: Wed, 1 Feb 2012 00:28:16 +0100 From: Marius Strobl To: John Baldwin Message-ID: <20120131232816.GL39861@alchemy.franken.de> References: <200906091426.n59EQNRC074046@svn.freebsd.org> <20120129154124.GB18227@alchemy.franken.de> <201201300932.06243.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201300932.06243.jhb@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: r193833 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2012 23:28:18 -0000 On Mon, Jan 30, 2012 at 09:32:06AM -0500, John Baldwin wrote: > On Sunday, January 29, 2012 10:41:24 am Marius Strobl wrote: > > On Tue, Jun 09, 2009 at 02:26:23PM +0000, John Baldwin wrote: > > > Author: jhb > > > Date: Tue Jun 9 14:26:23 2009 > > > New Revision: 193833 > > > URL: http://svn.freebsd.org/changeset/base/193833 > > > > > > Log: > > > Add support for multiple passes of the device tree during the boot-time > > > probe. The current device order is unchanged. This commit just adds the > > > infrastructure and ABI changes so that it is easier to merge later changes > > > into 8.x. > > > - Driver attachments now have an associated pass level. Attachments are > > > not allowed to probe or attach to drivers until the system-wide pass level > > > is >= the attachment's pass level. By default driver attachments use the > > > "last" pass level (BUS_PASS_DEFAULT). Driver's that wish to probe during > > > an earlier pass use EARLY_DRIVER_MODULE() instead of DRIVER_MODULE() which > > > accepts the pass level as an additional parameter. > > > - A new method BUS_NEW_PASS has been added to the bus interface. This > > > method is invoked when the system-wide pass level is changed to kick off > > > a rescan of the device tree so that drivers that have just been made > > > "eligible" can probe and attach. > > > - The bus_generic_new_pass() function provides a default implementation of > > > BUS_NEW_PASS(). It first allows drivers that were just made eligible for > > > this pass to identify new child devices. Then it propogates the rescan to > > > child devices that already have an attached driver by invoking their > > > BUS_NEW_PASS() method. It also reprobes devices without a driver. > > > - BUS_PROBE_NOMATCH() is only invoked for devices that do not have > > > an attached driver after being scanned during the final pass. > > > - The bus_set_pass() function is used during boot to raise the pass level. > > > Currently it is only called once during root_bus_configure() to raise > > > the pass level to BUS_PASS_DEFAULT. This has the effect of probing all > > > devices in a single pass identical to previous behavior. > > > > > > Reviewed by: imp > > > Approved by: re (kib) > > > > > > > What would be necessary to finally enable support for multi-pass > > probing apart from the drivers also needing to set BUS_PASS_n if > > they want to take part earlier than BUS_PASS_DEFAULT)? My > > understanding is that this is should be as simple as changing > > root_bus_configure() to return BUS_PASS_ROOT instead of > > BUS_PASS_DEFAULT but the comment above that line actually talks > > about splitting the return value (?) up somehow ... > > It will already work now without needing any changes. I have some older > patches to make x86 probe ACPI and PCI busses and bridges early and they > required no changes to the root bus. The reason for the comment is that I > eventually imagine the multiple passes being split up so that we can do other > actions after various passes are complete. For example, we might rewrite > root_bus_configure() so that it looks something like: > > void > root_bus_configure(void) > { > > /* Enumerate the device tree and reserve static resources. */ > bus_set_pass(BUS_PASS_RESOURCE); > > /* > * Now scan devices to allocate dynamic resources, possibly > * rewriting BARs, etc. > */ > /* some code that doesn't exist yet */ > > /* Now probe interrupt controllers. */ > bus_set_pass(BUS_PASS_INTERRUPT); > > /* Now kick off interrupt routing via some new bus method. */ > /* not written yet */ > > /* Finish probing everything else. */ > bus_set_pass(BUS_PASS_DEFAULT); > } > > This works because bus_set_pass() will do multiple scans of the tree, one > per configured pass level, to raise the system's pass level up to the > requested level. > Ah, great, thanks for the explanation! Marius From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 01:28:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7338D1065675; Wed, 1 Feb 2012 01:28:36 +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 61B0E8FC13; Wed, 1 Feb 2012 01:28:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q111SaTl063855; Wed, 1 Feb 2012 01:28:36 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q111SajD063853; Wed, 1 Feb 2012 01:28:36 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202010128.q111SajD063853@svn.freebsd.org> From: Ed Maste Date: Wed, 1 Feb 2012 01:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230854 - stable/8/usr.sbin/wpa/wpa_supplicant X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 01:28:36 -0000 Author: emaste Date: Wed Feb 1 01:28:35 2012 New Revision: 230854 URL: http://svn.freebsd.org/changeset/base/230854 Log: MFC r230293: Add missing line continuation \. It did not cause any issue because the same path is already being included in ../Makefile.inc. PR: 164192 Submitted by: Devin Teske Modified: stable/8/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/8/usr.sbin/wpa/wpa_supplicant/ (props changed) Modified: stable/8/usr.sbin/wpa/wpa_supplicant/Makefile ============================================================================== --- stable/8/usr.sbin/wpa/wpa_supplicant/Makefile Tue Jan 31 23:24:46 2012 (r230853) +++ stable/8/usr.sbin/wpa/wpa_supplicant/Makefile Wed Feb 1 01:28:35 2012 (r230854) @@ -5,7 +5,7 @@ .PATH.c:${WPA_SUPPLICANT_DISTDIR} \ ${WPA_DISTDIR}/src/drivers \ ${WPA_DISTDIR}/src/eap_peer \ - ${WPA_DISTDIR}/src/rsn_supp + ${WPA_DISTDIR}/src/rsn_supp \ PROG= wpa_supplicant SRCS= aes.c aes_wrap.c blacklist.c common.c config.c ctrl_iface.c \ From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 01:36:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE79F1065675; Wed, 1 Feb 2012 01:36:46 +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 DCE478FC14; Wed, 1 Feb 2012 01:36:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q111akeV064154; Wed, 1 Feb 2012 01:36:46 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q111akkQ064152; Wed, 1 Feb 2012 01:36:46 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202010136.q111akkQ064152@svn.freebsd.org> From: Ed Maste Date: Wed, 1 Feb 2012 01:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230855 - stable/8/usr.sbin/wpa/wpa_supplicant X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 01:36:47 -0000 Author: emaste Date: Wed Feb 1 01:36:46 2012 New Revision: 230855 URL: http://svn.freebsd.org/changeset/base/230855 Log: Revert r230854 as the change does not apply to stable/8. Modified: stable/8/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/8/usr.sbin/wpa/wpa_supplicant/ (props changed) Modified: stable/8/usr.sbin/wpa/wpa_supplicant/Makefile ============================================================================== --- stable/8/usr.sbin/wpa/wpa_supplicant/Makefile Wed Feb 1 01:28:35 2012 (r230854) +++ stable/8/usr.sbin/wpa/wpa_supplicant/Makefile Wed Feb 1 01:36:46 2012 (r230855) @@ -5,7 +5,7 @@ .PATH.c:${WPA_SUPPLICANT_DISTDIR} \ ${WPA_DISTDIR}/src/drivers \ ${WPA_DISTDIR}/src/eap_peer \ - ${WPA_DISTDIR}/src/rsn_supp \ + ${WPA_DISTDIR}/src/rsn_supp PROG= wpa_supplicant SRCS= aes.c aes_wrap.c blacklist.c common.c config.c ctrl_iface.c \ From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 02:53:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4094106564A; Wed, 1 Feb 2012 02:53:06 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92D928FC15; Wed, 1 Feb 2012 02:53:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q112r6JL066694; Wed, 1 Feb 2012 02:53:06 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q112r6nl066691; Wed, 1 Feb 2012 02:53:06 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201202010253.q112r6nl066691@svn.freebsd.org> From: David Xu Date: Wed, 1 Feb 2012 02:53: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: r230857 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 02:53:06 -0000 Author: davidxu Date: Wed Feb 1 02:53:06 2012 New Revision: 230857 URL: http://svn.freebsd.org/changeset/base/230857 Log: If multiple threads call kevent() to get AIO events on same kqueue fd, it is possible that a single AIO event will be reported to multiple threads, it is not threading friendly, and the existing API can not control this behavior. Allocate a kevent flags field sigev_notify_kevent_flags for AIO event notification in sigevent, and allow user to pass EV_CLEAR, EV_DISPATCH or EV_ONESHOT to AIO kernel code, user can control whether the event should be cleared once it is retrieved by a thread. This change should be comptaible with existing application, because the field should have already been zero-filled, and no additional action will be taken by kernel. PR: kern/156567 Modified: head/sys/kern/vfs_aio.c head/sys/sys/signal.h Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Wed Feb 1 02:16:15 2012 (r230856) +++ head/sys/kern/vfs_aio.c Wed Feb 1 02:53:06 2012 (r230857) @@ -1524,6 +1524,7 @@ aio_aqueue(struct thread *td, struct aio int error; int fd, kqfd; int jid; + u_short evflags; if (p->p_aioinfo == NULL) aio_init_aioinfo(p); @@ -1646,10 +1647,15 @@ aio_aqueue(struct thread *td, struct aio if (aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_KEVENT) goto no_kqueue; + evflags = aiocbe->uaiocb.aio_sigevent.sigev_notify_kevent_flags; + if ((evflags & ~(EV_CLEAR | EV_DISPATCH | EV_ONESHOT)) != 0) { + error = EINVAL; + goto aqueue_fail; + } kqfd = aiocbe->uaiocb.aio_sigevent.sigev_notify_kqueue; kev.ident = (uintptr_t)aiocbe->uuaiocb; kev.filter = EVFILT_AIO; - kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1; + kev.flags = EV_ADD | EV_ENABLE | EV_FLAG1 | evflags; kev.data = (intptr_t)aiocbe; kev.udata = aiocbe->uaiocb.aio_sigevent.sigev_value.sival_ptr; error = kqfd_register(kqfd, &kev, td, 1); Modified: head/sys/sys/signal.h ============================================================================== --- head/sys/sys/signal.h Wed Feb 1 02:16:15 2012 (r230856) +++ head/sys/sys/signal.h Wed Feb 1 02:53:06 2012 (r230857) @@ -169,12 +169,14 @@ struct sigevent { void (*_function)(union sigval); void *_attribute; /* pthread_attr_t * */ } _sigev_thread; + unsigned short _kevent_flags; long __spare__[8]; } _sigev_un; }; #if __BSD_VISIBLE #define sigev_notify_kqueue sigev_signo +#define sigev_notify_kevent_flags _sigev_un._kevent_flags #define sigev_notify_thread_id _sigev_un._threadid #endif #define sigev_notify_function _sigev_un._sigev_thread._function From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 03:28:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3339106566B; Wed, 1 Feb 2012 03:28:19 +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 CD71B8FC08; Wed, 1 Feb 2012 03:28:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q113SJxT068190; Wed, 1 Feb 2012 03:28:19 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q113SJth068188; Wed, 1 Feb 2012 03:28:19 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202010328.q113SJth068188@svn.freebsd.org> From: Ed Maste Date: Wed, 1 Feb 2012 03:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230858 - stable/9/usr.sbin/wpa/wpa_supplicant X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 03:28:20 -0000 Author: emaste Date: Wed Feb 1 03:28:19 2012 New Revision: 230858 URL: http://svn.freebsd.org/changeset/base/230858 Log: MFC r230293: Add missing line continuation \. It did not cause any issue because the same path is already being included in ../Makefile.inc. PR: 164192 Submitted by: Devin Teske Modified: stable/9/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/9/usr.sbin/wpa/wpa_supplicant/ (props changed) Modified: stable/9/usr.sbin/wpa/wpa_supplicant/Makefile ============================================================================== --- stable/9/usr.sbin/wpa/wpa_supplicant/Makefile Wed Feb 1 02:53:06 2012 (r230857) +++ stable/9/usr.sbin/wpa/wpa_supplicant/Makefile Wed Feb 1 03:28:19 2012 (r230858) @@ -5,7 +5,7 @@ .PATH.c:${WPA_SUPPLICANT_DISTDIR} \ ${WPA_DISTDIR}/src/drivers \ ${WPA_DISTDIR}/src/eap_peer \ - ${WPA_DISTDIR}/src/rsn_supp + ${WPA_DISTDIR}/src/rsn_supp \ ${WPA_DISTDIR}/src/crypto PROG= wpa_supplicant From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 03:42:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80ACE1065675; Wed, 1 Feb 2012 03:42:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B6D08FC12; Wed, 1 Feb 2012 03:42:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q113gFSY068641; Wed, 1 Feb 2012 03:42:15 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q113gFnu068639; Wed, 1 Feb 2012 03:42:15 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201202010342.q113gFnu068639@svn.freebsd.org> From: Justin Hibbits Date: Wed, 1 Feb 2012 03:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230859 - head/sys/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 03:42:15 -0000 Author: jhibbits Date: Wed Feb 1 03:42:14 2012 New Revision: 230859 URL: http://svn.freebsd.org/changeset/base/230859 Log: Enable the pccard/cardbus modules for powerpc. Approved by: nwhitehorn (mentor) Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Feb 1 03:28:19 2012 (r230858) +++ head/sys/modules/Makefile Wed Feb 1 03:42:14 2012 (r230859) @@ -707,9 +707,12 @@ _xe= xe _agp= agp _an= an _bm= bm +_cardbus= cardbus +_cbb= cbb _cfi= cfi _cpufreq= cpufreq _nvram= powermac_nvram +_pccard= pccard _smbfs= smbfs _sound= sound .endif From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 09:28:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47764106566B; Wed, 1 Feb 2012 09:28:17 +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 31E888FC08; Wed, 1 Feb 2012 09:28:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q119SHxE079160; Wed, 1 Feb 2012 09:28:17 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q119SH9U079158; Wed, 1 Feb 2012 09:28:17 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202010928.q119SH9U079158@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 1 Feb 2012 09:28: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: r230861 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 09:28:17 -0000 Author: ae Date: Wed Feb 1 09:28:16 2012 New Revision: 230861 URL: http://svn.freebsd.org/changeset/base/230861 Log: The scheme code may not know about some inconsistency in the metadata. So, add an integrity check after recovery attempt. MFC after: 1 week Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed Feb 1 03:49:56 2012 (r230860) +++ head/sys/geom/part/g_part.c Wed Feb 1 09:28:16 2012 (r230861) @@ -1216,6 +1216,9 @@ g_part_ctl_recover(struct gctl_req *req, if (table->gpt_corrupt) { error = G_PART_RECOVER(table); + if (error == 0) + error = g_part_check_integrity(table, + LIST_FIRST(&gp->consumer)); if (error) { gctl_error(req, "%d recovering '%s' failed", error, gp->name); From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 10:59:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FA191065670; Wed, 1 Feb 2012 10:59:21 +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 081E08FC0C; Wed, 1 Feb 2012 10:59:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11AxLxE084143; Wed, 1 Feb 2012 10:59:21 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11AxJN8084040; Wed, 1 Feb 2012 10:59:19 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201202011059.q11AxJN8084040@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 1 Feb 2012 10:59: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: r230862 - head/tools/kerneldoc/subsys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 10:59:21 -0000 Author: netchild Date: Wed Feb 1 10:59:19 2012 New Revision: 230862 URL: http://svn.freebsd.org/changeset/base/230862 Log: - remove non-existent input directories from the configs - add the target-arch to the project name where applicable (arch dependend code) - fix comment for __FreeBSD__ [1] Noticed by: bz [1] Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_aac head/tools/kerneldoc/subsys/Doxyfile-dev_acpi_support head/tools/kerneldoc/subsys/Doxyfile-dev_acpica head/tools/kerneldoc/subsys/Doxyfile-dev_adb head/tools/kerneldoc/subsys/Doxyfile-dev_adlink head/tools/kerneldoc/subsys/Doxyfile-dev_advansys head/tools/kerneldoc/subsys/Doxyfile-dev_ae head/tools/kerneldoc/subsys/Doxyfile-dev_age head/tools/kerneldoc/subsys/Doxyfile-dev_agp head/tools/kerneldoc/subsys/Doxyfile-dev_aha head/tools/kerneldoc/subsys/Doxyfile-dev_ahb head/tools/kerneldoc/subsys/Doxyfile-dev_ahci head/tools/kerneldoc/subsys/Doxyfile-dev_aic head/tools/kerneldoc/subsys/Doxyfile-dev_aic7xxx head/tools/kerneldoc/subsys/Doxyfile-dev_alc head/tools/kerneldoc/subsys/Doxyfile-dev_ale head/tools/kerneldoc/subsys/Doxyfile-dev_amdsbwd head/tools/kerneldoc/subsys/Doxyfile-dev_amdtemp head/tools/kerneldoc/subsys/Doxyfile-dev_amr head/tools/kerneldoc/subsys/Doxyfile-dev_an head/tools/kerneldoc/subsys/Doxyfile-dev_arcmsr head/tools/kerneldoc/subsys/Doxyfile-dev_asmc head/tools/kerneldoc/subsys/Doxyfile-dev_asr head/tools/kerneldoc/subsys/Doxyfile-dev_ata head/tools/kerneldoc/subsys/Doxyfile-dev_ath head/tools/kerneldoc/subsys/Doxyfile-dev_atkbdc head/tools/kerneldoc/subsys/Doxyfile-dev_auxio head/tools/kerneldoc/subsys/Doxyfile-dev_bce head/tools/kerneldoc/subsys/Doxyfile-dev_bfe head/tools/kerneldoc/subsys/Doxyfile-dev_bge head/tools/kerneldoc/subsys/Doxyfile-dev_bktr head/tools/kerneldoc/subsys/Doxyfile-dev_bm head/tools/kerneldoc/subsys/Doxyfile-dev_buslogic head/tools/kerneldoc/subsys/Doxyfile-dev_bwi head/tools/kerneldoc/subsys/Doxyfile-dev_bwn head/tools/kerneldoc/subsys/Doxyfile-dev_bxe head/tools/kerneldoc/subsys/Doxyfile-dev_cardbus head/tools/kerneldoc/subsys/Doxyfile-dev_cas head/tools/kerneldoc/subsys/Doxyfile-dev_ce head/tools/kerneldoc/subsys/Doxyfile-dev_cesa head/tools/kerneldoc/subsys/Doxyfile-dev_cfe head/tools/kerneldoc/subsys/Doxyfile-dev_cfi head/tools/kerneldoc/subsys/Doxyfile-dev_ciss head/tools/kerneldoc/subsys/Doxyfile-dev_cm head/tools/kerneldoc/subsys/Doxyfile-dev_cmx head/tools/kerneldoc/subsys/Doxyfile-dev_coretemp head/tools/kerneldoc/subsys/Doxyfile-dev_cp head/tools/kerneldoc/subsys/Doxyfile-dev_cpuctl head/tools/kerneldoc/subsys/Doxyfile-dev_cpufreq head/tools/kerneldoc/subsys/Doxyfile-dev_cs head/tools/kerneldoc/subsys/Doxyfile-dev_ct head/tools/kerneldoc/subsys/Doxyfile-dev_ctau head/tools/kerneldoc/subsys/Doxyfile-dev_cx head/tools/kerneldoc/subsys/Doxyfile-dev_cxgb head/tools/kerneldoc/subsys/Doxyfile-dev_cxgbe head/tools/kerneldoc/subsys/Doxyfile-dev_cy head/tools/kerneldoc/subsys/Doxyfile-dev_dc head/tools/kerneldoc/subsys/Doxyfile-dev_dcons head/tools/kerneldoc/subsys/Doxyfile-dev_de head/tools/kerneldoc/subsys/Doxyfile-dev_digi head/tools/kerneldoc/subsys/Doxyfile-dev_dpms head/tools/kerneldoc/subsys/Doxyfile-dev_dpt head/tools/kerneldoc/subsys/Doxyfile-dev_drm head/tools/kerneldoc/subsys/Doxyfile-dev_e1000 head/tools/kerneldoc/subsys/Doxyfile-dev_ed head/tools/kerneldoc/subsys/Doxyfile-dev_eisa head/tools/kerneldoc/subsys/Doxyfile-dev_en head/tools/kerneldoc/subsys/Doxyfile-dev_ep head/tools/kerneldoc/subsys/Doxyfile-dev_esp head/tools/kerneldoc/subsys/Doxyfile-dev_et head/tools/kerneldoc/subsys/Doxyfile-dev_ex head/tools/kerneldoc/subsys/Doxyfile-dev_exca head/tools/kerneldoc/subsys/Doxyfile-dev_fatm head/tools/kerneldoc/subsys/Doxyfile-dev_fb head/tools/kerneldoc/subsys/Doxyfile-dev_fdc head/tools/kerneldoc/subsys/Doxyfile-dev_fdt head/tools/kerneldoc/subsys/Doxyfile-dev_fe head/tools/kerneldoc/subsys/Doxyfile-dev_firewire head/tools/kerneldoc/subsys/Doxyfile-dev_flash head/tools/kerneldoc/subsys/Doxyfile-dev_fxp head/tools/kerneldoc/subsys/Doxyfile-dev_gem head/tools/kerneldoc/subsys/Doxyfile-dev_glxiic head/tools/kerneldoc/subsys/Doxyfile-dev_glxsb head/tools/kerneldoc/subsys/Doxyfile-dev_gpio head/tools/kerneldoc/subsys/Doxyfile-dev_hatm head/tools/kerneldoc/subsys/Doxyfile-dev_hifn head/tools/kerneldoc/subsys/Doxyfile-dev_hme head/tools/kerneldoc/subsys/Doxyfile-dev_hpt27xx head/tools/kerneldoc/subsys/Doxyfile-dev_hptiop head/tools/kerneldoc/subsys/Doxyfile-dev_hptmv head/tools/kerneldoc/subsys/Doxyfile-dev_hptrr head/tools/kerneldoc/subsys/Doxyfile-dev_hwpmc head/tools/kerneldoc/subsys/Doxyfile-dev_ic head/tools/kerneldoc/subsys/Doxyfile-dev_ichsmb head/tools/kerneldoc/subsys/Doxyfile-dev_ichwd head/tools/kerneldoc/subsys/Doxyfile-dev_ida head/tools/kerneldoc/subsys/Doxyfile-dev_ie head/tools/kerneldoc/subsys/Doxyfile-dev_ieee488 head/tools/kerneldoc/subsys/Doxyfile-dev_if_ndis head/tools/kerneldoc/subsys/Doxyfile-dev_iicbus head/tools/kerneldoc/subsys/Doxyfile-dev_iir head/tools/kerneldoc/subsys/Doxyfile-dev_io head/tools/kerneldoc/subsys/Doxyfile-dev_ipmi head/tools/kerneldoc/subsys/Doxyfile-dev_ips head/tools/kerneldoc/subsys/Doxyfile-dev_ipw head/tools/kerneldoc/subsys/Doxyfile-dev_iscsi head/tools/kerneldoc/subsys/Doxyfile-dev_isp head/tools/kerneldoc/subsys/Doxyfile-dev_ispfw head/tools/kerneldoc/subsys/Doxyfile-dev_iwi head/tools/kerneldoc/subsys/Doxyfile-dev_iwn head/tools/kerneldoc/subsys/Doxyfile-dev_ixgb head/tools/kerneldoc/subsys/Doxyfile-dev_ixgbe head/tools/kerneldoc/subsys/Doxyfile-dev_jme head/tools/kerneldoc/subsys/Doxyfile-dev_joy head/tools/kerneldoc/subsys/Doxyfile-dev_kbd head/tools/kerneldoc/subsys/Doxyfile-dev_kbdmux head/tools/kerneldoc/subsys/Doxyfile-dev_ksyms head/tools/kerneldoc/subsys/Doxyfile-dev_le head/tools/kerneldoc/subsys/Doxyfile-dev_led head/tools/kerneldoc/subsys/Doxyfile-dev_lge head/tools/kerneldoc/subsys/Doxyfile-dev_lindev head/tools/kerneldoc/subsys/Doxyfile-dev_lmc head/tools/kerneldoc/subsys/Doxyfile-dev_malo head/tools/kerneldoc/subsys/Doxyfile-dev_mc146818 head/tools/kerneldoc/subsys/Doxyfile-dev_mca head/tools/kerneldoc/subsys/Doxyfile-dev_mcd head/tools/kerneldoc/subsys/Doxyfile-dev_md head/tools/kerneldoc/subsys/Doxyfile-dev_mem head/tools/kerneldoc/subsys/Doxyfile-dev_mfi head/tools/kerneldoc/subsys/Doxyfile-dev_mge head/tools/kerneldoc/subsys/Doxyfile-dev_mii head/tools/kerneldoc/subsys/Doxyfile-dev_mk48txx head/tools/kerneldoc/subsys/Doxyfile-dev_mly head/tools/kerneldoc/subsys/Doxyfile-dev_mmc head/tools/kerneldoc/subsys/Doxyfile-dev_mn head/tools/kerneldoc/subsys/Doxyfile-dev_mps head/tools/kerneldoc/subsys/Doxyfile-dev_mpt head/tools/kerneldoc/subsys/Doxyfile-dev_mse head/tools/kerneldoc/subsys/Doxyfile-dev_msk head/tools/kerneldoc/subsys/Doxyfile-dev_mvs head/tools/kerneldoc/subsys/Doxyfile-dev_mwl head/tools/kerneldoc/subsys/Doxyfile-dev_mxge head/tools/kerneldoc/subsys/Doxyfile-dev_my head/tools/kerneldoc/subsys/Doxyfile-dev_ncv head/tools/kerneldoc/subsys/Doxyfile-dev_netmap head/tools/kerneldoc/subsys/Doxyfile-dev_nfe head/tools/kerneldoc/subsys/Doxyfile-dev_nge head/tools/kerneldoc/subsys/Doxyfile-dev_nmdm head/tools/kerneldoc/subsys/Doxyfile-dev_nsp head/tools/kerneldoc/subsys/Doxyfile-dev_null head/tools/kerneldoc/subsys/Doxyfile-dev_nve head/tools/kerneldoc/subsys/Doxyfile-dev_nvram head/tools/kerneldoc/subsys/Doxyfile-dev_nvram2env head/tools/kerneldoc/subsys/Doxyfile-dev_nxge head/tools/kerneldoc/subsys/Doxyfile-dev_ofw head/tools/kerneldoc/subsys/Doxyfile-dev_patm head/tools/kerneldoc/subsys/Doxyfile-dev_pbio head/tools/kerneldoc/subsys/Doxyfile-dev_pccard head/tools/kerneldoc/subsys/Doxyfile-dev_pccbb head/tools/kerneldoc/subsys/Doxyfile-dev_pcf head/tools/kerneldoc/subsys/Doxyfile-dev_pcn head/tools/kerneldoc/subsys/Doxyfile-dev_pdq head/tools/kerneldoc/subsys/Doxyfile-dev_powermac_nvram head/tools/kerneldoc/subsys/Doxyfile-dev_ppbus head/tools/kerneldoc/subsys/Doxyfile-dev_ppc head/tools/kerneldoc/subsys/Doxyfile-dev_pst head/tools/kerneldoc/subsys/Doxyfile-dev_pty head/tools/kerneldoc/subsys/Doxyfile-dev_puc head/tools/kerneldoc/subsys/Doxyfile-dev_qlxgb head/tools/kerneldoc/subsys/Doxyfile-dev_quicc head/tools/kerneldoc/subsys/Doxyfile-dev_ral head/tools/kerneldoc/subsys/Doxyfile-dev_random head/tools/kerneldoc/subsys/Doxyfile-dev_rc head/tools/kerneldoc/subsys/Doxyfile-dev_re head/tools/kerneldoc/subsys/Doxyfile-dev_rndtest head/tools/kerneldoc/subsys/Doxyfile-dev_rp head/tools/kerneldoc/subsys/Doxyfile-dev_rt head/tools/kerneldoc/subsys/Doxyfile-dev_safe head/tools/kerneldoc/subsys/Doxyfile-dev_sbni head/tools/kerneldoc/subsys/Doxyfile-dev_scc head/tools/kerneldoc/subsys/Doxyfile-dev_scd head/tools/kerneldoc/subsys/Doxyfile-dev_sdhci head/tools/kerneldoc/subsys/Doxyfile-dev_sec head/tools/kerneldoc/subsys/Doxyfile-dev_sf head/tools/kerneldoc/subsys/Doxyfile-dev_sfxge head/tools/kerneldoc/subsys/Doxyfile-dev_sge head/tools/kerneldoc/subsys/Doxyfile-dev_si head/tools/kerneldoc/subsys/Doxyfile-dev_siba head/tools/kerneldoc/subsys/Doxyfile-dev_siis head/tools/kerneldoc/subsys/Doxyfile-dev_sio head/tools/kerneldoc/subsys/Doxyfile-dev_sis head/tools/kerneldoc/subsys/Doxyfile-dev_sk head/tools/kerneldoc/subsys/Doxyfile-dev_smbus head/tools/kerneldoc/subsys/Doxyfile-dev_smc head/tools/kerneldoc/subsys/Doxyfile-dev_sn head/tools/kerneldoc/subsys/Doxyfile-dev_snc head/tools/kerneldoc/subsys/Doxyfile-dev_snp head/tools/kerneldoc/subsys/Doxyfile-dev_speaker head/tools/kerneldoc/subsys/Doxyfile-dev_spibus head/tools/kerneldoc/subsys/Doxyfile-dev_ste head/tools/kerneldoc/subsys/Doxyfile-dev_stg head/tools/kerneldoc/subsys/Doxyfile-dev_stge head/tools/kerneldoc/subsys/Doxyfile-dev_streams head/tools/kerneldoc/subsys/Doxyfile-dev_sym head/tools/kerneldoc/subsys/Doxyfile-dev_syscons head/tools/kerneldoc/subsys/Doxyfile-dev_tdfx head/tools/kerneldoc/subsys/Doxyfile-dev_ti head/tools/kerneldoc/subsys/Doxyfile-dev_tl head/tools/kerneldoc/subsys/Doxyfile-dev_tpm head/tools/kerneldoc/subsys/Doxyfile-dev_trm head/tools/kerneldoc/subsys/Doxyfile-dev_tsec head/tools/kerneldoc/subsys/Doxyfile-dev_twa head/tools/kerneldoc/subsys/Doxyfile-dev_twe head/tools/kerneldoc/subsys/Doxyfile-dev_tws head/tools/kerneldoc/subsys/Doxyfile-dev_tx head/tools/kerneldoc/subsys/Doxyfile-dev_txp head/tools/kerneldoc/subsys/Doxyfile-dev_uart head/tools/kerneldoc/subsys/Doxyfile-dev_ubsec head/tools/kerneldoc/subsys/Doxyfile-dev_utopia head/tools/kerneldoc/subsys/Doxyfile-dev_vge head/tools/kerneldoc/subsys/Doxyfile-dev_viawd head/tools/kerneldoc/subsys/Doxyfile-dev_virtio head/tools/kerneldoc/subsys/Doxyfile-dev_vkbd head/tools/kerneldoc/subsys/Doxyfile-dev_vr head/tools/kerneldoc/subsys/Doxyfile-dev_vte head/tools/kerneldoc/subsys/Doxyfile-dev_vx head/tools/kerneldoc/subsys/Doxyfile-dev_vxge head/tools/kerneldoc/subsys/Doxyfile-dev_watchdog head/tools/kerneldoc/subsys/Doxyfile-dev_wb head/tools/kerneldoc/subsys/Doxyfile-dev_wds head/tools/kerneldoc/subsys/Doxyfile-dev_wi head/tools/kerneldoc/subsys/Doxyfile-dev_wl head/tools/kerneldoc/subsys/Doxyfile-dev_wpi head/tools/kerneldoc/subsys/Doxyfile-dev_wtap head/tools/kerneldoc/subsys/Doxyfile-dev_xe head/tools/kerneldoc/subsys/Doxyfile-dev_xen head/tools/kerneldoc/subsys/Doxyfile-dev_xl head/tools/kerneldoc/subsys/common-Doxyfile Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_aac ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_aac Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_aac Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/aac/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/aac/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_aac/dev_aac.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_acpi_support ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_acpi_support Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_acpi_support Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/acpi_support/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/acpi_support/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_acpi_support/dev_acpi_support.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_acpica ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_acpica Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_acpica Wed Feb 1 10:59:19 2012 (r230862) @@ -5,7 +5,7 @@ #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- -PROJECT_NAME = "FreeBSD kernel ACPICA device code" +PROJECT_NAME = "FreeBSD kernel $(DOXYGEN_TARGET_ARCH) ACPICA device code" OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_acpica/ EXTRACT_ALL = YES # for undocumented src, no warnings enabled #--------------------------------------------------------------------------- Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_adb ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_adb Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_adb Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/adb/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/adb/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_adb/dev_adb.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_adlink ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_adlink Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_adlink Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/adlink/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/adlink/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_adlink/dev_adlink.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_advansys ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_advansys Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_advansys Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/advansys/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/advansys/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_advansys/dev_advansys.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ae ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ae Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ae Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ae/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ae/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ae/dev_ae.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_age ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_age Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_age Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/age/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/age/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_age/dev_age.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_agp ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_agp Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_agp Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/agp/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/agp/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_agp/dev_agp.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_aha ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_aha Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_aha Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/aha/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/aha/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_aha/dev_aha.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ahb ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ahb Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ahb Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ahb/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ahb/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ahb/dev_ahb.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ahci ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ahci Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ahci Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ahci/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ahci/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ahci/dev_ahci.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_aic ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_aic Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_aic Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/aic/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/aic/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_aic/dev_aic.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_aic7xxx ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_aic7xxx Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_aic7xxx Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/aic7xxx/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/aic7xxx/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_aic7xxx/dev_aic7xxx.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_alc ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_alc Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_alc Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/alc/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/alc/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_alc/dev_alc.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ale ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ale Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ale Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ale/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ale/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ale/dev_ale.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_amdsbwd ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_amdsbwd Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amdsbwd Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/amdsbwd/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/amdsbwd/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_amdsbwd/dev_amdsbwd.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_amdtemp ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_amdtemp Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amdtemp Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/amdtemp/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/amdtemp/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_amdtemp/dev_amdtemp.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_amr ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_amr Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amr Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/amr/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/amr/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_amr/dev_amr.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_an ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_an Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_an Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/an/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/an/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_an/dev_an.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_arcmsr ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_arcmsr Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_arcmsr Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/arcmsr/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/arcmsr/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_arcmsr/dev_arcmsr.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_asmc ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_asmc Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_asmc Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/asmc/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/asmc/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_asmc/dev_asmc.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_asr ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_asr Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_asr Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/asr/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/asr/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_asr/dev_asr.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ata ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ata Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ata Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ata/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ata/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ata/dev_ata.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ath ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ath Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ath Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ath/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ath/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ath/dev_ath.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_atkbdc ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_atkbdc Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_atkbdc Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/atkbdc/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/atkbdc/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_atkbdc/dev_atkbdc.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_auxio ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_auxio Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_auxio Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/auxio/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/auxio/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_auxio/dev_auxio.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_bce ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_bce Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bce Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/bce/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bce/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_bce/dev_bce.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_bfe ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_bfe Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bfe Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/bfe/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bfe/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_bfe/dev_bfe.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_bge ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_bge Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bge Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/bge/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bge/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_bge/dev_bge.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_bktr ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_bktr Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bktr Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/bktr/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bktr/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_bktr/dev_bktr.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_bm ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_bm Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bm Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/bm/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bm/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_bm/dev_bm.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_buslogic ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_buslogic Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_buslogic Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/buslogic/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/buslogic/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_buslogic/dev_buslogic.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_bwi ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_bwi Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bwi Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/bwi/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bwi/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_bwi/dev_bwi.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_bwn ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_bwn Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bwn Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/bwn/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bwn/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_bwn/dev_bwn.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_bxe ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_bxe Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bxe Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/bxe/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bxe/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_bxe/dev_bxe.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cardbus ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cardbus Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cardbus Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cardbus/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cardbus/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cardbus/dev_cardbus.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cas ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cas Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cas Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cas/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cas/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cas/dev_cas.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ce ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ce Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ce Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ce/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ce/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ce/dev_ce.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cesa ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cesa Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cesa Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cesa/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cesa/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cesa/dev_cesa.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cfe ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cfe Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cfe Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cfe/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cfe/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cfe/dev_cfe.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cfi ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cfi Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cfi Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cfi/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cfi/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cfi/dev_cfi.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ciss ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ciss Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ciss Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ciss/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ciss/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ciss/dev_ciss.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cm ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cm Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cm Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cm/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cm/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cm/dev_cm.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cmx ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cmx Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cmx Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cmx/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cmx/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cmx/dev_cmx.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_coretemp ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_coretemp Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_coretemp Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/coretemp/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/coretemp/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_coretemp/dev_coretemp.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cp ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cp Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cp Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cp/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cp/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cp/dev_cp.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cpuctl ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cpuctl Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cpuctl Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cpuctl/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cpuctl/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cpuctl/dev_cpuctl.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cpufreq ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cpufreq Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cpufreq Wed Feb 1 10:59:19 2012 (r230862) @@ -5,7 +5,7 @@ #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- -PROJECT_NAME = "FreeBSD kernel CPUFREQ device code" +PROJECT_NAME = "FreeBSD kernel $(DOXYGEN_TARGET_ARCH) CPUFREQ device code" OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_cpufreq/ EXTRACT_ALL = YES # for undocumented src, no warnings enabled #--------------------------------------------------------------------------- Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cs ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cs Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cs Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cs/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cs/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cs/dev_cs.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ct ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ct Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ct Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ct/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ct/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ct/dev_ct.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ctau ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ctau Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ctau Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ctau/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ctau/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ctau/dev_ctau.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cx ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cx Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cx Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cx/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cx/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cx/dev_cx.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cxgb ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cxgb Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cxgb Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cxgb/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cxgb/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cxgb/dev_cxgb.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cxgbe ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cxgbe Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cxgbe Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cxgbe/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cxgbe/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cxgbe/dev_cxgbe.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_cy ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_cy Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cy Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/cy/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cy/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_cy/dev_cy.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_dc ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_dc Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_dc Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/dc/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/dc/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_dc/dev_dc.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_dcons ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_dcons Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_dcons Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/dcons/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/dcons/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_dcons/dev_dcons.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_de ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_de Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_de Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/de/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/de/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_de/dev_de.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_digi ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_digi Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_digi Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/digi/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/digi/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_digi/dev_digi.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_dpms ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_dpms Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_dpms Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/dpms/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/dpms/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_dpms/dev_dpms.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_dpt ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_dpt Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_dpt Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/dpt/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/dpt/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_dpt/dev_dpt.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_drm ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_drm Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_drm Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/drm/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/drm/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_drm/dev_drm.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_e1000 ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_e1000 Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_e1000 Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/e1000/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/e1000/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_e1000/dev_e1000.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ed ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ed Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ed Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ed/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ed/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ed/dev_ed.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_eisa ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_eisa Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_eisa Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/eisa/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/eisa/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_eisa/dev_eisa.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_en ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_en Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_en Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/en/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/en/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_en/dev_en.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ep ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ep Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ep Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ep/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ep/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ep/dev_ep.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_esp ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_esp Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_esp Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/esp/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/esp/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_esp/dev_esp.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_et ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_et Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_et Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/et/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/et/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_et/dev_et.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ex ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ex Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ex Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ex/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ex/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ex/dev_ex.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_exca ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_exca Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_exca Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/exca/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/exca/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_exca/dev_exca.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_fatm ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_fatm Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_fatm Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/fatm/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/fatm/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_fatm/dev_fatm.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_fb ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_fb Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_fb Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/fb/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/fb/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_fb/dev_fb.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_fdc ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_fdc Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_fdc Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/fdc/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/fdc/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_fdc/dev_fdc.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_fdt ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_fdt Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_fdt Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/fdt/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/fdt/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_fdt/dev_fdt.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_fe ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_fe Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_fe Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/fe/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/fe/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_fe/dev_fe.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_firewire ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_firewire Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_firewire Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/firewire/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/firewire/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_firewire/dev_firewire.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_flash ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_flash Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_flash Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/flash/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/flash/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_flash/dev_flash.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_fxp ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_fxp Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_fxp Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/fxp/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/fxp/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_fxp/dev_fxp.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_gem ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_gem Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_gem Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/gem/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/gem/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_gem/dev_gem.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_glxiic ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_glxiic Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_glxiic Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/glxiic/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/glxiic/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_glxiic/dev_glxiic.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_glxsb ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_glxsb Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_glxsb Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/glxsb/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/glxsb/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_glxsb/dev_glxsb.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_gpio ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_gpio Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_gpio Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/gpio/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/gpio/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_gpio/dev_gpio.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_hatm ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_hatm Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hatm Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/hatm/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/hatm/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_hatm/dev_hatm.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_hifn ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_hifn Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hifn Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/hifn/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/hifn/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_hifn/dev_hifn.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_hme ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_hme Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hme Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/hme/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/hme/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_hme/dev_hme.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_hpt27xx ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_hpt27xx Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hpt27xx Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/hpt27xx/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/hpt27xx/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_hpt27xx/dev_hpt27xx.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_hptiop ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_hptiop Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hptiop Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/hptiop/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/hptiop/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_hptiop/dev_hptiop.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_hptmv ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_hptmv Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hptmv Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/hptmv/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/hptmv/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_hptmv/dev_hptmv.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_hptrr ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_hptrr Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hptrr Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/hptrr/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/hptrr/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_hptrr/dev_hptrr.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_hwpmc ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_hwpmc Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hwpmc Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/hwpmc/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/hwpmc/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_hwpmc/dev_hwpmc.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ic ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ic Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ic Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ic/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ic/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ic/dev_ic.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ichsmb ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ichsmb Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ichsmb Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ichsmb/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ichsmb/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ichsmb/dev_ichsmb.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ichwd ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ichwd Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ichwd Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ichwd/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ichwd/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ichwd/dev_ichwd.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ida ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ida Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ida Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ida/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ida/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ida/dev_ida.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ie ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ie Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ie Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ie/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ie/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ie/dev_ie.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_ieee488 ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_ieee488 Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ieee488 Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/ieee488/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ieee488/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_ieee488/dev_ieee488.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_if_ndis ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_if_ndis Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_if_ndis Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/if_ndis/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/if_ndis/ \ $(NOTREVIEWED) GENERATE_TAGFILE = dev_if_ndis/dev_if_ndis.tag Modified: head/tools/kerneldoc/subsys/Doxyfile-dev_iicbus ============================================================================== --- head/tools/kerneldoc/subsys/Doxyfile-dev_iicbus Wed Feb 1 09:28:16 2012 (r230861) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_iicbus Wed Feb 1 10:59:19 2012 (r230862) @@ -12,7 +12,6 @@ EXTRACT_ALL = YES # for un # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = $(DOXYGEN_SRC_PATH)/dev/iicbus/ \ - $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/iicbus/ \ $(NOTREVIEWED) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 11:07:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4B56106566C; Wed, 1 Feb 2012 11:07:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4DF48FC0A; Wed, 1 Feb 2012 11:07:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11B7fCl084497; Wed, 1 Feb 2012 11:07:41 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11B7fV1084495; Wed, 1 Feb 2012 11:07:41 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202011107.q11B7fV1084495@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 1 Feb 2012 11:07: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: r230863 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 11:07:42 -0000 Author: glebius Date: Wed Feb 1 11:07:41 2012 New Revision: 230863 URL: http://svn.freebsd.org/changeset/base/230863 Log: o Provide functions carp_ifa_addroute()/carp_ifa_delroute() to cleanup routes from a single ifa. o Implement carp_addroute()/carp_delroute() via above functions. o Call carp_ifa_delroute() in the carp_detach() to avoid junk routes left in routing table, in case if user removes an address in a MASTER state. [1] Reported by: az [1] Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Wed Feb 1 10:59:19 2012 (r230862) +++ head/sys/netinet/ip_carp.c Wed Feb 1 11:07:41 2012 (r230863) @@ -269,7 +269,9 @@ static void carp_master_down_locked(stru static void carp_send_ad(void *); static void carp_send_ad_locked(struct carp_softc *); static void carp_addroute(struct carp_softc *); +static void carp_ifa_addroute(struct ifaddr *); static void carp_delroute(struct carp_softc *); +static void carp_ifa_delroute(struct ifaddr *); static void carp_send_ad_all(void *, int); static void carp_demote_adj(int, char *); @@ -907,22 +909,29 @@ carp_addroute(struct carp_softc *sc) struct ifaddr *ifa; CARP_FOREACH_IFA(sc, ifa) - switch (ifa->ifa_addr->sa_family) { + carp_ifa_addroute(ifa); +} + +static void +carp_ifa_addroute(struct ifaddr *ifa) +{ + + switch (ifa->ifa_addr->sa_family) { #ifdef INET - case AF_INET: - in_addprefix(ifatoia(ifa), RTF_UP); - ifa_add_loopback_route(ifa, - (struct sockaddr *)&ifatoia(ifa)->ia_addr); - break; + case AF_INET: + in_addprefix(ifatoia(ifa), RTF_UP); + ifa_add_loopback_route(ifa, + (struct sockaddr *)&ifatoia(ifa)->ia_addr); + break; #endif #ifdef INET6 - case AF_INET6: - ifa_add_loopback_route(ifa, - (struct sockaddr *)&ifatoia6(ifa)->ia_addr); - in6_ifaddloop(ifa); - break; + case AF_INET6: + ifa_add_loopback_route(ifa, + (struct sockaddr *)&ifatoia6(ifa)->ia_addr); + in6_ifaddloop(ifa); + break; #endif - } + } } static void @@ -931,22 +940,29 @@ carp_delroute(struct carp_softc *sc) struct ifaddr *ifa; CARP_FOREACH_IFA(sc, ifa) - switch (ifa->ifa_addr->sa_family) { + carp_ifa_delroute(ifa); +} + +static void +carp_ifa_delroute(struct ifaddr *ifa) +{ + + switch (ifa->ifa_addr->sa_family) { #ifdef INET - case AF_INET: - ifa_del_loopback_route(ifa, - (struct sockaddr *)&ifatoia(ifa)->ia_addr); - in_scrubprefix(ifatoia(ifa), LLE_STATIC); - break; + case AF_INET: + ifa_del_loopback_route(ifa, + (struct sockaddr *)&ifatoia(ifa)->ia_addr); + in_scrubprefix(ifatoia(ifa), LLE_STATIC); + break; #endif #ifdef INET6 - case AF_INET6: - ifa_del_loopback_route(ifa, - (struct sockaddr *)&ifatoia6(ifa)->ia_addr); - in6_ifremloop(ifa); - break; + case AF_INET6: + ifa_del_loopback_route(ifa, + (struct sockaddr *)&ifatoia6(ifa)->ia_addr); + in6_ifremloop(ifa); + break; #endif - } + } } #ifdef INET @@ -1856,6 +1872,7 @@ carp_detach(struct ifaddr *ifa) #endif } + carp_ifa_delroute(ifa); carp_multicast_cleanup(sc, ifa->ifa_addr->sa_family); ifa->ifa_carp = NULL; From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 13:33:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E80391065673; Wed, 1 Feb 2012 13:33:53 +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 C940C8FC1E; Wed, 1 Feb 2012 13:33:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11DXrBf089040; Wed, 1 Feb 2012 13:33:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11DXrlQ089030; Wed, 1 Feb 2012 13:33:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202011333.q11DXrlQ089030@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Feb 2012 13:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230864 - in head: lib/libc/amd64/gen lib/libc/arm/gen lib/libc/i386/gen lib/libc/ia64/gen lib/libc/mips/gen lib/libc/powerpc/gen lib/libc/powerpc64/gen lib/libc/sparc64/gen sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 13:33:54 -0000 Author: kib Date: Wed Feb 1 13:33:53 2012 New Revision: 230864 URL: http://svn.freebsd.org/changeset/base/230864 Log: Make the sys/ucontext.h self-contained by changing the return type of __getcontextx_size(3) from size_t to int. PR: ports/164654 MFC after: 1 month Modified: head/lib/libc/amd64/gen/getcontextx.c head/lib/libc/arm/gen/getcontextx.c head/lib/libc/i386/gen/getcontextx.c head/lib/libc/ia64/gen/getcontextx.c head/lib/libc/mips/gen/getcontextx.c head/lib/libc/powerpc/gen/getcontextx.c head/lib/libc/powerpc64/gen/getcontextx.c head/lib/libc/sparc64/gen/getcontextx.c head/sys/sys/ucontext.h Modified: head/lib/libc/amd64/gen/getcontextx.c ============================================================================== --- head/lib/libc/amd64/gen/getcontextx.c Wed Feb 1 11:07:41 2012 (r230863) +++ head/lib/libc/amd64/gen/getcontextx.c Wed Feb 1 13:33:53 2012 (r230864) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); static int xstate_sz = -1; -size_t +int __getcontextx_size(void) { u_int p[4]; Modified: head/lib/libc/arm/gen/getcontextx.c ============================================================================== --- head/lib/libc/arm/gen/getcontextx.c Wed Feb 1 11:07:41 2012 (r230863) +++ head/lib/libc/arm/gen/getcontextx.c Wed Feb 1 13:33:53 2012 (r230864) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include -size_t +int __getcontextx_size(void) { Modified: head/lib/libc/i386/gen/getcontextx.c ============================================================================== --- head/lib/libc/i386/gen/getcontextx.c Wed Feb 1 11:07:41 2012 (r230863) +++ head/lib/libc/i386/gen/getcontextx.c Wed Feb 1 13:33:53 2012 (r230864) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); static int xstate_sz = -1; -size_t +int __getcontextx_size(void) { u_int p[4]; Modified: head/lib/libc/ia64/gen/getcontextx.c ============================================================================== --- head/lib/libc/ia64/gen/getcontextx.c Wed Feb 1 11:07:41 2012 (r230863) +++ head/lib/libc/ia64/gen/getcontextx.c Wed Feb 1 13:33:53 2012 (r230864) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include -size_t +int __getcontextx_size(void) { Modified: head/lib/libc/mips/gen/getcontextx.c ============================================================================== --- head/lib/libc/mips/gen/getcontextx.c Wed Feb 1 11:07:41 2012 (r230863) +++ head/lib/libc/mips/gen/getcontextx.c Wed Feb 1 13:33:53 2012 (r230864) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include -size_t +int __getcontextx_size(void) { Modified: head/lib/libc/powerpc/gen/getcontextx.c ============================================================================== --- head/lib/libc/powerpc/gen/getcontextx.c Wed Feb 1 11:07:41 2012 (r230863) +++ head/lib/libc/powerpc/gen/getcontextx.c Wed Feb 1 13:33:53 2012 (r230864) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include -size_t +int __getcontextx_size(void) { Modified: head/lib/libc/powerpc64/gen/getcontextx.c ============================================================================== --- head/lib/libc/powerpc64/gen/getcontextx.c Wed Feb 1 11:07:41 2012 (r230863) +++ head/lib/libc/powerpc64/gen/getcontextx.c Wed Feb 1 13:33:53 2012 (r230864) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include -size_t +int __getcontextx_size(void) { Modified: head/lib/libc/sparc64/gen/getcontextx.c ============================================================================== --- head/lib/libc/sparc64/gen/getcontextx.c Wed Feb 1 11:07:41 2012 (r230863) +++ head/lib/libc/sparc64/gen/getcontextx.c Wed Feb 1 13:33:53 2012 (r230864) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include -size_t +int __getcontextx_size(void) { Modified: head/sys/sys/ucontext.h ============================================================================== --- head/sys/sys/ucontext.h Wed Feb 1 11:07:41 2012 (r230863) +++ head/sys/sys/ucontext.h Wed Feb 1 13:33:53 2012 (r230864) @@ -79,7 +79,7 @@ int signalcontext(ucontext_t *, int, __s int swapcontext(ucontext_t *, const ucontext_t *); #if __BSD_VISIBLE -size_t __getcontextx_size(void); +int __getcontextx_size(void); int __fillcontextx(char *ctx); #endif From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 13:39:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 511341065672; Wed, 1 Feb 2012 13:39: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 219498FC08; Wed, 1 Feb 2012 13:39:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11Ddr8w089248; Wed, 1 Feb 2012 13:39:53 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11DdrRY089245; Wed, 1 Feb 2012 13:39:53 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201202011339.q11DdrRY089245@svn.freebsd.org> From: Rafal Jaworowski Date: Wed, 1 Feb 2012 13:39: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: r230865 - head/sys/dev/mvs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 13:39:53 -0000 Author: raj Date: Wed Feb 1 13:39:52 2012 New Revision: 230865 URL: http://svn.freebsd.org/changeset/base/230865 Log: Adjust mvs(4) to handle interrupt cause reg depending on the actual number of channels available - current code treats bits 4:7 in 'SATAHC interrupt mask' and 'SATAHC interrupt cause' as flags for SATA channels 2 and 3 - for embedded SATA controllers (SoC) these bits have been marked as reserved in datasheets so far, but for some new and upcoming chips they are used for purposes other than SATA Submitted by: Lukasz Plachno Reviewed by: mav Obtained from: Semihalf MFC after: 2 weeks Modified: head/sys/dev/mvs/mvs.h head/sys/dev/mvs/mvs_soc.c Modified: head/sys/dev/mvs/mvs.h ============================================================================== --- head/sys/dev/mvs/mvs.h Wed Feb 1 13:33:53 2012 (r230864) +++ head/sys/dev/mvs/mvs.h Wed Feb 1 13:39:52 2012 (r230865) @@ -61,6 +61,9 @@ #define CHIP_SOC_LED 0x2C /* SoC LED Configuration */ +/* Additional mask for SoC devices with less than 4 channels */ +#define CHIP_SOC_HC0_MASK(num) (0xff >> ((4 - (num)) * 2)) + /* Chip CCC registers */ #define CHIP_ICC 0x18008 #define CHIP_ICC_ALL_PORTS (1 << 4) /* all ports irq event */ Modified: head/sys/dev/mvs/mvs_soc.c ============================================================================== --- head/sys/dev/mvs/mvs_soc.c Wed Feb 1 13:33:53 2012 (r230864) +++ head/sys/dev/mvs/mvs_soc.c Wed Feb 1 13:39:52 2012 (r230865) @@ -216,7 +216,9 @@ mvs_ctlr_setup(device_t dev) if (ccc) ccim |= IC_HC0_COAL_DONE; /* Enable chip interrupts */ - ctlr->gmim = (ccc ? IC_HC0_COAL_DONE : IC_DONE_HC0) | IC_ERR_HC0; + ctlr->gmim = ((ccc ? IC_HC0_COAL_DONE : + (IC_DONE_HC0 & CHIP_SOC_HC0_MASK(ctlr->channels))) | + (IC_ERR_HC0 & CHIP_SOC_HC0_MASK(ctlr->channels))); ATA_OUTL(ctlr->r_mem, CHIP_SOC_MIM, ctlr->gmim | ctlr->pmim); return (0); } @@ -291,25 +293,26 @@ mvs_intr(void *data) struct mvs_controller *ctlr = data; struct mvs_intr_arg arg; void (*function)(void *); - int p; + int p, chan_num; u_int32_t ic, aic; ic = ATA_INL(ctlr->r_mem, CHIP_SOC_MIC); if ((ic & IC_HC0) == 0) return; + /* Acknowledge interrupts of this HC. */ aic = 0; - if (ic & (IC_DONE_IRQ << 0)) - aic |= HC_IC_DONE(0) | HC_IC_DEV(0); - if (ic & (IC_DONE_IRQ << 2)) - aic |= HC_IC_DONE(1) | HC_IC_DEV(1); - if (ic & (IC_DONE_IRQ << 4)) - aic |= HC_IC_DONE(2) | HC_IC_DEV(2); - if (ic & (IC_DONE_IRQ << 6)) - aic |= HC_IC_DONE(3) | HC_IC_DEV(3); + + /* Processing interrupts from each initialized channel */ + for (chan_num = 0; chan_num < ctlr->channels; chan_num++) { + if (ic & (IC_DONE_IRQ << (chan_num * 2))) + aic |= HC_IC_DONE(chan_num) | HC_IC_DEV(chan_num); + } + if (ic & IC_HC0_COAL_DONE) aic |= HC_IC_COAL; ATA_OUTL(ctlr->r_mem, HC_IC, ~aic); + /* Call per-port interrupt handler. */ for (p = 0; p < ctlr->channels; p++) { arg.cause = ic & (IC_ERR_IRQ|IC_DONE_IRQ); From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 14:34:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45E6D1065674; Wed, 1 Feb 2012 14:34:53 +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 1AAD38FC13; Wed, 1 Feb 2012 14:34:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11EYrmr091009; Wed, 1 Feb 2012 14:34:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11EYqCt091007; Wed, 1 Feb 2012 14:34:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202011434.q11EYqCt091007@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Feb 2012 14:34: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: r230866 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 14:34:53 -0000 Author: kib Date: Wed Feb 1 14:34:52 2012 New Revision: 230866 URL: http://svn.freebsd.org/changeset/base/230866 Log: Add kqueue support to /dev/klog. Submitted by: Mateusz Guzik PR: kern/156423 MFC after: 1 weeks Modified: head/sys/kern/subr_log.c Modified: head/sys/kern/subr_log.c ============================================================================== --- head/sys/kern/subr_log.c Wed Feb 1 13:39:52 2012 (r230865) +++ head/sys/kern/subr_log.c Wed Feb 1 14:34:52 2012 (r230866) @@ -59,6 +59,7 @@ static d_close_t logclose; static d_read_t logread; static d_ioctl_t logioctl; static d_poll_t logpoll; +static d_kqfilter_t logkqfilter; static void logtimeout(void *arg); @@ -69,9 +70,20 @@ static struct cdevsw log_cdevsw = { .d_read = logread, .d_ioctl = logioctl, .d_poll = logpoll, + .d_kqfilter = logkqfilter, .d_name = "log", }; +static int logkqread(struct knote *note, long hint); +static void logkqdetach(struct knote *note); + +static struct filterops log_read_filterops = { + .f_isfd = 1, + .f_attach = NULL, + .f_detach = logkqdetach, + .f_event = logkqread, +}; + static struct logsoftc { int sc_state; /* see above for possibilities */ struct selinfo sc_selp; /* process waiting on select call */ @@ -181,6 +193,40 @@ logpoll(struct cdev *dev, int events, st return (revents); } +static int +logkqfilter(struct cdev *dev, struct knote *kn) +{ + + if (kn->kn_filter != EVFILT_READ) + return (EINVAL); + + kn->kn_fop = &log_read_filterops; + kn->kn_hook = NULL; + + mtx_lock(&msgbuf_lock); + knlist_add(&logsoftc.sc_selp.si_note, kn, 1); + mtx_unlock(&msgbuf_lock); + return (0); +} + +static int +logkqread(struct knote *kn, long hint) +{ + + mtx_assert(&msgbuf_lock, MA_OWNED); + kn->kn_data = msgbuf_getcount(msgbufp); + return (kn->kn_data != 0); +} + +static void +logkqdetach(struct knote *kn) +{ + + mtx_lock(&msgbuf_lock); + knlist_remove(&logsoftc.sc_selp.si_note, kn, 1); + mtx_unlock(&msgbuf_lock); +} + static void logtimeout(void *arg) { @@ -198,6 +244,7 @@ logtimeout(void *arg) } msgbuftrigger = 0; selwakeuppri(&logsoftc.sc_selp, LOG_RDPRI); + KNOTE_LOCKED(&logsoftc.sc_selp.si_note, 0); if ((logsoftc.sc_state & LOG_ASYNC) && logsoftc.sc_sigio != NULL) pgsigio(&logsoftc.sc_sigio, SIGIO, 0); cv_broadcastpri(&log_wakeup, LOG_RDPRI); @@ -256,6 +303,7 @@ log_drvinit(void *unused) cv_init(&log_wakeup, "klog"); callout_init_mtx(&logsoftc.sc_callout, &msgbuf_lock, 0); + knlist_init_mtx(&logsoftc.sc_selp.si_note, &msgbuf_lock); make_dev_credf(MAKEDEV_ETERNAL, &log_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0600, "klog"); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 15:04:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05D891065670; Wed, 1 Feb 2012 15:04:28 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDB6D8FC1C; Wed, 1 Feb 2012 15:04:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11F4RQI091962; Wed, 1 Feb 2012 15:04:27 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11F4RkO091960; Wed, 1 Feb 2012 15:04:27 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201202011504.q11F4RkO091960@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 1 Feb 2012 15:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230867 - stable/9/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 15:04:28 -0000 Author: pluknet Date: Wed Feb 1 15:04:27 2012 New Revision: 230867 URL: http://svn.freebsd.org/changeset/base/230867 Log: MFC r230545: Clarify and improve the boot menu with some small changes. PR: misc/160818 Submitted by: Warren Block Modified: stable/9/sys/boot/forth/menu.rc Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/boot/forth/menu.rc ============================================================================== --- stable/9/sys/boot/forth/menu.rc Wed Feb 1 14:34:52 2012 (r230866) +++ stable/9/sys/boot/forth/menu.rc Wed Feb 1 15:04:27 2012 (r230867) @@ -18,9 +18,9 @@ menu-init \ initialize the menu area \ Initialize main menu constructs (see `menu.4th') \ NOTE: To use the `ansi' variants, add `loader_color=1' to loader.conf(5) -set menu_caption[1]="Boot [ENTER]" +set menu_caption[1]="Boot [Enter]" set menu_command[1]="boot" -set ansi_caption[1]="Boot [ENTER]" +set ansi_caption[1]="Boot [Enter]" set menu_keycode[1]="98" set menu_caption[2]="[Esc]ape to loader prompt" @@ -38,34 +38,34 @@ set menu_reboot \ set menu_options=4 -set menu_caption[4]="[A]CPI Support: Disabled" -set toggled_text[4]="[A]CPI Support: Enabled" +set menu_caption[4]="[A]CPI Support off" +set toggled_text[4]="[A]CPI Support On" set menu_command[4]="toggle_acpi" set menu_keycode[4]="97" set menu_acpi=4 -set ansi_caption[4]="ACPI Support: Disabled" -set toggled_ansi[4]="ACPI Support: Enabled" +set ansi_caption[4]="ACPI Support Off" +set toggled_ansi[4]="ACPI Support On" -set menu_caption[5]="Boot Safe [M]ode: NO" -set toggled_text[5]="Boot Safe [M]ode: YES" +set menu_caption[5]="Safe [M]ode... off" +set toggled_text[5]="Safe [M]ode... On" set menu_command[5]="toggle_safemode" set menu_keycode[5]="109" -set ansi_caption[5]="Boot Safe Mode: NO" -set toggled_ansi[5]="Boot Safe Mode: YES" +set ansi_caption[5]="Safe Mode... Off" +set toggled_ansi[5]="Safe Mode... On" -set menu_caption[6]="Boot [S]ingle User: NO" -set toggled_text[6]="Boot [S]ingle User: YES" +set menu_caption[6]="[S]ingle User. off" +set toggled_text[6]="[S]ingle User. On" set menu_command[6]="toggle_singleuser" set menu_keycode[6]="115" -set ansi_caption[6]="Boot Single User: NO" -set toggled_ansi[6]="Boot Single User: YES" +set ansi_caption[6]="Single User. Off" +set toggled_ansi[6]="Single User. On" -set menu_caption[7]="Boot [V]erbose: NO" -set toggled_text[7]="Boot [V]erbose: YES" +set menu_caption[7]="[V]erbose..... off" +set toggled_text[7]="[V]erbose..... On" set menu_command[7]="toggle_verbose" set menu_keycode[7]="118" -set ansi_caption[7]="Boot Verbose: NO" -set toggled_ansi[7]="Boot Verbose: YES" +set ansi_caption[7]="Verbose..... Off" +set toggled_ansi[7]="Verbose..... On" \ Enable automatic booting (add ``autoboot_delay=N'' to loader.conf(5) to \ customize the timeout; default is 10-seconds) From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 15:57:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6251B106566B; Wed, 1 Feb 2012 15:57:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EB6C8FC1B; Wed, 1 Feb 2012 15:57:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11FvocJ093537; Wed, 1 Feb 2012 15:57:50 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11FvoNj093532; Wed, 1 Feb 2012 15:57:50 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202011557.q11FvoNj093532@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 1 Feb 2012 15:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230868 - in stable/9/sys: contrib/pf/net netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 15:57:50 -0000 Author: glebius Date: Wed Feb 1 15:57:49 2012 New Revision: 230868 URL: http://svn.freebsd.org/changeset/base/230868 Log: Merge some cleanups and bugfixes to pfsync(4) and pf(4) from head. Merged revisions: r229773,229777,229849-229853,229857,229959,229961-229964,229976. r229777: Merge from OpenBSD: revision 1.170 date: 2011/10/30 23:04:38; author: mikeb; state: Exp; lines: +6 -7 Allow setting big MTU values on the pfsync interface but not larger than the syncdev MTU. Prompted by the discussion with and tested by Maxim Bourmistrov; ok dlg, mpf Consistently use sc_ifp->if_mtu in the MTU check throughout the module. This backs out r228813. r229849: o Fix panic on module unload, that happened due to mutex being destroyed prior to pfsync_uninit(). To do this, move all the initialization to the module_t method, instead of SYSINIT(9). o Fix another panic after module unload, due to not clearing the m_addr_chg_pf_p pointer. o Refuse to unload module, unless being unloaded forcibly. o Revert the sub argument to MODULE_DECLARE, to the stable/8 value. r229850: Bunch of fixes to pfsync(4) module load/unload: o Make the pfsync.ko actually usable. Before this change loading it didn't register protosw, so was a nop. However, a module /boot/kernel did confused users. o Rewrite the way we are joining multicast group: - Move multicast initialization/destruction to separate functions. - Don't allocate memory if we aren't going to join a multicast group. - Use modern API for joining/leaving multicast group. - Now the utterly wrong pfsync_ifdetach() isn't needed. o Move module initialization from SYSINIT(9) to moduledata_t method. o Refuse to unload module, unless asked forcibly. o Improve a bit some FreeBSD porting code: - Use separate malloc type. - Simplify swi sheduling. r229857: Can't pass MSIZE to m_cljget(), an mbuf can't be attached as external storage to another mbuf. r229963: Add necessary locking in pfsync_in_ureq(). r229976: Redo r226660: - Define schednetisr() to swi_sched. - In the swi handler check if there is some data prepared, and if true, then call pfsync_sendout(), however tell it not to schedule swi again. - Since now we don't obtain the pfsync lock in the swi handler, don't use ifqueue mutex to synchronize queue access. r229773, r229851, r229959, r229961, r229962, r229964 - minor cleanups. Modified: stable/9/sys/contrib/pf/net/if_pfsync.c stable/9/sys/contrib/pf/net/pf.c stable/9/sys/contrib/pf/net/pf_ioctl.c stable/9/sys/contrib/pf/net/pfvar.h stable/9/sys/netinet/in_proto.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/contrib/pf/ (props changed) Modified: stable/9/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- stable/9/sys/contrib/pf/net/if_pfsync.c Wed Feb 1 15:04:27 2012 (r230867) +++ stable/9/sys/contrib/pf/net/if_pfsync.c Wed Feb 1 15:57:49 2012 (r230868) @@ -47,6 +47,8 @@ * 1.118, 1.124, 1.148, 1.149, 1.151, 1.171 - fixes to bulk updates * 1.120, 1.175 - use monotonic time_uptime * 1.122 - reduce number of updates for non-TCP sessions + * 1.128 - cleanups + * 1.170 - SIOCSIFMTU checks */ #ifdef __FreeBSD__ @@ -59,12 +61,6 @@ __FBSDID("$FreeBSD$"); #define NBPFILTER 1 -#ifdef DEV_PFSYNC -#define NPFSYNC DEV_PFSYNC -#else -#define NPFSYNC 0 -#endif - #ifdef DEV_CARP #define NCARP DEV_CARP #else @@ -92,6 +88,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #else #include #include @@ -298,19 +295,26 @@ struct pfsync_softc { #else struct timeout sc_tmo; #endif -#ifdef __FreeBSD__ - eventhandler_tag sc_detachtag; -#endif - }; #ifdef __FreeBSD__ +static MALLOC_DEFINE(M_PFSYNC, "pfsync", "pfsync data"); static VNET_DEFINE(struct pfsync_softc *, pfsyncif) = NULL; #define V_pfsyncif VNET(pfsyncif) - +static VNET_DEFINE(void *, pfsync_swi_cookie) = NULL; +#define V_pfsync_swi_cookie VNET(pfsync_swi_cookie) static VNET_DEFINE(struct pfsyncstats, pfsyncstats); #define V_pfsyncstats VNET(pfsyncstats) +static void pfsyncintr(void *); +static int pfsync_multicast_setup(struct pfsync_softc *); +static void pfsync_multicast_cleanup(struct pfsync_softc *); +static int pfsync_init(void); +static void pfsync_uninit(void); +static void pfsync_sendout1(int); + +#define schednetisr(NETISR_PFSYNC) swi_sched(V_pfsync_swi_cookie, 0) + SYSCTL_NODE(_net, OID_AUTO, pfsync, CTLFLAG_RW, 0, "PFSYNC"); SYSCTL_VNET_STRUCT(_net_pfsync, OID_AUTO, stats, CTLFLAG_RW, &VNET_NAME(pfsyncstats), pfsyncstats, @@ -321,16 +325,6 @@ struct pfsyncstats pfsyncstats; #define V_pfsyncstats pfsyncstats #endif -#ifdef __FreeBSD__ -static void pfsyncintr(void *); -struct pfsync_swi { - void * pfsync_swi_cookie; -}; -static struct pfsync_swi pfsync_swi; -#define schednetisr(p) swi_sched(pfsync_swi.pfsync_swi_cookie, 0) -#define NETISR_PFSYNC -#endif - void pfsyncattach(int); #ifdef __FreeBSD__ int pfsync_clone_create(struct if_clone *, int, caddr_t); @@ -352,7 +346,6 @@ int pfsyncioctl(struct ifnet *, u_long, void pfsyncstart(struct ifnet *); struct mbuf *pfsync_if_dequeue(struct ifnet *); -struct mbuf *pfsync_get_mbuf(struct pfsync_softc *); void pfsync_deferred(struct pf_state *, int); void pfsync_undefer(struct pfsync_deferral *, int); @@ -364,11 +357,8 @@ void pfsync_update_state_req(struct pf_s void pfsync_drop(struct pfsync_softc *); void pfsync_sendout(void); void pfsync_send_plus(void *, size_t); -int pfsync_tdb_sendout(struct pfsync_softc *); -int pfsync_sendout_mbuf(struct pfsync_softc *, struct mbuf *); void pfsync_timeout(void *); void pfsync_tdb_timeout(void *); -void pfsync_send_bus(struct pfsync_softc *, u_int8_t); void pfsync_bulk_start(void); void pfsync_bulk_status(u_int8_t); @@ -376,8 +366,6 @@ void pfsync_bulk_update(void *); void pfsync_bulk_fail(void *); #ifdef __FreeBSD__ -void pfsync_ifdetach(void *, struct ifnet *); - /* XXX: ugly */ #define betoh64 (unsigned long long)be64toh #define timeout_del callout_stop @@ -389,6 +377,10 @@ int pfsync_sync_ok; #endif #ifdef __FreeBSD__ +VNET_DEFINE(struct ifc_simple_data, pfsync_cloner_data); +VNET_DEFINE(struct if_clone, pfsync_cloner); +#define V_pfsync_cloner_data VNET(pfsync_cloner_data) +#define V_pfsync_cloner VNET(pfsync_cloner) IFC_SIMPLE_DECLARE(pfsync, 1); #else struct if_clone pfsync_cloner = @@ -414,25 +406,20 @@ pfsync_clone_create(struct if_clone *ifc if (unit != 0) return (EINVAL); -#ifndef __FreeBSD__ +#ifdef __FreeBSD__ + sc = malloc(sizeof(struct pfsync_softc), M_PFSYNC, M_WAITOK | M_ZERO); + sc->pfsync_sync_ok = 1; +#else pfsync_sync_ok = 1; + sc = malloc(sizeof(*pfsyncif), M_DEVBUF, M_NOWAIT | M_ZERO); #endif - sc = malloc(sizeof(struct pfsync_softc), M_DEVBUF, M_NOWAIT | M_ZERO); - if (sc == NULL) - return (ENOMEM); - for (q = 0; q < PFSYNC_S_COUNT; q++) TAILQ_INIT(&sc->sc_qs[q]); #ifdef __FreeBSD__ - sc->pfsync_sync_ok = 1; - sc->sc_pool = uma_zcreate("pfsync", PFSYNC_PLSIZE, - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (sc->sc_pool == NULL) { - free(sc, M_DEVBUF); - return (ENOMEM); - } + sc->sc_pool = uma_zcreate("pfsync", PFSYNC_PLSIZE, NULL, NULL, NULL, + NULL, UMA_ALIGN_PTR, 0); #else pool_init(&sc->sc_pool, PFSYNC_PLSIZE, 0, 0, 0, "pfsync", NULL); #endif @@ -445,13 +432,7 @@ pfsync_clone_create(struct if_clone *ifc sc->sc_len = PFSYNC_MINPKT; sc->sc_maxupdates = 128; -#ifdef __FreeBSD__ - sc->sc_imo.imo_membership = (struct in_multi **)malloc( - (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_DEVBUF, - M_NOWAIT | M_ZERO); - sc->sc_imo.imo_max_memberships = IP_MIN_MEMBERSHIPS; - sc->sc_imo.imo_multicast_vif = -1; -#else +#ifndef __FreeBSD__ sc->sc_imo.imo_membership = (struct in_multi **)malloc( (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_IPMOPTS, M_WAITOK | M_ZERO); @@ -461,26 +442,11 @@ pfsync_clone_create(struct if_clone *ifc #ifdef __FreeBSD__ ifp = sc->sc_ifp = if_alloc(IFT_PFSYNC); if (ifp == NULL) { - free(sc->sc_imo.imo_membership, M_DEVBUF); uma_zdestroy(sc->sc_pool); - free(sc, M_DEVBUF); + free(sc, M_PFSYNC); return (ENOSPC); } if_initname(ifp, ifc->ifc_name, unit); - - sc->sc_detachtag = EVENTHANDLER_REGISTER(ifnet_departure_event, -#ifdef __FreeBSD__ - pfsync_ifdetach, V_pfsyncif, EVENTHANDLER_PRI_ANY); -#else - pfsync_ifdetach, pfsyncif, EVENTHANDLER_PRI_ANY); -#endif - if (sc->sc_detachtag == NULL) { - if_free(ifp); - free(sc->sc_imo.imo_membership, M_DEVBUF); - uma_zdestroy(sc->sc_pool); - free(sc, M_DEVBUF); - return (ENOSPC); - } #else ifp = &sc->sc_if; snprintf(ifp->if_xname, sizeof ifp->if_xname, "pfsync%d", unit); @@ -492,13 +458,12 @@ pfsync_clone_create(struct if_clone *ifc ifp->if_type = IFT_PFSYNC; ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_hdrlen = sizeof(struct pfsync_header); - ifp->if_mtu = 1500; /* XXX */ + ifp->if_mtu = ETHERMTU; #ifdef __FreeBSD__ callout_init(&sc->sc_tmo, CALLOUT_MPSAFE); callout_init_mtx(&sc->sc_bulk_tmo, &pf_task_mtx, 0); callout_init(&sc->sc_bulkfail_tmo, CALLOUT_MPSAFE); #else - ifp->if_hardmtu = MCLBYTES; /* XXX */ timeout_set(&sc->sc_tmo, pfsync_timeout, sc); timeout_set(&sc->sc_bulk_tmo, pfsync_bulk_update, sc); timeout_set(&sc->sc_bulkfail_tmo, pfsync_bulk_fail, sc); @@ -540,7 +505,6 @@ pfsync_clone_destroy(struct ifnet *ifp) struct pfsync_softc *sc = ifp->if_softc; #ifdef __FreeBSD__ - EVENTHANDLER_DEREGISTER(ifnet_departure_event, sc->sc_detachtag); PF_LOCK(); #endif timeout_del(&sc->sc_bulkfail_tmo); @@ -576,11 +540,13 @@ pfsync_clone_destroy(struct ifnet *ifp) #endif #ifdef __FreeBSD__ if_free(ifp); - free(sc->sc_imo.imo_membership, M_DEVBUF); + if (sc->sc_imo.imo_membership) + pfsync_multicast_cleanup(sc); + free(sc, M_PFSYNC); #else free(sc->sc_imo.imo_membership, M_IPMOPTS); -#endif free(sc, M_DEVBUF); +#endif #ifdef __FreeBSD__ V_pfsyncif = NULL; @@ -721,9 +687,9 @@ pfsync_state_import(struct pfsync_state int pool_flags; int error; +#ifdef __FreeBSD__ PF_LOCK_ASSERT(); -#ifdef __FreeBSD__ if (sp->creatorid == 0 && V_pf_status.debug >= PF_DEBUG_MISC) { #else if (sp->creatorid == 0 && pf_status.debug >= PF_DEBUG_MISC) { @@ -863,11 +829,7 @@ pfsync_state_import(struct pfsync_state CLR(st->state_flags, PFSTATE_NOSYNC); if (ISSET(st->state_flags, PFSTATE_ACK)) { pfsync_q_ins(st, PFSYNC_S_IACK); -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif } } CLR(st->state_flags, PFSTATE_ACK); @@ -1323,11 +1285,7 @@ pfsync_in_upd(struct pfsync_pkt *pkt, st V_pfsyncstats.pfsyncs_stale++; pfsync_update_state(st); -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif continue; } pfsync_alloc_scrub_memory(&sp->dst, &st->dst); @@ -1433,11 +1391,7 @@ pfsync_in_upd_c(struct pfsync_pkt *pkt, V_pfsyncstats.pfsyncs_stale++; pfsync_update_state(st); -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif continue; } pfsync_alloc_scrub_memory(&up->dst, &st->dst); @@ -1473,6 +1427,9 @@ pfsync_in_ureq(struct pfsync_pkt *pkt, s } ura = (struct pfsync_upd_req *)(mp->m_data + offp); +#ifdef __FreeBSD__ + PF_LOCK(); +#endif for (i = 0; i < count; i++) { ur = &ura[i]; @@ -1490,11 +1447,12 @@ pfsync_in_ureq(struct pfsync_pkt *pkt, s if (ISSET(st->state_flags, PFSTATE_NOSYNC)) continue; - PF_LOCK(); pfsync_update_state_req(st); - PF_UNLOCK(); } } +#ifdef __FreeBSD__ + PF_UNLOCK(); +#endif return (len); } @@ -1617,7 +1575,7 @@ pfsync_in_bus(struct pfsync_pkt *pkt, st #ifdef __FreeBSD__ callout_reset(&sc->sc_bulkfail_tmo, 4 * hz + V_pf_pool_limits[PF_LIMIT_STATES].limit / - ((sc->sc_sync_if->if_mtu - PFSYNC_MINPKT) / + ((sc->sc_ifp->if_mtu - PFSYNC_MINPKT) / sizeof(struct pfsync_state)), pfsync_bulk_fail, V_pfsyncif); #else @@ -1827,10 +1785,10 @@ pfsyncioctl(struct ifnet *ifp, u_long cm #endif break; case SIOCSIFMTU: - if (ifr->ifr_mtu <= PFSYNC_MINPKT) + if (!sc->sc_sync_if || + ifr->ifr_mtu <= PFSYNC_MINPKT || + ifr->ifr_mtu > sc->sc_sync_if->if_mtu) return (EINVAL); - if (ifr->ifr_mtu > MCLBYTES) /* XXX could be bigger */ - ifr->ifr_mtu = MCLBYTES; if (ifr->ifr_mtu < ifp->if_mtu) { s = splnet(); #ifdef __FreeBSD__ @@ -1892,12 +1850,15 @@ pfsyncioctl(struct ifnet *ifp, u_long cm sc->sc_sync_if = NULL; #ifdef __FreeBSD__ PF_UNLOCK(); -#endif + if (imo->imo_membership) + pfsync_multicast_cleanup(sc); +#else if (imo->imo_num_memberships > 0) { in_delmulti(imo->imo_membership[ --imo->imo_num_memberships]); imo->imo_multicast_ifp = NULL; } +#endif break; } @@ -1922,57 +1883,53 @@ pfsyncioctl(struct ifnet *ifp, u_long cm pfsync_sendout(); sc->sc_sync_if = sifp; - if (imo->imo_num_memberships > 0) { #ifdef __FreeBSD__ + if (imo->imo_membership) { PF_UNLOCK(); -#endif - in_delmulti(imo->imo_membership[--imo->imo_num_memberships]); -#ifdef __FreeBSD__ + pfsync_multicast_cleanup(sc); PF_LOCK(); -#endif + } +#else + if (imo->imo_num_memberships > 0) { + in_delmulti(imo->imo_membership[--imo->imo_num_memberships]); imo->imo_multicast_ifp = NULL; } +#endif - if (sc->sc_sync_if && #ifdef __FreeBSD__ + if (sc->sc_sync_if && sc->sc_sync_peer.s_addr == htonl(INADDR_PFSYNC_GROUP)) { + PF_UNLOCK(); + error = pfsync_multicast_setup(sc); + if (error) + return (error); + PF_LOCK(); + } #else + if (sc->sc_sync_if && sc->sc_sync_peer.s_addr == INADDR_PFSYNC_GROUP) { -#endif struct in_addr addr; if (!(sc->sc_sync_if->if_flags & IFF_MULTICAST)) { sc->sc_sync_if = NULL; -#ifdef __FreeBSD__ - PF_UNLOCK(); -#endif splx(s); return (EADDRNOTAVAIL); } -#ifdef __FreeBSD__ - addr.s_addr = htonl(INADDR_PFSYNC_GROUP); -#else addr.s_addr = INADDR_PFSYNC_GROUP; -#endif -#ifdef __FreeBSD__ - PF_UNLOCK(); -#endif if ((imo->imo_membership[0] = in_addmulti(&addr, sc->sc_sync_if)) == NULL) { sc->sc_sync_if = NULL; splx(s); return (ENOBUFS); } -#ifdef __FreeBSD__ - PF_LOCK(); -#endif imo->imo_num_memberships++; imo->imo_multicast_ifp = sc->sc_sync_if; imo->imo_multicast_ttl = PFSYNC_DFLTTL; imo->imo_multicast_loop = 0; } +#endif /* !__FreeBSD__ */ ip = &sc->sc_template; bzero(ip, sizeof(*ip)); @@ -2111,7 +2068,7 @@ pfsync_drop(struct pfsync_softc *sc) #ifdef PFSYNC_DEBUG #ifdef __FreeBSD__ KASSERT(st->sync_state == q, - ("%s: st->sync_state == q", + ("%s: st->sync_state == q", __FUNCTION__)); #else KASSERT(st->sync_state == q); @@ -2141,12 +2098,20 @@ pfsync_drop(struct pfsync_softc *sc) sc->sc_len = PFSYNC_MINPKT; } -void -pfsync_sendout(void) -{ #ifdef __FreeBSD__ +void pfsync_sendout() +{ + pfsync_sendout1(1); +} + +static void +pfsync_sendout1(int schedswi) +{ struct pfsync_softc *sc = V_pfsyncif; #else +void +pfsync_sendout(void) +{ struct pfsync_softc *sc = pfsyncif; #endif #if NBPFILTER > 0 @@ -2167,7 +2132,6 @@ pfsync_sendout(void) #endif #ifdef __FreeBSD__ size_t pktlen; - int dummy_error; #endif int offset; int q, count = 0; @@ -2207,8 +2171,7 @@ pfsync_sendout(void) if (pktlen > MHLEN) { /* Find the right pool to allocate from. */ /* XXX: This is ugly. */ - m_cljget(m, M_DONTWAIT, pktlen <= MSIZE ? MSIZE : - pktlen <= MCLBYTES ? MCLBYTES : + m_cljget(m, M_DONTWAIT, pktlen <= MCLBYTES ? MCLBYTES : #if MJUMPAGESIZE != MCLBYTES pktlen <= MJUMPAGESIZE ? MJUMPAGESIZE : #endif @@ -2373,8 +2336,14 @@ pfsync_sendout(void) sc->sc_ifp->if_obytes += m->m_pkthdr.len; sc->sc_len = PFSYNC_MINPKT; - IFQ_ENQUEUE(&sc->sc_ifp->if_snd, m, dummy_error); - schednetisr(NETISR_PFSYNC); + if (!_IF_QFULL(&sc->sc_ifp->if_snd)) + _IF_ENQUEUE(&sc->sc_ifp->if_snd, m); + else { + m_freem(m); + sc->sc_ifp->if_snd.ifq_drops++; + } + if (schedswi) + swi_sched(V_pfsync_swi_cookie, 0); #else sc->sc_if.if_opackets++; sc->sc_if.if_obytes += m->m_pkthdr.len; @@ -2433,11 +2402,7 @@ pfsync_insert_state(struct pf_state *st) pfsync_q_ins(st, PFSYNC_S_INS); if (ISSET(st->state_flags, PFSTATE_ACK)) -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif else st->sync_updates = 0; } @@ -2636,11 +2601,7 @@ pfsync_update_state(struct pf_state *st) if (sync || (time_uptime - st->pfsync_time) < 2) { pfsync_upds++; -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif } } @@ -2676,7 +2637,7 @@ pfsync_request_update(u_int32_t creatori nlen += sizeof(struct pfsync_subheader); #ifdef __FreeBSD__ - if (sc->sc_len + nlen > sc->sc_sync_if->if_mtu) { + if (sc->sc_len + nlen > sc->sc_ifp->if_mtu) { #else if (sc->sc_len + nlen > sc->sc_if.if_mtu) { #endif @@ -2691,11 +2652,7 @@ pfsync_request_update(u_int32_t creatori TAILQ_INSERT_TAIL(&sc->sc_upd_req_list, item, ur_entry); sc->sc_len += nlen; -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif } void @@ -2724,11 +2681,7 @@ pfsync_update_state_req(struct pf_state pfsync_q_del(st); case PFSYNC_S_NONE: pfsync_q_ins(st, PFSYNC_S_UPD); -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif return; case PFSYNC_S_INS: @@ -2892,7 +2845,7 @@ pfsync_q_del(struct pf_state *st) int q = st->sync_state; #ifdef __FreeBSD__ - KASSERT(st->sync_state != PFSYNC_S_NONE, + KASSERT(st->sync_state != PFSYNC_S_NONE, ("%s: st->sync_state != PFSYNC_S_NONE", __FUNCTION__)); #else KASSERT(st->sync_state != PFSYNC_S_NONE); @@ -3023,7 +2976,7 @@ pfsync_bulk_start(void) printf("pfsync: received bulk update request\n"); #ifdef __FreeBSD__ - PF_LOCK(); + PF_LOCK_ASSERT(); if (TAILQ_EMPTY(&V_state_list)) #else if (TAILQ_EMPTY(&state_list)) @@ -3037,15 +2990,11 @@ pfsync_bulk_start(void) #else sc->sc_bulk_next = TAILQ_FIRST(&state_list); #endif - sc->sc_bulk_last = sc->sc_bulk_next; + sc->sc_bulk_last = sc->sc_bulk_next; - pfsync_bulk_status(PFSYNC_BUS_START); - callout_reset(&sc->sc_bulk_tmo, 1, - pfsync_bulk_update, sc); + pfsync_bulk_status(PFSYNC_BUS_START); + callout_reset(&sc->sc_bulk_tmo, 1, pfsync_bulk_update, sc); } -#ifdef __FreeBSD__ - PF_UNLOCK(); -#endif } void @@ -3306,7 +3255,11 @@ pfsyncintr(void *arg) CURVNET_SET(sc->sc_ifp->if_vnet); pfsync_ints++; - IF_DEQUEUE_ALL(&sc->sc_ifp->if_snd, m); + PF_LOCK(); + if (sc->sc_len > PFSYNC_MINPKT) + pfsync_sendout1(0); + _IF_DEQUEUE_ALL(&sc->sc_ifp->if_snd, m); + PF_UNLOCK(); for (; m != NULL; m = n) { @@ -3355,54 +3308,91 @@ pfsync_sysctl(int *name, u_int namelen, } #ifdef __FreeBSD__ -void -pfsync_ifdetach(void *arg, struct ifnet *ifp) +static int +pfsync_multicast_setup(struct pfsync_softc *sc) { - struct pfsync_softc *sc = (struct pfsync_softc *)arg; - struct ip_moptions *imo; - - if (sc == NULL || sc->sc_sync_if != ifp) - return; /* not for us; unlocked read */ + struct ip_moptions *imo = &sc->sc_imo; + int error; - CURVNET_SET(sc->sc_ifp->if_vnet); + if (!(sc->sc_sync_if->if_flags & IFF_MULTICAST)) { + sc->sc_sync_if = NULL; + return (EADDRNOTAVAIL); + } - PF_LOCK(); + imo->imo_membership = (struct in_multi **)malloc( + (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_PFSYNC, + M_WAITOK | M_ZERO); + imo->imo_max_memberships = IP_MIN_MEMBERSHIPS; + imo->imo_multicast_vif = -1; - /* Deal with a member interface going away from under us. */ - sc->sc_sync_if = NULL; - imo = &sc->sc_imo; - if (imo->imo_num_memberships > 0) { - KASSERT(imo->imo_num_memberships == 1, - ("%s: imo_num_memberships != 1", __func__)); - /* - * Our event handler is always called after protocol - * domains have been detached from the underlying ifnet. - * Do not call in_delmulti(); we held a single reference - * which the protocol domain has purged in in_purgemaddrs(). - */ - PF_UNLOCK(); - imo->imo_membership[--imo->imo_num_memberships] = NULL; - PF_LOCK(); - imo->imo_multicast_ifp = NULL; - } + if ((error = in_joingroup(sc->sc_sync_if, &sc->sc_sync_peer, NULL, + &imo->imo_membership[0])) != 0) { + free(imo->imo_membership, M_PFSYNC); + return (error); + } + imo->imo_num_memberships++; + imo->imo_multicast_ifp = sc->sc_sync_if; + imo->imo_multicast_ttl = PFSYNC_DFLTTL; + imo->imo_multicast_loop = 0; - PF_UNLOCK(); - - CURVNET_RESTORE(); + return (0); } +static void +pfsync_multicast_cleanup(struct pfsync_softc *sc) +{ + struct ip_moptions *imo = &sc->sc_imo; + + in_leavegroup(imo->imo_membership[0], NULL); + free(imo->imo_membership, M_PFSYNC); + imo->imo_membership = NULL; + imo->imo_multicast_ifp = NULL; +} + +#ifdef INET +extern struct domain inetdomain; +static struct protosw in_pfsync_protosw = { + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_PFSYNC, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = pfsync_input, + .pr_output = (pr_output_t *)rip_output, + .pr_ctloutput = rip_ctloutput, + .pr_usrreqs = &rip_usrreqs +}; +#endif + static int -vnet_pfsync_init(const void *unused) +pfsync_init() { + VNET_ITERATOR_DECL(vnet_iter); int error = 0; - pfsyncattach(0); - - error = swi_add(NULL, "pfsync", pfsyncintr, V_pfsyncif, - SWI_NET, INTR_MPSAFE, &pfsync_swi.pfsync_swi_cookie); + VNET_LIST_RLOCK(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + V_pfsync_cloner = pfsync_cloner; + V_pfsync_cloner_data = pfsync_cloner_data; + V_pfsync_cloner.ifc_data = &V_pfsync_cloner_data; + if_clone_attach(&V_pfsync_cloner); + error = swi_add(NULL, "pfsync", pfsyncintr, V_pfsyncif, + SWI_NET, INTR_MPSAFE, &V_pfsync_swi_cookie); + CURVNET_RESTORE(); + if (error) + goto fail_locked; + } + VNET_LIST_RUNLOCK(); +#ifdef INET + error = pf_proto_register(PF_INET, &in_pfsync_protosw); if (error) - panic("%s: swi_add %d", __func__, error); - + goto fail; + error = ipproto_register(IPPROTO_PFSYNC); + if (error) { + pf_proto_unregister(PF_INET, IPPROTO_PFSYNC, SOCK_RAW); + goto fail; + } +#endif PF_LOCK(); pfsync_state_import_ptr = pfsync_state_import; pfsync_up_ptr = pfsync_up; @@ -3415,13 +3405,27 @@ vnet_pfsync_init(const void *unused) PF_UNLOCK(); return (0); + +fail: + VNET_LIST_RLOCK(); +fail_locked: + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + if (V_pfsync_swi_cookie) { + swi_remove(V_pfsync_swi_cookie); + if_clone_detach(&V_pfsync_cloner); + } + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); + + return (error); } -static int -vnet_pfsync_uninit(const void *unused) +static void +pfsync_uninit() { - - swi_remove(pfsync_swi.pfsync_swi_cookie); + VNET_ITERATOR_DECL(vnet_iter); PF_LOCK(); pfsync_state_import_ptr = NULL; @@ -3434,30 +3438,18 @@ vnet_pfsync_uninit(const void *unused) pfsync_defer_ptr = NULL; PF_UNLOCK(); - if_clone_detach(&pfsync_cloner); - - return (0); + ipproto_unregister(IPPROTO_PFSYNC); + pf_proto_unregister(PF_INET, IPPROTO_PFSYNC, SOCK_RAW); + VNET_LIST_RLOCK(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + swi_remove(V_pfsync_swi_cookie); + if_clone_detach(&V_pfsync_cloner); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); } -/* Define startup order. */ -#define PFSYNC_SYSINIT_ORDER SI_SUB_PROTO_IF -#define PFSYNC_MODEVENT_ORDER (SI_ORDER_FIRST) /* On boot slot in here. */ -#define PFSYNC_VNET_ORDER (PFSYNC_MODEVENT_ORDER + 2) /* Later still. */ - -/* - * Starting up. - * VNET_SYSINIT is called for each existing vnet and each new vnet. - */ -VNET_SYSINIT(vnet_pfsync_init, PFSYNC_SYSINIT_ORDER, PFSYNC_VNET_ORDER, - vnet_pfsync_init, NULL); - -/* - * Closing up shop. These are done in REVERSE ORDER, - * Not called on reboot. - * VNET_SYSUNINIT is called for each exiting vnet as it exits. - */ -VNET_SYSUNINIT(vnet_pfsync_uninit, PFSYNC_SYSINIT_ORDER, PFSYNC_VNET_ORDER, - vnet_pfsync_uninit, NULL); static int pfsync_modevent(module_t mod, int type, void *data) { @@ -3465,21 +3457,23 @@ pfsync_modevent(module_t mod, int type, switch (type) { case MOD_LOAD: -#ifndef __FreeBSD__ - pfsyncattach(0); -#endif + error = pfsync_init(); + break; + case MOD_QUIESCE: + /* + * Module should not be unloaded due to race conditions. + */ + error = EPERM; break; case MOD_UNLOAD: -#ifndef __FreeBSD__ - if_clone_detach(&pfsync_cloner); -#endif + pfsync_uninit(); break; default: error = EINVAL; break; } - return error; + return (error); } static moduledata_t pfsync_mod = { @@ -3490,7 +3484,7 @@ static moduledata_t pfsync_mod = { #define PFSYNC_MODVER 1 -DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); MODULE_VERSION(pfsync, PFSYNC_MODVER); MODULE_DEPEND(pfsync, pf, PF_MODVER, PF_MODVER, PF_MODVER); #endif /* __FreeBSD__ */ Modified: stable/9/sys/contrib/pf/net/pf.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf.c Wed Feb 1 15:04:27 2012 (r230867) +++ stable/9/sys/contrib/pf/net/pf.c Wed Feb 1 15:57:49 2012 (r230868) @@ -47,23 +47,7 @@ __FBSDID("$FreeBSD$"); #include "opt_bpf.h" #include "opt_pf.h" -#ifdef DEV_BPF -#define NBPFILTER DEV_BPF -#else -#define NBPFILTER 0 -#endif - -#ifdef DEV_PFLOG -#define NPFLOG DEV_PFLOG -#else -#define NPFLOG 0 -#endif - -#ifdef DEV_PFSYNC -#define NPFSYNC DEV_PFSYNC -#else -#define NPFSYNC 0 -#endif +#define NPFSYNC 1 #ifdef DEV_PFLOW #define NPFLOW DEV_PFLOW Modified: stable/9/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf_ioctl.c Wed Feb 1 15:04:27 2012 (r230867) +++ stable/9/sys/contrib/pf/net/pf_ioctl.c Wed Feb 1 15:57:49 2012 (r230868) @@ -44,11 +44,7 @@ __FBSDID("$FreeBSD$"); #include "opt_bpf.h" #include "opt_pf.h" -#ifdef DEV_BPF -#define NBPFILTER DEV_BPF -#else -#define NBPFILTER 0 -#endif +#define NPFSYNC 1 #ifdef DEV_PFLOG #define NPFLOG DEV_PFLOG @@ -56,16 +52,10 @@ __FBSDID("$FreeBSD$"); #define NPFLOG 0 #endif -#ifdef DEV_PFSYNC -#define NPFSYNC DEV_PFSYNC -#else -#define NPFSYNC 0 -#endif - -#else +#else /* !__FreeBSD__ */ #include "pfsync.h" #include "pflog.h" -#endif +#endif /* __FreeBSD__ */ #include #include @@ -4328,57 +4318,25 @@ dehook_pf(void) return (0); } -/* Vnet accessors */ -static int -vnet_pf_init(const void *unused) -{ - - V_pf_pfil_hooked = 0; - V_pf_end_threads = 0; - - V_debug_pfugidhack = 0; - - TAILQ_INIT(&V_pf_tags); - TAILQ_INIT(&V_pf_qids); - - pf_load(); - - return (0); -} - -static int -vnet_pf_uninit(const void *unused) -{ - - pf_unload(); - - return (0); -} - -/* Define startup order. */ -#define PF_SYSINIT_ORDER SI_SUB_PROTO_BEGIN -#define PF_MODEVENT_ORDER (SI_ORDER_FIRST) /* On boot slot in here. */ -#define PF_VNET_ORDER (PF_MODEVENT_ORDER + 2) /* Later still. */ - -/* - * Starting up. - * VNET_SYSINIT is called for each existing vnet and each new vnet. - */ -VNET_SYSINIT(vnet_pf_init, PF_SYSINIT_ORDER, PF_VNET_ORDER, - vnet_pf_init, NULL); - -/* - * Closing up shop. These are done in REVERSE ORDER, - * Not called on reboot. - * VNET_SYSUNINIT is called for each exiting vnet as it exits. - */ -VNET_SYSUNINIT(vnet_pf_uninit, PF_SYSINIT_ORDER, PF_VNET_ORDER, - vnet_pf_uninit, NULL); - static int pf_load(void) { + VNET_ITERATOR_DECL(vnet_iter); + VNET_LIST_RLOCK(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + V_pf_pfil_hooked = 0; + V_pf_end_threads = 0; + V_debug_pfugidhack = 0; + TAILQ_INIT(&V_pf_tags); + TAILQ_INIT(&V_pf_qids); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); + + init_pf_mutex(); + pf_dev = make_dev(&pf_cdevsw, 0, 0, 0, 0600, PF_NAME); init_zone_var(); sx_init(&V_pf_consistency_lock, "pf_statetbl_lock"); if (pfattach() < 0) @@ -4395,6 +4353,7 @@ pf_unload(void) PF_LOCK(); V_pf_status.running = 0; PF_UNLOCK(); + m_addr_chg_pf_p = NULL; error = dehook_pf(); if (error) { /* @@ -4417,6 +4376,8 @@ pf_unload(void) pf_osfp_cleanup(); cleanup_pf_zone(); PF_UNLOCK(); + destroy_dev(pf_dev); + destroy_pf_mutex(); sx_destroy(&V_pf_consistency_lock); return error; } @@ -4428,12 +4389,16 @@ pf_modevent(module_t mod, int type, void switch(type) { case MOD_LOAD: - init_pf_mutex(); - pf_dev = make_dev(&pf_cdevsw, 0, 0, 0, 0600, PF_NAME); + error = pf_load(); + break; + case MOD_QUIESCE: + /* + * Module should not be unloaded due to race conditions. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 16:41:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5868E106564A; Wed, 1 Feb 2012 16:41:00 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 475908FC14; Wed, 1 Feb 2012 16:41:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11Gf0ri095463; Wed, 1 Feb 2012 16:41:00 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11Gf0j6095461; Wed, 1 Feb 2012 16:41:00 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201202011641.q11Gf0j6095461@svn.freebsd.org> From: Guy Helmer Date: Wed, 1 Feb 2012 16:41: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: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 16:41:00 -0000 Author: ghelmer Date: Wed Feb 1 16:40:59 2012 New Revision: 230869 URL: http://svn.freebsd.org/changeset/base/230869 Log: Change the notes about the pidfile to include Doug's preference for pre-creating the pidfile with appropriate owner and permissions. Requested by dougb Modified: head/usr.sbin/daemon/daemon.8 Modified: head/usr.sbin/daemon/daemon.8 ============================================================================== --- head/usr.sbin/daemon/daemon.8 Wed Feb 1 15:57:49 2012 (r230868) +++ head/usr.sbin/daemon/daemon.8 Wed Feb 1 16:40:59 2012 (r230869) @@ -61,8 +61,9 @@ using the functionality. If the .Fl u -option is used, the directory to contain the pidfile must be writable -by the specified user. +option is used, either the pidfile needs to have been pre-created +with appropriate ownership and permissions, or the directory to contain +the pidfile must be writable by the specified user. Note, that the file will be created shortly before the process is actually executed, and will remain after the process exits (although it will be removed if the execution fails). From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 17:04:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AB62106566C; Wed, 1 Feb 2012 17:04:15 +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 491BC8FC08; Wed, 1 Feb 2012 17:04:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11H4FoK096300; Wed, 1 Feb 2012 17:04:15 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11H4FGT096298; Wed, 1 Feb 2012 17:04:15 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201202011704.q11H4FGT096298@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 1 Feb 2012 17:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230870 - stable/7/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 17:04:15 -0000 Author: jh Date: Wed Feb 1 17:04:14 2012 New Revision: 230870 URL: http://svn.freebsd.org/changeset/base/230870 Log: Partially MFC r228358: Fix markup. Modified: stable/7/share/man/man9/sbuf.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man9/sbuf.9 ============================================================================== --- stable/7/share/man/man9/sbuf.9 Wed Feb 1 16:40:59 2012 (r230869) +++ stable/7/share/man/man9/sbuf.9 Wed Feb 1 17:04:14 2012 (r230870) @@ -380,7 +380,8 @@ function returns the actual string; only works on a finished .Fa sbuf . The -.Fn sbuf_len function returns the length of the string. +.Fn sbuf_len +function returns the length of the string. For an .Fa sbuf with an attached drain, From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 17:07:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD640106566C; Wed, 1 Feb 2012 17:07:29 +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 BBD0D8FC08; Wed, 1 Feb 2012 17:07:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11H7TTA096441; Wed, 1 Feb 2012 17:07:29 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11H7Tmc096439; Wed, 1 Feb 2012 17:07:29 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201202011707.q11H7Tmc096439@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 1 Feb 2012 17:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230871 - stable/7/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 17:07:29 -0000 Author: jh Date: Wed Feb 1 17:07:29 2012 New Revision: 230871 URL: http://svn.freebsd.org/changeset/base/230871 Log: MFC r228359: sbuf_data() hasn't returned NULL for overflowed buffers since r71721. Modified: stable/7/share/man/man9/sbuf.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man9/sbuf.9 ============================================================================== --- stable/7/share/man/man9/sbuf.9 Wed Feb 1 17:04:14 2012 (r230870) +++ stable/7/share/man/man9/sbuf.9 Wed Feb 1 17:07:29 2012 (r230871) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2011 +.Dd December 9, 2011 .Dt SBUF 9 .Os .Sh NAME @@ -456,12 +456,8 @@ function returns a non-zero value if the buffer overflowed, and zero otherwise. .Pp The -.Fn sbuf_data -and .Fn sbuf_len -functions return -.Dv NULL -and \-1, respectively, if the buffer overflowed. +function returns \-1 if the buffer overflowed. .Pp The .Fn sbuf_copyin From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 17:17:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6E841065670 for ; Wed, 1 Feb 2012 17:17:20 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo-p00-ob6.rzone.de (mo-p00-ob6.rzone.de [IPv6:2a01:238:20a:202:53f0::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6B3528FC13 for ; Wed, 1 Feb 2012 17:17:20 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/avgusCdvwXOZ/NA7x/bslxlDPy6G726REW7piU2JIqNTwRM= X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de ([2001:6f8:13f0:0:5e26:aff:fe1e:99a9]) by smtp.strato.de (fruni mo11) (RZmta 27.6 AUTH) with (DHE-RSA-AES128-SHA encrypted) ESMTPA id 0033bao11FPsek for ; Wed, 1 Feb 2012 18:16:59 +0100 (MET) Received: by britannica.bec.de (sSMTP sendmail emulation); Wed, 01 Feb 2012 18:16:58 +0100 Date: Wed, 1 Feb 2012 18:16:58 +0100 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Message-ID: <20120201171658.GA8438@britannica.bec.de> References: <201202011333.q11DXrlQ089030@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201202011333.q11DXrlQ089030@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: svn commit: r230864 - in head: lib/libc/amd64/gen lib/libc/arm/gen lib/libc/i386/gen lib/libc/ia64/gen lib/libc/mips/gen lib/libc/powerpc/gen lib/libc/powerpc64/gen lib/libc/sparc64/gen sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 17:17:20 -0000 On Wed, Feb 01, 2012 at 01:33:53PM +0000, Konstantin Belousov wrote: > Log: > Make the sys/ucontext.h self-contained by changing the return type > of __getcontextx_size(3) from size_t to int. Are you sure that this doesn't break the ABI? That is: are you sure that it doesn't return garbage in the higher 32bit on LP64 platforms? Joerg From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 17:56:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F541106564A; Wed, 1 Feb 2012 17:56:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C8178FC12; Wed, 1 Feb 2012 17:56:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11HudFS098045; Wed, 1 Feb 2012 17:56:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11HudOk098043; Wed, 1 Feb 2012 17:56:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202011756.q11HudOk098043@svn.freebsd.org> From: Alexander Motin Date: Wed, 1 Feb 2012 17:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230872 - stable/9/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 17:56:39 -0000 Author: mav Date: Wed Feb 1 17:56:38 2012 New Revision: 230872 URL: http://svn.freebsd.org/changeset/base/230872 Log: MFC r228820, r228851: Merge to da driver quirks hinting 4K physical sector sizes for SATA disks connected via SAS or USB. Unluckily I've found that SAS (mps) and USB-SATA I have translate models in different ways, requiring twice more quirks. Unluckily for Hitachi, their model names are trimmed on SAS, making impossible to identify 4K sector drives that way. Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Wed Feb 1 17:07:29 2012 (r230871) +++ stable/9/sys/cam/scsi/scsi_da.c Wed Feb 1 17:56:38 2012 (r230872) @@ -89,7 +89,8 @@ typedef enum { DA_Q_NONE = 0x00, DA_Q_NO_SYNC_CACHE = 0x01, DA_Q_NO_6_BYTE = 0x02, - DA_Q_NO_PREVENT = 0x04 + DA_Q_NO_PREVENT = 0x04, + DA_Q_4K = 0x08 } da_quirks; typedef enum { @@ -112,6 +113,8 @@ struct disk_params { u_int8_t secs_per_track; u_int32_t secsize; /* Number of bytes/sector */ u_int64_t sectors; /* total number sectors */ + u_int stripesize; + u_int stripeoffset; }; struct da_softc { @@ -565,7 +568,223 @@ static struct da_quirk_entry da_quirk_ta */ {T_DIRECT, SIP_MEDIA_REMOVABLE, "Sony", "Sony DSC", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE | DA_Q_NO_PREVENT - } + }, + /* ATA/SATA devices over SAS/USB/... */ + { + /* Hitachi Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "Hitachi", "H??????????E3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Samsung Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG HD155UI*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Samsung Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "HD155UI*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Samsung Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG HD204UI*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Samsung Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "HD204UI*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Barracuda Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST????DL*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Barracuda Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST????DL", "*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Barracuda Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST???DM*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Barracuda Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST???DM*", "*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Barracuda Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST????DM*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Barracuda Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST????DM", "*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9500423AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST950042", "3AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9500424AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST950042", "4AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9640423AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST964042", "3AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9640424AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST964042", "4AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9750420AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST975042", "0AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9750422AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST975042", "2AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9750423AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST975042", "3AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Thin Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST???LT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Thin Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST???LT*", "*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD????RS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "??RS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD????RX*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "??RX*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD??????RS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "????RS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD??????RX*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "????RX*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Black Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD???PKT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Black Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "?PKT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Black Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD?????PKT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Black Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "???PKT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Blue Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD???PVT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Blue Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "?PVT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Blue Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD?????PVT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Blue Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "???PVT*", "*" }, + /*quirks*/DA_Q_4K + }, }; static disk_strategy_t dastrategy; @@ -586,7 +805,7 @@ static int daerror(union ccb *ccb, u_i static void daprevent(struct cam_periph *periph, int action); static int dagetcapacity(struct cam_periph *periph); static void dasetgeom(struct cam_periph *periph, uint32_t block_len, - uint64_t maxsector); + uint64_t maxsector, u_int lbppbe, u_int lalba); static timeout_t dasendorderedtag; static void dashutdown(void *arg, int howto); @@ -688,6 +907,8 @@ daopen(struct disk *dp) softc->disk->d_sectorsize = softc->params.secsize; softc->disk->d_mediasize = softc->params.secsize * (off_t)softc->params.sectors; + softc->disk->d_stripesize = softc->params.stripesize; + softc->disk->d_stripeoffset = softc->params.stripeoffset; /* XXX: these are not actually "firmware" values, so they may be wrong */ softc->disk->d_fwsectors = softc->params.secs_per_track; softc->disk->d_fwheads = softc->params.heads; @@ -1759,7 +1980,7 @@ dadone(struct cam_periph *periph, union announce_buf[0] = '\0'; cam_periph_invalidate(periph); } else { - dasetgeom(periph, block_size, maxsector); + dasetgeom(periph, block_size, maxsector, 0, 0); dp = &softc->params; snprintf(announce_buf, sizeof(announce_buf), "%juMB (%ju %u byte sectors: %dH %dS/T " @@ -2091,7 +2312,7 @@ done: (uintmax_t) block_len); error = EINVAL; } else - dasetgeom(periph, block_len, maxsector); + dasetgeom(periph, block_len, maxsector, 0, 0); } xpt_release_ccb(ccb); @@ -2102,7 +2323,8 @@ done: } static void -dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector) +dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, + u_int lbppbe, u_int lalba) { struct ccb_calc_geometry ccg; struct da_softc *softc; @@ -2113,6 +2335,17 @@ dasetgeom(struct cam_periph *periph, uin dp = &softc->params; dp->secsize = block_len; dp->sectors = maxsector + 1; + if (lbppbe > 0) { + dp->stripesize = block_len << lbppbe; + dp->stripeoffset = (dp->stripesize - block_len * lalba) % + dp->stripesize; + } else if (softc->quirks & DA_Q_4K) { + dp->stripesize = 4096; + dp->stripeoffset = 0; + } else { + dp->stripesize = 0; + dp->stripeoffset = 0; + } /* * Have the controller provide us with a geometry * for this disk. The only time the geometry From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 18:02:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41E9D106566C; Wed, 1 Feb 2012 18:02:14 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30F438FC0C; Wed, 1 Feb 2012 18:02:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11I2ENL098299; Wed, 1 Feb 2012 18:02:14 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11I2DXw098297; Wed, 1 Feb 2012 18:02:13 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202011802.q11I2DXw098297@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 1 Feb 2012 18:02: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: r230873 - head/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 18:02:14 -0000 Author: trociny Date: Wed Feb 1 18:02:13 2012 New Revision: 230873 URL: http://svn.freebsd.org/changeset/base/230873 Log: Try to avoid ambiguity when sysctl returns ENOMEM additionally checking the returned oldlen: when ENOMEM is due to the supplied buffer being too short the return oldlen is equal to buffer size. Without this additional check kvm_getprocs() gets stuck in loop if the returned ENOMEM was due the exceeded memorylocked limit. This is easily can be observed running `limits -l 1k top'. Submitted by: Andrey Zonov MFC after: 1 week Modified: head/lib/libkvm/kvm_proc.c Modified: head/lib/libkvm/kvm_proc.c ============================================================================== --- head/lib/libkvm/kvm_proc.c Wed Feb 1 17:56:38 2012 (r230872) +++ head/lib/libkvm/kvm_proc.c Wed Feb 1 18:02:13 2012 (r230873) @@ -474,7 +474,7 @@ struct kinfo_proc * kvm_getprocs(kvm_t *kd, int op, int arg, int *cnt) { int mib[4], st, nprocs; - size_t size; + size_t size, osize; int temp_op; if (kd->procbase != 0) { @@ -524,10 +524,11 @@ kvm_getprocs(kvm_t *kd, int op, int arg, _kvm_realloc(kd, kd->procbase, size); if (kd->procbase == 0) return (0); + osize = size; st = sysctl(mib, temp_op == KERN_PROC_ALL || temp_op == KERN_PROC_PROC ? 3 : 4, kd->procbase, &size, NULL, 0); - } while (st == -1 && errno == ENOMEM); + } while (st == -1 && errno == ENOMEM && size == osize); if (st == -1) { _kvm_syserr(kd, kd->program, "kvm_getprocs"); return (0); From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 18:03:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61004106566B; Wed, 1 Feb 2012 18:03:22 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5004E8FC13; Wed, 1 Feb 2012 18:03:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11I3M43098368; Wed, 1 Feb 2012 18:03:22 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11I3MDf098366; Wed, 1 Feb 2012 18:03:22 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202011803.q11I3MDf098366@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 1 Feb 2012 18:03: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: r230874 - head/usr.bin/sockstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 18:03:22 -0000 Author: trociny Date: Wed Feb 1 18:03:21 2012 New Revision: 230874 URL: http://svn.freebsd.org/changeset/base/230874 Log: Try to avoid ambiguity when sysctl returns ENOMEM additionally checking the returned oldlen: when ENOMEM is due to the supplied buffer being too short the return oldlen is equal to buffer size. Without this additional check sockstat gets stuck in loop leaking the memory if the returned ENOMEM was due the exceeded memorylocked limit. This is easily can be observed running `limits -l 1k sockstat'. Submitted by: Andrey Zonov MFC after: 1 week Modified: head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Wed Feb 1 18:02:13 2012 (r230873) +++ head/usr.bin/sockstat/sockstat.c Wed Feb 1 18:03:21 2012 (r230874) @@ -296,7 +296,7 @@ gather_inet(int proto) break; if (errno == ENOENT) goto out; - if (errno != ENOMEM) + if (errno != ENOMEM || len != bufsize) err(1, "sysctlbyname()"); bufsize *= 2; } @@ -424,7 +424,7 @@ gather_unix(int proto) len = bufsize; if (sysctlbyname(varname, buf, &len, NULL, 0) == 0) break; - if (errno != ENOMEM) + if (errno != ENOMEM || len != bufsize) err(1, "sysctlbyname()"); bufsize *= 2; } @@ -476,14 +476,15 @@ out: static void getfiles(void) { - size_t len; + size_t len, olen; - if ((xfiles = malloc(len = sizeof *xfiles)) == NULL) + olen = len = sizeof *xfiles; + if ((xfiles = malloc(len)) == NULL) err(1, "malloc()"); while (sysctlbyname("kern.file", xfiles, &len, 0, 0) == -1) { - if (errno != ENOMEM) + if (errno != ENOMEM || len != olen) err(1, "sysctlbyname()"); - len *= 2; + olen = len *= 2; if ((xfiles = realloc(xfiles, len)) == NULL) err(1, "realloc()"); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 18:05:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 944811065670; Wed, 1 Feb 2012 18:05:55 +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 775D28FC08; Wed, 1 Feb 2012 18:05:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11I5tFA098486; Wed, 1 Feb 2012 18:05:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11I5tqE098484; Wed, 1 Feb 2012 18:05:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202011805.q11I5tqE098484@svn.freebsd.org> From: Alexander Motin Date: Wed, 1 Feb 2012 18:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230875 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 18:05:55 -0000 Author: mav Date: Wed Feb 1 18:05:54 2012 New Revision: 230875 URL: http://svn.freebsd.org/changeset/base/230875 Log: MFC r228820, r228851: Merge to da driver quirks hinting 4K physical sector sizes for SATA disks connected via SAS or USB. Unluckily I've found that SAS (mps) and USB-SATA I have translate models in different ways, requiring twice more quirks. Unluckily for Hitachi, their model names are trimmed on SAS, making impossible to identify 4K sector drives that way. Modified: stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Wed Feb 1 18:03:21 2012 (r230874) +++ stable/8/sys/cam/scsi/scsi_da.c Wed Feb 1 18:05:54 2012 (r230875) @@ -88,7 +88,8 @@ typedef enum { DA_Q_NONE = 0x00, DA_Q_NO_SYNC_CACHE = 0x01, DA_Q_NO_6_BYTE = 0x02, - DA_Q_NO_PREVENT = 0x04 + DA_Q_NO_PREVENT = 0x04, + DA_Q_4K = 0x08 } da_quirks; typedef enum { @@ -111,6 +112,8 @@ struct disk_params { u_int8_t secs_per_track; u_int32_t secsize; /* Number of bytes/sector */ u_int64_t sectors; /* total number sectors */ + u_int stripesize; + u_int stripeoffset; }; struct da_softc { @@ -563,7 +566,223 @@ static struct da_quirk_entry da_quirk_ta */ {T_DIRECT, SIP_MEDIA_REMOVABLE, "Sony", "Sony DSC", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE | DA_Q_NO_PREVENT - } + }, + /* ATA/SATA devices over SAS/USB/... */ + { + /* Hitachi Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "Hitachi", "H??????????E3*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Samsung Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG HD155UI*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Samsung Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "HD155UI*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Samsung Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG HD204UI*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Samsung Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "HD204UI*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Barracuda Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST????DL*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Barracuda Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST????DL", "*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Barracuda Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST???DM*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Barracuda Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST???DM*", "*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Barracuda Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST????DM*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Barracuda Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST????DM", "*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9500423AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST950042", "3AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9500424AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST950042", "4AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9640423AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST964042", "3AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9640424AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST964042", "4AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9750420AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST975042", "0AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9750422AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST975042", "2AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST9750423AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST975042", "3AS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Thin Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST???LT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* Seagate Momentus Thin Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ST???LT*", "*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD????RS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "??RS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD????RX*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "??RX*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD??????RS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "????RS*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD??????RX*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Caviar Green Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "????RX*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Black Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD???PKT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Black Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "?PKT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Black Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD?????PKT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Black Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "???PKT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Blue Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD???PVT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Blue Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "?PVT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Blue Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "WDC WD?????PVT*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* WDC Scorpio Blue Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "WDC WD??", "???PVT*", "*" }, + /*quirks*/DA_Q_4K + }, }; static disk_strategy_t dastrategy; @@ -584,7 +803,7 @@ static int daerror(union ccb *ccb, u_i static void daprevent(struct cam_periph *periph, int action); static int dagetcapacity(struct cam_periph *periph); static void dasetgeom(struct cam_periph *periph, uint32_t block_len, - uint64_t maxsector); + uint64_t maxsector, u_int lbppbe, u_int lalba); static timeout_t dasendorderedtag; static void dashutdown(void *arg, int howto); @@ -686,6 +905,8 @@ daopen(struct disk *dp) softc->disk->d_sectorsize = softc->params.secsize; softc->disk->d_mediasize = softc->params.secsize * (off_t)softc->params.sectors; + softc->disk->d_stripesize = softc->params.stripesize; + softc->disk->d_stripeoffset = softc->params.stripeoffset; /* XXX: these are not actually "firmware" values, so they may be wrong */ softc->disk->d_fwsectors = softc->params.secs_per_track; softc->disk->d_fwheads = softc->params.heads; @@ -1661,7 +1882,7 @@ dadone(struct cam_periph *periph, union announce_buf[0] = '\0'; cam_periph_invalidate(periph); } else { - dasetgeom(periph, block_size, maxsector); + dasetgeom(periph, block_size, maxsector, 0, 0); dp = &softc->params; snprintf(announce_buf, sizeof(announce_buf), "%juMB (%ju %u byte sectors: %dH %dS/T " @@ -1992,7 +2213,7 @@ done: (uintmax_t) block_len); error = EINVAL; } else - dasetgeom(periph, block_len, maxsector); + dasetgeom(periph, block_len, maxsector, 0, 0); } xpt_release_ccb(ccb); @@ -2003,7 +2224,8 @@ done: } static void -dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector) +dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, + u_int lbppbe, u_int lalba) { struct ccb_calc_geometry ccg; struct da_softc *softc; @@ -2014,6 +2236,17 @@ dasetgeom(struct cam_periph *periph, uin dp = &softc->params; dp->secsize = block_len; dp->sectors = maxsector + 1; + if (lbppbe > 0) { + dp->stripesize = block_len << lbppbe; + dp->stripeoffset = (dp->stripesize - block_len * lalba) % + dp->stripesize; + } else if (softc->quirks & DA_Q_4K) { + dp->stripesize = 4096; + dp->stripeoffset = 0; + } else { + dp->stripesize = 0; + dp->stripeoffset = 0; + } /* * Have the controller provide us with a geometry * for this disk. The only time the geometry From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 19:46:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C28A9106564A; Wed, 1 Feb 2012 19:46:12 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9658D8FC0A; Wed, 1 Feb 2012 19:46:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11JkCXU001721; Wed, 1 Feb 2012 19:46:12 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11JkCEI001718; Wed, 1 Feb 2012 19:46:12 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201202011946.q11JkCEI001718@svn.freebsd.org> From: Davide Italiano Date: Wed, 1 Feb 2012 19:46: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: r230876 - in head: share/misc usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 19:46:12 -0000 Author: davide Date: Wed Feb 1 19:46:12 2012 New Revision: 230876 URL: http://svn.freebsd.org/changeset/base/230876 Log: Add myself to the relevant docs. Approved by: alc, gnn (mentors) Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Feb 1 18:05:54 2012 (r230875) +++ head/share/misc/committers-src.dot Wed Feb 1 19:46:12 2012 (r230876) @@ -118,6 +118,7 @@ cokane [label="Coleman Kane\ncokane@Free cperciva [label="Colin Percival\ncperciva@FreeBSD.org\n2004/01/20"] csjp [label="Christian S.J. Peron\ncsjp@FreeBSD.org\n2004/05/04"] das [label="David Schultz\ndas@FreeBSD.org\n2003/02/21"] +davide [label="Davide Italiano\ndavide@FreeBSD.org\n2012/01/27"] davidxu [label="David Xu\ndavidxu@FreeBSD.org\n2002/09/02"] dchagin [label="Dmitry Chagin\ndchagin@FreeBSD.org\n2009/02/28"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2004/09/14"] @@ -284,6 +285,8 @@ adrian -> rmh ae -> melifaro +alc -> davide + andre -> qingli anholt -> jkim @@ -376,6 +379,7 @@ gnn -> ivoras gnn -> vanhu gnn -> lstewart gnn -> np +gnn -> davide grog -> edwin grog -> le Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Feb 1 18:05:54 2012 (r230875) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Feb 1 19:46:12 2012 (r230876) @@ -217,6 +217,7 @@ 07/11 Jesus R. Camou born in Hermosillo, Sonora, Mexico, 1983 07/15 Gary Jennejohn born in Rochester, New York, United States, 1950 07/16 Suleiman Souhlal born in Roma, Italy, 1983 +07/16 Davide Italiano born in Milazzo, Italy, 1989 07/17 Michael Chin-Yuan Wu born in Taipei, Taiwan, Republic of China, 1980 07/19 Masafumi NAKANE born in Okazaki, Aichi, Japan, 1972 07/19 Simon L. Nielsen born in Copenhagen, Denmark, 1980 From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 20:12:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD0F71065676; Wed, 1 Feb 2012 20:12: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 CC2398FC12; Wed, 1 Feb 2012 20:12:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11KCii2002626; Wed, 1 Feb 2012 20:12:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11KCiYi002624; Wed, 1 Feb 2012 20:12:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202012012.q11KCiYi002624@svn.freebsd.org> From: Alexander Motin Date: Wed, 1 Feb 2012 20:12: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: r230877 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 20:12:45 -0000 Author: mav Date: Wed Feb 1 20:12:44 2012 New Revision: 230877 URL: http://svn.freebsd.org/changeset/base/230877 Log: Fix NULL dereference panic on attempt to turn off (on system shutdown) disconnected swap device. This is quick and imperfect solution, as swap device will still be opened and GEOM will not be able to destroy it. Proper solution would be to automatically turn off and close disconnected swap device, but with existing code it will cause panic if there is at least one page on device, even if it is unimportant page of the user-level process. It needs some work. Reviewed by: kib@ MFC after: 1 week Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Feb 1 19:46:12 2012 (r230876) +++ head/sys/vm/swap_pager.c Wed Feb 1 20:12:44 2012 (r230877) @@ -2521,7 +2521,7 @@ swapgeom_orphan(struct g_consumer *cp) mtx_lock(&sw_dev_mtx); TAILQ_FOREACH(sp, &swtailq, sw_list) if (sp->sw_id == cp) - sp->sw_id = NULL; + sp->sw_flags |= SW_CLOSING; mtx_unlock(&sw_dev_mtx); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 20:18:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FBFF106566C; Wed, 1 Feb 2012 20:18:57 +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 8EFAD8FC14; Wed, 1 Feb 2012 20:18:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11KIvrL002895; Wed, 1 Feb 2012 20:18:57 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11KIvae002893; Wed, 1 Feb 2012 20:18:57 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202012018.q11KIvae002893@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 1 Feb 2012 20:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230878 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 20:18:57 -0000 Author: ken Date: Wed Feb 1 20:18:57 2012 New Revision: 230878 URL: http://svn.freebsd.org/changeset/base/230878 Log: Add the netback driver to the build. MFC after: 3 days Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Feb 1 20:12:44 2012 (r230877) +++ head/sys/conf/files Wed Feb 1 20:18:57 2012 (r230878) @@ -3532,6 +3532,7 @@ dev/xen/blkback/blkback.c optional xen | dev/xen/console/console.c optional xen dev/xen/console/xencons_ring.c optional xen dev/xen/control/control.c optional xen | xenhvm +dev/xen/netback/netback.c optional xen | xenhvm dev/xen/netfront/netfront.c optional xen | xenhvm dev/xen/xenpci/xenpci.c optional xenpci dev/xen/xenpci/evtchn.c optional xenpci From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 20:19:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C45D1065676; Wed, 1 Feb 2012 20:19:34 +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 3B3D58FC1A; Wed, 1 Feb 2012 20:19:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11KJYpB002951; Wed, 1 Feb 2012 20:19:34 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11KJYPl002949; Wed, 1 Feb 2012 20:19:34 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202012019.q11KJYPl002949@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 1 Feb 2012 20:19:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230879 - head/sys/xen/interface/io X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 20:19:34 -0000 Author: ken Date: Wed Feb 1 20:19:33 2012 New Revision: 230879 URL: http://svn.freebsd.org/changeset/base/230879 Log: Add the GSO prefix descriptor define. MFC after: 3 days Modified: head/sys/xen/interface/io/netif.h Modified: head/sys/xen/interface/io/netif.h ============================================================================== --- head/sys/xen/interface/io/netif.h Wed Feb 1 20:18:57 2012 (r230878) +++ head/sys/xen/interface/io/netif.h Wed Feb 1 20:19:33 2012 (r230879) @@ -173,6 +173,10 @@ typedef struct netif_rx_request netif_rx #define _NETRXF_extra_info (3) #define NETRXF_extra_info (1U<<_NETRXF_extra_info) +/* GSO Prefix descriptor. */ +#define _NETRXF_gso_prefix (4) +#define NETRXF_gso_prefix (1U<<_NETRXF_gso_prefix) + struct netif_rx_response { uint16_t id; uint16_t offset; /* Offset in page of start of received packet */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 20:32:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 2B5B6106566C; Wed, 1 Feb 2012 20:32:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 901B914EE02; Wed, 1 Feb 2012 20:32:00 +0000 (UTC) Message-ID: <4F29A13F.20403@FreeBSD.org> Date: Wed, 01 Feb 2012 12:31:59 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Guy Helmer References: <201202011641.q11Gf0j6095461@svn.freebsd.org> In-Reply-To: <201202011641.q11Gf0j6095461@svn.freebsd.org> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 20:32:02 -0000 Thanks! Sorry I didn't get a chance to reply to your last message, totally buried lately. Doug On 02/01/2012 08:41, Guy Helmer wrote: > Author: ghelmer > Date: Wed Feb 1 16:40:59 2012 > New Revision: 230869 > URL: http://svn.freebsd.org/changeset/base/230869 > > Log: > Change the notes about the pidfile to include Doug's preference > for pre-creating the pidfile with appropriate owner and permissions. > > Requested by dougb > > Modified: > head/usr.sbin/daemon/daemon.8 > > Modified: head/usr.sbin/daemon/daemon.8 > ============================================================================== > --- head/usr.sbin/daemon/daemon.8 Wed Feb 1 15:57:49 2012 (r230868) > +++ head/usr.sbin/daemon/daemon.8 Wed Feb 1 16:40:59 2012 (r230869) > @@ -61,8 +61,9 @@ using the > functionality. > If the > .Fl u > -option is used, the directory to contain the pidfile must be writable > -by the specified user. > +option is used, either the pidfile needs to have been pre-created > +with appropriate ownership and permissions, or the directory to contain > +the pidfile must be writable by the specified user. > Note, that the file will be created shortly before the process is > actually executed, and will remain after the process exits (although > it will be removed if the execution fails). > -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:08:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AF38106566B; Wed, 1 Feb 2012 21:08:34 +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 3EA8C8FC0C; Wed, 1 Feb 2012 21:08:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11L8YcG004714; Wed, 1 Feb 2012 21:08:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11L8YEL004711; Wed, 1 Feb 2012 21:08:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012108.q11L8YEL004711@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230880 - stable/9/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:08:34 -0000 Author: marius Date: Wed Feb 1 21:08:33 2012 New Revision: 230880 URL: http://svn.freebsd.org/changeset/base/230880 Log: MFC: r230627 Using ATA_CAM along with ATAPI DMA causes data corruption with ALI_NEW and CMD controllers for reasons unknown so disable it. PR: 164226 Modified: stable/9/sys/dev/ata/chipsets/ata-acerlabs.c stable/9/sys/dev/ata/chipsets/ata-siliconimage.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-acerlabs.c Wed Feb 1 20:19:33 2012 (r230879) +++ stable/9/sys/dev/ata/chipsets/ata-acerlabs.c Wed Feb 1 21:08:33 2012 (r230880) @@ -213,6 +213,10 @@ ata_ali_ch_attach(device_t dev) if (ch->dma.max_iosize > 256 * 512) ch->dma.max_iosize = 256 * 512; } +#ifdef ATA_CAM + if (ctlr->chip->cfg2 & ALI_NEW) + ch->flags |= ATA_NO_ATAPI_DMA; +#endif return 0; } Modified: stable/9/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-siliconimage.c Wed Feb 1 20:19:33 2012 (r230879) +++ stable/9/sys/dev/ata/chipsets/ata-siliconimage.c Wed Feb 1 21:08:33 2012 (r230880) @@ -240,6 +240,10 @@ ata_cmd_ch_attach(device_t dev) if (ctlr->chip->cfg2 & SII_INTR) ch->hw.status = ata_cmd_status; +#ifdef ATA_CAM + ch->flags |= ATA_NO_ATAPI_DMA; +#endif + return 0; } From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:08:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71B311065672; Wed, 1 Feb 2012 21:08:36 +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 5FEC48FC16; Wed, 1 Feb 2012 21:08:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11L8a90004745; Wed, 1 Feb 2012 21:08:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11L8aoF004742; Wed, 1 Feb 2012 21:08:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012108.q11L8aoF004742@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230881 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:08:36 -0000 Author: marius Date: Wed Feb 1 21:08:35 2012 New Revision: 230881 URL: http://svn.freebsd.org/changeset/base/230881 Log: MFC: r230627 Using ATA_CAM along with ATAPI DMA causes data corruption with ALI_NEW and CMD controllers for reasons unknown so disable it. PR: 164226 Modified: stable/8/sys/dev/ata/chipsets/ata-acerlabs.c stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-acerlabs.c Wed Feb 1 21:08:33 2012 (r230880) +++ stable/8/sys/dev/ata/chipsets/ata-acerlabs.c Wed Feb 1 21:08:35 2012 (r230881) @@ -213,6 +213,10 @@ ata_ali_ch_attach(device_t dev) if (ch->dma.max_iosize > 256 * 512) ch->dma.max_iosize = 256 * 512; } +#ifdef ATA_CAM + if (ctlr->chip->cfg2 & ALI_NEW) + ch->flags |= ATA_NO_ATAPI_DMA; +#endif return 0; } Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Wed Feb 1 21:08:33 2012 (r230880) +++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Wed Feb 1 21:08:35 2012 (r230881) @@ -240,6 +240,10 @@ ata_cmd_ch_attach(device_t dev) if (ctlr->chip->cfg2 & SII_INTR) ch->hw.status = ata_cmd_status; +#ifdef ATA_CAM + ch->flags |= ATA_NO_ATAPI_DMA; +#endif + return 0; } From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:10:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E5961065672; Wed, 1 Feb 2012 21:10:00 +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 4B5368FC13; Wed, 1 Feb 2012 21:10:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LA0Vg004860; Wed, 1 Feb 2012 21:10:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LA008004853; Wed, 1 Feb 2012 21:10:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012110.q11LA008004853@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230882 - stable/9/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:10:00 -0000 Author: marius Date: Wed Feb 1 21:09:59 2012 New Revision: 230882 URL: http://svn.freebsd.org/changeset/base/230882 Log: MFC: r230630 For machines where the kernel address space is unrestricted increase VM_KMEM_SIZE_SCALE to 2, awaiting more insight from alc@. As it turns out, the VM apparently has problems with machines that have large holes in the physical address space, causing the kmem_suballoc() call in kmeminit() to fail with a VM_KMEM_SIZE_SCALE of 1. Using a value of 2 allows these, namely Blade 1500 with 2GB of RAM, to boot. PR: 164227 Modified: stable/9/sys/sparc64/include/vmparam.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/include/vmparam.h ============================================================================== --- stable/9/sys/sparc64/include/vmparam.h Wed Feb 1 21:08:35 2012 (r230881) +++ stable/9/sys/sparc64/include/vmparam.h Wed Feb 1 21:09:59 2012 (r230882) @@ -218,7 +218,7 @@ * is the total KVA space allocated for kmem_map. */ #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (tsb_kernel_ldd_phys == 0 ? 3 : 1) +#define VM_KMEM_SIZE_SCALE (tsb_kernel_ldd_phys == 0 ? 3 : 2) #endif /* From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:10:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1486D106566B; Wed, 1 Feb 2012 21:10:01 +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 F24818FC14; Wed, 1 Feb 2012 21:10:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LA0ix004880; Wed, 1 Feb 2012 21:10:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LA0dB004878; Wed, 1 Feb 2012 21:10:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012110.q11LA0dB004878@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230883 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:10:01 -0000 Author: marius Date: Wed Feb 1 21:10:00 2012 New Revision: 230883 URL: http://svn.freebsd.org/changeset/base/230883 Log: MFC: r230630 For machines where the kernel address space is unrestricted increase VM_KMEM_SIZE_SCALE to 2, awaiting more insight from alc@. As it turns out, the VM apparently has problems with machines that have large holes in the physical address space, causing the kmem_suballoc() call in kmeminit() to fail with a VM_KMEM_SIZE_SCALE of 1. Using a value of 2 allows these, namely Blade 1500 with 2GB of RAM, to boot. PR: 164227 Modified: stable/8/sys/sparc64/include/vmparam.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/sparc64/include/vmparam.h ============================================================================== --- stable/8/sys/sparc64/include/vmparam.h Wed Feb 1 21:09:59 2012 (r230882) +++ stable/8/sys/sparc64/include/vmparam.h Wed Feb 1 21:10:00 2012 (r230883) @@ -222,7 +222,7 @@ * is the total KVA space allocated for kmem_map. */ #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (tsb_kernel_ldd_phys == 0 ? 3 : 1) +#define VM_KMEM_SIZE_SCALE (tsb_kernel_ldd_phys == 0 ? 3 : 2) #endif /* From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:11:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4767C106566B; Wed, 1 Feb 2012 21:11:07 +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 358C18FC16; Wed, 1 Feb 2012 21:11:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LB7ED004999; Wed, 1 Feb 2012 21:11:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LB7AH004997; Wed, 1 Feb 2012 21:11:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012111.q11LB7AH004997@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230884 - stable/9/sys/dev/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:11:07 -0000 Author: marius Date: Wed Feb 1 21:11:06 2012 New Revision: 230884 URL: http://svn.freebsd.org/changeset/base/230884 Log: MFC: r230631 Implement OF_printf() using kvprintf() directly, avoiding to use a buffer and allowing to handle newlines properly. Modified: stable/9/sys/dev/ofw/openfirm.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/ofw/openfirm.c ============================================================================== --- stable/9/sys/dev/ofw/openfirm.c Wed Feb 1 21:10:00 2012 (r230883) +++ stable/9/sys/dev/ofw/openfirm.c Wed Feb 1 21:11:06 2012 (r230884) @@ -72,6 +72,8 @@ __FBSDID("$FreeBSD$"); #include "ofw_if.h" +static void OF_putchar(int c, void *arg); + MALLOC_DEFINE(M_OFWPROP, "openfirm", "Open Firmware properties"); static ihandle_t stdout; @@ -82,7 +84,7 @@ static struct ofw_kobj ofw_kernel_obj; static struct kobj_ops ofw_kernel_kops; /* - * OFW install routines. Highest priority wins, equal priority also + * OFW install routines. Highest priority wins, equal priority also * overrides allowing last-set to win. */ SET_DECLARE(ofw_set, ofw_def_t); @@ -138,15 +140,27 @@ OF_init(void *cookie) return (rv); } +static void +OF_putchar(int c, void *arg __unused) +{ + char cbuf; + + if (c == '\n') { + cbuf = '\r'; + OF_write(stdout, &cbuf, 1); + } + + cbuf = c; + OF_write(stdout, &cbuf, 1); +} + void OF_printf(const char *fmt, ...) { va_list va; - char buf[1024]; va_start(va, fmt); - vsprintf(buf, fmt, va); - OF_write(stdout, buf, strlen(buf)); + (void)kvprintf(fmt, OF_putchar, NULL, 10, va); va_end(va); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:11:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC04F1065805; Wed, 1 Feb 2012 21:11:10 +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 1A7A68FC17; Wed, 1 Feb 2012 21:11:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LB9kN005034; Wed, 1 Feb 2012 21:11:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LB9EU005032; Wed, 1 Feb 2012 21:11:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012111.q11LB9EU005032@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230885 - stable/8/sys/dev/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:11:14 -0000 Author: marius Date: Wed Feb 1 21:11:09 2012 New Revision: 230885 URL: http://svn.freebsd.org/changeset/base/230885 Log: MFC: r230631 Implement OF_printf() using kvprintf() directly, avoiding to use a buffer and allowing to handle newlines properly. Modified: stable/8/sys/dev/ofw/openfirm.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/ofw/openfirm.c ============================================================================== --- stable/8/sys/dev/ofw/openfirm.c Wed Feb 1 21:11:06 2012 (r230884) +++ stable/8/sys/dev/ofw/openfirm.c Wed Feb 1 21:11:09 2012 (r230885) @@ -70,6 +70,8 @@ __FBSDID("$FreeBSD$"); #include "ofw_if.h" +static void OF_putchar(int c, void *arg); + MALLOC_DEFINE(M_OFWPROP, "openfirm", "Open Firmware properties"); static ihandle_t stdout; @@ -80,7 +82,7 @@ static struct ofw_kobj ofw_kernel_obj; static struct kobj_ops ofw_kernel_kops; /* - * OFW install routines. Highest priority wins, equal priority also + * OFW install routines. Highest priority wins, equal priority also * overrides allowing last-set to win. */ SET_DECLARE(ofw_set, ofw_def_t); @@ -131,15 +133,27 @@ OF_init(void *cookie) stdout = -1; } +static void +OF_putchar(int c, void *arg __unused) +{ + char cbuf; + + if (c == '\n') { + cbuf = '\r'; + OF_write(stdout, &cbuf, 1); + } + + cbuf = c; + OF_write(stdout, &cbuf, 1); +} + void OF_printf(const char *fmt, ...) { va_list va; - char buf[1024]; va_start(va, fmt); - vsprintf(buf, fmt, va); - OF_write(stdout, buf, strlen(buf)); + (void)kvprintf(fmt, OF_putchar, NULL, 10, va); va_end(va); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:14:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64189106564A; Wed, 1 Feb 2012 21:14:05 +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 37B798FC14; Wed, 1 Feb 2012 21:14:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LE5kq005189; Wed, 1 Feb 2012 21:14:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LE5Cg005186; Wed, 1 Feb 2012 21:14:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012114.q11LE5Cg005186@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230886 - in stable/9/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:14:05 -0000 Author: marius Date: Wed Feb 1 21:14:04 2012 New Revision: 230886 URL: http://svn.freebsd.org/changeset/base/230886 Log: MFC: r230632 - Now that we have a working OF_printf() since r230631 (MFC'ed to stable/9 in r230884), use it for implementing a simple OF_panic() that may be used during the early cycles when panic() isn't available, yet. - Mark cpu_{exit,shutdown}() as __dead2 as appropriate. Modified: stable/9/sys/sparc64/include/ofw_machdep.h stable/9/sys/sparc64/sparc64/ofw_machdep.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/include/ofw_machdep.h ============================================================================== --- stable/9/sys/sparc64/include/ofw_machdep.h Wed Feb 1 21:11:09 2012 (r230885) +++ stable/9/sys/sparc64/include/ofw_machdep.h Wed Feb 1 21:14:04 2012 (r230886) @@ -37,8 +37,9 @@ typedef uint64_t cell_t; int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); u_int OF_getscsinitid(device_t); -void cpu_shutdown(void *); +void OF_panic(const char *fmt, ...) __dead2 __printflike(1, 2); +void cpu_shutdown(void *) __dead2; int ofw_entry(void *); -void ofw_exit(void *); +void ofw_exit(void *) __dead2; #endif /* _MACHINE_OFW_MACHDEP_H_ */ Modified: stable/9/sys/sparc64/sparc64/ofw_machdep.c ============================================================================== --- stable/9/sys/sparc64/sparc64/ofw_machdep.c Wed Feb 1 21:11:09 2012 (r230885) +++ stable/9/sys/sparc64/sparc64/ofw_machdep.c Wed Feb 1 21:14:04 2012 (r230886) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include void OF_getetheraddr(device_t dev, u_char *addr) @@ -81,6 +82,19 @@ OF_getscsinitid(device_t dev) return (7); } +void +OF_panic(const char *fmt, ...) +{ + char buf[256]; + va_list ap; + + va_start(ap, fmt); + (void)vsnprintf(buf, sizeof(buf), fmt, ap); + OF_printf("OF_panic: %s\n", buf); + va_end(ap); + OF_exit(); +} + static __inline uint32_t phys_hi_mask_space(const char *bus, uint32_t phys_hi) { From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:14:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C14E3106566C; Wed, 1 Feb 2012 21:14:07 +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 94C0B8FC15; Wed, 1 Feb 2012 21:14:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LE7Dg005223; Wed, 1 Feb 2012 21:14:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LE7CC005220; Wed, 1 Feb 2012 21:14:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012114.q11LE7CC005220@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230887 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:14:07 -0000 Author: marius Date: Wed Feb 1 21:14:07 2012 New Revision: 230887 URL: http://svn.freebsd.org/changeset/base/230887 Log: MFC: r230632 - Now that we have a working OF_printf() since r230631 (MFC'ed to stable/8 in r230885), use it for implementing a simple OF_panic() that may be used during the early cycles when panic() isn't available, yet. - Mark cpu_{exit,shutdown}() as __dead2 as appropriate. Modified: stable/8/sys/sparc64/include/ofw_machdep.h stable/8/sys/sparc64/sparc64/ofw_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/sparc64/include/ofw_machdep.h ============================================================================== --- stable/8/sys/sparc64/include/ofw_machdep.h Wed Feb 1 21:14:04 2012 (r230886) +++ stable/8/sys/sparc64/include/ofw_machdep.h Wed Feb 1 21:14:07 2012 (r230887) @@ -37,8 +37,9 @@ typedef uint64_t cell_t; int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); u_int OF_getscsinitid(device_t); -void cpu_shutdown(void *); +void OF_panic(const char *fmt, ...) __dead2 __printflike(1, 2); +void cpu_shutdown(void *) __dead2; int ofw_entry(void *); -void ofw_exit(void *); +void ofw_exit(void *) __dead2; #endif /* _MACHINE_OFW_MACHDEP_H_ */ Modified: stable/8/sys/sparc64/sparc64/ofw_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/ofw_machdep.c Wed Feb 1 21:14:04 2012 (r230886) +++ stable/8/sys/sparc64/sparc64/ofw_machdep.c Wed Feb 1 21:14:07 2012 (r230887) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include void OF_getetheraddr(device_t dev, u_char *addr) @@ -81,6 +82,19 @@ OF_getscsinitid(device_t dev) return (7); } +void +OF_panic(const char *fmt, ...) +{ + char buf[256]; + va_list ap; + + va_start(ap, fmt); + (void)vsnprintf(buf, sizeof(buf), fmt, ap); + OF_printf("OF_panic: %s\n", buf); + va_end(ap); + OF_exit(); +} + static __inline uint32_t phys_hi_mask_space(const char *bus, uint32_t phys_hi) { From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:15:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7CC9106566B; Wed, 1 Feb 2012 21:15:24 +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 C63388FC15; Wed, 1 Feb 2012 21:15:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LFO0o005330; Wed, 1 Feb 2012 21:15:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LFO8H005328; Wed, 1 Feb 2012 21:15:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012115.q11LFO8H005328@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230888 - stable/9/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:15:25 -0000 Author: marius Date: Wed Feb 1 21:15:24 2012 New Revision: 230888 URL: http://svn.freebsd.org/changeset/base/230888 Log: MFC: r230628 Mark cpu_{halt,reset}() as __dead2 as appropriate. Modified: stable/9/sys/sparc64/include/cpu.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/include/cpu.h ============================================================================== --- stable/9/sys/sparc64/include/cpu.h Wed Feb 1 21:14:07 2012 (r230887) +++ stable/9/sys/sparc64/include/cpu.h Wed Feb 1 21:15:24 2012 (r230888) @@ -53,8 +53,8 @@ extern char btext[]; extern char etext[]; void cheetah_init(u_int cpu_impl); -void cpu_halt(void); -void cpu_reset(void); +void cpu_halt(void) __dead2; +void cpu_reset(void) __dead2; void fork_trampoline(void); void swi_vm(void *v); void zeus_init(u_int cpu_impl); From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:15:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A18A106564A; Wed, 1 Feb 2012 21:15:28 +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 EC8558FC08; Wed, 1 Feb 2012 21:15:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LFRDq005365; Wed, 1 Feb 2012 21:15:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LFRTm005363; Wed, 1 Feb 2012 21:15:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012115.q11LFRTm005363@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230889 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:15:28 -0000 Author: marius Date: Wed Feb 1 21:15:27 2012 New Revision: 230889 URL: http://svn.freebsd.org/changeset/base/230889 Log: MFC: r230628 Mark cpu_{halt,reset}() as __dead2 as appropriate. Modified: stable/8/sys/sparc64/include/cpu.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/sparc64/include/cpu.h ============================================================================== --- stable/8/sys/sparc64/include/cpu.h Wed Feb 1 21:15:24 2012 (r230888) +++ stable/8/sys/sparc64/include/cpu.h Wed Feb 1 21:15:27 2012 (r230889) @@ -53,8 +53,8 @@ extern char btext[]; extern char etext[]; void cheetah_init(u_int cpu_impl); -void cpu_halt(void); -void cpu_reset(void); +void cpu_halt(void) __dead2; +void cpu_reset(void) __dead2; void fork_trampoline(void); void swi_vm(void *v); void zeus_init(u_int cpu_impl); From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:19:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59FBE106564A; Wed, 1 Feb 2012 21:19:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46B9F8FC16; Wed, 1 Feb 2012 21:19:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LJrwi005587; Wed, 1 Feb 2012 21:19:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LJrQN005581; Wed, 1 Feb 2012 21:19:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012119.q11LJrQN005581@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230890 - in stable/9/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:19:53 -0000 Author: marius Date: Wed Feb 1 21:19:52 2012 New Revision: 230890 URL: http://svn.freebsd.org/changeset/base/230890 Log: MFC: r230633, r230634 Now that we have a working OF_printf() since r230631 and a OF_panic() helper since r230632 (MFC'ed to stable/9 in r230884 and r230886 respectively), use these for output and panicing during the early cycles and move cninit() until after the static per-CPU data has been set up. This solves a couple of issue regarding the non- availability of the static per-CPU data: - panic() not working and only making things worse when called, - having to supply a special DELAY() implementation to the low-level console drivers, - curthread accesses of mutex(9) usage in low-level console drivers that aren't conditional due to compiler optimizations (basically, this is the problem described in r227537 but in this case for keyboards attached via uart(4)). [1] PR: 164123 [1] Modified: stable/9/sys/sparc64/include/clock.h stable/9/sys/sparc64/sparc64/cache.c stable/9/sys/sparc64/sparc64/clock.c stable/9/sys/sparc64/sparc64/machdep.c stable/9/sys/sparc64/sparc64/pmap.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/include/clock.h ============================================================================== --- stable/9/sys/sparc64/include/clock.h Wed Feb 1 21:15:27 2012 (r230889) +++ stable/9/sys/sparc64/include/clock.h Wed Feb 1 21:19:52 2012 (r230890) @@ -1,27 +1,5 @@ /*- - * Copyright (c) 2001 Jake Burkholder. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * This file is in the public domain. * * $FreeBSD$ */ @@ -29,10 +7,4 @@ #ifndef _MACHINE_CLOCK_H_ #define _MACHINE_CLOCK_H_ -extern void (*delay_func)(int usec); -extern u_long clock_boot; - -void delay_boot(int usec); -void delay_tick(int usec); - #endif /* !_MACHINE_CLOCK_H_ */ Modified: stable/9/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/9/sys/sparc64/sparc64/cache.c Wed Feb 1 21:15:27 2012 (r230889) +++ stable/9/sys/sparc64/sparc64/cache.c Wed Feb 1 21:19:52 2012 (r230890) @@ -142,24 +142,24 @@ cache_init(struct pcpu *pcpu) "l2-cache-line-size", pcpu->pc_cache.ec_linesize) == -1 || OF_GET(pcpu->pc_node, !use_new_prop ? "ecache-associativity" : "l2-cache-associativity", pcpu->pc_cache.ec_assoc) == -1) - panic("cache_init: could not retrieve cache parameters"); + OF_panic("%s: could not retrieve cache parameters", __func__); set = pcpu->pc_cache.ic_size / pcpu->pc_cache.ic_assoc; if ((set & ~(1UL << (ffs(set) - 1))) != 0) - panic("cache_init: I$ set size not a power of 2"); + OF_panic("%s: I$ set size not a power of 2", __func__); if ((pcpu->pc_cache.dc_size & ~(1UL << (ffs(pcpu->pc_cache.dc_size) - 1))) != 0) - panic("cache_init: D$ size not a power of 2"); + OF_panic("%s: D$ size not a power of 2", __func__); /* * For CPUs which don't support unaliasing in hardware ensure that * the data cache doesn't have too many virtual colors. */ if (dcache_color_ignore == 0 && ((pcpu->pc_cache.dc_size / pcpu->pc_cache.dc_assoc) / PAGE_SIZE) != DCACHE_COLORS) - panic("cache_init: too many D$ colors"); + OF_panic("%s: too many D$ colors", __func__); set = pcpu->pc_cache.ec_size / pcpu->pc_cache.ec_assoc; if ((set & ~(1UL << (ffs(set) - 1))) != 0) - panic("cache_init: E$ set size not a power of 2"); + OF_panic("%s: E$ set size not a power of 2", __func__); if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCIII) { cache_enable = cheetah_cache_enable; @@ -184,5 +184,5 @@ cache_init(struct pcpu *pcpu) tlb_flush_nonlocked = spitfire_tlb_flush_nonlocked; tlb_flush_user = spitfire_tlb_flush_user; } else - panic("cache_init: unknown CPU"); + OF_panic("%s: unknown CPU", __func__); } Modified: stable/9/sys/sparc64/sparc64/clock.c ============================================================================== --- stable/9/sys/sparc64/sparc64/clock.c Wed Feb 1 21:15:27 2012 (r230889) +++ stable/9/sys/sparc64/sparc64/clock.c Wed Feb 1 21:19:52 2012 (r230890) @@ -33,36 +33,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include -void (*delay_func)(int usec); -u_long clock_boot; - void DELAY(int usec) { - - (*delay_func)(usec); -} - -void -delay_boot(int usec) -{ - u_long end; - - if (usec < 0) - return; - - end = rd(tick) + (u_long)usec * clock_boot / 1000000; - while (rd(tick) < end) - cpu_spinwait(); -} - -void -delay_tick(int usec) -{ u_long end; if (usec < 0) Modified: stable/9/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/9/sys/sparc64/sparc64/machdep.c Wed Feb 1 21:15:27 2012 (r230889) +++ stable/9/sys/sparc64/sparc64/machdep.c Wed Feb 1 21:19:52 2012 (r230890) @@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -376,7 +375,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Parse metadata if present and fetch parameters. Must be before the - * console is inited so cninit gets the right value of boothowto. + * console is inited so cninit() gets the right value of boothowto. */ if (mdp != NULL) { preload_metadata = mdp; @@ -421,37 +420,19 @@ sparc64_init(caddr_t mdp, u_long o1, u_l root = OF_peer(0); pc->pc_node = find_bsp(root, pc->pc_mid, cpu_impl); if (pc->pc_node == 0) - OF_exit(); + OF_panic("%s: cannot find boot CPU node", __func__); if (OF_getprop(pc->pc_node, "clock-frequency", &pc->pc_clock, sizeof(pc->pc_clock)) <= 0) - OF_exit(); - - /* - * Provide a DELAY() that works before PCPU_REG is set. We can't - * set PCPU_REG without also taking over the trap table or the - * firmware will overwrite it. Unfortunately, it's way to early - * to also take over the trap table at this point. - */ - clock_boot = pc->pc_clock; - delay_func = delay_boot; - - /* - * Initialize the console before printing anything. - * NB: the low-level console drivers require a working DELAY() at - * this point. - */ - cninit(); + OF_panic("%s: cannot determine boot CPU clock", __func__); /* * Panic if there is no metadata. Most likely the kernel was booted * directly, instead of through loader(8). */ if (mdp == NULL || kmdp == NULL || end == 0 || - kernel_tlb_slots == 0 || kernel_tlbs == NULL) { - printf("sparc64_init: missing loader metadata.\n" - "This probably means you are not using loader(8).\n"); - panic("sparc64_init"); - } + kernel_tlb_slots == 0 || kernel_tlbs == NULL) + OF_panic("%s: missing loader metadata.\nThis probably means " + "you are not using loader(8).", __func__); /* * Work around the broken loader behavior of not demapping no @@ -461,7 +442,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l for (va = KERNBASE + (kernel_tlb_slots - 1) * PAGE_SIZE_4M; va >= roundup2(end, PAGE_SIZE_4M); va -= PAGE_SIZE_4M) { if (bootverbose) - printf("demapping unused kernel TLB slot " + OF_printf("demapping unused kernel TLB slot " "(va %#lx - %#lx)\n", va, va + PAGE_SIZE_4M - 1); stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, ASI_DMMU_DEMAP, 0); @@ -479,13 +460,15 @@ sparc64_init(caddr_t mdp, u_long o1, u_l */ if (OF_getprop(pc->pc_node, "#dtlb-entries", &dtlb_slots, sizeof(dtlb_slots)) == -1) - panic("sparc64_init: cannot determine number of dTLB slots"); + OF_panic("%s: cannot determine number of dTLB slots", + __func__); if (OF_getprop(pc->pc_node, "#itlb-entries", &itlb_slots, sizeof(itlb_slots)) == -1) - panic("sparc64_init: cannot determine number of iTLB slots"); + OF_panic("%s: cannot determine number of iTLB slots", + __func__); /* - * Initialize and enable the caches. Note that his may include + * Initialize and enable the caches. Note that this may include * applying workarounds. */ cache_init(pc); @@ -573,9 +556,13 @@ sparc64_init(caddr_t mdp, u_long o1, u_l sun4u_set_traptable(tl0_base); /* - * It's now safe to use the real DELAY(). + * Initialize the console. + * NB: the low-level console drivers require a working DELAY() and + * some compiler optimizations may cause the curthread accesses of + * mutex(9) to be factored out even if the latter aren't actually + * called, both requiring PCPU_REG to be set. */ - delay_func = delay_tick; + cninit(); /* * Initialize the dynamic per-CPU area for the BSP and the message Modified: stable/9/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/9/sys/sparc64/sparc64/pmap.c Wed Feb 1 21:15:27 2012 (r230889) +++ stable/9/sys/sparc64/sparc64/pmap.c Wed Feb 1 21:19:52 2012 (r230890) @@ -333,16 +333,16 @@ pmap_bootstrap(u_int cpu_impl) * pmap_bootstrap_alloc is called. */ if ((pmem = OF_finddevice("/memory")) == -1) - panic("pmap_bootstrap: finddevice /memory"); + OF_panic("%s: finddevice /memory", __func__); if ((sz = OF_getproplen(pmem, "available")) == -1) - panic("pmap_bootstrap: getproplen /memory/available"); + OF_panic("%s: getproplen /memory/available", __func__); if (sizeof(phys_avail) < sz) - panic("pmap_bootstrap: phys_avail too small"); + OF_panic("%s: phys_avail too small", __func__); if (sizeof(mra) < sz) - panic("pmap_bootstrap: mra too small"); + OF_panic("%s: mra too small", __func__); bzero(mra, sz); if (OF_getprop(pmem, "available", mra, sz) == -1) - panic("pmap_bootstrap: getprop /memory/available"); + OF_panic("%s: getprop /memory/available", __func__); sz /= sizeof(*mra); CTR0(KTR_PMAP, "pmap_bootstrap: physical memory"); qsort(mra, sz, sizeof (*mra), mr_cmp); @@ -414,7 +414,7 @@ pmap_bootstrap(u_int cpu_impl) */ pa = pmap_bootstrap_alloc(tsb_kernel_size, colors); if (pa & PAGE_MASK_4M) - panic("pmap_bootstrap: TSB unaligned\n"); + OF_panic("%s: TSB unaligned", __func__); tsb_kernel_phys = pa; if (tsb_kernel_ldd_phys == 0) { tsb_kernel = @@ -461,7 +461,7 @@ pmap_bootstrap(u_int cpu_impl) #define PATCH_ASI(addr, asi) do { \ if (addr[0] != WR_R_I(IF_F3_RD(addr[0]), 0x0, \ IF_F3_RS1(addr[0]))) \ - panic("%s: patched instructions have changed", \ + OF_panic("%s: patched instructions have changed", \ __func__); \ addr[0] |= EIF_IMM((asi), 13); \ flush(addr); \ @@ -470,7 +470,7 @@ pmap_bootstrap(u_int cpu_impl) #define PATCH_LDD(addr, asi) do { \ if (addr[0] != LDDA_R_I_R(IF_F3_RD(addr[0]), 0x0, \ IF_F3_RS1(addr[0]), IF_F3_RS2(addr[0]))) \ - panic("%s: patched instructions have changed", \ + OF_panic("%s: patched instructions have changed", \ __func__); \ addr[0] |= EIF_F3_IMM_ASI(asi); \ flush(addr); \ @@ -481,7 +481,7 @@ pmap_bootstrap(u_int cpu_impl) addr[1] != OR_R_I_R(IF_F3_RD(addr[1]), 0x0, \ IF_F3_RS1(addr[1])) || \ addr[3] != SETHI(IF_F2_RD(addr[3]), 0x0)) \ - panic("%s: patched instructions have changed", \ + OF_panic("%s: patched instructions have changed", \ __func__); \ addr[0] |= EIF_IMM((val) >> 42, 22); \ addr[1] |= EIF_IMM((val) >> 32, 10); \ @@ -495,7 +495,7 @@ pmap_bootstrap(u_int cpu_impl) if (addr[0] != SETHI(IF_F2_RD(addr[0]), 0x0) || \ addr[1] != OR_R_I_R(IF_F3_RD(addr[1]), 0x0, \ IF_F3_RS1(addr[1]))) \ - panic("%s: patched instructions have changed", \ + OF_panic("%s: patched instructions have changed", \ __func__); \ addr[0] |= EIF_IMM((val) >> 10, 22); \ addr[1] |= EIF_IMM((val), 10); \ @@ -604,14 +604,15 @@ pmap_bootstrap(u_int cpu_impl) * Add the PROM mappings to the kernel TSB. */ if ((vmem = OF_finddevice("/virtual-memory")) == -1) - panic("pmap_bootstrap: finddevice /virtual-memory"); + OF_panic("%s: finddevice /virtual-memory", __func__); if ((sz = OF_getproplen(vmem, "translations")) == -1) - panic("pmap_bootstrap: getproplen translations"); + OF_panic("%s: getproplen translations", __func__); if (sizeof(translations) < sz) - panic("pmap_bootstrap: translations too small"); + OF_panic("%s: translations too small", __func__); bzero(translations, sz); if (OF_getprop(vmem, "translations", translations, sz) == -1) - panic("pmap_bootstrap: getprop /virtual-memory/translations"); + OF_panic("%s: getprop /virtual-memory/translations", + __func__); sz /= sizeof(*translations); translations_size = sz; CTR0(KTR_PMAP, "pmap_bootstrap: translations"); @@ -649,11 +650,11 @@ pmap_bootstrap(u_int cpu_impl) * calls in that situation. */ if ((sz = OF_getproplen(pmem, "reg")) == -1) - panic("pmap_bootstrap: getproplen /memory/reg"); + OF_panic("%s: getproplen /memory/reg", __func__); if (sizeof(sparc64_memreg) < sz) - panic("pmap_bootstrap: sparc64_memreg too small"); + OF_panic("%s: sparc64_memreg too small", __func__); if (OF_getprop(pmem, "reg", sparc64_memreg, sz) == -1) - panic("pmap_bootstrap: getprop /memory/reg"); + OF_panic("%s: getprop /memory/reg", __func__); sparc64_nmemreg = sz / sizeof(*sparc64_memreg); /* @@ -726,7 +727,7 @@ pmap_bootstrap_alloc(vm_size_t size, uin phys_avail[i] += size; return (pa); } - panic("pmap_bootstrap_alloc"); + OF_panic("%s: no suitable region found", __func__); } /* From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:19:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA7DA106566B; Wed, 1 Feb 2012 21:19:54 +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 D73E88FC08; Wed, 1 Feb 2012 21:19:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LJs04005623; Wed, 1 Feb 2012 21:19:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LJsEY005616; Wed, 1 Feb 2012 21:19:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012119.q11LJsEY005616@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230891 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:19:55 -0000 Author: marius Date: Wed Feb 1 21:19:54 2012 New Revision: 230891 URL: http://svn.freebsd.org/changeset/base/230891 Log: MFC: r230633, r230634 Now that we have a working OF_printf() since r230631 and a OF_panic() helper since r230632 (MFC'ed to stable/8 in r230885 and r230887 respectively), use these for output and panicing during the early cycles and move cninit() until after the static per-CPU data has been set up. This solves a couple of issue regarding the non- availability of the static per-CPU data: - panic() not working and only making things worse when called, - having to supply a special DELAY() implementation to the low-level console drivers, - curthread accesses of mutex(9) usage in low-level console drivers that aren't conditional due to compiler optimizations (basically, this is the problem described in r227537 but in this case for keyboards attached via uart(4)). [1] PR: 164123 [1] Modified: stable/8/sys/sparc64/include/clock.h stable/8/sys/sparc64/sparc64/cache.c stable/8/sys/sparc64/sparc64/clock.c stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/sparc64/include/clock.h ============================================================================== --- stable/8/sys/sparc64/include/clock.h Wed Feb 1 21:19:52 2012 (r230890) +++ stable/8/sys/sparc64/include/clock.h Wed Feb 1 21:19:54 2012 (r230891) @@ -1,27 +1,5 @@ /*- - * Copyright (c) 2001 Jake Burkholder. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * This file is in the public domain. * * $FreeBSD$ */ @@ -29,10 +7,4 @@ #ifndef _MACHINE_CLOCK_H_ #define _MACHINE_CLOCK_H_ -extern void (*delay_func)(int usec); -extern u_long clock_boot; - -void delay_boot(int usec); -void delay_tick(int usec); - #endif /* !_MACHINE_CLOCK_H_ */ Modified: stable/8/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/8/sys/sparc64/sparc64/cache.c Wed Feb 1 21:19:52 2012 (r230890) +++ stable/8/sys/sparc64/sparc64/cache.c Wed Feb 1 21:19:54 2012 (r230891) @@ -142,24 +142,24 @@ cache_init(struct pcpu *pcpu) "l2-cache-line-size", pcpu->pc_cache.ec_linesize) == -1 || OF_GET(pcpu->pc_node, !use_new_prop ? "ecache-associativity" : "l2-cache-associativity", pcpu->pc_cache.ec_assoc) == -1) - panic("cache_init: could not retrieve cache parameters"); + OF_panic("%s: could not retrieve cache parameters", __func__); set = pcpu->pc_cache.ic_size / pcpu->pc_cache.ic_assoc; if ((set & ~(1UL << (ffs(set) - 1))) != 0) - panic("cache_init: I$ set size not a power of 2"); + OF_panic("%s: I$ set size not a power of 2", __func__); if ((pcpu->pc_cache.dc_size & ~(1UL << (ffs(pcpu->pc_cache.dc_size) - 1))) != 0) - panic("cache_init: D$ size not a power of 2"); + OF_panic("%s: D$ size not a power of 2", __func__); /* * For CPUs which don't support unaliasing in hardware ensure that * the data cache doesn't have too many virtual colors. */ if (dcache_color_ignore == 0 && ((pcpu->pc_cache.dc_size / pcpu->pc_cache.dc_assoc) / PAGE_SIZE) != DCACHE_COLORS) - panic("cache_init: too many D$ colors"); + OF_panic("%s: too many D$ colors", __func__); set = pcpu->pc_cache.ec_size / pcpu->pc_cache.ec_assoc; if ((set & ~(1UL << (ffs(set) - 1))) != 0) - panic("cache_init: E$ set size not a power of 2"); + OF_panic("%s: E$ set size not a power of 2", __func__); if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCIII) { cache_enable = cheetah_cache_enable; @@ -184,5 +184,5 @@ cache_init(struct pcpu *pcpu) tlb_flush_nonlocked = spitfire_tlb_flush_nonlocked; tlb_flush_user = spitfire_tlb_flush_user; } else - panic("cache_init: unknown CPU"); + OF_panic("%s: unknown CPU", __func__); } Modified: stable/8/sys/sparc64/sparc64/clock.c ============================================================================== --- stable/8/sys/sparc64/sparc64/clock.c Wed Feb 1 21:19:52 2012 (r230890) +++ stable/8/sys/sparc64/sparc64/clock.c Wed Feb 1 21:19:54 2012 (r230891) @@ -33,36 +33,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include -void (*delay_func)(int usec); -u_long clock_boot; - void DELAY(int usec) { - - (*delay_func)(usec); -} - -void -delay_boot(int usec) -{ - u_long end; - - if (usec < 0) - return; - - end = rd(tick) + (u_long)usec * clock_boot / 1000000; - while (rd(tick) < end) - cpu_spinwait(); -} - -void -delay_tick(int usec) -{ u_long end; if (usec < 0) Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Wed Feb 1 21:19:52 2012 (r230890) +++ stable/8/sys/sparc64/sparc64/machdep.c Wed Feb 1 21:19:54 2012 (r230891) @@ -87,7 +87,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -375,7 +374,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Parse metadata if present and fetch parameters. Must be before the - * console is inited so cninit gets the right value of boothowto. + * console is inited so cninit() gets the right value of boothowto. */ if (mdp != NULL) { preload_metadata = mdp; @@ -420,37 +419,19 @@ sparc64_init(caddr_t mdp, u_long o1, u_l root = OF_peer(0); pc->pc_node = find_bsp(root, pc->pc_mid, cpu_impl); if (pc->pc_node == 0) - OF_exit(); + OF_panic("%s: cannot find boot CPU node", __func__); if (OF_getprop(pc->pc_node, "clock-frequency", &pc->pc_clock, sizeof(pc->pc_clock)) <= 0) - OF_exit(); - - /* - * Provide a DELAY() that works before PCPU_REG is set. We can't - * set PCPU_REG without also taking over the trap table or the - * firmware will overwrite it. Unfortunately, it's way to early - * to also take over the trap table at this point. - */ - clock_boot = pc->pc_clock; - delay_func = delay_boot; - - /* - * Initialize the console before printing anything. - * NB: the low-level console drivers require a working DELAY() at - * this point. - */ - cninit(); + OF_panic("%s: cannot determine boot CPU clock", __func__); /* * Panic if there is no metadata. Most likely the kernel was booted * directly, instead of through loader(8). */ if (mdp == NULL || kmdp == NULL || end == 0 || - kernel_tlb_slots == 0 || kernel_tlbs == NULL) { - printf("sparc64_init: missing loader metadata.\n" - "This probably means you are not using loader(8).\n"); - panic("sparc64_init"); - } + kernel_tlb_slots == 0 || kernel_tlbs == NULL) + OF_panic("%s: missing loader metadata.\nThis probably means " + "you are not using loader(8).", __func__); /* * Work around the broken loader behavior of not demapping no @@ -460,7 +441,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l for (va = KERNBASE + (kernel_tlb_slots - 1) * PAGE_SIZE_4M; va >= roundup2(end, PAGE_SIZE_4M); va -= PAGE_SIZE_4M) { if (bootverbose) - printf("demapping unused kernel TLB slot " + OF_printf("demapping unused kernel TLB slot " "(va %#lx - %#lx)\n", va, va + PAGE_SIZE_4M - 1); stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, ASI_DMMU_DEMAP, 0); @@ -478,13 +459,15 @@ sparc64_init(caddr_t mdp, u_long o1, u_l */ if (OF_getprop(pc->pc_node, "#dtlb-entries", &dtlb_slots, sizeof(dtlb_slots)) == -1) - panic("sparc64_init: cannot determine number of dTLB slots"); + OF_panic("%s: cannot determine number of dTLB slots", + __func__); if (OF_getprop(pc->pc_node, "#itlb-entries", &itlb_slots, sizeof(itlb_slots)) == -1) - panic("sparc64_init: cannot determine number of iTLB slots"); + OF_panic("%s: cannot determine number of iTLB slots", + __func__); /* - * Initialize and enable the caches. Note that his may include + * Initialize and enable the caches. Note that this may include * applying workarounds. */ cache_init(pc); @@ -572,9 +555,13 @@ sparc64_init(caddr_t mdp, u_long o1, u_l sun4u_set_traptable(tl0_base); /* - * It's now safe to use the real DELAY(). + * Initialize the console. + * NB: the low-level console drivers require a working DELAY() and + * some compiler optimizations may cause the curthread accesses of + * mutex(9) to be factored out even if the latter aren't actually + * called, both requiring PCPU_REG to be set. */ - delay_func = delay_tick; + cninit(); /* * Initialize the dynamic per-CPU area for the BSP and the message Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Wed Feb 1 21:19:52 2012 (r230890) +++ stable/8/sys/sparc64/sparc64/pmap.c Wed Feb 1 21:19:54 2012 (r230891) @@ -340,16 +340,16 @@ pmap_bootstrap(u_int cpu_impl) * pmap_bootstrap_alloc is called. */ if ((pmem = OF_finddevice("/memory")) == -1) - panic("pmap_bootstrap: finddevice /memory"); + OF_panic("%s: finddevice /memory", __func__); if ((sz = OF_getproplen(pmem, "available")) == -1) - panic("pmap_bootstrap: getproplen /memory/available"); + OF_panic("%s: getproplen /memory/available", __func__); if (sizeof(phys_avail) < sz) - panic("pmap_bootstrap: phys_avail too small"); + OF_panic("%s: phys_avail too small", __func__); if (sizeof(mra) < sz) - panic("pmap_bootstrap: mra too small"); + OF_panic("%s: mra too small", __func__); bzero(mra, sz); if (OF_getprop(pmem, "available", mra, sz) == -1) - panic("pmap_bootstrap: getprop /memory/available"); + OF_panic("%s: getprop /memory/available", __func__); sz /= sizeof(*mra); CTR0(KTR_PMAP, "pmap_bootstrap: physical memory"); qsort(mra, sz, sizeof (*mra), mr_cmp); @@ -421,7 +421,7 @@ pmap_bootstrap(u_int cpu_impl) */ pa = pmap_bootstrap_alloc(tsb_kernel_size, colors); if (pa & PAGE_MASK_4M) - panic("pmap_bootstrap: TSB unaligned\n"); + OF_panic("%s: TSB unaligned", __func__); tsb_kernel_phys = pa; if (tsb_kernel_ldd_phys == 0) { tsb_kernel = @@ -468,7 +468,7 @@ pmap_bootstrap(u_int cpu_impl) #define PATCH_ASI(addr, asi) do { \ if (addr[0] != WR_R_I(IF_F3_RD(addr[0]), 0x0, \ IF_F3_RS1(addr[0]))) \ - panic("%s: patched instructions have changed", \ + OF_panic("%s: patched instructions have changed", \ __func__); \ addr[0] |= EIF_IMM((asi), 13); \ flush(addr); \ @@ -477,7 +477,7 @@ pmap_bootstrap(u_int cpu_impl) #define PATCH_LDD(addr, asi) do { \ if (addr[0] != LDDA_R_I_R(IF_F3_RD(addr[0]), 0x0, \ IF_F3_RS1(addr[0]), IF_F3_RS2(addr[0]))) \ - panic("%s: patched instructions have changed", \ + OF_panic("%s: patched instructions have changed", \ __func__); \ addr[0] |= EIF_F3_IMM_ASI(asi); \ flush(addr); \ @@ -488,7 +488,7 @@ pmap_bootstrap(u_int cpu_impl) addr[1] != OR_R_I_R(IF_F3_RD(addr[1]), 0x0, \ IF_F3_RS1(addr[1])) || \ addr[3] != SETHI(IF_F2_RD(addr[3]), 0x0)) \ - panic("%s: patched instructions have changed", \ + OF_panic("%s: patched instructions have changed", \ __func__); \ addr[0] |= EIF_IMM((val) >> 42, 22); \ addr[1] |= EIF_IMM((val) >> 32, 10); \ @@ -502,7 +502,7 @@ pmap_bootstrap(u_int cpu_impl) if (addr[0] != SETHI(IF_F2_RD(addr[0]), 0x0) || \ addr[1] != OR_R_I_R(IF_F3_RD(addr[1]), 0x0, \ IF_F3_RS1(addr[1]))) \ - panic("%s: patched instructions have changed", \ + OF_panic("%s: patched instructions have changed", \ __func__); \ addr[0] |= EIF_IMM((val) >> 10, 22); \ addr[1] |= EIF_IMM((val), 10); \ @@ -611,14 +611,15 @@ pmap_bootstrap(u_int cpu_impl) * Add the PROM mappings to the kernel TSB. */ if ((vmem = OF_finddevice("/virtual-memory")) == -1) - panic("pmap_bootstrap: finddevice /virtual-memory"); + OF_panic("%s: finddevice /virtual-memory", __func__); if ((sz = OF_getproplen(vmem, "translations")) == -1) - panic("pmap_bootstrap: getproplen translations"); + OF_panic("%s: getproplen translations", __func__); if (sizeof(translations) < sz) - panic("pmap_bootstrap: translations too small"); + OF_panic("%s: translations too small", __func__); bzero(translations, sz); if (OF_getprop(vmem, "translations", translations, sz) == -1) - panic("pmap_bootstrap: getprop /virtual-memory/translations"); + OF_panic("%s: getprop /virtual-memory/translations", + __func__); sz /= sizeof(*translations); translations_size = sz; CTR0(KTR_PMAP, "pmap_bootstrap: translations"); @@ -656,11 +657,11 @@ pmap_bootstrap(u_int cpu_impl) * calls in that situation. */ if ((sz = OF_getproplen(pmem, "reg")) == -1) - panic("pmap_bootstrap: getproplen /memory/reg"); + OF_panic("%s: getproplen /memory/reg", __func__); if (sizeof(sparc64_memreg) < sz) - panic("pmap_bootstrap: sparc64_memreg too small"); + OF_panic("%s: sparc64_memreg too small", __func__); if (OF_getprop(pmem, "reg", sparc64_memreg, sz) == -1) - panic("pmap_bootstrap: getprop /memory/reg"); + OF_panic("%s: getprop /memory/reg", __func__); sparc64_nmemreg = sz / sizeof(*sparc64_memreg); /* @@ -733,7 +734,7 @@ pmap_bootstrap_alloc(vm_size_t size, uin phys_avail[i] += size; return (pa); } - panic("pmap_bootstrap_alloc"); + OF_panic("%s: no suitable region found", __func__); } /* From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:24:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C56F1065670; Wed, 1 Feb 2012 21:24:04 +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 1A1D88FC0C; Wed, 1 Feb 2012 21:24:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LO3cW005828; Wed, 1 Feb 2012 21:24:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LO3O2005826; Wed, 1 Feb 2012 21:24:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012124.q11LO3O2005826@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230892 - stable/9/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:24:04 -0000 Author: marius Date: Wed Feb 1 21:24:03 2012 New Revision: 230892 URL: http://svn.freebsd.org/changeset/base/230892 Log: MFC: r230662 Fully disable interrupts while we fiddle with the FP context in the VIS-based block copy/zero implementations. While with 4BSD it's sufficient to just disable the tick interrupts, with ULE+PREEMPTION it's otherwise also possible that these are preempted via IPIs. Modified: stable/9/sys/sparc64/sparc64/support.S Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/sparc64/support.S ============================================================================== --- stable/9/sys/sparc64/sparc64/support.S Wed Feb 1 21:19:54 2012 (r230891) +++ stable/9/sys/sparc64/sparc64/support.S Wed Feb 1 21:24:03 2012 (r230892) @@ -580,8 +580,8 @@ fpu_fault_begin: * void spitfire_block_copy(void *src, void *dst, size_t len) */ ENTRY(spitfire_block_copy) - rdpr %pil, %o3 - wrpr %g0, PIL_TICK, %pil + rdpr %pstate, %o3 + wrpr %g0, PSTATE_NORMAL, %pstate wr %g0, ASI_BLK_S, %asi wr %g0, FPRS_FEF, %fprs @@ -603,7 +603,7 @@ ENTRY(spitfire_block_copy) or %o4, PCB_FEF, %o4 stx %o4, [PCB_REG + PCB_FLAGS] -1: wrpr %o3, 0, %pil +1: wrpr %o3, 0, %pstate ldda [%o0] %asi, %f0 add %o0, 64, %o0 @@ -653,8 +653,8 @@ END(spitfire_block_copy) ENTRY(zeus_block_copy) prefetch [%o0 + (0 * 64)], 0 - rdpr %pil, %o3 - wrpr %g0, PIL_TICK, %pil + rdpr %pstate, %o3 + wrpr %g0, PSTATE_NORMAL, %pstate wr %g0, ASI_BLK_S, %asi wr %g0, FPRS_FEF, %fprs @@ -676,7 +676,7 @@ ENTRY(zeus_block_copy) or %o4, PCB_FEF, %o4 stx %o4, [PCB_REG + PCB_FLAGS] -1: wrpr %o3, 0, %pil +1: wrpr %o3, 0, %pstate ldd [%o0 + (0 * 8)], %f0 prefetch [%o0 + (1 * 64)], 0 @@ -764,8 +764,8 @@ END(zeus_block_copy) */ ALTENTRY(zeus_block_zero) ENTRY(spitfire_block_zero) - rdpr %pil, %o3 - wrpr %g0, PIL_TICK, %pil + rdpr %pstate, %o3 + wrpr %g0, PSTATE_NORMAL, %pstate wr %g0, ASI_BLK_S, %asi wr %g0, FPRS_FEF, %fprs @@ -787,7 +787,7 @@ ENTRY(spitfire_block_zero) or %o4, PCB_FEF, %o4 stx %o4, [PCB_REG + PCB_FLAGS] -1: wrpr %o3, 0, %pil +1: wrpr %o3, 0, %pstate fzero %f0 fzero %f2 From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:24:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBB41106566B; Wed, 1 Feb 2012 21:24:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F71F8FC13; Wed, 1 Feb 2012 21:24:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LO6hp005862; Wed, 1 Feb 2012 21:24:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LO6FG005860; Wed, 1 Feb 2012 21:24:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012124.q11LO6FG005860@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230893 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:24:06 -0000 Author: marius Date: Wed Feb 1 21:24:06 2012 New Revision: 230893 URL: http://svn.freebsd.org/changeset/base/230893 Log: MFC: r230662 Fully disable interrupts while we fiddle with the FP context in the VIS-based block copy/zero implementations. While with 4BSD it's sufficient to just disable the tick interrupts, with ULE+PREEMPTION it's otherwise also possible that these are preempted via IPIs. Modified: stable/8/sys/sparc64/sparc64/support.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/sparc64/sparc64/support.S ============================================================================== --- stable/8/sys/sparc64/sparc64/support.S Wed Feb 1 21:24:03 2012 (r230892) +++ stable/8/sys/sparc64/sparc64/support.S Wed Feb 1 21:24:06 2012 (r230893) @@ -580,8 +580,8 @@ fpu_fault_begin: * void spitfire_block_copy(void *src, void *dst, size_t len) */ ENTRY(spitfire_block_copy) - rdpr %pil, %o3 - wrpr %g0, PIL_TICK, %pil + rdpr %pstate, %o3 + wrpr %g0, PSTATE_NORMAL, %pstate wr %g0, ASI_BLK_S, %asi wr %g0, FPRS_FEF, %fprs @@ -603,7 +603,7 @@ ENTRY(spitfire_block_copy) or %o4, PCB_FEF, %o4 stx %o4, [PCB_REG + PCB_FLAGS] -1: wrpr %o3, 0, %pil +1: wrpr %o3, 0, %pstate ldda [%o0] %asi, %f0 add %o0, 64, %o0 @@ -653,8 +653,8 @@ END(spitfire_block_copy) ENTRY(zeus_block_copy) prefetch [%o0 + (0 * 64)], 0 - rdpr %pil, %o3 - wrpr %g0, PIL_TICK, %pil + rdpr %pstate, %o3 + wrpr %g0, PSTATE_NORMAL, %pstate wr %g0, ASI_BLK_S, %asi wr %g0, FPRS_FEF, %fprs @@ -676,7 +676,7 @@ ENTRY(zeus_block_copy) or %o4, PCB_FEF, %o4 stx %o4, [PCB_REG + PCB_FLAGS] -1: wrpr %o3, 0, %pil +1: wrpr %o3, 0, %pstate ldd [%o0 + (0 * 8)], %f0 prefetch [%o0 + (1 * 64)], 0 @@ -764,8 +764,8 @@ END(zeus_block_copy) */ ALTENTRY(zeus_block_zero) ENTRY(spitfire_block_zero) - rdpr %pil, %o3 - wrpr %g0, PIL_TICK, %pil + rdpr %pstate, %o3 + wrpr %g0, PSTATE_NORMAL, %pstate wr %g0, ASI_BLK_S, %asi wr %g0, FPRS_FEF, %fprs @@ -787,7 +787,7 @@ ENTRY(spitfire_block_zero) or %o4, PCB_FEF, %o4 stx %o4, [PCB_REG + PCB_FLAGS] -1: wrpr %o3, 0, %pil +1: wrpr %o3, 0, %pstate fzero %f0 fzero %f2 From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:28:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3079E106564A; Wed, 1 Feb 2012 21:28:14 +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 1E1898FC0C; Wed, 1 Feb 2012 21:28:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LSDCp006050; Wed, 1 Feb 2012 21:28:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LSD1W006047; Wed, 1 Feb 2012 21:28:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012128.q11LSD1W006047@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230894 - stable/9/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:28:14 -0000 Author: marius Date: Wed Feb 1 21:28:13 2012 New Revision: 230894 URL: http://svn.freebsd.org/changeset/base/230894 Log: MFC: r230664 As it turns out r227960 (MFC'ed to stable/9 in r228126) may still be insufficient with PREEMPTION so try harder to get the CDMA sync interrupt delivered and also in a more efficient way: - wrap the whole process of sending and receiving the CDMA sync interrupt in a critical section so we don't get preempted, - send the CDMA sync interrupt to the CPU that is actually waiting for it to happen so we don't take a detour via another CPU, - instead of waiting for up to 15 seconds for the interrupt to trigger try the whole process for up to 15 times using a one second timeout (the code was also changed to just ignore belated interrupts of a previous tries should they appear). According to testing done by Peter Jeremy with the debugging also added as part of this commit the first two changes apparently are sufficient to now properly get the CDMA sync interrupts delivered at the first try though. Modified: stable/9/sys/sparc64/pci/schizo.c stable/9/sys/sparc64/pci/schizovar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/pci/schizo.c ============================================================================== --- stable/9/sys/sparc64/pci/schizo.c Wed Feb 1 21:24:06 2012 (r230893) +++ stable/9/sys/sparc64/pci/schizo.c Wed Feb 1 21:28:13 2012 (r230894) @@ -178,6 +178,8 @@ struct schizo_icarg { bus_addr_t sica_clr; }; +#define SCHIZO_CDMA_TIMEOUT 1 /* 1 second per try */ +#define SCHIZO_CDMA_TRIES 15 #define SCHIZO_PERF_CNT_QLTY 100 #define SCHIZO_SPC_BARRIER(spc, sc, offs, len, flags) \ @@ -706,13 +708,15 @@ schizo_attach(device_t dev) i = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, 4)); if (i == STX_CDMA_A_INO || i == STX_CDMA_B_INO) { - (void)schizo_get_intrmap(sc, i, NULL, - &sc->sc_cdma_clr); + sc->sc_cdma_vec = INTMAP_VEC(sc->sc_ign, i); + (void)schizo_get_intrmap(sc, i, + &sc->sc_cdma_map, &sc->sc_cdma_clr); schizo_set_intr(sc, 4, i, schizo_cdma); } else { i = STX_CDMA_A_INO + sc->sc_half; + sc->sc_cdma_vec = INTMAP_VEC(sc->sc_ign, i); if (bus_set_resource(dev, SYS_RES_IRQ, 5, - INTMAP_VEC(sc->sc_ign, i), 1) != 0) + sc->sc_cdma_vec, 1) != 0) panic("%s: failed to add CDMA " "interrupt", __func__); j = schizo_intr_register(sc, i); @@ -720,8 +724,8 @@ schizo_attach(device_t dev) panic("%s: could not register " "interrupt controller for CDMA " "(%d)", __func__, j); - (void)schizo_get_intrmap(sc, i, NULL, - &sc->sc_cdma_clr); + (void)schizo_get_intrmap(sc, i, + &sc->sc_cdma_map, &sc->sc_cdma_clr); schizo_set_intr(sc, 5, i, schizo_cdma); } } else { @@ -988,7 +992,8 @@ schizo_cdma(void *arg) { struct schizo_softc *sc = arg; - atomic_store_rel_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_RECEIVED); + atomic_cmpset_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_PENDING, + SCHIZO_CDMA_STATE_RECEIVED); return (FILTER_HANDLED); } @@ -1153,7 +1158,10 @@ schizo_dmamap_sync(bus_dma_tag_t dt, bus struct timeval cur, end; struct schizo_iommu_state *sis = dt->dt_cookie; struct schizo_softc *sc = sis->sis_sc; - int res; + int i, res; +#ifdef INVARIANTS + register_t pil; +#endif if ((map->dm_flags & DMF_STREAMED) != 0) { iommu_dma_methods.dm_dmamap_sync(dt, map, op); @@ -1170,20 +1178,36 @@ schizo_dmamap_sync(bus_dma_tag_t dt, bus * but given that these disable interrupts we have to emulate * one. */ + critical_enter(); + KASSERT((rdpr(pstate) & PSTATE_IE) != 0, + ("%s: interrupts disabled", __func__)); + KASSERT((pil = rdpr(pil)) <= PIL_BRIDGE, + ("%s: PIL too low (%ld)", __func__, pil)); for (; atomic_cmpset_acq_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_IDLE, SCHIZO_CDMA_STATE_PENDING) == 0;) ; - SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, INTCLR_RECEIVED); - microuptime(&cur); - end.tv_sec = 15; - end.tv_usec = 0; - timevaladd(&end, &cur); - for (; (res = atomic_cmpset_rel_32(&sc->sc_cdma_state, - SCHIZO_CDMA_STATE_RECEIVED, SCHIZO_CDMA_STATE_IDLE)) == - 0 && timevalcmp(&cur, &end, <=);) + SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_map, + INTMAP_ENABLE(sc->sc_cdma_vec, PCPU_GET(mid))); + for (i = 0; i < SCHIZO_CDMA_TRIES; i++) { + if (i > 0) + printf("%s: try %d\n", __func__, i); + SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, + INTCLR_RECEIVED); microuptime(&cur); + end.tv_sec = SCHIZO_CDMA_TIMEOUT; + end.tv_usec = 0; + timevaladd(&end, &cur); + for (; (res = atomic_cmpset_rel_32(&sc->sc_cdma_state, + SCHIZO_CDMA_STATE_RECEIVED, + SCHIZO_CDMA_STATE_IDLE)) == 0 && + timevalcmp(&cur, &end, <=);) + microuptime(&cur); + if (res != 0) + break; + } if (res == 0) panic("%s: DMA does not sync", __func__); + critical_exit(); } if ((op & BUS_DMASYNC_PREWRITE) != 0) @@ -1352,7 +1376,7 @@ schizo_alloc_resource(device_t bus, devi panic("%s: XXX: interrupt range", __func__); start = end = INTMAP_VEC(sc->sc_ign, end); return (bus_generic_alloc_resource(bus, child, type, rid, - start, end, count, flags)); + start, end, count, flags)); case SYS_RES_MEMORY: rm = &sc->sc_pci_mem_rman; break; Modified: stable/9/sys/sparc64/pci/schizovar.h ============================================================================== --- stable/9/sys/sparc64/pci/schizovar.h Wed Feb 1 21:24:06 2012 (r230893) +++ stable/9/sys/sparc64/pci/schizovar.h Wed Feb 1 21:28:13 2012 (r230894) @@ -59,7 +59,9 @@ struct schizo_softc { #define SCHIZO_FLAGS_BSWAR (1 << 0) #define SCHIZO_FLAGS_XMODE (1 << 1) + bus_addr_t sc_cdma_map; bus_addr_t sc_cdma_clr; + uint32_t sc_cdma_vec; uint32_t sc_cdma_state; #define SCHIZO_CDMA_STATE_IDLE (1 << 0) #define SCHIZO_CDMA_STATE_PENDING (1 << 1) From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:28:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 179811065677; Wed, 1 Feb 2012 21:28:17 +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 052928FC18; Wed, 1 Feb 2012 21:28:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LSGoD006089; Wed, 1 Feb 2012 21:28:16 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LSGAi006086; Wed, 1 Feb 2012 21:28:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012128.q11LSGAi006086@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230895 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:28:17 -0000 Author: marius Date: Wed Feb 1 21:28:16 2012 New Revision: 230895 URL: http://svn.freebsd.org/changeset/base/230895 Log: MFC: r230664 As it turns out r227960 (MFC'ed to stable/8 in r228145) may still be insufficient with PREEMPTION so try harder to get the CDMA sync interrupt delivered and also in a more efficient way: - wrap the whole process of sending and receiving the CDMA sync interrupt in a critical section so we don't get preempted, - send the CDMA sync interrupt to the CPU that is actually waiting for it to happen so we don't take a detour via another CPU, - instead of waiting for up to 15 seconds for the interrupt to trigger try the whole process for up to 15 times using a one second timeout (the code was also changed to just ignore belated interrupts of a previous tries should they appear). According to testing done by Peter Jeremy with the debugging also added as part of this commit the first two changes apparently are sufficient to now properly get the CDMA sync interrupts delivered at the first try though. Modified: stable/8/sys/sparc64/pci/schizo.c stable/8/sys/sparc64/pci/schizovar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/sparc64/pci/schizo.c ============================================================================== --- stable/8/sys/sparc64/pci/schizo.c Wed Feb 1 21:28:13 2012 (r230894) +++ stable/8/sys/sparc64/pci/schizo.c Wed Feb 1 21:28:16 2012 (r230895) @@ -178,6 +178,8 @@ struct schizo_icarg { bus_addr_t sica_clr; }; +#define SCHIZO_CDMA_TIMEOUT 1 /* 1 second per try */ +#define SCHIZO_CDMA_TRIES 15 #define SCHIZO_PERF_CNT_QLTY 100 #define SCHIZO_SPC_BARRIER(spc, sc, offs, len, flags) \ @@ -706,13 +708,15 @@ schizo_attach(device_t dev) i = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, 4)); if (i == STX_CDMA_A_INO || i == STX_CDMA_B_INO) { - (void)schizo_get_intrmap(sc, i, NULL, - &sc->sc_cdma_clr); + sc->sc_cdma_vec = INTMAP_VEC(sc->sc_ign, i); + (void)schizo_get_intrmap(sc, i, + &sc->sc_cdma_map, &sc->sc_cdma_clr); schizo_set_intr(sc, 4, i, schizo_cdma); } else { i = STX_CDMA_A_INO + sc->sc_half; + sc->sc_cdma_vec = INTMAP_VEC(sc->sc_ign, i); if (bus_set_resource(dev, SYS_RES_IRQ, 5, - INTMAP_VEC(sc->sc_ign, i), 1) != 0) + sc->sc_cdma_vec, 1) != 0) panic("%s: failed to add CDMA " "interrupt", __func__); j = schizo_intr_register(sc, i); @@ -720,8 +724,8 @@ schizo_attach(device_t dev) panic("%s: could not register " "interrupt controller for CDMA " "(%d)", __func__, j); - (void)schizo_get_intrmap(sc, i, NULL, - &sc->sc_cdma_clr); + (void)schizo_get_intrmap(sc, i, + &sc->sc_cdma_map, &sc->sc_cdma_clr); schizo_set_intr(sc, 5, i, schizo_cdma); } } else { @@ -988,7 +992,8 @@ schizo_cdma(void *arg) { struct schizo_softc *sc = arg; - atomic_store_rel_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_RECEIVED); + atomic_cmpset_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_PENDING, + SCHIZO_CDMA_STATE_RECEIVED); return (FILTER_HANDLED); } @@ -1153,7 +1158,10 @@ schizo_dmamap_sync(bus_dma_tag_t dt, bus struct timeval cur, end; struct schizo_iommu_state *sis = dt->dt_cookie; struct schizo_softc *sc = sis->sis_sc; - int res; + int i, res; +#ifdef INVARIANTS + register_t pil; +#endif if ((map->dm_flags & DMF_STREAMED) != 0) { iommu_dma_methods.dm_dmamap_sync(dt, map, op); @@ -1170,20 +1178,36 @@ schizo_dmamap_sync(bus_dma_tag_t dt, bus * but given that these disable interrupts we have to emulate * one. */ + critical_enter(); + KASSERT((rdpr(pstate) & PSTATE_IE) != 0, + ("%s: interrupts disabled", __func__)); + KASSERT((pil = rdpr(pil)) <= PIL_BRIDGE, + ("%s: PIL too low (%ld)", __func__, pil)); for (; atomic_cmpset_acq_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_IDLE, SCHIZO_CDMA_STATE_PENDING) == 0;) ; - SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, INTCLR_RECEIVED); - microuptime(&cur); - end.tv_sec = 15; - end.tv_usec = 0; - timevaladd(&end, &cur); - for (; (res = atomic_cmpset_rel_32(&sc->sc_cdma_state, - SCHIZO_CDMA_STATE_RECEIVED, SCHIZO_CDMA_STATE_IDLE)) == - 0 && timevalcmp(&cur, &end, <=);) + SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_map, + INTMAP_ENABLE(sc->sc_cdma_vec, PCPU_GET(mid))); + for (i = 0; i < SCHIZO_CDMA_TRIES; i++) { + if (i > 0) + printf("%s: try %d\n", __func__, i); + SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, + INTCLR_RECEIVED); microuptime(&cur); + end.tv_sec = SCHIZO_CDMA_TIMEOUT; + end.tv_usec = 0; + timevaladd(&end, &cur); + for (; (res = atomic_cmpset_rel_32(&sc->sc_cdma_state, + SCHIZO_CDMA_STATE_RECEIVED, + SCHIZO_CDMA_STATE_IDLE)) == 0 && + timevalcmp(&cur, &end, <=);) + microuptime(&cur); + if (res != 0) + break; + } if (res == 0) panic("%s: DMA does not sync", __func__); + critical_exit(); } if ((op & BUS_DMASYNC_PREWRITE) != 0) @@ -1352,7 +1376,7 @@ schizo_alloc_resource(device_t bus, devi panic("%s: XXX: interrupt range", __func__); start = end = INTMAP_VEC(sc->sc_ign, end); return (bus_generic_alloc_resource(bus, child, type, rid, - start, end, count, flags)); + start, end, count, flags)); case SYS_RES_MEMORY: rm = &sc->sc_pci_mem_rman; break; Modified: stable/8/sys/sparc64/pci/schizovar.h ============================================================================== --- stable/8/sys/sparc64/pci/schizovar.h Wed Feb 1 21:28:13 2012 (r230894) +++ stable/8/sys/sparc64/pci/schizovar.h Wed Feb 1 21:28:16 2012 (r230895) @@ -59,7 +59,9 @@ struct schizo_softc { #define SCHIZO_FLAGS_BSWAR (1 << 0) #define SCHIZO_FLAGS_XMODE (1 << 1) + bus_addr_t sc_cdma_map; bus_addr_t sc_cdma_clr; + uint32_t sc_cdma_vec; uint32_t sc_cdma_state; #define SCHIZO_CDMA_STATE_IDLE (1 << 0) #define SCHIZO_CDMA_STATE_PENDING (1 << 1) From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:31:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAFEC106566B; Wed, 1 Feb 2012 21:31:46 +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 C0FBE8FC23; Wed, 1 Feb 2012 21:31:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11LVkcf006244; Wed, 1 Feb 2012 21:31:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11LVkK4006242; Wed, 1 Feb 2012 21:31:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202012131.q11LVkK4006242@svn.freebsd.org> From: Marius Strobl Date: Wed, 1 Feb 2012 21:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230896 - stable/9/sys/sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:31:47 -0000 Author: marius Date: Wed Feb 1 21:31:46 2012 New Revision: 230896 URL: http://svn.freebsd.org/changeset/base/230896 Log: MFC: r227980 Move to SCHED_ULE by default. Since r226057 SCHED_ULE and sparc64 are compatible with each other and since r227539 the last issue seen when using SCHED_ULE is fixed (MFC'ed to stable/9 in r230691 and r227714 respectively). At least on UP and 2-way machines SCHED_4BSD still performs better than SCHED_ULE, however, the optimizations done in r225889 (MFC'ed to stable/9 in r230673) pretty much compensate that so there's at least no net regression. Thanks go to Peter Jeremy for extensive testing. Modified: stable/9/sys/sparc64/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/conf/GENERIC ============================================================================== --- stable/9/sys/sparc64/conf/GENERIC Wed Feb 1 21:28:16 2012 (r230895) +++ stable/9/sys/sparc64/conf/GENERIC Wed Feb 1 21:31:46 2012 (r230896) @@ -26,7 +26,7 @@ makeoptions DEBUG=-g # Build kernel wit # Platforms supported # At this time all platforms are supported, as-is. -options SCHED_4BSD # 4BSD scheduler +options SCHED_ULE # ULE scheduler #options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols From owner-svn-src-all@FreeBSD.ORG Wed Feb 1 21:38:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E51151065676; Wed, 1 Feb 2012 21:38:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D14FE8FC0C; Wed, 1 Feb 2012 21:38:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q11Lc1la006499; Wed, 1 Feb 2012 21:38:01 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q11Lc1c4006495; Wed, 1 Feb 2012 21:38:01 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202012138.q11Lc1c4006495@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 1 Feb 2012 21:38: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: r230897 - in head/sys: conf dev/sound/pci gnu/dev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2012 21:38:02 -0000 Author: pfg Date: Wed Feb 1 21:38:01 2012 New Revision: 230897 URL: http://svn.freebsd.org/changeset/base/230897 Log: Use new OSS-based BSD-licensed header for cs sound driver. The cs driver requires a table with firmware values. An alternative firmware is available in a similar Open Sound System driver. This is actually a partial revert of Revision 77504. Special thanks to joel@ for patiently testing several replacement attempts. The csa driver and the complete sound system are now free of the GPL. Tested by: joel Approved by: jhb (mentor) MFC after: 3 weeks Added: head/sys/dev/sound/pci/cs461x_dsp.h (contents, props changed) Deleted: head/sys/gnu/dev/ Modified: head/sys/conf/files head/sys/dev/sound/pci/csa.c head/sys/dev/sound/pci/csareg.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Feb 1 21:31:46 2012 (r230896) +++ head/sys/conf/files Wed Feb 1 21:38:01 2012 (r230897) @@ -1732,8 +1732,7 @@ dev/sound/pci/als4000.c optional snd_al dev/sound/pci/atiixp.c optional snd_atiixp pci dev/sound/pci/cmi.c optional snd_cmi pci dev/sound/pci/cs4281.c optional snd_cs4281 pci -dev/sound/pci/csa.c optional snd_csa pci \ - warning "kernel contains GPL contaminated csaimg.h header" +dev/sound/pci/csa.c optional snd_csa pci dev/sound/pci/csapcm.c optional snd_csa pci dev/sound/pci/ds1.c optional snd_ds1 pci dev/sound/pci/emu10k1.c optional snd_emu10k1 pci Added: head/sys/dev/sound/pci/cs461x_dsp.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sound/pci/cs461x_dsp.h Wed Feb 1 21:38:01 2012 (r230897) @@ -0,0 +1,3497 @@ +/* $FreeBSD$ */ +/*- + * Copyright (C) 1996-2008, 4Front Technologies + * 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, WHETHERIN 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. + * + */ +/* + * This file is based on cs461x_dsp.h from the Open Sound System. + * Purpose: Firmware for cs461x/cs461x cards. + */ + +#ifndef _DEV_SOUND_PCI_CS461X_DSP_H +#define _DEV_SOUND_PCI_CS461X_DSP_H + +struct cs461x_firmware_struct cs461x_firmware = { + {{0x00000000, 0x00003000}, {0x00010000, 0x00003800}, + {0x00020000, 0x00007000}}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000163, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00200040, 0x00008010, 0x00000000, + 0x00000000, 0x80000001, 0x00000001, 0x00060000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00900080, 0x00000173, 0x00000000, + 0x00000000, 0x00000010, 0x00800000, 0x00900000, + 0xf2c0000f, 0x00000200, 0x00000000, 0x00010600, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000163, 0x330300c2, + 0x06000000, 0x00000000, 0x80008000, 0x80008000, + 0x3fc0000f, 0x00000301, 0x00010400, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00b00000, 0x00d0806d, 0x330480c3, + 0x04800000, 0x00000001, 0x00800001, 0x0000ffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x066a0130, 0x06350070, 0x0000929d, 0x929d929d, + 0x00000000, 0x0000735a, 0x00000600, 0x00000000, + 0x929d735a, 0x00000000, 0x00010000, 0x735a735a, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x000000f0, 0x0000804f, 0x000000c3, + 0x05000000, 0x00a00010, 0x00000000, 0x80008000, + 0x00000000, 0x00000000, 0x00000700, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000080, 0x00a00000, 0x0000809a, 0x000000c2, + 0x07400000, 0x00000000, 0x80008000, 0xffffffff, + 0x00c80028, 0x00005555, 0x00000000, 0x000107a0, + 0x00c80028, 0x000000c2, 0x06800000, 0x00000000, + 0x06e00080, 0x00300000, 0x000080bb, 0x000000c9, + 0x07a00000, 0x04000000, 0x80008000, 0xffffffff, + 0x00c80028, 0x00005555, 0x00000000, 0x00000780, + 0x00c80028, 0x000000c5, 0xff800000, 0x00000000, + 0x00640080, 0x00c00000, 0x00008197, 0x000000c9, + 0x07800000, 0x04000000, 0x80008000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0000805e, 0x000000c1, + 0x00000000, 0x00800000, 0x80008000, 0x80008000, + 0x00020000, 0x0000ffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x07c00000, 0x00900000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0000018e, 0x000000c2, + 0x07c00000, 0x00000000, 0x80008000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00e00100, 0x00000173, 0x00000000, + 0x00000000, 0x00400010, 0x00800000, 0x00e00000, + 0x00000000, 0x00000000, 0x08400000, 0x00900000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x01100000, 0x0000018e, 0x000000c2, + 0x08400000, 0x00000000, 0x80008000, 0xffffffff, + 0x007fff80, 0x00280058, 0x01300000, 0x00000000, + 0x00000000, 0x2aab0000, 0x00000000, 0x00000000, + 0x00000000, 0x01200000, 0x0000026c, 0x000000c2, + 0x08c00000, 0x18000000, 0x80008000, 0x80008000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0000805e, 0x000000c1, + 0x00000000, 0x01000000, 0x80008000, 0x80008000, + 0x00000000, 0x00000110, 0x00000000, 0x00000000, + 0x00000000, 0x00000082, 0x09000000, 0x00000000, + 0x00000000, 0x00000600, 0x013d0233, 0x20ff0040, + 0x00000000, 0x0000804c, 0x000101d8, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x929d0600, 0x929d929d, 0x929d929d, 0x929d0000, + 0x929d929d, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x00100635, 0x060b013f, 0x00000004, + 0x00000001, 0x007a0002, 0x00000000, 0x066e0610, + 0x0105929d, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0xa431ac75, 0x0001735a, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0x735a0051, + 0x00000000, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x929d929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x929d929d, 0x00000000, 0x06400136, + 0x0000270f, 0x00010000, 0x007a0000, 0x00000000, + 0x068e0645, 0x0105929d, 0x929d929d, 0x929d929d, + 0x929d929d, 0x929d929d, 0xa431ac75, 0x0001735a, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0xa431ac75, 0xa431ac75, 0xa431ac75, 0xa431ac75, + 0x735a0100, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 00:10:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F4C1106566C; Thu, 2 Feb 2012 00:10:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DBDC8FC13; Thu, 2 Feb 2012 00:10:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q120AL2N011222; Thu, 2 Feb 2012 00:10:21 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q120ALq9011218; Thu, 2 Feb 2012 00:10:21 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202020010.q120ALq9011218@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 2 Feb 2012 00:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230898 - in head/sys/modules/sound/driver: emu10k1 emu10kx maestro3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 00:10:21 -0000 Author: pfg Date: Thu Feb 2 00:10:20 2012 New Revision: 230898 URL: http://svn.freebsd.org/changeset/base/230898 Log: Cleanup some sound headers that don't need to be in the modules makefiles. Approved by: jhb (mentor) MFC after: 1 week Modified: head/sys/modules/sound/driver/emu10k1/Makefile head/sys/modules/sound/driver/emu10kx/Makefile head/sys/modules/sound/driver/maestro3/Makefile Modified: head/sys/modules/sound/driver/emu10k1/Makefile ============================================================================== --- head/sys/modules/sound/driver/emu10k1/Makefile Wed Feb 1 21:38:01 2012 (r230897) +++ head/sys/modules/sound/driver/emu10k1/Makefile Thu Feb 2 00:10:20 2012 (r230898) @@ -4,7 +4,7 @@ ${.CURDIR}/../../../../gnu/dev/sound/pci KMOD= snd_emu10k1 -SRCS= device_if.h bus_if.h emuxkireg.h pci_if.h +SRCS= device_if.h bus_if.h pci_if.h SRCS+= mpufoi_if.h SRCS+= emu10k1.c Modified: head/sys/modules/sound/driver/emu10kx/Makefile ============================================================================== --- head/sys/modules/sound/driver/emu10kx/Makefile Wed Feb 1 21:38:01 2012 (r230897) +++ head/sys/modules/sound/driver/emu10kx/Makefile Thu Feb 2 00:10:20 2012 (r230898) @@ -11,6 +11,5 @@ SRCS+= vnode_if.h SRCS+= emu10kx.c SRCS+= emu10kx-pcm.c SRCS+= emu10kx-midi.c -SRCS+= emuxkireg.h .include Modified: head/sys/modules/sound/driver/maestro3/Makefile ============================================================================== --- head/sys/modules/sound/driver/maestro3/Makefile Wed Feb 1 21:38:01 2012 (r230897) +++ head/sys/modules/sound/driver/maestro3/Makefile Thu Feb 2 00:10:20 2012 (r230898) @@ -4,7 +4,6 @@ KMOD= snd_maestro3 SRCS= device_if.h bus_if.h pci_if.h -SRCS+= allegro_code.h allegro_reg.h SRCS+= maestro3.c CFLAGS+= -Wall -DM3_DEBUG_LEVEL=-1 From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 02:29:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E11A3106564A; Thu, 2 Feb 2012 02:29:17 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 9EE038FC0A; Thu, 2 Feb 2012 02:29:14 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 3BEE125D385E; Thu, 2 Feb 2012 02:29:12 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 38955BDA74F; Thu, 2 Feb 2012 02:29:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Y5twILoOIK1q; Thu, 2 Feb 2012 02:29:09 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id B2B7ABDA769; Thu, 2 Feb 2012 02:29:09 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/mixed; boundary=Apple-Mail-22--197285964 From: "Bjoern A. Zeeb" In-Reply-To: <201201231617.q0NGHtPq033979@svn.freebsd.org> Date: Thu, 2 Feb 2012 02:29:08 +0000 Message-Id: <1D21A08C-C878-473B-B47B-985559F454CC@lists.zabbadoz.net> References: <201201231617.q0NGHtPq033979@svn.freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) 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: r230484 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 02:29:18 -0000 --Apple-Mail-22--197285964 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 23. Jan 2012, at 16:17 , Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Mon Jan 23 16:17:54 2012 > New Revision: 230484 > URL: http://svn.freebsd.org/changeset/base/230484 >=20 > Log: > Part of r230482 didn't actually work. Revert it for now. This means = PR > 161047 isn't actually fixed. >=20 It also seems that this currently leaves the VTY0 in tail saying: "Starting local daemons:" ^T says tail, ^C and ^Z obviously don't work and the boot seems to hang unless you get what's going on. Took me a couple minutes:( We really need a big message there... saying "please go to vtyX" at = least. See also attached screenshot. > PR: bin/161047 >=20 > Modified: > head/release/rc.local >=20 > Modified: head/release/rc.local > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/release/rc.local Mon Jan 23 15:50:16 2012 = (r230483) > +++ head/release/rc.local Mon Jan 23 16:17:54 2012 = (r230484) > @@ -14,14 +14,12 @@ if [ $? -eq 0 ]; then > TERM=3Dxterm >=20 > if [ -z "$EXTERNAL_VTY_STARTED" ]; then > - vidcontrol -s 2 # Switch to a VTY with no kernel = messages > # Init will clean these processes up if/when the system > # goes multiuser > touch /tmp/bsdinstall_log > tail -f /tmp/bsdinstall_log > /dev/ttyv2 & > /usr/libexec/getty autologin ttyv3 > EXTERNAL_VTY_STARTED=3D1 > - trap "vidcontrol -s 1" EXIT > fi > else > # Serial or other console --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! --Apple-Mail-22--197285964-- From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 03:56:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A93C106566B; Thu, 2 Feb 2012 03:56:08 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 081C28FC14; Thu, 2 Feb 2012 03:56:08 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 0A09425D385E; Thu, 2 Feb 2012 03:56:06 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 0BA3ABDA77A; Thu, 2 Feb 2012 03:56:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id q0zmqVpkcAdL; Thu, 2 Feb 2012 03:56:04 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 7B4E6BDA779; Thu, 2 Feb 2012 03:56:04 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201202012018.q11KIvae002893@svn.freebsd.org> Date: Thu, 2 Feb 2012 03:56:03 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <35AAFFDE-9247-4489-B5A5-7F5048AC766E@lists.zabbadoz.net> References: <201202012018.q11KIvae002893@svn.freebsd.org> To: Kenneth D. Merry X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230878 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 03:56:08 -0000 On 1. Feb 2012, at 20:18 , Kenneth D. Merry wrote: > Author: ken > Date: Wed Feb 1 20:18:57 2012 > New Revision: 230878 > URL: http://svn.freebsd.org/changeset/base/230878 >=20 > Log: > Add the netback driver to the build. I guess only tested on amd64... =3D=3D=3D> i386 XENHVM failed (_.i386.XENHVM): >>> Kernel build for XENHVM started on Thu Feb 2 02:29:12 UTC 2012 /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c: In function = 'xnb_txpkt2gnttab': =3D=3D=3D> i386 XEN failed (_.i386.XEN): >>> Kernel build for XEN started on Thu Feb 2 02:29:11 UTC 2012 /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c: In function = 'xnb_free_communication_mem': /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c:622: error: = 'kernel_map' undeclared (first use in this function) /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c:622: error: (Each = undeclared identifier is reported only once /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c:622: error: for = each function it appears in.) /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c: In function = 'xnb_alloc_communication_mem': /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c:812: error: = 'kernel_map' undeclared (first use in this function) > MFC after: 3 days >=20 > Modified: > head/sys/conf/files >=20 > Modified: head/sys/conf/files > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/conf/files Wed Feb 1 20:12:44 2012 = (r230877) > +++ head/sys/conf/files Wed Feb 1 20:18:57 2012 = (r230878) > @@ -3532,6 +3532,7 @@ dev/xen/blkback/blkback.c optional xen | > dev/xen/console/console.c optional xen > dev/xen/console/xencons_ring.c optional xen > dev/xen/control/control.c optional xen | xenhvm > +dev/xen/netback/netback.c optional xen | xenhvm > dev/xen/netfront/netfront.c optional xen | xenhvm > dev/xen/xenpci/xenpci.c optional xenpci > dev/xen/xenpci/evtchn.c optional xenpci --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 06:17:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5734D106566B; Thu, 2 Feb 2012 06:17:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A28898FC14; Thu, 2 Feb 2012 06:17:40 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q126HZqq037255 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Feb 2012 08:17:35 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q126HZhU094894; Thu, 2 Feb 2012 08:17:35 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q126HYUT094893; Thu, 2 Feb 2012 08:17:34 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 2 Feb 2012 08:17:34 +0200 From: Konstantin Belousov To: Bruce Evans , Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: <20120202061734.GP3283@deviant.kiev.zoral.com.ua> References: <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> <20120127194221.GA25723@zim.MIT.EDU> <20120128123748.GD2726@deviant.kiev.zoral.com.ua> <20120129001225.GA32220@zim.MIT.EDU> <20120129062327.GK2726@deviant.kiev.zoral.com.ua> <20120129223904.GA37483@zim.MIT.EDU> <20120130063034.GU2726@deviant.kiev.zoral.com.ua> <20120130190703.GA44663@zim.MIT.EDU> <20120131105431.GB3283@deviant.kiev.zoral.com.ua> <20120131174849.GA50386@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X78YbkCBd9ye7Cvs" Content-Disposition: inline In-Reply-To: <20120131174849.GA50386@zim.MIT.EDU> 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=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 06:17:41 -0000 --X78YbkCBd9ye7Cvs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 31, 2012 at 12:48:49PM -0500, David Schultz wrote: > On Tue, Jan 31, 2012, Konstantin Belousov wrote: > > On Mon, Jan 30, 2012 at 02:07:03PM -0500, David Schultz wrote: > > > On Mon, Jan 30, 2012, Kostik Belousov wrote: > > > > On Sun, Jan 29, 2012 at 05:39:04PM -0500, David Schultz wrote: > > > > > On Sun, Jan 29, 2012, Kostik Belousov wrote: > > > > > > On Sat, Jan 28, 2012 at 07:12:25PM -0500, David Schultz wrote: > > > > > > > On Sat, Jan 28, 2012, Kostik Belousov wrote: > > > > > > > > On Fri, Jan 27, 2012 at 02:42:21PM -0500, David Schultz wro= te: > > > > > > > > > The correct limit on the maximum size of a single read/wr= ite is > > > > > > > > > SSIZE_MAX, but FreeBSD uses INT_MAX. It's not safe to ra= ise the > > > > > > > > > limit yet, though, because of bugs in several filesystems= . For > > > > > > > > > example, FFS copies uio_resid into a local variable of ty= pe int. > > > > > > > > > I have some old patches that fix some of these issues for= FFS and > > > > > > > > > cd9660, but surely there are more places I didn't notice. > > > > > > > > >=20 > > > > > > > > Absolutely agree. > > > > > > > >=20 > > > > > > > > http://people.freebsd.org/~kib/misc/uio_resid.5.patch > > > > > > >=20 > > > > > > > Nice. You found a lot more than I've got in my tree, and you= even > > > > > > > fixed the return values. There are at least a few more place= s to > > > > > > > fix. For instance, cd9660 and the NFS client pass uio_resid = or > > > > > > > iov_len to min(), which operates on ints. (Incidentally, C11 > > > > > > > generics ought to make it possible to write type-generic min() > > > > > > > and max() functions.) > > > > > >=20 > > > > > > Thank you, http://people.freebsd.org/~kib/misc/uio_resid.6.patch > > > > > > changed them to MIN(). > > > > >=20 > > > > > This looks good to me. I tried to think of other places that you > > > > > might have missed, and the only one that occurred to me is the > > > > Might ? I think this is a blatant understate. > > > >=20 > > > > > pipe code. sys_pipe.c has an `int orig_resid' and lots of bogus > > > > > casts of iov_len and uio_resid to type u_int. Some look harmless, > > > > > although it appears that writing a multiple of 2^32 bytes might > > > > > result in pipe_build_write_buffer() allocating a 0-length buffer. > > > > >=20 > > > > > My only reservation is that raising the limit could unmask a > > > > > kernel buffer overflow if we missed something, but I guess we have > > > > > to cross that bridge some day anyway. > > > > Yes, and it is an obvious reason why I am chicken to commit this for > > > > so long time. One more place, if this is reasonable to count as 'on= e' > > > > place, are the cdevsw methods. devfs passes uio down to the drivers. > > >=20 > > > That's why I'm glad I'm not committing it. :) A more conservative > > > change (also known as "kicking the can down the road") would be to > > > add a VFS flag, e.g., VFCF_LONGIO, and only set it on file systems > > > that have been thoroughly reviewed. The VFS layer could cap the size > > > at INT_MAX for file systems without the flag. > > At least I will get more mail after the commit, I hope. > >=20 > > I disagree with the VFCF_LONGIO approach. It will cause much head-scrat= ching > > for unsuspecting user who would try to use > 4GB transfers. > >=20 > > What I can do, is to commit all changes except removals of the checks > > for INT_MAX. After type changes settle, I can try to gather enough > > bravery to flip the checks in HEAD, possibly with temporary sysctl > > to return to old behaviour for emergency (AKA hole). >=20 > That sounds like a good plan to me. >=20 > As an aside, I wonder if we could convince the clang folks to add > a warning similar to `lint -a', which complains about every long->int > narrowing conversion that doesn't have an explicit cast. Modern > languages such as Java and C# require casts for narrowing > conversions, and I'd be a lot more confident about this change if > we did the same for the FreeBSD kernel. >=20 > > > > diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c > > > > index 9edcb74..332ec37 100644 > > > > --- a/sys/kern/sys_pipe.c > > > > +++ b/sys/kern/sys_pipe.c > > > [...] > > > > @@ -757,14 +757,14 @@ pipe_build_write_buffer(wpipe, uio) > > > > struct pipe *wpipe; > > > > struct uio *uio; > > > > { > > > > - u_int size; > > > > + size_t size; > > > > int i; > > > > =20 > > > > PIPE_LOCK_ASSERT(wpipe, MA_NOTOWNED); > > > > KASSERT(wpipe->pipe_state & PIPE_DIRECTW, > > > > ("Clone attempt on non-direct write pipe!")); > > > > =20 > > > > - size =3D (u_int) uio->uio_iov->iov_len; > > > > + size =3D uio->uio_iov->iov_len; > > > > if (size > wpipe->pipe_buffer.size) > > > > size =3D wpipe->pipe_buffer.size; > > >=20 > > > The transfer can't be bigger than the max pipe buffer size (64k), > > > so `size =3D (int)MIN(uio->uio_iov->iov_len, wpipe->pipe_buffer.size)' > > > should suffice. The same comment applies elsewhere in the file. > >=20 > > True. If you much prefer this version, I will change the patch. But I do > > think that my changes are cleaner. >=20 > I don't mind either way. I haven't touched anything remotely > close to that code in years. I did the changes along the way suggested by Bruce. Also, I put the patch under the real test for UFS and new NFS client, reading/writing files of sizes multiple of INT_MAX in single transaction. This indeed revealed two more issues, one in ktrace, and second in uiomove(). The later resulted in quite spectacular kernel stack corruption, because uio_iovcnt become underflowed and iovec was iterated past end. The updated patch disables SSIZE_MAX i/o by default, and includes sysctl knob debug.iosize_max_clamp, which removes the clamp if set to zero. I consider this patch as a commit candidate. http://people.freebsd.org/~kib/misc/uio_resid.9.patch --X78YbkCBd9ye7Cvs Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk8qKn0ACgkQC3+MBN1Mb4g65ACgsLLHOMAckJciVwiRT5K4u+2H 4yEAn3JoSuIHG8d6edIxVMAevmh+MFJz =lqxH -----END PGP SIGNATURE----- --X78YbkCBd9ye7Cvs-- From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 06:18:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9B121065672; Thu, 2 Feb 2012 06:18: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 A818F8FC15; Thu, 2 Feb 2012 06:18:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q126IfkB022510; Thu, 2 Feb 2012 06:18:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q126If8B022508; Thu, 2 Feb 2012 06:18:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202020618.q126If8B022508@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 Feb 2012 06:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230900 - stable/9/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 06:18:41 -0000 Author: kib Date: Thu Feb 2 06:18:41 2012 New Revision: 230900 URL: http://svn.freebsd.org/changeset/base/230900 Log: MFC r230783: Add definition for PT_GNU_RELRO. Modified: stable/9/sys/sys/elf_common.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sys/elf_common.h ============================================================================== --- stable/9/sys/sys/elf_common.h Thu Feb 2 04:20:33 2012 (r230899) +++ stable/9/sys/sys/elf_common.h Thu Feb 2 06:18:41 2012 (r230900) @@ -328,6 +328,7 @@ typedef struct { #define PT_SUNW_UNWIND 0x6464e550 /* amd64 UNWIND program header */ #define PT_GNU_EH_FRAME 0x6474e550 #define PT_GNU_STACK 0x6474e551 +#define PT_GNU_RELRO 0x6474e552 #define PT_LOSUNW 0x6ffffffa #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ #define PT_SUNWSTACK 0x6ffffffb /* describes the stack segment */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 06:39:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA820106564A; Thu, 2 Feb 2012 06:39: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 98FCB8FC16; Thu, 2 Feb 2012 06:39:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q126dXge023178; Thu, 2 Feb 2012 06:39:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q126dXbI023176; Thu, 2 Feb 2012 06:39:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202020639.q126dXbI023176@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 Feb 2012 06:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230901 - stable/8/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 06:39:33 -0000 Author: kib Date: Thu Feb 2 06:39:33 2012 New Revision: 230901 URL: http://svn.freebsd.org/changeset/base/230901 Log: MFC r230783: Add definition for PT_GNU_RELRO. Modified: stable/8/sys/sys/elf_common.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/sys/elf_common.h ============================================================================== --- stable/8/sys/sys/elf_common.h Thu Feb 2 06:18:41 2012 (r230900) +++ stable/8/sys/sys/elf_common.h Thu Feb 2 06:39:33 2012 (r230901) @@ -326,6 +326,7 @@ typedef struct { #define PT_SUNW_UNWIND 0x6464e550 /* amd64 UNWIND program header */ #define PT_GNU_EH_FRAME 0x6474e550 #define PT_GNU_STACK 0x6474e551 +#define PT_GNU_RELRO 0x6474e552 #define PT_LOSUNW 0x6ffffffa #define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ #define PT_SUNWSTACK 0x6ffffffb /* describes the stack segment */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 07:38:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1331106566B; Thu, 2 Feb 2012 07:38:40 +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 BB7998FC08; Thu, 2 Feb 2012 07:38:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q127ceG4025361; Thu, 2 Feb 2012 07:38:40 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q127ceIo025359; Thu, 2 Feb 2012 07:38:40 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202020738.q127ceIo025359@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 2 Feb 2012 07:38: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: r230902 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 07:38:40 -0000 Author: ken Date: Thu Feb 2 07:38:40 2012 New Revision: 230902 URL: http://svn.freebsd.org/changeset/base/230902 Log: Unbreak the i386 full PV (XEN kernel) build by reverting rev 230878 and taking the netback driver out of the build temporarily. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 2 06:39:33 2012 (r230901) +++ head/sys/conf/files Thu Feb 2 07:38:40 2012 (r230902) @@ -3531,7 +3531,6 @@ dev/xen/blkback/blkback.c optional xen | dev/xen/console/console.c optional xen dev/xen/console/xencons_ring.c optional xen dev/xen/control/control.c optional xen | xenhvm -dev/xen/netback/netback.c optional xen | xenhvm dev/xen/netfront/netfront.c optional xen | xenhvm dev/xen/xenpci/xenpci.c optional xenpci dev/xen/xenpci/evtchn.c optional xenpci From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 07:41:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 659E4106574A; Thu, 2 Feb 2012 07:41:51 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 266768FC1C; Thu, 2 Feb 2012 07:41:50 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q127fowu088752; Thu, 2 Feb 2012 00:41:50 -0700 (MST) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q127fnO3088749; Thu, 2 Feb 2012 00:41:49 -0700 (MST) (envelope-from ken) Date: Thu, 2 Feb 2012 00:41:49 -0700 From: "Kenneth D. Merry" To: "Bjoern A. Zeeb" Message-ID: <20120202074149.GA87780@nargothrond.kdm.org> References: <201202012018.q11KIvae002893@svn.freebsd.org> <35AAFFDE-9247-4489-B5A5-7F5048AC766E@lists.zabbadoz.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <35AAFFDE-9247-4489-B5A5-7F5048AC766E@lists.zabbadoz.net> User-Agent: Mutt/1.4.2i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230878 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 07:41:51 -0000 On Thu, Feb 02, 2012 at 03:56:03 +0000, Bjoern A. Zeeb wrote: > On 1. Feb 2012, at 20:18 , Kenneth D. Merry wrote: > > > Author: ken > > Date: Wed Feb 1 20:18:57 2012 > > New Revision: 230878 > > URL: http://svn.freebsd.org/changeset/base/230878 > > > > Log: > > Add the netback driver to the build. > > I guess only tested on amd64... > > ===> i386 XENHVM failed (_.i386.XENHVM): > >>> Kernel build for XENHVM started on Thu Feb 2 02:29:12 UTC 2012 > /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c: In function 'xnb_txpkt2gnttab': > > ===> i386 XEN failed (_.i386.XEN): > >>> Kernel build for XEN started on Thu Feb 2 02:29:11 UTC 2012 > > /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c: In function 'xnb_free_communication_mem': > /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c:622: error: 'kernel_map' undeclared (first use in this function) > /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c:622: error: (Each undeclared identifier is reported only once > /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c:622: error: for each function it appears in.) > /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c: In function 'xnb_alloc_communication_mem': > /scratch/tmp/bz/head.svn/sys/dev/xen/netback/netback.c:812: error: 'kernel_map' undeclared (first use in this function) Whoops! Sorry about that. I backed it out until I can figure out the right way to fix it. My build machine is bogged down with nightly backups at the moment, so figuring out the fix isn't going to happen tonight. Thanks, Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 14:17:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18897106566C; Thu, 2 Feb 2012 14:17:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03E4F8FC0A; Thu, 2 Feb 2012 14:17:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q12EHwkA040838; Thu, 2 Feb 2012 14:17:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q12EHw1S040836; Thu, 2 Feb 2012 14:17:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202021417.q12EHw1S040836@svn.freebsd.org> From: Alexander Motin Date: Thu, 2 Feb 2012 14:17: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: r230912 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 14:17:59 -0000 Author: mav Date: Thu Feb 2 14:17:58 2012 New Revision: 230912 URL: http://svn.freebsd.org/changeset/base/230912 Log: Make CAM ATA honor old hw.ata.ata_dma and hw.ata.atapi_dma tunables. Even having more specific hint.ata.X.mode controls, global ones are still could be useful from some points, including compatibility. PR: kern/164651 MFC after: 1 week Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Thu Feb 2 12:22:22 2012 (r230911) +++ head/sys/cam/ata/ata_xpt.c Thu Feb 2 14:17:58 2012 (r230912) @@ -186,6 +186,12 @@ static void ata_dev_async(u_int32_t asy static void ata_action(union ccb *start_ccb); static void ata_announce_periph(struct cam_periph *periph); +static int ata_dma = 1; +static int atapi_dma = 1; + +TUNABLE_INT("hw.ata.ata_dma", &ata_dma); +TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma); + static struct xpt_xport ata_xport = { .alloc_device = ata_alloc_device, .action = ata_action, @@ -356,6 +362,13 @@ probestart(struct cam_periph *periph, un if (cts.xport_specific.sata.valid & CTS_SATA_VALID_MODE) mode = cts.xport_specific.sata.mode; } + if (periph->path->device->protocol == PROTO_ATA) { + if (ata_dma == 0 && (mode == 0 || mode > ATA_PIO_MAX)) + mode = ATA_PIO_MAX; + } else { + if (atapi_dma == 0 && (mode == 0 || mode > ATA_PIO_MAX)) + mode = ATA_PIO_MAX; + } negotiate: /* Honor device capabilities. */ wantmode = mode = ata_max_mode(ident_buf, mode); From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 15:24:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 305C0106566C; Thu, 2 Feb 2012 15:24:10 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id F04878FC0C; Thu, 2 Feb 2012 15:24:09 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LYR00K0KUS9UR00@smtpauth2.wiscmail.wisc.edu>; Thu, 02 Feb 2012 09:24:09 -0600 (CST) Received: from wanderer.tachypleus.net (i3-user-nat.icecube.wisc.edu [128.104.255.12]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LYR0084SUS61Q30@smtpauth2.wiscmail.wisc.edu>; Thu, 02 Feb 2012 09:24:06 -0600 (CST) Date: Thu, 02 Feb 2012 09:24:05 -0600 From: Nathan Whitehorn In-reply-to: <1D21A08C-C878-473B-B47B-985559F454CC@lists.zabbadoz.net> To: "Bjoern A. Zeeb" Message-id: <4F2AAA95.8050702@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.255.12 X-Spam-PmxInfo: Server=avs-13, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.2.2.151515, SenderIP=128.104.255.12 References: <201201231617.q0NGHtPq033979@svn.freebsd.org> <1D21A08C-C878-473B-B47B-985559F454CC@lists.zabbadoz.net> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111213 Thunderbird/8.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230484 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 15:24:10 -0000 On 02/01/12 20:29, Bjoern A. Zeeb wrote: > > On 23. Jan 2012, at 16:17 , Nathan Whitehorn wrote: > >> Author: nwhitehorn >> Date: Mon Jan 23 16:17:54 2012 >> New Revision: 230484 >> URL: http://svn.freebsd.org/changeset/base/230484 >> >> Log: >> Part of r230482 didn't actually work. Revert it for now. This means PR >> 161047 isn't actually fixed. >> > > It also seems that this currently leaves the VTY0 in tail saying: > "Starting local daemons:" > > ^T says tail, ^C and ^Z obviously don't work and the boot seems to hang > unless you get what's going on. Took me a couple minutes:( > > We really need a big message there... saying "please go to vtyX" at least. > > See also attached screenshot. Interesting and sorry for breakage --it should just continue normally. I've broken my arm and typing and testing this kind of thing is hard. Any chance you could fix it? -Nathan > >> PR: bin/161047 >> >> Modified: >> head/release/rc.local >> >> Modified: head/release/rc.local >> ============================================================================== >> --- head/release/rc.local Mon Jan 23 15:50:16 2012 (r230483) >> +++ head/release/rc.local Mon Jan 23 16:17:54 2012 (r230484) >> @@ -14,14 +14,12 @@ if [ $? -eq 0 ]; then >> TERM=xterm >> >> if [ -z "$EXTERNAL_VTY_STARTED" ]; then >> - vidcontrol -s 2 # Switch to a VTY with no kernel messages >> # Init will clean these processes up if/when the system >> # goes multiuser >> touch /tmp/bsdinstall_log >> tail -f /tmp/bsdinstall_log> /dev/ttyv2& >> /usr/libexec/getty autologin ttyv3 >> EXTERNAL_VTY_STARTED=1 >> - trap "vidcontrol -s 1" EXIT >> fi >> else >> # Serial or other console > > From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 16:18:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A21FA1065672; Thu, 2 Feb 2012 16:18:41 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C43F8FC0A; Thu, 2 Feb 2012 16:18:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q12GIfUZ044501; Thu, 2 Feb 2012 16:18:41 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q12GIf7e044499; Thu, 2 Feb 2012 16:18:41 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202021618.q12GIf7e044499@svn.freebsd.org> From: Martin Matuska Date: Thu, 2 Feb 2012 16:18: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: r230913 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 16:18:41 -0000 Author: mm Date: Thu Feb 2 16:18:40 2012 New Revision: 230913 URL: http://svn.freebsd.org/changeset/base/230913 Log: Fix out of bounds write causing random panics, uncovered by the change in r230256 Reviewed by: pluknet@ MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Feb 2 14:17:58 2012 (r230912) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Feb 2 16:18:40 2012 (r230913) @@ -993,7 +993,7 @@ dnode_buf_pageout(dmu_buf_t *db, void *a dnh->dnh_dnode = NULL; } kmem_free(children_dnodes, sizeof (dnode_children_t) + - (epb - 1) * sizeof (dnode_handle_t)); + epb * sizeof (dnode_handle_t)); } /* @@ -1078,7 +1078,7 @@ dnode_hold_impl(objset_t *os, uint64_t o int i; dnode_children_t *winner; children_dnodes = kmem_zalloc(sizeof (dnode_children_t) + - (epb - 1) * sizeof (dnode_handle_t), KM_SLEEP); + epb * sizeof (dnode_handle_t), KM_SLEEP); children_dnodes->dnc_count = epb; dnh = &children_dnodes->dnc_children[0]; for (i = 0; i < epb; i++) { @@ -1088,7 +1088,7 @@ dnode_hold_impl(objset_t *os, uint64_t o if (winner = dmu_buf_set_user(&db->db, children_dnodes, NULL, dnode_buf_pageout)) { kmem_free(children_dnodes, sizeof (dnode_children_t) + - (epb - 1) * sizeof (dnode_handle_t)); + epb * sizeof (dnode_handle_t)); children_dnodes = winner; } } From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 16:33:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9869E106564A; Thu, 2 Feb 2012 16:33:59 +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 829228FC12; Thu, 2 Feb 2012 16:33:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q12GXx1x045031; Thu, 2 Feb 2012 16:33:59 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q12GXxHN045029; Thu, 2 Feb 2012 16:33:59 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202021633.q12GXxHN045029@svn.freebsd.org> From: Martin Matuska Date: Thu, 2 Feb 2012 16:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230914 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 16:33:59 -0000 Author: mm Date: Thu Feb 2 16:33:58 2012 New Revision: 230914 URL: http://svn.freebsd.org/changeset/base/230914 Log: Add copyright information on last commits to comply with CDDL. Discussed with: pluknet@ MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Feb 2 16:18:40 2012 (r230913) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Feb 2 16:33:58 2012 (r230914) @@ -20,6 +20,9 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * + * Portions Copyright 2012 Sergey Kandaurov + * Portions Copyright 2012 Martin Matuska */ #include From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 17:08:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA1C3106564A; Thu, 2 Feb 2012 17:08:51 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 3171C8FC12; Thu, 2 Feb 2012 17:08:51 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 5B77C25D3888; Thu, 2 Feb 2012 17:08:50 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 82F35BDA818; Thu, 2 Feb 2012 17:08:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id naBLmFkCJhzH; Thu, 2 Feb 2012 17:08:48 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 61505BDA81A; Thu, 2 Feb 2012 17:08:48 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <4F2AAA95.8050702@freebsd.org> Date: Thu, 2 Feb 2012 17:08:47 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <54DDA424-0570-4485-B93A-52BC2CFC83F1@lists.zabbadoz.net> References: <201201231617.q0NGHtPq033979@svn.freebsd.org> <1D21A08C-C878-473B-B47B-985559F454CC@lists.zabbadoz.net> <4F2AAA95.8050702@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230484 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 17:08:51 -0000 On 2. Feb 2012, at 15:24 , Nathan Whitehorn wrote: > On 02/01/12 20:29, Bjoern A. Zeeb wrote: >>=20 >> On 23. Jan 2012, at 16:17 , Nathan Whitehorn wrote: >>=20 >>> Author: nwhitehorn >>> Date: Mon Jan 23 16:17:54 2012 >>> New Revision: 230484 >>> URL: http://svn.freebsd.org/changeset/base/230484 >>>=20 >>> Log: >>> Part of r230482 didn't actually work. Revert it for now. This means = PR >>> 161047 isn't actually fixed. >>>=20 >>=20 >> It also seems that this currently leaves the VTY0 in tail saying: >> "Starting local daemons:" >>=20 >> ^T says tail, ^C and ^Z obviously don't work and the boot seems to = hang >> unless you get what's going on. Took me a couple minutes:( >>=20 >> We really need a big message there... saying "please go to vtyX" at = least. >>=20 >> See also attached screenshot. >=20 > Interesting and sorry for breakage --it should just continue normally. Switching to vty3 and checking it seems "bsdinstall" is not running on = any other terminal either yet. > I've broken my arm and typing and testing this kind of thing is hard. = Any chance you could fix it? Get well soon. I'll see if I can trick anyone into it or find some time = this weekend. /bz --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 17:25:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 236401065674; Thu, 2 Feb 2012 17:25:40 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E9358FC08; Thu, 2 Feb 2012 17:25:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q12HPdji046666; Thu, 2 Feb 2012 17:25:39 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q12HPdtA046663; Thu, 2 Feb 2012 17:25:39 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201202021725.q12HPdtA046663@svn.freebsd.org> From: Joel Dahl Date: Thu, 2 Feb 2012 17:25: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: r230915 - in head/sys/modules/sound/driver: emu10k1 emu10kx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 17:25:40 -0000 Author: joel (doc committer) Date: Thu Feb 2 17:25:39 2012 New Revision: 230915 URL: http://svn.freebsd.org/changeset/base/230915 Log: Remove leftovers from previous commits. Approved by: jhb Modified: head/sys/modules/sound/driver/emu10k1/Makefile head/sys/modules/sound/driver/emu10kx/Makefile Modified: head/sys/modules/sound/driver/emu10k1/Makefile ============================================================================== --- head/sys/modules/sound/driver/emu10k1/Makefile Thu Feb 2 16:33:58 2012 (r230914) +++ head/sys/modules/sound/driver/emu10k1/Makefile Thu Feb 2 17:25:39 2012 (r230915) @@ -1,7 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../../dev/sound/pci \ - ${.CURDIR}/../../../../gnu/dev/sound/pci +.PATH: ${.CURDIR}/../../../../dev/sound/pci KMOD= snd_emu10k1 SRCS= device_if.h bus_if.h pci_if.h Modified: head/sys/modules/sound/driver/emu10kx/Makefile ============================================================================== --- head/sys/modules/sound/driver/emu10kx/Makefile Thu Feb 2 16:33:58 2012 (r230914) +++ head/sys/modules/sound/driver/emu10kx/Makefile Thu Feb 2 17:25:39 2012 (r230915) @@ -1,6 +1,5 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../../dev/sound/pci \ - ${.CURDIR}/../../../../gnu/dev/sound/pci +.PATH: ${.CURDIR}/../../../../dev/sound/pci KMOD= snd_emu10kx From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 17:54:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7E2B106566B; Thu, 2 Feb 2012 17:54:35 +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 C1A2C8FC08; Thu, 2 Feb 2012 17:54:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q12HsZHH047643; Thu, 2 Feb 2012 17:54:35 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q12HsZh5047637; Thu, 2 Feb 2012 17:54:35 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202021754.q12HsZh5047637@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 2 Feb 2012 17:54: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: r230916 - in head/sys: conf dev/xen/netback i386/include/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 17:54:35 -0000 Author: ken Date: Thu Feb 2 17:54:35 2012 New Revision: 230916 URL: http://svn.freebsd.org/changeset/base/230916 Log: Fix the netback driver build for i386. netback.c: Add missing VM includes. xen/xenvar.h, xen/xenpmap.h: Move some XENHVM macros from to on i386 to match the amd64 headers. conf/files: Add netback to the build. Submitted by: jhb MFC after: 3 days Modified: head/sys/conf/files head/sys/dev/xen/netback/netback.c head/sys/i386/include/xen/xenpmap.h head/sys/i386/include/xen/xenvar.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 2 17:25:39 2012 (r230915) +++ head/sys/conf/files Thu Feb 2 17:54:35 2012 (r230916) @@ -3531,6 +3531,7 @@ dev/xen/blkback/blkback.c optional xen | dev/xen/console/console.c optional xen dev/xen/console/xencons_ring.c optional xen dev/xen/control/control.c optional xen | xenhvm +dev/xen/netback/netback.c optional xen | xenhvm dev/xen/netfront/netfront.c optional xen | xenhvm dev/xen/xenpci/xenpci.c optional xenpci dev/xen/xenpci/evtchn.c optional xenpci Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Thu Feb 2 17:25:39 2012 (r230915) +++ head/sys/dev/xen/netback/netback.c Thu Feb 2 17:54:35 2012 (r230916) @@ -75,6 +75,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include Modified: head/sys/i386/include/xen/xenpmap.h ============================================================================== --- head/sys/i386/include/xen/xenpmap.h Thu Feb 2 17:25:39 2012 (r230915) +++ head/sys/i386/include/xen/xenpmap.h Thu Feb 2 17:54:35 2012 (r230916) @@ -232,15 +232,6 @@ phys_to_machine_mapping_valid(unsigned l return xen_phys_machine[pfn] != INVALID_P2M_ENTRY; } -#elif defined(XENHVM) - -#define set_phys_to_machine(pfn, mfn) ((void)0) -#define phys_to_machine_mapping_valid(pfn) (TRUE) - -#if !defined(PAE) -#define vtomach(va) pmap_kextract((vm_offset_t) (va)) -#endif - -#endif /* !XEN && !XENHVM */ +#endif /* !XEN */ #endif /* _XEN_XENPMAP_H_ */ Modified: head/sys/i386/include/xen/xenvar.h ============================================================================== --- head/sys/i386/include/xen/xenvar.h Thu Feb 2 17:25:39 2012 (r230915) +++ head/sys/i386/include/xen/xenvar.h Thu Feb 2 17:54:35 2012 (r230916) @@ -106,9 +106,15 @@ void xen_destroy_contiguous_region(void #elif defined(XENHVM) +#if !defined(PAE) +#define vtomach(va) pmap_kextract((vm_offset_t) (va)) +#endif #define PFNTOMFN(pa) (pa) #define MFNTOPFN(ma) (ma) +#define set_phys_to_machine(pfn, mfn) ((void)0) +#define phys_to_machine_mapping_valid(pfn) (TRUE) + #endif /* !XEN && !XENHVM */ #endif From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 18:17:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 518331065700; Thu, 2 Feb 2012 18:17:50 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39AD38FC08; Thu, 2 Feb 2012 18:17:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q12IHoFq048438; Thu, 2 Feb 2012 18:17:50 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q12IHoaL048430; Thu, 2 Feb 2012 18:17:50 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202021817.q12IHoaL048430@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 2 Feb 2012 18:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230917 - stable/9/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 18:17:50 -0000 Author: trociny Date: Thu Feb 2 18:17:49 2012 New Revision: 230917 URL: http://svn.freebsd.org/changeset/base/230917 Log: MFC r227838, r227873, r228025, r228049, r228289, r228447, r230753: r227838, r227873: Add new options, -e and -x, to display process environment variables and ELF auxiliary vectors. r228025, r228049: Make proctstat -x output more readable. This also fixes the issue, spotted by mdf, with values that were printed as decimal and had hex prefixes. Discussed with: kib, rwatson r228289: Don't output a warning if kern.proc.auxv sysctl has returned EPERM. After r228288 this is rather a normal situation. r228447: Make 64-bit procstat output ELF auxiliary vectors for 32-bit processes. Reviewed by: kib r230753: Always return 0 if the sysctl failed. This fixes the bug: when procstat -xa was run and the sysctl for a process returned ESRCH or EPERM, for this process procstat output the result collected for the previous successful process. Added: stable/9/usr.bin/procstat/procstat_auxv.c - copied, changed from r227838, head/usr.bin/procstat/procstat_auxv.c Modified: stable/9/usr.bin/procstat/Makefile stable/9/usr.bin/procstat/procstat.1 stable/9/usr.bin/procstat/procstat.c stable/9/usr.bin/procstat/procstat.h stable/9/usr.bin/procstat/procstat_args.c Directory Properties: stable/9/usr.bin/procstat/ (props changed) Modified: stable/9/usr.bin/procstat/Makefile ============================================================================== --- stable/9/usr.bin/procstat/Makefile Thu Feb 2 17:54:35 2012 (r230916) +++ stable/9/usr.bin/procstat/Makefile Thu Feb 2 18:17:49 2012 (r230917) @@ -4,6 +4,7 @@ PROG= procstat MAN= procstat.1 SRCS= procstat.c \ procstat_args.c \ + procstat_auxv.c \ procstat_basic.c \ procstat_bin.c \ procstat_cred.c \ Modified: stable/9/usr.bin/procstat/procstat.1 ============================================================================== --- stable/9/usr.bin/procstat/procstat.1 Thu Feb 2 17:54:35 2012 (r230916) +++ stable/9/usr.bin/procstat/procstat.1 Thu Feb 2 18:17:49 2012 (r230917) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2011 +.Dd November 22, 2011 .Dt PROCSTAT 1 .Os .Sh NAME @@ -56,6 +56,8 @@ for printing: Display binary information for the process. .It Fl c Display command line arguments for the process. +.It Fl e +Display environment variables for the process. .It Fl f Display file descriptor information for the process. .It Fl i @@ -73,6 +75,8 @@ Display security credential information Display thread information for the process. .It Fl v Display virtual memory mappings for the process. +.It Fl x +Display ELF auxiliary vector for the process. .El .Pp All options generate output in the format of a table, the first field of Modified: stable/9/usr.bin/procstat/procstat.c ============================================================================== --- stable/9/usr.bin/procstat/procstat.c Thu Feb 2 17:54:35 2012 (r230916) +++ stable/9/usr.bin/procstat/procstat.c Thu Feb 2 18:17:49 2012 (r230917) @@ -39,7 +39,8 @@ #include "procstat.h" -static int aflag, bflag, cflag, fflag, iflag, jflag, kflag, sflag, tflag, vflag; +static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, sflag, tflag; +static int vflag, xflag; int hflag, nflag, Cflag; static void @@ -47,8 +48,9 @@ usage(void) { fprintf(stderr, "usage: procstat [-h] [-C] [-M core] [-N system] " - "[-w interval] [-b | -c | -f | -i | -j | -k | -s | -t | -v]\n"); - fprintf(stderr, " [-a | pid ...]\n"); + "[-w interval] \n"); + fprintf(stderr, " [-b | -c | -e | -f | -i | -j | -k | " + "-s | -t | -v | -x] [-a | pid ...]\n"); exit(EX_USAGE); } @@ -60,6 +62,8 @@ procstat(struct procstat *prstat, struct procstat_bin(kipp); else if (cflag) procstat_args(kipp); + else if (eflag) + procstat_env(kipp); else if (fflag) procstat_files(prstat, kipp); else if (iflag) @@ -74,6 +78,8 @@ procstat(struct procstat *prstat, struct procstat_threads(kipp); else if (vflag) procstat_vm(kipp); + else if (xflag) + procstat_auxv(kipp); else procstat_basic(kipp); } @@ -117,7 +123,7 @@ main(int argc, char *argv[]) interval = 0; memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "CN:M:abcfijkhstvw:")) != -1) { + while ((ch = getopt(argc, argv, "CN:M:abcefijkhstvw:x")) != -1) { switch (ch) { case 'C': Cflag++; @@ -141,6 +147,10 @@ main(int argc, char *argv[]) cflag++; break; + case 'e': + eflag++; + break; + case 'f': fflag++; break; @@ -186,6 +196,10 @@ main(int argc, char *argv[]) interval = l; break; + case 'x': + xflag++; + break; + case '?': default: usage(); @@ -196,7 +210,8 @@ main(int argc, char *argv[]) argv += optind; /* We require that either 0 or 1 mode flags be set. */ - tmp = bflag + cflag + fflag + (kflag ? 1 : 0) + sflag + tflag + vflag; + tmp = bflag + cflag + eflag + fflag + (kflag ? 1 : 0) + sflag + tflag + + vflag + xflag; if (!(tmp == 0 || tmp == 1)) usage(); Modified: stable/9/usr.bin/procstat/procstat.h ============================================================================== --- stable/9/usr.bin/procstat/procstat.h Thu Feb 2 17:54:35 2012 (r230916) +++ stable/9/usr.bin/procstat/procstat.h Thu Feb 2 18:17:49 2012 (r230917) @@ -35,9 +35,11 @@ struct kinfo_proc; void kinfo_proc_sort(struct kinfo_proc *kipp, int count); void procstat_args(struct kinfo_proc *kipp); +void procstat_auxv(struct kinfo_proc *kipp); void procstat_basic(struct kinfo_proc *kipp); void procstat_bin(struct kinfo_proc *kipp); void procstat_cred(struct kinfo_proc *kipp); +void procstat_env(struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_kstack(struct kinfo_proc *kipp, int kflag); void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); Modified: stable/9/usr.bin/procstat/procstat_args.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_args.c Thu Feb 2 17:54:35 2012 (r230916) +++ stable/9/usr.bin/procstat/procstat_args.c Thu Feb 2 18:17:49 2012 (r230917) @@ -42,24 +42,26 @@ static char args[ARG_MAX]; -void -procstat_args(struct kinfo_proc *kipp) +static void +do_args(struct kinfo_proc *kipp, int env) { int error, name[4]; size_t len; char *cp; if (!hflag) - printf("%5s %-16s %-53s\n", "PID", "COMM", "ARGS"); + printf("%5s %-16s %-53s\n", "PID", "COMM", + env ? "ENVIRONMENT" : "ARGS"); name[0] = CTL_KERN; name[1] = KERN_PROC; - name[2] = KERN_PROC_ARGS; + name[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; name[3] = kipp->ki_pid; len = sizeof(args); error = sysctl(name, 4, args, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.args: %d", kipp->ki_pid); + if (error < 0 && errno != ESRCH && errno != EPERM) { + warn("sysctl: kern.proc.%s: %d: %d", env ? "env" : "args", + kipp->ki_pid, errno); return; } if (error < 0) @@ -75,3 +77,15 @@ procstat_args(struct kinfo_proc *kipp) printf("%s%s", cp != args ? " " : "", cp); printf("\n"); } + +void +procstat_args(struct kinfo_proc *kipp) +{ + do_args(kipp, 0); +} + +void +procstat_env(struct kinfo_proc *kipp) +{ + do_args(kipp, 1); +} Copied and modified: stable/9/usr.bin/procstat/procstat_auxv.c (from r227838, head/usr.bin/procstat/procstat_auxv.c) ============================================================================== --- head/usr.bin/procstat/procstat_auxv.c Tue Nov 22 20:59:52 2011 (r227838, copy source) +++ stable/9/usr.bin/procstat/procstat_auxv.c Thu Feb 2 18:17:49 2012 (r230917) @@ -27,9 +27,12 @@ */ #include +#include #include #include +#include + #include #include #include @@ -38,140 +41,201 @@ #include #include -#include - #include "procstat.h" -static char auxv[sizeof(Elf_Auxinfo) * 256]; +#define PROC_AUXV_MAX 256 -void -procstat_auxv(struct kinfo_proc *kipp) +static Elf_Auxinfo auxv[PROC_AUXV_MAX]; +static char prefix[256]; + +#if __ELF_WORD_SIZE == 64 +static Elf32_Auxinfo auxv32[PROC_AUXV_MAX]; + +static const char *elf32_sv_names[] = { + "Linux ELF32", + "FreeBSD ELF32", +}; + +static int +is_elf32(pid_t pid) { - Elf_Auxinfo *aux; - int i, error, name[4]; - size_t len; + int error, name[4]; + size_t len, i; + static char sv_name[256]; - if (!hflag) - printf("%5s %-16s %-53s\n", "PID", "COMM", "AUXV"); + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_SV_NAME; + name[3] = pid; + len = sizeof(sv_name); + error = sysctl(name, 4, sv_name, &len, NULL, 0); + if (error != 0 || len == 0) + return (0); + for (i = 0; i < sizeof(elf32_sv_names) / sizeof(*elf32_sv_names); i++) { + if (strncmp(sv_name, elf32_sv_names[i], sizeof(sv_name)) == 0) + return (1); + } + return (0); +} + +static size_t +retrieve_auxv32(pid_t pid) +{ + int name[4]; + size_t len, i; + void *ptr; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_AUXV; + name[3] = pid; + len = sizeof(auxv32); + if (sysctl(name, 4, auxv32, &len, NULL, 0) == -1) { + if (errno != ESRCH && errno != EPERM) + warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); + return (0); + } + for (i = 0; i < len; i++) { + /* + * XXX: We expect that values for a_type on a 32-bit platform + * are directly mapped to those on 64-bit one, which is not + * necessarily true. + */ + auxv[i].a_type = auxv32[i].a_type; + ptr = &auxv32[i].a_un; + auxv[i].a_un.a_val = *((uint32_t *)ptr); + } + return (len); +} +#endif /* __ELF_WORD_SIZE == 64 */ + +#define PRINT(name, spec, val) \ + printf("%s %-16s " #spec "\n", prefix, #name, (val)) +#define PRINT_UNKNOWN(type, val) \ + printf("%s %16ld %#lx\n", prefix, (long)type, (u_long)(val)) +static size_t +retrieve_auxv(pid_t pid) +{ + int name[4]; + size_t len; + +#if __ELF_WORD_SIZE == 64 + if (is_elf32(pid)) + return (retrieve_auxv32(pid)); +#endif name[0] = CTL_KERN; name[1] = KERN_PROC; name[2] = KERN_PROC_AUXV; - name[3] = kipp->ki_pid; + name[3] = pid; len = sizeof(auxv); - error = sysctl(name, 4, auxv, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.auxv: %d: %d", kipp->ki_pid, errno); - return; + if (sysctl(name, 4, auxv, &len, NULL, 0) == -1) { + if (errno != ESRCH && errno != EPERM) + warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); + return (0); } - if (error < 0) - return; - printf("%5d ", kipp->ki_pid); - printf("%-16s", kipp->ki_comm); - if (len == 0) { - printf(" -\n"); + return (len); +} + +void +procstat_auxv(struct kinfo_proc *kipp) +{ + size_t len, i; + + if (!hflag) + printf("%5s %-16s %-16s %-16s\n", "PID", "COMM", "AUXV", "VALUE"); + len = retrieve_auxv(kipp->ki_pid); + if (len == 0) return; - } - for (aux = (Elf_Auxinfo *)auxv, i = 0; i < 256; i++, aux++) { - switch(aux->a_type) { + snprintf(prefix, sizeof(prefix), "%5d %-16s", kipp->ki_pid, + kipp->ki_comm); + for (i = 0; i < len; i++) { + switch(auxv[i].a_type) { case AT_NULL: - printf(" (%d)\n", i + 1); return; case AT_IGNORE: - printf(" AT_IGNORE=0x%lu", - (unsigned long)aux->a_un.a_val); break; case AT_EXECFD: - printf(" AT_EXECFD=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_EXECFD, %ld, (long)auxv[i].a_un.a_val); break; case AT_PHDR: - printf(" AT_PHDR=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_PHDR, %p, auxv[i].a_un.a_ptr); break; case AT_PHENT: - printf(" AT_PHENT=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_PHENT, %ld, (long)auxv[i].a_un.a_val); break; case AT_PHNUM: - printf(" AT_PHNUM=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_PHNUM, %ld, (long)auxv[i].a_un.a_val); break; case AT_PAGESZ: - printf(" AT_PAGESZ=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_PAGESZ, %ld, (long)auxv[i].a_un.a_val); break; case AT_BASE: - printf(" AT_BASE=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_BASE, %p, auxv[i].a_un.a_ptr); break; case AT_FLAGS: - printf(" AT_FLAGS=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_FLAGS, %#lx, (u_long)auxv[i].a_un.a_val); break; case AT_ENTRY: - printf(" AT_ENTRY=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_ENTRY, %p, auxv[i].a_un.a_ptr); break; +#ifdef AT_NOTELF case AT_NOTELF: - printf(" AT_NOTELF=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_NOTELF, %ld, (long)auxv[i].a_un.a_val); break; +#endif +#ifdef AT_UID case AT_UID: - printf(" AT_UID=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_UID, %ld, (long)auxv[i].a_un.a_val); break; +#endif +#ifdef AT_EUID case AT_EUID: - printf(" AT_EUID=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_EUID, %ld, (long)auxv[i].a_un.a_val); break; +#endif +#ifdef AT_GID case AT_GID: - printf(" AT_GID=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_GID, %ld, (long)auxv[i].a_un.a_val); break; +#endif +#ifdef AT_EGID case AT_EGID: - printf(" AT_EGID=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_EGID, %ld, (long)auxv[i].a_un.a_val); break; +#endif case AT_EXECPATH: - printf(" AT_EXECPATH=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_EXECPATH, %p, auxv[i].a_un.a_ptr); break; case AT_CANARY: - printf(" AT_CANARY=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_CANARY, %p, auxv[i].a_un.a_ptr); break; case AT_CANARYLEN: - printf(" AT_CANARYLEN=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_CANARYLEN, %ld, (long)auxv[i].a_un.a_val); break; case AT_OSRELDATE: - printf(" AT_OSRELDATE=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_OSRELDATE, %ld, (long)auxv[i].a_un.a_val); break; case AT_NCPUS: - printf(" AT_NCPUS=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_NCPUS, %ld, (long)auxv[i].a_un.a_val); break; case AT_PAGESIZES: - printf(" AT_PAGESIZES=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_PAGESIZES, %p, auxv[i].a_un.a_ptr); break; case AT_PAGESIZESLEN: - printf(" AT_PAGESIZESLEN=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_PAGESIZESLEN, %ld, (long)auxv[i].a_un.a_val); break; case AT_STACKPROT: - printf(" AT_STACKPROT=0x%lu", - (unsigned long)aux->a_un.a_val); + if ((auxv[i].a_un.a_val & VM_PROT_EXECUTE) != 0) + PRINT(AT_STACKPROT, %s, "NONEXECUTABLE"); + else + PRINT(AT_STACKPROT, %s, "EXECUTABLE"); break; case AT_COUNT: - printf(" AT_COUNT=0x%lu", - (unsigned long)aux->a_un.a_val); + PRINT(AT_COUNT, %ld, (long)auxv[i].a_un.a_val); break; default: - printf(" %ld=0x%lu", (long)aux->a_type, - (unsigned long)aux->a_un.a_val); + PRINT_UNKNOWN(auxv[i].a_type, auxv[i].a_un.a_val); break; } } From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 18:22:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A31A106564A; Thu, 2 Feb 2012 18:22:26 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F17798FC16; Thu, 2 Feb 2012 18:22:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q12IMPUL048728; Thu, 2 Feb 2012 18:22:25 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q12IMPPc048722; Thu, 2 Feb 2012 18:22:25 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202021822.q12IMPPc048722@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 2 Feb 2012 18:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230918 - stable/9/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 18:22:26 -0000 Author: trociny Date: Thu Feb 2 18:22:25 2012 New Revision: 230918 URL: http://svn.freebsd.org/changeset/base/230918 Log: MFC r227956, r228090, r228446, r230471, r230548: r227956: Add -l flag to display resource limits. PR: bin/161257 Reviewed by: kib r228090: Update SYNOPSIS to include the flags added recently. Spotted by: jhb r228446: Make procstat -l output similar to the output of limits(1). Suggested by: jhb r230471, r230548: Make procstat -l to work with the new version of kern.proc.rlimit. Submitted by: Andrey Zonov Added: stable/9/usr.bin/procstat/procstat_rlimit.c - copied, changed from r227956, head/usr.bin/procstat/procstat_rlimit.c Modified: stable/9/usr.bin/procstat/Makefile stable/9/usr.bin/procstat/procstat.1 stable/9/usr.bin/procstat/procstat.c stable/9/usr.bin/procstat/procstat.h Directory Properties: stable/9/usr.bin/procstat/ (props changed) Modified: stable/9/usr.bin/procstat/Makefile ============================================================================== --- stable/9/usr.bin/procstat/Makefile Thu Feb 2 18:17:49 2012 (r230917) +++ stable/9/usr.bin/procstat/Makefile Thu Feb 2 18:22:25 2012 (r230918) @@ -10,6 +10,7 @@ SRCS= procstat.c \ procstat_cred.c \ procstat_files.c \ procstat_kstack.c \ + procstat_rlimit.c \ procstat_sigs.c \ procstat_threads.c \ procstat_vm.c Modified: stable/9/usr.bin/procstat/procstat.1 ============================================================================== --- stable/9/usr.bin/procstat/procstat.1 Thu Feb 2 18:17:49 2012 (r230917) +++ stable/9/usr.bin/procstat/procstat.1 Thu Feb 2 18:22:25 2012 (r230918) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2011 +.Dd November 28, 2011 .Dt PROCSTAT 1 .Os .Sh NAME @@ -37,7 +37,7 @@ .Op Fl n .Op Fl C .Op Fl w Ar interval -.Op Fl b | c | f | i | j | k | s | t | v +.Op Fl b | c | e | f | i | j | k | l | s | t | v | x .Op Fl a | Ar pid ... .Sh DESCRIPTION The @@ -69,6 +69,8 @@ Display the stacks of kernel threads in threads currently running on a CPU and threads with stacks swapped to disk. If the flag is repeated, function offsets as well as function names are printed. +.It Fl l +Display resource limits for the process. .It Fl s Display security credential information for the process. .It Fl t Modified: stable/9/usr.bin/procstat/procstat.c ============================================================================== --- stable/9/usr.bin/procstat/procstat.c Thu Feb 2 18:17:49 2012 (r230917) +++ stable/9/usr.bin/procstat/procstat.c Thu Feb 2 18:22:25 2012 (r230918) @@ -39,8 +39,8 @@ #include "procstat.h" -static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, sflag, tflag; -static int vflag, xflag; +static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, lflag, sflag; +static int tflag, vflag, xflag; int hflag, nflag, Cflag; static void @@ -50,7 +50,7 @@ usage(void) fprintf(stderr, "usage: procstat [-h] [-C] [-M core] [-N system] " "[-w interval] \n"); fprintf(stderr, " [-b | -c | -e | -f | -i | -j | -k | " - "-s | -t | -v | -x] [-a | pid ...]\n"); + "-l | -s | -t | -v | -x] [-a | pid ...]\n"); exit(EX_USAGE); } @@ -72,6 +72,8 @@ procstat(struct procstat *prstat, struct procstat_threads_sigs(prstat, kipp); else if (kflag) procstat_kstack(kipp, kflag); + else if (lflag) + procstat_rlimit(kipp); else if (sflag) procstat_cred(kipp); else if (tflag) @@ -123,7 +125,7 @@ main(int argc, char *argv[]) interval = 0; memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "CN:M:abcefijkhstvw:x")) != -1) { + while ((ch = getopt(argc, argv, "CN:M:abcefijklhstvw:x")) != -1) { switch (ch) { case 'C': Cflag++; @@ -167,6 +169,10 @@ main(int argc, char *argv[]) kflag++; break; + case 'l': + lflag++; + break; + case 'n': nflag++; break; @@ -210,8 +216,8 @@ main(int argc, char *argv[]) argv += optind; /* We require that either 0 or 1 mode flags be set. */ - tmp = bflag + cflag + eflag + fflag + (kflag ? 1 : 0) + sflag + tflag + - vflag + xflag; + tmp = bflag + cflag + eflag + fflag + (kflag ? 1 : 0) + lflag + sflag + + tflag + vflag + xflag; if (!(tmp == 0 || tmp == 1)) usage(); Modified: stable/9/usr.bin/procstat/procstat.h ============================================================================== --- stable/9/usr.bin/procstat/procstat.h Thu Feb 2 18:17:49 2012 (r230917) +++ stable/9/usr.bin/procstat/procstat.h Thu Feb 2 18:22:25 2012 (r230918) @@ -42,6 +42,7 @@ void procstat_cred(struct kinfo_proc *ki void procstat_env(struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_kstack(struct kinfo_proc *kipp, int kflag); +void procstat_rlimit(struct kinfo_proc *kipp); void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_threads(struct kinfo_proc *kipp); void procstat_threads_sigs(struct procstat *prstat, struct kinfo_proc *kipp); Copied and modified: stable/9/usr.bin/procstat/procstat_rlimit.c (from r227956, head/usr.bin/procstat/procstat_rlimit.c) ============================================================================== --- head/usr.bin/procstat/procstat_rlimit.c Thu Nov 24 20:54:06 2011 (r227956, copy source) +++ stable/9/usr.bin/procstat/procstat_rlimit.c Thu Feb 2 18:22:25 2012 (r230918) @@ -28,7 +28,6 @@ #include #include -#define _RLIMIT_IDENT #include #include #include @@ -36,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -43,36 +43,77 @@ #include "procstat.h" -static struct rlimit rlimit[RLIM_NLIMITS]; +static struct { + const char *name; + const char *suffix; +} rlimit_param[13] = { + {"cputime", "sec"}, + {"filesize", "B "}, + {"datasize", "B "}, + {"stacksize", "B "}, + {"coredumpsize", "B "}, + {"memoryuse", "B "}, + {"memorylocked", "B "}, + {"maxprocesses", " "}, + {"openfiles", " "}, + {"sbsize", "B "}, + {"vmemoryuse", "B "}, + {"pseudo-terminals", " "}, + {"swapuse", "B "}, +}; + +#if RLIM_NLIMITS > 13 +#error "Resource limits have grown. Add new entries to rlimit_param[]." +#endif + +static +const char *humanize_rlimit(int indx, rlim_t limit) +{ + static char buf[14]; + int scale; + + if (limit == RLIM_INFINITY) + return ("infinity "); + + scale = humanize_number(buf, sizeof(buf) - 1, (int64_t)limit, + rlimit_param[indx].suffix, HN_AUTOSCALE | HN_GETSCALE, HN_DECIMAL); + (void)humanize_number(buf, sizeof(buf) - 1, (int64_t)limit, + rlimit_param[indx].suffix, HN_AUTOSCALE, HN_DECIMAL); + /* Pad with one space if there is no suffix prefix. */ + if (scale == 0) + sprintf(buf + strlen(buf), " "); + return (buf); +} void procstat_rlimit(struct kinfo_proc *kipp) { - int error, i, name[4]; + struct rlimit rlimit; + int error, i, name[5]; size_t len; - if (!hflag) - printf("%5s %-16s %-10s %12s %12s\n", "PID", "COMM", "RLIMIT", - "CURRENT", "MAX"); + if (!hflag) { + printf("%5s %-16s %-16s %16s %16s\n", + "PID", "COMM", "RLIMIT", "SOFT ", "HARD "); + } + len = sizeof(struct rlimit); name[0] = CTL_KERN; name[1] = KERN_PROC; name[2] = KERN_PROC_RLIMIT; name[3] = kipp->ki_pid; - len = sizeof(rlimit); - error = sysctl(name, 4, rlimit, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.rlimit: %d", kipp->ki_pid); - return; - } - if (error < 0 || len != sizeof(rlimit)) - return; - for (i = 0; i < RLIM_NLIMITS; i++) { - printf("%5d %-16s %-10s %12jd %12jd\n", kipp->ki_pid, - kipp->ki_comm, rlimit_ident[i], - rlimit[i].rlim_cur == RLIM_INFINITY ? - -1 : rlimit[i].rlim_cur, - rlimit[i].rlim_max == RLIM_INFINITY ? - -1 : rlimit[i].rlim_max); - } + name[4] = i; + error = sysctl(name, 5, &rlimit, &len, NULL, 0); + if (error < 0 && errno != ESRCH) { + warn("sysctl: kern.proc.rlimit: %d", kipp->ki_pid); + return; + } + if (error < 0 || len != sizeof(struct rlimit)) + return; + + printf("%5d %-16s %-16s ", kipp->ki_pid, kipp->ki_comm, + rlimit_param[i].name); + printf("%16s ", humanize_rlimit(i, rlimit.rlim_cur)); + printf("%16s\n", humanize_rlimit(i, rlimit.rlim_max)); + } } From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 18:25:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C144A106566B; Thu, 2 Feb 2012 18:25:12 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE8A88FC15; Thu, 2 Feb 2012 18:25:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q12IPCHL048858; Thu, 2 Feb 2012 18:25:12 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q12IPCqw048855; Thu, 2 Feb 2012 18:25:12 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202021825.q12IPCqw048855@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 2 Feb 2012 18:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230919 - stable/9/usr.bin/limits X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 18:25:12 -0000 Author: trociny Date: Thu Feb 2 18:25:12 2012 New Revision: 230919 URL: http://svn.freebsd.org/changeset/base/230919 Log: MFC r230549: Add -P option to allow get and set limits for other processes. Submitted by: Andrey Zonov Modified: stable/9/usr.bin/limits/limits.1 stable/9/usr.bin/limits/limits.c Directory Properties: stable/9/usr.bin/limits/ (props changed) Modified: stable/9/usr.bin/limits/limits.1 ============================================================================== --- stable/9/usr.bin/limits/limits.1 Thu Feb 2 18:22:25 2012 (r230918) +++ stable/9/usr.bin/limits/limits.1 Thu Feb 2 18:25:12 2012 (r230919) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2011 +.Dd January 23, 2011 .Dt LIMITS 1 .Os .Sh NAME @@ -27,7 +27,7 @@ .Nd set or display process resource limits .Sh SYNOPSIS .Nm -.Op Fl C Ar class | Fl U Ar user +.Op Fl C Ar class | Fl P Ar pid | Fl U Ar user .Op Fl SHB .Op Fl ea .Op Fl bcdflmnstuvpw Op Ar val @@ -143,6 +143,9 @@ for the class are used, if it exists, or the .Dq Li root class if the user is a superuser account. +.It Fl P Ar pid +Select or set limits for the process identified by the +.Ar pid . .It Fl S Select display or setting of .Dq soft Modified: stable/9/usr.bin/limits/limits.c ============================================================================== --- stable/9/usr.bin/limits/limits.c Thu Feb 2 18:22:25 2012 (r230918) +++ stable/9/usr.bin/limits/limits.c Thu Feb 2 18:25:12 2012 (r230919) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -249,6 +250,8 @@ static void usage(void); static int getshelltype(void); static void print_limit(rlim_t limit, unsigned divisor, const char *inf, const char *pfx, const char *sfx, const char *which); +static void getrlimit_proc(pid_t pid, int resource, struct rlimit *rlp); +static void setrlimit_proc(pid_t pid, int resource, const struct rlimit *rlp); extern char **environ; static const char rcs_string[] = RCS_STRING; @@ -262,24 +265,24 @@ main(int argc, char *argv[]) int rcswhich, shelltype; int i, num_limits = 0; int ch, doeval = 0, doall = 0; - int rtrn; + int rtrn, setproc; login_cap_t * lc = NULL; enum { ANY=0, SOFT=1, HARD=2, BOTH=3, DISPLAYONLY=4 } type = ANY; enum { RCSUNKNOWN=0, RCSSET=1, RCSSEL=2 } todo = RCSUNKNOWN; int which_limits[RLIM_NLIMITS]; rlim_t set_limits[RLIM_NLIMITS]; struct rlimit limits[RLIM_NLIMITS]; + pid_t pid; /* init resource tables */ for (i = 0; i < RLIM_NLIMITS; i++) { which_limits[i] = 0; /* Don't set/display any */ set_limits[i] = RLIM_INFINITY; - /* Get current resource values */ - getrlimit(i, &limits[i]); } + pid = -1; optarg = NULL; - while ((ch = getopt(argc, argv, ":EeC:U:BSHab:c:d:f:l:m:n:s:t:u:v:p:w:")) != -1) { + while ((ch = getopt(argc, argv, ":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:")) != -1) { switch(ch) { case 'a': doall = 1; @@ -312,6 +315,12 @@ main(int argc, char *argv[]) case 'B': type = SOFT|HARD; break; + case 'P': + if (!isdigit(*optarg) || (pid = atoi(optarg)) < 0) { + warnx("invalid pid `%s'", optarg); + usage(); + } + break; default: case ':': /* Without arg */ if ((p = strchr(rcs_string, optopt)) != NULL) { @@ -335,6 +344,30 @@ main(int argc, char *argv[]) optarg = NULL; } + if (pid != -1) { + if (cls != NULL) { + warnx("-C cannot be used with -P option"); + usage(); + } + if (pwd != NULL) { + warnx("-U cannot be used with -P option"); + usage(); + } + } + + /* Get current resource values */ + setproc = 0; + for (i = 0; i < RLIM_NLIMITS; i++) { + if (pid == -1) { + getrlimit(i, &limits[i]); + } else if (doall || num_limits == 0) { + getrlimit_proc(pid, i, &limits[i]); + } else if (which_limits[i] != 0) { + getrlimit_proc(pid, i, &limits[i]); + setproc = 1; + } + } + /* If user was specified, get class from that */ if (pwd != NULL) lc = login_getpwclass(pwd); @@ -414,6 +447,10 @@ main(int argc, char *argv[]) warnx("-e cannot be used with `cmd' option"); usage(); } + if (pid != -1) { + warnx("-P cannot be used with `cmd' option"); + usage(); + } login_close(lc); @@ -440,6 +477,14 @@ main(int argc, char *argv[]) err(1, "%s", *argv); } + if (setproc) { + for (rcswhich = 0; rcswhich < RLIM_NLIMITS; rcswhich++) { + if (which_limits[rcswhich] != 0) + setrlimit_proc(pid, rcswhich, &limits[rcswhich]); + } + exit(EXIT_SUCCESS); + } + shelltype = doeval ? getshelltype() : SH_NONE; if (type == ANY) /* Default to soft limits */ @@ -493,7 +538,8 @@ static void usage(void) { (void)fprintf(stderr, -"usage: limits [-C class|-U user] [-eaSHBE] [-bcdflmnstuvpw [val]] [[name=val ...] cmd]\n"); + "usage: limits [-C class|-P pid|-U user] [-eaSHBE] " + "[-bcdflmnstuvpw [val]] [[name=val ...] cmd]\n"); exit(EXIT_FAILURE); } @@ -677,3 +723,38 @@ getshelltype(void) return SH_SH; } +static void +getrlimit_proc(pid_t pid, int resource, struct rlimit *rlp) +{ + int error; + int name[5]; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_RLIMIT; + name[3] = pid; + name[4] = resource; + len = sizeof(*rlp); + error = sysctl(name, 5, rlp, &len, NULL, 0); + if (error == -1) + err(EXIT_FAILURE, "sysctl: kern.proc.rlimit: %d", pid); + if (len != sizeof(*rlp)) + errx(EXIT_FAILURE, "sysctl() returns wrong size"); +} + +static void +setrlimit_proc(pid_t pid, int resource, const struct rlimit *rlp) +{ + int error; + int name[5]; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_RLIMIT; + name[3] = pid; + name[4] = resource; + error = sysctl(name, 5, NULL, 0, rlp, sizeof(*rlp)); + if (error == -1) + err(EXIT_FAILURE, "sysctl: kern.proc.rlimit: %d", pid); +} From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 19:01:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6368F1065675; Thu, 2 Feb 2012 19:01:42 +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 4EFDA8FC12; Thu, 2 Feb 2012 19:01:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q12J1geG050240; Thu, 2 Feb 2012 19:01:42 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q12J1g0t050233; Thu, 2 Feb 2012 19:01:42 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202021901.q12J1g0t050233@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 2 Feb 2012 19:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230920 - in stable/9/sys: conf dev/mps dev/mps/mpi modules/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 19:01:42 -0000 Author: ken Date: Thu Feb 2 19:01:41 2012 New Revision: 230920 URL: http://svn.freebsd.org/changeset/base/230920 Log: MFC 230592: Bring in the LSI-supported version of the mps(4) driver. This involves significant changes to the mps(4) driver, but is not a complete rewrite. Some of the changes in this version of the driver: - Integrated RAID (IR) support. - Support for WarpDrive controllers. - Support for SCSI protection information (EEDP). - Support for TLR (Transport Level Retries), needed for tape drives. - Improved error recovery code. - ioctl interface compatible with LSI utilities. mps.4: Update the mps(4) driver man page somewhat for the driver changes. The list of supported hardware still needs to be updated to reflect the full list of supported cards. conf/files: Add the new driver files. mps/mpi/*: Updated version of the MPI header files, with a BSD style copyright. mps/*: See above for a description of the new driver features. modules/mps/Makefile: Add the new mps(4) driver files. Submitted by: Kashyap Desai Sponsored by: LSI, Spectra Logic Reviewed by: ken Added: stable/9/sys/dev/mps/mps_config.c - copied unchanged from r230592, head/sys/dev/mps/mps_config.c stable/9/sys/dev/mps/mps_mapping.c - copied unchanged from r230592, head/sys/dev/mps/mps_mapping.c stable/9/sys/dev/mps/mps_mapping.h - copied unchanged from r230592, head/sys/dev/mps/mps_mapping.h stable/9/sys/dev/mps/mps_sas.h - copied unchanged from r230592, head/sys/dev/mps/mps_sas.h stable/9/sys/dev/mps/mps_sas_lsi.c - copied unchanged from r230592, head/sys/dev/mps/mps_sas_lsi.c Modified: stable/9/sys/conf/files stable/9/sys/dev/mps/mpi/mpi2.h stable/9/sys/dev/mps/mpi/mpi2_cnfg.h stable/9/sys/dev/mps/mpi/mpi2_hbd.h stable/9/sys/dev/mps/mpi/mpi2_history.txt stable/9/sys/dev/mps/mpi/mpi2_init.h stable/9/sys/dev/mps/mpi/mpi2_ioc.h stable/9/sys/dev/mps/mpi/mpi2_ra.h stable/9/sys/dev/mps/mpi/mpi2_raid.h stable/9/sys/dev/mps/mpi/mpi2_sas.h stable/9/sys/dev/mps/mpi/mpi2_targ.h stable/9/sys/dev/mps/mpi/mpi2_tool.h stable/9/sys/dev/mps/mpi/mpi2_type.h stable/9/sys/dev/mps/mps.c stable/9/sys/dev/mps/mps_ioctl.h stable/9/sys/dev/mps/mps_pci.c stable/9/sys/dev/mps/mps_sas.c stable/9/sys/dev/mps/mps_table.c stable/9/sys/dev/mps/mps_user.c stable/9/sys/dev/mps/mpsvar.h stable/9/sys/modules/mps/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Thu Feb 2 18:25:12 2012 (r230919) +++ stable/9/sys/conf/files Thu Feb 2 19:01:41 2012 (r230920) @@ -1463,8 +1463,11 @@ dev/mmc/mmcbus_if.m standard dev/mmc/mmcsd.c optional mmcsd dev/mn/if_mn.c optional mn pci dev/mps/mps.c optional mps +dev/mps/mps_config.c optional mps +dev/mps/mps_mapping.c optional mps dev/mps/mps_pci.c optional mps pci dev/mps/mps_sas.c optional mps +dev/mps/mps_sas_lsi.c optional mps dev/mps/mps_table.c optional mps dev/mps/mps_user.c optional mps dev/mpt/mpt.c optional mpt Modified: stable/9/sys/dev/mps/mpi/mpi2.h ============================================================================== --- stable/9/sys/dev/mps/mpi/mpi2.h Thu Feb 2 18:25:12 2012 (r230919) +++ stable/9/sys/dev/mps/mpi/mpi2.h Thu Feb 2 19:01:41 2012 (r230920) @@ -1,6 +1,35 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 LSI Corp. + * 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. + * + * LSI MPT-Fusion Host Adapter FreeBSD + * + * $FreeBSD$ + */ + /* - * Copyright (c) 2000-2009 LSI Corporation. + * Copyright (c) 2000-2011 LSI Corporation. * * * Name: mpi2.h @@ -9,7 +38,7 @@ * scatter/gather formats. * Creation Date: June 21, 2006 * - * mpi2.h Version: 02.00.14 + * mpi2.h Version: 02.00.18 * * Version History * --------------- @@ -58,6 +87,15 @@ * Added MSI-x index mask and shift for Reply Post Host * Index register. * Added function code for Host Based Discovery Action. + * 02-10-10 02.00.15 Bumped MPI2_HEADER_VERSION_UNIT. + * Added define for MPI2_FUNCTION_PWR_MGMT_CONTROL. + * Added defines for product-specific range of message + * function codes, 0xF0 to 0xFF. + * 05-12-10 02.00.16 Bumped MPI2_HEADER_VERSION_UNIT. + * Added alternative defines for the SGE Direction bit. + * 08-11-10 02.00.17 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-10-10 02.00.18 Bumped MPI2_HEADER_VERSION_UNIT. + * Added MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR define. * -------------------------------------------------------------------------- */ @@ -83,7 +121,7 @@ #define MPI2_VERSION_02_00 (0x0200) /* versioning for this MPI header set */ -#define MPI2_HEADER_VERSION_UNIT (0x0E) +#define MPI2_HEADER_VERSION_UNIT (0x12) #define MPI2_HEADER_VERSION_DEV (0x00) #define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI2_HEADER_VERSION_UNIT_SHIFT (8) @@ -476,8 +514,6 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN /***************************************************************************** * * Message Functions -* 0x80 -> 0x8F reserved for private message use per product -* * *****************************************************************************/ @@ -508,6 +544,9 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN #define MPI2_FUNCTION_TARGET_CMD_BUF_LIST_POST (0x25) /* Target Command Buffer Post List */ #define MPI2_FUNCTION_RAID_ACCELERATOR (0x2C) /* RAID Accelerator */ #define MPI2_FUNCTION_HOST_BASED_DISCOVERY_ACTION (0x2F) /* Host Based Discovery Action */ +#define MPI2_FUNCTION_PWR_MGMT_CONTROL (0x30) /* Power Management Control */ +#define MPI2_FUNCTION_MIN_PRODUCT_SPECIFIC (0xF0) /* beginning of product-specific range */ +#define MPI2_FUNCTION_MAX_PRODUCT_SPECIFIC (0xFF) /* end of product-specific range */ @@ -922,6 +961,9 @@ typedef struct _MPI2_MPI_SGE_UNION #define MPI2_SGE_FLAGS_IOC_TO_HOST (0x00) #define MPI2_SGE_FLAGS_HOST_TO_IOC (0x04) +#define MPI2_SGE_FLAGS_DEST (MPI2_SGE_FLAGS_IOC_TO_HOST) +#define MPI2_SGE_FLAGS_SOURCE (MPI2_SGE_FLAGS_HOST_TO_IOC) + /* Address Size */ #define MPI2_SGE_FLAGS_32_BIT_ADDRESSING (0x00) @@ -1046,11 +1088,11 @@ typedef struct _MPI2_IEEE_SGE_UNION /* Data Location Address Space */ #define MPI2_IEEE_SGE_FLAGS_ADDR_MASK (0x03) -#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR (0x00) -#define MPI2_IEEE_SGE_FLAGS_IOCDDR_ADDR (0x01) +#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR (0x00) /* IEEE Simple Element only */ +#define MPI2_IEEE_SGE_FLAGS_IOCDDR_ADDR (0x01) /* IEEE Simple Element only */ #define MPI2_IEEE_SGE_FLAGS_IOCPLB_ADDR (0x02) -#define MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR (0x03) - +#define MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR (0x03) /* IEEE Simple Element only */ +#define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR (0x03) /* IEEE Chain Element only */ /**************************************************************************** * IEEE SGE operation Macros Modified: stable/9/sys/dev/mps/mpi/mpi2_cnfg.h ============================================================================== --- stable/9/sys/dev/mps/mpi/mpi2_cnfg.h Thu Feb 2 18:25:12 2012 (r230919) +++ stable/9/sys/dev/mps/mpi/mpi2_cnfg.h Thu Feb 2 19:01:41 2012 (r230920) @@ -1,13 +1,42 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 LSI Corp. + * 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. + * + * LSI MPT-Fusion Host Adapter FreeBSD + * + * $FreeBSD$ + */ + /* - * Copyright (c) 2000-2009 LSI Corporation. + * Copyright (c) 2000-2011 LSI Corporation. * * * Name: mpi2_cnfg.h * Title: MPI Configuration messages and pages * Creation Date: November 10, 2006 * - * mpi2_cnfg.h Version: 02.00.13 + * mpi2_cnfg.h Version: 02.00.17 * * Version History * --------------- @@ -110,6 +139,31 @@ * Added Ethernet configuration pages. * 10-28-09 02.00.13 Added MPI2_IOUNITPAGE1_ENABLE_HOST_BASED_DISCOVERY. * Added SAS PHY Page 4 structure and defines. + * 02-10-10 02.00.14 Modified the comments for the configuration page + * structures that contain an array of data. The host + * should use the "count" field in the page data (e.g. the + * NumPhys field) to determine the number of valid elements + * in the array. + * Added/modified some MPI2_MFGPAGE_DEVID_SAS defines. + * Added PowerManagementCapabilities to IO Unit Page 7. + * Added PortWidthModGroup field to + * MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_6 and related defines. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_7 and related defines. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_8 and related defines. + * 05-12-10 02.00.15 Added MPI2_RAIDVOL0_STATUS_FLAG_VOL_NOT_CONSISTENT + * define. + * Added MPI2_PHYSDISK0_INCOMPATIBLE_MEDIA_TYPE define. + * Added MPI2_SAS_NEG_LINK_RATE_UNSUPPORTED_PHY define. + * 08-11-10 02.00.16 Removed IO Unit Page 1 device path (multi-pathing) + * defines. + * 11-10-10 02.00.17 Added ReceptacleID field (replacing Reserved1) to + * MPI2_MANPAGE7_CONNECTOR_INFO and reworked defines for + * the Pinout field. + * Added BoardTemperature and BoardTemperatureUnits fields + * to MPI2_CONFIG_PAGE_IO_UNIT_7. + * Added MPI2_CONFIG_EXTPAGETYPE_EXT_MANUFACTURING define + * and MPI2_CONFIG_PAGE_EXT_MAN_PS structure. * -------------------------------------------------------------------------- */ @@ -193,6 +247,7 @@ typedef union _MPI2_CONFIG_EXT_PAGE_HEAD #define MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING (0x17) #define MPI2_CONFIG_EXTPAGETYPE_SAS_PORT (0x18) #define MPI2_CONFIG_EXTPAGETYPE_ETHERNET (0x19) +#define MPI2_CONFIG_EXTPAGETYPE_EXT_MANUFACTURING (0x1A) /***************************************************************************** @@ -322,7 +377,7 @@ typedef struct _MPI2_CONFIG_REQUEST #define MPI2_CONFIG_ACTION_PAGE_READ_NVRAM (0x06) #define MPI2_CONFIG_ACTION_PAGE_GET_CHANGEABLE (0x07) -/* values for SGLFlags field are in the SGL section of mpi2.h */ +/* use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */ /* Config Reply Message */ @@ -368,14 +423,19 @@ typedef struct _MPI2_CONFIG_REPLY #define MPI2_MFGPAGE_DEVID_SAS2116_1 (0x0064) #define MPI2_MFGPAGE_DEVID_SAS2116_2 (0x0065) +#define MPI2_MFGPAGE_DEVID_SSS6200 (0x007E) + #define MPI2_MFGPAGE_DEVID_SAS2208_1 (0x0080) #define MPI2_MFGPAGE_DEVID_SAS2208_2 (0x0081) #define MPI2_MFGPAGE_DEVID_SAS2208_3 (0x0082) #define MPI2_MFGPAGE_DEVID_SAS2208_4 (0x0083) #define MPI2_MFGPAGE_DEVID_SAS2208_5 (0x0084) #define MPI2_MFGPAGE_DEVID_SAS2208_6 (0x0085) -#define MPI2_MFGPAGE_DEVID_SAS2208_7 (0x0086) -#define MPI2_MFGPAGE_DEVID_SAS2208_8 (0x0087) +#define MPI2_MFGPAGE_DEVID_SAS2308_1 (0x0086) +#define MPI2_MFGPAGE_DEVID_SAS2308_2 (0x0087) +#define MPI2_MFGPAGE_DEVID_SAS2308_3 (0x006E) + + /* Manufacturing Page 0 */ @@ -541,7 +601,7 @@ typedef struct _MPI2_CONFIG_PAGE_MAN_4 /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_MAN_PAGE_5_PHY_ENTRIES #define MPI2_MAN_PAGE_5_PHY_ENTRIES (1) @@ -590,23 +650,31 @@ typedef struct _MPI2_MANPAGE7_CONNECTOR_ U32 Pinout; /* 0x00 */ U8 Connector[16]; /* 0x04 */ U8 Location; /* 0x14 */ - U8 Reserved1; /* 0x15 */ + U8 ReceptacleID; /* 0x15 */ U16 Slot; /* 0x16 */ U32 Reserved2; /* 0x18 */ } MPI2_MANPAGE7_CONNECTOR_INFO, MPI2_POINTER PTR_MPI2_MANPAGE7_CONNECTOR_INFO, Mpi2ManPage7ConnectorInfo_t, MPI2_POINTER pMpi2ManPage7ConnectorInfo_t; /* defines for the Pinout field */ -#define MPI2_MANPAGE7_PINOUT_SFF_8484_L4 (0x00080000) -#define MPI2_MANPAGE7_PINOUT_SFF_8484_L3 (0x00040000) -#define MPI2_MANPAGE7_PINOUT_SFF_8484_L2 (0x00020000) -#define MPI2_MANPAGE7_PINOUT_SFF_8484_L1 (0x00010000) -#define MPI2_MANPAGE7_PINOUT_SFF_8470_L4 (0x00000800) -#define MPI2_MANPAGE7_PINOUT_SFF_8470_L3 (0x00000400) -#define MPI2_MANPAGE7_PINOUT_SFF_8470_L2 (0x00000200) -#define MPI2_MANPAGE7_PINOUT_SFF_8470_L1 (0x00000100) -#define MPI2_MANPAGE7_PINOUT_SFF_8482 (0x00000002) -#define MPI2_MANPAGE7_PINOUT_CONNECTION_UNKNOWN (0x00000001) +#define MPI2_MANPAGE7_PINOUT_LANE_MASK (0x0000FF00) +#define MPI2_MANPAGE7_PINOUT_LANE_SHIFT (8) + +#define MPI2_MANPAGE7_PINOUT_TYPE_MASK (0x000000FF) +#define MPI2_MANPAGE7_PINOUT_TYPE_UNKNOWN (0x00) +#define MPI2_MANPAGE7_PINOUT_SATA_SINGLE (0x01) +#define MPI2_MANPAGE7_PINOUT_SFF_8482 (0x02) +#define MPI2_MANPAGE7_PINOUT_SFF_8486 (0x03) +#define MPI2_MANPAGE7_PINOUT_SFF_8484 (0x04) +#define MPI2_MANPAGE7_PINOUT_SFF_8087 (0x05) +#define MPI2_MANPAGE7_PINOUT_SFF_8643_4I (0x06) +#define MPI2_MANPAGE7_PINOUT_SFF_8643_8I (0x07) +#define MPI2_MANPAGE7_PINOUT_SFF_8470 (0x08) +#define MPI2_MANPAGE7_PINOUT_SFF_8088 (0x09) +#define MPI2_MANPAGE7_PINOUT_SFF_8644_4X (0x0A) +#define MPI2_MANPAGE7_PINOUT_SFF_8644_8X (0x0B) +#define MPI2_MANPAGE7_PINOUT_SFF_8644_16X (0x0C) +#define MPI2_MANPAGE7_PINOUT_SFF_8436 (0x0D) /* defines for the Location field */ #define MPI2_MANPAGE7_LOCATION_UNKNOWN (0x01) @@ -619,7 +687,7 @@ typedef struct _MPI2_MANPAGE7_CONNECTOR_ /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_MANPAGE7_CONNECTOR_INFO_MAX #define MPI2_MANPAGE7_CONNECTOR_INFO_MAX (1) @@ -640,7 +708,7 @@ typedef struct _MPI2_CONFIG_PAGE_MAN_7 MPI2_POINTER PTR_MPI2_CONFIG_PAGE_MAN_7, Mpi2ManufacturingPage7_t, MPI2_POINTER pMpi2ManufacturingPage7_t; -#define MPI2_MANUFACTURING7_PAGEVERSION (0x00) +#define MPI2_MANUFACTURING7_PAGEVERSION (0x01) /* defines for the Flags field */ #define MPI2_MANPAGE7_FLAG_USE_SLOT_INFO (0x00000001) @@ -717,6 +785,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT /* IO Unit Page 1 Flags defines */ #define MPI2_IOUNITPAGE1_ENABLE_HOST_BASED_DISCOVERY (0x00000800) #define MPI2_IOUNITPAGE1_MASK_SATA_WRITE_CACHE (0x00000600) +#define MPI2_IOUNITPAGE1_SATA_WRITE_CACHE_SHIFT (9) #define MPI2_IOUNITPAGE1_ENABLE_SATA_WRITE_CACHE (0x00000000) #define MPI2_IOUNITPAGE1_DISABLE_SATA_WRITE_CACHE (0x00000200) #define MPI2_IOUNITPAGE1_UNCHANGED_SATA_WRITE_CACHE (0x00000400) @@ -724,15 +793,13 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE1_DISABLE_IR (0x00000040) #define MPI2_IOUNITPAGE1_DISABLE_TASK_SET_FULL_HANDLING (0x00000020) #define MPI2_IOUNITPAGE1_IR_USE_STATIC_VOLUME_ID (0x00000004) -#define MPI2_IOUNITPAGE1_MULTI_PATHING (0x00000002) -#define MPI2_IOUNITPAGE1_SINGLE_PATHING (0x00000000) /* IO Unit Page 3 */ /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength at runtime. + * one and check the value returned for GPIOCount at runtime. */ #ifndef MPI2_IO_UNIT_PAGE_3_GPIO_VAL_MAX #define MPI2_IO_UNIT_PAGE_3_GPIO_VAL_MAX (1) @@ -761,7 +828,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT /* * Upper layer code (drivers, utilities, etc.) should leave this define set to - * one and check Header.PageLength or NumDmaEngines at runtime. + * one and check the value returned for NumDmaEngines at runtime. */ #ifndef MPI2_IOUNITPAGE5_DMAENGINE_ENTRIES #define MPI2_IOUNITPAGE5_DMAENGINE_ENTRIES (1) @@ -826,15 +893,17 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT U8 PCIeWidth; /* 0x06 */ U8 PCIeSpeed; /* 0x07 */ U32 ProcessorState; /* 0x08 */ - U32 Reserved2; /* 0x0C */ + U32 PowerManagementCapabilities; /* 0x0C */ U16 IOCTemperature; /* 0x10 */ U8 IOCTemperatureUnits; /* 0x12 */ U8 IOCSpeed; /* 0x13 */ - U32 Reserved3; /* 0x14 */ + U16 BoardTemperature; /* 0x14 */ + U8 BoardTemperatureUnits; /* 0x16 */ + U8 Reserved3; /* 0x17 */ } MPI2_CONFIG_PAGE_IO_UNIT_7, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_IO_UNIT_7, Mpi2IOUnitPage7_t, MPI2_POINTER pMpi2IOUnitPage7_t; -#define MPI2_IOUNITPAGE7_PAGEVERSION (0x00) +#define MPI2_IOUNITPAGE7_PAGEVERSION (0x02) /* defines for IO Unit Page 7 PCIeWidth field */ #define MPI2_IOUNITPAGE7_PCIE_WIDTH_X1 (0x01) @@ -855,6 +924,13 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE7_PSTATE_DISABLED (0x01) #define MPI2_IOUNITPAGE7_PSTATE_ENABLED (0x02) +/* defines for IO Unit Page 7 PowerManagementCapabilities field */ +#define MPI2_IOUNITPAGE7_PMCAP_12_5_PCT_IOCSPEED (0x00000400) +#define MPI2_IOUNITPAGE7_PMCAP_25_0_PCT_IOCSPEED (0x00000200) +#define MPI2_IOUNITPAGE7_PMCAP_50_0_PCT_IOCSPEED (0x00000100) +#define MPI2_IOUNITPAGE7_PMCAP_PCIE_WIDTH_CHANGE (0x00000008) +#define MPI2_IOUNITPAGE7_PMCAP_PCIE_SPEED_CHANGE (0x00000004) + /* defines for IO Unit Page 7 IOCTemperatureUnits field */ #define MPI2_IOUNITPAGE7_IOC_TEMP_NOT_PRESENT (0x00) #define MPI2_IOUNITPAGE7_IOC_TEMP_FAHRENHEIT (0x01) @@ -866,6 +942,11 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE7_IOC_SPEED_QUARTER (0x04) #define MPI2_IOUNITPAGE7_IOC_SPEED_EIGHTH (0x08) +/* defines for IO Unit Page 7 BoardTemperatureUnits field */ +#define MPI2_IOUNITPAGE7_BOARD_TEMP_NOT_PRESENT (0x00) +#define MPI2_IOUNITPAGE7_BOARD_TEMP_FAHRENHEIT (0x01) +#define MPI2_IOUNITPAGE7_BOARD_TEMP_CELSIUS (0x02) + /**************************************************************************** @@ -1198,7 +1279,7 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_3 /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_BIOS_PAGE_4_PHY_ENTRIES #define MPI2_BIOS_PAGE_4_PHY_ENTRIES (1) @@ -1272,7 +1353,7 @@ typedef struct _MPI2_RAIDVOL0_SETTINGS /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength at runtime. + * one and check the value returned for NumPhysDisks at runtime. */ #ifndef MPI2_RAID_VOL_PAGE_0_PHYSDISK_MAX #define MPI2_RAID_VOL_PAGE_0_PHYSDISK_MAX (1) @@ -1329,6 +1410,7 @@ typedef struct _MPI2_CONFIG_PAGE_RAID_VO #define MPI2_RAIDVOL0_STATUS_FLAG_CAPACITY_EXPANSION (0x00040000) #define MPI2_RAIDVOL0_STATUS_FLAG_BACKGROUND_INIT (0x00020000) #define MPI2_RAIDVOL0_STATUS_FLAG_RESYNC_IN_PROGRESS (0x00010000) +#define MPI2_RAIDVOL0_STATUS_FLAG_VOL_NOT_CONSISTENT (0x00000080) #define MPI2_RAIDVOL0_STATUS_FLAG_OCE_ALLOWED (0x00000040) #define MPI2_RAIDVOL0_STATUS_FLAG_BGI_COMPLETE (0x00000020) #define MPI2_RAIDVOL0_STATUS_FLAG_1E_OFFSET_MIRROR (0x00000000) @@ -1451,11 +1533,15 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS #define MPI2_PHYSDISK0_INCOMPATIBLE_MAX_LBA (0x03) #define MPI2_PHYSDISK0_INCOMPATIBLE_SATA_EXTENDED_CMD (0x04) #define MPI2_PHYSDISK0_INCOMPATIBLE_REMOVEABLE_MEDIA (0x05) +#define MPI2_PHYSDISK0_INCOMPATIBLE_MEDIA_TYPE (0x06) #define MPI2_PHYSDISK0_INCOMPATIBLE_UNKNOWN (0xFF) /* PhysDiskAttributes defines */ +#define MPI2_PHYSDISK0_ATTRIB_MEDIA_MASK (0x0C) #define MPI2_PHYSDISK0_ATTRIB_SOLID_STATE_DRIVE (0x08) #define MPI2_PHYSDISK0_ATTRIB_HARD_DISK_DRIVE (0x04) + +#define MPI2_PHYSDISK0_ATTRIB_PROTOCOL_MASK (0x03) #define MPI2_PHYSDISK0_ATTRIB_SAS_PROTOCOL (0x02) #define MPI2_PHYSDISK0_ATTRIB_SATA_PROTOCOL (0x01) @@ -1474,7 +1560,7 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength or NumPhysDiskPaths at runtime. + * one and check the value returned for NumPhysDiskPaths at runtime. */ #ifndef MPI2_RAID_PHYS_DISK1_PATH_MAX #define MPI2_RAID_PHYS_DISK1_PATH_MAX (1) @@ -1527,6 +1613,7 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS #define MPI2_SAS_NEG_LINK_RATE_SATA_OOB_COMPLETE (0x03) #define MPI2_SAS_NEG_LINK_RATE_PORT_SELECTOR (0x04) #define MPI2_SAS_NEG_LINK_RATE_SMP_RESET_IN_PROGRESS (0x05) +#define MPI2_SAS_NEG_LINK_RATE_UNSUPPORTED_PHY (0x06) #define MPI2_SAS_NEG_LINK_RATE_1_5 (0x08) #define MPI2_SAS_NEG_LINK_RATE_3_0 (0x09) #define MPI2_SAS_NEG_LINK_RATE_6_0 (0x0A) @@ -1553,6 +1640,7 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS #define MPI2_SAS_PHYINFO_PHY_VACANT (0x80000000) #define MPI2_SAS_PHYINFO_PHY_POWER_CONDITION_MASK (0x18000000) +#define MPI2_SAS_PHYINFO_SHIFT_PHY_POWER_CONDITION (27) #define MPI2_SAS_PHYINFO_PHY_POWER_ACTIVE (0x00000000) #define MPI2_SAS_PHYINFO_PHY_POWER_PARTIAL (0x08000000) #define MPI2_SAS_PHYINFO_PHY_POWER_SLUMBER (0x10000000) @@ -1636,7 +1724,7 @@ typedef struct _MPI2_SAS_IO_UNIT0_PHY_DA /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_SAS_IOUNIT0_PHY_MAX #define MPI2_SAS_IOUNIT0_PHY_MAX (1) @@ -1707,7 +1795,7 @@ typedef struct _MPI2_SAS_IO_UNIT1_PHY_DA /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_SAS_IOUNIT1_PHY_MAX #define MPI2_SAS_IOUNIT1_PHY_MAX (1) @@ -1798,7 +1886,7 @@ typedef struct _MPI2_SAS_IOUNIT4_SPINUP_ /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * four and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_SAS_IOUNIT4_PHY_MAX #define MPI2_SAS_IOUNIT4_PHY_MAX (4) @@ -1837,7 +1925,7 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN typedef struct _MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS { U8 ControlFlags; /* 0x00 */ - U8 Reserved1; /* 0x01 */ + U8 PortWidthModGroup; /* 0x01 */ U16 InactivityTimerExponent; /* 0x02 */ U8 SATAPartialTimeout; /* 0x04 */ U8 Reserved2; /* 0x05 */ @@ -1857,6 +1945,9 @@ typedef struct _MPI2_SAS_IO_UNIT5_PHY_PM #define MPI2_SASIOUNIT5_CONTROL_SATA_SLUMBER_ENABLE (0x02) #define MPI2_SASIOUNIT5_CONTROL_SATA_PARTIAL_ENABLE (0x01) +/* defines for PortWidthModeGroup field */ +#define MPI2_SASIOUNIT5_PWMG_DISABLE (0xFF) + /* defines for InactivityTimerExponent field */ #define MPI2_SASIOUNIT5_ITE_MASK_SAS_SLUMBER (0x7000) #define MPI2_SASIOUNIT5_ITE_SHIFT_SAS_SLUMBER (12) @@ -1878,7 +1969,7 @@ typedef struct _MPI2_SAS_IO_UNIT5_PHY_PM /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_SAS_IOUNIT5_PHY_MAX #define MPI2_SAS_IOUNIT5_PHY_MAX (1) @@ -1896,7 +1987,137 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SASIOUNIT_5, Mpi2SasIOUnitPage5_t, MPI2_POINTER pMpi2SasIOUnitPage5_t; -#define MPI2_SASIOUNITPAGE5_PAGEVERSION (0x00) +#define MPI2_SASIOUNITPAGE5_PAGEVERSION (0x01) + + +/* SAS IO Unit Page 6 */ + +typedef struct _MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS +{ + U8 CurrentStatus; /* 0x00 */ + U8 CurrentModulation; /* 0x01 */ + U8 CurrentUtilization; /* 0x02 */ + U8 Reserved1; /* 0x03 */ + U32 Reserved2; /* 0x04 */ +} MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS, + MPI2_POINTER PTR_MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS, + Mpi2SasIOUnit6PortWidthModGroupStatus_t, + MPI2_POINTER pMpi2SasIOUnit6PortWidthModGroupStatus_t; + +/* defines for CurrentStatus field */ +#define MPI2_SASIOUNIT6_STATUS_UNAVAILABLE (0x00) +#define MPI2_SASIOUNIT6_STATUS_UNCONFIGURED (0x01) +#define MPI2_SASIOUNIT6_STATUS_INVALID_CONFIG (0x02) +#define MPI2_SASIOUNIT6_STATUS_LINK_DOWN (0x03) +#define MPI2_SASIOUNIT6_STATUS_OBSERVATION_ONLY (0x04) +#define MPI2_SASIOUNIT6_STATUS_INACTIVE (0x05) +#define MPI2_SASIOUNIT6_STATUS_ACTIVE_IOUNIT (0x06) +#define MPI2_SASIOUNIT6_STATUS_ACTIVE_HOST (0x07) + +/* defines for CurrentModulation field */ +#define MPI2_SASIOUNIT6_MODULATION_25_PERCENT (0x00) +#define MPI2_SASIOUNIT6_MODULATION_50_PERCENT (0x01) +#define MPI2_SASIOUNIT6_MODULATION_75_PERCENT (0x02) +#define MPI2_SASIOUNIT6_MODULATION_100_PERCENT (0x03) + +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check the value returned for NumGroups at runtime. + */ +#ifndef MPI2_SAS_IOUNIT6_GROUP_MAX +#define MPI2_SAS_IOUNIT6_GROUP_MAX (1) +#endif + +typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_6 +{ + MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ + U32 Reserved1; /* 0x08 */ + U32 Reserved2; /* 0x0C */ + U8 NumGroups; /* 0x10 */ + U8 Reserved3; /* 0x11 */ + U16 Reserved4; /* 0x12 */ + MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS + PortWidthModulationGroupStatus[MPI2_SAS_IOUNIT6_GROUP_MAX]; /* 0x14 */ +} MPI2_CONFIG_PAGE_SASIOUNIT_6, + MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SASIOUNIT_6, + Mpi2SasIOUnitPage6_t, MPI2_POINTER pMpi2SasIOUnitPage6_t; + +#define MPI2_SASIOUNITPAGE6_PAGEVERSION (0x00) + + +/* SAS IO Unit Page 7 */ + +typedef struct _MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS +{ + U8 Flags; /* 0x00 */ + U8 Reserved1; /* 0x01 */ + U16 Reserved2; /* 0x02 */ + U8 Threshold75Pct; /* 0x04 */ + U8 Threshold50Pct; /* 0x05 */ + U8 Threshold25Pct; /* 0x06 */ + U8 Reserved3; /* 0x07 */ +} MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS, + MPI2_POINTER PTR_MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS, + Mpi2SasIOUnit7PortWidthModGroupSettings_t, + MPI2_POINTER pMpi2SasIOUnit7PortWidthModGroupSettings_t; + +/* defines for Flags field */ +#define MPI2_SASIOUNIT7_FLAGS_ENABLE_PORT_WIDTH_MODULATION (0x01) + + +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check the value returned for NumGroups at runtime. + */ +#ifndef MPI2_SAS_IOUNIT7_GROUP_MAX +#define MPI2_SAS_IOUNIT7_GROUP_MAX (1) +#endif + +typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_7 +{ + MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ + U8 SamplingInterval; /* 0x08 */ + U8 WindowLength; /* 0x09 */ + U16 Reserved1; /* 0x0A */ + U32 Reserved2; /* 0x0C */ + U32 Reserved3; /* 0x10 */ + U8 NumGroups; /* 0x14 */ + U8 Reserved4; /* 0x15 */ + U16 Reserved5; /* 0x16 */ + MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS + PortWidthModulationGroupSettings[MPI2_SAS_IOUNIT7_GROUP_MAX]; /* 0x18 */ +} MPI2_CONFIG_PAGE_SASIOUNIT_7, + MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SASIOUNIT_7, + Mpi2SasIOUnitPage7_t, MPI2_POINTER pMpi2SasIOUnitPage7_t; + +#define MPI2_SASIOUNITPAGE7_PAGEVERSION (0x00) + + +/* SAS IO Unit Page 8 */ + +typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_8 +{ + MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ + U32 Reserved1; /* 0x08 */ + U32 PowerManagementCapabilities; /* 0x0C */ + U32 Reserved2; /* 0x10 */ +} MPI2_CONFIG_PAGE_SASIOUNIT_8, + MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SASIOUNIT_8, + Mpi2SasIOUnitPage8_t, MPI2_POINTER pMpi2SasIOUnitPage8_t; + +#define MPI2_SASIOUNITPAGE8_PAGEVERSION (0x00) + +/* defines for PowerManagementCapabilities field */ +#define MPI2_SASIOUNIT8_PM_HOST_PORT_WIDTH_MOD (0x000001000) +#define MPI2_SASIOUNIT8_PM_HOST_SAS_SLUMBER_MODE (0x000000800) +#define MPI2_SASIOUNIT8_PM_HOST_SAS_PARTIAL_MODE (0x000000400) +#define MPI2_SASIOUNIT8_PM_HOST_SATA_SLUMBER_MODE (0x000000200) +#define MPI2_SASIOUNIT8_PM_HOST_SATA_PARTIAL_MODE (0x000000100) +#define MPI2_SASIOUNIT8_PM_IOUNIT_PORT_WIDTH_MOD (0x000000010) +#define MPI2_SASIOUNIT8_PM_IOUNIT_SAS_SLUMBER_MODE (0x000000008) +#define MPI2_SASIOUNIT8_PM_IOUNIT_SAS_PARTIAL_MODE (0x000000004) +#define MPI2_SASIOUNIT8_PM_IOUNIT_SATA_SLUMBER_MODE (0x000000002) +#define MPI2_SASIOUNIT8_PM_IOUNIT_SATA_PARTIAL_MODE (0x000000001) @@ -2187,7 +2408,7 @@ typedef struct _MPI2_SASPHY2_PHY_EVENT /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhyEvents at runtime. + * one and check the value returned for NumPhyEvents at runtime. */ #ifndef MPI2_SASPHY2_PHY_EVENT_MAX #define MPI2_SASPHY2_PHY_EVENT_MAX (1) @@ -2280,7 +2501,7 @@ typedef struct _MPI2_SASPHY3_PHY_EVENT_C /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhyEvents at runtime. + * one and check the value returned for NumPhyEvents at runtime. */ #ifndef MPI2_SASPHY3_PHY_EVENT_MAX #define MPI2_SASPHY3_PHY_EVENT_MAX (1) @@ -2392,7 +2613,7 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_ENC /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumLogEntries at runtime. */ #ifndef MPI2_LOG_0_NUM_LOG_ENTRIES #define MPI2_LOG_0_NUM_LOG_ENTRIES (1) @@ -2442,7 +2663,7 @@ typedef struct _MPI2_CONFIG_PAGE_LOG_0 /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumElements at runtime. */ #ifndef MPI2_RAIDCONFIG0_MAX_ELEMENTS #define MPI2_RAIDCONFIG0_MAX_ELEMENTS (1) @@ -2642,5 +2863,25 @@ typedef struct _MPI2_CONFIG_PAGE_ETHERNE #define MPI2_ETHPG1_MS_DATA_RATE_1GBIT (0x03) +/**************************************************************************** +* Extended Manufacturing Config Pages +****************************************************************************/ + +/* + * Generic structure to use for product-specific extended manufacturing pages + * (currently Extended Manufacturing Page 40 through Extended Manufacturing + * Page 60). + */ + +typedef struct _MPI2_CONFIG_PAGE_EXT_MAN_PS +{ + MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ + U32 ProductSpecificInfo; /* 0x08 */ +} MPI2_CONFIG_PAGE_EXT_MAN_PS, + MPI2_POINTER PTR_MPI2_CONFIG_PAGE_EXT_MAN_PS, + Mpi2ExtManufacturingPagePS_t, MPI2_POINTER pMpi2ExtManufacturingPagePS_t; + +/* PageVersion should be provided by product-specific code */ + #endif Modified: stable/9/sys/dev/mps/mpi/mpi2_hbd.h ============================================================================== --- stable/9/sys/dev/mps/mpi/mpi2_hbd.h Thu Feb 2 18:25:12 2012 (r230919) +++ stable/9/sys/dev/mps/mpi/mpi2_hbd.h Thu Feb 2 19:01:41 2012 (r230920) @@ -1,13 +1,42 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 LSI Corp. + * 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. + * + * LSI MPT-Fusion Host Adapter FreeBSD + * + * $FreeBSD$ + */ + /* - * Copyright (c) 2009 LSI Corporation. + * Copyright (c) 2009-2011 LSI Corporation. * * * Name: mpi2_hbd.h * Title: MPI Host Based Discovery messages and structures * Creation Date: October 21, 2009 * - * mpi2_hbd.h Version: 02.00.00 + * mpi2_hbd.h Version: 02.00.01 * * Version History * --------------- @@ -15,6 +44,8 @@ * Date Version Description * -------- -------- ------------------------------------------------------ * 10-28-09 02.00.00 Initial version. + * 08-11-10 02.00.01 Removed PortGroups, DmaGroup, and ControlGroup from + * HBD Action request, replaced by AdditionalInfo field. * -------------------------------------------------------------------------- */ @@ -48,10 +79,7 @@ typedef struct _MPI2_HBD_ACTION_REQUEST U8 Port; /* 0x25 */ U8 MaxConnections; /* 0x26 */ U8 MaxRate; /* 0x27 */ - U8 PortGroups; /* 0x28 */ - U8 DmaGroup; /* 0x29 */ - U8 ControlGroup; /* 0x2A */ - U8 Reserved6; /* 0x2B */ + U32 AdditionalInfo; /* 0x28 */ U16 InitialAWT; /* 0x2C */ U16 Reserved7; /* 0x2E */ U32 Reserved8; /* 0x30 */ Modified: stable/9/sys/dev/mps/mpi/mpi2_history.txt ============================================================================== --- stable/9/sys/dev/mps/mpi/mpi2_history.txt Thu Feb 2 18:25:12 2012 (r230919) +++ stable/9/sys/dev/mps/mpi/mpi2_history.txt Thu Feb 2 19:01:41 2012 (r230920) @@ -1,29 +1,58 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 LSI Corp. + * 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. + * + * LSI MPT-Fusion Host Adapter FreeBSD + * + * $FreeBSD$ + */ + ============================== Fusion-MPT MPI 2.0 Header File Change History ============================== - Copyright (c) 2000-2009 LSI Corporation. + Copyright (c) 2000-2011 LSI Corporation. --------------------------------------- - Header Set Release Version: 02.00.14 - Header Set Release Date: 10-28-09 + Header Set Release Version: 02.00.18 + Header Set Release Date: 11-10-10 --------------------------------------- Filename Current version Prior version ---------- --------------- ------------- - mpi2.h 02.00.14 02.00.13 - mpi2_cnfg.h 02.00.13 02.00.12 - mpi2_init.h 02.00.08 02.00.07 - mpi2_ioc.h 02.00.13 02.00.12 - mpi2_raid.h 02.00.04 02.00.04 - mpi2_sas.h 02.00.03 02.00.02 - mpi2_targ.h 02.00.03 02.00.03 - mpi2_tool.h 02.00.04 02.00.04 + mpi2.h 02.00.18 02.00.17 + mpi2_cnfg.h 02.00.17 02.00.16 + mpi2_init.h 02.00.11 02.00.10 + mpi2_ioc.h 02.00.16 02.00.15 + mpi2_raid.h 02.00.05 02.00.05 + mpi2_sas.h 02.00.05 02.00.05 + mpi2_targ.h 02.00.04 02.00.04 + mpi2_tool.h 02.00.06 02.00.06 mpi2_type.h 02.00.00 02.00.00 mpi2_ra.h 02.00.00 02.00.00 - mpi2_hbd.h 02.00.00 - mpi2_history.txt 02.00.14 02.00.13 + mpi2_hbd.h 02.00.01 02.00.01 + mpi2_history.txt 02.00.18 02.00.17 * Date Version Description @@ -72,6 +101,15 @@ mpi2.h * Added MSI-x index mask and shift for Reply Post Host * Index register. * Added function code for Host Based Discovery Action. + * 02-10-10 02.00.15 Bumped MPI2_HEADER_VERSION_UNIT. + * Added define for MPI2_FUNCTION_PWR_MGMT_CONTROL. + * Added defines for product-specific range of message + * function codes, 0xF0 to 0xFF. + * 05-12-10 02.00.16 Bumped MPI2_HEADER_VERSION_UNIT. + * Added alternative defines for the SGE Direction bit. + * 08-11-10 02.00.17 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-10-10 02.00.18 Bumped MPI2_HEADER_VERSION_UNIT. + * Added MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR define. * -------------------------------------------------------------------------- mpi2_cnfg.h @@ -171,6 +209,31 @@ mpi2_cnfg.h * Added Ethernet configuration pages. * 10-28-09 02.00.13 Added MPI2_IOUNITPAGE1_ENABLE_HOST_BASED_DISCOVERY. * Added SAS PHY Page 4 structure and defines. + * 02-10-10 02.00.14 Modified the comments for the configuration page + * structures that contain an array of data. The host + * should use the "count" field in the page data (e.g. the + * NumPhys field) to determine the number of valid elements + * in the array. + * Added/modified some MPI2_MFGPAGE_DEVID_SAS defines. + * Added PowerManagementCapabilities to IO Unit Page 7. + * Added PortWidthModGroup field to + * MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_6 and related defines. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_7 and related defines. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_8 and related defines. + * 05-12-10 02.00.15 Added MPI2_RAIDVOL0_STATUS_FLAG_VOL_NOT_CONSISTENT + * define. + * Added MPI2_PHYSDISK0_INCOMPATIBLE_MEDIA_TYPE define. + * Added MPI2_SAS_NEG_LINK_RATE_UNSUPPORTED_PHY define. + * 08-11-10 02.00.16 Removed IO Unit Page 1 device path (multi-pathing) + * defines. + * 11-10-10 02.00.17 Added ReceptacleID field (replacing Reserved1) to + * MPI2_MANPAGE7_CONNECTOR_INFO and reworked defines for + * the Pinout field. + * Added BoardTemperature and BoardTemperatureUnits fields + * to MPI2_CONFIG_PAGE_IO_UNIT_7. + * Added MPI2_CONFIG_EXTPAGETYPE_EXT_MANUFACTURING define + * and MPI2_CONFIG_PAGE_EXT_MAN_PS structure. * -------------------------------------------------------------------------- mpi2_init.h @@ -192,6 +255,9 @@ mpi2_init.h * both SCSI IO Error Reply and SCSI Task Management Reply. * Added ResponseInfo field to MPI2_SCSI_TASK_MANAGE_REPLY. * Added MPI2_SCSITASKMGMT_RSP_TM_OVERLAPPED_TAG define. + * 02-10-10 02.00.09 Removed unused structure that had "#if 0" around it. + * 05-12-10 02.00.10 Added optional vendor-unique region to SCSI IO Request. + * 11-10-10 02.00.11 Added MPI2_SCSIIO_NUM_SGLOFFSETS define. * -------------------------------------------------------------------------- mpi2_ioc.h @@ -280,6 +346,12 @@ mpi2_ioc.h * (MPI2_FW_HEADER_PID_). * Modified values for SAS ProductID Family * (MPI2_FW_HEADER_PID_FAMILY_). + * 02-10-10 02.00.14 Added SAS Quiesce Event structure and defines. + * Added PowerManagementControl Request structures and + * defines. + * 05-12-10 02.00.15 Marked Task Set Full Event as obsolete. + * Added MPI2_EVENT_SAS_TOPO_LR_UNSUPPORTED_PHY define. + * 11-10-10 02.00.16 Added MPI2_FW_DOWNLOAD_ITYPE_MIN_PRODUCT_SPECIFIC. * -------------------------------------------------------------------------- mpi2_raid.h @@ -292,6 +364,7 @@ mpi2_raid.h * can be sized by the build environment. * 07-30-09 02.00.04 Added proper define for the Use Default Settings bit of * VolumeCreationFlags and marked the old one as obsolete. + * 05-12-10 02.00.05 Added MPI2_RAID_VOL_FLAGS_OP_MDC define. * -------------------------------------------------------------------------- mpi2_sas.h @@ -302,6 +375,8 @@ mpi2_sas.h * Request. * 10-28-09 02.00.03 Changed the type of SGL in MPI2_SATA_PASSTHROUGH_REQUEST * to MPI2_SGE_IO_UNION since it supports chained SGLs. + * 05-12-10 02.00.04 Modified some comments. + * 08-11-10 02.00.05 Added NCQ operations to SAS IO Unit Control. * -------------------------------------------------------------------------- mpi2_targ.h @@ -313,6 +388,7 @@ mpi2_targ.h * MPI2_TARGET_CMD_BUF_POST_BASE_REQUEST. * Target Status Send Request only takes a single SGE for * response data. + * 02-10-10 02.00.04 Added comment to MPI2_TARGET_SSP_RSP_IU structure. * -------------------------------------------------------------------------- mpi2_tool.h @@ -325,6 +401,9 @@ mpi2_tool.h * and reply messages. * Added MPI2_DIAG_BUF_TYPE_EXTENDED. * Incremented MPI2_DIAG_BUF_TYPE_COUNT. + * 05-12-10 02.00.05 Added Diagnostic Data Upload tool. + * 08-11-10 02.00.06 Added defines that were missing for Diagnostic Buffer + * Post Request. * -------------------------------------------------------------------------- mpi2_type.h @@ -337,24 +416,40 @@ mpi2_ra.h mpi2_hbd.h * 10-28-09 02.00.00 Initial version. + * 08-11-10 02.00.01 Removed PortGroups, DmaGroup, and ControlGroup from + * HBD Action request, replaced by AdditionalInfo field. * -------------------------------------------------------------------------- mpi2_history.txt Parts list history -Filename 02.00.14 02.00.13 02.00.12 ----------- -------- -------- -------- -mpi2.h 02.00.14 02.00.13 02.00.12 -mpi2_cnfg.h 02.00.13 02.00.12 02.00.11 -mpi2_init.h 02.00.08 02.00.07 02.00.07 -mpi2_ioc.h 02.00.13 02.00.12 02.00.11 -mpi2_raid.h 02.00.04 02.00.04 02.00.03 -mpi2_sas.h 02.00.03 02.00.02 02.00.02 -mpi2_targ.h 02.00.03 02.00.03 02.00.03 -mpi2_tool.h 02.00.04 02.00.04 02.00.03 -mpi2_type.h 02.00.00 02.00.00 02.00.00 -mpi2_ra.h 02.00.00 02.00.00 02.00.00 -mpi2_hbd.h 02.00.00 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 19:02:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B65AA1065674; Thu, 2 Feb 2012 19:02:16 +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 8A8A28FC0C; Thu, 2 Feb 2012 19:02:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q12J2GEC050296; Thu, 2 Feb 2012 19:02:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q12J2GXO050293; Thu, 2 Feb 2012 19:02:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202021902.q12J2GXO050293@svn.freebsd.org> From: Alexander Motin Date: Thu, 2 Feb 2012 19:02: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: r230921 - in head/sys/cam: ata scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 19:02:16 -0000 Author: mav Date: Thu Feb 2 19:02:15 2012 New Revision: 230921 URL: http://svn.freebsd.org/changeset/base/230921 Log: Insert ordered command every 1/4 of the current command timeout, not 1/4 of the default one. Without this change setting kern.cam.ada.default_timeout to 1 instead of 30 allowed me to trigger several false positive command timeouts under heavy ZFS load on a SiI3132 siis(4) controller with 5 HDDs on a port multiplier. MFC after: 1 week Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu Feb 2 19:01:41 2012 (r230920) +++ head/sys/cam/ata/ata_da.c Thu Feb 2 19:02:15 2012 (r230921) @@ -1098,7 +1098,7 @@ adaregister(struct cam_periph *periph, v */ callout_init_mtx(&softc->sendordered_c, periph->sim->mtx, 0); callout_reset(&softc->sendordered_c, - (ADA_DEFAULT_TIMEOUT * hz) / ADA_ORDEREDTAG_INTERVAL, + (ada_default_timeout * hz) / ADA_ORDEREDTAG_INTERVAL, adasendorderedtag, softc); if (ADA_RA >= 0 && @@ -1653,7 +1653,7 @@ adasendorderedtag(void *arg) } /* Queue us up again */ callout_reset(&softc->sendordered_c, - (ADA_DEFAULT_TIMEOUT * hz) / ADA_ORDEREDTAG_INTERVAL, + (ada_default_timeout * hz) / ADA_ORDEREDTAG_INTERVAL, adasendorderedtag, softc); } Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Feb 2 19:01:41 2012 (r230920) +++ head/sys/cam/scsi/scsi_da.c Thu Feb 2 19:02:15 2012 (r230921) @@ -1149,7 +1149,7 @@ dadump(void *arg, void *virtual, vm_offs /*data_ptr*/(u_int8_t *) virtual, /*dxfer_len*/length, /*sense_len*/SSD_FULL_SIZE, - DA_DEFAULT_TIMEOUT * 1000); + da_default_timeout * 1000); xpt_polled_action((union ccb *)&csio); cam_periph_unlock(periph); @@ -1597,7 +1597,7 @@ daregister(struct cam_periph *periph, vo */ callout_init_mtx(&softc->sendordered_c, periph->sim->mtx, 0); callout_reset(&softc->sendordered_c, - (DA_DEFAULT_TIMEOUT * hz) / DA_ORDEREDTAG_INTERVAL, + (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, dasendorderedtag, softc); mtx_unlock(periph->sim->mtx); @@ -2768,7 +2768,7 @@ dasendorderedtag(void *arg) } /* Queue us up again */ callout_reset(&softc->sendordered_c, - (DA_DEFAULT_TIMEOUT * hz) / DA_ORDEREDTAG_INTERVAL, + (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, dasendorderedtag, softc); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 19:03:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11EB3106564A; Thu, 2 Feb 2012 19:03:30 +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 F1B2B8FC0C; Thu, 2 Feb 2012 19:03:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q12J3TG5050371; Thu, 2 Feb 2012 19:03:29 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q12J3TSN050364; Thu, 2 Feb 2012 19:03:29 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202021903.q12J3TSN050364@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 2 Feb 2012 19:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230922 - in stable/8/sys: conf dev/mps dev/mps/mpi modules/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 19:03:30 -0000 Author: ken Date: Thu Feb 2 19:03:29 2012 New Revision: 230922 URL: http://svn.freebsd.org/changeset/base/230922 Log: MFC 230592: Bring in the LSI-supported version of the mps(4) driver. This involves significant changes to the mps(4) driver, but is not a complete rewrite. Some of the changes in this version of the driver: - Integrated RAID (IR) support. - Support for WarpDrive controllers. - Support for SCSI protection information (EEDP). - Support for TLR (Transport Level Retries), needed for tape drives. - Improved error recovery code. - ioctl interface compatible with LSI utilities. mps.4: Update the mps(4) driver man page somewhat for the driver changes. The list of supported hardware still needs to be updated to reflect the full list of supported cards. conf/files: Add the new driver files. mps/mpi/*: Updated version of the MPI header files, with a BSD style copyright. mps/*: See above for a description of the new driver features. modules/mps/Makefile: Add the new mps(4) driver files. Submitted by: Kashyap Desai Sponsored by: LSI, Spectra Logic Reviewed by: ken Added: stable/8/sys/dev/mps/mps_config.c - copied unchanged from r230592, head/sys/dev/mps/mps_config.c stable/8/sys/dev/mps/mps_mapping.c - copied unchanged from r230592, head/sys/dev/mps/mps_mapping.c stable/8/sys/dev/mps/mps_mapping.h - copied unchanged from r230592, head/sys/dev/mps/mps_mapping.h stable/8/sys/dev/mps/mps_sas.h - copied unchanged from r230592, head/sys/dev/mps/mps_sas.h stable/8/sys/dev/mps/mps_sas_lsi.c - copied unchanged from r230592, head/sys/dev/mps/mps_sas_lsi.c Modified: stable/8/sys/conf/files stable/8/sys/dev/mps/mpi/mpi2.h stable/8/sys/dev/mps/mpi/mpi2_cnfg.h stable/8/sys/dev/mps/mpi/mpi2_hbd.h stable/8/sys/dev/mps/mpi/mpi2_history.txt stable/8/sys/dev/mps/mpi/mpi2_init.h stable/8/sys/dev/mps/mpi/mpi2_ioc.h stable/8/sys/dev/mps/mpi/mpi2_ra.h stable/8/sys/dev/mps/mpi/mpi2_raid.h stable/8/sys/dev/mps/mpi/mpi2_sas.h stable/8/sys/dev/mps/mpi/mpi2_targ.h stable/8/sys/dev/mps/mpi/mpi2_tool.h stable/8/sys/dev/mps/mpi/mpi2_type.h stable/8/sys/dev/mps/mps.c stable/8/sys/dev/mps/mps_ioctl.h stable/8/sys/dev/mps/mps_pci.c stable/8/sys/dev/mps/mps_sas.c stable/8/sys/dev/mps/mps_table.c stable/8/sys/dev/mps/mps_user.c stable/8/sys/dev/mps/mpsvar.h stable/8/sys/modules/mps/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Thu Feb 2 19:02:15 2012 (r230921) +++ stable/8/sys/conf/files Thu Feb 2 19:03:29 2012 (r230922) @@ -1345,8 +1345,11 @@ dev/mmc/mmcbus_if.m standard dev/mmc/mmcsd.c optional mmcsd dev/mn/if_mn.c optional mn pci dev/mps/mps.c optional mps +dev/mps/mps_config.c optional mps +dev/mps/mps_mapping.c optional mps dev/mps/mps_pci.c optional mps pci dev/mps/mps_sas.c optional mps +dev/mps/mps_sas_lsi.c optional mps dev/mps/mps_table.c optional mps dev/mps/mps_user.c optional mps dev/mpt/mpt.c optional mpt Modified: stable/8/sys/dev/mps/mpi/mpi2.h ============================================================================== --- stable/8/sys/dev/mps/mpi/mpi2.h Thu Feb 2 19:02:15 2012 (r230921) +++ stable/8/sys/dev/mps/mpi/mpi2.h Thu Feb 2 19:03:29 2012 (r230922) @@ -1,6 +1,35 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 LSI Corp. + * 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. + * + * LSI MPT-Fusion Host Adapter FreeBSD + * + * $FreeBSD$ + */ + /* - * Copyright (c) 2000-2009 LSI Corporation. + * Copyright (c) 2000-2011 LSI Corporation. * * * Name: mpi2.h @@ -9,7 +38,7 @@ * scatter/gather formats. * Creation Date: June 21, 2006 * - * mpi2.h Version: 02.00.14 + * mpi2.h Version: 02.00.18 * * Version History * --------------- @@ -58,6 +87,15 @@ * Added MSI-x index mask and shift for Reply Post Host * Index register. * Added function code for Host Based Discovery Action. + * 02-10-10 02.00.15 Bumped MPI2_HEADER_VERSION_UNIT. + * Added define for MPI2_FUNCTION_PWR_MGMT_CONTROL. + * Added defines for product-specific range of message + * function codes, 0xF0 to 0xFF. + * 05-12-10 02.00.16 Bumped MPI2_HEADER_VERSION_UNIT. + * Added alternative defines for the SGE Direction bit. + * 08-11-10 02.00.17 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-10-10 02.00.18 Bumped MPI2_HEADER_VERSION_UNIT. + * Added MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR define. * -------------------------------------------------------------------------- */ @@ -83,7 +121,7 @@ #define MPI2_VERSION_02_00 (0x0200) /* versioning for this MPI header set */ -#define MPI2_HEADER_VERSION_UNIT (0x0E) +#define MPI2_HEADER_VERSION_UNIT (0x12) #define MPI2_HEADER_VERSION_DEV (0x00) #define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI2_HEADER_VERSION_UNIT_SHIFT (8) @@ -476,8 +514,6 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN /***************************************************************************** * * Message Functions -* 0x80 -> 0x8F reserved for private message use per product -* * *****************************************************************************/ @@ -508,6 +544,9 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN #define MPI2_FUNCTION_TARGET_CMD_BUF_LIST_POST (0x25) /* Target Command Buffer Post List */ #define MPI2_FUNCTION_RAID_ACCELERATOR (0x2C) /* RAID Accelerator */ #define MPI2_FUNCTION_HOST_BASED_DISCOVERY_ACTION (0x2F) /* Host Based Discovery Action */ +#define MPI2_FUNCTION_PWR_MGMT_CONTROL (0x30) /* Power Management Control */ +#define MPI2_FUNCTION_MIN_PRODUCT_SPECIFIC (0xF0) /* beginning of product-specific range */ +#define MPI2_FUNCTION_MAX_PRODUCT_SPECIFIC (0xFF) /* end of product-specific range */ @@ -922,6 +961,9 @@ typedef struct _MPI2_MPI_SGE_UNION #define MPI2_SGE_FLAGS_IOC_TO_HOST (0x00) #define MPI2_SGE_FLAGS_HOST_TO_IOC (0x04) +#define MPI2_SGE_FLAGS_DEST (MPI2_SGE_FLAGS_IOC_TO_HOST) +#define MPI2_SGE_FLAGS_SOURCE (MPI2_SGE_FLAGS_HOST_TO_IOC) + /* Address Size */ #define MPI2_SGE_FLAGS_32_BIT_ADDRESSING (0x00) @@ -1046,11 +1088,11 @@ typedef struct _MPI2_IEEE_SGE_UNION /* Data Location Address Space */ #define MPI2_IEEE_SGE_FLAGS_ADDR_MASK (0x03) -#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR (0x00) -#define MPI2_IEEE_SGE_FLAGS_IOCDDR_ADDR (0x01) +#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR (0x00) /* IEEE Simple Element only */ +#define MPI2_IEEE_SGE_FLAGS_IOCDDR_ADDR (0x01) /* IEEE Simple Element only */ #define MPI2_IEEE_SGE_FLAGS_IOCPLB_ADDR (0x02) -#define MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR (0x03) - +#define MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR (0x03) /* IEEE Simple Element only */ +#define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR (0x03) /* IEEE Chain Element only */ /**************************************************************************** * IEEE SGE operation Macros Modified: stable/8/sys/dev/mps/mpi/mpi2_cnfg.h ============================================================================== --- stable/8/sys/dev/mps/mpi/mpi2_cnfg.h Thu Feb 2 19:02:15 2012 (r230921) +++ stable/8/sys/dev/mps/mpi/mpi2_cnfg.h Thu Feb 2 19:03:29 2012 (r230922) @@ -1,13 +1,42 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 LSI Corp. + * 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. + * + * LSI MPT-Fusion Host Adapter FreeBSD + * + * $FreeBSD$ + */ + /* - * Copyright (c) 2000-2009 LSI Corporation. + * Copyright (c) 2000-2011 LSI Corporation. * * * Name: mpi2_cnfg.h * Title: MPI Configuration messages and pages * Creation Date: November 10, 2006 * - * mpi2_cnfg.h Version: 02.00.13 + * mpi2_cnfg.h Version: 02.00.17 * * Version History * --------------- @@ -110,6 +139,31 @@ * Added Ethernet configuration pages. * 10-28-09 02.00.13 Added MPI2_IOUNITPAGE1_ENABLE_HOST_BASED_DISCOVERY. * Added SAS PHY Page 4 structure and defines. + * 02-10-10 02.00.14 Modified the comments for the configuration page + * structures that contain an array of data. The host + * should use the "count" field in the page data (e.g. the + * NumPhys field) to determine the number of valid elements + * in the array. + * Added/modified some MPI2_MFGPAGE_DEVID_SAS defines. + * Added PowerManagementCapabilities to IO Unit Page 7. + * Added PortWidthModGroup field to + * MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_6 and related defines. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_7 and related defines. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_8 and related defines. + * 05-12-10 02.00.15 Added MPI2_RAIDVOL0_STATUS_FLAG_VOL_NOT_CONSISTENT + * define. + * Added MPI2_PHYSDISK0_INCOMPATIBLE_MEDIA_TYPE define. + * Added MPI2_SAS_NEG_LINK_RATE_UNSUPPORTED_PHY define. + * 08-11-10 02.00.16 Removed IO Unit Page 1 device path (multi-pathing) + * defines. + * 11-10-10 02.00.17 Added ReceptacleID field (replacing Reserved1) to + * MPI2_MANPAGE7_CONNECTOR_INFO and reworked defines for + * the Pinout field. + * Added BoardTemperature and BoardTemperatureUnits fields + * to MPI2_CONFIG_PAGE_IO_UNIT_7. + * Added MPI2_CONFIG_EXTPAGETYPE_EXT_MANUFACTURING define + * and MPI2_CONFIG_PAGE_EXT_MAN_PS structure. * -------------------------------------------------------------------------- */ @@ -193,6 +247,7 @@ typedef union _MPI2_CONFIG_EXT_PAGE_HEAD #define MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING (0x17) #define MPI2_CONFIG_EXTPAGETYPE_SAS_PORT (0x18) #define MPI2_CONFIG_EXTPAGETYPE_ETHERNET (0x19) +#define MPI2_CONFIG_EXTPAGETYPE_EXT_MANUFACTURING (0x1A) /***************************************************************************** @@ -322,7 +377,7 @@ typedef struct _MPI2_CONFIG_REQUEST #define MPI2_CONFIG_ACTION_PAGE_READ_NVRAM (0x06) #define MPI2_CONFIG_ACTION_PAGE_GET_CHANGEABLE (0x07) -/* values for SGLFlags field are in the SGL section of mpi2.h */ +/* use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */ /* Config Reply Message */ @@ -368,14 +423,19 @@ typedef struct _MPI2_CONFIG_REPLY #define MPI2_MFGPAGE_DEVID_SAS2116_1 (0x0064) #define MPI2_MFGPAGE_DEVID_SAS2116_2 (0x0065) +#define MPI2_MFGPAGE_DEVID_SSS6200 (0x007E) + #define MPI2_MFGPAGE_DEVID_SAS2208_1 (0x0080) #define MPI2_MFGPAGE_DEVID_SAS2208_2 (0x0081) #define MPI2_MFGPAGE_DEVID_SAS2208_3 (0x0082) #define MPI2_MFGPAGE_DEVID_SAS2208_4 (0x0083) #define MPI2_MFGPAGE_DEVID_SAS2208_5 (0x0084) #define MPI2_MFGPAGE_DEVID_SAS2208_6 (0x0085) -#define MPI2_MFGPAGE_DEVID_SAS2208_7 (0x0086) -#define MPI2_MFGPAGE_DEVID_SAS2208_8 (0x0087) +#define MPI2_MFGPAGE_DEVID_SAS2308_1 (0x0086) +#define MPI2_MFGPAGE_DEVID_SAS2308_2 (0x0087) +#define MPI2_MFGPAGE_DEVID_SAS2308_3 (0x006E) + + /* Manufacturing Page 0 */ @@ -541,7 +601,7 @@ typedef struct _MPI2_CONFIG_PAGE_MAN_4 /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_MAN_PAGE_5_PHY_ENTRIES #define MPI2_MAN_PAGE_5_PHY_ENTRIES (1) @@ -590,23 +650,31 @@ typedef struct _MPI2_MANPAGE7_CONNECTOR_ U32 Pinout; /* 0x00 */ U8 Connector[16]; /* 0x04 */ U8 Location; /* 0x14 */ - U8 Reserved1; /* 0x15 */ + U8 ReceptacleID; /* 0x15 */ U16 Slot; /* 0x16 */ U32 Reserved2; /* 0x18 */ } MPI2_MANPAGE7_CONNECTOR_INFO, MPI2_POINTER PTR_MPI2_MANPAGE7_CONNECTOR_INFO, Mpi2ManPage7ConnectorInfo_t, MPI2_POINTER pMpi2ManPage7ConnectorInfo_t; /* defines for the Pinout field */ -#define MPI2_MANPAGE7_PINOUT_SFF_8484_L4 (0x00080000) -#define MPI2_MANPAGE7_PINOUT_SFF_8484_L3 (0x00040000) -#define MPI2_MANPAGE7_PINOUT_SFF_8484_L2 (0x00020000) -#define MPI2_MANPAGE7_PINOUT_SFF_8484_L1 (0x00010000) -#define MPI2_MANPAGE7_PINOUT_SFF_8470_L4 (0x00000800) -#define MPI2_MANPAGE7_PINOUT_SFF_8470_L3 (0x00000400) -#define MPI2_MANPAGE7_PINOUT_SFF_8470_L2 (0x00000200) -#define MPI2_MANPAGE7_PINOUT_SFF_8470_L1 (0x00000100) -#define MPI2_MANPAGE7_PINOUT_SFF_8482 (0x00000002) -#define MPI2_MANPAGE7_PINOUT_CONNECTION_UNKNOWN (0x00000001) +#define MPI2_MANPAGE7_PINOUT_LANE_MASK (0x0000FF00) +#define MPI2_MANPAGE7_PINOUT_LANE_SHIFT (8) + +#define MPI2_MANPAGE7_PINOUT_TYPE_MASK (0x000000FF) +#define MPI2_MANPAGE7_PINOUT_TYPE_UNKNOWN (0x00) +#define MPI2_MANPAGE7_PINOUT_SATA_SINGLE (0x01) +#define MPI2_MANPAGE7_PINOUT_SFF_8482 (0x02) +#define MPI2_MANPAGE7_PINOUT_SFF_8486 (0x03) +#define MPI2_MANPAGE7_PINOUT_SFF_8484 (0x04) +#define MPI2_MANPAGE7_PINOUT_SFF_8087 (0x05) +#define MPI2_MANPAGE7_PINOUT_SFF_8643_4I (0x06) +#define MPI2_MANPAGE7_PINOUT_SFF_8643_8I (0x07) +#define MPI2_MANPAGE7_PINOUT_SFF_8470 (0x08) +#define MPI2_MANPAGE7_PINOUT_SFF_8088 (0x09) +#define MPI2_MANPAGE7_PINOUT_SFF_8644_4X (0x0A) +#define MPI2_MANPAGE7_PINOUT_SFF_8644_8X (0x0B) +#define MPI2_MANPAGE7_PINOUT_SFF_8644_16X (0x0C) +#define MPI2_MANPAGE7_PINOUT_SFF_8436 (0x0D) /* defines for the Location field */ #define MPI2_MANPAGE7_LOCATION_UNKNOWN (0x01) @@ -619,7 +687,7 @@ typedef struct _MPI2_MANPAGE7_CONNECTOR_ /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_MANPAGE7_CONNECTOR_INFO_MAX #define MPI2_MANPAGE7_CONNECTOR_INFO_MAX (1) @@ -640,7 +708,7 @@ typedef struct _MPI2_CONFIG_PAGE_MAN_7 MPI2_POINTER PTR_MPI2_CONFIG_PAGE_MAN_7, Mpi2ManufacturingPage7_t, MPI2_POINTER pMpi2ManufacturingPage7_t; -#define MPI2_MANUFACTURING7_PAGEVERSION (0x00) +#define MPI2_MANUFACTURING7_PAGEVERSION (0x01) /* defines for the Flags field */ #define MPI2_MANPAGE7_FLAG_USE_SLOT_INFO (0x00000001) @@ -717,6 +785,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT /* IO Unit Page 1 Flags defines */ #define MPI2_IOUNITPAGE1_ENABLE_HOST_BASED_DISCOVERY (0x00000800) #define MPI2_IOUNITPAGE1_MASK_SATA_WRITE_CACHE (0x00000600) +#define MPI2_IOUNITPAGE1_SATA_WRITE_CACHE_SHIFT (9) #define MPI2_IOUNITPAGE1_ENABLE_SATA_WRITE_CACHE (0x00000000) #define MPI2_IOUNITPAGE1_DISABLE_SATA_WRITE_CACHE (0x00000200) #define MPI2_IOUNITPAGE1_UNCHANGED_SATA_WRITE_CACHE (0x00000400) @@ -724,15 +793,13 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE1_DISABLE_IR (0x00000040) #define MPI2_IOUNITPAGE1_DISABLE_TASK_SET_FULL_HANDLING (0x00000020) #define MPI2_IOUNITPAGE1_IR_USE_STATIC_VOLUME_ID (0x00000004) -#define MPI2_IOUNITPAGE1_MULTI_PATHING (0x00000002) -#define MPI2_IOUNITPAGE1_SINGLE_PATHING (0x00000000) /* IO Unit Page 3 */ /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength at runtime. + * one and check the value returned for GPIOCount at runtime. */ #ifndef MPI2_IO_UNIT_PAGE_3_GPIO_VAL_MAX #define MPI2_IO_UNIT_PAGE_3_GPIO_VAL_MAX (1) @@ -761,7 +828,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT /* * Upper layer code (drivers, utilities, etc.) should leave this define set to - * one and check Header.PageLength or NumDmaEngines at runtime. + * one and check the value returned for NumDmaEngines at runtime. */ #ifndef MPI2_IOUNITPAGE5_DMAENGINE_ENTRIES #define MPI2_IOUNITPAGE5_DMAENGINE_ENTRIES (1) @@ -826,15 +893,17 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT U8 PCIeWidth; /* 0x06 */ U8 PCIeSpeed; /* 0x07 */ U32 ProcessorState; /* 0x08 */ - U32 Reserved2; /* 0x0C */ + U32 PowerManagementCapabilities; /* 0x0C */ U16 IOCTemperature; /* 0x10 */ U8 IOCTemperatureUnits; /* 0x12 */ U8 IOCSpeed; /* 0x13 */ - U32 Reserved3; /* 0x14 */ + U16 BoardTemperature; /* 0x14 */ + U8 BoardTemperatureUnits; /* 0x16 */ + U8 Reserved3; /* 0x17 */ } MPI2_CONFIG_PAGE_IO_UNIT_7, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_IO_UNIT_7, Mpi2IOUnitPage7_t, MPI2_POINTER pMpi2IOUnitPage7_t; -#define MPI2_IOUNITPAGE7_PAGEVERSION (0x00) +#define MPI2_IOUNITPAGE7_PAGEVERSION (0x02) /* defines for IO Unit Page 7 PCIeWidth field */ #define MPI2_IOUNITPAGE7_PCIE_WIDTH_X1 (0x01) @@ -855,6 +924,13 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE7_PSTATE_DISABLED (0x01) #define MPI2_IOUNITPAGE7_PSTATE_ENABLED (0x02) +/* defines for IO Unit Page 7 PowerManagementCapabilities field */ +#define MPI2_IOUNITPAGE7_PMCAP_12_5_PCT_IOCSPEED (0x00000400) +#define MPI2_IOUNITPAGE7_PMCAP_25_0_PCT_IOCSPEED (0x00000200) +#define MPI2_IOUNITPAGE7_PMCAP_50_0_PCT_IOCSPEED (0x00000100) +#define MPI2_IOUNITPAGE7_PMCAP_PCIE_WIDTH_CHANGE (0x00000008) +#define MPI2_IOUNITPAGE7_PMCAP_PCIE_SPEED_CHANGE (0x00000004) + /* defines for IO Unit Page 7 IOCTemperatureUnits field */ #define MPI2_IOUNITPAGE7_IOC_TEMP_NOT_PRESENT (0x00) #define MPI2_IOUNITPAGE7_IOC_TEMP_FAHRENHEIT (0x01) @@ -866,6 +942,11 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE7_IOC_SPEED_QUARTER (0x04) #define MPI2_IOUNITPAGE7_IOC_SPEED_EIGHTH (0x08) +/* defines for IO Unit Page 7 BoardTemperatureUnits field */ +#define MPI2_IOUNITPAGE7_BOARD_TEMP_NOT_PRESENT (0x00) +#define MPI2_IOUNITPAGE7_BOARD_TEMP_FAHRENHEIT (0x01) +#define MPI2_IOUNITPAGE7_BOARD_TEMP_CELSIUS (0x02) + /**************************************************************************** @@ -1198,7 +1279,7 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_3 /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_BIOS_PAGE_4_PHY_ENTRIES #define MPI2_BIOS_PAGE_4_PHY_ENTRIES (1) @@ -1272,7 +1353,7 @@ typedef struct _MPI2_RAIDVOL0_SETTINGS /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength at runtime. + * one and check the value returned for NumPhysDisks at runtime. */ #ifndef MPI2_RAID_VOL_PAGE_0_PHYSDISK_MAX #define MPI2_RAID_VOL_PAGE_0_PHYSDISK_MAX (1) @@ -1329,6 +1410,7 @@ typedef struct _MPI2_CONFIG_PAGE_RAID_VO #define MPI2_RAIDVOL0_STATUS_FLAG_CAPACITY_EXPANSION (0x00040000) #define MPI2_RAIDVOL0_STATUS_FLAG_BACKGROUND_INIT (0x00020000) #define MPI2_RAIDVOL0_STATUS_FLAG_RESYNC_IN_PROGRESS (0x00010000) +#define MPI2_RAIDVOL0_STATUS_FLAG_VOL_NOT_CONSISTENT (0x00000080) #define MPI2_RAIDVOL0_STATUS_FLAG_OCE_ALLOWED (0x00000040) #define MPI2_RAIDVOL0_STATUS_FLAG_BGI_COMPLETE (0x00000020) #define MPI2_RAIDVOL0_STATUS_FLAG_1E_OFFSET_MIRROR (0x00000000) @@ -1451,11 +1533,15 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS #define MPI2_PHYSDISK0_INCOMPATIBLE_MAX_LBA (0x03) #define MPI2_PHYSDISK0_INCOMPATIBLE_SATA_EXTENDED_CMD (0x04) #define MPI2_PHYSDISK0_INCOMPATIBLE_REMOVEABLE_MEDIA (0x05) +#define MPI2_PHYSDISK0_INCOMPATIBLE_MEDIA_TYPE (0x06) #define MPI2_PHYSDISK0_INCOMPATIBLE_UNKNOWN (0xFF) /* PhysDiskAttributes defines */ +#define MPI2_PHYSDISK0_ATTRIB_MEDIA_MASK (0x0C) #define MPI2_PHYSDISK0_ATTRIB_SOLID_STATE_DRIVE (0x08) #define MPI2_PHYSDISK0_ATTRIB_HARD_DISK_DRIVE (0x04) + +#define MPI2_PHYSDISK0_ATTRIB_PROTOCOL_MASK (0x03) #define MPI2_PHYSDISK0_ATTRIB_SAS_PROTOCOL (0x02) #define MPI2_PHYSDISK0_ATTRIB_SATA_PROTOCOL (0x01) @@ -1474,7 +1560,7 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength or NumPhysDiskPaths at runtime. + * one and check the value returned for NumPhysDiskPaths at runtime. */ #ifndef MPI2_RAID_PHYS_DISK1_PATH_MAX #define MPI2_RAID_PHYS_DISK1_PATH_MAX (1) @@ -1527,6 +1613,7 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS #define MPI2_SAS_NEG_LINK_RATE_SATA_OOB_COMPLETE (0x03) #define MPI2_SAS_NEG_LINK_RATE_PORT_SELECTOR (0x04) #define MPI2_SAS_NEG_LINK_RATE_SMP_RESET_IN_PROGRESS (0x05) +#define MPI2_SAS_NEG_LINK_RATE_UNSUPPORTED_PHY (0x06) #define MPI2_SAS_NEG_LINK_RATE_1_5 (0x08) #define MPI2_SAS_NEG_LINK_RATE_3_0 (0x09) #define MPI2_SAS_NEG_LINK_RATE_6_0 (0x0A) @@ -1553,6 +1640,7 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS #define MPI2_SAS_PHYINFO_PHY_VACANT (0x80000000) #define MPI2_SAS_PHYINFO_PHY_POWER_CONDITION_MASK (0x18000000) +#define MPI2_SAS_PHYINFO_SHIFT_PHY_POWER_CONDITION (27) #define MPI2_SAS_PHYINFO_PHY_POWER_ACTIVE (0x00000000) #define MPI2_SAS_PHYINFO_PHY_POWER_PARTIAL (0x08000000) #define MPI2_SAS_PHYINFO_PHY_POWER_SLUMBER (0x10000000) @@ -1636,7 +1724,7 @@ typedef struct _MPI2_SAS_IO_UNIT0_PHY_DA /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_SAS_IOUNIT0_PHY_MAX #define MPI2_SAS_IOUNIT0_PHY_MAX (1) @@ -1707,7 +1795,7 @@ typedef struct _MPI2_SAS_IO_UNIT1_PHY_DA /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_SAS_IOUNIT1_PHY_MAX #define MPI2_SAS_IOUNIT1_PHY_MAX (1) @@ -1798,7 +1886,7 @@ typedef struct _MPI2_SAS_IOUNIT4_SPINUP_ /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * four and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_SAS_IOUNIT4_PHY_MAX #define MPI2_SAS_IOUNIT4_PHY_MAX (4) @@ -1837,7 +1925,7 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN typedef struct _MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS { U8 ControlFlags; /* 0x00 */ - U8 Reserved1; /* 0x01 */ + U8 PortWidthModGroup; /* 0x01 */ U16 InactivityTimerExponent; /* 0x02 */ U8 SATAPartialTimeout; /* 0x04 */ U8 Reserved2; /* 0x05 */ @@ -1857,6 +1945,9 @@ typedef struct _MPI2_SAS_IO_UNIT5_PHY_PM #define MPI2_SASIOUNIT5_CONTROL_SATA_SLUMBER_ENABLE (0x02) #define MPI2_SASIOUNIT5_CONTROL_SATA_PARTIAL_ENABLE (0x01) +/* defines for PortWidthModeGroup field */ +#define MPI2_SASIOUNIT5_PWMG_DISABLE (0xFF) + /* defines for InactivityTimerExponent field */ #define MPI2_SASIOUNIT5_ITE_MASK_SAS_SLUMBER (0x7000) #define MPI2_SASIOUNIT5_ITE_SHIFT_SAS_SLUMBER (12) @@ -1878,7 +1969,7 @@ typedef struct _MPI2_SAS_IO_UNIT5_PHY_PM /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_SAS_IOUNIT5_PHY_MAX #define MPI2_SAS_IOUNIT5_PHY_MAX (1) @@ -1896,7 +1987,137 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SASIOUNIT_5, Mpi2SasIOUnitPage5_t, MPI2_POINTER pMpi2SasIOUnitPage5_t; -#define MPI2_SASIOUNITPAGE5_PAGEVERSION (0x00) +#define MPI2_SASIOUNITPAGE5_PAGEVERSION (0x01) + + +/* SAS IO Unit Page 6 */ + +typedef struct _MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS +{ + U8 CurrentStatus; /* 0x00 */ + U8 CurrentModulation; /* 0x01 */ + U8 CurrentUtilization; /* 0x02 */ + U8 Reserved1; /* 0x03 */ + U32 Reserved2; /* 0x04 */ +} MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS, + MPI2_POINTER PTR_MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS, + Mpi2SasIOUnit6PortWidthModGroupStatus_t, + MPI2_POINTER pMpi2SasIOUnit6PortWidthModGroupStatus_t; + +/* defines for CurrentStatus field */ +#define MPI2_SASIOUNIT6_STATUS_UNAVAILABLE (0x00) +#define MPI2_SASIOUNIT6_STATUS_UNCONFIGURED (0x01) +#define MPI2_SASIOUNIT6_STATUS_INVALID_CONFIG (0x02) +#define MPI2_SASIOUNIT6_STATUS_LINK_DOWN (0x03) +#define MPI2_SASIOUNIT6_STATUS_OBSERVATION_ONLY (0x04) +#define MPI2_SASIOUNIT6_STATUS_INACTIVE (0x05) +#define MPI2_SASIOUNIT6_STATUS_ACTIVE_IOUNIT (0x06) +#define MPI2_SASIOUNIT6_STATUS_ACTIVE_HOST (0x07) + +/* defines for CurrentModulation field */ +#define MPI2_SASIOUNIT6_MODULATION_25_PERCENT (0x00) +#define MPI2_SASIOUNIT6_MODULATION_50_PERCENT (0x01) +#define MPI2_SASIOUNIT6_MODULATION_75_PERCENT (0x02) +#define MPI2_SASIOUNIT6_MODULATION_100_PERCENT (0x03) + +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check the value returned for NumGroups at runtime. + */ +#ifndef MPI2_SAS_IOUNIT6_GROUP_MAX +#define MPI2_SAS_IOUNIT6_GROUP_MAX (1) +#endif + +typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_6 +{ + MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ + U32 Reserved1; /* 0x08 */ + U32 Reserved2; /* 0x0C */ + U8 NumGroups; /* 0x10 */ + U8 Reserved3; /* 0x11 */ + U16 Reserved4; /* 0x12 */ + MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS + PortWidthModulationGroupStatus[MPI2_SAS_IOUNIT6_GROUP_MAX]; /* 0x14 */ +} MPI2_CONFIG_PAGE_SASIOUNIT_6, + MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SASIOUNIT_6, + Mpi2SasIOUnitPage6_t, MPI2_POINTER pMpi2SasIOUnitPage6_t; + +#define MPI2_SASIOUNITPAGE6_PAGEVERSION (0x00) + + +/* SAS IO Unit Page 7 */ + +typedef struct _MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS +{ + U8 Flags; /* 0x00 */ + U8 Reserved1; /* 0x01 */ + U16 Reserved2; /* 0x02 */ + U8 Threshold75Pct; /* 0x04 */ + U8 Threshold50Pct; /* 0x05 */ + U8 Threshold25Pct; /* 0x06 */ + U8 Reserved3; /* 0x07 */ +} MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS, + MPI2_POINTER PTR_MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS, + Mpi2SasIOUnit7PortWidthModGroupSettings_t, + MPI2_POINTER pMpi2SasIOUnit7PortWidthModGroupSettings_t; + +/* defines for Flags field */ +#define MPI2_SASIOUNIT7_FLAGS_ENABLE_PORT_WIDTH_MODULATION (0x01) + + +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check the value returned for NumGroups at runtime. + */ +#ifndef MPI2_SAS_IOUNIT7_GROUP_MAX +#define MPI2_SAS_IOUNIT7_GROUP_MAX (1) +#endif + +typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_7 +{ + MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ + U8 SamplingInterval; /* 0x08 */ + U8 WindowLength; /* 0x09 */ + U16 Reserved1; /* 0x0A */ + U32 Reserved2; /* 0x0C */ + U32 Reserved3; /* 0x10 */ + U8 NumGroups; /* 0x14 */ + U8 Reserved4; /* 0x15 */ + U16 Reserved5; /* 0x16 */ + MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS + PortWidthModulationGroupSettings[MPI2_SAS_IOUNIT7_GROUP_MAX]; /* 0x18 */ +} MPI2_CONFIG_PAGE_SASIOUNIT_7, + MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SASIOUNIT_7, + Mpi2SasIOUnitPage7_t, MPI2_POINTER pMpi2SasIOUnitPage7_t; + +#define MPI2_SASIOUNITPAGE7_PAGEVERSION (0x00) + + +/* SAS IO Unit Page 8 */ + +typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_8 +{ + MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ + U32 Reserved1; /* 0x08 */ + U32 PowerManagementCapabilities; /* 0x0C */ + U32 Reserved2; /* 0x10 */ +} MPI2_CONFIG_PAGE_SASIOUNIT_8, + MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SASIOUNIT_8, + Mpi2SasIOUnitPage8_t, MPI2_POINTER pMpi2SasIOUnitPage8_t; + +#define MPI2_SASIOUNITPAGE8_PAGEVERSION (0x00) + +/* defines for PowerManagementCapabilities field */ +#define MPI2_SASIOUNIT8_PM_HOST_PORT_WIDTH_MOD (0x000001000) +#define MPI2_SASIOUNIT8_PM_HOST_SAS_SLUMBER_MODE (0x000000800) +#define MPI2_SASIOUNIT8_PM_HOST_SAS_PARTIAL_MODE (0x000000400) +#define MPI2_SASIOUNIT8_PM_HOST_SATA_SLUMBER_MODE (0x000000200) +#define MPI2_SASIOUNIT8_PM_HOST_SATA_PARTIAL_MODE (0x000000100) +#define MPI2_SASIOUNIT8_PM_IOUNIT_PORT_WIDTH_MOD (0x000000010) +#define MPI2_SASIOUNIT8_PM_IOUNIT_SAS_SLUMBER_MODE (0x000000008) +#define MPI2_SASIOUNIT8_PM_IOUNIT_SAS_PARTIAL_MODE (0x000000004) +#define MPI2_SASIOUNIT8_PM_IOUNIT_SATA_SLUMBER_MODE (0x000000002) +#define MPI2_SASIOUNIT8_PM_IOUNIT_SATA_PARTIAL_MODE (0x000000001) @@ -2187,7 +2408,7 @@ typedef struct _MPI2_SASPHY2_PHY_EVENT /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhyEvents at runtime. + * one and check the value returned for NumPhyEvents at runtime. */ #ifndef MPI2_SASPHY2_PHY_EVENT_MAX #define MPI2_SASPHY2_PHY_EVENT_MAX (1) @@ -2280,7 +2501,7 @@ typedef struct _MPI2_SASPHY3_PHY_EVENT_C /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhyEvents at runtime. + * one and check the value returned for NumPhyEvents at runtime. */ #ifndef MPI2_SASPHY3_PHY_EVENT_MAX #define MPI2_SASPHY3_PHY_EVENT_MAX (1) @@ -2392,7 +2613,7 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_ENC /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumLogEntries at runtime. */ #ifndef MPI2_LOG_0_NUM_LOG_ENTRIES #define MPI2_LOG_0_NUM_LOG_ENTRIES (1) @@ -2442,7 +2663,7 @@ typedef struct _MPI2_CONFIG_PAGE_LOG_0 /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumElements at runtime. */ #ifndef MPI2_RAIDCONFIG0_MAX_ELEMENTS #define MPI2_RAIDCONFIG0_MAX_ELEMENTS (1) @@ -2642,5 +2863,25 @@ typedef struct _MPI2_CONFIG_PAGE_ETHERNE #define MPI2_ETHPG1_MS_DATA_RATE_1GBIT (0x03) +/**************************************************************************** +* Extended Manufacturing Config Pages +****************************************************************************/ + +/* + * Generic structure to use for product-specific extended manufacturing pages + * (currently Extended Manufacturing Page 40 through Extended Manufacturing + * Page 60). + */ + +typedef struct _MPI2_CONFIG_PAGE_EXT_MAN_PS +{ + MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ + U32 ProductSpecificInfo; /* 0x08 */ +} MPI2_CONFIG_PAGE_EXT_MAN_PS, + MPI2_POINTER PTR_MPI2_CONFIG_PAGE_EXT_MAN_PS, + Mpi2ExtManufacturingPagePS_t, MPI2_POINTER pMpi2ExtManufacturingPagePS_t; + +/* PageVersion should be provided by product-specific code */ + #endif Modified: stable/8/sys/dev/mps/mpi/mpi2_hbd.h ============================================================================== --- stable/8/sys/dev/mps/mpi/mpi2_hbd.h Thu Feb 2 19:02:15 2012 (r230921) +++ stable/8/sys/dev/mps/mpi/mpi2_hbd.h Thu Feb 2 19:03:29 2012 (r230922) @@ -1,13 +1,42 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 LSI Corp. + * 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. + * + * LSI MPT-Fusion Host Adapter FreeBSD + * + * $FreeBSD$ + */ + /* - * Copyright (c) 2009 LSI Corporation. + * Copyright (c) 2009-2011 LSI Corporation. * * * Name: mpi2_hbd.h * Title: MPI Host Based Discovery messages and structures * Creation Date: October 21, 2009 * - * mpi2_hbd.h Version: 02.00.00 + * mpi2_hbd.h Version: 02.00.01 * * Version History * --------------- @@ -15,6 +44,8 @@ * Date Version Description * -------- -------- ------------------------------------------------------ * 10-28-09 02.00.00 Initial version. + * 08-11-10 02.00.01 Removed PortGroups, DmaGroup, and ControlGroup from + * HBD Action request, replaced by AdditionalInfo field. * -------------------------------------------------------------------------- */ @@ -48,10 +79,7 @@ typedef struct _MPI2_HBD_ACTION_REQUEST U8 Port; /* 0x25 */ U8 MaxConnections; /* 0x26 */ U8 MaxRate; /* 0x27 */ - U8 PortGroups; /* 0x28 */ - U8 DmaGroup; /* 0x29 */ - U8 ControlGroup; /* 0x2A */ - U8 Reserved6; /* 0x2B */ + U32 AdditionalInfo; /* 0x28 */ U16 InitialAWT; /* 0x2C */ U16 Reserved7; /* 0x2E */ U32 Reserved8; /* 0x30 */ Modified: stable/8/sys/dev/mps/mpi/mpi2_history.txt ============================================================================== --- stable/8/sys/dev/mps/mpi/mpi2_history.txt Thu Feb 2 19:02:15 2012 (r230921) +++ stable/8/sys/dev/mps/mpi/mpi2_history.txt Thu Feb 2 19:03:29 2012 (r230922) @@ -1,29 +1,58 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 LSI Corp. + * 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. + * + * LSI MPT-Fusion Host Adapter FreeBSD + * + * $FreeBSD$ + */ + ============================== Fusion-MPT MPI 2.0 Header File Change History ============================== - Copyright (c) 2000-2009 LSI Corporation. + Copyright (c) 2000-2011 LSI Corporation. --------------------------------------- - Header Set Release Version: 02.00.14 - Header Set Release Date: 10-28-09 + Header Set Release Version: 02.00.18 + Header Set Release Date: 11-10-10 --------------------------------------- Filename Current version Prior version ---------- --------------- ------------- - mpi2.h 02.00.14 02.00.13 - mpi2_cnfg.h 02.00.13 02.00.12 - mpi2_init.h 02.00.08 02.00.07 - mpi2_ioc.h 02.00.13 02.00.12 - mpi2_raid.h 02.00.04 02.00.04 - mpi2_sas.h 02.00.03 02.00.02 - mpi2_targ.h 02.00.03 02.00.03 - mpi2_tool.h 02.00.04 02.00.04 + mpi2.h 02.00.18 02.00.17 + mpi2_cnfg.h 02.00.17 02.00.16 + mpi2_init.h 02.00.11 02.00.10 + mpi2_ioc.h 02.00.16 02.00.15 + mpi2_raid.h 02.00.05 02.00.05 + mpi2_sas.h 02.00.05 02.00.05 + mpi2_targ.h 02.00.04 02.00.04 + mpi2_tool.h 02.00.06 02.00.06 mpi2_type.h 02.00.00 02.00.00 mpi2_ra.h 02.00.00 02.00.00 - mpi2_hbd.h 02.00.00 - mpi2_history.txt 02.00.14 02.00.13 + mpi2_hbd.h 02.00.01 02.00.01 + mpi2_history.txt 02.00.18 02.00.17 * Date Version Description @@ -72,6 +101,15 @@ mpi2.h * Added MSI-x index mask and shift for Reply Post Host * Index register. * Added function code for Host Based Discovery Action. + * 02-10-10 02.00.15 Bumped MPI2_HEADER_VERSION_UNIT. + * Added define for MPI2_FUNCTION_PWR_MGMT_CONTROL. + * Added defines for product-specific range of message + * function codes, 0xF0 to 0xFF. + * 05-12-10 02.00.16 Bumped MPI2_HEADER_VERSION_UNIT. + * Added alternative defines for the SGE Direction bit. + * 08-11-10 02.00.17 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-10-10 02.00.18 Bumped MPI2_HEADER_VERSION_UNIT. + * Added MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR define. * -------------------------------------------------------------------------- mpi2_cnfg.h @@ -171,6 +209,31 @@ mpi2_cnfg.h * Added Ethernet configuration pages. * 10-28-09 02.00.13 Added MPI2_IOUNITPAGE1_ENABLE_HOST_BASED_DISCOVERY. * Added SAS PHY Page 4 structure and defines. + * 02-10-10 02.00.14 Modified the comments for the configuration page + * structures that contain an array of data. The host + * should use the "count" field in the page data (e.g. the + * NumPhys field) to determine the number of valid elements + * in the array. + * Added/modified some MPI2_MFGPAGE_DEVID_SAS defines. + * Added PowerManagementCapabilities to IO Unit Page 7. + * Added PortWidthModGroup field to + * MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_6 and related defines. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_7 and related defines. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_8 and related defines. + * 05-12-10 02.00.15 Added MPI2_RAIDVOL0_STATUS_FLAG_VOL_NOT_CONSISTENT + * define. + * Added MPI2_PHYSDISK0_INCOMPATIBLE_MEDIA_TYPE define. + * Added MPI2_SAS_NEG_LINK_RATE_UNSUPPORTED_PHY define. + * 08-11-10 02.00.16 Removed IO Unit Page 1 device path (multi-pathing) + * defines. + * 11-10-10 02.00.17 Added ReceptacleID field (replacing Reserved1) to + * MPI2_MANPAGE7_CONNECTOR_INFO and reworked defines for + * the Pinout field. + * Added BoardTemperature and BoardTemperatureUnits fields + * to MPI2_CONFIG_PAGE_IO_UNIT_7. + * Added MPI2_CONFIG_EXTPAGETYPE_EXT_MANUFACTURING define + * and MPI2_CONFIG_PAGE_EXT_MAN_PS structure. * -------------------------------------------------------------------------- mpi2_init.h @@ -192,6 +255,9 @@ mpi2_init.h * both SCSI IO Error Reply and SCSI Task Management Reply. * Added ResponseInfo field to MPI2_SCSI_TASK_MANAGE_REPLY. * Added MPI2_SCSITASKMGMT_RSP_TM_OVERLAPPED_TAG define. + * 02-10-10 02.00.09 Removed unused structure that had "#if 0" around it. + * 05-12-10 02.00.10 Added optional vendor-unique region to SCSI IO Request. + * 11-10-10 02.00.11 Added MPI2_SCSIIO_NUM_SGLOFFSETS define. * -------------------------------------------------------------------------- mpi2_ioc.h @@ -280,6 +346,12 @@ mpi2_ioc.h * (MPI2_FW_HEADER_PID_). * Modified values for SAS ProductID Family * (MPI2_FW_HEADER_PID_FAMILY_). + * 02-10-10 02.00.14 Added SAS Quiesce Event structure and defines. + * Added PowerManagementControl Request structures and + * defines. + * 05-12-10 02.00.15 Marked Task Set Full Event as obsolete. + * Added MPI2_EVENT_SAS_TOPO_LR_UNSUPPORTED_PHY define. + * 11-10-10 02.00.16 Added MPI2_FW_DOWNLOAD_ITYPE_MIN_PRODUCT_SPECIFIC. * -------------------------------------------------------------------------- mpi2_raid.h @@ -292,6 +364,7 @@ mpi2_raid.h * can be sized by the build environment. * 07-30-09 02.00.04 Added proper define for the Use Default Settings bit of * VolumeCreationFlags and marked the old one as obsolete. + * 05-12-10 02.00.05 Added MPI2_RAID_VOL_FLAGS_OP_MDC define. * -------------------------------------------------------------------------- mpi2_sas.h @@ -302,6 +375,8 @@ mpi2_sas.h * Request. * 10-28-09 02.00.03 Changed the type of SGL in MPI2_SATA_PASSTHROUGH_REQUEST * to MPI2_SGE_IO_UNION since it supports chained SGLs. + * 05-12-10 02.00.04 Modified some comments. + * 08-11-10 02.00.05 Added NCQ operations to SAS IO Unit Control. * -------------------------------------------------------------------------- mpi2_targ.h @@ -313,6 +388,7 @@ mpi2_targ.h * MPI2_TARGET_CMD_BUF_POST_BASE_REQUEST. * Target Status Send Request only takes a single SGE for * response data. + * 02-10-10 02.00.04 Added comment to MPI2_TARGET_SSP_RSP_IU structure. * -------------------------------------------------------------------------- mpi2_tool.h @@ -325,6 +401,9 @@ mpi2_tool.h * and reply messages. * Added MPI2_DIAG_BUF_TYPE_EXTENDED. * Incremented MPI2_DIAG_BUF_TYPE_COUNT. + * 05-12-10 02.00.05 Added Diagnostic Data Upload tool. + * 08-11-10 02.00.06 Added defines that were missing for Diagnostic Buffer + * Post Request. * -------------------------------------------------------------------------- mpi2_type.h @@ -337,24 +416,40 @@ mpi2_ra.h mpi2_hbd.h * 10-28-09 02.00.00 Initial version. + * 08-11-10 02.00.01 Removed PortGroups, DmaGroup, and ControlGroup from + * HBD Action request, replaced by AdditionalInfo field. * -------------------------------------------------------------------------- mpi2_history.txt Parts list history -Filename 02.00.14 02.00.13 02.00.12 ----------- -------- -------- -------- -mpi2.h 02.00.14 02.00.13 02.00.12 -mpi2_cnfg.h 02.00.13 02.00.12 02.00.11 -mpi2_init.h 02.00.08 02.00.07 02.00.07 -mpi2_ioc.h 02.00.13 02.00.12 02.00.11 -mpi2_raid.h 02.00.04 02.00.04 02.00.03 -mpi2_sas.h 02.00.03 02.00.02 02.00.02 -mpi2_targ.h 02.00.03 02.00.03 02.00.03 -mpi2_tool.h 02.00.04 02.00.04 02.00.03 -mpi2_type.h 02.00.00 02.00.00 02.00.00 -mpi2_ra.h 02.00.00 02.00.00 02.00.00 -mpi2_hbd.h 02.00.00 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Feb 2 21:04:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8E79106566B; Thu, 2 Feb 2012 21:04:24 +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 B74AF8FC16; Thu, 2 Feb 2012 21:04:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q12L4OUT054132; Thu, 2 Feb 2012 21:04:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q12L4OJ8054130; Thu, 2 Feb 2012 21:04:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202022104.q12L4OJ8054130@svn.freebsd.org> From: Adrian Chadd Date: Thu, 2 Feb 2012 21:04: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: r230923 - head/tools/tools/ath/athradar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 21:04:24 -0000 Author: adrian Date: Thu Feb 2 21:04:24 2012 New Revision: 230923 URL: http://svn.freebsd.org/changeset/base/230923 Log: Add some missing radar config parameters to athradar. Modified: head/tools/tools/ath/athradar/athradar.c Modified: head/tools/tools/ath/athradar/athradar.c ============================================================================== --- head/tools/tools/ath/athradar/athradar.c Thu Feb 2 19:03:29 2012 (r230922) +++ head/tools/tools/ath/athradar/athradar.c Thu Feb 2 21:04:24 2012 (r230923) @@ -207,6 +207,12 @@ radar_set_param(struct radarhandler *rad radarset(radar, DFS_PARAM_RELSTEP, v); } else if (strcmp(param, "maxlen") == 0) { radarset(radar, DFS_PARAM_MAXLEN, v); + } else if (strcmp(param, "usefir128") == 0) { + radarset(radar, DFS_PARAM_USEFIR128, v); + } else if (strcmp(param, "blockradar") == 0) { + radarset(radar, DFS_PARAM_BLOCKRADAR, v); + } else if (strcmp(param, "enmaxrssi") == 0) { + radarset(radar, DFS_PARAM_MAXRSSI_EN, v); } else if (strcmp(param, "extchannel") == 0) { radarset(radar, DFS_PARAM_EN_EXTCH, v); } else { From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 01:36:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77CB0106566B; Fri, 3 Feb 2012 01:36:03 +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 64E588FC0C; Fri, 3 Feb 2012 01:36:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q131a3cj064168; Fri, 3 Feb 2012 01:36:03 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q131a3wA064162; Fri, 3 Feb 2012 01:36:03 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201202030136.q131a3wA064162@svn.freebsd.org> From: Jack F Vogel Date: Fri, 3 Feb 2012 01:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230924 - in stable/8/sys: conf dev/ixgbe modules/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 01:36:03 -0000 Author: jfv Date: Fri Feb 3 01:36:02 2012 New Revision: 230924 URL: http://svn.freebsd.org/changeset/base/230924 Log: MFC of the latest ixgbe driver. Revisions included: 209602,209603,209607,209609,209622,215911, 215913,215914,215924,217129,217556,222588, 222592,225405,229767,230329,230775,230790 Modified: stable/8/sys/conf/files stable/8/sys/dev/ixgbe/LICENSE stable/8/sys/dev/ixgbe/README stable/8/sys/dev/ixgbe/ixgbe.c stable/8/sys/dev/ixgbe/ixgbe.h stable/8/sys/dev/ixgbe/ixgbe_82598.c stable/8/sys/dev/ixgbe/ixgbe_82599.c stable/8/sys/dev/ixgbe/ixgbe_api.c stable/8/sys/dev/ixgbe/ixgbe_api.h stable/8/sys/dev/ixgbe/ixgbe_common.c stable/8/sys/dev/ixgbe/ixgbe_common.h stable/8/sys/dev/ixgbe/ixgbe_mbx.c stable/8/sys/dev/ixgbe/ixgbe_mbx.h stable/8/sys/dev/ixgbe/ixgbe_osdep.h stable/8/sys/dev/ixgbe/ixgbe_phy.c stable/8/sys/dev/ixgbe/ixgbe_phy.h stable/8/sys/dev/ixgbe/ixgbe_type.h stable/8/sys/dev/ixgbe/ixgbe_vf.c stable/8/sys/dev/ixgbe/ixgbe_vf.h stable/8/sys/dev/ixgbe/ixv.c stable/8/sys/dev/ixgbe/ixv.h stable/8/sys/modules/ixgbe/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Thu Feb 2 21:04:24 2012 (r230923) +++ stable/8/sys/conf/files Fri Feb 3 01:36:02 2012 (r230924) @@ -1263,7 +1263,9 @@ dev/ixgbe/ixgbe_82598.c optional ixgbe compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_82599.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/jme/if_jme.c optional jme pci inet +dev/ixgbe/ixgbe_x540.c optional ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/jme/if_jme.c optional jme pci dev/joy/joy.c optional joy dev/joy/joy_isa.c optional joy isa dev/joy/joy_pccard.c optional joy pccard Modified: stable/8/sys/dev/ixgbe/LICENSE ============================================================================== --- stable/8/sys/dev/ixgbe/LICENSE Thu Feb 2 21:04:24 2012 (r230923) +++ stable/8/sys/dev/ixgbe/LICENSE Fri Feb 3 01:36:02 2012 (r230924) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2011, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: stable/8/sys/dev/ixgbe/README ============================================================================== --- stable/8/sys/dev/ixgbe/README Thu Feb 2 21:04:24 2012 (r230923) +++ stable/8/sys/dev/ixgbe/README Fri Feb 3 01:36:02 2012 (r230924) @@ -1,8 +1,8 @@ -FreeBSD Driver for 10 Gigabit PCI Express Server Adapters -============================================= +FreeBSD Driver for Intel(R) Ethernet 10 Gigabit PCI Express Server Adapters +============================================================================ /*$FreeBSD$*/ -May 14, 2008 +November 12, 2010 Contents @@ -11,15 +11,15 @@ Contents - Overview - Supported Adapters - Building and Installation -- Additional Configurations +- Additional Configurations and Tuning - Known Limitations Overview ======== -This file describes the FreeBSD* driver for the 10 Gigabit PCIE Family of -Adapters. Drivers has been developed for use with FreeBSD 7 or later. +This file describes the FreeBSD* driver for the Intel(R) Ethernet 10 Gigabit +Family of Adapters. Driver has been developed for use with FreeBSD 7.2 or later. For questions related to hardware requirements, refer to the documentation supplied with your Intel 10GbE adapter. All hardware requirements listed @@ -29,100 +29,98 @@ apply to use with FreeBSD. Supported Adapters ================== -The following Intel network adapters are compatible with the drivers in this -release: - -Controller Adapter Name Physical Layer ----------- ------------ -------------- -82598EB Intel(R) 10 Gigabit XF SR/AF 10G Base -LR (850 nm optical fiber) - Dual Port Server Adapter 10G Base -SR (1310 nm optical fiber) -82598EB Intel(R) 10 Gigabit XF SR/LR - Server Adapter - Intel(R) 82598EB 10 Gigabit AF - Network Connection - Intel(R) 82598EB 10 Gigabit AT - CX4 Network Connection +The driver in this release is compatible with 82598 and 82599-based Intel +Network Connections. +SFP+ Devices with Pluggable Optics +---------------------------------- -Building and Installation -========================= - -NOTE: You must have kernel sources installed in order to compile the driver - module. - - In the instructions below, x.x.x is the driver version as indicated in - the name of the driver tar. - -1. Move the base driver tar file to the directory of your choice. For - example, use /home/username/ixgbe or /usr/local/src/ixgbe. - -2. Untar/unzip the archive: - tar xfz ixgbe-x.x.x.tar.gz - -3. To install man page: - cd ixgbe-x.x.x - gzip -c ixgbe.4 > /usr/share/man/man4/ixgbee.4.gz - -4. To load the driver onto a running system: - cd ixgbe-x.x.x/src - make load - -5. To assign an IP address to the interface, enter the following: - ifconfig ix - -6. Verify that the interface works. Enter the following, where - is the IP address for another machine on the same subnet as the interface - that is being tested: - ping - -7. If you want the driver to load automatically when the system is booted: - - cd ixgbe-x.x.x/src - make - make install - - Edit /boot/loader.conf, and add the following line: - ixgbe_load="YES" - - OR - - compile the driver into the kernel (see item 8). - - - Edit /etc/rc.conf, and create the appropriate ifconfig_ixgbe - entry: - - ifconfig_ix="" - - Example usage: - - ifconfig_ix0="inet 192.168.10.1 netmask 255.255.255.0" - - NOTE: For assistance, see the ifconfig man page. - -8. If you want to compile the driver into the kernel, enter: +82599-BASED ADAPTERS - FreeBSD 7 or later: +NOTE: If your 82599-based Intel(R) Ethernet Network Adapter came with Intel +optics, or is an Intel(R) Ethernet Server Adapter X520-2, then it only supports +Intel optics and/or the direct attach cables listed below. - cd ixgbe-x.x.x/src - - cp *.[ch] /usr/src/sys/dev/ixgbe - - cp Makefile.kernel /usr/src/sys/modules/ixgbe/Makefile - - Edit the kernel configuration file (i.e., GENERIC or MYKERNEL) in - /usr/src/sys/i386/conf (replace "i386" with the appropriate system - architecture if necessary), and ensure the following line is present: - - device ixgbe - - Compile and install the kernel. The system must be reboot for the kernel - updates to take affect. For additional information on compiling the kernel, - consult the FreeBSD operating system documentation. +When 82599-based SFP+ devices are connected back to back, they should be set to +the same Speed setting via Ethtool. Results may vary if you mix speed settings. + +Supplier Type Part Numbers +SR Modules +Intel DUAL RATE 1G/10G SFP+ SR (bailed) FTLX8571D3BCV-IT +Intel DUAL RATE 1G/10G SFP+ SR (bailed) AFBR-703SDZ-IN2 +Intel DUAL RATE 1G/10G SFP+ SR (bailed) AFBR-703SDDZ-IN1 +LR Modules +Intel DUAL RATE 1G/10G SFP+ LR (bailed) FTLX1471D3BCV-IT +Intel DUAL RATE 1G/10G SFP+ LR (bailed) AFCT-701SDZ-IN2 +Intel DUAL RATE 1G/10G SFP+ LR (bailed) AFCT-701SDDZ-IN1 + +The following is a list of 3rd party SFP+ modules and direct attach cables that +have received some testing. Not all modules are applicable to all devices. + +Supplier Type Part Numbers + +Finisar SFP+ SR bailed, 10g single rate FTLX8571D3BCL +Avago SFP+ SR bailed, 10g single rate AFBR-700SDZ +Finisar SFP+ LR bailed, 10g single rate FTLX8571D3BCV-IT + +Finisar DUAL RATE 1G/10G SFP+ SR (No Bail) FTLX8571D3QCV-IT +Avago DUAL RATE 1G/10G SFP+ SR (No Bail) AFBR-703SDZ-IN1 +Finisar DUAL RATE 1G/10G SFP+ LR (No Bail) FTLX1471D3QCV-IT +Avago DUAL RATE 1G/10G SFP+ LR (No Bail) AFCT-701SDZ-IN1 +Finistar 1000BASE-T SFP FCLF8522P2BTL +Avago 1000BASE-T SFP ABCU-5710RZ + +82599-based adapters support all passive and active limiting direct attach +cables that comply with SFF-8431 v4.1 and SFF-8472 v10.4 specifications. + +Laser turns off for SFP+ when ifconfig down +-------------------------------------------------------- +"ifconfig down" turns off the laser for 82599-based SFP+ fiber adapters. +"ifconfig up" turns on the later. + +82598-BASED ADAPTERS + +NOTES for 82598-Based Adapters: +- Intel(R) Ethernet Network Adapters that support removable optical modules + only support their original module type (i.e., the Intel(R) 10 Gigabit SR + Dual Port Express Module only supports SR optical modules). If you plug + in a different type of module, the driver will not load. +- Hot Swapping/hot plugging optical modules is not supported. +- Only single speed, 10 gigabit modules are supported. +- LAN on Motherboard (LOMs) may support DA, SR, or LR modules. Other module + types are not supported. Please see your system documentation for details. + +The following is a list of 3rd party SFP+ modules and direct attach cables that have +received some testing. Not all modules are applicable to all devices. + +Supplier Type Part Numbers + +Finisar SFP+ SR bailed, 10g single rate FTLX8571D3BCL +Avago SFP+ SR bailed, 10g single rate AFBR-700SDZ +Finisar SFP+ LR bailed, 10g single rate FTLX1471D3BCL + +82598-based adapters support all passive direct attach cables that comply +with SFF-8431 v4.1 and SFF-8472 v10.4 specifications. Active direct attach +cables are not supported. + +Third party optic modules and cables referred to above are listed only for the +purpose of highlighting third party specifications and potential compatibility, +and are not recommendations or endorsements or sponsorship of any third party's +product by Intel. Intel is not endorsing or promoting products made by any +third party and the third party reference is provided only to share information +regarding certain optic modules and cables with the above specifications. There +may be other manufacturers or suppliers, producing or supplying optic modules +and cables with similar or matching descriptions. Customers must use their own +discretion and diligence to purchase optic modules and cables from any third +party of their choice. Customer are solely responsible for assessing the +suitability of the product and/or devices and for the selection of the vendor +for purchasing any product. INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL +DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF +SUCH THIRD PARTY PRODUCTS OR SELECTION OF VENDOR BY CUSTOMERS. Configuration and Tuning -========================= +======================== The driver supports Transmit/Receive Checksum Offload and Jumbo Frames on all 10 Gigabit adapters. @@ -143,7 +141,7 @@ all 10 Gigabit adapters. The Jumbo Frames MTU range for Intel Adapters is 1500 to 16114. The default MTU range is 1500. To modify the setting, enter the following: - ifconfig ix mtu 9000 + ifconfig ix mtu 9000 To confirm an interface's MTU value, use the ifconfig command. To confirm the MTU used between two specific devices, use: @@ -200,6 +198,8 @@ all 10 Gigabit adapters. TSO --- + TSO is enabled by default. + To disable: ifconfig -tso @@ -209,23 +209,21 @@ all 10 Gigabit adapters. ifconfig tso LRO - ___ + --- - Large Receive Offload is available in version 1.4.4, it is on - by default. It can be toggled off and on by using: - sysctl dev.ix.X.enable_lro=[0,1] - - NOTE: when changing this feature you MUST be sure the interface - is reinitialized, it is easy to do this with ifconfig down/up. - The LRO code will ultimately move into the kernel stack code, - but for this first release it was included with the driver. + Large Receive Offload is available in the driver; it is on by default. + It can be disabled by using: + ifconfig -lro + To enable: + ifconfig lro + Important system configuration changes: --------------------------------------- - When there is a choice run on a 64bit OS rather than 32, it makes - a significant difference in improvement. - + When there is a choice run on a 64bit OS rather than 32, it makes a + significant difference in improvement. + The default scheduler SCHED_4BSD is not smart about SMP locality issues. Significant improvement can be achieved by switching to the ULE scheduler. @@ -233,34 +231,79 @@ all 10 Gigabit adapters. SCHED_ULE. Note that this is only advisable on FreeBSD 7, on 6.X there have been stability problems with ULE. - Change the file /etc/sysctl.conf, add the line: + The interface can generate high number of interrupts. To avoid running + into the limit set by the kernel, adjust hw.intr_storm_threshold + setting using sysctl: - hw.intr_storm_threshold: 8000 (the default is 1000) + sysctl hw.intr_storm_threshold=9000 (the default is 1000) + + For this change to take effect on boot, edit /etc/sysctl.conf and add the + line: + hw.intr_storm_threshold=9000 + + If you still see Interrupt Storm detected messages, increase the limit to a + higher number. Best throughput results are seen with a large MTU; use 9000 if possible. - The default number of descriptors is 256, increasing this to 1024 or even - 2048 may improve performance. + The default number of descriptors is 1024, increasing this to 2K or even + 4K may improve performance in some workloads, but change carefully. Known Limitations ================= + +For known hardware and troubleshooting issues, refer to the following website. + + http://support.intel.com/support/go/network/adapter/home.htm + +Either select the link for your adapter or perform a search for the adapter +number. The adapter's page lists many issues. For a complete list of hardware +issues download your adapter's user guide and read the Release Notes. + + UDP stress test with 10GbE driver + --------------------------------- Under small packets UDP stress test with 10GbE driver, the FreeBSD system will drop UDP packets due to the fullness of socket buffers. You may want to change the driver's Flow Control variables to the minimum value for controlling packet reception. + Attempting to configure larger MTUs with a large numbers of processors may + generate the error message "ix0:could not setup receive structures" + -------------------------------------------------------------------------- + When using the ixgbe driver with RSS autoconfigured based on the number of + cores (the default setting) and that number is larger than 4, increase the + memory resources allocated for the mbuf pool as follows: + + Add to the sysctl.conf file for the system: + + kern.ipc.nmbclusters=262144 + kern.ipc.nmbjumbop=262144 + + Lower than expected performance on dual port 10GbE devices + ---------------------------------------------------------- + Some PCI-E x8 slots are actually configured as x4 slots. These slots have + insufficient bandwidth for full 10Gbe line rate with dual port 10GbE devices. + The driver can detect this situation and will write the following message in + the system log: "PCI-Express bandwidth available for this card is not + sufficient for optimal performance. For optimal performance a x8 PCI-Express + slot is required." + + If this error occurs, moving your adapter to a true x8 slot will resolve the + issue. + + Support ======= For general information and support, go to the Intel support website at: - http://support.intel.com + www.intel.com/support/ If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to -the issue to freebsd@intel.com. +the issue to freebsd@intel.com Modified: stable/8/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.c Thu Feb 2 21:04:24 2012 (r230923) +++ stable/8/sys/dev/ixgbe/ixgbe.c Fri Feb 3 01:36:02 2012 (r230924) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -34,6 +34,7 @@ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_inet.h" +#include "opt_inet6.h" #endif #include "ixgbe.h" @@ -46,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.3.10"; +char ixgbe_driver_version[] = "2.4.5"; /********************************************************************* * PCI Device ID Table @@ -80,6 +81,8 @@ static ixgbe_vendor_info_t ixgbe_vendor_ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BACKPLANE_FCOE, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} }; @@ -152,6 +155,7 @@ static void ixgbe_refresh_mbufs(struct r static int ixgbe_xmit(struct tx_ring *, struct mbuf **); static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS); static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS); +static int ixgbe_set_thermal_test(SYSCTL_HANDLER_ARGS); static int ixgbe_dma_malloc(struct adapter *, bus_size_t, struct ixgbe_dma_alloc *, int); static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); @@ -318,7 +322,7 @@ static int fdir_pballoc = 1; * ixgbe_probe determines if the driver should be loaded on * adapter based on PCI vendor/device id of the adapter. * - * return 0 on success, positive on failure + * return BUS_PROBE_DEFAULT on success, positive on failure *********************************************************************/ static int @@ -357,7 +361,7 @@ ixgbe_probe(device_t dev) ixgbe_driver_version); device_set_desc_copy(dev, adapter_name); ++ixgbe_total_ports; - return (0); + return (BUS_PROBE_DEFAULT); } ent++; } @@ -385,6 +389,11 @@ ixgbe_attach(device_t dev) INIT_DEBUGOUT("ixgbe_attach: begin"); + if (resource_disabled("ixgbe", device_get_unit(dev))) { + device_printf(dev, "Disabled by device hint\n"); + return (ENXIO); + } + /* Allocate, clear, and link in our adapter structure */ adapter = device_get_softc(dev); adapter->dev = adapter->osdep.dev = dev; @@ -397,7 +406,7 @@ ixgbe_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "flow_control", CTLTYPE_INT | CTLFLAG_RW, + OID_AUTO, "fc", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_set_flowcntl, "I", "Flow Control"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), @@ -410,6 +419,21 @@ ixgbe_attach(device_t dev) OID_AUTO, "enable_aim", CTLTYPE_INT|CTLFLAG_RW, &ixgbe_enable_aim, 1, "Interrupt Moderation"); + /* + ** Allow a kind of speed control by forcing the autoneg + ** advertised speed list to only a certain value, this + ** supports 1G on 82599 devices, and 100Mb on x540. + */ + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "advertise_speed", CTLTYPE_INT | CTLFLAG_RW, + adapter, 0, ixgbe_set_advertise, "I", "Link Speed"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "ts", CTLTYPE_INT | CTLFLAG_RW, adapter, + 0, ixgbe_set_thermal_test, "I", "Thermal Test"); + /* Set up the timer callout */ callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0); @@ -497,9 +521,10 @@ ixgbe_attach(device_t dev) /* Get Hardware Flow Control setting */ hw->fc.requested_mode = ixgbe_fc_full; + adapter->fc = hw->fc.requested_mode; hw->fc.pause_time = IXGBE_FC_PAUSE; hw->fc.low_water = IXGBE_FC_LO; - hw->fc.high_water = IXGBE_FC_HI; + hw->fc.high_water[0] = IXGBE_FC_HI; hw->fc.send_xon = TRUE; error = ixgbe_init_hw(hw); @@ -700,16 +725,20 @@ ixgbe_start_locked(struct tx_ring *txr, return; while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { + if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE) { + txr->queue_status |= IXGBE_QUEUE_DEPLETED; + break; + } IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; if (ixgbe_xmit(txr, &m_head)) { - if (m_head == NULL) - break; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + if (m_head != NULL) + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE) + txr->queue_status |= IXGBE_QUEUE_DEPLETED; break; } /* Send a copy of the frame to the BPF listener */ @@ -758,11 +787,14 @@ ixgbe_mq_start(struct ifnet *ifp, struct /* Which queue to use */ if ((m->m_flags & M_FLOWID) != 0) i = m->m_pkthdr.flowid % adapter->num_queues; + else + i = curcpu % adapter->num_queues; txr = &adapter->tx_rings[i]; que = &adapter->queues[i]; - if (IXGBE_TX_TRYLOCK(txr)) { + if (((txr->queue_status & IXGBE_QUEUE_DEPLETED) == 0) && + IXGBE_TX_TRYLOCK(txr)) { err = ixgbe_mq_start_locked(ifp, txr, m); IXGBE_TX_UNLOCK(txr); } else { @@ -780,13 +812,18 @@ ixgbe_mq_start_locked(struct ifnet *ifp, struct mbuf *next; int enqueued, err = 0; - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || adapter->link_active == 0) { + if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) || + (txr->queue_status == IXGBE_QUEUE_DEPLETED) || + adapter->link_active == 0) { if (m != NULL) err = drbr_enqueue(ifp, txr->br, m); return (err); } + /* Call cleanup if number of TX descriptors low */ + if (txr->tx_avail <= IXGBE_TX_CLEANUP_THRESHOLD) + ixgbe_txeof(txr); + enqueued = 0; if (m == NULL) { next = drbr_dequeue(ifp, txr->br); @@ -813,7 +850,7 @@ ixgbe_mq_start_locked(struct ifnet *ifp, if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) ixgbe_txeof(txr); if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + txr->queue_status |= IXGBE_QUEUE_DEPLETED; break; } next = drbr_dequeue(ifp, txr->br); @@ -821,10 +858,13 @@ ixgbe_mq_start_locked(struct ifnet *ifp, if (enqueued > 0) { /* Set watchdog on */ - txr->queue_status = IXGBE_QUEUE_WORKING; + txr->queue_status |= IXGBE_QUEUE_WORKING; txr->watchdog_time = ticks; } + if (txr->tx_avail < IXGBE_TX_CLEANUP_THRESHOLD) + ixgbe_txeof(txr); + return (err); } @@ -862,8 +902,9 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c { struct adapter *adapter = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; -#ifdef INET +#if defined(INET) || defined(INET6) struct ifaddr *ifa = (struct ifaddr *)data; + bool avoid_reset = FALSE; #endif int error = 0; @@ -871,26 +912,28 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c case SIOCSIFADDR: #ifdef INET - if (ifa->ifa_addr->sa_family == AF_INET) { - /* - * Since resetting hardware takes a very long time - * and results in link renegotiation we only - * initialize the hardware only when it is absolutely - * required. - */ + if (ifa->ifa_addr->sa_family == AF_INET) + avoid_reset = TRUE; +#endif +#ifdef INET6 + if (ifa->ifa_addr->sa_family == AF_INET6) + avoid_reset = TRUE; +#endif +#if defined(INET) || defined(INET6) + /* + ** Calling init results in link renegotiation, + ** so we avoid doing it when possible. + */ + if (avoid_reset) { ifp->if_flags |= IFF_UP; - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - IXGBE_CORE_LOCK(adapter); - ixgbe_init_locked(adapter); - IXGBE_CORE_UNLOCK(adapter); - } + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + ixgbe_init(adapter); if (!(ifp->if_flags & IFF_NOARP)) arp_ifinit(ifp, ifa); } else -#endif error = ether_ioctl(ifp, command, data); +#endif break; - case SIOCSIFMTU: IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)"); if (ifr->ifr_mtu > IXGBE_MAX_FRAME_SIZE - ETHER_HDR_LEN) { @@ -951,6 +994,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; if (mask & IFCAP_VLAN_HWFILTER) ifp->if_capenable ^= IFCAP_VLAN_HWFILTER; + if (mask & IFCAP_VLAN_HWTSO) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { IXGBE_CORE_LOCK(adapter); ixgbe_init_locked(adapter); @@ -1058,10 +1103,14 @@ ixgbe_init_locked(struct adapter *adapte /* Enable Fan Failure Interrupt */ gpie |= IXGBE_SDP1_GPIEN; - /* Add for Thermal detection */ + /* Add for Module detection */ if (hw->mac.type == ixgbe_mac_82599EB) gpie |= IXGBE_SDP2_GPIEN; + /* Thermal Failure Detection */ + if (hw->mac.type == ixgbe_mac_X540) + gpie |= IXGBE_SDP0_GPIEN; + if (adapter->msix > 1) { /* Enable Enhanced MSIX mode */ gpie |= IXGBE_GPIE_MSIX_MODE; @@ -1142,8 +1191,12 @@ ixgbe_init_locked(struct adapter *adapte #ifdef IXGBE_FDIR /* Init Flow director */ - if (hw->mac.type != ixgbe_mac_82598EB) + if (hw->mac.type != ixgbe_mac_82598EB) { + u32 hdrm = 64 << fdir_pballoc; + + hw->mac.ops.setup_rxpba(hw, 0, hdrm, PBA_STRATEGY_EQUAL); ixgbe_init_fdir_signature_82599(&adapter->hw, fdir_pballoc); + } #endif /* @@ -1271,7 +1324,7 @@ ixgbe_handle_que(void *context, int pend ixgbe_start_locked(txr, ifp); #endif IXGBE_TX_UNLOCK(txr); - if (more) { + if (more || (ifp->if_drv_flags & IFF_DRV_OACTIVE)) { taskqueue_enqueue(que->tq, &que->que_task); return; } @@ -1338,7 +1391,7 @@ ixgbe_legacy_irq(void *arg) /********************************************************************* * - * MSI Queue Interrupt Service routine + * MSIX Queue Interrupt Service routine * **********************************************************************/ void @@ -1351,12 +1404,24 @@ ixgbe_msix_que(void *arg) bool more_tx, more_rx; u32 newitr = 0; + ixgbe_disable_queue(adapter, que->msix); ++que->irqs; more_rx = ixgbe_rxeof(que, adapter->rx_process_limit); IXGBE_TX_LOCK(txr); more_tx = ixgbe_txeof(txr); + /* + ** Make certain that if the stack + ** has anything queued the task gets + ** scheduled to handle it. + */ +#if __FreeBSD_version < 800000 + if (!IFQ_DRV_IS_EMPTY(&adapter->ifp->if_snd)) +#else + if (!drbr_empty(adapter->ifp, txr->br)) +#endif + more_tx = 1; IXGBE_TX_UNLOCK(txr); /* Do AIM now? */ @@ -1474,6 +1539,15 @@ ixgbe_msix_link(void *arg) IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1); } + /* Check for over temp condition */ + if ((hw->mac.type == ixgbe_mac_X540) && + (reg_eicr & IXGBE_EICR_GPI_SDP0)) { + device_printf(adapter->dev, "\nCRITICAL: OVER TEMP!! " + "PHY IS SHUT DOWN!!\n"); + device_printf(adapter->dev, "System shutdown required\n"); + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP0); + } + IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); return; } @@ -1506,6 +1580,9 @@ ixgbe_media_status(struct ifnet * ifp, s ifmr->ifm_status |= IFM_ACTIVE; switch (adapter->link_speed) { + case IXGBE_LINK_SPEED_100_FULL: + ifmr->ifm_active |= IFM_100_TX | IFM_FDX; + break; case IXGBE_LINK_SPEED_1GB_FULL: ifmr->ifm_active |= IFM_1000_T | IFM_FDX; break; @@ -1541,7 +1618,9 @@ ixgbe_media_change(struct ifnet * ifp) switch (IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: adapter->hw.phy.autoneg_advertised = - IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_10GB_FULL; + IXGBE_LINK_SPEED_100_FULL | + IXGBE_LINK_SPEED_1GB_FULL | + IXGBE_LINK_SPEED_10GB_FULL; break; default: device_printf(adapter->dev, "Only auto media type\n"); @@ -1570,7 +1649,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m struct mbuf *m_head; bus_dma_segment_t segs[adapter->num_segs]; bus_dmamap_t map; - struct ixgbe_tx_buf *txbuf, *txbuf_mapped; + struct ixgbe_tx_buf *txbuf; union ixgbe_adv_tx_desc *txd = NULL; m_head = *m_headp; @@ -1589,7 +1668,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m */ first = txr->next_avail_desc; txbuf = &txr->tx_buffers[first]; - txbuf_mapped = txbuf; map = txbuf->map; /* @@ -1708,6 +1786,8 @@ ixgbe_xmit(struct tx_ring *txr, struct m txr->next_avail_desc = i; txbuf->m_head = m_head; + /* Swap the dma map between the first and last descriptor */ + txr->tx_buffers[first].map = txbuf->map; txbuf->map = map; bus_dmamap_sync(txr->txtag, map, BUS_DMASYNC_PREWRITE); @@ -1812,7 +1892,7 @@ ixgbe_set_multi(struct adapter *adapter) update_ptr = mta; ixgbe_update_mc_addr_list(&adapter->hw, - update_ptr, mcnt, ixgbe_mc_array_itr); + update_ptr, mcnt, ixgbe_mc_array_itr, TRUE); return; } @@ -1846,11 +1926,15 @@ ixgbe_mc_array_itr(struct ixgbe_hw *hw, static void ixgbe_local_timer(void *arg) { - struct adapter *adapter = arg; + struct adapter *adapter = arg; device_t dev = adapter->dev; - struct tx_ring *txr = adapter->tx_rings; + struct ifnet *ifp = adapter->ifp; + struct ix_queue *que = adapter->queues; + struct tx_ring *txr = adapter->tx_rings; + int hung, busy, paused; mtx_assert(&adapter->core_mtx, MA_OWNED); + hung = busy = paused = 0; /* Check for pluggable optics */ if (adapter->sfp_probe) @@ -1865,21 +1949,38 @@ ixgbe_local_timer(void *arg) * then don't do the watchdog check */ if (IXGBE_READ_REG(&adapter->hw, IXGBE_TFCS) & IXGBE_TFCS_TXOFF) - goto out; + paused = 1; /* - ** Check status on the TX queues for a hang - */ - for (int i = 0; i < adapter->num_queues; i++, txr++) - if (txr->queue_status == IXGBE_QUEUE_HUNG) - goto hung; + ** Check the TX queues status + ** - central locked handling of OACTIVE + ** - watchdog only if all queues show hung + */ + for (int i = 0; i < adapter->num_queues; i++, que++, txr++) { + if ((txr->queue_status & IXGBE_QUEUE_HUNG) && + (paused == 0)) + ++hung; + if (txr->queue_status & IXGBE_QUEUE_DEPLETED) + ++busy; + if ((txr->queue_status & IXGBE_QUEUE_IDLE) == 0) + taskqueue_enqueue(que->tq, &que->que_task); + } + /* Only truely watchdog if all queues show hung */ + if (hung == adapter->num_queues) + goto watchdog; + /* Only turn off the stack flow when ALL are depleted */ + if (busy == adapter->num_queues) + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + else if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) && + (busy < adapter->num_queues)) + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; out: ixgbe_rearm_queues(adapter, adapter->que_mask); callout_reset(&adapter->timer, hz, ixgbe_local_timer, adapter); return; -hung: +watchdog: device_printf(adapter->dev, "Watchdog timeout -- resetting\n"); device_printf(dev,"Queue(%d) tdh = %d, hw tdt = %d\n", txr->me, IXGBE_READ_REG(&adapter->hw, IXGBE_TDH(txr->me)), @@ -1949,9 +2050,11 @@ ixgbe_stop(void *arg) INIT_DEBUGOUT("ixgbe_stop: begin\n"); ixgbe_disable_intr(adapter); + callout_stop(&adapter->timer); - /* Tell the stack that the interface is no longer active */ - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + /* Let the stack know...*/ + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; ixgbe_reset_hw(hw); hw->adapter_stopped = FALSE; @@ -1959,7 +2062,6 @@ ixgbe_stop(void *arg) /* Turn off the laser */ if (hw->phy.multispeed_fiber) ixgbe_disable_tx_laser(hw); - callout_stop(&adapter->timer); /* reprogram the RAR[0] in case user changed it. */ ixgbe_set_rar(&adapter->hw, 0, adapter->hw.mac.addr, 0, IXGBE_RAH_AV); @@ -2013,35 +2115,41 @@ ixgbe_setup_optics(struct adapter *adapt int layer; layer = ixgbe_get_supported_physical_layer(hw); - switch (layer) { - case IXGBE_PHYSICAL_LAYER_10GBASE_T: - adapter->optics = IFM_10G_T; - break; - case IXGBE_PHYSICAL_LAYER_1000BASE_T: - adapter->optics = IFM_1000_T; - break; - case IXGBE_PHYSICAL_LAYER_10GBASE_LR: - case IXGBE_PHYSICAL_LAYER_10GBASE_LRM: - adapter->optics = IFM_10G_LR; - break; - case IXGBE_PHYSICAL_LAYER_10GBASE_SR: - adapter->optics = IFM_10G_SR; - break; - case IXGBE_PHYSICAL_LAYER_10GBASE_KX4: - case IXGBE_PHYSICAL_LAYER_10GBASE_CX4: - adapter->optics = IFM_10G_CX4; - break; - case IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU: - adapter->optics = IFM_10G_TWINAX; - break; - case IXGBE_PHYSICAL_LAYER_1000BASE_KX: - case IXGBE_PHYSICAL_LAYER_10GBASE_KR: - case IXGBE_PHYSICAL_LAYER_10GBASE_XAUI: - case IXGBE_PHYSICAL_LAYER_UNKNOWN: - default: - adapter->optics = IFM_ETHER | IFM_AUTO; - break; + + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) { + adapter->optics = IFM_10G_T; + return; + } + + if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_T) { + adapter->optics = IFM_1000_T; + return; + } + + if (layer & (IXGBE_PHYSICAL_LAYER_10GBASE_LR | + IXGBE_PHYSICAL_LAYER_10GBASE_LRM)) { + adapter->optics = IFM_10G_LR; + return; + } + + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_SR) { + adapter->optics = IFM_10G_SR; + return; + } + + if (layer & IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU) { + adapter->optics = IFM_10G_TWINAX; + return; + } + + if (layer & (IXGBE_PHYSICAL_LAYER_10GBASE_KX4 | + IXGBE_PHYSICAL_LAYER_10GBASE_CX4)) { + adapter->optics = IFM_10G_CX4; + return; } + + /* If we get here just set the default */ + adapter->optics = IFM_ETHER | IFM_AUTO; return; } @@ -2265,7 +2373,9 @@ ixgbe_setup_msix(struct adapter *adapter msi: msgs = pci_msi_count(dev); if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0) - device_printf(adapter->dev,"Using MSI interrupt\n"); + device_printf(adapter->dev,"Using an MSI interrupt\n"); + else + device_printf(adapter->dev,"Using a Legacy interrupt\n"); return (msgs); } @@ -2412,19 +2522,21 @@ ixgbe_setup_interface(device_t dev, stru ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO4 | IFCAP_VLAN_HWCSUM; - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; ifp->if_capabilities |= IFCAP_JUMBO_MTU; + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING + | IFCAP_VLAN_HWTSO + | IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; /* Don't enable LRO by default */ ifp->if_capabilities |= IFCAP_LRO; /* - ** Dont turn this on by default, if vlans are + ** Don't turn this on by default, if vlans are ** created on another pseudo device (eg. lagg) ** then vlan events are not passed thru, breaking ** operation, but with HW FILTER off it works. If - ** using vlans directly on the em driver you can + ** using vlans directly on the ixgbe driver you can ** enable this and get full hardware tag filtering. */ ifp->if_capabilities |= IFCAP_VLAN_HWFILTER; @@ -2876,6 +2988,7 @@ ixgbe_initialize_transmit_units(struct a txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i)); break; case ixgbe_mac_82599EB: + case ixgbe_mac_X540: default: txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i)); break; @@ -2886,6 +2999,7 @@ ixgbe_initialize_transmit_units(struct a IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), txctrl); break; case ixgbe_mac_82599EB: + case ixgbe_mac_X540: default: IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(i), txctrl); break; @@ -3371,18 +3485,13 @@ ixgbe_txeof(struct tx_ring *txr) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 02:06:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D7BD106566B; Fri, 3 Feb 2012 02:06:15 +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 02E598FC14; Fri, 3 Feb 2012 02:06:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1326EWr065153; Fri, 3 Feb 2012 02:06:14 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1326EER065151; Fri, 3 Feb 2012 02:06:14 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201202030206.q1326EER065151@svn.freebsd.org> From: Rui Paulo Date: Fri, 3 Feb 2012 02:06: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: r230926 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 02:06:15 -0000 Author: rpaulo Date: Fri Feb 3 02:06:14 2012 New Revision: 230926 URL: http://svn.freebsd.org/changeset/base/230926 Log: Whitespace removal. Modified: head/sys/net80211/ieee80211_mesh.c Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Fri Feb 3 01:59:16 2012 (r230925) +++ head/sys/net80211/ieee80211_mesh.c Fri Feb 3 02:06:14 2012 (r230926) @@ -442,19 +442,19 @@ ieee80211_mesh_init(void) ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC, IEEE80211_ACTION_MESHLMETRIC_REP, mesh_recv_action_meshlmetric_rep); - ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING, + ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING, IEEE80211_ACTION_MESHPEERING_OPEN, mesh_send_action_meshpeering_open); - ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING, + ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING, IEEE80211_ACTION_MESHPEERING_CONFIRM, mesh_send_action_meshpeering_confirm); - ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING, + ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING, IEEE80211_ACTION_MESHPEERING_CLOSE, mesh_send_action_meshpeering_close); - ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC, + ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC, IEEE80211_ACTION_MESHLMETRIC_REQ, mesh_send_action_meshlink_request); - ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC, + ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC, IEEE80211_ACTION_MESHLMETRIC_REP, mesh_send_action_meshlink_reply); @@ -1934,10 +1934,10 @@ mesh_send_action_meshpeering_open(struct ic->ic_headroom + sizeof(struct ieee80211_frame), sizeof(uint16_t) /* action+category */ + sizeof(uint16_t) /* capabilites */ - + 2 + IEEE80211_RATE_SIZE - + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) + + 2 + IEEE80211_RATE_SIZE + + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) + 2 + IEEE80211_MESHID_LEN - + sizeof(struct ieee80211_meshconf_ie) + + sizeof(struct ieee80211_meshconf_ie) + sizeof(struct ieee80211_meshpeer_ie) ); if (m != NULL) { @@ -1997,10 +1997,10 @@ mesh_send_action_meshpeering_confirm(str + sizeof(uint16_t) /* capabilites */ + sizeof(uint16_t) /* status code */ + sizeof(uint16_t) /* AID */ - + 2 + IEEE80211_RATE_SIZE - + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) + + 2 + IEEE80211_RATE_SIZE + + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) + 2 + IEEE80211_MESHID_LEN - + sizeof(struct ieee80211_meshconf_ie) + + sizeof(struct ieee80211_meshconf_ie) + sizeof(struct ieee80211_meshpeer_ie) ); if (m != NULL) { @@ -2063,7 +2063,7 @@ mesh_send_action_meshpeering_close(struc sizeof(uint16_t) /* action+category */ + sizeof(uint16_t) /* reason code */ + 2 + IEEE80211_MESHID_LEN - + sizeof(struct ieee80211_meshpeer_ie) + + sizeof(struct ieee80211_meshpeer_ie) ); if (m != NULL) { /* From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 03:05:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 152EC1065674; Fri, 3 Feb 2012 03:05:42 +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 034F98FC13; Fri, 3 Feb 2012 03:05:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1335fGk067245; Fri, 3 Feb 2012 03:05:41 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1335fSN067243; Fri, 3 Feb 2012 03:05:41 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201202030305.q1335fSN067243@svn.freebsd.org> From: Rick Macklem Date: Fri, 3 Feb 2012 03:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230928 - stable/9/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 03:05:42 -0000 Author: rmacklem Date: Fri Feb 3 03:05:41 2012 New Revision: 230928 URL: http://svn.freebsd.org/changeset/base/230928 Log: MFC: r230345 Martin Cracauer reported a problem to freebsd-current@ under the subject "Data corruption over NFS in -current". During investigation of this, I came across an ugly bogusity in the new NFS client where it replaced the cr_uid with the one used for the mount. This was done so that "system operations" like the NFSv4 Renew would be performed as the user that did the mount. However, if any other thread shares the credential with the one doing this operation, it could do an RPC (or just about anything else) as the wrong cr_uid. This patch fixes the above, by using the mount credentials instead of the one provided as an argument for this case. It appears to have fixed Martin's problem. This patch is needed for NFSv4 mounts and NFSv3 mounts against some non-FreeBSD servers that do not put post operation attributes in the NFSv3 Statfs RPC reply. Tested by: cracauer at cons.org, dim Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonkrpc.c Fri Feb 3 02:15:59 2012 (r230927) +++ stable/9/sys/fs/nfs/nfs_commonkrpc.c Fri Feb 3 03:05:41 2012 (r230928) @@ -472,7 +472,7 @@ newnfs_request(struct nfsrv_descript *nd { u_int32_t *tl; time_t waituntil; - int i, j, set_uid = 0, set_sigset = 0, timeo; + int i, j, set_sigset = 0, timeo; int trycnt, error = 0, usegssname = 0, secflavour = AUTH_SYS; u_int16_t procnum; u_int trylater_delay = 1; @@ -483,8 +483,8 @@ newnfs_request(struct nfsrv_descript *nd enum clnt_stat stat; struct nfsreq *rep = NULL; char *srv_principal = NULL; - uid_t saved_uid = (uid_t)-1; sigset_t oldset; + struct ucred *authcred; if (xidp != NULL) *xidp = 0; @@ -494,6 +494,14 @@ newnfs_request(struct nfsrv_descript *nd return (ESTALE); } + /* + * Set authcred, which is used to acquire RPC credentials to + * the cred argument, by default. The crhold() should not be + * necessary, but will ensure that some future code change + * doesn't result in the credential being free'd prematurely. + */ + authcred = crhold(cred); + /* For client side interruptible mounts, mask off the signals. */ if (nmp != NULL && td != NULL && NFSHASINT(nmp)) { newnfs_set_sigmask(td, &oldset); @@ -532,13 +540,16 @@ newnfs_request(struct nfsrv_descript *nd /* * If there is a client side host based credential, * use that, otherwise use the system uid, if set. + * The system uid is in the nmp->nm_sockreq.nr_cred + * credentials. */ if (nmp->nm_krbnamelen > 0) { usegssname = 1; } else if (nmp->nm_uid != (uid_t)-1) { - saved_uid = cred->cr_uid; - cred->cr_uid = nmp->nm_uid; - set_uid = 1; + KASSERT(nmp->nm_sockreq.nr_cred != NULL, + ("newnfs_request: NULL nr_cred")); + crfree(authcred); + authcred = crhold(nmp->nm_sockreq.nr_cred); } } else if (nmp->nm_krbnamelen == 0 && nmp->nm_uid != (uid_t)-1 && cred->cr_uid == (uid_t)0) { @@ -547,10 +558,13 @@ newnfs_request(struct nfsrv_descript *nd * the system uid is set and this is root, use the * system uid, since root won't have user * credentials in a credentials cache file. + * The system uid is in the nmp->nm_sockreq.nr_cred + * credentials. */ - saved_uid = cred->cr_uid; - cred->cr_uid = nmp->nm_uid; - set_uid = 1; + KASSERT(nmp->nm_sockreq.nr_cred != NULL, + ("newnfs_request: NULL nr_cred")); + crfree(authcred); + authcred = crhold(nmp->nm_sockreq.nr_cred); } if (NFSHASINTEGRITY(nmp)) secflavour = RPCSEC_GSS_KRB5I; @@ -566,13 +580,13 @@ newnfs_request(struct nfsrv_descript *nd * Use the uid that did the mount when the RPC is doing * NFSv4 system operations, as indicated by the * ND_USEGSSNAME flag, for the AUTH_SYS case. + * The credentials in nm_sockreq.nr_cred were used for the + * mount. */ - saved_uid = cred->cr_uid; - if (nmp->nm_uid != (uid_t)-1) - cred->cr_uid = nmp->nm_uid; - else - cred->cr_uid = 0; - set_uid = 1; + KASSERT(nmp->nm_sockreq.nr_cred != NULL, + ("newnfs_request: NULL nr_cred")); + crfree(authcred); + authcred = crhold(nmp->nm_sockreq.nr_cred); } if (nmp != NULL) { @@ -588,12 +602,11 @@ newnfs_request(struct nfsrv_descript *nd auth = authnone_create(); else if (usegssname) auth = nfs_getauth(nrp, secflavour, nmp->nm_krbname, - srv_principal, NULL, cred); + srv_principal, NULL, authcred); else auth = nfs_getauth(nrp, secflavour, NULL, - srv_principal, NULL, cred); - if (set_uid) - cred->cr_uid = saved_uid; + srv_principal, NULL, authcred); + crfree(authcred); if (auth == NULL) { m_freem(nd->nd_mreq); if (set_sigset) From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 03:41:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BD24106564A; Fri, 3 Feb 2012 03:41:44 +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 3A01F8FC08; Fri, 3 Feb 2012 03:41:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q133fiRX068584; Fri, 3 Feb 2012 03:41:44 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q133fiDD068582; Fri, 3 Feb 2012 03:41:44 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201202030341.q133fiDD068582@svn.freebsd.org> From: Rick Macklem Date: Fri, 3 Feb 2012 03:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230930 - stable/8/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 03:41:44 -0000 Author: rmacklem Date: Fri Feb 3 03:41:43 2012 New Revision: 230930 URL: http://svn.freebsd.org/changeset/base/230930 Log: MFC: r230345 Martin Cracauer reported a problem to freebsd-current@ under the subject "Data corruption over NFS in -current". During investigation of this, I came across an ugly bogusity in the new NFS client where it replaced the cr_uid with the one used for the mount. This was done so that "system operations" like the NFSv4 Renew would be performed as the user that did the mount. However, if any other thread shares the credential with the one doing this operation, it could do an RPC (or just about anything else) as the wrong cr_uid. This patch fixes the above, by using the mount credentials instead of the one provided as an argument for this case. It appears to have fixed Martin's problem. This patch is needed for NFSv4 mounts and NFSv3 mounts against some non-FreeBSD servers that do not put post operation attributes in the NFSv3 Statfs RPC reply. Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonkrpc.c Fri Feb 3 03:11:08 2012 (r230929) +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c Fri Feb 3 03:41:43 2012 (r230930) @@ -449,7 +449,7 @@ newnfs_request(struct nfsrv_descript *nd { u_int32_t *tl; time_t waituntil; - int i, j, set_uid = 0, set_sigset = 0, timeo; + int i, j, set_sigset = 0, timeo; int trycnt, error = 0, usegssname = 0, secflavour = AUTH_SYS; u_int16_t procnum; u_int trylater_delay = 1; @@ -460,8 +460,8 @@ newnfs_request(struct nfsrv_descript *nd enum clnt_stat stat; struct nfsreq *rep = NULL; char *srv_principal = NULL; - uid_t saved_uid = (uid_t)-1; sigset_t oldset; + struct ucred *authcred; if (xidp != NULL) *xidp = 0; @@ -471,6 +471,14 @@ newnfs_request(struct nfsrv_descript *nd return (ESTALE); } + /* + * Set authcred, which is used to acquire RPC credentials to + * the cred argument, by default. The crhold() should not be + * necessary, but will ensure that some future code change + * doesn't result in the credential being free'd prematurely. + */ + authcred = crhold(cred); + /* For client side interruptible mounts, mask off the signals. */ if (nmp != NULL && td != NULL && NFSHASINT(nmp)) { newnfs_set_sigmask(td, &oldset); @@ -509,13 +517,16 @@ newnfs_request(struct nfsrv_descript *nd /* * If there is a client side host based credential, * use that, otherwise use the system uid, if set. + * The system uid is in the nmp->nm_sockreq.nr_cred + * credentials. */ if (nmp->nm_krbnamelen > 0) { usegssname = 1; } else if (nmp->nm_uid != (uid_t)-1) { - saved_uid = cred->cr_uid; - cred->cr_uid = nmp->nm_uid; - set_uid = 1; + KASSERT(nmp->nm_sockreq.nr_cred != NULL, + ("newnfs_request: NULL nr_cred")); + crfree(authcred); + authcred = crhold(nmp->nm_sockreq.nr_cred); } } else if (nmp->nm_krbnamelen == 0 && nmp->nm_uid != (uid_t)-1 && cred->cr_uid == (uid_t)0) { @@ -524,10 +535,13 @@ newnfs_request(struct nfsrv_descript *nd * the system uid is set and this is root, use the * system uid, since root won't have user * credentials in a credentials cache file. + * The system uid is in the nmp->nm_sockreq.nr_cred + * credentials. */ - saved_uid = cred->cr_uid; - cred->cr_uid = nmp->nm_uid; - set_uid = 1; + KASSERT(nmp->nm_sockreq.nr_cred != NULL, + ("newnfs_request: NULL nr_cred")); + crfree(authcred); + authcred = crhold(nmp->nm_sockreq.nr_cred); } if (NFSHASINTEGRITY(nmp)) secflavour = RPCSEC_GSS_KRB5I; @@ -543,13 +557,13 @@ newnfs_request(struct nfsrv_descript *nd * Use the uid that did the mount when the RPC is doing * NFSv4 system operations, as indicated by the * ND_USEGSSNAME flag, for the AUTH_SYS case. + * The credentials in nm_sockreq.nr_cred were used for the + * mount. */ - saved_uid = cred->cr_uid; - if (nmp->nm_uid != (uid_t)-1) - cred->cr_uid = nmp->nm_uid; - else - cred->cr_uid = 0; - set_uid = 1; + KASSERT(nmp->nm_sockreq.nr_cred != NULL, + ("newnfs_request: NULL nr_cred")); + crfree(authcred); + authcred = crhold(nmp->nm_sockreq.nr_cred); } if (nmp != NULL) { @@ -565,12 +579,11 @@ newnfs_request(struct nfsrv_descript *nd auth = authnone_create(); else if (usegssname) auth = nfs_getauth(nrp, secflavour, nmp->nm_krbname, - srv_principal, NULL, cred); + srv_principal, NULL, authcred); else auth = nfs_getauth(nrp, secflavour, NULL, - srv_principal, NULL, cred); - if (set_uid) - cred->cr_uid = saved_uid; + srv_principal, NULL, authcred); + crfree(authcred); if (auth == NULL) { m_freem(nd->nd_mreq); if (set_sigset) From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 05:00:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FB20106566B; Fri, 3 Feb 2012 05:00:43 +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 8C9938FC08; Fri, 3 Feb 2012 05:00:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1350h3u071109; Fri, 3 Feb 2012 05:00:43 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1350h2t071105; Fri, 3 Feb 2012 05:00:43 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201202030500.q1350h2t071105@svn.freebsd.org> From: Jack F Vogel Date: Fri, 3 Feb 2012 05:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230931 - stable/8/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 05:00:43 -0000 Author: jfv Date: Fri Feb 3 05:00:43 2012 New Revision: 230931 URL: http://svn.freebsd.org/changeset/base/230931 Log: MFC did not get the new files... Added: stable/8/sys/dev/ixgbe/ixgbe_82598.h (contents, props changed) stable/8/sys/dev/ixgbe/ixgbe_82599.h (contents, props changed) stable/8/sys/dev/ixgbe/ixgbe_x540.c (contents, props changed) stable/8/sys/dev/ixgbe/ixgbe_x540.h (contents, props changed) Added: stable/8/sys/dev/ixgbe/ixgbe_82598.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/ixgbe/ixgbe_82598.h Fri Feb 3 05:00:43 2012 (r230931) @@ -0,0 +1,52 @@ +/****************************************************************************** + + Copyright (c) 2001-2012, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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 _IXGBE_82598_H_ +#define _IXGBE_82598_H_ + +u32 ixgbe_get_pcie_msix_count_82598(struct ixgbe_hw *hw); +s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num); +s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw); +void ixgbe_enable_relaxed_ordering_82598(struct ixgbe_hw *hw); +s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq); +s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on); +s32 ixgbe_read_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 *val); +s32 ixgbe_write_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 val); +s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset, + u8 *eeprom_data); +u32 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw); +s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw); +void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw); +void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw); +#endif /* _IXGBE_82598_H_ */ Added: stable/8/sys/dev/ixgbe/ixgbe_82599.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/ixgbe/ixgbe_82599.h Fri Feb 3 05:00:43 2012 (r230931) @@ -0,0 +1,65 @@ +/****************************************************************************** + + Copyright (c) 2001-2012, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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 _IXGBE_82599_H_ +#define _IXGBE_82599_H_ + +s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, + ixgbe_link_speed *speed, bool *autoneg); +enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw); +void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw); +void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw); +void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw); +s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, + ixgbe_link_speed speed, bool autoneg, + bool autoneg_wait_to_complete); +s32 ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw, + ixgbe_link_speed speed, bool autoneg, + bool autoneg_wait_to_complete); +s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, + bool autoneg_wait_to_complete); +s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed speed, + bool autoneg, bool autoneg_wait_to_complete); +s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw); +void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw); +s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw); +s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val); +s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val); +s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw); +s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw); +s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw); +u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw); +s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval); +bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw); +#endif /* _IXGBE_82599_H_ */ Added: stable/8/sys/dev/ixgbe/ixgbe_x540.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/ixgbe/ixgbe_x540.c Fri Feb 3 05:00:43 2012 (r230931) @@ -0,0 +1,971 @@ +/****************************************************************************** + + Copyright (c) 2001-2012, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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 "ixgbe_x540.h" +#include "ixgbe_type.h" +#include "ixgbe_api.h" +#include "ixgbe_common.h" +#include "ixgbe_phy.h" + +static s32 ixgbe_update_flash_X540(struct ixgbe_hw *hw); +static s32 ixgbe_poll_flash_update_done_X540(struct ixgbe_hw *hw); +static s32 ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw); +static void ixgbe_release_swfw_sync_semaphore(struct ixgbe_hw *hw); + +/** + * ixgbe_init_ops_X540 - Inits func ptrs and MAC type + * @hw: pointer to hardware structure + * + * Initialize the function pointers and assign the MAC type for X540. + * Does not touch the hardware. + **/ +s32 ixgbe_init_ops_X540(struct ixgbe_hw *hw) +{ + struct ixgbe_mac_info *mac = &hw->mac; + struct ixgbe_phy_info *phy = &hw->phy; + struct ixgbe_eeprom_info *eeprom = &hw->eeprom; + s32 ret_val; + + DEBUGFUNC("ixgbe_init_ops_X540"); + + ret_val = ixgbe_init_phy_ops_generic(hw); + ret_val = ixgbe_init_ops_generic(hw); + + + /* EEPROM */ + eeprom->ops.init_params = &ixgbe_init_eeprom_params_X540; + eeprom->ops.read = &ixgbe_read_eerd_X540; + eeprom->ops.read_buffer = &ixgbe_read_eerd_buffer_X540; + eeprom->ops.write = &ixgbe_write_eewr_X540; + eeprom->ops.write_buffer = &ixgbe_write_eewr_buffer_X540; + eeprom->ops.update_checksum = &ixgbe_update_eeprom_checksum_X540; + eeprom->ops.validate_checksum = &ixgbe_validate_eeprom_checksum_X540; + eeprom->ops.calc_checksum = &ixgbe_calc_eeprom_checksum_X540; + + /* PHY */ + phy->ops.init = &ixgbe_init_phy_ops_generic; + phy->ops.reset = NULL; + + /* MAC */ + mac->ops.reset_hw = &ixgbe_reset_hw_X540; + mac->ops.enable_relaxed_ordering = &ixgbe_enable_relaxed_ordering_gen2; + mac->ops.get_media_type = &ixgbe_get_media_type_X540; + mac->ops.get_supported_physical_layer = + &ixgbe_get_supported_physical_layer_X540; + mac->ops.read_analog_reg8 = NULL; + mac->ops.write_analog_reg8 = NULL; + mac->ops.start_hw = &ixgbe_start_hw_X540; + mac->ops.get_san_mac_addr = &ixgbe_get_san_mac_addr_generic; + mac->ops.set_san_mac_addr = &ixgbe_set_san_mac_addr_generic; + mac->ops.get_device_caps = &ixgbe_get_device_caps_generic; + mac->ops.get_wwn_prefix = &ixgbe_get_wwn_prefix_generic; + mac->ops.get_fcoe_boot_status = &ixgbe_get_fcoe_boot_status_generic; + mac->ops.acquire_swfw_sync = &ixgbe_acquire_swfw_sync_X540; + mac->ops.release_swfw_sync = &ixgbe_release_swfw_sync_X540; + mac->ops.disable_sec_rx_path = &ixgbe_disable_sec_rx_path_generic; + mac->ops.enable_sec_rx_path = &ixgbe_enable_sec_rx_path_generic; + + /* RAR, Multicast, VLAN */ + mac->ops.set_vmdq = &ixgbe_set_vmdq_generic; + mac->ops.clear_vmdq = &ixgbe_clear_vmdq_generic; + mac->ops.insert_mac_addr = &ixgbe_insert_mac_addr_generic; + mac->rar_highwater = 1; + mac->ops.set_vfta = &ixgbe_set_vfta_generic; + mac->ops.set_vlvf = &ixgbe_set_vlvf_generic; + mac->ops.clear_vfta = &ixgbe_clear_vfta_generic; + mac->ops.init_uta_tables = &ixgbe_init_uta_tables_generic; + mac->ops.set_mac_anti_spoofing = &ixgbe_set_mac_anti_spoofing; + mac->ops.set_vlan_anti_spoofing = &ixgbe_set_vlan_anti_spoofing; + + /* Link */ + mac->ops.get_link_capabilities = + &ixgbe_get_copper_link_capabilities_generic; + mac->ops.setup_link = &ixgbe_setup_mac_link_X540; + mac->ops.setup_rxpba = &ixgbe_set_rxpba_generic; + mac->ops.check_link = &ixgbe_check_mac_link_generic; + + mac->mcft_size = 128; + mac->vft_size = 128; + mac->num_rar_entries = 128; + mac->rx_pb_size = 384; + mac->max_tx_queues = 128; + mac->max_rx_queues = 128; + mac->max_msix_vectors = ixgbe_get_pcie_msix_count_generic(hw); + + /* + * FWSM register + * ARC supported; valid only if manageability features are + * enabled. + */ + mac->arc_subsystem_valid = (IXGBE_READ_REG(hw, IXGBE_FWSM) & + IXGBE_FWSM_MODE_MASK) ? TRUE : FALSE; + + hw->mbx.ops.init_params = ixgbe_init_mbx_params_pf; + + /* LEDs */ + mac->ops.blink_led_start = ixgbe_blink_led_start_X540; + mac->ops.blink_led_stop = ixgbe_blink_led_stop_X540; + + /* Manageability interface */ + mac->ops.set_fw_drv_ver = &ixgbe_set_fw_drv_ver_generic; + + return ret_val; +} + +/** + * ixgbe_get_link_capabilities_X540 - Determines link capabilities + * @hw: pointer to hardware structure + * @speed: pointer to link speed + * @autoneg: TRUE when autoneg or autotry is enabled + * + * Determines the link capabilities by reading the AUTOC register. + **/ +s32 ixgbe_get_link_capabilities_X540(struct ixgbe_hw *hw, + ixgbe_link_speed *speed, + bool *autoneg) +{ + ixgbe_get_copper_link_capabilities_generic(hw, speed, autoneg); + + return IXGBE_SUCCESS; +} + +/** + * ixgbe_get_media_type_X540 - Get media type + * @hw: pointer to hardware structure + * + * Returns the media type (fiber, copper, backplane) + **/ +enum ixgbe_media_type ixgbe_get_media_type_X540(struct ixgbe_hw *hw) +{ + UNREFERENCED_1PARAMETER(hw); + return ixgbe_media_type_copper; +} + +/** + * ixgbe_setup_mac_link_X540 - Sets the auto advertised capabilities + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg: TRUE if autonegotiation enabled + * @autoneg_wait_to_complete: TRUE when waiting for completion is needed + **/ +s32 ixgbe_setup_mac_link_X540(struct ixgbe_hw *hw, + ixgbe_link_speed speed, bool autoneg, + bool autoneg_wait_to_complete) +{ + DEBUGFUNC("ixgbe_setup_mac_link_X540"); + return hw->phy.ops.setup_link_speed(hw, speed, autoneg, + autoneg_wait_to_complete); +} + +/** + * ixgbe_reset_hw_X540 - Perform hardware reset + * @hw: pointer to hardware structure + * + * Resets the hardware by resetting the transmit and receive units, masks + * and clears all interrupts, and perform a reset. + **/ +s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw) +{ + s32 status; + u32 ctrl, i; + + DEBUGFUNC("ixgbe_reset_hw_X540"); + + /* Call adapter stop to disable tx/rx and clear interrupts */ + status = hw->mac.ops.stop_adapter(hw); + if (status != IXGBE_SUCCESS) + goto reset_hw_out; + + /* flush pending Tx transactions */ + ixgbe_clear_tx_pending(hw); + +mac_reset_top: + ctrl = IXGBE_CTRL_RST; + ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL); + IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl); + IXGBE_WRITE_FLUSH(hw); + + /* Poll for reset bit to self-clear indicating reset is complete */ + for (i = 0; i < 10; i++) { + usec_delay(1); + ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); + if (!(ctrl & IXGBE_CTRL_RST_MASK)) + break; + } + + if (ctrl & IXGBE_CTRL_RST_MASK) { + status = IXGBE_ERR_RESET_FAILED; + DEBUGOUT("Reset polling failed to complete.\n"); + } + msec_delay(100); + + /* + * Double resets are required for recovery from certain error + * conditions. Between resets, it is necessary to stall to allow time + * for any pending HW events to complete. + */ + if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { + hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; + goto mac_reset_top; + } + + /* Set the Rx packet buffer size. */ + IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(0), 384 << IXGBE_RXPBSIZE_SHIFT); + + /* Store the permanent mac address */ + hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); + + /* + * Store MAC address from RAR0, clear receive address registers, and + * clear the multicast table. Also reset num_rar_entries to 128, + * since we modify this value when programming the SAN MAC address. + */ + hw->mac.num_rar_entries = 128; + hw->mac.ops.init_rx_addrs(hw); + + /* Store the permanent SAN mac address */ + hw->mac.ops.get_san_mac_addr(hw, hw->mac.san_addr); + + /* Add the SAN MAC address to the RAR only if it's a valid address */ + if (ixgbe_validate_mac_addr(hw->mac.san_addr) == 0) { + hw->mac.ops.set_rar(hw, hw->mac.num_rar_entries - 1, + hw->mac.san_addr, 0, IXGBE_RAH_AV); + + /* Reserve the last RAR for the SAN MAC address */ + hw->mac.num_rar_entries--; + } + + /* Store the alternative WWNN/WWPN prefix */ + hw->mac.ops.get_wwn_prefix(hw, &hw->mac.wwnn_prefix, + &hw->mac.wwpn_prefix); + +reset_hw_out: + return status; +} + +/** + * ixgbe_start_hw_X540 - Prepare hardware for Tx/Rx + * @hw: pointer to hardware structure + * + * Starts the hardware using the generic start_hw function + * and the generation start_hw function. + * Then performs revision-specific operations, if any. + **/ +s32 ixgbe_start_hw_X540(struct ixgbe_hw *hw) +{ + s32 ret_val = IXGBE_SUCCESS; + + DEBUGFUNC("ixgbe_start_hw_X540"); + + ret_val = ixgbe_start_hw_generic(hw); + if (ret_val != IXGBE_SUCCESS) + goto out; + + ret_val = ixgbe_start_hw_gen2(hw); + +out: + return ret_val; +} + +/** + * ixgbe_get_supported_physical_layer_X540 - Returns physical layer type + * @hw: pointer to hardware structure + * + * Determines physical layer capabilities of the current configuration. + **/ +u32 ixgbe_get_supported_physical_layer_X540(struct ixgbe_hw *hw) +{ + u32 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN; + u16 ext_ability = 0; + + DEBUGFUNC("ixgbe_get_supported_physical_layer_X540"); + + hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_EXT_ABILITY, + IXGBE_MDIO_PMA_PMD_DEV_TYPE, &ext_ability); + if (ext_ability & IXGBE_MDIO_PHY_10GBASET_ABILITY) + physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_T; + if (ext_ability & IXGBE_MDIO_PHY_1000BASET_ABILITY) + physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T; + if (ext_ability & IXGBE_MDIO_PHY_100BASETX_ABILITY) + physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX; + + return physical_layer; +} + +/** + * ixgbe_init_eeprom_params_X540 - Initialize EEPROM params + * @hw: pointer to hardware structure + * + * Initializes the EEPROM parameters ixgbe_eeprom_info within the + * ixgbe_hw struct in order to set up EEPROM access. + **/ +s32 ixgbe_init_eeprom_params_X540(struct ixgbe_hw *hw) +{ + struct ixgbe_eeprom_info *eeprom = &hw->eeprom; + u32 eec; + u16 eeprom_size; + + DEBUGFUNC("ixgbe_init_eeprom_params_X540"); + + if (eeprom->type == ixgbe_eeprom_uninitialized) { + eeprom->semaphore_delay = 10; + eeprom->type = ixgbe_flash; + + eec = IXGBE_READ_REG(hw, IXGBE_EEC); + eeprom_size = (u16)((eec & IXGBE_EEC_SIZE) >> + IXGBE_EEC_SIZE_SHIFT); + eeprom->word_size = 1 << (eeprom_size + + IXGBE_EEPROM_WORD_SIZE_SHIFT); + + DEBUGOUT2("Eeprom params: type = %d, size = %d\n", + eeprom->type, eeprom->word_size); + } + + return IXGBE_SUCCESS; +} + +/** + * ixgbe_read_eerd_X540- Read EEPROM word using EERD + * @hw: pointer to hardware structure + * @offset: offset of word in the EEPROM to read + * @data: word read from the EEPROM + * + * Reads a 16 bit word from the EEPROM using the EERD register. + **/ +s32 ixgbe_read_eerd_X540(struct ixgbe_hw *hw, u16 offset, u16 *data) +{ + s32 status = IXGBE_SUCCESS; + + DEBUGFUNC("ixgbe_read_eerd_X540"); + if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == + IXGBE_SUCCESS) + status = ixgbe_read_eerd_generic(hw, offset, data); + else + status = IXGBE_ERR_SWFW_SYNC; + + hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); + return status; +} + +/** + * ixgbe_read_eerd_buffer_X540- Read EEPROM word(s) using EERD + * @hw: pointer to hardware structure + * @offset: offset of word in the EEPROM to read + * @words: number of words + * @data: word(s) read from the EEPROM + * + * Reads a 16 bit word(s) from the EEPROM using the EERD register. + **/ +s32 ixgbe_read_eerd_buffer_X540(struct ixgbe_hw *hw, + u16 offset, u16 words, u16 *data) +{ + s32 status = IXGBE_SUCCESS; + + DEBUGFUNC("ixgbe_read_eerd_buffer_X540"); + if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == + IXGBE_SUCCESS) + status = ixgbe_read_eerd_buffer_generic(hw, offset, + words, data); + else + status = IXGBE_ERR_SWFW_SYNC; + + hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); + return status; +} + +/** + * ixgbe_write_eewr_X540 - Write EEPROM word using EEWR + * @hw: pointer to hardware structure + * @offset: offset of word in the EEPROM to write + * @data: word write to the EEPROM + * + * Write a 16 bit word to the EEPROM using the EEWR register. + **/ +s32 ixgbe_write_eewr_X540(struct ixgbe_hw *hw, u16 offset, u16 data) +{ + s32 status = IXGBE_SUCCESS; + + DEBUGFUNC("ixgbe_write_eewr_X540"); + if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == + IXGBE_SUCCESS) + status = ixgbe_write_eewr_generic(hw, offset, data); + else + status = IXGBE_ERR_SWFW_SYNC; + + hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); + return status; +} + +/** + * ixgbe_write_eewr_buffer_X540 - Write EEPROM word(s) using EEWR + * @hw: pointer to hardware structure + * @offset: offset of word in the EEPROM to write + * @words: number of words + * @data: word(s) write to the EEPROM + * + * Write a 16 bit word(s) to the EEPROM using the EEWR register. + **/ +s32 ixgbe_write_eewr_buffer_X540(struct ixgbe_hw *hw, + u16 offset, u16 words, u16 *data) +{ + s32 status = IXGBE_SUCCESS; + + DEBUGFUNC("ixgbe_write_eewr_buffer_X540"); + if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == + IXGBE_SUCCESS) + status = ixgbe_write_eewr_buffer_generic(hw, offset, + words, data); + else + status = IXGBE_ERR_SWFW_SYNC; + + hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); + return status; +} + +/** + * ixgbe_calc_eeprom_checksum_X540 - Calculates and returns the checksum + * + * This function does not use synchronization for EERD and EEWR. It can + * be used internally by function which utilize ixgbe_acquire_swfw_sync_X540. + * + * @hw: pointer to hardware structure + **/ +u16 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw) +{ + u16 i; + u16 j; + u16 checksum = 0; + u16 length = 0; + u16 pointer = 0; + u16 word = 0; + + /* + * Do not use hw->eeprom.ops.read because we do not want to take + * the synchronization semaphores here. Instead use + * ixgbe_read_eerd_generic + */ + + DEBUGFUNC("ixgbe_calc_eeprom_checksum_X540"); + + /* Include 0x0-0x3F in the checksum */ + for (i = 0; i < IXGBE_EEPROM_CHECKSUM; i++) { + if (ixgbe_read_eerd_generic(hw, i, &word) != IXGBE_SUCCESS) { + DEBUGOUT("EEPROM read failed\n"); + break; + } + checksum += word; + } + + /* + * Include all data from pointers 0x3, 0x6-0xE. This excludes the + * FW, PHY module, and PCIe Expansion/Option ROM pointers. + */ + for (i = IXGBE_PCIE_ANALOG_PTR; i < IXGBE_FW_PTR; i++) { + if (i == IXGBE_PHY_PTR || i == IXGBE_OPTION_ROM_PTR) + continue; + + if (ixgbe_read_eerd_generic(hw, i, &pointer) != IXGBE_SUCCESS) { + DEBUGOUT("EEPROM read failed\n"); + break; + } + + /* Skip pointer section if the pointer is invalid. */ + if (pointer == 0xFFFF || pointer == 0 || + pointer >= hw->eeprom.word_size) + continue; + + if (ixgbe_read_eerd_generic(hw, pointer, &length) != + IXGBE_SUCCESS) { + DEBUGOUT("EEPROM read failed\n"); + break; + } + + /* Skip pointer section if length is invalid. */ + if (length == 0xFFFF || length == 0 || + (pointer + length) >= hw->eeprom.word_size) + continue; + + for (j = pointer+1; j <= pointer+length; j++) { + if (ixgbe_read_eerd_generic(hw, j, &word) != + IXGBE_SUCCESS) { + DEBUGOUT("EEPROM read failed\n"); + break; + } + checksum += word; + } + } + + checksum = (u16)IXGBE_EEPROM_SUM - checksum; + + return checksum; +} + +/** + * ixgbe_validate_eeprom_checksum_X540 - Validate EEPROM checksum + * @hw: pointer to hardware structure + * @checksum_val: calculated checksum + * + * Performs checksum calculation and validates the EEPROM checksum. If the + * caller does not need checksum_val, the value can be NULL. + **/ +s32 ixgbe_validate_eeprom_checksum_X540(struct ixgbe_hw *hw, + u16 *checksum_val) +{ + s32 status; + u16 checksum; + u16 read_checksum = 0; + + DEBUGFUNC("ixgbe_validate_eeprom_checksum_X540"); + + /* + * Read the first word from the EEPROM. If this times out or fails, do + * not continue or we could be in for a very long wait while every + * EEPROM read fails + */ + status = hw->eeprom.ops.read(hw, 0, &checksum); + + if (status != IXGBE_SUCCESS) { + DEBUGOUT("EEPROM read failed\n"); + goto out; + } + + if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == + IXGBE_SUCCESS) { + checksum = hw->eeprom.ops.calc_checksum(hw); + + /* + * Do not use hw->eeprom.ops.read because we do not want to take + * the synchronization semaphores twice here. + */ + ixgbe_read_eerd_generic(hw, IXGBE_EEPROM_CHECKSUM, + &read_checksum); + + /* + * Verify read checksum from EEPROM is the same as + * calculated checksum + */ + if (read_checksum != checksum) + status = IXGBE_ERR_EEPROM_CHECKSUM; + + /* If the user cares, return the calculated checksum */ + if (checksum_val) + *checksum_val = checksum; + } else { + status = IXGBE_ERR_SWFW_SYNC; + } + + hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); +out: + return status; +} + +/** + * ixgbe_update_eeprom_checksum_X540 - Updates the EEPROM checksum and flash + * @hw: pointer to hardware structure + * + * After writing EEPROM to shadow RAM using EEWR register, software calculates + * checksum and updates the EEPROM and instructs the hardware to update + * the flash. + **/ +s32 ixgbe_update_eeprom_checksum_X540(struct ixgbe_hw *hw) +{ + s32 status; + u16 checksum; + + DEBUGFUNC("ixgbe_update_eeprom_checksum_X540"); + + /* + * Read the first word from the EEPROM. If this times out or fails, do + * not continue or we could be in for a very long wait while every + * EEPROM read fails + */ + status = hw->eeprom.ops.read(hw, 0, &checksum); + + if (status != IXGBE_SUCCESS) + DEBUGOUT("EEPROM read failed\n"); + + if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == + IXGBE_SUCCESS) { + checksum = hw->eeprom.ops.calc_checksum(hw); + + /* + * Do not use hw->eeprom.ops.write because we do not want to + * take the synchronization semaphores twice here. + */ + status = ixgbe_write_eewr_generic(hw, IXGBE_EEPROM_CHECKSUM, + checksum); + + if (status == IXGBE_SUCCESS) + status = ixgbe_update_flash_X540(hw); + else + status = IXGBE_ERR_SWFW_SYNC; + } + + hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); + + return status; +} + +/** + * ixgbe_update_flash_X540 - Instruct HW to copy EEPROM to Flash device + * @hw: pointer to hardware structure + * + * Set FLUP (bit 23) of the EEC register to instruct Hardware to copy + * EEPROM from shadow RAM to the flash device. + **/ +static s32 ixgbe_update_flash_X540(struct ixgbe_hw *hw) +{ + u32 flup; + s32 status = IXGBE_ERR_EEPROM; + + DEBUGFUNC("ixgbe_update_flash_X540"); + + status = ixgbe_poll_flash_update_done_X540(hw); + if (status == IXGBE_ERR_EEPROM) { + DEBUGOUT("Flash update time out\n"); + goto out; + } + + flup = IXGBE_READ_REG(hw, IXGBE_EEC) | IXGBE_EEC_FLUP; + IXGBE_WRITE_REG(hw, IXGBE_EEC, flup); + + status = ixgbe_poll_flash_update_done_X540(hw); + if (status == IXGBE_SUCCESS) + DEBUGOUT("Flash update complete\n"); + else + DEBUGOUT("Flash update time out\n"); + + if (hw->revision_id == 0) { + flup = IXGBE_READ_REG(hw, IXGBE_EEC); + + if (flup & IXGBE_EEC_SEC1VAL) { + flup |= IXGBE_EEC_FLUP; + IXGBE_WRITE_REG(hw, IXGBE_EEC, flup); + } + + status = ixgbe_poll_flash_update_done_X540(hw); + if (status == IXGBE_SUCCESS) + DEBUGOUT("Flash update complete\n"); + else + DEBUGOUT("Flash update time out\n"); + } +out: + return status; +} + +/** + * ixgbe_poll_flash_update_done_X540 - Poll flash update status + * @hw: pointer to hardware structure + * + * Polls the FLUDONE (bit 26) of the EEC Register to determine when the + * flash update is done. + **/ +static s32 ixgbe_poll_flash_update_done_X540(struct ixgbe_hw *hw) +{ + u32 i; + u32 reg; + s32 status = IXGBE_ERR_EEPROM; + + DEBUGFUNC("ixgbe_poll_flash_update_done_X540"); + + for (i = 0; i < IXGBE_FLUDONE_ATTEMPTS; i++) { + reg = IXGBE_READ_REG(hw, IXGBE_EEC); + if (reg & IXGBE_EEC_FLUDONE) { + status = IXGBE_SUCCESS; + break; + } + usec_delay(5); + } + return status; +} + +/** + * ixgbe_acquire_swfw_sync_X540 - Acquire SWFW semaphore + * @hw: pointer to hardware structure + * @mask: Mask to specify which semaphore to acquire + * + * Acquires the SWFW semaphore thought the SW_FW_SYNC register for + * the specified function (CSR, PHY0, PHY1, NVM, Flash) + **/ +s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u16 mask) +{ + u32 swfw_sync; + u32 swmask = mask; + u32 fwmask = mask << 5; + u32 hwmask = 0; + u32 timeout = 200; + u32 i; + s32 ret_val = IXGBE_SUCCESS; + + DEBUGFUNC("ixgbe_acquire_swfw_sync_X540"); + + if (swmask == IXGBE_GSSR_EEP_SM) + hwmask = IXGBE_GSSR_FLASH_SM; + + /* SW only mask doesn't have FW bit pair */ + if (swmask == IXGBE_GSSR_SW_MNG_SM) + fwmask = 0; + + for (i = 0; i < timeout; i++) { + /* + * SW NVM semaphore bit is used for access to all + * SW_FW_SYNC bits (not just NVM) + */ + if (ixgbe_get_swfw_sync_semaphore(hw)) { + ret_val = IXGBE_ERR_SWFW_SYNC; + goto out; + } + + swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC); + if (!(swfw_sync & (fwmask | swmask | hwmask))) { + swfw_sync |= swmask; + IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC, swfw_sync); + ixgbe_release_swfw_sync_semaphore(hw); + msec_delay(5); + goto out; + } else { + /* + * Firmware currently using resource (fwmask), hardware + * currently using resource (hwmask), or other software + * thread currently using resource (swmask) + */ + ixgbe_release_swfw_sync_semaphore(hw); + msec_delay(5); + } + } + + /* Failed to get SW only semaphore */ + if (swmask == IXGBE_GSSR_SW_MNG_SM) { + ret_val = IXGBE_ERR_SWFW_SYNC; + goto out; + } + + /* If the resource is not released by the FW/HW the SW can assume that + * the FW/HW malfunctions. In that case the SW should sets the SW bit(s) + * of the requested resource(s) while ignoring the corresponding FW/HW + * bits in the SW_FW_SYNC register. + */ + swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC); + if (swfw_sync & (fwmask | hwmask)) { + if (ixgbe_get_swfw_sync_semaphore(hw)) { + ret_val = IXGBE_ERR_SWFW_SYNC; + goto out; + } + + swfw_sync |= swmask; + IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC, swfw_sync); + ixgbe_release_swfw_sync_semaphore(hw); + msec_delay(5); + } + +out: + return ret_val; +} + +/** + * ixgbe_release_swfw_sync_X540 - Release SWFW semaphore + * @hw: pointer to hardware structure + * @mask: Mask to specify which semaphore to release + * + * Releases the SWFW semaphore throught the SW_FW_SYNC register + * for the specified function (CSR, PHY0, PHY1, EVM, Flash) + **/ +void ixgbe_release_swfw_sync_X540(struct ixgbe_hw *hw, u16 mask) +{ + u32 swfw_sync; + u32 swmask = mask; + + DEBUGFUNC("ixgbe_release_swfw_sync_X540"); + + ixgbe_get_swfw_sync_semaphore(hw); + + swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC); + swfw_sync &= ~swmask; + IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC, swfw_sync); + + ixgbe_release_swfw_sync_semaphore(hw); + msec_delay(5); +} + +/** + * ixgbe_get_nvm_semaphore - Get hardware semaphore + * @hw: pointer to hardware structure + * + * Sets the hardware semaphores so SW/FW can gain control of shared resources + **/ +static s32 ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw) +{ + s32 status = IXGBE_ERR_EEPROM; + u32 timeout = 2000; + u32 i; + u32 swsm; + + DEBUGFUNC("ixgbe_get_swfw_sync_semaphore"); + + /* Get SMBI software semaphore between device drivers first */ + for (i = 0; i < timeout; i++) { + /* + * If the SMBI bit is 0 when we read it, then the bit will be + * set and we have the semaphore + */ + swsm = IXGBE_READ_REG(hw, IXGBE_SWSM); + if (!(swsm & IXGBE_SWSM_SMBI)) { + status = IXGBE_SUCCESS; + break; + } + usec_delay(50); + } + + /* Now get the semaphore between SW/FW through the REGSMP bit */ + if (status == IXGBE_SUCCESS) { + for (i = 0; i < timeout; i++) { + swsm = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC); + if (!(swsm & IXGBE_SWFW_REGSMP)) + break; + + usec_delay(50); + } + + /* + * Release semaphores and return error if SW NVM semaphore + * was not granted because we don't have access to the EEPROM + */ + if (i >= timeout) { + DEBUGOUT("REGSMP Software NVM semaphore not " + "granted.\n"); + ixgbe_release_swfw_sync_semaphore(hw); + status = IXGBE_ERR_EEPROM; + } + } else { + DEBUGOUT("Software semaphore SMBI between device drivers " + "not granted.\n"); + } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 05:23:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9488106566B; Fri, 3 Feb 2012 05:23:52 +0000 (UTC) (envelope-from uzimac@da3m0n8t3r.com) Received: from z.umatar.com (z.umatar.com [66.135.39.87]) by mx1.freebsd.org (Postfix) with ESMTP id 4F06B8FC0A; Fri, 3 Feb 2012 05:23:52 +0000 (UTC) Received: from z.umatar.com (localhost [127.0.0.1]) by z.umatar.com (8.14.5/8.14.3) with ESMTP id q135C8jG040204; Thu, 2 Feb 2012 21:12:08 -0800 (PST) (envelope-from uzimac@da3m0n8t3r.com) Received: (from uzimac@localhost) by z.umatar.com (8.14.5/8.14.3/Submit) id q135C8j9040203; Thu, 2 Feb 2012 21:12:08 -0800 (PST) (envelope-from uzimac@da3m0n8t3r.com) X-Authentication-Warning: z.umatar.com: uzimac set sender to uzimac@da3m0n8t3r.com using -f From: "Waitman Gobble" To: Adrian Chadd Message-Id: <1328245928.39926@da3m0n8t3r.com> X-Originating-IP: 75.36.155.21 X-Mailer: Usermin 1.500 In-Reply-To: <201202022104.q12L4OJ8054130@svn.freebsd.org> Date: Thu, 02 Feb 2012 21:12:08 -0800 (PST) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="bound1328245928" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230923 - head/tools/tools/ath/athradar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 05:23:53 -0000 This is a multi-part message in MIME format. --bound1328245928 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Adrian Chadd wrote .. > Author: adrian > Date: Thu Feb 2 21:04:24 2012 > New Revision: 230923 > URL: http://svn.freebsd.org/changeset/base/230923 > > Log: > Add some missing radar config parameters to athradar. > > Modified: > head/tools/tools/ath/athradar/athradar.c > > Modified: head/tools/tools/ath/athradar/athradar.c > ============================================================================== > --- head/tools/tools/ath/athradar/athradar.c Thu Feb 2 19:03:29 2012 (r230922) > +++ head/tools/tools/ath/athradar/athradar.c Thu Feb 2 21:04:24 2012 (r230923) > @@ -207,6 +207,12 @@ radar_set_param(struct radarhandler *rad > radarset(radar, DFS_PARAM_RELSTEP, v); > } else if (strcmp(param, "maxlen") == 0) { > radarset(radar, DFS_PARAM_MAXLEN, v); > + } else if (strcmp(param, "usefir128") == 0) { > + radarset(radar, DFS_PARAM_USEFIR128, v); > + } else if (strcmp(param, "blockradar") == 0) { > + radarset(radar, DFS_PARAM_BLOCKRADAR, v); > + } else if (strcmp(param, "enmaxrssi") == 0) { > + radarset(radar, DFS_PARAM_MAXRSSI_EN, v); > } else if (strcmp(param, "extchannel") == 0) { > radarset(radar, DFS_PARAM_EN_EXTCH, v); > } else { > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" I make/installed in /usr/src/tools/tools/ath/athradar and it appears to work, however I'm curious about what I can do with this. I don't seem to find anything about "radar parameter diagnostic" in a search engine, but maybe I'm looking in the wrong place. Simple command line example? Only asking `cause it sounds potentially cool :) thanks! -- Waitman Gobble San Jose California USA --bound1328245928-- From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 09:07:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30CD71065672; Fri, 3 Feb 2012 09:07:54 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 034248FC15; Fri, 3 Feb 2012 09:07:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1397rO4078876; Fri, 3 Feb 2012 09:07:53 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1397r50078874; Fri, 3 Feb 2012 09:07:53 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201202030907.q1397r50078874@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 3 Feb 2012 09:07: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: r230934 - head/usr.bin/fstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 09:07:54 -0000 Author: pluknet Date: Fri Feb 3 09:07:53 2012 New Revision: 230934 URL: http://svn.freebsd.org/changeset/base/230934 Log: Print the owner process for unix domain sockets when restricted to the specified files. PR: bin/143962 MFC after: 2 weeks Modified: head/usr.bin/fstat/fstat.c Modified: head/usr.bin/fstat/fstat.c ============================================================================== --- head/usr.bin/fstat/fstat.c Fri Feb 3 09:06:24 2012 (r230933) +++ head/usr.bin/fstat/fstat.c Fri Feb 3 09:07:53 2012 (r230934) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -224,28 +225,53 @@ static void print_file_info(struct procstat *procstat, struct filestat *fst, const char *uname, const char *cmd, int pid) { + struct sockstat sock; struct vnstat vn; DEVS *d; const char *filename; int error, fsmatch = 0; char errbuf[_POSIX2_LINE_MAX]; + error = 0; filename = NULL; if (checkfile != 0) { - if (fst->fs_type != PS_FST_TYPE_VNODE && - fst->fs_type != PS_FST_TYPE_FIFO) + switch (fst->fs_type) { + case PS_FST_TYPE_VNODE: + case PS_FST_TYPE_FIFO: + error = procstat_get_vnode_info(procstat, fst, &vn, errbuf); + break; + case PS_FST_TYPE_SOCKET: + error = procstat_get_socket_info(procstat, fst, &sock, errbuf); + break; + default: return; - error = procstat_get_vnode_info(procstat, fst, &vn, errbuf); + } if (error != 0) return; for (d = devs; d != NULL; d = d->next) - if (d->fsid == vn.vn_fsid) { - fsmatch = 1; - if ((unsigned)d->ino == vn.vn_fileid) { - filename = d->name; - break; + switch (fst->fs_type) { + case PS_FST_TYPE_VNODE: + case PS_FST_TYPE_FIFO: + if (d->fsid == vn.vn_fsid) { + fsmatch = 1; + if ((unsigned)d->ino == vn.vn_fileid) { + filename = d->name; + break; + } + } + break; + case PS_FST_TYPE_SOCKET: + if (sock.dom_family == AF_UNIX) { + fsmatch = 1; + if (strcmp(((struct sockaddr_un *) + (&sock.sa_local))->sun_path, + d->name) == 0) { + filename = d->name; + break; + } } + break; } if (fsmatch == 0 || (filename == NULL && fsflg == 0)) return; From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 13:40:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7B4A106566C; Fri, 3 Feb 2012 13:40:51 +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 D1F268FC14; Fri, 3 Feb 2012 13:40:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13DepRC089602; Fri, 3 Feb 2012 13:40:51 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13DepPU089600; Fri, 3 Feb 2012 13:40:51 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202031340.q13DepPU089600@svn.freebsd.org> From: Martin Matuska Date: Fri, 3 Feb 2012 13:40: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: r230945 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 13:40:52 -0000 Author: mm Date: Fri Feb 3 13:40:51 2012 New Revision: 230945 URL: http://svn.freebsd.org/changeset/base/230945 Log: Revert r230913 and r230914. The initialization was correct, the problem needs deeper analysis. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Feb 3 13:20:48 2012 (r230944) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Feb 3 13:40:51 2012 (r230945) @@ -20,9 +20,6 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * - * Portions Copyright 2012 Sergey Kandaurov - * Portions Copyright 2012 Martin Matuska */ #include @@ -996,7 +993,7 @@ dnode_buf_pageout(dmu_buf_t *db, void *a dnh->dnh_dnode = NULL; } kmem_free(children_dnodes, sizeof (dnode_children_t) + - epb * sizeof (dnode_handle_t)); + (epb - 1) * sizeof (dnode_handle_t)); } /* @@ -1081,7 +1078,7 @@ dnode_hold_impl(objset_t *os, uint64_t o int i; dnode_children_t *winner; children_dnodes = kmem_zalloc(sizeof (dnode_children_t) + - epb * sizeof (dnode_handle_t), KM_SLEEP); + (epb - 1) * sizeof (dnode_handle_t), KM_SLEEP); children_dnodes->dnc_count = epb; dnh = &children_dnodes->dnc_children[0]; for (i = 0; i < epb; i++) { @@ -1091,7 +1088,7 @@ dnode_hold_impl(objset_t *os, uint64_t o if (winner = dmu_buf_set_user(&db->db, children_dnodes, NULL, dnode_buf_pageout)) { kmem_free(children_dnodes, sizeof (dnode_children_t) + - epb * sizeof (dnode_handle_t)); + (epb - 1) * sizeof (dnode_handle_t)); children_dnodes = winner; } } From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 17:36:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E71BF106566B; Fri, 3 Feb 2012 17:36:32 +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 D15598FC08; Fri, 3 Feb 2012 17:36:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13HaWNn097193; Fri, 3 Feb 2012 17:36:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13HaWsY097191; Fri, 3 Feb 2012 17:36:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202031736.q13HaWsY097191@svn.freebsd.org> From: Ed Schouten Date: Fri, 3 Feb 2012 17:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230951 - stable/9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 17:36:33 -0000 Author: ed Date: Fri Feb 3 17:36:32 2012 New Revision: 230951 URL: http://svn.freebsd.org/changeset/base/230951 Log: MFC r226785: Attempt to fix build logic for gensnmptree. There are two problems with the existing logic. It builds gensnmptree on <700018, even if WITHOUT_BSNMP is set, but more importantly, we must not forget to build gensnmptree on systems that have originally been built without. This causes a buildworld on those systems to fail. Modified: stable/9/Makefile.inc1 (contents, props changed) Directory Properties: stable/9/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Fri Feb 3 15:39:13 2012 (r230950) +++ stable/9/Makefile.inc1 Fri Feb 3 17:36:32 2012 (r230951) @@ -1029,7 +1029,8 @@ _yacc= usr.bin/yacc _awk= usr.bin/awk .endif -.if ${BOOTSTRAPPING} < 700018 +.if ${MK_BSNMP} != "no" && \ + (${BOOTSTRAPPING} < 700018 || !exists(/usr/sbin/gensnmptree)) _gensnmptree= usr.sbin/bsnmpd/gensnmptree .endif From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 17:50:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FB46106566C; Fri, 3 Feb 2012 17:50:40 +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 EDCDD8FC16; Fri, 3 Feb 2012 17:50:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13Hodoo097660; Fri, 3 Feb 2012 17:50:39 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13HodDw097658; Fri, 3 Feb 2012 17:50:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202031750.q13HodDw097658@svn.freebsd.org> From: Ed Schouten Date: Fri, 3 Feb 2012 17:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230952 - stable/9/lib/libpam/modules/pam_lastlog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 17:50:40 -0000 Author: ed Date: Fri Feb 3 17:50:39 2012 New Revision: 230952 URL: http://svn.freebsd.org/changeset/base/230952 Log: MFC r227314: Ensure pam_lastlog removes the /dev/ component of the TTY name. Some consumers of PAM remove the /dev/ component (i.e. login), while others don't (i.e. su). We must ensure that the /dev/ component is removed to ensure that the utmpx entries properly work with tools such as w(1). Modified: stable/9/lib/libpam/modules/pam_lastlog/pam_lastlog.c Directory Properties: stable/9/lib/libpam/ (props changed) Modified: stable/9/lib/libpam/modules/pam_lastlog/pam_lastlog.c ============================================================================== --- stable/9/lib/libpam/modules/pam_lastlog/pam_lastlog.c Fri Feb 3 17:36:32 2012 (r230951) +++ stable/9/lib/libpam/modules/pam_lastlog/pam_lastlog.c Fri Feb 3 17:50:39 2012 (r230952) @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$"); #define _BSD_SOURCE #include + +#include #include #include #include @@ -96,6 +98,9 @@ pam_sm_open_session(pam_handle_t *pamh, pam_err = PAM_SERVICE_ERR; goto err; } + /* Strip /dev/ component. */ + if (strncmp(tty, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + tty = (const char *)tty + sizeof(_PATH_DEV) - 1; if ((flags & PAM_SILENT) == 0) { if (setutxdb(UTXDB_LASTLOGIN, NULL) != 0) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 18:48:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A54221065676; Fri, 3 Feb 2012 18:48:40 +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 8F1D78FC13; Fri, 3 Feb 2012 18:48:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13ImegJ099559; Fri, 3 Feb 2012 18:48:40 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13ImeTU099556; Fri, 3 Feb 2012 18:48:40 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202031848.q13ImeTU099556@svn.freebsd.org> From: Ed Schouten Date: Fri, 3 Feb 2012 18:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230953 - in stable/9/sys: net netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 18:48:40 -0000 Author: ed Date: Fri Feb 3 18:48:40 2012 New Revision: 230953 URL: http://svn.freebsd.org/changeset/base/230953 Log: MFC r226610: Add missing #includes. According to POSIX, these two header files should be able to be included by themselves, not depending on other headers. The header uses struct sockaddr when __BSD_VISIBLE=1, while uses integer datatypes (u_int32_t, u_short, etc). Modified: stable/9/sys/net/if.h stable/9/sys/netinet/tcp.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if.h ============================================================================== --- stable/9/sys/net/if.h Fri Feb 3 17:50:39 2012 (r230952) +++ stable/9/sys/net/if.h Fri Feb 3 18:48:40 2012 (r230953) @@ -43,9 +43,11 @@ /* * does not depend on on most other systems. This * helps userland compatibility. (struct timeval ifi_lastchange) + * The same holds for . (struct sockaddr ifru_addr) */ #ifndef _KERNEL #include +#include #endif struct ifnet; Modified: stable/9/sys/netinet/tcp.h ============================================================================== --- stable/9/sys/netinet/tcp.h Fri Feb 3 17:50:39 2012 (r230952) +++ stable/9/sys/netinet/tcp.h Fri Feb 3 18:48:40 2012 (r230953) @@ -34,6 +34,7 @@ #define _NETINET_TCP_H_ #include +#include #if __BSD_VISIBLE From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 20:20:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 913781065673; Fri, 3 Feb 2012 20:20:31 +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 62B058FC0A; Fri, 3 Feb 2012 20:20:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13KKVgY002561; Fri, 3 Feb 2012 20:20:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13KKV1N002559; Fri, 3 Feb 2012 20:20:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202032020.q13KKV1N002559@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 3 Feb 2012 20:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230954 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 20:20:31 -0000 Author: kib Date: Fri Feb 3 20:20:30 2012 New Revision: 230954 URL: http://svn.freebsd.org/changeset/base/230954 Log: tijl is on his own now. Approved by: core (implicit) Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Feb 3 18:48:40 2012 (r230953) +++ svnadmin/conf/mentors Fri Feb 3 20:20:30 2012 (r230954) @@ -38,6 +38,5 @@ sbruno scottl snb dwmalone sson gnn theraven dim Co-mentor: brooks -tijl kib versus gavin Co-mentor: fjoe will ken From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 20:24:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D30C106566B; Fri, 3 Feb 2012 20:24:19 +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 17DFD8FC0A; Fri, 3 Feb 2012 20:24:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13KOIkb002735; Fri, 3 Feb 2012 20:24:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13KOICY002733; Fri, 3 Feb 2012 20:24:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202032024.q13KOICY002733@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 3 Feb 2012 20:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230955 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 20:24:19 -0000 Author: jilles Date: Fri Feb 3 20:24:18 2012 New Revision: 230955 URL: http://svn.freebsd.org/changeset/base/230955 Log: MFC r228510: Fix select/poll/kqueue for write on reverse direction before first write. The reverse direction of a pipe is lazily allocated on the first write in that direction (because pipes are usually used in one direction only). A special case is needed to ensure the pipe appears writable before the first write because there are 0 bytes of pending data in 0 bytes of buffer space at that point, leaving 0 bytes of data that can be written with the normal code. Note that the first write returns [ENOMEM] if kern.ipc.maxpipekva is exceeded and does not block or return [EAGAIN], so selecting true for write is correct even in that case. PR: kern/93685 Modified: stable/9/sys/kern/sys_pipe.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/sys_pipe.c ============================================================================== --- stable/9/sys/kern/sys_pipe.c Fri Feb 3 20:20:30 2012 (r230954) +++ stable/9/sys/kern/sys_pipe.c Fri Feb 3 20:24:18 2012 (r230955) @@ -1349,7 +1349,8 @@ pipe_poll(fp, events, active_cred, td) if (wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF) || (((wpipe->pipe_state & PIPE_DIRECTW) == 0) && - (wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) >= PIPE_BUF)) + ((wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) >= PIPE_BUF || + wpipe->pipe_buffer.size == 0))) revents |= events & (POLLOUT | POLLWRNORM); if ((events & POLLINIGNEOF) == 0) { @@ -1660,7 +1661,8 @@ filt_pipewrite(struct knote *kn, long hi PIPE_UNLOCK(rpipe); return (1); } - kn->kn_data = wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt; + kn->kn_data = (wpipe->pipe_buffer.size > 0) ? + (wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) : PIPE_BUF; if (wpipe->pipe_state & PIPE_DIRECTW) kn->kn_data = 0; From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 20:27:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C63C01065672; Fri, 3 Feb 2012 20:27:14 +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 A7A908FC14; Fri, 3 Feb 2012 20:27:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13KREx5002873; Fri, 3 Feb 2012 20:27:14 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13KREPW002872; Fri, 3 Feb 2012 20:27:14 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202032027.q13KREPW002872@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 3 Feb 2012 20:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230956 - stable/9/tools/regression/pipe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 20:27:15 -0000 Author: jilles Date: Fri Feb 3 20:27:14 2012 New Revision: 230956 URL: http://svn.freebsd.org/changeset/base/230956 Log: MFC r228512: Add test for r228510 (MFC'ed as r230955). Added: stable/9/tools/regression/pipe/pipe-reverse2.c - copied unchanged from r228512, head/tools/regression/pipe/pipe-reverse2.c Modified: Directory Properties: stable/9/tools/regression/pipe/ (props changed) Copied: stable/9/tools/regression/pipe/pipe-reverse2.c (from r228512, head/tools/regression/pipe/pipe-reverse2.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/pipe/pipe-reverse2.c Fri Feb 3 20:27:14 2012 (r230956, copy of r228512, head/tools/regression/pipe/pipe-reverse2.c) @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 2010 Jilles Tjoelker + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include +#include +#include + +/* + * Check that pipes can be selected for writing in the reverse direction. + */ +int +main(int argc, char *argv[]) +{ + int pip[2]; + fd_set set; + int n; + + if (pipe(pip) == -1) + err(1, "FAIL: pipe"); + + FD_ZERO(&set); + FD_SET(pip[0], &set); + n = select(pip[1] + 1, NULL, &set, NULL, &(struct timeval){ 0, 0 }); + if (n != 1) + errx(1, "FAIL: select initial reverse direction"); + + n = write(pip[0], "x", 1); + if (n != 1) + err(1, "FAIL: write reverse direction"); + + FD_ZERO(&set); + FD_SET(pip[0], &set); + n = select(pip[1] + 1, NULL, &set, NULL, &(struct timeval){ 0, 0 }); + if (n != 1) + errx(1, "FAIL: select reverse direction after write"); + + printf("PASS\n"); + + return (0); +} From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 21:21:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27E161065674; Fri, 3 Feb 2012 21:21:01 +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 128EF8FC16; Fri, 3 Feb 2012 21:21:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13LL0s3004569; Fri, 3 Feb 2012 21:21:00 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13LL0uA004567; Fri, 3 Feb 2012 21:21:00 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202032121.q13LL0uA004567@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 3 Feb 2012 21:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230957 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 21:21:01 -0000 Author: jkim Date: Fri Feb 3 21:21:00 2012 New Revision: 230957 URL: http://svn.freebsd.org/changeset/base/230957 Log: Fix a function prototype to reflect reality. No functional change. Modified: head/sys/amd64/acpica/acpi_wakeup.c Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Fri Feb 3 20:27:14 2012 (r230956) +++ head/sys/amd64/acpica/acpi_wakeup.c Fri Feb 3 21:21:00 2012 (r230957) @@ -74,7 +74,7 @@ static struct pcb **susppcbs; static void **suspfpusave; #endif -int acpi_restorecpu(vm_offset_t, struct pcb *); +int acpi_restorecpu(uint64_t, vm_offset_t); static void *acpi_alloc_wakeup_handler(void); static void acpi_stop_beep(void *); From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 21:24:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F0A4106566B; Fri, 3 Feb 2012 21:24:29 +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 09BFE8FC12; Fri, 3 Feb 2012 21:24:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13LOSEQ004728; Fri, 3 Feb 2012 21:24:28 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13LOSGv004726; Fri, 3 Feb 2012 21:24:28 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202032124.q13LOSGv004726@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 3 Feb 2012 21:24:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230958 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 21:24:29 -0000 Author: jkim Date: Fri Feb 3 21:24:28 2012 New Revision: 230958 URL: http://svn.freebsd.org/changeset/base/230958 Log: Restore callee saved registers later and micro-optimize. Modified: head/sys/amd64/acpica/acpi_switch.S Modified: head/sys/amd64/acpica/acpi_switch.S ============================================================================== --- head/sys/amd64/acpica/acpi_switch.S Fri Feb 3 21:21:00 2012 (r230957) +++ head/sys/amd64/acpica/acpi_switch.S Fri Feb 3 21:24:28 2012 (r230958) @@ -120,15 +120,6 @@ ENTRY(acpi_restorecpu) #undef SDT_SYSTSS #undef SDT_SYSBSY - /* Restore other callee saved registers. */ - movq PCB_R15(%rdi), %r15 - movq PCB_R14(%rdi), %r14 - movq PCB_R13(%rdi), %r13 - movq PCB_R12(%rdi), %r12 - movq PCB_RBP(%rdi), %rbp - movq PCB_RSP(%rdi), %rsp - movq PCB_RBX(%rdi), %rbx - /* Restore debug registers. */ movq PCB_DR0(%rdi), %rax movq %rax, %dr0 @@ -145,6 +136,7 @@ ENTRY(acpi_restorecpu) /* Restore FPU state. */ fninit + movq WAKEUP_CTX(fpusave), %rbx movq WAKEUP_CTX(xsmask), %rax testq %rax, %rax jz 1f @@ -153,19 +145,26 @@ ENTRY(acpi_restorecpu) movl $XCR0, %ecx /* xsetbv */ .byte 0x0f, 0x01, 0xd1 - movq WAKEUP_CTX(fpusave), %rcx -/* xrstor (%rcx) */ - .byte 0x0f, 0xae, 0x29 +/* xrstor (%rbx) */ + .byte 0x0f, 0xae, 0x2b jmp 2f 1: - movq WAKEUP_CTX(fpusave), %rcx - fxrstor (%rcx) + fxrstor (%rbx) 2: /* Reload CR0. */ movq PCB_CR0(%rdi), %rax movq %rax, %cr0 + /* Restore other callee saved registers. */ + movq PCB_R15(%rdi), %r15 + movq PCB_R14(%rdi), %r14 + movq PCB_R13(%rdi), %r13 + movq PCB_R12(%rdi), %r12 + movq PCB_RBP(%rdi), %rbp + movq PCB_RSP(%rdi), %rsp + movq PCB_RBX(%rdi), %rbx + /* Restore return address. */ movq PCB_RIP(%rdi), %rax movq %rax, (%rsp) From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 21:26:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BA47106564A; Fri, 3 Feb 2012 21:26:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AAB68FC0C; Fri, 3 Feb 2012 21:26:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13LQQiN004825; Fri, 3 Feb 2012 21:26:26 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13LQQQ8004822; Fri, 3 Feb 2012 21:26:26 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202032126.q13LQQQ8004822@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 3 Feb 2012 21:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230959 - stable/8/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 21:26:26 -0000 Author: pfg Date: Fri Feb 3 21:26:25 2012 New Revision: 230959 URL: http://svn.freebsd.org/changeset/base/230959 Log: MFC: r228756 Clean an inconsistency with -ffinite-math-only. Backported from the gcc-4_3-branch, revision (118001) under the GPLv2. This issue was also fixed in Apple's gcc. PR: 157025 Reviewed by: mm Approved by: jhb (mentor) Modified: stable/8/contrib/gcc/ChangeLog.gcc43 stable/8/contrib/gcc/builtins.c Directory Properties: stable/8/contrib/gcc/ (props changed) Modified: stable/8/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- stable/8/contrib/gcc/ChangeLog.gcc43 Fri Feb 3 21:24:28 2012 (r230958) +++ stable/8/contrib/gcc/ChangeLog.gcc43 Fri Feb 3 21:26:25 2012 (r230959) @@ -96,6 +96,14 @@ * doc/invoke.texi: Add entry about geode processor. +2006-10-24 Richard Guenther + + PR middle-end/28796 + * builtins.c (fold_builtin_classify): Use HONOR_INFINITIES + and HONOR_NANS instead of MODE_HAS_INFINITIES and MODE_HAS_NANS + for deciding optimizations in consistency with fold-const.c + (fold_builtin_unordered_cmp): Likewise. + 2006-10-22 H.J. Lu (r117958) * config.gcc (i[34567]86-*-*): Add tmmintrin.h to extra_headers. Modified: stable/8/contrib/gcc/builtins.c ============================================================================== --- stable/8/contrib/gcc/builtins.c Fri Feb 3 21:24:28 2012 (r230958) +++ stable/8/contrib/gcc/builtins.c Fri Feb 3 21:26:25 2012 (r230959) @@ -8720,7 +8720,7 @@ fold_builtin_classify (tree fndecl, tree switch (builtin_index) { case BUILT_IN_ISINF: - if (!MODE_HAS_INFINITIES (TYPE_MODE (TREE_TYPE (arg)))) + if (!HONOR_INFINITIES (TYPE_MODE (TREE_TYPE (arg)))) return omit_one_operand (type, integer_zero_node, arg); if (TREE_CODE (arg) == REAL_CST) @@ -8736,8 +8736,8 @@ fold_builtin_classify (tree fndecl, tree return NULL_TREE; case BUILT_IN_FINITE: - if (!MODE_HAS_NANS (TYPE_MODE (TREE_TYPE (arg))) - && !MODE_HAS_INFINITIES (TYPE_MODE (TREE_TYPE (arg)))) + if (!HONOR_NANS (TYPE_MODE (TREE_TYPE (arg))) + && !HONOR_INFINITIES (TYPE_MODE (TREE_TYPE (arg)))) return omit_one_operand (type, integer_zero_node, arg); if (TREE_CODE (arg) == REAL_CST) @@ -8750,7 +8750,7 @@ fold_builtin_classify (tree fndecl, tree return NULL_TREE; case BUILT_IN_ISNAN: - if (!MODE_HAS_NANS (TYPE_MODE (TREE_TYPE (arg)))) + if (!HONOR_NANS (TYPE_MODE (TREE_TYPE (arg)))) return omit_one_operand (type, integer_zero_node, arg); if (TREE_CODE (arg) == REAL_CST) @@ -8833,13 +8833,13 @@ fold_builtin_unordered_cmp (tree fndecl, if (unordered_code == UNORDERED_EXPR) { - if (!MODE_HAS_NANS (TYPE_MODE (TREE_TYPE (arg0)))) + if (!HONOR_NANS (TYPE_MODE (TREE_TYPE (arg0)))) return omit_two_operands (type, integer_zero_node, arg0, arg1); return fold_build2 (UNORDERED_EXPR, type, arg0, arg1); } - code = MODE_HAS_NANS (TYPE_MODE (TREE_TYPE (arg0))) ? unordered_code - : ordered_code; + code = HONOR_NANS (TYPE_MODE (TREE_TYPE (arg0))) ? unordered_code + : ordered_code; return fold_build1 (TRUTH_NOT_EXPR, type, fold_build2 (code, type, arg0, arg1)); } From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 21:30:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C3BE106564A; Fri, 3 Feb 2012 21:30:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62E658FC08; Fri, 3 Feb 2012 21:30:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13LUW7S005007; Fri, 3 Feb 2012 21:30:32 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13LUWWC004991; Fri, 3 Feb 2012 21:30:32 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202032130.q13LUWWC004991@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 3 Feb 2012 21:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230960 - in stable/8/contrib/libstdc++: . config/os/aix include/bits include/ext include/tr1 libsupc++ src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 21:30:32 -0000 Author: pfg Date: Fri Feb 3 21:30:31 2012 New Revision: 230960 URL: http://svn.freebsd.org/changeset/base/230960 Log: MFC: r228780 Update libstdc++ with small changes up to the latest rev. (135556) from the gcc 4.2 branch. The libraries in the gcc-4_2-branch remained under the LGPLv2. Reviewed by: mm Approved by: jhb (mentor) Modified: stable/8/contrib/libstdc++/ChangeLog stable/8/contrib/libstdc++/config/os/aix/os_defines.h stable/8/contrib/libstdc++/include/bits/allocator.h stable/8/contrib/libstdc++/include/bits/basic_string.h stable/8/contrib/libstdc++/include/bits/fstream.tcc stable/8/contrib/libstdc++/include/bits/locale_facets.tcc stable/8/contrib/libstdc++/include/ext/atomicity.h stable/8/contrib/libstdc++/include/ext/codecvt_specializations.h stable/8/contrib/libstdc++/include/ext/concurrence.h stable/8/contrib/libstdc++/include/ext/vstring.h stable/8/contrib/libstdc++/include/tr1/boost_shared_ptr.h stable/8/contrib/libstdc++/include/tr1/random stable/8/contrib/libstdc++/libsupc++/eh_personality.cc stable/8/contrib/libstdc++/libsupc++/typeinfo stable/8/contrib/libstdc++/src/valarray-inst.cc Directory Properties: stable/8/contrib/libstdc++/ (props changed) Modified: stable/8/contrib/libstdc++/ChangeLog ============================================================================== --- stable/8/contrib/libstdc++/ChangeLog Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/ChangeLog Fri Feb 3 21:30:31 2012 (r230960) @@ -1,3 +1,133 @@ +2008-05-19 Release Manager + + * GCC 4.2.4 released. + +2008-03-13 David Edelsohn + + Backport from mainline: + 2008-01-26 David Edelsohn + + PR target/34794 + * config/os/aix/os_defines.h: Define __COMPATMATH__. + +2008-02-14 Kaveh R. Ghazi + + * testsuite/27_io/fpos/14320-1.cc: Check for "long long" and + remove XFAIL. + +2008-02-01 Release Manager + + * GCC 4.2.3 released. + +2008-01-06 Ted Phelps + + PR c++/34152 + * libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Check + _GLIBCXX_HAVE_GETIPINFO instead of HAVE_GETIPINFO. + +2008-01-05 Paolo Carlini + + PR libstdc++/34680 + + Revert: + 2007-12-17 Jonathan Wakely + * include/bits/locale_facets.tcc (has_facet, use_facet): Simplify + RTTI checks. + + 2007-12-14 Benjamin Kosnik + + PR libstdc++/30127 + PR libstdc++/34449 + * include/bits/locale_facets.tcc (use_facet): Check facet hierarchy. + (has_facet): Same. + * testsuite/22_locale/global_templates/user_facet_hierarchies.cc: New. + * testsuite/22_locale/global_templates/ + standard_facet_hierarchies.cc: New. + +2007-12-17 Jonathan Wakely + + * include/bits/locale_facets.tcc (has_facet, use_facet): Simplify + RTTI checks. + +2007-12-17 Benjamin Kosnik + + * testsuite/22_locale/global_templates/ + standard_facet_hierarchies.cc: Fix for generic locale model. + +2007-12-14 Benjamin Kosnik + + PR libstdc++/30127 + PR libstdc++/34449 + * include/bits/locale_facets.tcc (use_facet): Check facet hierarchy. + (has_facet): Same. + * testsuite/22_locale/global_templates/user_facet_hierarchies.cc: New. + * testsuite/22_locale/global_templates/ + standard_facet_hierarchies.cc: New. + +2007-11-26 Paolo Carlini + + * include/bits/locale_facets.tcc (num_put<>::_M_insert_int): When + ios_base::showpos and the type is signed and the value is zero, + prepend +. + * testsuite/22_locale/num_put/put/char/12.cc: New. + * testsuite/22_locale/num_put/put/wchar_t/12.cc: Likewise. + +2007-10-20 Paolo Carlini + + * include/tr1/random + (uniform_int<>::_M_call(_UniformRandomNumberGenerator&, result_type, + result_type, true_type)): Fix small thinko. + +2007-10-19 Paolo Carlini + + PR libstdc++/33815 + * include/tr1/random + (uniform_int<>::_M_call(_UniformRandomNumberGenerator&, result_type, + result_type, true_type)): Avoid the modulo (which uses the low-order + bits). + +2007-10-18 Paolo Carlini + + PR libstdc++/33807 + * include/bits/allocator.h (operator==(const allocator<_Tp>&, + const allocator<_Tp>&), operator!=(const allocator<_Tp>&, + const allocator<_Tp>&)): Add. + * testsuite/20_util/memory/allocator/33807.cc: New. + +2007-10-14 Jonathan Wakely + + * docs/html/Makefile: Follow up to libstdc++/14991, remove target. + +2007-10-14 Jonathan Wakely + + * src/valarray-inst.cc, include/ext/atomicity.h, + include/ext/concurrence.h, include/bits/basic_string.h, + include/bits/fstream.tcc, include/ext/vstring.h: Fix comment typos. + +2007-10-14 Jonathan Wakely + + * include/tr1_impl/boost_shared_ptr.h: (__weak_ptr::lock()): Add + missing template argument. + * testsuite/tr1/2_general_utilities/memory/shared_ptr/ + explicit_instantiation/2.cc: New. + * testsuite/tr1/2_general_utilities/memory/weak_ptr/ + explicit_instantiation/2.cc: New. + +2007-10-11 Paolo Carlini + + PR libstdc++/33734 + * include/ext/codecvt_specializations.h (encoding_state::good, + init, destroy): Use cast notation instead of reinterpret_cast. + +2007-10-07 Release Manager + + * GCC 4.2.2 released. + +2007-10-06 Benjamin Kosnik + + PR libstdc++/33678 + * libsupc++/typeinfo (typeinfo): Revert ordering of virtual components. + 2007-08-28 Paolo Carlini PR libstdc++/33128 Modified: stable/8/contrib/libstdc++/config/os/aix/os_defines.h ============================================================================== --- stable/8/contrib/libstdc++/config/os/aix/os_defines.h Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/config/os/aix/os_defines.h Fri Feb 3 21:30:31 2012 (r230960) @@ -1,6 +1,6 @@ // Specific definitions for AIX -*- C++ -*- -// Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc. +// Copyright (C) 2000, 2002, 2005, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -48,4 +48,9 @@ #define _ALL_SOURCE #endif +// C99 math +#ifndef __COMPATMATH__ +#define __COMPATMATH__ +#endif + #endif Modified: stable/8/contrib/libstdc++/include/bits/allocator.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/allocator.h Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/include/bits/allocator.h Fri Feb 3 21:30:31 2012 (r230960) @@ -115,11 +115,21 @@ _GLIBCXX_BEGIN_NAMESPACE(std) operator==(const allocator<_T1>&, const allocator<_T2>&) { return true; } + template + inline bool + operator==(const allocator<_Tp>&, const allocator<_Tp>&) + { return true; } + template inline bool operator!=(const allocator<_T1>&, const allocator<_T2>&) { return false; } + template + inline bool + operator!=(const allocator<_Tp>&, const allocator<_Tp>&) + { return false; } + // Inhibit implicit instantiations for required instantiations, // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. Modified: stable/8/contrib/libstdc++/include/bits/basic_string.h ============================================================================== --- stable/8/contrib/libstdc++/include/bits/basic_string.h Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/include/bits/basic_string.h Fri Feb 3 21:30:31 2012 (r230960) @@ -1672,7 +1672,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /** * @brief Find position of a character of C substring. * @param s String containing characters to locate. - * @param pos Index of character to search from (default 0). + * @param pos Index of character to search from. * @param n Number of characters from s to search for. * @return Index of first occurrence. * @@ -1733,7 +1733,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /** * @brief Find last position of a character of C substring. * @param s C string containing characters to locate. - * @param pos Index of character to search back from (default end). + * @param pos Index of character to search back from. * @param n Number of characters from s to search for. * @return Index of last occurrence. * @@ -1764,7 +1764,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /** * @brief Find last position of a character. * @param c Character to locate. - * @param pos Index of character to search back from (default 0). + * @param pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a pos, searches backward for @a c within this string. @@ -1794,7 +1794,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /** * @brief Find position of a character not in C substring. * @param s C string containing characters to avoid. - * @param pos Index of character to search from (default 0). + * @param pos Index of character to search from. * @param n Number of characters from s to consider. * @return Index of first occurrence. * @@ -1839,8 +1839,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /** * @brief Find last position of a character not in string. * @param str String containing characters to avoid. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. + * @param pos Index of character to search back from (default end). + * @return Index of last occurrence. * * Starting from @a pos, searches backward for a character not * contained in @a str within this string. If found, returns the index @@ -1853,9 +1853,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /** * @brief Find last position of a character not in C substring. * @param s C string containing characters to avoid. - * @param pos Index of character to search from (default 0). + * @param pos Index of character to search back from. * @param n Number of characters from s to consider. - * @return Index of first occurrence. + * @return Index of last occurrence. * * Starting from @a pos, searches backward for a character not * contained in the first @a n characters of @a s within this string. @@ -1866,10 +1866,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std) find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const; /** - * @brief Find position of a character not in C string. + * @brief Find last position of a character not in C string. * @param s C string containing characters to avoid. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. + * @param pos Index of character to search back from (default end). + * @return Index of last occurrence. * * Starting from @a pos, searches backward for a character not * contained in @a s within this string. If found, returns the index @@ -1885,8 +1885,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /** * @brief Find last position of a different character. * @param c Character to avoid. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. + * @param pos Index of character to search back from (default end). + * @return Index of last occurrence. * * Starting from @a pos, searches backward for a character other than * @a c within this string. If found, returns the index where it was Modified: stable/8/contrib/libstdc++/include/bits/fstream.tcc ============================================================================== --- stable/8/contrib/libstdc++/include/bits/fstream.tcc Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/include/bits/fstream.tcc Fri Feb 3 21:30:31 2012 (r230960) @@ -194,7 +194,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const bool __testin = _M_mode & ios_base::in; if (__testin && !_M_writing) { - // Check for pback madness, and if so swich back to the + // Check for pback madness, and if so switch back to the // normal buffers and jet outta here before expensive // fileops happen... _M_destroy_pback(); Modified: stable/8/contrib/libstdc++/include/bits/locale_facets.tcc ============================================================================== --- stable/8/contrib/libstdc++/include/bits/locale_facets.tcc Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/include/bits/locale_facets.tcc Fri Feb 3 21:30:31 2012 (r230960) @@ -1,6 +1,7 @@ // Locale support -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, +// 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -117,6 +118,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) return static_cast(*__facets[__i]); } + // Routine to access a cache for the facet. If the cache didn't // exist before, it gets constructed on the fly. template @@ -1015,13 +1017,13 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE if (__builtin_expect(__dec, true)) { // Decimal. - if (__v > 0) + if (__v >= 0) { if (__flags & ios_base::showpos && numeric_limits<_ValueT>::is_signed) *--__cs = __lit[__num_base::_S_oplus], ++__len; } - else if (__v) + else *--__cs = __lit[__num_base::_S_ominus], ++__len; } else if (__flags & ios_base::showbase && __v) Modified: stable/8/contrib/libstdc++/include/ext/atomicity.h ============================================================================== --- stable/8/contrib/libstdc++/include/ext/atomicity.h Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/include/ext/atomicity.h Fri Feb 3 21:30:31 2012 (r230960) @@ -42,7 +42,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) // Functions for portable atomic access. - // To abstract locking primatives across all thread policies, use: + // To abstract locking primitives across all thread policies, use: // __exchange_and_add_dispatch // __atomic_add_dispatch #ifdef _GLIBCXX_ATOMIC_BUILTINS Modified: stable/8/contrib/libstdc++/include/ext/codecvt_specializations.h ============================================================================== --- stable/8/contrib/libstdc++/include/ext/codecvt_specializations.h Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/include/ext/codecvt_specializations.h Fri Feb 3 21:30:31 2012 (r230960) @@ -128,7 +128,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) bool good() const throw() { - const descriptor_type __err = reinterpret_cast(-1); + const descriptor_type __err = (iconv_t)(-1); bool __test = _M_in_desc && _M_in_desc != __err; __test &= _M_out_desc && _M_out_desc != __err; return __test; @@ -166,7 +166,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) void init() { - const descriptor_type __err = reinterpret_cast(-1); + const descriptor_type __err = (iconv_t)(-1); const bool __have_encodings = _M_int_enc.size() && _M_ext_enc.size(); if (!_M_in_desc && __have_encodings) { @@ -199,7 +199,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) void destroy() throw() { - const descriptor_type __err = reinterpret_cast(-1); + const descriptor_type __err = (iconv_t)(-1); if (_M_in_desc && _M_in_desc != __err) { iconv_close(_M_in_desc); Modified: stable/8/contrib/libstdc++/include/ext/concurrence.h ============================================================================== --- stable/8/contrib/libstdc++/include/ext/concurrence.h Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/include/ext/concurrence.h Fri Feb 3 21:30:31 2012 (r230960) @@ -46,7 +46,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) // Available locking policies: // _S_single single-threaded code that doesn't need to be locked. // _S_mutex multi-threaded code that requires additional support - // from gthr.h or abstraction layers in concurrance.h. + // from gthr.h or abstraction layers in concurrence.h. // _S_atomic multi-threaded code using atomic operations. enum _Lock_policy { _S_single, _S_mutex, _S_atomic }; Modified: stable/8/contrib/libstdc++/include/ext/vstring.h ============================================================================== --- stable/8/contrib/libstdc++/include/ext/vstring.h Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/include/ext/vstring.h Fri Feb 3 21:30:31 2012 (r230960) @@ -1407,7 +1407,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) /** * @brief Find position of a character of C substring. * @param s String containing characters to locate. - * @param pos Index of character to search from (default 0). + * @param pos Index of character to search from. * @param n Number of characters from s to search for. * @return Index of first occurrence. * @@ -1468,7 +1468,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) /** * @brief Find last position of a character of C substring. * @param s C string containing characters to locate. - * @param pos Index of character to search back from (default end). + * @param pos Index of character to search back from. * @param n Number of characters from s to search for. * @return Index of last occurrence. * @@ -1499,7 +1499,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) /** * @brief Find last position of a character. * @param c Character to locate. - * @param pos Index of character to search back from (default 0). + * @param pos Index of character to search back from (default end). * @return Index of last occurrence. * * Starting from @a pos, searches backward for @a c within this string. @@ -1529,7 +1529,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) /** * @brief Find position of a character not in C substring. * @param s C string containing characters to avoid. - * @param pos Index of character to search from (default 0). + * @param pos Index of character to search from. * @param n Number of characters from s to consider. * @return Index of first occurrence. * @@ -1574,8 +1574,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) /** * @brief Find last position of a character not in string. * @param str String containing characters to avoid. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. + * @param pos Index of character to search back from (default end). + * @return Index of last occurrence. * * Starting from @a pos, searches backward for a character not * contained in @a str within this string. If found, returns the index @@ -1589,9 +1589,9 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) /** * @brief Find last position of a character not in C substring. * @param s C string containing characters to avoid. - * @param pos Index of character to search from (default 0). + * @param pos Index of character to search back from. * @param n Number of characters from s to consider. - * @return Index of first occurrence. + * @return Index of last occurrence. * * Starting from @a pos, searches backward for a character not * contained in the first @a n characters of @a s within this string. @@ -1602,10 +1602,10 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const; /** - * @brief Find position of a character not in C string. + * @brief Find last position of a character not in C string. * @param s C string containing characters to avoid. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. + * @param pos Index of character to search back from (default end). + * @return Index of last occurrence. * * Starting from @a pos, searches backward for a character not * contained in @a s within this string. If found, returns the index @@ -1621,8 +1621,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) /** * @brief Find last position of a different character. * @param c Character to avoid. - * @param pos Index of character to search from (default 0). - * @return Index of first occurrence. + * @param pos Index of character to search back from (default end). + * @return Index of last occurrence. * * Starting from @a pos, searches backward for a character other than * @a c within this string. If found, returns the index where it was Modified: stable/8/contrib/libstdc++/include/tr1/boost_shared_ptr.h ============================================================================== --- stable/8/contrib/libstdc++/include/tr1/boost_shared_ptr.h Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/include/tr1/boost_shared_ptr.h Fri Feb 3 21:30:31 2012 (r230960) @@ -857,7 +857,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) // Q: How can we get here? // A: Another thread may have invalidated r after the // use_count test above. - return __shared_ptr(); + return __shared_ptr(); } #else Modified: stable/8/contrib/libstdc++/include/tr1/random ============================================================================== --- stable/8/contrib/libstdc++/include/tr1/random Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/include/tr1/random Fri Feb 3 21:30:31 2012 (r230960) @@ -1618,10 +1618,15 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) result_type _M_call(_UniformRandomNumberGenerator& __urng, result_type __min, result_type __max, true_type) - { + { + // XXX Must be fixed to also work when __urng.max() - __urng.min() + // is smaller than __max - __min. typedef typename __gnu_cxx::__add_unsigned::__type __utype; - return result_type(__utype(__urng()) % (__max - __min + 1)) + __min; + return result_type((__max - __min + 1.0L) + * (__utype(__urng()) - __utype(__urng.min())) + / (__utype(__urng.max()) + - __utype(__urng.min()) + 1.0L)) + __min; } template Modified: stable/8/contrib/libstdc++/libsupc++/eh_personality.cc ============================================================================== --- stable/8/contrib/libstdc++/libsupc++/eh_personality.cc Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/libsupc++/eh_personality.cc Fri Feb 3 21:30:31 2012 (r230960) @@ -1,5 +1,5 @@ // -*- C++ -*- The GNU C++ exception personality routine. -// Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003, 2006, 2008 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -434,7 +434,7 @@ PERSONALITY_FUNCTION (int version, // Parse the LSDA header. p = parse_lsda_header (context, language_specific_data, &info); info.ttype_base = base_of_encoded_value (info.ttype_encoding, context); -#ifdef HAVE_GETIPINFO +#ifdef _GLIBCXX_HAVE_GETIPINFO ip = _Unwind_GetIPInfo (context, &ip_before_insn); #else ip = _Unwind_GetIP (context); Modified: stable/8/contrib/libstdc++/libsupc++/typeinfo ============================================================================== --- stable/8/contrib/libstdc++/libsupc++/typeinfo Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/libsupc++/typeinfo Fri Feb 3 21:30:31 2012 (r230960) @@ -99,7 +99,13 @@ namespace std #endif bool operator!=(const type_info& __arg) const { return !operator==(__arg); } - + + // Return true if this is a pointer type of some kind + virtual bool __is_pointer_p() const; + + // Return true if this is a function type + virtual bool __is_function_p() const; + // Try and catch a thrown type. Store an adjusted pointer to the // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then // THR_OBJ points to the thrown object. If THR_TYPE is a pointer @@ -113,12 +119,6 @@ namespace std virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target, void **__obj_ptr) const; - // Return true if this is a pointer type of some kind - virtual bool __is_pointer_p() const; - - // Return true if this is a function type - virtual bool __is_function_p() const; - protected: const char *__name; Modified: stable/8/contrib/libstdc++/src/valarray-inst.cc ============================================================================== --- stable/8/contrib/libstdc++/src/valarray-inst.cc Fri Feb 3 21:26:25 2012 (r230959) +++ stable/8/contrib/libstdc++/src/valarray-inst.cc Fri Feb 3 21:30:31 2012 (r230960) @@ -68,7 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) __gslice_to_index(size_t __o, const valarray& __l, const valarray& __s, valarray& __i) { - // There are as much as dimensions as there are strides. + // There are as many dimensions as there are strides. size_t __n = __l.size(); // Get a buffer to hold current multi-index as we go through From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 21:38:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFC61106566C; Fri, 3 Feb 2012 21:38:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F7278FC0A; Fri, 3 Feb 2012 21:38:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13LcN4E005287; Fri, 3 Feb 2012 21:38:23 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13LcN7R005285; Fri, 3 Feb 2012 21:38:23 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202032138.q13LcN7R005285@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 3 Feb 2012 21:38:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230961 - stable/9/usr.bin/printf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 21:38:23 -0000 Author: pfg Date: Fri Feb 3 21:38:23 2012 New Revision: 230961 URL: http://svn.freebsd.org/changeset/base/230961 Log: MFC: r230027 Style cleanups for printf. PR: bin/152934 Approved by: jhb (mentor) Obtained from: Illumos Modified: stable/9/usr.bin/printf/printf.c Directory Properties: stable/9/usr.bin/printf/ (props changed) Modified: stable/9/usr.bin/printf/printf.c ============================================================================== --- stable/9/usr.bin/printf/printf.c Fri Feb 3 21:30:31 2012 (r230960) +++ stable/9/usr.bin/printf/printf.c Fri Feb 3 21:38:23 2012 (r230961) @@ -66,21 +66,21 @@ static const char rcsid[] = #include "error.h" #endif -#define PF(f, func) do { \ - char *b = NULL; \ - if (havewidth) \ - if (haveprec) \ +#define PF(f, func) do { \ + char *b = NULL; \ + if (havewidth) \ + if (haveprec) \ (void)asprintf(&b, f, fieldwidth, precision, func); \ - else \ - (void)asprintf(&b, f, fieldwidth, func); \ - else if (haveprec) \ - (void)asprintf(&b, f, precision, func); \ - else \ - (void)asprintf(&b, f, func); \ - if (b) { \ - (void)fputs(b, stdout); \ - free(b); \ - } \ + else \ + (void)asprintf(&b, f, fieldwidth, func); \ + else if (haveprec) \ + (void)asprintf(&b, f, precision, func); \ + else \ + (void)asprintf(&b, f, func); \ + if (b) { \ + (void)fputs(b, stdout); \ + free(b); \ + } \ } while (0) static int asciicode(void); @@ -357,10 +357,10 @@ mknum(char *str, char ch) static int escape(char *fmt, int percent, size_t *len) { - char *save, *store; - int value, c; + char *save, *store, c; + int value; - for (save = store = fmt; (c = *fmt); ++fmt, ++store) { + for (save = store = fmt; ((c = *fmt) != 0); ++fmt, ++store) { if (c != '\\') { *store = c; continue; @@ -414,7 +414,7 @@ escape(char *fmt, int percent, size_t *l *store++ = '%'; *store = '%'; } else - *store = value; + *store = (char)value; break; default: *store = *fmt; From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 22:06:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37FA0106566B; Fri, 3 Feb 2012 22:06:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EF498FC0C; Fri, 3 Feb 2012 22:06:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13M6SDO006253; Fri, 3 Feb 2012 22:06:28 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13M6RUi006248; Fri, 3 Feb 2012 22:06:27 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202032206.q13M6RUi006248@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 3 Feb 2012 22:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230962 - in stable/9/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 22:06:28 -0000 Author: pfg Date: Fri Feb 3 22:06:27 2012 New Revision: 230962 URL: http://svn.freebsd.org/changeset/base/230962 Log: MFC: r229430, r229980 Replace a GPL'd header in the emu10k1 snd driver code. This brings in the emuxkireg.h from NetBSD (dev/pci) which is used for the same purpose but is smaller. The emu10k1 is now free from the GPL. While here also merge some cleanups to the module Makefile. PR: 153901 Obtained from: NetBSD Approved by: core (mentor implicit) Added: stable/9/sys/dev/sound/pci/emuxkireg.h - copied unchanged from r229430, head/sys/dev/sound/pci/emuxkireg.h Modified: stable/9/sys/conf/files stable/9/sys/dev/sound/pci/emu10k1.c stable/9/sys/modules/sound/driver/emu10k1/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/modules/sound/driver/emu10k1/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Fri Feb 3 21:38:23 2012 (r230961) +++ stable/9/sys/conf/files Fri Feb 3 22:06:27 2012 (r230962) @@ -50,7 +50,7 @@ aic79xx_reg_print.c optional ahd pci aic79xx_reg_print.o optional ahd pci ahd_reg_pretty_print \ compile-with "${NORMAL_C}" \ no-implicit-rule local -emu10k1-alsa%diked.h optional snd_emu10k1 | snd_emu10kx \ +emu10k1-alsa%diked.h optional snd_emu10kx \ dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h" \ 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 \ @@ -1727,9 +1727,7 @@ dev/sound/pci/csa.c optional snd_csa pc warning "kernel contains GPL contaminated csaimg.h header" dev/sound/pci/csapcm.c optional snd_csa pci dev/sound/pci/ds1.c optional snd_ds1 pci -dev/sound/pci/emu10k1.c optional snd_emu10k1 pci \ - dependency "emu10k1-alsa%diked.h" \ - warning "kernel contains GPL contaminated emu10k1 headers" +dev/sound/pci/emu10k1.c optional snd_emu10k1 pci dev/sound/pci/emu10kx.c optional snd_emu10kx pci \ dependency "emu10k1-alsa%diked.h" \ dependency "p16v-alsa%diked.h" \ Modified: stable/9/sys/dev/sound/pci/emu10k1.c ============================================================================== --- stable/9/sys/dev/sound/pci/emu10k1.c Fri Feb 3 21:38:23 2012 (r230961) +++ stable/9/sys/dev/sound/pci/emu10k1.c Fri Feb 3 22:06:27 2012 (r230962) @@ -32,7 +32,7 @@ #include #include -#include "emu10k1-alsa%diked.h" +#include #include #include @@ -66,12 +66,94 @@ SND_DECLARE_FILE("$FreeBSD$"); #define ENABLE 0xffffffff #define DISABLE 0x00000000 -#define ENV_ON DCYSUSV_CHANNELENABLE_MASK +#define ENV_ON EMU_CHAN_DCYSUSV_CHANNELENABLE_MASK #define ENV_OFF 0x00 /* XXX: should this be 1? */ -#define A_IOCFG_GPOUT_A 0x40 /* Analog Output */ -#define A_IOCFG_GPOUT_D 0x04 /* Digital Output */ -#define A_IOCFG_GPOUT_AD (A_IOCFG_GPOUT_A|A_IOCFG_GPOUT_D) /* A_IOCFG_GPOUT0 */ +#define EMU_A_IOCFG_GPOUT_A 0x40 +#define EMU_A_IOCFG_GPOUT_D 0x04 +#define EMU_A_IOCFG_GPOUT_AD (EMU_A_IOCFG_GPOUT_A|EMU_A_IOCFG_GPOUT_D) /* EMU_A_IOCFG_GPOUT0 */ + +#define EMU_HCFG_GPOUT1 0x00000800 + +/* instruction set */ +#define iACC3 0x06 +#define iMACINT0 0x04 +#define iINTERP 0x0e + +#define C_00000000 0x40 +#define C_00000001 0x41 +#define C_00000004 0x44 +#define C_40000000 0x4d +/* Audigy constants */ +#define A_C_00000000 0xc0 +#define A_C_40000000 0xcd + +/* GPRs */ +#define FXBUS(x) (0x00 + (x)) +#define EXTIN(x) (0x10 + (x)) +#define EXTOUT(x) (0x20 + (x)) + +#define GPR(x) (EMU_FXGPREGBASE + (x)) +#define A_EXTIN(x) (0x40 + (x)) +#define A_FXBUS(x) (0x00 + (x)) +#define A_EXTOUT(x) (0x60 + (x)) +#define A_GPR(x) (EMU_A_FXGPREGBASE + (x)) + +/* FX buses */ +#define FXBUS_PCM_LEFT 0x00 +#define FXBUS_PCM_RIGHT 0x01 +#define FXBUS_MIDI_LEFT 0x04 +#define FXBUS_MIDI_RIGHT 0x05 +#define FXBUS_MIDI_REVERB 0x0c +#define FXBUS_MIDI_CHORUS 0x0d + +/* Inputs */ +#define EXTIN_AC97_L 0x00 +#define EXTIN_AC97_R 0x01 +#define EXTIN_SPDIF_CD_L 0x02 +#define EXTIN_SPDIF_CD_R 0x03 +#define EXTIN_TOSLINK_L 0x06 +#define EXTIN_TOSLINK_R 0x07 +#define EXTIN_COAX_SPDIF_L 0x0a +#define EXTIN_COAX_SPDIF_R 0x0b +/* Audigy Inputs */ +#define A_EXTIN_AC97_L 0x00 +#define A_EXTIN_AC97_R 0x01 + +/* Outputs */ +#define EXTOUT_AC97_L 0x00 +#define EXTOUT_AC97_R 0x01 +#define EXTOUT_TOSLINK_L 0x02 +#define EXTOUT_TOSLINK_R 0x03 +#define EXTOUT_AC97_CENTER 0x04 +#define EXTOUT_AC97_LFE 0x05 +#define EXTOUT_HEADPHONE_L 0x06 +#define EXTOUT_HEADPHONE_R 0x07 +#define EXTOUT_REAR_L 0x08 +#define EXTOUT_REAR_R 0x09 +#define EXTOUT_ADC_CAP_L 0x0a +#define EXTOUT_ADC_CAP_R 0x0b +#define EXTOUT_ACENTER 0x11 +#define EXTOUT_ALFE 0x12 +/* Audigy Outputs */ +#define A_EXTOUT_FRONT_L 0x00 +#define A_EXTOUT_FRONT_R 0x01 +#define A_EXTOUT_CENTER 0x02 +#define A_EXTOUT_LFE 0x03 +#define A_EXTOUT_HEADPHONE_L 0x04 +#define A_EXTOUT_HEADPHONE_R 0x05 +#define A_EXTOUT_REAR_L 0x06 +#define A_EXTOUT_REAR_R 0x07 +#define A_EXTOUT_AFRONT_L 0x08 +#define A_EXTOUT_AFRONT_R 0x09 +#define A_EXTOUT_ACENTER 0x0a +#define A_EXTOUT_ALFE 0x0b +#define A_EXTOUT_AREAR_L 0x0e +#define A_EXTOUT_AREAR_R 0x0f +#define A_EXTOUT_AC97_L 0x10 +#define A_EXTOUT_AC97_R 0x11 +#define A_EXTOUT_ADC_CAP_L 0x16 +#define A_EXTOUT_ADC_CAP_R 0x17 struct emu_memblk { SLIST_ENTRY(emu_memblk) link; @@ -247,9 +329,9 @@ emu_rdptr(struct sc_info *sc, int chn, i { u_int32_t ptr, val, mask, size, offset; - ptr = ((reg << 16) & sc->addrmask) | (chn & PTR_CHANNELNUM_MASK); - emu_wr(sc, PTR, ptr, 4); - val = emu_rd(sc, DATA, 4); + ptr = ((reg << 16) & sc->addrmask) | (chn & EMU_PTR_CHNO_MASK); + emu_wr(sc, EMU_PTR, ptr, 4); + val = emu_rd(sc, EMU_DATA, 4); if (reg & 0xff000000) { size = (reg >> 24) & 0x3f; offset = (reg >> 16) & 0x1f; @@ -265,23 +347,23 @@ emu_wrptr(struct sc_info *sc, int chn, i { u_int32_t ptr, mask, size, offset; - ptr = ((reg << 16) & sc->addrmask) | (chn & PTR_CHANNELNUM_MASK); - emu_wr(sc, PTR, ptr, 4); + ptr = ((reg << 16) & sc->addrmask) | (chn & EMU_PTR_CHNO_MASK); + emu_wr(sc, EMU_PTR, ptr, 4); if (reg & 0xff000000) { size = (reg >> 24) & 0x3f; offset = (reg >> 16) & 0x1f; mask = ((1 << size) - 1) << offset; data <<= offset; data &= mask; - data |= emu_rd(sc, DATA, 4) & ~mask; + data |= emu_rd(sc, EMU_DATA, 4) & ~mask; } - emu_wr(sc, DATA, data, 4); + emu_wr(sc, EMU_DATA, data, 4); } static void emu_wrefx(struct sc_info *sc, unsigned int pc, unsigned int data) { - pc += sc->audigy ? A_MICROCODEBASE : MICROCODEBASE; + pc += sc->audigy ? EMU_A_MICROCODEBASE : EMU_MICROCODEBASE; emu_wrptr(sc, 0, pc, data); } @@ -294,8 +376,8 @@ emu_rdcd(kobj_t obj, void *devinfo, int { struct sc_info *sc = (struct sc_info *)devinfo; - emu_wr(sc, AC97ADDRESS, regno, 1); - return emu_rd(sc, AC97DATA, 2); + emu_wr(sc, EMU_AC97ADDR, regno, 1); + return emu_rd(sc, EMU_AC97DATA, 2); } static int @@ -303,8 +385,8 @@ emu_wrcd(kobj_t obj, void *devinfo, int { struct sc_info *sc = (struct sc_info *)devinfo; - emu_wr(sc, AC97ADDRESS, regno, 1); - emu_wr(sc, AC97DATA, data, 2); + emu_wr(sc, EMU_AC97ADDR, regno, 1); + emu_wr(sc, EMU_AC97DATA, data, 2); return 0; } @@ -346,7 +428,7 @@ emu_settimer(struct sc_info *sc) } RANGE(rate, 48, 9600); sc->timerinterval = 48000 / rate; - emu_wr(sc, TIMER, sc->timerinterval & 0x03ff, 2); + emu_wr(sc, EMU_TIMER, sc->timerinterval & 0x03ff, 2); return sc->timerinterval; } @@ -357,15 +439,15 @@ emu_enatimer(struct sc_info *sc, int go) u_int32_t x; if (go) { if (sc->timer++ == 0) { - x = emu_rd(sc, INTE, 4); - x |= INTE_INTERVALTIMERENB; - emu_wr(sc, INTE, x, 4); + x = emu_rd(sc, EMU_INTE, 4); + x |= EMU_INTE_INTERTIMERENB; + emu_wr(sc, EMU_INTE, x, 4); } } else { sc->timer = 0; - x = emu_rd(sc, INTE, 4); - x &= ~INTE_INTERVALTIMERENB; - emu_wr(sc, INTE, x, 4); + x = emu_rd(sc, EMU_INTE, 4); + x &= ~EMU_INTE_INTERTIMERENB; + emu_wr(sc, EMU_INTE, x, 4); } return 0; } @@ -373,7 +455,7 @@ emu_enatimer(struct sc_info *sc, int go) static void emu_enastop(struct sc_info *sc, char channel, int enable) { - int reg = (channel & 0x20) ? SOLEH : SOLEL; + int reg = (channel & 0x20) ? EMU_SOLEH : EMU_SOLEL; channel &= 0x1f; reg |= 1 << 24; reg |= channel << 16; @@ -568,49 +650,49 @@ emu_vwrite(struct sc_info *sc, struct em r = v->ismaster ? 0 : r; } - emu_wrptr(sc, v->vnum, CPF, v->stereo ? CPF_STEREO_MASK : 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF, v->stereo ? EMU_CHAN_CPF_STEREO_MASK : 0); val = v->stereo ? 28 : 30; val *= v->b16 ? 1 : 2; start = sa + val; if (sc->audigy) { - emu_wrptr(sc, v->vnum, A_FXRT1, v->fxrt1); - emu_wrptr(sc, v->vnum, A_FXRT2, v->fxrt2); - emu_wrptr(sc, v->vnum, A_SENDAMOUNTS, 0); + emu_wrptr(sc, v->vnum, EMU_A_CHAN_FXRT1, v->fxrt1); + emu_wrptr(sc, v->vnum, EMU_A_CHAN_FXRT2, v->fxrt2); + emu_wrptr(sc, v->vnum, EMU_A_CHAN_SENDAMOUNTS, 0); } else - emu_wrptr(sc, v->vnum, FXRT, v->fxrt1 << 16); + emu_wrptr(sc, v->vnum, EMU_CHAN_FXRT, v->fxrt1 << 16); - emu_wrptr(sc, v->vnum, PTRX, (x << 8) | r); - emu_wrptr(sc, v->vnum, DSL, ea | (y << 24)); - emu_wrptr(sc, v->vnum, PSST, sa | (l << 24)); - emu_wrptr(sc, v->vnum, CCCA, start | (v->b16 ? 0 : CCCA_8BITSELECT)); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX, (x << 8) | r); + emu_wrptr(sc, v->vnum, EMU_CHAN_DSL, ea | (y << 24)); + emu_wrptr(sc, v->vnum, EMU_CHAN_PSST, sa | (l << 24)); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCCA, start | (v->b16 ? 0 : EMU_CHAN_CCCA_8BITSELECT)); - emu_wrptr(sc, v->vnum, Z1, 0); - emu_wrptr(sc, v->vnum, Z2, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_Z1, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_Z2, 0); silent_page = ((u_int32_t)(sc->mem.silent_page_addr) << 1) - | MAP_PTI_MASK; - emu_wrptr(sc, v->vnum, MAPA, silent_page); - emu_wrptr(sc, v->vnum, MAPB, silent_page); - - emu_wrptr(sc, v->vnum, CVCF, CVCF_CURRENTFILTER_MASK); - emu_wrptr(sc, v->vnum, VTFT, VTFT_FILTERTARGET_MASK); - emu_wrptr(sc, v->vnum, ATKHLDM, 0); - emu_wrptr(sc, v->vnum, DCYSUSM, DCYSUSM_DECAYTIME_MASK); - emu_wrptr(sc, v->vnum, LFOVAL1, 0x8000); - emu_wrptr(sc, v->vnum, LFOVAL2, 0x8000); - emu_wrptr(sc, v->vnum, FMMOD, 0); - emu_wrptr(sc, v->vnum, TREMFRQ, 0); - emu_wrptr(sc, v->vnum, FM2FRQ2, 0); - emu_wrptr(sc, v->vnum, ENVVAL, 0x8000); - - emu_wrptr(sc, v->vnum, ATKHLDV, - ATKHLDV_HOLDTIME_MASK | ATKHLDV_ATTACKTIME_MASK); - emu_wrptr(sc, v->vnum, ENVVOL, 0x8000); + | EMU_CHAN_MAP_PTI_MASK; + emu_wrptr(sc, v->vnum, EMU_CHAN_MAPA, silent_page); + emu_wrptr(sc, v->vnum, EMU_CHAN_MAPB, silent_page); + + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, EMU_CHAN_CVCF_CURRFILTER_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, EMU_CHAN_VTFT_FILTERTARGET_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_ATKHLDM, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_DCYSUSM, EMU_CHAN_DCYSUSM_DECAYTIME_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_LFOVAL1, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_LFOVAL2, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_FMMOD, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_TREMFRQ, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_FM2FRQ2, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_ENVVAL, 0x8000); + + emu_wrptr(sc, v->vnum, EMU_CHAN_ATKHLDV, + EMU_CHAN_ATKHLDV_HOLDTIME_MASK | EMU_CHAN_ATKHLDV_ATTACKTIME_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_ENVVOL, 0x8000); - emu_wrptr(sc, v->vnum, PEFE_FILTERAMOUNT, 0x7f); - emu_wrptr(sc, v->vnum, PEFE_PITCHAMOUNT, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_PEFE_FILTERAMOUNT, 0x7f); + emu_wrptr(sc, v->vnum, EMU_CHAN_PEFE_PITCHAMOUNT, 0); if (v->slave != NULL) emu_vwrite(sc, v->slave); @@ -631,29 +713,29 @@ emu_vtrigger(struct sc_info *sc, struct sample = v->b16 ? 0x00000000 : 0x80808080; for (i = 0; i < cs; i++) - emu_wrptr(sc, v->vnum, CD0 + i, sample); - emu_wrptr(sc, v->vnum, CCR_CACHEINVALIDSIZE, 0); - emu_wrptr(sc, v->vnum, CCR_READADDRESS, cra); - emu_wrptr(sc, v->vnum, CCR_CACHEINVALIDSIZE, ccis); - - emu_wrptr(sc, v->vnum, IFATN, 0xff00); - emu_wrptr(sc, v->vnum, VTFT, 0xffffffff); - emu_wrptr(sc, v->vnum, CVCF, 0xffffffff); - emu_wrptr(sc, v->vnum, DCYSUSV, 0x00007f7f); + emu_wrptr(sc, v->vnum, EMU_CHAN_CD0 + i, sample); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_CACHEINVALIDSIZE, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_READADDRESS, cra); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_CACHEINVALIDSIZE, ccis); + + emu_wrptr(sc, v->vnum, EMU_CHAN_IFATN, 0xff00); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, 0xffffffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, 0xffffffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_DCYSUSV, 0x00007f7f); emu_enastop(sc, v->vnum, 0); pitch_target = emu_rate_to_linearpitch(v->speed); initial_pitch = emu_rate_to_pitch(v->speed) >> 8; - emu_wrptr(sc, v->vnum, PTRX_PITCHTARGET, pitch_target); - emu_wrptr(sc, v->vnum, CPF_CURRENTPITCH, pitch_target); - emu_wrptr(sc, v->vnum, IP, initial_pitch); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX_PITCHTARGET, pitch_target); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF_PITCH, pitch_target); + emu_wrptr(sc, v->vnum, EMU_CHAN_IP, initial_pitch); } else { - emu_wrptr(sc, v->vnum, PTRX_PITCHTARGET, 0); - emu_wrptr(sc, v->vnum, CPF_CURRENTPITCH, 0); - emu_wrptr(sc, v->vnum, IFATN, 0xffff); - emu_wrptr(sc, v->vnum, VTFT, 0x0000ffff); - emu_wrptr(sc, v->vnum, CVCF, 0x0000ffff); - emu_wrptr(sc, v->vnum, IP, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX_PITCHTARGET, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF_PITCH, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_IFATN, 0xffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, 0x0000ffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, 0x0000ffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_IP, 0); emu_enastop(sc, v->vnum, 1); } if (v->slave != NULL) @@ -666,7 +748,7 @@ emu_vpos(struct sc_info *sc, struct emu_ int s, ptr; s = (v->b16 ? 1 : 0) + (v->stereo ? 1 : 0); - ptr = (emu_rdptr(sc, v->vnum, CCCA_CURRADDR) - (v->start >> s)) << s; + ptr = (emu_rdptr(sc, v->vnum, EMU_CHAN_CCCA_CURRADDR) - (v->start >> s)) << s; return ptr & ~0x0000001f; } @@ -875,27 +957,27 @@ emurchan_init(kobj_t obj, void *devinfo, ch->num = sc->rnum; switch(sc->rnum) { case 0: - ch->idxreg = sc->audigy ? A_ADCIDX : ADCIDX; - ch->basereg = ADCBA; - ch->sizereg = ADCBS; - ch->setupreg = ADCCR; - ch->irqmask = INTE_ADCBUFENABLE; + ch->idxreg = sc->audigy ? EMU_A_ADCIDX : EMU_ADCIDX; + ch->basereg = EMU_ADCBA; + ch->sizereg = EMU_ADCBS; + ch->setupreg = EMU_ADCCR; + ch->irqmask = EMU_INTE_ADCBUFENABLE; break; case 1: - ch->idxreg = FXIDX; - ch->basereg = FXBA; - ch->sizereg = FXBS; - ch->setupreg = FXWC; - ch->irqmask = INTE_EFXBUFENABLE; + ch->idxreg = EMU_FXIDX; + ch->basereg = EMU_FXBA; + ch->sizereg = EMU_FXBS; + ch->setupreg = EMU_FXWC; + ch->irqmask = EMU_INTE_EFXBUFENABLE; break; case 2: - ch->idxreg = MICIDX; - ch->basereg = MICBA; - ch->sizereg = MICBS; + ch->idxreg = EMU_MICIDX; + ch->basereg = EMU_MICBA; + ch->sizereg = EMU_MICBS; ch->setupreg = 0; - ch->irqmask = INTE_MICBUFENABLE; + ch->irqmask = EMU_INTE_MICBUFENABLE; break; } sc->rnum++; @@ -967,27 +1049,27 @@ emurchan_trigger(kobj_t obj, void *data, switch(sc->bufsz) { case 4096: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; break; case 8192: - sz = ADCBS_BUFSIZE_8192; + sz = EMU_RECBS_BUFSIZE_8192; break; case 16384: - sz = ADCBS_BUFSIZE_16384; + sz = EMU_RECBS_BUFSIZE_16384; break; case 32768: - sz = ADCBS_BUFSIZE_32768; + sz = EMU_RECBS_BUFSIZE_32768; break; case 65536: - sz = ADCBS_BUFSIZE_65536; + sz = EMU_RECBS_BUFSIZE_65536; break; default: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; } snd_mtxlock(sc->lock); @@ -997,23 +1079,23 @@ emurchan_trigger(kobj_t obj, void *data, emu_wrptr(sc, 0, ch->sizereg, sz); if (ch->num == 0) { if (sc->audigy) { - val = A_ADCCR_LCHANENABLE; + val = EMU_A_ADCCR_LCHANENABLE; if (AFMT_CHANNEL(ch->fmt) > 1) - val |= A_ADCCR_RCHANENABLE; + val |= EMU_A_ADCCR_RCHANENABLE; val |= audigy_recval(ch->spd); } else { - val = ADCCR_LCHANENABLE; + val = EMU_ADCCR_LCHANENABLE; if (AFMT_CHANNEL(ch->fmt) > 1) - val |= ADCCR_RCHANENABLE; + val |= EMU_ADCCR_RCHANENABLE; val |= emu_recval(ch->spd); } emu_wrptr(sc, 0, ch->setupreg, 0); emu_wrptr(sc, 0, ch->setupreg, val); } - val = emu_rd(sc, INTE, 4); + val = emu_rd(sc, EMU_INTE, 4); val |= ch->irqmask; - emu_wr(sc, INTE, val, 4); + emu_wr(sc, EMU_INTE, val, 4); break; case PCMTRIG_STOP: @@ -1022,9 +1104,9 @@ emurchan_trigger(kobj_t obj, void *data, emu_wrptr(sc, 0, ch->sizereg, 0); if (ch->setupreg) emu_wrptr(sc, 0, ch->setupreg, 0); - val = emu_rd(sc, INTE, 4); + val = emu_rd(sc, EMU_INTE, 4); val &= ~ch->irqmask; - emu_wr(sc, INTE, val, 4); + emu_wr(sc, EMU_INTE, val, 4); break; case PCMTRIG_EMLDMAWR: @@ -1122,9 +1204,9 @@ emu_midiattach(struct sc_info *sc) { int i; - i = emu_rd(sc, INTE, 4); - i |= INTE_MIDIRXENABLE; - emu_wr(sc, INTE, i, 4); + i = emu_rd(sc, EMU_INTE, 4); + i |= EMU_INTE_MIDIRXENABLE; + emu_wr(sc, EMU_INTE, i, 4); sc->mpu = mpu401_init(&emu_mpu_class, sc, emu_intr2, &sc->mpu_intr); } @@ -1139,52 +1221,52 @@ emu_intr(void *data) snd_mtxlock(sc->lock); while (1) { - stat = emu_rd(sc, IPR, 4); + stat = emu_rd(sc, EMU_IPR, 4); if (stat == 0) break; ack = 0; /* process irq */ - if (stat & IPR_INTERVALTIMER) - ack |= IPR_INTERVALTIMER; + if (stat & EMU_IPR_INTERVALTIMER) + ack |= EMU_IPR_INTERVALTIMER; - if (stat & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL)) - ack |= stat & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL); + if (stat & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL)) + ack |= stat & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL); - if (stat & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL)) - ack |= stat & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL); + if (stat & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL)) + ack |= stat & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL); - if (stat & (IPR_MICBUFFULL | IPR_MICBUFHALFFULL)) - ack |= stat & (IPR_MICBUFFULL | IPR_MICBUFHALFFULL); + if (stat & (EMU_IPR_MICBUFFULL | EMU_IPR_MICBUFHALFFULL)) + ack |= stat & (EMU_IPR_MICBUFFULL | EMU_IPR_MICBUFHALFFULL); - if (stat & IPR_PCIERROR) { - ack |= IPR_PCIERROR; + if (stat & EMU_PCIERROR) { + ack |= EMU_PCIERROR; device_printf(sc->dev, "pci error\n"); /* we still get an nmi with ecc ram even if we ack this */ } - if (stat & IPR_SAMPLERATETRACKER) { - ack |= IPR_SAMPLERATETRACKER; + if (stat & EMU_IPR_RATETRCHANGE) { + ack |= EMU_IPR_RATETRCHANGE; #ifdef EMUDEBUG device_printf(sc->dev, "sample rate tracker lock status change\n"); #endif } - if (stat & IPR_MIDIRECVBUFEMPTY) + if (stat & EMU_IPR_MIDIRECVBUFE) if (sc->mpu_intr) { (sc->mpu_intr)(sc->mpu); - ack |= IPR_MIDIRECVBUFEMPTY | IPR_MIDITRANSBUFEMPTY; + ack |= EMU_IPR_MIDIRECVBUFE | EMU_IPR_MIDITRANSBUFE; } if (stat & ~ack) device_printf(sc->dev, "dodgy irq: %x (harmless)\n", stat & ~ack); - emu_wr(sc, IPR, stat, 4); + emu_wr(sc, EMU_IPR, stat, 4); if (ack) { snd_mtxunlock(sc->lock); - if (ack & IPR_INTERVALTIMER) { + if (ack & EMU_IPR_INTERVALTIMER) { x = 0; for (i = 0; i < sc->nchans; i++) { if (sc->pch[i].run) { @@ -1197,15 +1279,15 @@ emu_intr(void *data) } - if (ack & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL)) { + if (ack & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL)) { if (sc->rch[0].channel) chn_intr(sc->rch[0].channel); } - if (ack & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL)) { + if (ack & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL)) { if (sc->rch[1].channel) chn_intr(sc->rch[1].channel); } - if (ack & (IPR_MICBUFFULL | IPR_MICBUFHALFFULL)) { + if (ack & (EMU_IPR_MICBUFFULL | EMU_IPR_MICBUFHALFFULL)) { if (sc->rch[2].channel) chn_intr(sc->rch[2].channel); } @@ -1378,12 +1460,12 @@ audigy_initefx(struct sc_info *sc) audigy_addefxop(sc, 0x0f, 0x0c0, 0x0c0, 0x0cf, 0x0c0, &pc); for (i = 0; i < 512; i++) - emu_wrptr(sc, 0, A_FXGPREGBASE + i, 0x0); + emu_wrptr(sc, 0, EMU_A_FXGPREGBASE + i, 0x0); pc = 16; /* stop fx processor */ - emu_wrptr(sc, 0, A_DBG, A_DBG_SINGLE_STEP); + emu_wrptr(sc, 0, EMU_A_DBG, EMU_A_DBG_SINGLE_STEP); /* Audigy 2 (EMU10K2) DSP Registers: FX Bus @@ -1518,7 +1600,7 @@ audigy_initefx(struct sc_info *sc) A_C_00000000, A_EXTIN(A_EXTIN_AC97_R), &pc); /* resume normal operations */ - emu_wrptr(sc, 0, A_DBG, 0); + emu_wrptr(sc, 0, EMU_A_DBG, 0); } static void @@ -1534,7 +1616,7 @@ emu_initefx(struct sc_info *sc) } for (i = 0; i < 256; i++) - emu_wrptr(sc, 0, FXGPREGBASE + i, 0); + emu_wrptr(sc, 0, EMU_FXGPREGBASE + i, 0); /* FX-8010 DSP Registers: FX Bus @@ -1654,7 +1736,7 @@ emu_initefx(struct sc_info *sc) C_00000000, EXTIN(EXTIN_AC97_R), &pc); /* resume normal operations */ - emu_wrptr(sc, 0, DBG, 0); + emu_wrptr(sc, 0, EMU_DBG, 0); } /* Probe and attach the card */ @@ -1665,69 +1747,69 @@ emu_init(struct sc_info *sc) if (sc->audigy) { /* enable additional AC97 slots */ - emu_wrptr(sc, 0, AC97SLOT, AC97SLOT_CNTR | AC97SLOT_LFE); + emu_wrptr(sc, 0, EMU_AC97SLOT, EMU_AC97SLOT_CENTER | EMU_AC97SLOT_LFE); } /* disable audio and lock cache */ - emu_wr(sc, HCFG, - HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, + emu_wr(sc, EMU_HCFG, + EMU_HCFG_LOCKSOUNDCACHE | EMU_HCFG_LOCKTANKCACHE_MASK | EMU_HCFG_MUTEBUTTONENABLE, 4); /* reset recording buffers */ - emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, MICBA, 0); - emu_wrptr(sc, 0, FXBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, FXBA, 0); - emu_wrptr(sc, 0, ADCBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, ADCBA, 0); + emu_wrptr(sc, 0, EMU_MICBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_MICBA, 0); + emu_wrptr(sc, 0, EMU_FXBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_FXBA, 0); + emu_wrptr(sc, 0, EMU_ADCBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_ADCBA, 0); /* disable channel interrupt */ - emu_wr(sc, INTE, - INTE_INTERVALTIMERENB | INTE_SAMPLERATETRACKER | INTE_PCIERRORENABLE, + emu_wr(sc, EMU_INTE, + EMU_INTE_INTERTIMERENB | EMU_INTE_SAMPLERATER | EMU_INTE_PCIERRENABLE, 4); - emu_wrptr(sc, 0, CLIEL, 0); - emu_wrptr(sc, 0, CLIEH, 0); - emu_wrptr(sc, 0, SOLEL, 0); - emu_wrptr(sc, 0, SOLEH, 0); + emu_wrptr(sc, 0, EMU_CLIEL, 0); + emu_wrptr(sc, 0, EMU_CLIEH, 0); + emu_wrptr(sc, 0, EMU_SOLEL, 0); + emu_wrptr(sc, 0, EMU_SOLEH, 0); /* wonder what these do... */ if (sc->audigy) { - emu_wrptr(sc, 0, SPBYPASS, 0xf00); - emu_wrptr(sc, 0, AC97SLOT, 0x3); + emu_wrptr(sc, 0, EMU_SPBYPASS, 0xf00); + emu_wrptr(sc, 0, EMU_AC97SLOT, 0x3); } /* init envelope engine */ for (ch = 0; ch < NUM_G; ch++) { - emu_wrptr(sc, ch, DCYSUSV, ENV_OFF); - emu_wrptr(sc, ch, IP, 0); - emu_wrptr(sc, ch, VTFT, 0xffff); - emu_wrptr(sc, ch, CVCF, 0xffff); - emu_wrptr(sc, ch, PTRX, 0); - emu_wrptr(sc, ch, CPF, 0); - emu_wrptr(sc, ch, CCR, 0); - - emu_wrptr(sc, ch, PSST, 0); - emu_wrptr(sc, ch, DSL, 0x10); - emu_wrptr(sc, ch, CCCA, 0); - emu_wrptr(sc, ch, Z1, 0); - emu_wrptr(sc, ch, Z2, 0); - emu_wrptr(sc, ch, FXRT, 0xd01c0000); - - emu_wrptr(sc, ch, ATKHLDM, 0); - emu_wrptr(sc, ch, DCYSUSM, 0); - emu_wrptr(sc, ch, IFATN, 0xffff); - emu_wrptr(sc, ch, PEFE, 0); - emu_wrptr(sc, ch, FMMOD, 0); - emu_wrptr(sc, ch, TREMFRQ, 24); /* 1 Hz */ - emu_wrptr(sc, ch, FM2FRQ2, 24); /* 1 Hz */ - emu_wrptr(sc, ch, TEMPENV, 0); + emu_wrptr(sc, ch, EMU_CHAN_DCYSUSV, ENV_OFF); + emu_wrptr(sc, ch, EMU_CHAN_IP, 0); + emu_wrptr(sc, ch, EMU_CHAN_VTFT, 0xffff); + emu_wrptr(sc, ch, EMU_CHAN_CVCF, 0xffff); + emu_wrptr(sc, ch, EMU_CHAN_PTRX, 0); + emu_wrptr(sc, ch, EMU_CHAN_CPF, 0); + emu_wrptr(sc, ch, EMU_CHAN_CCR, 0); + + emu_wrptr(sc, ch, EMU_CHAN_PSST, 0); + emu_wrptr(sc, ch, EMU_CHAN_DSL, 0x10); + emu_wrptr(sc, ch, EMU_CHAN_CCCA, 0); + emu_wrptr(sc, ch, EMU_CHAN_Z1, 0); + emu_wrptr(sc, ch, EMU_CHAN_Z2, 0); + emu_wrptr(sc, ch, EMU_CHAN_FXRT, 0xd01c0000); + + emu_wrptr(sc, ch, EMU_CHAN_ATKHLDM, 0); + emu_wrptr(sc, ch, EMU_CHAN_DCYSUSM, 0); + emu_wrptr(sc, ch, EMU_CHAN_IFATN, 0xffff); + emu_wrptr(sc, ch, EMU_CHAN_PEFE, 0); + emu_wrptr(sc, ch, EMU_CHAN_FMMOD, 0); + emu_wrptr(sc, ch, EMU_CHAN_TREMFRQ, 24); /* 1 Hz */ + emu_wrptr(sc, ch, EMU_CHAN_FM2FRQ2, 24); /* 1 Hz */ + emu_wrptr(sc, ch, EMU_CHAN_TEMPENV, 0); /*** these are last so OFF prevents writing ***/ - emu_wrptr(sc, ch, LFOVAL2, 0); - emu_wrptr(sc, ch, LFOVAL1, 0); - emu_wrptr(sc, ch, ATKHLDV, 0); - emu_wrptr(sc, ch, ENVVOL, 0); - emu_wrptr(sc, ch, ENVVAL, 0); + emu_wrptr(sc, ch, EMU_CHAN_LFOVAL2, 0); + emu_wrptr(sc, ch, EMU_CHAN_LFOVAL1, 0); + emu_wrptr(sc, ch, EMU_CHAN_ATKHLDV, 0); + emu_wrptr(sc, ch, EMU_CHAN_ENVVOL, 0); + emu_wrptr(sc, ch, EMU_CHAN_ENVVAL, 0); if (sc->audigy) { /* audigy cards need this to initialize correctly */ @@ -1736,9 +1818,9 @@ emu_init(struct sc_info *sc) emu_wrptr(sc, ch, 0x4e, 0); emu_wrptr(sc, ch, 0x4f, 0); /* set default routing */ - emu_wrptr(sc, ch, A_FXRT1, 0x03020100); - emu_wrptr(sc, ch, A_FXRT2, 0x3f3f3f3f); - emu_wrptr(sc, ch, A_SENDAMOUNTS, 0); + emu_wrptr(sc, ch, EMU_A_CHAN_FXRT1, 0x03020100); + emu_wrptr(sc, ch, EMU_A_CHAN_FXRT2, 0x3f3f3f3f); + emu_wrptr(sc, ch, EMU_A_CHAN_SENDAMOUNTS, 0); } sc->voice[ch].vnum = ch; @@ -1769,13 +1851,13 @@ emu_init(struct sc_info *sc) * AN = 0 (Audio data) * P = 0 (Consumer) */ - spcs = SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 | - SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | - SPCS_GENERATIONSTATUS | 0x00001200 | 0x00000000 | - SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT; - emu_wrptr(sc, 0, SPCS0, spcs); - emu_wrptr(sc, 0, SPCS1, spcs); - emu_wrptr(sc, 0, SPCS2, spcs); + spcs = EMU_SPCS_CLKACCY_1000PPM | EMU_SPCS_SAMPLERATE_48 | + EMU_SPCS_CHANNELNUM_LEFT | EMU_SPCS_SOURCENUM_UNSPEC | + EMU_SPCS_GENERATIONSTATUS | 0x00001200 | 0x00000000 | + EMU_SPCS_EMPHASIS_NONE | EMU_SPCS_COPYRIGHT; + emu_wrptr(sc, 0, EMU_SPCS0, spcs); + emu_wrptr(sc, 0, EMU_SPCS1, spcs); + emu_wrptr(sc, 0, EMU_SPCS2, spcs); if (!sc->audigy) emu_initefx(sc); @@ -1786,8 +1868,8 @@ emu_init(struct sc_info *sc) u_int32_t tmp; /* Setup SRCMulti_I2S SamplingRate */ - tmp = emu_rdptr(sc, 0, A_SPDIF_SAMPLERATE) & 0xfffff1ff; - emu_wrptr(sc, 0, A_SPDIF_SAMPLERATE, tmp | 0x400); + tmp = emu_rdptr(sc, 0, EMU_A_SPDIF_SAMPLERATE) & 0xfffff1ff; + emu_wrptr(sc, 0, EMU_A_SPDIF_SAMPLERATE, tmp | 0x400); /* Setup SRCSel (Enable SPDIF, I2S SRCMulti) */ emu_wr(sc, 0x20, 0x00600000, 4); @@ -1816,13 +1898,13 @@ emu_init(struct sc_info *sc) for (i = 0; i < EMUMAXPAGES; i++) sc->mem.ptb_pages[i] = tmp | i; - emu_wrptr(sc, 0, PTB, (sc->mem.ptb_pages_addr)); - emu_wrptr(sc, 0, TCB, 0); /* taken from original driver */ - emu_wrptr(sc, 0, TCBS, 0); /* taken from original driver */ + emu_wrptr(sc, 0, EMU_PTB, (sc->mem.ptb_pages_addr)); + emu_wrptr(sc, 0, EMU_TCB, 0); /* taken from original driver */ + emu_wrptr(sc, 0, EMU_TCBS, 0); /* taken from original driver */ for (ch = 0; ch < NUM_G; ch++) { - emu_wrptr(sc, ch, MAPA, tmp | MAP_PTI_MASK); - emu_wrptr(sc, ch, MAPB, tmp | MAP_PTI_MASK); + emu_wrptr(sc, ch, EMU_CHAN_MAPA, tmp | EMU_CHAN_MAP_PTI_MASK); + emu_wrptr(sc, ch, EMU_CHAN_MAPB, tmp | EMU_CHAN_MAP_PTI_MASK); } /* emu_memalloc(sc, EMUPAGESIZE); */ @@ -1850,19 +1932,19 @@ emu_init(struct sc_info *sc) */ if (sc->audigy) { - tmp = HCFG_AUTOMUTE | HCFG_JOYENABLE; + tmp = EMU_HCFG_AUTOMUTE | EMU_HCFG_JOYENABLE; if (sc->audigy2) /* Audigy 2 */ - tmp = HCFG_AUDIOENABLE | HCFG_AC3ENABLE_CDSPDIF | - HCFG_AC3ENABLE_GPSPDIF; - emu_wr(sc, HCFG, tmp, 4); + tmp = EMU_HCFG_AUDIOENABLE | EMU_HCFG_AC3ENABLE_CDSPDIF | + EMU_HCFG_AC3ENABLE_GPSPDIF; + emu_wr(sc, EMU_HCFG, tmp, 4); audigy_initefx(sc); /* from ALSA initialization code: */ /* enable audio and disable both audio/digital outputs */ - emu_wr(sc, HCFG, emu_rd(sc, HCFG, 4) | HCFG_AUDIOENABLE, 4); - emu_wr(sc, A_IOCFG, emu_rd(sc, A_IOCFG, 4) & ~A_IOCFG_GPOUT_AD, + emu_wr(sc, EMU_HCFG, emu_rd(sc, EMU_HCFG, 4) | EMU_HCFG_AUDIOENABLE, 4); + emu_wr(sc, EMU_A_IOCFG, emu_rd(sc, EMU_A_IOCFG, 4) & ~EMU_A_IOCFG_GPOUT_AD, 4); if (sc->audigy2) { /* Audigy 2 */ /* Unmute Analog. @@ -1870,27 +1952,27 @@ emu_init(struct sc_info *sc) * init Alice3 I2SOut beyond 48kHz. * So, sequence is important. */ - emu_wr(sc, A_IOCFG, - emu_rd(sc, A_IOCFG, 4) | A_IOCFG_GPOUT_A, 4); + emu_wr(sc, EMU_A_IOCFG, + emu_rd(sc, EMU_A_IOCFG, 4) | EMU_A_IOCFG_GPOUT_A, 4); } } else { /* EMU10K1 initialization code */ - tmp = HCFG_AUDIOENABLE | HCFG_LOCKTANKCACHE_MASK - | HCFG_AUTOMUTE; + tmp = EMU_HCFG_AUDIOENABLE | EMU_HCFG_LOCKTANKCACHE_MASK + | EMU_HCFG_AUTOMUTE; if (sc->rev >= 6) - tmp |= HCFG_JOYENABLE; + tmp |= EMU_HCFG_JOYENABLE; - emu_wr(sc, HCFG, tmp, 4); + emu_wr(sc, EMU_HCFG, tmp, 4); /* TOSLink detection */ sc->tos_link = 0; - tmp = emu_rd(sc, HCFG, 4); - if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) { - emu_wr(sc, HCFG, tmp | HCFG_GPOUT1, 4); + tmp = emu_rd(sc, EMU_HCFG, 4); + if (tmp & (EMU_HCFG_GPINPUT0 | EMU_HCFG_GPINPUT1)) { + emu_wr(sc, EMU_HCFG, tmp | EMU_HCFG_GPOUT1, 4); DELAY(50); - if (tmp != (emu_rd(sc, HCFG, 4) & ~HCFG_GPOUT1)) { + if (tmp != (emu_rd(sc, EMU_HCFG, 4) & ~EMU_HCFG_GPOUT1)) { sc->tos_link = 1; - emu_wr(sc, HCFG, tmp, 4); + emu_wr(sc, EMU_HCFG, tmp, 4); } } } @@ -1903,42 +1985,42 @@ emu_uninit(struct sc_info *sc) { u_int32_t ch; - emu_wr(sc, INTE, 0, 4); + emu_wr(sc, EMU_INTE, 0, 4); for (ch = 0; ch < NUM_G; ch++) - emu_wrptr(sc, ch, DCYSUSV, ENV_OFF); + emu_wrptr(sc, ch, EMU_CHAN_DCYSUSV, ENV_OFF); for (ch = 0; ch < NUM_G; ch++) { - emu_wrptr(sc, ch, VTFT, 0); - emu_wrptr(sc, ch, CVCF, 0); - emu_wrptr(sc, ch, PTRX, 0); - emu_wrptr(sc, ch, CPF, 0); + emu_wrptr(sc, ch, EMU_CHAN_VTFT, 0); + emu_wrptr(sc, ch, EMU_CHAN_CVCF, 0); + emu_wrptr(sc, ch, EMU_CHAN_PTRX, 0); + emu_wrptr(sc, ch, EMU_CHAN_CPF, 0); } if (sc->audigy) { /* stop fx processor */ - emu_wrptr(sc, 0, A_DBG, A_DBG_SINGLE_STEP); + emu_wrptr(sc, 0, EMU_A_DBG, EMU_A_DBG_SINGLE_STEP); } /* disable audio and lock cache */ - emu_wr(sc, HCFG, - HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, + emu_wr(sc, EMU_HCFG, + EMU_HCFG_LOCKSOUNDCACHE | EMU_HCFG_LOCKTANKCACHE_MASK | EMU_HCFG_MUTEBUTTONENABLE, 4); - emu_wrptr(sc, 0, PTB, 0); + emu_wrptr(sc, 0, EMU_PTB, 0); /* reset recording buffers */ - emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, MICBA, 0); - emu_wrptr(sc, 0, FXBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, FXBA, 0); - emu_wrptr(sc, 0, FXWC, 0); - emu_wrptr(sc, 0, ADCBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, ADCBA, 0); - emu_wrptr(sc, 0, TCB, 0); - emu_wrptr(sc, 0, TCBS, 0); + emu_wrptr(sc, 0, EMU_MICBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_MICBA, 0); + emu_wrptr(sc, 0, EMU_FXBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_FXBA, 0); + emu_wrptr(sc, 0, EMU_FXWC, 0); + emu_wrptr(sc, 0, EMU_ADCBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_ADCBA, 0); + emu_wrptr(sc, 0, EMU_TCB, 0); + emu_wrptr(sc, 0, EMU_TCBS, 0); /* disable channel interrupt */ - emu_wrptr(sc, 0, CLIEL, 0); - emu_wrptr(sc, 0, CLIEH, 0); - emu_wrptr(sc, 0, SOLEL, 0); - emu_wrptr(sc, 0, SOLEH, 0); + emu_wrptr(sc, 0, EMU_CLIEL, 0); + emu_wrptr(sc, 0, EMU_CLIEH, 0); + emu_wrptr(sc, 0, EMU_SOLEL, 0); + emu_wrptr(sc, 0, EMU_SOLEH, 0); /* init envelope engine */ if (!SLIST_EMPTY(&sc->mem.blocks)) @@ -1997,7 +2079,7 @@ emu_pci_attach(device_t dev) sc->audigy = sc->type == EMU10K2_PCI_ID || sc->type == EMU10K3_PCI_ID; sc->audigy2 = (sc->audigy && sc->rev == 0x04); sc->nchans = sc->audigy ? 8 : 4; - sc->addrmask = sc->audigy ? A_PTR_ADDRESS_MASK : PTR_ADDRESS_MASK; + sc->addrmask = sc->audigy ? EMU_A_PTR_ADDR_MASK : EMU_PTR_ADDR_MASK; data = pci_read_config(dev, PCIR_COMMAND, 2); data |= (PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN); Copied: stable/9/sys/dev/sound/pci/emuxkireg.h (from r229430, head/sys/dev/sound/pci/emuxkireg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/sound/pci/emuxkireg.h Fri Feb 3 22:06:27 2012 (r230962, copy of r229430, head/sys/dev/sound/pci/emuxkireg.h) @@ -0,0 +1,689 @@ +/* $FreeBSD$ */ +/* $NetBSD: emuxkireg.h,v 1.8 2008/04/28 20:23:54 martin Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Yannick Montulet. + * + * 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. + */ + +#ifndef _DEV_PCI_EMUXKIREG_H_ +#define _DEV_PCI_EMUXKIREG_H_ + +/* + * Register values for Creative EMU10000. The register values have been + * taken from GPLed SBLive! header file published by Creative. The comments + * have been stripped to avoid GPL pollution in kernel. The Creative version + * including comments is available in Linux 2.4.* kernel as file + * drivers/sound/emu10k1/8010.h + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 22:13:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A93451065670; Fri, 3 Feb 2012 22:13:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90D658FC0C; Fri, 3 Feb 2012 22:13:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13MDauK006559; Fri, 3 Feb 2012 22:13:36 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13MDaLT006554; Fri, 3 Feb 2012 22:13:36 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202032213.q13MDaLT006554@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 3 Feb 2012 22:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230963 - in stable/8/sys: conf dev/sound/pci modules/sound/driver/emu10k1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 22:13:36 -0000 Author: pfg Date: Fri Feb 3 22:13:36 2012 New Revision: 230963 URL: http://svn.freebsd.org/changeset/base/230963 Log: MFC: r229430, r229980 Replace a GPL'd header in the emu10k1 snd driver code. This brings in the emuxkireg.h from NetBSD (dev/pci) which is used for the same purpose but is smaller. The emu10k1 is now free from the GPL. While here also merge some cleanups to the module Makefile. PR: 153901 Obtained from: NetBSD Approved by: core (mentor implicit) Added: stable/8/sys/dev/sound/pci/emuxkireg.h - copied unchanged from r229430, head/sys/dev/sound/pci/emuxkireg.h Modified: stable/8/sys/conf/files stable/8/sys/dev/sound/pci/emu10k1.c stable/8/sys/modules/sound/driver/emu10k1/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/modules/sound/driver/emu10k1/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Fri Feb 3 22:06:27 2012 (r230962) +++ stable/8/sys/conf/files Fri Feb 3 22:13:36 2012 (r230963) @@ -50,7 +50,7 @@ aic79xx_reg_print.c optional ahd pci aic79xx_reg_print.o optional ahd pci ahd_reg_pretty_print \ compile-with "${NORMAL_C}" \ no-implicit-rule local -emu10k1-alsa%diked.h optional snd_emu10k1 | snd_emu10kx \ +emu10k1-alsa%diked.h optional snd_emu10kx \ dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h" \ 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 \ @@ -1601,9 +1601,7 @@ dev/sound/pci/csa.c optional snd_csa pc warning "kernel contains GPL contaminated csaimg.h header" dev/sound/pci/csapcm.c optional snd_csa pci dev/sound/pci/ds1.c optional snd_ds1 pci -dev/sound/pci/emu10k1.c optional snd_emu10k1 pci \ - dependency "emu10k1-alsa%diked.h" \ - warning "kernel contains GPL contaminated emu10k1 headers" +dev/sound/pci/emu10k1.c optional snd_emu10k1 pci dev/sound/pci/emu10kx.c optional snd_emu10kx pci \ dependency "emu10k1-alsa%diked.h" \ dependency "p16v-alsa%diked.h" \ Modified: stable/8/sys/dev/sound/pci/emu10k1.c ============================================================================== --- stable/8/sys/dev/sound/pci/emu10k1.c Fri Feb 3 22:06:27 2012 (r230962) +++ stable/8/sys/dev/sound/pci/emu10k1.c Fri Feb 3 22:13:36 2012 (r230963) @@ -32,7 +32,7 @@ #include #include -#include "emu10k1-alsa%diked.h" +#include #include #include @@ -66,12 +66,94 @@ SND_DECLARE_FILE("$FreeBSD$"); #define ENABLE 0xffffffff #define DISABLE 0x00000000 -#define ENV_ON DCYSUSV_CHANNELENABLE_MASK +#define ENV_ON EMU_CHAN_DCYSUSV_CHANNELENABLE_MASK #define ENV_OFF 0x00 /* XXX: should this be 1? */ -#define A_IOCFG_GPOUT_A 0x40 /* Analog Output */ -#define A_IOCFG_GPOUT_D 0x04 /* Digital Output */ -#define A_IOCFG_GPOUT_AD (A_IOCFG_GPOUT_A|A_IOCFG_GPOUT_D) /* A_IOCFG_GPOUT0 */ +#define EMU_A_IOCFG_GPOUT_A 0x40 +#define EMU_A_IOCFG_GPOUT_D 0x04 +#define EMU_A_IOCFG_GPOUT_AD (EMU_A_IOCFG_GPOUT_A|EMU_A_IOCFG_GPOUT_D) /* EMU_A_IOCFG_GPOUT0 */ + +#define EMU_HCFG_GPOUT1 0x00000800 + +/* instruction set */ +#define iACC3 0x06 +#define iMACINT0 0x04 +#define iINTERP 0x0e + +#define C_00000000 0x40 +#define C_00000001 0x41 +#define C_00000004 0x44 +#define C_40000000 0x4d +/* Audigy constants */ +#define A_C_00000000 0xc0 +#define A_C_40000000 0xcd + +/* GPRs */ +#define FXBUS(x) (0x00 + (x)) +#define EXTIN(x) (0x10 + (x)) +#define EXTOUT(x) (0x20 + (x)) + +#define GPR(x) (EMU_FXGPREGBASE + (x)) +#define A_EXTIN(x) (0x40 + (x)) +#define A_FXBUS(x) (0x00 + (x)) +#define A_EXTOUT(x) (0x60 + (x)) +#define A_GPR(x) (EMU_A_FXGPREGBASE + (x)) + +/* FX buses */ +#define FXBUS_PCM_LEFT 0x00 +#define FXBUS_PCM_RIGHT 0x01 +#define FXBUS_MIDI_LEFT 0x04 +#define FXBUS_MIDI_RIGHT 0x05 +#define FXBUS_MIDI_REVERB 0x0c +#define FXBUS_MIDI_CHORUS 0x0d + +/* Inputs */ +#define EXTIN_AC97_L 0x00 +#define EXTIN_AC97_R 0x01 +#define EXTIN_SPDIF_CD_L 0x02 +#define EXTIN_SPDIF_CD_R 0x03 +#define EXTIN_TOSLINK_L 0x06 +#define EXTIN_TOSLINK_R 0x07 +#define EXTIN_COAX_SPDIF_L 0x0a +#define EXTIN_COAX_SPDIF_R 0x0b +/* Audigy Inputs */ +#define A_EXTIN_AC97_L 0x00 +#define A_EXTIN_AC97_R 0x01 + +/* Outputs */ +#define EXTOUT_AC97_L 0x00 +#define EXTOUT_AC97_R 0x01 +#define EXTOUT_TOSLINK_L 0x02 +#define EXTOUT_TOSLINK_R 0x03 +#define EXTOUT_AC97_CENTER 0x04 +#define EXTOUT_AC97_LFE 0x05 +#define EXTOUT_HEADPHONE_L 0x06 +#define EXTOUT_HEADPHONE_R 0x07 +#define EXTOUT_REAR_L 0x08 +#define EXTOUT_REAR_R 0x09 +#define EXTOUT_ADC_CAP_L 0x0a +#define EXTOUT_ADC_CAP_R 0x0b +#define EXTOUT_ACENTER 0x11 +#define EXTOUT_ALFE 0x12 +/* Audigy Outputs */ +#define A_EXTOUT_FRONT_L 0x00 +#define A_EXTOUT_FRONT_R 0x01 +#define A_EXTOUT_CENTER 0x02 +#define A_EXTOUT_LFE 0x03 +#define A_EXTOUT_HEADPHONE_L 0x04 +#define A_EXTOUT_HEADPHONE_R 0x05 +#define A_EXTOUT_REAR_L 0x06 +#define A_EXTOUT_REAR_R 0x07 +#define A_EXTOUT_AFRONT_L 0x08 +#define A_EXTOUT_AFRONT_R 0x09 +#define A_EXTOUT_ACENTER 0x0a +#define A_EXTOUT_ALFE 0x0b +#define A_EXTOUT_AREAR_L 0x0e +#define A_EXTOUT_AREAR_R 0x0f +#define A_EXTOUT_AC97_L 0x10 +#define A_EXTOUT_AC97_R 0x11 +#define A_EXTOUT_ADC_CAP_L 0x16 +#define A_EXTOUT_ADC_CAP_R 0x17 struct emu_memblk { SLIST_ENTRY(emu_memblk) link; @@ -247,9 +329,9 @@ emu_rdptr(struct sc_info *sc, int chn, i { u_int32_t ptr, val, mask, size, offset; - ptr = ((reg << 16) & sc->addrmask) | (chn & PTR_CHANNELNUM_MASK); - emu_wr(sc, PTR, ptr, 4); - val = emu_rd(sc, DATA, 4); + ptr = ((reg << 16) & sc->addrmask) | (chn & EMU_PTR_CHNO_MASK); + emu_wr(sc, EMU_PTR, ptr, 4); + val = emu_rd(sc, EMU_DATA, 4); if (reg & 0xff000000) { size = (reg >> 24) & 0x3f; offset = (reg >> 16) & 0x1f; @@ -265,23 +347,23 @@ emu_wrptr(struct sc_info *sc, int chn, i { u_int32_t ptr, mask, size, offset; - ptr = ((reg << 16) & sc->addrmask) | (chn & PTR_CHANNELNUM_MASK); - emu_wr(sc, PTR, ptr, 4); + ptr = ((reg << 16) & sc->addrmask) | (chn & EMU_PTR_CHNO_MASK); + emu_wr(sc, EMU_PTR, ptr, 4); if (reg & 0xff000000) { size = (reg >> 24) & 0x3f; offset = (reg >> 16) & 0x1f; mask = ((1 << size) - 1) << offset; data <<= offset; data &= mask; - data |= emu_rd(sc, DATA, 4) & ~mask; + data |= emu_rd(sc, EMU_DATA, 4) & ~mask; } - emu_wr(sc, DATA, data, 4); + emu_wr(sc, EMU_DATA, data, 4); } static void emu_wrefx(struct sc_info *sc, unsigned int pc, unsigned int data) { - pc += sc->audigy ? A_MICROCODEBASE : MICROCODEBASE; + pc += sc->audigy ? EMU_A_MICROCODEBASE : EMU_MICROCODEBASE; emu_wrptr(sc, 0, pc, data); } @@ -294,8 +376,8 @@ emu_rdcd(kobj_t obj, void *devinfo, int { struct sc_info *sc = (struct sc_info *)devinfo; - emu_wr(sc, AC97ADDRESS, regno, 1); - return emu_rd(sc, AC97DATA, 2); + emu_wr(sc, EMU_AC97ADDR, regno, 1); + return emu_rd(sc, EMU_AC97DATA, 2); } static int @@ -303,8 +385,8 @@ emu_wrcd(kobj_t obj, void *devinfo, int { struct sc_info *sc = (struct sc_info *)devinfo; - emu_wr(sc, AC97ADDRESS, regno, 1); - emu_wr(sc, AC97DATA, data, 2); + emu_wr(sc, EMU_AC97ADDR, regno, 1); + emu_wr(sc, EMU_AC97DATA, data, 2); return 0; } @@ -346,7 +428,7 @@ emu_settimer(struct sc_info *sc) } RANGE(rate, 48, 9600); sc->timerinterval = 48000 / rate; - emu_wr(sc, TIMER, sc->timerinterval & 0x03ff, 2); + emu_wr(sc, EMU_TIMER, sc->timerinterval & 0x03ff, 2); return sc->timerinterval; } @@ -357,15 +439,15 @@ emu_enatimer(struct sc_info *sc, int go) u_int32_t x; if (go) { if (sc->timer++ == 0) { - x = emu_rd(sc, INTE, 4); - x |= INTE_INTERVALTIMERENB; - emu_wr(sc, INTE, x, 4); + x = emu_rd(sc, EMU_INTE, 4); + x |= EMU_INTE_INTERTIMERENB; + emu_wr(sc, EMU_INTE, x, 4); } } else { sc->timer = 0; - x = emu_rd(sc, INTE, 4); - x &= ~INTE_INTERVALTIMERENB; - emu_wr(sc, INTE, x, 4); + x = emu_rd(sc, EMU_INTE, 4); + x &= ~EMU_INTE_INTERTIMERENB; + emu_wr(sc, EMU_INTE, x, 4); } return 0; } @@ -373,7 +455,7 @@ emu_enatimer(struct sc_info *sc, int go) static void emu_enastop(struct sc_info *sc, char channel, int enable) { - int reg = (channel & 0x20) ? SOLEH : SOLEL; + int reg = (channel & 0x20) ? EMU_SOLEH : EMU_SOLEL; channel &= 0x1f; reg |= 1 << 24; reg |= channel << 16; @@ -568,49 +650,49 @@ emu_vwrite(struct sc_info *sc, struct em r = v->ismaster ? 0 : r; } - emu_wrptr(sc, v->vnum, CPF, v->stereo ? CPF_STEREO_MASK : 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF, v->stereo ? EMU_CHAN_CPF_STEREO_MASK : 0); val = v->stereo ? 28 : 30; val *= v->b16 ? 1 : 2; start = sa + val; if (sc->audigy) { - emu_wrptr(sc, v->vnum, A_FXRT1, v->fxrt1); - emu_wrptr(sc, v->vnum, A_FXRT2, v->fxrt2); - emu_wrptr(sc, v->vnum, A_SENDAMOUNTS, 0); + emu_wrptr(sc, v->vnum, EMU_A_CHAN_FXRT1, v->fxrt1); + emu_wrptr(sc, v->vnum, EMU_A_CHAN_FXRT2, v->fxrt2); + emu_wrptr(sc, v->vnum, EMU_A_CHAN_SENDAMOUNTS, 0); } else - emu_wrptr(sc, v->vnum, FXRT, v->fxrt1 << 16); + emu_wrptr(sc, v->vnum, EMU_CHAN_FXRT, v->fxrt1 << 16); - emu_wrptr(sc, v->vnum, PTRX, (x << 8) | r); - emu_wrptr(sc, v->vnum, DSL, ea | (y << 24)); - emu_wrptr(sc, v->vnum, PSST, sa | (l << 24)); - emu_wrptr(sc, v->vnum, CCCA, start | (v->b16 ? 0 : CCCA_8BITSELECT)); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX, (x << 8) | r); + emu_wrptr(sc, v->vnum, EMU_CHAN_DSL, ea | (y << 24)); + emu_wrptr(sc, v->vnum, EMU_CHAN_PSST, sa | (l << 24)); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCCA, start | (v->b16 ? 0 : EMU_CHAN_CCCA_8BITSELECT)); - emu_wrptr(sc, v->vnum, Z1, 0); - emu_wrptr(sc, v->vnum, Z2, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_Z1, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_Z2, 0); silent_page = ((u_int32_t)(sc->mem.silent_page_addr) << 1) - | MAP_PTI_MASK; - emu_wrptr(sc, v->vnum, MAPA, silent_page); - emu_wrptr(sc, v->vnum, MAPB, silent_page); - - emu_wrptr(sc, v->vnum, CVCF, CVCF_CURRENTFILTER_MASK); - emu_wrptr(sc, v->vnum, VTFT, VTFT_FILTERTARGET_MASK); - emu_wrptr(sc, v->vnum, ATKHLDM, 0); - emu_wrptr(sc, v->vnum, DCYSUSM, DCYSUSM_DECAYTIME_MASK); - emu_wrptr(sc, v->vnum, LFOVAL1, 0x8000); - emu_wrptr(sc, v->vnum, LFOVAL2, 0x8000); - emu_wrptr(sc, v->vnum, FMMOD, 0); - emu_wrptr(sc, v->vnum, TREMFRQ, 0); - emu_wrptr(sc, v->vnum, FM2FRQ2, 0); - emu_wrptr(sc, v->vnum, ENVVAL, 0x8000); - - emu_wrptr(sc, v->vnum, ATKHLDV, - ATKHLDV_HOLDTIME_MASK | ATKHLDV_ATTACKTIME_MASK); - emu_wrptr(sc, v->vnum, ENVVOL, 0x8000); + | EMU_CHAN_MAP_PTI_MASK; + emu_wrptr(sc, v->vnum, EMU_CHAN_MAPA, silent_page); + emu_wrptr(sc, v->vnum, EMU_CHAN_MAPB, silent_page); + + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, EMU_CHAN_CVCF_CURRFILTER_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, EMU_CHAN_VTFT_FILTERTARGET_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_ATKHLDM, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_DCYSUSM, EMU_CHAN_DCYSUSM_DECAYTIME_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_LFOVAL1, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_LFOVAL2, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_FMMOD, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_TREMFRQ, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_FM2FRQ2, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_ENVVAL, 0x8000); + + emu_wrptr(sc, v->vnum, EMU_CHAN_ATKHLDV, + EMU_CHAN_ATKHLDV_HOLDTIME_MASK | EMU_CHAN_ATKHLDV_ATTACKTIME_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_ENVVOL, 0x8000); - emu_wrptr(sc, v->vnum, PEFE_FILTERAMOUNT, 0x7f); - emu_wrptr(sc, v->vnum, PEFE_PITCHAMOUNT, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_PEFE_FILTERAMOUNT, 0x7f); + emu_wrptr(sc, v->vnum, EMU_CHAN_PEFE_PITCHAMOUNT, 0); if (v->slave != NULL) emu_vwrite(sc, v->slave); @@ -631,29 +713,29 @@ emu_vtrigger(struct sc_info *sc, struct sample = v->b16 ? 0x00000000 : 0x80808080; for (i = 0; i < cs; i++) - emu_wrptr(sc, v->vnum, CD0 + i, sample); - emu_wrptr(sc, v->vnum, CCR_CACHEINVALIDSIZE, 0); - emu_wrptr(sc, v->vnum, CCR_READADDRESS, cra); - emu_wrptr(sc, v->vnum, CCR_CACHEINVALIDSIZE, ccis); - - emu_wrptr(sc, v->vnum, IFATN, 0xff00); - emu_wrptr(sc, v->vnum, VTFT, 0xffffffff); - emu_wrptr(sc, v->vnum, CVCF, 0xffffffff); - emu_wrptr(sc, v->vnum, DCYSUSV, 0x00007f7f); + emu_wrptr(sc, v->vnum, EMU_CHAN_CD0 + i, sample); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_CACHEINVALIDSIZE, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_READADDRESS, cra); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_CACHEINVALIDSIZE, ccis); + + emu_wrptr(sc, v->vnum, EMU_CHAN_IFATN, 0xff00); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, 0xffffffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, 0xffffffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_DCYSUSV, 0x00007f7f); emu_enastop(sc, v->vnum, 0); pitch_target = emu_rate_to_linearpitch(v->speed); initial_pitch = emu_rate_to_pitch(v->speed) >> 8; - emu_wrptr(sc, v->vnum, PTRX_PITCHTARGET, pitch_target); - emu_wrptr(sc, v->vnum, CPF_CURRENTPITCH, pitch_target); - emu_wrptr(sc, v->vnum, IP, initial_pitch); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX_PITCHTARGET, pitch_target); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF_PITCH, pitch_target); + emu_wrptr(sc, v->vnum, EMU_CHAN_IP, initial_pitch); } else { - emu_wrptr(sc, v->vnum, PTRX_PITCHTARGET, 0); - emu_wrptr(sc, v->vnum, CPF_CURRENTPITCH, 0); - emu_wrptr(sc, v->vnum, IFATN, 0xffff); - emu_wrptr(sc, v->vnum, VTFT, 0x0000ffff); - emu_wrptr(sc, v->vnum, CVCF, 0x0000ffff); - emu_wrptr(sc, v->vnum, IP, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX_PITCHTARGET, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF_PITCH, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_IFATN, 0xffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, 0x0000ffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, 0x0000ffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_IP, 0); emu_enastop(sc, v->vnum, 1); } if (v->slave != NULL) @@ -666,7 +748,7 @@ emu_vpos(struct sc_info *sc, struct emu_ int s, ptr; s = (v->b16 ? 1 : 0) + (v->stereo ? 1 : 0); - ptr = (emu_rdptr(sc, v->vnum, CCCA_CURRADDR) - (v->start >> s)) << s; + ptr = (emu_rdptr(sc, v->vnum, EMU_CHAN_CCCA_CURRADDR) - (v->start >> s)) << s; return ptr & ~0x0000001f; } @@ -875,27 +957,27 @@ emurchan_init(kobj_t obj, void *devinfo, ch->num = sc->rnum; switch(sc->rnum) { case 0: - ch->idxreg = sc->audigy ? A_ADCIDX : ADCIDX; - ch->basereg = ADCBA; - ch->sizereg = ADCBS; - ch->setupreg = ADCCR; - ch->irqmask = INTE_ADCBUFENABLE; + ch->idxreg = sc->audigy ? EMU_A_ADCIDX : EMU_ADCIDX; + ch->basereg = EMU_ADCBA; + ch->sizereg = EMU_ADCBS; + ch->setupreg = EMU_ADCCR; + ch->irqmask = EMU_INTE_ADCBUFENABLE; break; case 1: - ch->idxreg = FXIDX; - ch->basereg = FXBA; - ch->sizereg = FXBS; - ch->setupreg = FXWC; - ch->irqmask = INTE_EFXBUFENABLE; + ch->idxreg = EMU_FXIDX; + ch->basereg = EMU_FXBA; + ch->sizereg = EMU_FXBS; + ch->setupreg = EMU_FXWC; + ch->irqmask = EMU_INTE_EFXBUFENABLE; break; case 2: - ch->idxreg = MICIDX; - ch->basereg = MICBA; - ch->sizereg = MICBS; + ch->idxreg = EMU_MICIDX; + ch->basereg = EMU_MICBA; + ch->sizereg = EMU_MICBS; ch->setupreg = 0; - ch->irqmask = INTE_MICBUFENABLE; + ch->irqmask = EMU_INTE_MICBUFENABLE; break; } sc->rnum++; @@ -967,27 +1049,27 @@ emurchan_trigger(kobj_t obj, void *data, switch(sc->bufsz) { case 4096: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; break; case 8192: - sz = ADCBS_BUFSIZE_8192; + sz = EMU_RECBS_BUFSIZE_8192; break; case 16384: - sz = ADCBS_BUFSIZE_16384; + sz = EMU_RECBS_BUFSIZE_16384; break; case 32768: - sz = ADCBS_BUFSIZE_32768; + sz = EMU_RECBS_BUFSIZE_32768; break; case 65536: - sz = ADCBS_BUFSIZE_65536; + sz = EMU_RECBS_BUFSIZE_65536; break; default: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; } snd_mtxlock(sc->lock); @@ -997,23 +1079,23 @@ emurchan_trigger(kobj_t obj, void *data, emu_wrptr(sc, 0, ch->sizereg, sz); if (ch->num == 0) { if (sc->audigy) { - val = A_ADCCR_LCHANENABLE; + val = EMU_A_ADCCR_LCHANENABLE; if (AFMT_CHANNEL(ch->fmt) > 1) - val |= A_ADCCR_RCHANENABLE; + val |= EMU_A_ADCCR_RCHANENABLE; val |= audigy_recval(ch->spd); } else { - val = ADCCR_LCHANENABLE; + val = EMU_ADCCR_LCHANENABLE; if (AFMT_CHANNEL(ch->fmt) > 1) - val |= ADCCR_RCHANENABLE; + val |= EMU_ADCCR_RCHANENABLE; val |= emu_recval(ch->spd); } emu_wrptr(sc, 0, ch->setupreg, 0); emu_wrptr(sc, 0, ch->setupreg, val); } - val = emu_rd(sc, INTE, 4); + val = emu_rd(sc, EMU_INTE, 4); val |= ch->irqmask; - emu_wr(sc, INTE, val, 4); + emu_wr(sc, EMU_INTE, val, 4); break; case PCMTRIG_STOP: @@ -1022,9 +1104,9 @@ emurchan_trigger(kobj_t obj, void *data, emu_wrptr(sc, 0, ch->sizereg, 0); if (ch->setupreg) emu_wrptr(sc, 0, ch->setupreg, 0); - val = emu_rd(sc, INTE, 4); + val = emu_rd(sc, EMU_INTE, 4); val &= ~ch->irqmask; - emu_wr(sc, INTE, val, 4); + emu_wr(sc, EMU_INTE, val, 4); break; case PCMTRIG_EMLDMAWR: @@ -1122,9 +1204,9 @@ emu_midiattach(struct sc_info *sc) { int i; - i = emu_rd(sc, INTE, 4); - i |= INTE_MIDIRXENABLE; - emu_wr(sc, INTE, i, 4); + i = emu_rd(sc, EMU_INTE, 4); + i |= EMU_INTE_MIDIRXENABLE; + emu_wr(sc, EMU_INTE, i, 4); sc->mpu = mpu401_init(&emu_mpu_class, sc, emu_intr2, &sc->mpu_intr); } @@ -1139,52 +1221,52 @@ emu_intr(void *data) snd_mtxlock(sc->lock); while (1) { - stat = emu_rd(sc, IPR, 4); + stat = emu_rd(sc, EMU_IPR, 4); if (stat == 0) break; ack = 0; /* process irq */ - if (stat & IPR_INTERVALTIMER) - ack |= IPR_INTERVALTIMER; + if (stat & EMU_IPR_INTERVALTIMER) + ack |= EMU_IPR_INTERVALTIMER; - if (stat & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL)) - ack |= stat & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL); + if (stat & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL)) + ack |= stat & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL); - if (stat & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL)) - ack |= stat & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL); + if (stat & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL)) + ack |= stat & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL); - if (stat & (IPR_MICBUFFULL | IPR_MICBUFHALFFULL)) - ack |= stat & (IPR_MICBUFFULL | IPR_MICBUFHALFFULL); + if (stat & (EMU_IPR_MICBUFFULL | EMU_IPR_MICBUFHALFFULL)) + ack |= stat & (EMU_IPR_MICBUFFULL | EMU_IPR_MICBUFHALFFULL); - if (stat & IPR_PCIERROR) { - ack |= IPR_PCIERROR; + if (stat & EMU_PCIERROR) { + ack |= EMU_PCIERROR; device_printf(sc->dev, "pci error\n"); /* we still get an nmi with ecc ram even if we ack this */ } - if (stat & IPR_SAMPLERATETRACKER) { - ack |= IPR_SAMPLERATETRACKER; + if (stat & EMU_IPR_RATETRCHANGE) { + ack |= EMU_IPR_RATETRCHANGE; #ifdef EMUDEBUG device_printf(sc->dev, "sample rate tracker lock status change\n"); #endif } - if (stat & IPR_MIDIRECVBUFEMPTY) + if (stat & EMU_IPR_MIDIRECVBUFE) if (sc->mpu_intr) { (sc->mpu_intr)(sc->mpu); - ack |= IPR_MIDIRECVBUFEMPTY | IPR_MIDITRANSBUFEMPTY; + ack |= EMU_IPR_MIDIRECVBUFE | EMU_IPR_MIDITRANSBUFE; } if (stat & ~ack) device_printf(sc->dev, "dodgy irq: %x (harmless)\n", stat & ~ack); - emu_wr(sc, IPR, stat, 4); + emu_wr(sc, EMU_IPR, stat, 4); if (ack) { snd_mtxunlock(sc->lock); - if (ack & IPR_INTERVALTIMER) { + if (ack & EMU_IPR_INTERVALTIMER) { x = 0; for (i = 0; i < sc->nchans; i++) { if (sc->pch[i].run) { @@ -1197,15 +1279,15 @@ emu_intr(void *data) } - if (ack & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL)) { + if (ack & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL)) { if (sc->rch[0].channel) chn_intr(sc->rch[0].channel); } - if (ack & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL)) { + if (ack & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL)) { if (sc->rch[1].channel) chn_intr(sc->rch[1].channel); } - if (ack & (IPR_MICBUFFULL | IPR_MICBUFHALFFULL)) { + if (ack & (EMU_IPR_MICBUFFULL | EMU_IPR_MICBUFHALFFULL)) { if (sc->rch[2].channel) chn_intr(sc->rch[2].channel); } @@ -1378,12 +1460,12 @@ audigy_initefx(struct sc_info *sc) audigy_addefxop(sc, 0x0f, 0x0c0, 0x0c0, 0x0cf, 0x0c0, &pc); for (i = 0; i < 512; i++) - emu_wrptr(sc, 0, A_FXGPREGBASE + i, 0x0); + emu_wrptr(sc, 0, EMU_A_FXGPREGBASE + i, 0x0); pc = 16; /* stop fx processor */ - emu_wrptr(sc, 0, A_DBG, A_DBG_SINGLE_STEP); + emu_wrptr(sc, 0, EMU_A_DBG, EMU_A_DBG_SINGLE_STEP); /* Audigy 2 (EMU10K2) DSP Registers: FX Bus @@ -1518,7 +1600,7 @@ audigy_initefx(struct sc_info *sc) A_C_00000000, A_EXTIN(A_EXTIN_AC97_R), &pc); /* resume normal operations */ - emu_wrptr(sc, 0, A_DBG, 0); + emu_wrptr(sc, 0, EMU_A_DBG, 0); } static void @@ -1534,7 +1616,7 @@ emu_initefx(struct sc_info *sc) } for (i = 0; i < 256; i++) - emu_wrptr(sc, 0, FXGPREGBASE + i, 0); + emu_wrptr(sc, 0, EMU_FXGPREGBASE + i, 0); /* FX-8010 DSP Registers: FX Bus @@ -1654,7 +1736,7 @@ emu_initefx(struct sc_info *sc) C_00000000, EXTIN(EXTIN_AC97_R), &pc); /* resume normal operations */ - emu_wrptr(sc, 0, DBG, 0); + emu_wrptr(sc, 0, EMU_DBG, 0); } /* Probe and attach the card */ @@ -1665,69 +1747,69 @@ emu_init(struct sc_info *sc) if (sc->audigy) { /* enable additional AC97 slots */ - emu_wrptr(sc, 0, AC97SLOT, AC97SLOT_CNTR | AC97SLOT_LFE); + emu_wrptr(sc, 0, EMU_AC97SLOT, EMU_AC97SLOT_CENTER | EMU_AC97SLOT_LFE); } /* disable audio and lock cache */ - emu_wr(sc, HCFG, - HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, + emu_wr(sc, EMU_HCFG, + EMU_HCFG_LOCKSOUNDCACHE | EMU_HCFG_LOCKTANKCACHE_MASK | EMU_HCFG_MUTEBUTTONENABLE, 4); /* reset recording buffers */ - emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, MICBA, 0); - emu_wrptr(sc, 0, FXBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, FXBA, 0); - emu_wrptr(sc, 0, ADCBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, ADCBA, 0); + emu_wrptr(sc, 0, EMU_MICBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_MICBA, 0); + emu_wrptr(sc, 0, EMU_FXBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_FXBA, 0); + emu_wrptr(sc, 0, EMU_ADCBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_ADCBA, 0); /* disable channel interrupt */ - emu_wr(sc, INTE, - INTE_INTERVALTIMERENB | INTE_SAMPLERATETRACKER | INTE_PCIERRORENABLE, + emu_wr(sc, EMU_INTE, + EMU_INTE_INTERTIMERENB | EMU_INTE_SAMPLERATER | EMU_INTE_PCIERRENABLE, 4); - emu_wrptr(sc, 0, CLIEL, 0); - emu_wrptr(sc, 0, CLIEH, 0); - emu_wrptr(sc, 0, SOLEL, 0); - emu_wrptr(sc, 0, SOLEH, 0); + emu_wrptr(sc, 0, EMU_CLIEL, 0); + emu_wrptr(sc, 0, EMU_CLIEH, 0); + emu_wrptr(sc, 0, EMU_SOLEL, 0); + emu_wrptr(sc, 0, EMU_SOLEH, 0); /* wonder what these do... */ if (sc->audigy) { - emu_wrptr(sc, 0, SPBYPASS, 0xf00); - emu_wrptr(sc, 0, AC97SLOT, 0x3); + emu_wrptr(sc, 0, EMU_SPBYPASS, 0xf00); + emu_wrptr(sc, 0, EMU_AC97SLOT, 0x3); } /* init envelope engine */ for (ch = 0; ch < NUM_G; ch++) { - emu_wrptr(sc, ch, DCYSUSV, ENV_OFF); - emu_wrptr(sc, ch, IP, 0); - emu_wrptr(sc, ch, VTFT, 0xffff); - emu_wrptr(sc, ch, CVCF, 0xffff); - emu_wrptr(sc, ch, PTRX, 0); - emu_wrptr(sc, ch, CPF, 0); - emu_wrptr(sc, ch, CCR, 0); - - emu_wrptr(sc, ch, PSST, 0); - emu_wrptr(sc, ch, DSL, 0x10); - emu_wrptr(sc, ch, CCCA, 0); - emu_wrptr(sc, ch, Z1, 0); - emu_wrptr(sc, ch, Z2, 0); - emu_wrptr(sc, ch, FXRT, 0xd01c0000); - - emu_wrptr(sc, ch, ATKHLDM, 0); - emu_wrptr(sc, ch, DCYSUSM, 0); - emu_wrptr(sc, ch, IFATN, 0xffff); - emu_wrptr(sc, ch, PEFE, 0); - emu_wrptr(sc, ch, FMMOD, 0); - emu_wrptr(sc, ch, TREMFRQ, 24); /* 1 Hz */ - emu_wrptr(sc, ch, FM2FRQ2, 24); /* 1 Hz */ - emu_wrptr(sc, ch, TEMPENV, 0); + emu_wrptr(sc, ch, EMU_CHAN_DCYSUSV, ENV_OFF); + emu_wrptr(sc, ch, EMU_CHAN_IP, 0); + emu_wrptr(sc, ch, EMU_CHAN_VTFT, 0xffff); + emu_wrptr(sc, ch, EMU_CHAN_CVCF, 0xffff); + emu_wrptr(sc, ch, EMU_CHAN_PTRX, 0); + emu_wrptr(sc, ch, EMU_CHAN_CPF, 0); + emu_wrptr(sc, ch, EMU_CHAN_CCR, 0); + + emu_wrptr(sc, ch, EMU_CHAN_PSST, 0); + emu_wrptr(sc, ch, EMU_CHAN_DSL, 0x10); + emu_wrptr(sc, ch, EMU_CHAN_CCCA, 0); + emu_wrptr(sc, ch, EMU_CHAN_Z1, 0); + emu_wrptr(sc, ch, EMU_CHAN_Z2, 0); + emu_wrptr(sc, ch, EMU_CHAN_FXRT, 0xd01c0000); + + emu_wrptr(sc, ch, EMU_CHAN_ATKHLDM, 0); + emu_wrptr(sc, ch, EMU_CHAN_DCYSUSM, 0); + emu_wrptr(sc, ch, EMU_CHAN_IFATN, 0xffff); + emu_wrptr(sc, ch, EMU_CHAN_PEFE, 0); + emu_wrptr(sc, ch, EMU_CHAN_FMMOD, 0); + emu_wrptr(sc, ch, EMU_CHAN_TREMFRQ, 24); /* 1 Hz */ + emu_wrptr(sc, ch, EMU_CHAN_FM2FRQ2, 24); /* 1 Hz */ + emu_wrptr(sc, ch, EMU_CHAN_TEMPENV, 0); /*** these are last so OFF prevents writing ***/ - emu_wrptr(sc, ch, LFOVAL2, 0); - emu_wrptr(sc, ch, LFOVAL1, 0); - emu_wrptr(sc, ch, ATKHLDV, 0); - emu_wrptr(sc, ch, ENVVOL, 0); - emu_wrptr(sc, ch, ENVVAL, 0); + emu_wrptr(sc, ch, EMU_CHAN_LFOVAL2, 0); + emu_wrptr(sc, ch, EMU_CHAN_LFOVAL1, 0); + emu_wrptr(sc, ch, EMU_CHAN_ATKHLDV, 0); + emu_wrptr(sc, ch, EMU_CHAN_ENVVOL, 0); + emu_wrptr(sc, ch, EMU_CHAN_ENVVAL, 0); if (sc->audigy) { /* audigy cards need this to initialize correctly */ @@ -1736,9 +1818,9 @@ emu_init(struct sc_info *sc) emu_wrptr(sc, ch, 0x4e, 0); emu_wrptr(sc, ch, 0x4f, 0); /* set default routing */ - emu_wrptr(sc, ch, A_FXRT1, 0x03020100); - emu_wrptr(sc, ch, A_FXRT2, 0x3f3f3f3f); - emu_wrptr(sc, ch, A_SENDAMOUNTS, 0); + emu_wrptr(sc, ch, EMU_A_CHAN_FXRT1, 0x03020100); + emu_wrptr(sc, ch, EMU_A_CHAN_FXRT2, 0x3f3f3f3f); + emu_wrptr(sc, ch, EMU_A_CHAN_SENDAMOUNTS, 0); } sc->voice[ch].vnum = ch; @@ -1769,13 +1851,13 @@ emu_init(struct sc_info *sc) * AN = 0 (Audio data) * P = 0 (Consumer) */ - spcs = SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 | - SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | - SPCS_GENERATIONSTATUS | 0x00001200 | 0x00000000 | - SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT; - emu_wrptr(sc, 0, SPCS0, spcs); - emu_wrptr(sc, 0, SPCS1, spcs); - emu_wrptr(sc, 0, SPCS2, spcs); + spcs = EMU_SPCS_CLKACCY_1000PPM | EMU_SPCS_SAMPLERATE_48 | + EMU_SPCS_CHANNELNUM_LEFT | EMU_SPCS_SOURCENUM_UNSPEC | + EMU_SPCS_GENERATIONSTATUS | 0x00001200 | 0x00000000 | + EMU_SPCS_EMPHASIS_NONE | EMU_SPCS_COPYRIGHT; + emu_wrptr(sc, 0, EMU_SPCS0, spcs); + emu_wrptr(sc, 0, EMU_SPCS1, spcs); + emu_wrptr(sc, 0, EMU_SPCS2, spcs); if (!sc->audigy) emu_initefx(sc); @@ -1786,8 +1868,8 @@ emu_init(struct sc_info *sc) u_int32_t tmp; /* Setup SRCMulti_I2S SamplingRate */ - tmp = emu_rdptr(sc, 0, A_SPDIF_SAMPLERATE) & 0xfffff1ff; - emu_wrptr(sc, 0, A_SPDIF_SAMPLERATE, tmp | 0x400); + tmp = emu_rdptr(sc, 0, EMU_A_SPDIF_SAMPLERATE) & 0xfffff1ff; + emu_wrptr(sc, 0, EMU_A_SPDIF_SAMPLERATE, tmp | 0x400); /* Setup SRCSel (Enable SPDIF, I2S SRCMulti) */ emu_wr(sc, 0x20, 0x00600000, 4); @@ -1816,13 +1898,13 @@ emu_init(struct sc_info *sc) for (i = 0; i < EMUMAXPAGES; i++) sc->mem.ptb_pages[i] = tmp | i; - emu_wrptr(sc, 0, PTB, (sc->mem.ptb_pages_addr)); - emu_wrptr(sc, 0, TCB, 0); /* taken from original driver */ - emu_wrptr(sc, 0, TCBS, 0); /* taken from original driver */ + emu_wrptr(sc, 0, EMU_PTB, (sc->mem.ptb_pages_addr)); + emu_wrptr(sc, 0, EMU_TCB, 0); /* taken from original driver */ + emu_wrptr(sc, 0, EMU_TCBS, 0); /* taken from original driver */ for (ch = 0; ch < NUM_G; ch++) { - emu_wrptr(sc, ch, MAPA, tmp | MAP_PTI_MASK); - emu_wrptr(sc, ch, MAPB, tmp | MAP_PTI_MASK); + emu_wrptr(sc, ch, EMU_CHAN_MAPA, tmp | EMU_CHAN_MAP_PTI_MASK); + emu_wrptr(sc, ch, EMU_CHAN_MAPB, tmp | EMU_CHAN_MAP_PTI_MASK); } /* emu_memalloc(sc, EMUPAGESIZE); */ @@ -1850,19 +1932,19 @@ emu_init(struct sc_info *sc) */ if (sc->audigy) { - tmp = HCFG_AUTOMUTE | HCFG_JOYENABLE; + tmp = EMU_HCFG_AUTOMUTE | EMU_HCFG_JOYENABLE; if (sc->audigy2) /* Audigy 2 */ - tmp = HCFG_AUDIOENABLE | HCFG_AC3ENABLE_CDSPDIF | - HCFG_AC3ENABLE_GPSPDIF; - emu_wr(sc, HCFG, tmp, 4); + tmp = EMU_HCFG_AUDIOENABLE | EMU_HCFG_AC3ENABLE_CDSPDIF | + EMU_HCFG_AC3ENABLE_GPSPDIF; + emu_wr(sc, EMU_HCFG, tmp, 4); audigy_initefx(sc); /* from ALSA initialization code: */ /* enable audio and disable both audio/digital outputs */ - emu_wr(sc, HCFG, emu_rd(sc, HCFG, 4) | HCFG_AUDIOENABLE, 4); - emu_wr(sc, A_IOCFG, emu_rd(sc, A_IOCFG, 4) & ~A_IOCFG_GPOUT_AD, + emu_wr(sc, EMU_HCFG, emu_rd(sc, EMU_HCFG, 4) | EMU_HCFG_AUDIOENABLE, 4); + emu_wr(sc, EMU_A_IOCFG, emu_rd(sc, EMU_A_IOCFG, 4) & ~EMU_A_IOCFG_GPOUT_AD, 4); if (sc->audigy2) { /* Audigy 2 */ /* Unmute Analog. @@ -1870,27 +1952,27 @@ emu_init(struct sc_info *sc) * init Alice3 I2SOut beyond 48kHz. * So, sequence is important. */ - emu_wr(sc, A_IOCFG, - emu_rd(sc, A_IOCFG, 4) | A_IOCFG_GPOUT_A, 4); + emu_wr(sc, EMU_A_IOCFG, + emu_rd(sc, EMU_A_IOCFG, 4) | EMU_A_IOCFG_GPOUT_A, 4); } } else { /* EMU10K1 initialization code */ - tmp = HCFG_AUDIOENABLE | HCFG_LOCKTANKCACHE_MASK - | HCFG_AUTOMUTE; + tmp = EMU_HCFG_AUDIOENABLE | EMU_HCFG_LOCKTANKCACHE_MASK + | EMU_HCFG_AUTOMUTE; if (sc->rev >= 6) - tmp |= HCFG_JOYENABLE; + tmp |= EMU_HCFG_JOYENABLE; - emu_wr(sc, HCFG, tmp, 4); + emu_wr(sc, EMU_HCFG, tmp, 4); /* TOSLink detection */ sc->tos_link = 0; - tmp = emu_rd(sc, HCFG, 4); - if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) { - emu_wr(sc, HCFG, tmp | HCFG_GPOUT1, 4); + tmp = emu_rd(sc, EMU_HCFG, 4); + if (tmp & (EMU_HCFG_GPINPUT0 | EMU_HCFG_GPINPUT1)) { + emu_wr(sc, EMU_HCFG, tmp | EMU_HCFG_GPOUT1, 4); DELAY(50); - if (tmp != (emu_rd(sc, HCFG, 4) & ~HCFG_GPOUT1)) { + if (tmp != (emu_rd(sc, EMU_HCFG, 4) & ~EMU_HCFG_GPOUT1)) { sc->tos_link = 1; - emu_wr(sc, HCFG, tmp, 4); + emu_wr(sc, EMU_HCFG, tmp, 4); } } } @@ -1903,42 +1985,42 @@ emu_uninit(struct sc_info *sc) { u_int32_t ch; - emu_wr(sc, INTE, 0, 4); + emu_wr(sc, EMU_INTE, 0, 4); for (ch = 0; ch < NUM_G; ch++) - emu_wrptr(sc, ch, DCYSUSV, ENV_OFF); + emu_wrptr(sc, ch, EMU_CHAN_DCYSUSV, ENV_OFF); for (ch = 0; ch < NUM_G; ch++) { - emu_wrptr(sc, ch, VTFT, 0); - emu_wrptr(sc, ch, CVCF, 0); - emu_wrptr(sc, ch, PTRX, 0); - emu_wrptr(sc, ch, CPF, 0); + emu_wrptr(sc, ch, EMU_CHAN_VTFT, 0); + emu_wrptr(sc, ch, EMU_CHAN_CVCF, 0); + emu_wrptr(sc, ch, EMU_CHAN_PTRX, 0); + emu_wrptr(sc, ch, EMU_CHAN_CPF, 0); } if (sc->audigy) { /* stop fx processor */ - emu_wrptr(sc, 0, A_DBG, A_DBG_SINGLE_STEP); + emu_wrptr(sc, 0, EMU_A_DBG, EMU_A_DBG_SINGLE_STEP); } /* disable audio and lock cache */ - emu_wr(sc, HCFG, - HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, + emu_wr(sc, EMU_HCFG, + EMU_HCFG_LOCKSOUNDCACHE | EMU_HCFG_LOCKTANKCACHE_MASK | EMU_HCFG_MUTEBUTTONENABLE, 4); - emu_wrptr(sc, 0, PTB, 0); + emu_wrptr(sc, 0, EMU_PTB, 0); /* reset recording buffers */ - emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, MICBA, 0); - emu_wrptr(sc, 0, FXBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, FXBA, 0); - emu_wrptr(sc, 0, FXWC, 0); - emu_wrptr(sc, 0, ADCBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, ADCBA, 0); - emu_wrptr(sc, 0, TCB, 0); - emu_wrptr(sc, 0, TCBS, 0); + emu_wrptr(sc, 0, EMU_MICBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_MICBA, 0); + emu_wrptr(sc, 0, EMU_FXBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_FXBA, 0); + emu_wrptr(sc, 0, EMU_FXWC, 0); + emu_wrptr(sc, 0, EMU_ADCBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_ADCBA, 0); + emu_wrptr(sc, 0, EMU_TCB, 0); + emu_wrptr(sc, 0, EMU_TCBS, 0); /* disable channel interrupt */ - emu_wrptr(sc, 0, CLIEL, 0); - emu_wrptr(sc, 0, CLIEH, 0); - emu_wrptr(sc, 0, SOLEL, 0); - emu_wrptr(sc, 0, SOLEH, 0); + emu_wrptr(sc, 0, EMU_CLIEL, 0); + emu_wrptr(sc, 0, EMU_CLIEH, 0); + emu_wrptr(sc, 0, EMU_SOLEL, 0); + emu_wrptr(sc, 0, EMU_SOLEH, 0); /* init envelope engine */ if (!SLIST_EMPTY(&sc->mem.blocks)) @@ -1997,7 +2079,7 @@ emu_pci_attach(device_t dev) sc->audigy = sc->type == EMU10K2_PCI_ID || sc->type == EMU10K3_PCI_ID; sc->audigy2 = (sc->audigy && sc->rev == 0x04); sc->nchans = sc->audigy ? 8 : 4; - sc->addrmask = sc->audigy ? A_PTR_ADDRESS_MASK : PTR_ADDRESS_MASK; + sc->addrmask = sc->audigy ? EMU_A_PTR_ADDR_MASK : EMU_PTR_ADDR_MASK; data = pci_read_config(dev, PCIR_COMMAND, 2); data |= (PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN); Copied: stable/8/sys/dev/sound/pci/emuxkireg.h (from r229430, head/sys/dev/sound/pci/emuxkireg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/sound/pci/emuxkireg.h Fri Feb 3 22:13:36 2012 (r230963, copy of r229430, head/sys/dev/sound/pci/emuxkireg.h) @@ -0,0 +1,689 @@ +/* $FreeBSD$ */ +/* $NetBSD: emuxkireg.h,v 1.8 2008/04/28 20:23:54 martin Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Yannick Montulet. + * + * 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. + */ + +#ifndef _DEV_PCI_EMUXKIREG_H_ +#define _DEV_PCI_EMUXKIREG_H_ + +/* + * Register values for Creative EMU10000. The register values have been + * taken from GPLed SBLive! header file published by Creative. The comments + * have been stripped to avoid GPL pollution in kernel. The Creative version + * including comments is available in Linux 2.4.* kernel as file + * drivers/sound/emu10k1/8010.h + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 22:39:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0057F106566C; Fri, 3 Feb 2012 22:39:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E075F8FC0C; Fri, 3 Feb 2012 22:39:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13Md4EB007472; Fri, 3 Feb 2012 22:39:04 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13Md4WN007466; Fri, 3 Feb 2012 22:39:04 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202032239.q13Md4WN007466@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 3 Feb 2012 22:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230964 - in stable/9/sys: conf dev/sound/pci gnu/dev/sound/pci modules/sound/driver/emu10kx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 22:39:05 -0000 Author: pfg Date: Fri Feb 3 22:39:04 2012 New Revision: 230964 URL: http://svn.freebsd.org/changeset/base/230964 Log: MFC: r229981, r230898 Replace a GPL'd header in the emu10kx snd driver code. This uses the emuxkireg.h already used in the emu10k1 snd driver. Special thanks go to Alexander Motin as he was able to find some errors and reverse engineer some wrong values in the emuxkireg header. While here also merge some cleanups to the module Makefile. PR: 153901 Obtained from: NetBSD Approved by: core (mentor implicit) Deleted: stable/9/sys/gnu/dev/sound/pci/emu10k1-alsa.h stable/9/sys/gnu/dev/sound/pci/p16v-alsa.h stable/9/sys/gnu/dev/sound/pci/p17v-alsa.h Modified: stable/9/sys/conf/files stable/9/sys/dev/sound/pci/emu10kx-midi.c stable/9/sys/dev/sound/pci/emu10kx-pcm.c stable/9/sys/dev/sound/pci/emu10kx.c stable/9/sys/dev/sound/pci/emu10kx.h stable/9/sys/dev/sound/pci/emuxkireg.h stable/9/sys/modules/sound/driver/emu10kx/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/modules/sound/driver/emu10kx/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Fri Feb 3 22:13:36 2012 (r230963) +++ stable/9/sys/conf/files Fri Feb 3 22:39:04 2012 (r230964) @@ -50,11 +50,6 @@ aic79xx_reg_print.c optional ahd pci aic79xx_reg_print.o optional ahd pci ahd_reg_pretty_print \ compile-with "${NORMAL_C}" \ no-implicit-rule local -emu10k1-alsa%diked.h optional snd_emu10kx \ - dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h" \ - 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 @@ -67,16 +62,6 @@ fdt_static_dtb.h optional fdt fdt_dtb_s 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" \ - no-obj no-implicit-rule before-depend \ - clean "p16v-alsa%diked.h" -p17v-alsa%diked.h optional snd_emu10kx pci \ - dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h" \ - compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h p17v-alsa%diked.h" \ - no-obj no-implicit-rule before-depend \ - clean "p17v-alsa%diked.h" feeder_eq_gen.h optional sound \ dependency "$S/tools/sound/feeder_eq_mkfilter.awk" \ compile-with "${AWK} -f $S/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > feeder_eq_gen.h" \ @@ -1728,19 +1713,9 @@ dev/sound/pci/csa.c optional snd_csa pc dev/sound/pci/csapcm.c optional snd_csa pci dev/sound/pci/ds1.c optional snd_ds1 pci dev/sound/pci/emu10k1.c optional snd_emu10k1 pci -dev/sound/pci/emu10kx.c optional snd_emu10kx pci \ - dependency "emu10k1-alsa%diked.h" \ - dependency "p16v-alsa%diked.h" \ - dependency "p17v-alsa%diked.h" \ - warning "kernel contains GPL contaminated emu10kx headers" -dev/sound/pci/emu10kx-pcm.c optional snd_emu10kx pci \ - dependency "emu10k1-alsa%diked.h" \ - dependency "p16v-alsa%diked.h" \ - dependency "p17v-alsa%diked.h" \ - warning "kernel contains GPL contaminated emu10kx headers" -dev/sound/pci/emu10kx-midi.c optional snd_emu10kx pci \ - dependency "emu10k1-alsa%diked.h" \ - warning "kernel contains GPL contaminated emu10kx headers" +dev/sound/pci/emu10kx.c optional snd_emu10kx pci +dev/sound/pci/emu10kx-pcm.c optional snd_emu10kx pci +dev/sound/pci/emu10kx-midi.c optional snd_emu10kx pci dev/sound/pci/envy24.c optional snd_envy24 pci dev/sound/pci/envy24ht.c optional snd_envy24ht pci dev/sound/pci/es137x.c optional snd_es137x pci Modified: stable/9/sys/dev/sound/pci/emu10kx-midi.c ============================================================================== --- stable/9/sys/dev/sound/pci/emu10kx-midi.c Fri Feb 3 22:13:36 2012 (r230963) +++ stable/9/sys/dev/sound/pci/emu10kx-midi.c Fri Feb 3 22:39:04 2012 (r230964) @@ -50,8 +50,8 @@ #include #include "mpufoi_if.h" +#include #include -#include "emu10k1-alsa%diked.h" struct emu_midi_softc { struct mtx mtx; @@ -176,25 +176,25 @@ emu_midi_attach(device_t dev) if (scp->is_emu10k1) { /* SB Live! - only one MIDI device here */ inte_val = 0; - /* inte_val |= INTE_MIDITXENABLE;*/ - inte_val |= INTE_MIDIRXENABLE; - ipr_val = IPR_MIDITRANSBUFEMPTY; - ipr_val |= IPR_MIDIRECVBUFEMPTY; + /* inte_val |= EMU_INTE_MIDITXENABLE;*/ + inte_val |= EMU_INTE_MIDIRXENABLE; + ipr_val = EMU_IPR_MIDITRANSBUFE; + ipr_val |= EMU_IPR_MIDIRECVBUFE; } else { - if (scp->port == A_MUDATA1) { + if (scp->port == EMU_A_MUDATA1) { /* EXTERNAL MIDI (AudigyDrive) */ inte_val = 0; - /* inte_val |= A_INTE_MIDITXENABLE1;*/ - inte_val |= INTE_MIDIRXENABLE; - ipr_val = IPR_MIDITRANSBUFEMPTY; - ipr_val |= IPR_MIDIRECVBUFEMPTY; + /* inte_val |= A_EMU_INTE_MIDITXENABLE1;*/ + inte_val |= EMU_INTE_MIDIRXENABLE; + ipr_val = EMU_IPR_MIDITRANSBUFE; + ipr_val |= EMU_IPR_MIDIRECVBUFE; } else { /* MIDI hw config port 2 */ inte_val = 0; - /* inte_val |= A_INTE_MIDITXENABLE2;*/ - inte_val |= INTE_A_MIDIRXENABLE2; - ipr_val = IPR_A_MIDITRANSBUFEMPTY2; - ipr_val |= IPR_A_MIDIRECVBUFEMPTY2; + /* inte_val |= A_EMU_INTE_MIDITXENABLE2;*/ + inte_val |= EMU_INTE_A_MIDIRXENABLE2; + ipr_val = EMU_IPR_A_MIDITRANSBUFE2; + ipr_val |= EMU_IPR_A_MIDIRECBUFE2; } } @@ -214,7 +214,7 @@ emu_midi_attach(device_t dev) if (scp->is_emu10k1) emu_enable_ir(scp->card); else { - if (scp->port == A_MUDATA1) + if (scp->port == EMU_A_MUDATA1) emu_enable_ir(scp->card); } Modified: stable/9/sys/dev/sound/pci/emu10kx-pcm.c ============================================================================== --- stable/9/sys/dev/sound/pci/emu10kx-pcm.c Fri Feb 3 22:13:36 2012 (r230963) +++ stable/9/sys/dev/sound/pci/emu10kx-pcm.c Fri Feb 3 22:39:04 2012 (r230964) @@ -49,8 +49,8 @@ #include "mixer_if.h" +#include #include -#include "emu10k1-alsa%diked.h" struct emu_pcm_pchinfo { int spd; @@ -555,8 +555,8 @@ emu_ac97_read_emulation(struct emu_pcm_i break; } - emu_wr(sc->card, AC97ADDRESS, regno, 1); - tmp = emu_rd(sc->card, AC97DATA, 2); + emu_wr(sc->card, EMU_AC97ADDR, regno, 1); + tmp = emu_rd(sc->card, EMU_AC97DATA, 2); if (use_ac97) emulated = tmp; @@ -621,8 +621,8 @@ emu_ac97_write_emulation(struct emu_pcm_ break; } if (write_ac97) { - emu_wr(sc->card, AC97ADDRESS, regno, 1); - emu_wr(sc->card, AC97DATA, data, 2); + emu_wr(sc->card, EMU_AC97ADDR, regno, 1); + emu_wr(sc->card, EMU_AC97DATA, data, 2); } } @@ -658,8 +658,8 @@ emu_rdcd(kobj_t obj __unused, void *devi struct emu_pcm_info *sc = (struct emu_pcm_info *)devinfo; KASSERT(sc->card != NULL, ("emu_rdcd: no soundcard")); - emu_wr(sc->card, AC97ADDRESS, regno, 1); - rd = emu_rd(sc->card, AC97DATA, 2); + emu_wr(sc->card, EMU_AC97ADDR, regno, 1); + rd = emu_rd(sc->card, EMU_AC97DATA, 2); return (rd); } @@ -669,8 +669,8 @@ emu_wrcd(kobj_t obj __unused, void *devi struct emu_pcm_info *sc = (struct emu_pcm_info *)devinfo; KASSERT(sc->card != NULL, ("emu_wrcd: no soundcard")); - emu_wr(sc->card, AC97ADDRESS, regno, 1); - emu_wr(sc->card, AC97DATA, data, 2); + emu_wr(sc->card, EMU_AC97ADDR, regno, 1); + emu_wr(sc->card, EMU_AC97DATA, data, 2); return (0); } @@ -870,12 +870,12 @@ emurchan_init(kobj_t obj __unused, void ch->blksz = sc->bufsz / 2; /* We rise interrupt for half-full buffer */ ch->fmt = SND_FORMAT(AFMT_U8, 1, 0); ch->spd = 8000; - ch->idxreg = sc->is_emu10k1 ? ADCIDX : A_ADCIDX; - ch->basereg = ADCBA; - ch->sizereg = ADCBS; - ch->setupreg = ADCCR; - ch->irqmask = INTE_ADCBUFENABLE; - ch->iprmask = IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL; + ch->idxreg = sc->is_emu10k1 ? EMU_ADCIDX : EMU_A_ADCIDX; + ch->basereg = EMU_ADCBA; + ch->sizereg = EMU_ADCBS; + ch->setupreg = EMU_ADCCR; + ch->irqmask = EMU_INTE_ADCBUFENABLE; + ch->iprmask = EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL; if (sndbuf_alloc(ch->buffer, emu_gettag(sc->card), 0, sc->bufsz) != 0) return (NULL); @@ -953,22 +953,22 @@ emurchan_trigger(kobj_t obj __unused, vo switch (sc->bufsz) { case 4096: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; break; case 8192: - sz = ADCBS_BUFSIZE_8192; + sz = EMU_RECBS_BUFSIZE_8192; break; case 16384: - sz = ADCBS_BUFSIZE_16384; + sz = EMU_RECBS_BUFSIZE_16384; break; case 32768: - sz = ADCBS_BUFSIZE_32768; + sz = EMU_RECBS_BUFSIZE_32768; break; case 65536: - sz = ADCBS_BUFSIZE_65536; + sz = EMU_RECBS_BUFSIZE_65536; break; default: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; } snd_mtxlock(sc->lock); @@ -976,9 +976,9 @@ emurchan_trigger(kobj_t obj __unused, vo case PCMTRIG_START: ch->run = 1; emu_wrptr(sc->card, 0, ch->sizereg, sz); - val = sc->is_emu10k1 ? ADCCR_LCHANENABLE : A_ADCCR_LCHANENABLE; + val = sc->is_emu10k1 ? EMU_ADCCR_LCHANENABLE : EMU_A_ADCCR_LCHANENABLE; if (AFMT_CHANNEL(ch->fmt) > 1) - val |= sc->is_emu10k1 ? ADCCR_RCHANENABLE : A_ADCCR_RCHANENABLE; + val |= sc->is_emu10k1 ? EMU_ADCCR_RCHANENABLE : EMU_A_ADCCR_RCHANENABLE; val |= sc->is_emu10k1 ? emu_k1_recval(ch->spd) : emu_k2_recval(ch->spd); emu_wrptr(sc->card, 0, ch->setupreg, 0); emu_wrptr(sc->card, 0, ch->setupreg, val); @@ -1049,11 +1049,11 @@ emufxrchan_init(kobj_t obj __unused, voi ch = &(sc->rch_efx); ch->fmt = SND_FORMAT(AFMT_S16_LE, 1, 0); ch->spd = sc->is_emu10k1 ? 48000*32 : 48000 * 64; - ch->idxreg = FXIDX; - ch->basereg = FXBA; - ch->sizereg = FXBS; - ch->irqmask = INTE_EFXBUFENABLE; - ch->iprmask = IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL; + ch->idxreg = EMU_FXIDX; + ch->basereg = EMU_FXBA; + ch->sizereg = EMU_FXBS; + ch->irqmask = EMU_INTE_EFXBUFENABLE; + ch->iprmask = EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL; ch->buffer = b; ch->pcm = sc; ch->channel = c; @@ -1113,22 +1113,22 @@ emufxrchan_trigger(kobj_t obj __unused, switch (sc->bufsz) { case 4096: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; break; case 8192: - sz = ADCBS_BUFSIZE_8192; + sz = EMU_RECBS_BUFSIZE_8192; break; case 16384: - sz = ADCBS_BUFSIZE_16384; + sz = EMU_RECBS_BUFSIZE_16384; break; case 32768: - sz = ADCBS_BUFSIZE_32768; + sz = EMU_RECBS_BUFSIZE_32768; break; case 65536: - sz = ADCBS_BUFSIZE_65536; + sz = EMU_RECBS_BUFSIZE_65536; break; default: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; } snd_mtxlock(sc->lock); @@ -1140,14 +1140,14 @@ emufxrchan_trigger(kobj_t obj __unused, /* * SB Live! is limited to 32 mono channels. Audigy * has 64 mono channels. Channels are enabled - * by setting a bit in A_FXWC[1|2] registers. + * by setting a bit in EMU_A_FXWC[1|2] registers. */ /* XXX there is no way to demultiplex this streams for now */ if (sc->is_emu10k1) { - emu_wrptr(sc->card, 0, FXWC, 0xffffffff); + emu_wrptr(sc->card, 0, EMU_FXWC, 0xffffffff); } else { - emu_wrptr(sc->card, 0, A_FXWC1, 0xffffffff); - emu_wrptr(sc->card, 0, A_FXWC2, 0xffffffff); + emu_wrptr(sc->card, 0, EMU_A_FXWC1, 0xffffffff); + emu_wrptr(sc->card, 0, EMU_A_FXWC2, 0xffffffff); } break; case PCMTRIG_STOP: @@ -1155,10 +1155,10 @@ emufxrchan_trigger(kobj_t obj __unused, case PCMTRIG_ABORT: ch->run = 0; if (sc->is_emu10k1) { - emu_wrptr(sc->card, 0, FXWC, 0x0); + emu_wrptr(sc->card, 0, EMU_FXWC, 0x0); } else { - emu_wrptr(sc->card, 0, A_FXWC1, 0x0); - emu_wrptr(sc->card, 0, A_FXWC2, 0x0); + emu_wrptr(sc->card, 0, EMU_A_FXWC1, 0x0); + emu_wrptr(sc->card, 0, EMU_A_FXWC2, 0x0); } emu_wrptr(sc->card, 0, ch->sizereg, 0); (void)emu_intr_unregister(sc->card, ch->ihandle); @@ -1238,8 +1238,8 @@ emu_pcm_intr(void *pcm, uint32_t stat) snd_mtxlock(sc->lock); - if (stat & IPR_INTERVALTIMER) { - ack |= IPR_INTERVALTIMER; + if (stat & EMU_IPR_INTERVALTIMER) { + ack |= EMU_IPR_INTERVALTIMER; for (i = 0; i < MAX_CHANNELS; i++) if (sc->pch[i].channel) { if (sc->pch[i].run == 1) { @@ -1262,8 +1262,8 @@ emu_pcm_intr(void *pcm, uint32_t stat) } - if (stat & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL)) { - ack |= stat & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL); + if (stat & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL)) { + ack |= stat & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL); if (sc->rch_adc.channel) { snd_mtxunlock(sc->lock); chn_intr(sc->rch_adc.channel); @@ -1271,8 +1271,8 @@ emu_pcm_intr(void *pcm, uint32_t stat) } } - if (stat & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL)) { - ack |= stat & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL); + if (stat & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL)) { + ack |= stat & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL); if (sc->rch_efx.channel) { snd_mtxunlock(sc->lock); chn_intr(sc->rch_efx.channel); @@ -1450,8 +1450,8 @@ emu_pcm_attach(device_t dev) goto bad; } - inte = INTE_INTERVALTIMERENB; - ipr = IPR_INTERVALTIMER; /* Used by playback & ADC */ + inte = EMU_INTE_INTERTIMERENB; + ipr = EMU_IPR_INTERVALTIMER; /* Used by playback & ADC */ sc->ihandle = emu_intr_register(sc->card, inte, ipr, &emu_pcm_intr, sc); if (emu_pcm_init(sc) == -1) { Modified: stable/9/sys/dev/sound/pci/emu10kx.c ============================================================================== --- stable/9/sys/dev/sound/pci/emu10kx.c Fri Feb 3 22:13:36 2012 (r230963) +++ stable/9/sys/dev/sound/pci/emu10kx.c Fri Feb 3 22:39:04 2012 (r230964) @@ -53,6 +53,7 @@ #include #include +#include #include /* hw flags */ @@ -181,7 +182,7 @@ #define A_IN_AUX2_R 0x0d #define A_IN_AUX2 A_IN_AUX2_L -/* Audigiy Outputs */ +/* Audigy Outputs */ #define A_OUT_D_FRONT_L 0x00 #define A_OUT_D_FRONT_R 0x01 #define A_OUT_D_FRONT A_OUT_D_FRONT_L @@ -217,9 +218,19 @@ #define A_OUT_ADC_REC_R 0x17 #define A_OUT_ADC_REC A_OUT_ADC_REC_L -#include "emu10k1-alsa%diked.h" -#include "p16v-alsa%diked.h" -#include "p17v-alsa%diked.h" +#define EMU_DATA2 0x24 +#define EMU_IPR2 0x28 +#define EMU_INTE2 0x2c +#define EMU_IPR3 0x38 +#define EMU_INTE3 0x3c + +#define EMU_A2_SRCSel 0x60 +#define EMU_A2_SRCMULTI_ENABLE 0x6e + +#define EMU_A_I2S_CAPTURE_96000 0x00000400 + +#define EMU_A2_MIXER_I2S_ENABLE 0x7B +#define EMU_A2_MIXER_SPDIF_ENABLE 0x7A #define C_FRONT_L 0 #define C_FRONT_R 1 @@ -630,7 +641,7 @@ emu_wr_nolock(struct emu_sc_info *sc, un } } /* - * PTR / DATA interface. Access to EMU10Kx is made + * EMU_PTR / EMU_DATA interface. Access to EMU10Kx is made * via (channel, register) pair. Some registers are channel-specific, * some not. */ @@ -639,11 +650,11 @@ emu_rdptr(struct emu_sc_info *sc, unsign { uint32_t ptr, val, mask, size, offset; - ptr = ((reg << 16) & sc->address_mask) | (chn & PTR_CHANNELNUM_MASK); + ptr = ((reg << 16) & sc->address_mask) | (chn & EMU_PTR_CHNO_MASK); EMU_RWLOCK(); - emu_wr_nolock(sc, PTR, ptr, 4); - val = emu_rd_nolock(sc, DATA, 4); + emu_wr_nolock(sc, EMU_PTR, ptr, 4); + val = emu_rd_nolock(sc, EMU_DATA, 4); EMU_RWUNLOCK(); /* @@ -666,10 +677,10 @@ emu_wrptr(struct emu_sc_info *sc, unsign { uint32_t ptr, mask, size, offset; - ptr = ((reg << 16) & sc->address_mask) | (chn & PTR_CHANNELNUM_MASK); + ptr = ((reg << 16) & sc->address_mask) | (chn & EMU_PTR_CHNO_MASK); EMU_RWLOCK(); - emu_wr_nolock(sc, PTR, ptr, 4); + emu_wr_nolock(sc, EMU_PTR, ptr, 4); /* * XXX Another kind of magic encoding in register number. This can * give you side effect - it will read previous data from register @@ -681,13 +692,13 @@ emu_wrptr(struct emu_sc_info *sc, unsign mask = ((1 << size) - 1) << offset; data <<= offset; data &= mask; - data |= emu_rd_nolock(sc, DATA, 4) & ~mask; + data |= emu_rd_nolock(sc, EMU_DATA, 4) & ~mask; } - emu_wr_nolock(sc, DATA, data, 4); + emu_wr_nolock(sc, EMU_DATA, data, 4); EMU_RWUNLOCK(); } /* - * PTR2 / DATA2 interface. Access to P16v is made + * EMU_A2_PTR / EMU_DATA2 interface. Access to P16v is made * via (channel, register) pair. Some registers are channel-specific, * some not. This interface is supported by CA0102 and CA0108 chips only. */ @@ -698,8 +709,8 @@ emu_rd_p16vptr(struct emu_sc_info *sc, u /* XXX separate lock? */ EMU_RWLOCK(); - emu_wr_nolock(sc, PTR2, (reg << 16) | chn, 4); - val = emu_rd_nolock(sc, DATA2, 4); + emu_wr_nolock(sc, EMU_A2_PTR, (reg << 16) | chn, 4); + val = emu_rd_nolock(sc, EMU_DATA2, 4); EMU_RWUNLOCK(); @@ -711,8 +722,8 @@ emu_wr_p16vptr(struct emu_sc_info *sc, u { EMU_RWLOCK(); - emu_wr_nolock(sc, PTR2, (reg << 16) | chn, 4); - emu_wr_nolock(sc, DATA2, data, 4); + emu_wr_nolock(sc, EMU_A2_PTR, (reg << 16) | chn, 4); + emu_wr_nolock(sc, EMU_DATA2, data, 4); EMU_RWUNLOCK(); } /* @@ -737,13 +748,13 @@ emu_wr_cbptr(struct emu_sc_info *sc, uin /* * Direct hardware register access - * Assume that it is never used to access PTR-based registers and can run unlocked. + * Assume that it is never used to access EMU_PTR-based registers and can run unlocked. */ void emu_wr(struct emu_sc_info *sc, unsigned int regno, uint32_t data, unsigned int size) { - KASSERT(regno != PTR, ("emu_wr: attempt to write to PTR")); - KASSERT(regno != PTR2, ("emu_wr: attempt to write to PTR2")); + KASSERT(regno != EMU_PTR, ("emu_wr: attempt to write to EMU_PTR")); + KASSERT(regno != EMU_A2_PTR, ("emu_wr: attempt to write to EMU_A2_PTR")); emu_wr_nolock(sc, regno, data, size); } @@ -753,8 +764,8 @@ emu_rd(struct emu_sc_info *sc, unsigned { uint32_t rd; - KASSERT(regno != DATA, ("emu_rd: attempt to read DATA")); - KASSERT(regno != DATA2, ("emu_rd: attempt to read DATA2")); + KASSERT(regno != EMU_DATA, ("emu_rd: attempt to read DATA")); + KASSERT(regno != EMU_DATA2, ("emu_rd: attempt to read DATA2")); rd = emu_rd_nolock(sc, regno, size); return (rd); @@ -770,24 +781,24 @@ emu_enable_ir(struct emu_sc_info *sc) uint32_t iocfg; if (sc->is_emu10k2 || sc->is_ca0102) { - iocfg = emu_rd_nolock(sc, A_IOCFG, 2); - emu_wr_nolock(sc, A_IOCFG, iocfg | A_IOCFG_GPOUT2, 2); + iocfg = emu_rd_nolock(sc, EMU_A_IOCFG, 2); + emu_wr_nolock(sc, EMU_A_IOCFG, iocfg | EMU_A_IOCFG_GPOUT2, 2); DELAY(500); - emu_wr_nolock(sc, A_IOCFG, iocfg | A_IOCFG_GPOUT1 | A_IOCFG_GPOUT2, 2); + emu_wr_nolock(sc, EMU_A_IOCFG, iocfg | EMU_A_IOCFG_GPOUT1 | EMU_A_IOCFG_GPOUT2, 2); DELAY(500); - emu_wr_nolock(sc, A_IOCFG, iocfg | A_IOCFG_GPOUT1, 2); + emu_wr_nolock(sc, EMU_A_IOCFG, iocfg | EMU_A_IOCFG_GPOUT1, 2); DELAY(100); - emu_wr_nolock(sc, A_IOCFG, iocfg, 2); + emu_wr_nolock(sc, EMU_A_IOCFG, iocfg, 2); device_printf(sc->dev, "Audigy IR MIDI events enabled.\n"); sc->enable_ir = 1; } if (sc->is_emu10k1) { - iocfg = emu_rd_nolock(sc, HCFG, 4); - emu_wr_nolock(sc, HCFG, iocfg | HCFG_GPOUT2, 4); + iocfg = emu_rd_nolock(sc, EMU_HCFG, 4); + emu_wr_nolock(sc, EMU_HCFG, iocfg | EMU_HCFG_GPOUT2, 4); DELAY(500); - emu_wr_nolock(sc, HCFG, iocfg | HCFG_GPOUT1 | HCFG_GPOUT2, 4); + emu_wr_nolock(sc, EMU_HCFG, iocfg | EMU_HCFG_GPOUT1 | EMU_HCFG_GPOUT2, 4); DELAY(100); - emu_wr_nolock(sc, HCFG, iocfg, 4); + emu_wr_nolock(sc, EMU_HCFG, iocfg, 4); device_printf(sc->dev, "SB Live! IR MIDI events enabled.\n"); sc->enable_ir = 1; } @@ -835,7 +846,7 @@ emu_timer_set(struct emu_sc_info *sc, in sc->timerinterval = sc->timer[i]; /* XXX */ - emu_wr(sc, TIMER, sc->timerinterval & 0x03ff, 2); + emu_wr(sc, EMU_TIMER, sc->timerinterval & 0x03ff, 2); mtx_unlock(&sc->lock); return (timer); @@ -868,16 +879,16 @@ emu_timer_enable(struct emu_sc_info *sc, ena_int = 1; } - emu_wr(sc, TIMER, sc->timerinterval & 0x03ff, 2); + emu_wr(sc, EMU_TIMER, sc->timerinterval & 0x03ff, 2); if (ena_int == 1) { - x = emu_rd(sc, INTE, 4); - x |= INTE_INTERVALTIMERENB; - emu_wr(sc, INTE, x, 4); + x = emu_rd(sc, EMU_INTE, 4); + x |= EMU_INTE_INTERTIMERENB; + emu_wr(sc, EMU_INTE, x, 4); } else { - x = emu_rd(sc, INTE, 4); - x &= ~INTE_INTERVALTIMERENB; - emu_wr(sc, INTE, x, 4); + x = emu_rd(sc, EMU_INTE, 4); + x &= ~EMU_INTE_INTERTIMERENB; + emu_wr(sc, EMU_INTE, x, 4); } mtx_unlock(&sc->lock); return (0); @@ -917,9 +928,9 @@ emu_intr_register(struct emu_sc_info *sc sc->ihandler[i].intr_mask = intr_mask; sc->ihandler[i].softc = isc; sc->ihandler[i].irq_func = func; - x = emu_rd(sc, INTE, 4); + x = emu_rd(sc, EMU_INTE, 4); x |= inte_mask; - emu_wr(sc, INTE, x, 4); + emu_wr(sc, EMU_INTE, x, 4); mtx_unlock(&sc->lock); if (sc->dbg_level > 1) device_printf(sc->dev, "ihandle %d registered\n", i); @@ -946,7 +957,7 @@ emu_intr_unregister(struct emu_sc_info * return (-1); } - x = emu_rd(sc, INTE, 4); + x = emu_rd(sc, EMU_INTE, 4); x &= ~sc->ihandler[hnumber].inte_mask; sc->ihandler[hnumber].inte_mask = 0; @@ -954,12 +965,12 @@ emu_intr_unregister(struct emu_sc_info * sc->ihandler[hnumber].softc = NULL; sc->ihandler[hnumber].irq_func = NULL; - /* other interrupt handlers may use this INTE value */ + /* other interrupt handlers may use this EMU_INTE value */ for (i = 0; i < EMU_MAX_IRQ_CONSUMERS; i++) if (sc->ihandler[i].inte_mask != 0) x |= sc->ihandler[i].inte_mask; - emu_wr(sc, INTE, x, 4); + emu_wr(sc, EMU_INTE, x, 4); mtx_unlock(&sc->lock); return (hnumber); @@ -973,11 +984,11 @@ emu_intr(void *p) int i; for (;;) { - stat = emu_rd(sc, IPR, 4); + stat = emu_rd(sc, EMU_IPR, 4); ack = 0; if (stat == 0) break; - emu_wr(sc, IPR, stat, 4); + emu_wr(sc, EMU_IPR, stat, 4); for (i = 0; i < EMU_MAX_IRQ_CONSUMERS; i++) { if ((((sc->ihandler[i].intr_mask) & stat) != 0) && (((void *)sc->ihandler[i].irq_func) != NULL)) { @@ -993,13 +1004,13 @@ emu_intr(void *p) if ((sc->is_ca0102) || (sc->is_ca0108)) for (;;) { - stat = emu_rd(sc, IPR2, 4); + stat = emu_rd(sc, EMU_IPR2, 4); ack = 0; if (stat == 0) break; - emu_wr(sc, IPR2, stat, 4); + emu_wr(sc, EMU_IPR2, stat, 4); if (sc->dbg_level > 1) - device_printf(sc->dev, "IPR2: %08x\n", stat); + device_printf(sc->dev, "EMU_IPR2: %08x\n", stat); break; /* to avoid infinite loop. shoud be removed * after completion of P16V interface. */ @@ -1007,13 +1018,13 @@ emu_intr(void *p) if (sc->is_ca0102) for (;;) { - stat = emu_rd(sc, IPR3, 4); + stat = emu_rd(sc, EMU_IPR3, 4); ack = 0; if (stat == 0) break; - emu_wr(sc, IPR3, stat, 4); + emu_wr(sc, EMU_IPR3, stat, 4); if (sc->dbg_level > 1) - device_printf(sc->dev, "IPR3: %08x\n", stat); + device_printf(sc->dev, "EMU_IPR3: %08x\n", stat); break; /* to avoid infinite loop. should be removed * after completion of S/PDIF interface */ @@ -1374,61 +1385,61 @@ emu_vwrite(struct emu_sc_info *sc, struc if (v->stereo) { - emu_wrptr(sc, v->vnum, CPF, CPF_STEREO_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF, EMU_CHAN_CPF_STEREO_MASK); } else { - emu_wrptr(sc, v->vnum, CPF, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF, 0); } val = v->stereo ? 28 : 30; val *= v->b16 ? 1 : 2; start = v->sa + val; if (sc->is_emu10k1) { - emu_wrptr(sc, v->vnum, FXRT, ((v->routing[3] << 12) | + emu_wrptr(sc, v->vnum, EMU_CHAN_FXRT, ((v->routing[3] << 12) | (v->routing[2] << 8) | (v->routing[1] << 4) | (v->routing[0] << 0)) << 16); } else { - emu_wrptr(sc, v->vnum, A_FXRT1, (v->routing[3] << 24) | + emu_wrptr(sc, v->vnum, EMU_A_CHAN_FXRT1, (v->routing[3] << 24) | (v->routing[2] << 16) | (v->routing[1] << 8) | (v->routing[0] << 0)); - emu_wrptr(sc, v->vnum, A_FXRT2, (v->routing[7] << 24) | + emu_wrptr(sc, v->vnum, EMU_A_CHAN_FXRT2, (v->routing[7] << 24) | (v->routing[6] << 16) | (v->routing[5] << 8) | (v->routing[4] << 0)); - emu_wrptr(sc, v->vnum, A_SENDAMOUNTS, (v->amounts[7] << 24) | + emu_wrptr(sc, v->vnum, EMU_A_CHAN_SENDAMOUNTS, (v->amounts[7] << 24) | (v->amounts[6] << 26) | (v->amounts[5] << 8) | (v->amounts[4] << 0)); } - emu_wrptr(sc, v->vnum, PTRX, (v->amounts[0] << 8) | (v->amounts[1] << 0)); - emu_wrptr(sc, v->vnum, DSL, v->ea | (v->amounts[3] << 24)); - emu_wrptr(sc, v->vnum, PSST, v->sa | (v->amounts[2] << 24)); - - emu_wrptr(sc, v->vnum, CCCA, start | (v->b16 ? 0 : CCCA_8BITSELECT)); - emu_wrptr(sc, v->vnum, Z1, 0); - emu_wrptr(sc, v->vnum, Z2, 0); - - silent_page = ((uint32_t) (sc->mem.silent_page_addr) << 1) | MAP_PTI_MASK; - emu_wrptr(sc, v->vnum, MAPA, silent_page); - emu_wrptr(sc, v->vnum, MAPB, silent_page); - - emu_wrptr(sc, v->vnum, CVCF, CVCF_CURRENTFILTER_MASK); - emu_wrptr(sc, v->vnum, VTFT, VTFT_FILTERTARGET_MASK); - emu_wrptr(sc, v->vnum, ATKHLDM, 0); - emu_wrptr(sc, v->vnum, DCYSUSM, DCYSUSM_DECAYTIME_MASK); - emu_wrptr(sc, v->vnum, LFOVAL1, 0x8000); - emu_wrptr(sc, v->vnum, LFOVAL2, 0x8000); - emu_wrptr(sc, v->vnum, FMMOD, 0); - emu_wrptr(sc, v->vnum, TREMFRQ, 0); - emu_wrptr(sc, v->vnum, FM2FRQ2, 0); - emu_wrptr(sc, v->vnum, ENVVAL, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX, (v->amounts[0] << 8) | (v->amounts[1] << 0)); + emu_wrptr(sc, v->vnum, EMU_CHAN_DSL, v->ea | (v->amounts[3] << 24)); + emu_wrptr(sc, v->vnum, EMU_CHAN_PSST, v->sa | (v->amounts[2] << 24)); + + emu_wrptr(sc, v->vnum, EMU_CHAN_CCCA, start | (v->b16 ? 0 : EMU_CHAN_CCCA_8BITSELECT)); + emu_wrptr(sc, v->vnum, EMU_CHAN_Z1, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_Z2, 0); + + silent_page = ((uint32_t) (sc->mem.silent_page_addr) << 1) | EMU_CHAN_MAP_PTI_MASK; + emu_wrptr(sc, v->vnum, EMU_CHAN_MAPA, silent_page); + emu_wrptr(sc, v->vnum, EMU_CHAN_MAPB, silent_page); + + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, EMU_CHAN_CVCF_CURRFILTER_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, EMU_CHAN_VTFT_FILTERTARGET_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_ATKHLDM, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_DCYSUSM, EMU_CHAN_DCYSUSM_DECAYTIME_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_LFOVAL1, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_LFOVAL2, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_FMMOD, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_TREMFRQ, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_FM2FRQ2, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_ENVVAL, 0x8000); - emu_wrptr(sc, v->vnum, ATKHLDV, ATKHLDV_HOLDTIME_MASK | ATKHLDV_ATTACKTIME_MASK); - emu_wrptr(sc, v->vnum, ENVVOL, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_ATKHLDV, EMU_CHAN_ATKHLDV_HOLDTIME_MASK | EMU_CHAN_ATKHLDV_ATTACKTIME_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_ENVVOL, 0x8000); - emu_wrptr(sc, v->vnum, PEFE_FILTERAMOUNT, 0x7f); - emu_wrptr(sc, v->vnum, PEFE_PITCHAMOUNT, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_PEFE_FILTERAMOUNT, 0x7f); + emu_wrptr(sc, v->vnum, EMU_CHAN_PEFE_PITCHAMOUNT, 0); if ((v->stereo) && (v->slave != NULL)) emu_vwrite(sc, v->slave); } @@ -1438,7 +1449,7 @@ emu_vstop(struct emu_sc_info *sc, char c { int reg; - reg = (channel & 0x20) ? SOLEH : SOLEL; + reg = (channel & 0x20) ? EMU_SOLEH : EMU_SOLEL; channel &= 0x1f; reg |= 1 << 24; reg |= channel << 16; @@ -1459,29 +1470,29 @@ emu_vtrigger(struct emu_sc_info *sc, str ccis *= v->b16 ? 1 : 2; sample = v->b16 ? 0x00000000 : 0x80808080; for (i = 0; i < cs; i++) - emu_wrptr(sc, v->vnum, CD0 + i, sample); - emu_wrptr(sc, v->vnum, CCR_CACHEINVALIDSIZE, 0); - emu_wrptr(sc, v->vnum, CCR_READADDRESS, cra); - emu_wrptr(sc, v->vnum, CCR_CACHEINVALIDSIZE, ccis); - - emu_wrptr(sc, v->vnum, IFATN, 0xff00); - emu_wrptr(sc, v->vnum, VTFT, 0xffffffff); - emu_wrptr(sc, v->vnum, CVCF, 0xffffffff); - emu_wrptr(sc, v->vnum, DCYSUSV, 0x00007f7f); + emu_wrptr(sc, v->vnum, EMU_CHAN_CD0 + i, sample); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_CACHEINVALIDSIZE, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_READADDRESS, cra); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_CACHEINVALIDSIZE, ccis); + + emu_wrptr(sc, v->vnum, EMU_CHAN_IFATN, 0xff00); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, 0xffffffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, 0xffffffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_DCYSUSV, 0x00007f7f); emu_vstop(sc, v->vnum, 0); pitch_target = emu_rate_to_linearpitch(v->speed); initial_pitch = emu_rate_to_pitch(v->speed) >> 8; - emu_wrptr(sc, v->vnum, PTRX_PITCHTARGET, pitch_target); - emu_wrptr(sc, v->vnum, CPF_CURRENTPITCH, pitch_target); - emu_wrptr(sc, v->vnum, IP, initial_pitch); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX_PITCHTARGET, pitch_target); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF_PITCH, pitch_target); + emu_wrptr(sc, v->vnum, EMU_CHAN_IP, initial_pitch); } else { - emu_wrptr(sc, v->vnum, PTRX_PITCHTARGET, 0); - emu_wrptr(sc, v->vnum, CPF_CURRENTPITCH, 0); - emu_wrptr(sc, v->vnum, IFATN, 0xffff); - emu_wrptr(sc, v->vnum, VTFT, 0x0000ffff); - emu_wrptr(sc, v->vnum, CVCF, 0x0000ffff); - emu_wrptr(sc, v->vnum, IP, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX_PITCHTARGET, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF_PITCH, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_IFATN, 0xffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, 0x0000ffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, 0x0000ffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_IP, 0); emu_vstop(sc, v->vnum, 1); } if ((v->stereo) && (v->slave != NULL)) @@ -1494,7 +1505,7 @@ emu_vpos(struct emu_sc_info *sc, struct int s, ptr; s = (v->b16 ? 1 : 0) + (v->stereo ? 1 : 0); - ptr = (emu_rdptr(sc, v->vnum, CCCA_CURRADDR) - (v->start >> s)) << s; + ptr = (emu_rdptr(sc, v->vnum, EMU_CHAN_CCCA_CURRADDR) - (v->start >> s)) << s; return (ptr & ~0x0000001f); } @@ -1694,9 +1705,9 @@ emu_initefx(struct emu_sc_info *sc) /* stop DSP */ if (sc->is_emu10k1) { - emu_wrptr(sc, 0, DBG, EMU10K1_DBG_SINGLE_STEP); + emu_wrptr(sc, 0, EMU_DBG, EMU_DBG_SINGLE_STEP); } else { - emu_wrptr(sc, 0, A_DBG, A_DBG_SINGLE_STEP); + emu_wrptr(sc, 0, EMU_A_DBG, EMU_A_DBG_SINGLE_STEP); } /* code size is in instructions */ @@ -2162,9 +2173,9 @@ emu_initefx(struct emu_sc_info *sc) /* start DSP */ if (sc->is_emu10k1) { - emu_wrptr(sc, 0, DBG, 0); + emu_wrptr(sc, 0, EMU_DBG, 0); } else { - emu_wrptr(sc, 0, A_DBG, 0); + emu_wrptr(sc, 0, EMU_A_DBG, 0); } } @@ -2450,24 +2461,24 @@ emumix_set_mode(struct emu_sc_info *sc, return; } - hcfg = HCFG_AUDIOENABLE | HCFG_AUTOMUTE; + hcfg = EMU_HCFG_AUDIOENABLE | EMU_HCFG_AUTOMUTE; a_iocfg = 0; if (sc->rev >= 6) - hcfg |= HCFG_JOYENABLE; + hcfg |= EMU_HCFG_JOYENABLE; if (sc->is_emu10k1) - hcfg |= HCFG_LOCKTANKCACHE_MASK; + hcfg |= EMU_HCFG_LOCKTANKCACHE_MASK; else - hcfg |= HCFG_CODECFORMAT_I2S | HCFG_JOYENABLE; + hcfg |= EMU_HCFG_CODECFMT_I2S | EMU_HCFG_JOYENABLE; if (mode == MODE_DIGITAL) { if (sc->broken_digital) { device_printf(sc->dev, "Digital mode is reported as broken on this card.\n"); } - a_iocfg |= A_IOCFG_ENABLE_DIGITAL; - hcfg |= HCFG_GPOUT0; + a_iocfg |= EMU_A_IOCFG_GPOUT1; + hcfg |= EMU_HCFG_GPOUT0; } if (mode == MODE_ANALOG) @@ -2478,12 +2489,12 @@ emumix_set_mode(struct emu_sc_info *sc, if ((sc->is_ca0102) || (sc->is_ca0108)) /* - * Setting A_IOCFG_DISABLE_ANALOG will do opposite things + * Setting EMU_A_IOCFG_DISABLE_ANALOG will do opposite things * on diffrerent cards. * "don't disable analog outs" on Audigy 2 (ca0102/ca0108) * "disable analog outs" on Audigy (emu10k2) */ - a_iocfg |= A_IOCFG_DISABLE_ANALOG; + a_iocfg |= EMU_A_IOCFG_DISABLE_ANALOG; if (sc->is_ca0108) a_iocfg |= 0x20; /* XXX */ @@ -2492,12 +2503,12 @@ emumix_set_mode(struct emu_sc_info *sc, if (mode == MODE_DIGITAL) emumix_set_gpr(sc, sc->mute_gpr[ANALOGMUTE], 1); - emu_wr(sc, HCFG, hcfg, 4); + emu_wr(sc, EMU_HCFG, hcfg, 4); if ((sc->is_emu10k2) || (sc->is_ca0102) || (sc->is_ca0108)) { - tmp = emu_rd(sc, A_IOCFG, 2); + tmp = emu_rd(sc, EMU_A_IOCFG, 2); tmp = a_iocfg; - emu_wr(sc, A_IOCFG, tmp, 2); + emu_wr(sc, EMU_A_IOCFG, tmp, 2); } /* Unmute if we have changed mode to analog. */ @@ -2523,16 +2534,16 @@ emumix_set_spdif_mode(struct emu_sc_info return; } - spcs = SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 | - SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | - SPCS_GENERATIONSTATUS | 0x00001200 | 0x00000000 | - SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT; + spcs = EMU_SPCS_CLKACCY_1000PPM | EMU_SPCS_SAMPLERATE_48 | + EMU_SPCS_CHANNELNUM_LEFT | EMU_SPCS_SOURCENUM_UNSPEC | + EMU_SPCS_GENERATIONSTATUS | 0x00001200 | 0x00000000 | + EMU_SPCS_EMPHASIS_NONE | EMU_SPCS_COPYRIGHT; mode = SPDIF_MODE_PCM; - emu_wrptr(sc, 0, SPCS0, spcs); - emu_wrptr(sc, 0, SPCS1, spcs); - emu_wrptr(sc, 0, SPCS2, spcs); + emu_wrptr(sc, 0, EMU_SPCS0, spcs); + emu_wrptr(sc, 0, EMU_SPCS1, spcs); + emu_wrptr(sc, 0, EMU_SPCS2, spcs); } #define L2L_POINTS 10 @@ -2635,8 +2646,8 @@ emu_cardbus_init(struct emu_sc_info *sc) { /* - * XXX May not need this if we have IPR3 handler. - * Is it a real init calls, or IPR3 interrupt acknowledgments? + * XXX May not need this if we have EMU_IPR3 handler. + * Is it a real init calls, or EMU_IPR3 interrupt acknowledgments? * Looks much like "(data << 16) | register". */ emu_wr_cbptr(sc, (0x00d0 << 16) | 0x0000); @@ -2660,42 +2671,42 @@ emu_init(struct emu_sc_info *sc) int i; /* disable audio and lock cache */ - emu_wr(sc, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, 4); + emu_wr(sc, EMU_HCFG, EMU_HCFG_LOCKSOUNDCACHE | EMU_HCFG_LOCKTANKCACHE_MASK | EMU_HCFG_MUTEBUTTONENABLE, 4); /* reset recording buffers */ - emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, MICBA, 0); - emu_wrptr(sc, 0, FXBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, FXBA, 0); - emu_wrptr(sc, 0, ADCBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, ADCBA, 0); + emu_wrptr(sc, 0, EMU_MICBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_MICBA, 0); + emu_wrptr(sc, 0, EMU_FXBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_FXBA, 0); + emu_wrptr(sc, 0, EMU_ADCBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_ADCBA, 0); /* disable channel interrupt */ - emu_wr(sc, INTE, INTE_INTERVALTIMERENB | INTE_SAMPLERATETRACKER | INTE_PCIERRORENABLE, 4); - emu_wrptr(sc, 0, CLIEL, 0); - emu_wrptr(sc, 0, CLIEH, 0); - emu_wrptr(sc, 0, SOLEL, 0); - emu_wrptr(sc, 0, SOLEH, 0); + emu_wr(sc, EMU_INTE, EMU_INTE_INTERTIMERENB | EMU_INTE_SAMPLERATER | EMU_INTE_PCIERRENABLE, 4); + emu_wrptr(sc, 0, EMU_CLIEL, 0); + emu_wrptr(sc, 0, EMU_CLIEH, 0); + emu_wrptr(sc, 0, EMU_SOLEL, 0); + emu_wrptr(sc, 0, EMU_SOLEH, 0); /* disable P16V and S/PDIF interrupts */ if ((sc->is_ca0102) || (sc->is_ca0108)) - emu_wr(sc, INTE2, 0, 4); + emu_wr(sc, EMU_INTE2, 0, 4); if (sc->is_ca0102) - emu_wr(sc, INTE3, 0, 4); + emu_wr(sc, EMU_INTE3, 0, 4); /* init phys inputs and outputs */ ac97slot = 0; if (sc->has_51) - ac97slot = AC97SLOT_CNTR | AC97SLOT_LFE; + ac97slot = EMU_AC97SLOT_CENTER | EMU_AC97SLOT_LFE; if (sc->has_71) - ac97slot = AC97SLOT_CNTR | AC97SLOT_LFE | AC97SLOT_REAR_LEFT | AC97SLOT_REAR_RIGHT; + ac97slot = EMU_AC97SLOT_CENTER | EMU_AC97SLOT_LFE | EMU_AC97SLOT_REAR_LEFT | EMU_AC97SLOT_REAR_RIGHT; if (sc->is_emu10k2) ac97slot |= 0x40; - emu_wrptr(sc, 0, AC97SLOT, ac97slot); + emu_wrptr(sc, 0, EMU_AC97SLOT, ac97slot); if (sc->is_emu10k2) /* XXX for later cards? */ - emu_wrptr(sc, 0, SPBYPASS, 0xf00); /* What will happen if + emu_wrptr(sc, 0, EMU_SPBYPASS, 0xf00); /* What will happen if * we write 1 here? */ if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(sc->dev), @@ -2729,61 +2740,61 @@ emu_init(struct emu_sc_info *sc) sc->mem.ptb_pages[i] = tmp | i; for (ch = 0; ch < NUM_G; ch++) { - emu_wrptr(sc, ch, MAPA, tmp | MAP_PTI_MASK); - emu_wrptr(sc, ch, MAPB, tmp | MAP_PTI_MASK); + emu_wrptr(sc, ch, EMU_CHAN_MAPA, tmp | EMU_CHAN_MAP_PTI_MASK); + emu_wrptr(sc, ch, EMU_CHAN_MAPB, tmp | EMU_CHAN_MAP_PTI_MASK); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 23:00:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AC231065675; Fri, 3 Feb 2012 23:00:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1B6E8FC16; Fri, 3 Feb 2012 23:00:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13N0SJT008261; Fri, 3 Feb 2012 23:00:28 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13N0S9P008255; Fri, 3 Feb 2012 23:00:28 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202032300.q13N0S9P008255@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 3 Feb 2012 23:00:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230965 - in stable/8/sys: conf dev/sound/pci gnu/dev/sound/pci modules/sound/driver/emu10kx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 23:00:29 -0000 Author: pfg Date: Fri Feb 3 23:00:28 2012 New Revision: 230965 URL: http://svn.freebsd.org/changeset/base/230965 Log: MFC: r229981, r230898 Replace a GPL'd header in the emu10kx snd driver code. This uses the emuxkireg.h already used in the emu10k1 snd driver. Special thanks go to Alexander Motin as he was able to find some errors and reverse engineer some wrong values in the emuxkireg header. While here also merge some cleanups to the module Makefile. PR: 153901 Obtained from: NetBSD Approved by: core (mentor implicit) Deleted: stable/8/sys/gnu/dev/sound/pci/emu10k1-alsa.h stable/8/sys/gnu/dev/sound/pci/p16v-alsa.h stable/8/sys/gnu/dev/sound/pci/p17v-alsa.h Modified: stable/8/sys/conf/files stable/8/sys/dev/sound/pci/emu10kx-midi.c stable/8/sys/dev/sound/pci/emu10kx-pcm.c stable/8/sys/dev/sound/pci/emu10kx.c stable/8/sys/dev/sound/pci/emu10kx.h stable/8/sys/dev/sound/pci/emuxkireg.h stable/8/sys/modules/sound/driver/emu10kx/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/modules/sound/driver/emu10kx/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Fri Feb 3 22:39:04 2012 (r230964) +++ stable/8/sys/conf/files Fri Feb 3 23:00:28 2012 (r230965) @@ -50,21 +50,6 @@ aic79xx_reg_print.c optional ahd pci aic79xx_reg_print.o optional ahd pci ahd_reg_pretty_print \ compile-with "${NORMAL_C}" \ no-implicit-rule local -emu10k1-alsa%diked.h optional snd_emu10kx \ - dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h" \ - 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" -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" \ - no-obj no-implicit-rule before-depend \ - clean "p16v-alsa%diked.h" -p17v-alsa%diked.h optional snd_emu10kx pci \ - dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h" \ - compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h p17v-alsa%diked.h" \ - no-obj no-implicit-rule before-depend \ - clean "p17v-alsa%diked.h" feeder_eq_gen.h optional sound \ dependency "$S/tools/sound/feeder_eq_mkfilter.awk" \ compile-with "${AWK} -f $S/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > feeder_eq_gen.h" \ @@ -1602,19 +1587,9 @@ dev/sound/pci/csa.c optional snd_csa pc dev/sound/pci/csapcm.c optional snd_csa pci dev/sound/pci/ds1.c optional snd_ds1 pci dev/sound/pci/emu10k1.c optional snd_emu10k1 pci -dev/sound/pci/emu10kx.c optional snd_emu10kx pci \ - dependency "emu10k1-alsa%diked.h" \ - dependency "p16v-alsa%diked.h" \ - dependency "p17v-alsa%diked.h" \ - warning "kernel contains GPL contaminated emu10kx headers" -dev/sound/pci/emu10kx-pcm.c optional snd_emu10kx pci \ - dependency "emu10k1-alsa%diked.h" \ - dependency "p16v-alsa%diked.h" \ - dependency "p17v-alsa%diked.h" \ - warning "kernel contains GPL contaminated emu10kx headers" -dev/sound/pci/emu10kx-midi.c optional snd_emu10kx pci \ - dependency "emu10k1-alsa%diked.h" \ - warning "kernel contains GPL contaminated emu10kx headers" +dev/sound/pci/emu10kx.c optional snd_emu10kx pci +dev/sound/pci/emu10kx-pcm.c optional snd_emu10kx pci +dev/sound/pci/emu10kx-midi.c optional snd_emu10kx pci dev/sound/pci/envy24.c optional snd_envy24 pci dev/sound/pci/envy24ht.c optional snd_envy24ht pci dev/sound/pci/es137x.c optional snd_es137x pci Modified: stable/8/sys/dev/sound/pci/emu10kx-midi.c ============================================================================== --- stable/8/sys/dev/sound/pci/emu10kx-midi.c Fri Feb 3 22:39:04 2012 (r230964) +++ stable/8/sys/dev/sound/pci/emu10kx-midi.c Fri Feb 3 23:00:28 2012 (r230965) @@ -50,8 +50,8 @@ #include #include "mpufoi_if.h" +#include #include -#include "emu10k1-alsa%diked.h" struct emu_midi_softc { struct mtx mtx; @@ -176,25 +176,25 @@ emu_midi_attach(device_t dev) if (scp->is_emu10k1) { /* SB Live! - only one MIDI device here */ inte_val = 0; - /* inte_val |= INTE_MIDITXENABLE;*/ - inte_val |= INTE_MIDIRXENABLE; - ipr_val = IPR_MIDITRANSBUFEMPTY; - ipr_val |= IPR_MIDIRECVBUFEMPTY; + /* inte_val |= EMU_INTE_MIDITXENABLE;*/ + inte_val |= EMU_INTE_MIDIRXENABLE; + ipr_val = EMU_IPR_MIDITRANSBUFE; + ipr_val |= EMU_IPR_MIDIRECVBUFE; } else { - if (scp->port == A_MUDATA1) { + if (scp->port == EMU_A_MUDATA1) { /* EXTERNAL MIDI (AudigyDrive) */ inte_val = 0; - /* inte_val |= A_INTE_MIDITXENABLE1;*/ - inte_val |= INTE_MIDIRXENABLE; - ipr_val = IPR_MIDITRANSBUFEMPTY; - ipr_val |= IPR_MIDIRECVBUFEMPTY; + /* inte_val |= A_EMU_INTE_MIDITXENABLE1;*/ + inte_val |= EMU_INTE_MIDIRXENABLE; + ipr_val = EMU_IPR_MIDITRANSBUFE; + ipr_val |= EMU_IPR_MIDIRECVBUFE; } else { /* MIDI hw config port 2 */ inte_val = 0; - /* inte_val |= A_INTE_MIDITXENABLE2;*/ - inte_val |= INTE_A_MIDIRXENABLE2; - ipr_val = IPR_A_MIDITRANSBUFEMPTY2; - ipr_val |= IPR_A_MIDIRECVBUFEMPTY2; + /* inte_val |= A_EMU_INTE_MIDITXENABLE2;*/ + inte_val |= EMU_INTE_A_MIDIRXENABLE2; + ipr_val = EMU_IPR_A_MIDITRANSBUFE2; + ipr_val |= EMU_IPR_A_MIDIRECBUFE2; } } @@ -214,7 +214,7 @@ emu_midi_attach(device_t dev) if (scp->is_emu10k1) emu_enable_ir(scp->card); else { - if (scp->port == A_MUDATA1) + if (scp->port == EMU_A_MUDATA1) emu_enable_ir(scp->card); } Modified: stable/8/sys/dev/sound/pci/emu10kx-pcm.c ============================================================================== --- stable/8/sys/dev/sound/pci/emu10kx-pcm.c Fri Feb 3 22:39:04 2012 (r230964) +++ stable/8/sys/dev/sound/pci/emu10kx-pcm.c Fri Feb 3 23:00:28 2012 (r230965) @@ -49,8 +49,8 @@ #include "mixer_if.h" +#include #include -#include "emu10k1-alsa%diked.h" struct emu_pcm_pchinfo { int spd; @@ -555,8 +555,8 @@ emu_ac97_read_emulation(struct emu_pcm_i break; } - emu_wr(sc->card, AC97ADDRESS, regno, 1); - tmp = emu_rd(sc->card, AC97DATA, 2); + emu_wr(sc->card, EMU_AC97ADDR, regno, 1); + tmp = emu_rd(sc->card, EMU_AC97DATA, 2); if (use_ac97) emulated = tmp; @@ -621,8 +621,8 @@ emu_ac97_write_emulation(struct emu_pcm_ break; } if (write_ac97) { - emu_wr(sc->card, AC97ADDRESS, regno, 1); - emu_wr(sc->card, AC97DATA, data, 2); + emu_wr(sc->card, EMU_AC97ADDR, regno, 1); + emu_wr(sc->card, EMU_AC97DATA, data, 2); } } @@ -658,8 +658,8 @@ emu_rdcd(kobj_t obj __unused, void *devi struct emu_pcm_info *sc = (struct emu_pcm_info *)devinfo; KASSERT(sc->card != NULL, ("emu_rdcd: no soundcard")); - emu_wr(sc->card, AC97ADDRESS, regno, 1); - rd = emu_rd(sc->card, AC97DATA, 2); + emu_wr(sc->card, EMU_AC97ADDR, regno, 1); + rd = emu_rd(sc->card, EMU_AC97DATA, 2); return (rd); } @@ -669,8 +669,8 @@ emu_wrcd(kobj_t obj __unused, void *devi struct emu_pcm_info *sc = (struct emu_pcm_info *)devinfo; KASSERT(sc->card != NULL, ("emu_wrcd: no soundcard")); - emu_wr(sc->card, AC97ADDRESS, regno, 1); - emu_wr(sc->card, AC97DATA, data, 2); + emu_wr(sc->card, EMU_AC97ADDR, regno, 1); + emu_wr(sc->card, EMU_AC97DATA, data, 2); return (0); } @@ -870,12 +870,12 @@ emurchan_init(kobj_t obj __unused, void ch->blksz = sc->bufsz / 2; /* We rise interrupt for half-full buffer */ ch->fmt = SND_FORMAT(AFMT_U8, 1, 0); ch->spd = 8000; - ch->idxreg = sc->is_emu10k1 ? ADCIDX : A_ADCIDX; - ch->basereg = ADCBA; - ch->sizereg = ADCBS; - ch->setupreg = ADCCR; - ch->irqmask = INTE_ADCBUFENABLE; - ch->iprmask = IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL; + ch->idxreg = sc->is_emu10k1 ? EMU_ADCIDX : EMU_A_ADCIDX; + ch->basereg = EMU_ADCBA; + ch->sizereg = EMU_ADCBS; + ch->setupreg = EMU_ADCCR; + ch->irqmask = EMU_INTE_ADCBUFENABLE; + ch->iprmask = EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL; if (sndbuf_alloc(ch->buffer, emu_gettag(sc->card), 0, sc->bufsz) != 0) return (NULL); @@ -953,22 +953,22 @@ emurchan_trigger(kobj_t obj __unused, vo switch (sc->bufsz) { case 4096: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; break; case 8192: - sz = ADCBS_BUFSIZE_8192; + sz = EMU_RECBS_BUFSIZE_8192; break; case 16384: - sz = ADCBS_BUFSIZE_16384; + sz = EMU_RECBS_BUFSIZE_16384; break; case 32768: - sz = ADCBS_BUFSIZE_32768; + sz = EMU_RECBS_BUFSIZE_32768; break; case 65536: - sz = ADCBS_BUFSIZE_65536; + sz = EMU_RECBS_BUFSIZE_65536; break; default: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; } snd_mtxlock(sc->lock); @@ -976,9 +976,9 @@ emurchan_trigger(kobj_t obj __unused, vo case PCMTRIG_START: ch->run = 1; emu_wrptr(sc->card, 0, ch->sizereg, sz); - val = sc->is_emu10k1 ? ADCCR_LCHANENABLE : A_ADCCR_LCHANENABLE; + val = sc->is_emu10k1 ? EMU_ADCCR_LCHANENABLE : EMU_A_ADCCR_LCHANENABLE; if (AFMT_CHANNEL(ch->fmt) > 1) - val |= sc->is_emu10k1 ? ADCCR_RCHANENABLE : A_ADCCR_RCHANENABLE; + val |= sc->is_emu10k1 ? EMU_ADCCR_RCHANENABLE : EMU_A_ADCCR_RCHANENABLE; val |= sc->is_emu10k1 ? emu_k1_recval(ch->spd) : emu_k2_recval(ch->spd); emu_wrptr(sc->card, 0, ch->setupreg, 0); emu_wrptr(sc->card, 0, ch->setupreg, val); @@ -1049,11 +1049,11 @@ emufxrchan_init(kobj_t obj __unused, voi ch = &(sc->rch_efx); ch->fmt = SND_FORMAT(AFMT_S16_LE, 1, 0); ch->spd = sc->is_emu10k1 ? 48000*32 : 48000 * 64; - ch->idxreg = FXIDX; - ch->basereg = FXBA; - ch->sizereg = FXBS; - ch->irqmask = INTE_EFXBUFENABLE; - ch->iprmask = IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL; + ch->idxreg = EMU_FXIDX; + ch->basereg = EMU_FXBA; + ch->sizereg = EMU_FXBS; + ch->irqmask = EMU_INTE_EFXBUFENABLE; + ch->iprmask = EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL; ch->buffer = b; ch->pcm = sc; ch->channel = c; @@ -1113,22 +1113,22 @@ emufxrchan_trigger(kobj_t obj __unused, switch (sc->bufsz) { case 4096: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; break; case 8192: - sz = ADCBS_BUFSIZE_8192; + sz = EMU_RECBS_BUFSIZE_8192; break; case 16384: - sz = ADCBS_BUFSIZE_16384; + sz = EMU_RECBS_BUFSIZE_16384; break; case 32768: - sz = ADCBS_BUFSIZE_32768; + sz = EMU_RECBS_BUFSIZE_32768; break; case 65536: - sz = ADCBS_BUFSIZE_65536; + sz = EMU_RECBS_BUFSIZE_65536; break; default: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; } snd_mtxlock(sc->lock); @@ -1140,14 +1140,14 @@ emufxrchan_trigger(kobj_t obj __unused, /* * SB Live! is limited to 32 mono channels. Audigy * has 64 mono channels. Channels are enabled - * by setting a bit in A_FXWC[1|2] registers. + * by setting a bit in EMU_A_FXWC[1|2] registers. */ /* XXX there is no way to demultiplex this streams for now */ if (sc->is_emu10k1) { - emu_wrptr(sc->card, 0, FXWC, 0xffffffff); + emu_wrptr(sc->card, 0, EMU_FXWC, 0xffffffff); } else { - emu_wrptr(sc->card, 0, A_FXWC1, 0xffffffff); - emu_wrptr(sc->card, 0, A_FXWC2, 0xffffffff); + emu_wrptr(sc->card, 0, EMU_A_FXWC1, 0xffffffff); + emu_wrptr(sc->card, 0, EMU_A_FXWC2, 0xffffffff); } break; case PCMTRIG_STOP: @@ -1155,10 +1155,10 @@ emufxrchan_trigger(kobj_t obj __unused, case PCMTRIG_ABORT: ch->run = 0; if (sc->is_emu10k1) { - emu_wrptr(sc->card, 0, FXWC, 0x0); + emu_wrptr(sc->card, 0, EMU_FXWC, 0x0); } else { - emu_wrptr(sc->card, 0, A_FXWC1, 0x0); - emu_wrptr(sc->card, 0, A_FXWC2, 0x0); + emu_wrptr(sc->card, 0, EMU_A_FXWC1, 0x0); + emu_wrptr(sc->card, 0, EMU_A_FXWC2, 0x0); } emu_wrptr(sc->card, 0, ch->sizereg, 0); (void)emu_intr_unregister(sc->card, ch->ihandle); @@ -1238,8 +1238,8 @@ emu_pcm_intr(void *pcm, uint32_t stat) snd_mtxlock(sc->lock); - if (stat & IPR_INTERVALTIMER) { - ack |= IPR_INTERVALTIMER; + if (stat & EMU_IPR_INTERVALTIMER) { + ack |= EMU_IPR_INTERVALTIMER; for (i = 0; i < MAX_CHANNELS; i++) if (sc->pch[i].channel) { if (sc->pch[i].run == 1) { @@ -1262,8 +1262,8 @@ emu_pcm_intr(void *pcm, uint32_t stat) } - if (stat & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL)) { - ack |= stat & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL); + if (stat & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL)) { + ack |= stat & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL); if (sc->rch_adc.channel) { snd_mtxunlock(sc->lock); chn_intr(sc->rch_adc.channel); @@ -1271,8 +1271,8 @@ emu_pcm_intr(void *pcm, uint32_t stat) } } - if (stat & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL)) { - ack |= stat & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL); + if (stat & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL)) { + ack |= stat & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL); if (sc->rch_efx.channel) { snd_mtxunlock(sc->lock); chn_intr(sc->rch_efx.channel); @@ -1450,8 +1450,8 @@ emu_pcm_attach(device_t dev) goto bad; } - inte = INTE_INTERVALTIMERENB; - ipr = IPR_INTERVALTIMER; /* Used by playback & ADC */ + inte = EMU_INTE_INTERTIMERENB; + ipr = EMU_IPR_INTERVALTIMER; /* Used by playback & ADC */ sc->ihandle = emu_intr_register(sc->card, inte, ipr, &emu_pcm_intr, sc); if (emu_pcm_init(sc) == -1) { Modified: stable/8/sys/dev/sound/pci/emu10kx.c ============================================================================== --- stable/8/sys/dev/sound/pci/emu10kx.c Fri Feb 3 22:39:04 2012 (r230964) +++ stable/8/sys/dev/sound/pci/emu10kx.c Fri Feb 3 23:00:28 2012 (r230965) @@ -53,6 +53,7 @@ #include #include +#include #include /* hw flags */ @@ -181,7 +182,7 @@ #define A_IN_AUX2_R 0x0d #define A_IN_AUX2 A_IN_AUX2_L -/* Audigiy Outputs */ +/* Audigy Outputs */ #define A_OUT_D_FRONT_L 0x00 #define A_OUT_D_FRONT_R 0x01 #define A_OUT_D_FRONT A_OUT_D_FRONT_L @@ -217,9 +218,19 @@ #define A_OUT_ADC_REC_R 0x17 #define A_OUT_ADC_REC A_OUT_ADC_REC_L -#include "emu10k1-alsa%diked.h" -#include "p16v-alsa%diked.h" -#include "p17v-alsa%diked.h" +#define EMU_DATA2 0x24 +#define EMU_IPR2 0x28 +#define EMU_INTE2 0x2c +#define EMU_IPR3 0x38 +#define EMU_INTE3 0x3c + +#define EMU_A2_SRCSel 0x60 +#define EMU_A2_SRCMULTI_ENABLE 0x6e + +#define EMU_A_I2S_CAPTURE_96000 0x00000400 + +#define EMU_A2_MIXER_I2S_ENABLE 0x7B +#define EMU_A2_MIXER_SPDIF_ENABLE 0x7A #define C_FRONT_L 0 #define C_FRONT_R 1 @@ -630,7 +641,7 @@ emu_wr_nolock(struct emu_sc_info *sc, un } } /* - * PTR / DATA interface. Access to EMU10Kx is made + * EMU_PTR / EMU_DATA interface. Access to EMU10Kx is made * via (channel, register) pair. Some registers are channel-specific, * some not. */ @@ -639,11 +650,11 @@ emu_rdptr(struct emu_sc_info *sc, unsign { uint32_t ptr, val, mask, size, offset; - ptr = ((reg << 16) & sc->address_mask) | (chn & PTR_CHANNELNUM_MASK); + ptr = ((reg << 16) & sc->address_mask) | (chn & EMU_PTR_CHNO_MASK); EMU_RWLOCK(); - emu_wr_nolock(sc, PTR, ptr, 4); - val = emu_rd_nolock(sc, DATA, 4); + emu_wr_nolock(sc, EMU_PTR, ptr, 4); + val = emu_rd_nolock(sc, EMU_DATA, 4); EMU_RWUNLOCK(); /* @@ -666,10 +677,10 @@ emu_wrptr(struct emu_sc_info *sc, unsign { uint32_t ptr, mask, size, offset; - ptr = ((reg << 16) & sc->address_mask) | (chn & PTR_CHANNELNUM_MASK); + ptr = ((reg << 16) & sc->address_mask) | (chn & EMU_PTR_CHNO_MASK); EMU_RWLOCK(); - emu_wr_nolock(sc, PTR, ptr, 4); + emu_wr_nolock(sc, EMU_PTR, ptr, 4); /* * XXX Another kind of magic encoding in register number. This can * give you side effect - it will read previous data from register @@ -681,13 +692,13 @@ emu_wrptr(struct emu_sc_info *sc, unsign mask = ((1 << size) - 1) << offset; data <<= offset; data &= mask; - data |= emu_rd_nolock(sc, DATA, 4) & ~mask; + data |= emu_rd_nolock(sc, EMU_DATA, 4) & ~mask; } - emu_wr_nolock(sc, DATA, data, 4); + emu_wr_nolock(sc, EMU_DATA, data, 4); EMU_RWUNLOCK(); } /* - * PTR2 / DATA2 interface. Access to P16v is made + * EMU_A2_PTR / EMU_DATA2 interface. Access to P16v is made * via (channel, register) pair. Some registers are channel-specific, * some not. This interface is supported by CA0102 and CA0108 chips only. */ @@ -698,8 +709,8 @@ emu_rd_p16vptr(struct emu_sc_info *sc, u /* XXX separate lock? */ EMU_RWLOCK(); - emu_wr_nolock(sc, PTR2, (reg << 16) | chn, 4); - val = emu_rd_nolock(sc, DATA2, 4); + emu_wr_nolock(sc, EMU_A2_PTR, (reg << 16) | chn, 4); + val = emu_rd_nolock(sc, EMU_DATA2, 4); EMU_RWUNLOCK(); @@ -711,8 +722,8 @@ emu_wr_p16vptr(struct emu_sc_info *sc, u { EMU_RWLOCK(); - emu_wr_nolock(sc, PTR2, (reg << 16) | chn, 4); - emu_wr_nolock(sc, DATA2, data, 4); + emu_wr_nolock(sc, EMU_A2_PTR, (reg << 16) | chn, 4); + emu_wr_nolock(sc, EMU_DATA2, data, 4); EMU_RWUNLOCK(); } /* @@ -737,13 +748,13 @@ emu_wr_cbptr(struct emu_sc_info *sc, uin /* * Direct hardware register access - * Assume that it is never used to access PTR-based registers and can run unlocked. + * Assume that it is never used to access EMU_PTR-based registers and can run unlocked. */ void emu_wr(struct emu_sc_info *sc, unsigned int regno, uint32_t data, unsigned int size) { - KASSERT(regno != PTR, ("emu_wr: attempt to write to PTR")); - KASSERT(regno != PTR2, ("emu_wr: attempt to write to PTR2")); + KASSERT(regno != EMU_PTR, ("emu_wr: attempt to write to EMU_PTR")); + KASSERT(regno != EMU_A2_PTR, ("emu_wr: attempt to write to EMU_A2_PTR")); emu_wr_nolock(sc, regno, data, size); } @@ -753,8 +764,8 @@ emu_rd(struct emu_sc_info *sc, unsigned { uint32_t rd; - KASSERT(regno != DATA, ("emu_rd: attempt to read DATA")); - KASSERT(regno != DATA2, ("emu_rd: attempt to read DATA2")); + KASSERT(regno != EMU_DATA, ("emu_rd: attempt to read DATA")); + KASSERT(regno != EMU_DATA2, ("emu_rd: attempt to read DATA2")); rd = emu_rd_nolock(sc, regno, size); return (rd); @@ -770,24 +781,24 @@ emu_enable_ir(struct emu_sc_info *sc) uint32_t iocfg; if (sc->is_emu10k2 || sc->is_ca0102) { - iocfg = emu_rd_nolock(sc, A_IOCFG, 2); - emu_wr_nolock(sc, A_IOCFG, iocfg | A_IOCFG_GPOUT2, 2); + iocfg = emu_rd_nolock(sc, EMU_A_IOCFG, 2); + emu_wr_nolock(sc, EMU_A_IOCFG, iocfg | EMU_A_IOCFG_GPOUT2, 2); DELAY(500); - emu_wr_nolock(sc, A_IOCFG, iocfg | A_IOCFG_GPOUT1 | A_IOCFG_GPOUT2, 2); + emu_wr_nolock(sc, EMU_A_IOCFG, iocfg | EMU_A_IOCFG_GPOUT1 | EMU_A_IOCFG_GPOUT2, 2); DELAY(500); - emu_wr_nolock(sc, A_IOCFG, iocfg | A_IOCFG_GPOUT1, 2); + emu_wr_nolock(sc, EMU_A_IOCFG, iocfg | EMU_A_IOCFG_GPOUT1, 2); DELAY(100); - emu_wr_nolock(sc, A_IOCFG, iocfg, 2); + emu_wr_nolock(sc, EMU_A_IOCFG, iocfg, 2); device_printf(sc->dev, "Audigy IR MIDI events enabled.\n"); sc->enable_ir = 1; } if (sc->is_emu10k1) { - iocfg = emu_rd_nolock(sc, HCFG, 4); - emu_wr_nolock(sc, HCFG, iocfg | HCFG_GPOUT2, 4); + iocfg = emu_rd_nolock(sc, EMU_HCFG, 4); + emu_wr_nolock(sc, EMU_HCFG, iocfg | EMU_HCFG_GPOUT2, 4); DELAY(500); - emu_wr_nolock(sc, HCFG, iocfg | HCFG_GPOUT1 | HCFG_GPOUT2, 4); + emu_wr_nolock(sc, EMU_HCFG, iocfg | EMU_HCFG_GPOUT1 | EMU_HCFG_GPOUT2, 4); DELAY(100); - emu_wr_nolock(sc, HCFG, iocfg, 4); + emu_wr_nolock(sc, EMU_HCFG, iocfg, 4); device_printf(sc->dev, "SB Live! IR MIDI events enabled.\n"); sc->enable_ir = 1; } @@ -835,7 +846,7 @@ emu_timer_set(struct emu_sc_info *sc, in sc->timerinterval = sc->timer[i]; /* XXX */ - emu_wr(sc, TIMER, sc->timerinterval & 0x03ff, 2); + emu_wr(sc, EMU_TIMER, sc->timerinterval & 0x03ff, 2); mtx_unlock(&sc->lock); return (timer); @@ -868,16 +879,16 @@ emu_timer_enable(struct emu_sc_info *sc, ena_int = 1; } - emu_wr(sc, TIMER, sc->timerinterval & 0x03ff, 2); + emu_wr(sc, EMU_TIMER, sc->timerinterval & 0x03ff, 2); if (ena_int == 1) { - x = emu_rd(sc, INTE, 4); - x |= INTE_INTERVALTIMERENB; - emu_wr(sc, INTE, x, 4); + x = emu_rd(sc, EMU_INTE, 4); + x |= EMU_INTE_INTERTIMERENB; + emu_wr(sc, EMU_INTE, x, 4); } else { - x = emu_rd(sc, INTE, 4); - x &= ~INTE_INTERVALTIMERENB; - emu_wr(sc, INTE, x, 4); + x = emu_rd(sc, EMU_INTE, 4); + x &= ~EMU_INTE_INTERTIMERENB; + emu_wr(sc, EMU_INTE, x, 4); } mtx_unlock(&sc->lock); return (0); @@ -917,9 +928,9 @@ emu_intr_register(struct emu_sc_info *sc sc->ihandler[i].intr_mask = intr_mask; sc->ihandler[i].softc = isc; sc->ihandler[i].irq_func = func; - x = emu_rd(sc, INTE, 4); + x = emu_rd(sc, EMU_INTE, 4); x |= inte_mask; - emu_wr(sc, INTE, x, 4); + emu_wr(sc, EMU_INTE, x, 4); mtx_unlock(&sc->lock); if (sc->dbg_level > 1) device_printf(sc->dev, "ihandle %d registered\n", i); @@ -946,7 +957,7 @@ emu_intr_unregister(struct emu_sc_info * return (-1); } - x = emu_rd(sc, INTE, 4); + x = emu_rd(sc, EMU_INTE, 4); x &= ~sc->ihandler[hnumber].inte_mask; sc->ihandler[hnumber].inte_mask = 0; @@ -954,12 +965,12 @@ emu_intr_unregister(struct emu_sc_info * sc->ihandler[hnumber].softc = NULL; sc->ihandler[hnumber].irq_func = NULL; - /* other interrupt handlers may use this INTE value */ + /* other interrupt handlers may use this EMU_INTE value */ for (i = 0; i < EMU_MAX_IRQ_CONSUMERS; i++) if (sc->ihandler[i].inte_mask != 0) x |= sc->ihandler[i].inte_mask; - emu_wr(sc, INTE, x, 4); + emu_wr(sc, EMU_INTE, x, 4); mtx_unlock(&sc->lock); return (hnumber); @@ -973,11 +984,11 @@ emu_intr(void *p) int i; for (;;) { - stat = emu_rd(sc, IPR, 4); + stat = emu_rd(sc, EMU_IPR, 4); ack = 0; if (stat == 0) break; - emu_wr(sc, IPR, stat, 4); + emu_wr(sc, EMU_IPR, stat, 4); for (i = 0; i < EMU_MAX_IRQ_CONSUMERS; i++) { if ((((sc->ihandler[i].intr_mask) & stat) != 0) && (((void *)sc->ihandler[i].irq_func) != NULL)) { @@ -993,13 +1004,13 @@ emu_intr(void *p) if ((sc->is_ca0102) || (sc->is_ca0108)) for (;;) { - stat = emu_rd(sc, IPR2, 4); + stat = emu_rd(sc, EMU_IPR2, 4); ack = 0; if (stat == 0) break; - emu_wr(sc, IPR2, stat, 4); + emu_wr(sc, EMU_IPR2, stat, 4); if (sc->dbg_level > 1) - device_printf(sc->dev, "IPR2: %08x\n", stat); + device_printf(sc->dev, "EMU_IPR2: %08x\n", stat); break; /* to avoid infinite loop. shoud be removed * after completion of P16V interface. */ @@ -1007,13 +1018,13 @@ emu_intr(void *p) if (sc->is_ca0102) for (;;) { - stat = emu_rd(sc, IPR3, 4); + stat = emu_rd(sc, EMU_IPR3, 4); ack = 0; if (stat == 0) break; - emu_wr(sc, IPR3, stat, 4); + emu_wr(sc, EMU_IPR3, stat, 4); if (sc->dbg_level > 1) - device_printf(sc->dev, "IPR3: %08x\n", stat); + device_printf(sc->dev, "EMU_IPR3: %08x\n", stat); break; /* to avoid infinite loop. should be removed * after completion of S/PDIF interface */ @@ -1374,61 +1385,61 @@ emu_vwrite(struct emu_sc_info *sc, struc if (v->stereo) { - emu_wrptr(sc, v->vnum, CPF, CPF_STEREO_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF, EMU_CHAN_CPF_STEREO_MASK); } else { - emu_wrptr(sc, v->vnum, CPF, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF, 0); } val = v->stereo ? 28 : 30; val *= v->b16 ? 1 : 2; start = v->sa + val; if (sc->is_emu10k1) { - emu_wrptr(sc, v->vnum, FXRT, ((v->routing[3] << 12) | + emu_wrptr(sc, v->vnum, EMU_CHAN_FXRT, ((v->routing[3] << 12) | (v->routing[2] << 8) | (v->routing[1] << 4) | (v->routing[0] << 0)) << 16); } else { - emu_wrptr(sc, v->vnum, A_FXRT1, (v->routing[3] << 24) | + emu_wrptr(sc, v->vnum, EMU_A_CHAN_FXRT1, (v->routing[3] << 24) | (v->routing[2] << 16) | (v->routing[1] << 8) | (v->routing[0] << 0)); - emu_wrptr(sc, v->vnum, A_FXRT2, (v->routing[7] << 24) | + emu_wrptr(sc, v->vnum, EMU_A_CHAN_FXRT2, (v->routing[7] << 24) | (v->routing[6] << 16) | (v->routing[5] << 8) | (v->routing[4] << 0)); - emu_wrptr(sc, v->vnum, A_SENDAMOUNTS, (v->amounts[7] << 24) | + emu_wrptr(sc, v->vnum, EMU_A_CHAN_SENDAMOUNTS, (v->amounts[7] << 24) | (v->amounts[6] << 26) | (v->amounts[5] << 8) | (v->amounts[4] << 0)); } - emu_wrptr(sc, v->vnum, PTRX, (v->amounts[0] << 8) | (v->amounts[1] << 0)); - emu_wrptr(sc, v->vnum, DSL, v->ea | (v->amounts[3] << 24)); - emu_wrptr(sc, v->vnum, PSST, v->sa | (v->amounts[2] << 24)); - - emu_wrptr(sc, v->vnum, CCCA, start | (v->b16 ? 0 : CCCA_8BITSELECT)); - emu_wrptr(sc, v->vnum, Z1, 0); - emu_wrptr(sc, v->vnum, Z2, 0); - - silent_page = ((uint32_t) (sc->mem.silent_page_addr) << 1) | MAP_PTI_MASK; - emu_wrptr(sc, v->vnum, MAPA, silent_page); - emu_wrptr(sc, v->vnum, MAPB, silent_page); - - emu_wrptr(sc, v->vnum, CVCF, CVCF_CURRENTFILTER_MASK); - emu_wrptr(sc, v->vnum, VTFT, VTFT_FILTERTARGET_MASK); - emu_wrptr(sc, v->vnum, ATKHLDM, 0); - emu_wrptr(sc, v->vnum, DCYSUSM, DCYSUSM_DECAYTIME_MASK); - emu_wrptr(sc, v->vnum, LFOVAL1, 0x8000); - emu_wrptr(sc, v->vnum, LFOVAL2, 0x8000); - emu_wrptr(sc, v->vnum, FMMOD, 0); - emu_wrptr(sc, v->vnum, TREMFRQ, 0); - emu_wrptr(sc, v->vnum, FM2FRQ2, 0); - emu_wrptr(sc, v->vnum, ENVVAL, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX, (v->amounts[0] << 8) | (v->amounts[1] << 0)); + emu_wrptr(sc, v->vnum, EMU_CHAN_DSL, v->ea | (v->amounts[3] << 24)); + emu_wrptr(sc, v->vnum, EMU_CHAN_PSST, v->sa | (v->amounts[2] << 24)); + + emu_wrptr(sc, v->vnum, EMU_CHAN_CCCA, start | (v->b16 ? 0 : EMU_CHAN_CCCA_8BITSELECT)); + emu_wrptr(sc, v->vnum, EMU_CHAN_Z1, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_Z2, 0); + + silent_page = ((uint32_t) (sc->mem.silent_page_addr) << 1) | EMU_CHAN_MAP_PTI_MASK; + emu_wrptr(sc, v->vnum, EMU_CHAN_MAPA, silent_page); + emu_wrptr(sc, v->vnum, EMU_CHAN_MAPB, silent_page); + + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, EMU_CHAN_CVCF_CURRFILTER_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, EMU_CHAN_VTFT_FILTERTARGET_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_ATKHLDM, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_DCYSUSM, EMU_CHAN_DCYSUSM_DECAYTIME_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_LFOVAL1, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_LFOVAL2, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_FMMOD, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_TREMFRQ, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_FM2FRQ2, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_ENVVAL, 0x8000); - emu_wrptr(sc, v->vnum, ATKHLDV, ATKHLDV_HOLDTIME_MASK | ATKHLDV_ATTACKTIME_MASK); - emu_wrptr(sc, v->vnum, ENVVOL, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_ATKHLDV, EMU_CHAN_ATKHLDV_HOLDTIME_MASK | EMU_CHAN_ATKHLDV_ATTACKTIME_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_ENVVOL, 0x8000); - emu_wrptr(sc, v->vnum, PEFE_FILTERAMOUNT, 0x7f); - emu_wrptr(sc, v->vnum, PEFE_PITCHAMOUNT, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_PEFE_FILTERAMOUNT, 0x7f); + emu_wrptr(sc, v->vnum, EMU_CHAN_PEFE_PITCHAMOUNT, 0); if ((v->stereo) && (v->slave != NULL)) emu_vwrite(sc, v->slave); } @@ -1438,7 +1449,7 @@ emu_vstop(struct emu_sc_info *sc, char c { int reg; - reg = (channel & 0x20) ? SOLEH : SOLEL; + reg = (channel & 0x20) ? EMU_SOLEH : EMU_SOLEL; channel &= 0x1f; reg |= 1 << 24; reg |= channel << 16; @@ -1459,29 +1470,29 @@ emu_vtrigger(struct emu_sc_info *sc, str ccis *= v->b16 ? 1 : 2; sample = v->b16 ? 0x00000000 : 0x80808080; for (i = 0; i < cs; i++) - emu_wrptr(sc, v->vnum, CD0 + i, sample); - emu_wrptr(sc, v->vnum, CCR_CACHEINVALIDSIZE, 0); - emu_wrptr(sc, v->vnum, CCR_READADDRESS, cra); - emu_wrptr(sc, v->vnum, CCR_CACHEINVALIDSIZE, ccis); - - emu_wrptr(sc, v->vnum, IFATN, 0xff00); - emu_wrptr(sc, v->vnum, VTFT, 0xffffffff); - emu_wrptr(sc, v->vnum, CVCF, 0xffffffff); - emu_wrptr(sc, v->vnum, DCYSUSV, 0x00007f7f); + emu_wrptr(sc, v->vnum, EMU_CHAN_CD0 + i, sample); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_CACHEINVALIDSIZE, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_READADDRESS, cra); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_CACHEINVALIDSIZE, ccis); + + emu_wrptr(sc, v->vnum, EMU_CHAN_IFATN, 0xff00); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, 0xffffffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, 0xffffffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_DCYSUSV, 0x00007f7f); emu_vstop(sc, v->vnum, 0); pitch_target = emu_rate_to_linearpitch(v->speed); initial_pitch = emu_rate_to_pitch(v->speed) >> 8; - emu_wrptr(sc, v->vnum, PTRX_PITCHTARGET, pitch_target); - emu_wrptr(sc, v->vnum, CPF_CURRENTPITCH, pitch_target); - emu_wrptr(sc, v->vnum, IP, initial_pitch); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX_PITCHTARGET, pitch_target); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF_PITCH, pitch_target); + emu_wrptr(sc, v->vnum, EMU_CHAN_IP, initial_pitch); } else { - emu_wrptr(sc, v->vnum, PTRX_PITCHTARGET, 0); - emu_wrptr(sc, v->vnum, CPF_CURRENTPITCH, 0); - emu_wrptr(sc, v->vnum, IFATN, 0xffff); - emu_wrptr(sc, v->vnum, VTFT, 0x0000ffff); - emu_wrptr(sc, v->vnum, CVCF, 0x0000ffff); - emu_wrptr(sc, v->vnum, IP, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX_PITCHTARGET, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF_PITCH, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_IFATN, 0xffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, 0x0000ffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, 0x0000ffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_IP, 0); emu_vstop(sc, v->vnum, 1); } if ((v->stereo) && (v->slave != NULL)) @@ -1494,7 +1505,7 @@ emu_vpos(struct emu_sc_info *sc, struct int s, ptr; s = (v->b16 ? 1 : 0) + (v->stereo ? 1 : 0); - ptr = (emu_rdptr(sc, v->vnum, CCCA_CURRADDR) - (v->start >> s)) << s; + ptr = (emu_rdptr(sc, v->vnum, EMU_CHAN_CCCA_CURRADDR) - (v->start >> s)) << s; return (ptr & ~0x0000001f); } @@ -1694,9 +1705,9 @@ emu_initefx(struct emu_sc_info *sc) /* stop DSP */ if (sc->is_emu10k1) { - emu_wrptr(sc, 0, DBG, EMU10K1_DBG_SINGLE_STEP); + emu_wrptr(sc, 0, EMU_DBG, EMU_DBG_SINGLE_STEP); } else { - emu_wrptr(sc, 0, A_DBG, A_DBG_SINGLE_STEP); + emu_wrptr(sc, 0, EMU_A_DBG, EMU_A_DBG_SINGLE_STEP); } /* code size is in instructions */ @@ -2162,9 +2173,9 @@ emu_initefx(struct emu_sc_info *sc) /* start DSP */ if (sc->is_emu10k1) { - emu_wrptr(sc, 0, DBG, 0); + emu_wrptr(sc, 0, EMU_DBG, 0); } else { - emu_wrptr(sc, 0, A_DBG, 0); + emu_wrptr(sc, 0, EMU_A_DBG, 0); } } @@ -2450,24 +2461,24 @@ emumix_set_mode(struct emu_sc_info *sc, return; } - hcfg = HCFG_AUDIOENABLE | HCFG_AUTOMUTE; + hcfg = EMU_HCFG_AUDIOENABLE | EMU_HCFG_AUTOMUTE; a_iocfg = 0; if (sc->rev >= 6) - hcfg |= HCFG_JOYENABLE; + hcfg |= EMU_HCFG_JOYENABLE; if (sc->is_emu10k1) - hcfg |= HCFG_LOCKTANKCACHE_MASK; + hcfg |= EMU_HCFG_LOCKTANKCACHE_MASK; else - hcfg |= HCFG_CODECFORMAT_I2S | HCFG_JOYENABLE; + hcfg |= EMU_HCFG_CODECFMT_I2S | EMU_HCFG_JOYENABLE; if (mode == MODE_DIGITAL) { if (sc->broken_digital) { device_printf(sc->dev, "Digital mode is reported as broken on this card.\n"); } - a_iocfg |= A_IOCFG_ENABLE_DIGITAL; - hcfg |= HCFG_GPOUT0; + a_iocfg |= EMU_A_IOCFG_GPOUT1; + hcfg |= EMU_HCFG_GPOUT0; } if (mode == MODE_ANALOG) @@ -2478,12 +2489,12 @@ emumix_set_mode(struct emu_sc_info *sc, if ((sc->is_ca0102) || (sc->is_ca0108)) /* - * Setting A_IOCFG_DISABLE_ANALOG will do opposite things + * Setting EMU_A_IOCFG_DISABLE_ANALOG will do opposite things * on diffrerent cards. * "don't disable analog outs" on Audigy 2 (ca0102/ca0108) * "disable analog outs" on Audigy (emu10k2) */ - a_iocfg |= A_IOCFG_DISABLE_ANALOG; + a_iocfg |= EMU_A_IOCFG_DISABLE_ANALOG; if (sc->is_ca0108) a_iocfg |= 0x20; /* XXX */ @@ -2492,12 +2503,12 @@ emumix_set_mode(struct emu_sc_info *sc, if (mode == MODE_DIGITAL) emumix_set_gpr(sc, sc->mute_gpr[ANALOGMUTE], 1); - emu_wr(sc, HCFG, hcfg, 4); + emu_wr(sc, EMU_HCFG, hcfg, 4); if ((sc->is_emu10k2) || (sc->is_ca0102) || (sc->is_ca0108)) { - tmp = emu_rd(sc, A_IOCFG, 2); + tmp = emu_rd(sc, EMU_A_IOCFG, 2); tmp = a_iocfg; - emu_wr(sc, A_IOCFG, tmp, 2); + emu_wr(sc, EMU_A_IOCFG, tmp, 2); } /* Unmute if we have changed mode to analog. */ @@ -2523,16 +2534,16 @@ emumix_set_spdif_mode(struct emu_sc_info return; } - spcs = SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 | - SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | - SPCS_GENERATIONSTATUS | 0x00001200 | 0x00000000 | - SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT; + spcs = EMU_SPCS_CLKACCY_1000PPM | EMU_SPCS_SAMPLERATE_48 | + EMU_SPCS_CHANNELNUM_LEFT | EMU_SPCS_SOURCENUM_UNSPEC | + EMU_SPCS_GENERATIONSTATUS | 0x00001200 | 0x00000000 | + EMU_SPCS_EMPHASIS_NONE | EMU_SPCS_COPYRIGHT; mode = SPDIF_MODE_PCM; - emu_wrptr(sc, 0, SPCS0, spcs); - emu_wrptr(sc, 0, SPCS1, spcs); - emu_wrptr(sc, 0, SPCS2, spcs); + emu_wrptr(sc, 0, EMU_SPCS0, spcs); + emu_wrptr(sc, 0, EMU_SPCS1, spcs); + emu_wrptr(sc, 0, EMU_SPCS2, spcs); } #define L2L_POINTS 10 @@ -2635,8 +2646,8 @@ emu_cardbus_init(struct emu_sc_info *sc) { /* - * XXX May not need this if we have IPR3 handler. - * Is it a real init calls, or IPR3 interrupt acknowledgments? + * XXX May not need this if we have EMU_IPR3 handler. + * Is it a real init calls, or EMU_IPR3 interrupt acknowledgments? * Looks much like "(data << 16) | register". */ emu_wr_cbptr(sc, (0x00d0 << 16) | 0x0000); @@ -2660,42 +2671,42 @@ emu_init(struct emu_sc_info *sc) int i; /* disable audio and lock cache */ - emu_wr(sc, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, 4); + emu_wr(sc, EMU_HCFG, EMU_HCFG_LOCKSOUNDCACHE | EMU_HCFG_LOCKTANKCACHE_MASK | EMU_HCFG_MUTEBUTTONENABLE, 4); /* reset recording buffers */ - emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, MICBA, 0); - emu_wrptr(sc, 0, FXBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, FXBA, 0); - emu_wrptr(sc, 0, ADCBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, ADCBA, 0); + emu_wrptr(sc, 0, EMU_MICBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_MICBA, 0); + emu_wrptr(sc, 0, EMU_FXBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_FXBA, 0); + emu_wrptr(sc, 0, EMU_ADCBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_ADCBA, 0); /* disable channel interrupt */ - emu_wr(sc, INTE, INTE_INTERVALTIMERENB | INTE_SAMPLERATETRACKER | INTE_PCIERRORENABLE, 4); - emu_wrptr(sc, 0, CLIEL, 0); - emu_wrptr(sc, 0, CLIEH, 0); - emu_wrptr(sc, 0, SOLEL, 0); - emu_wrptr(sc, 0, SOLEH, 0); + emu_wr(sc, EMU_INTE, EMU_INTE_INTERTIMERENB | EMU_INTE_SAMPLERATER | EMU_INTE_PCIERRENABLE, 4); + emu_wrptr(sc, 0, EMU_CLIEL, 0); + emu_wrptr(sc, 0, EMU_CLIEH, 0); + emu_wrptr(sc, 0, EMU_SOLEL, 0); + emu_wrptr(sc, 0, EMU_SOLEH, 0); /* disable P16V and S/PDIF interrupts */ if ((sc->is_ca0102) || (sc->is_ca0108)) - emu_wr(sc, INTE2, 0, 4); + emu_wr(sc, EMU_INTE2, 0, 4); if (sc->is_ca0102) - emu_wr(sc, INTE3, 0, 4); + emu_wr(sc, EMU_INTE3, 0, 4); /* init phys inputs and outputs */ ac97slot = 0; if (sc->has_51) - ac97slot = AC97SLOT_CNTR | AC97SLOT_LFE; + ac97slot = EMU_AC97SLOT_CENTER | EMU_AC97SLOT_LFE; if (sc->has_71) - ac97slot = AC97SLOT_CNTR | AC97SLOT_LFE | AC97SLOT_REAR_LEFT | AC97SLOT_REAR_RIGHT; + ac97slot = EMU_AC97SLOT_CENTER | EMU_AC97SLOT_LFE | EMU_AC97SLOT_REAR_LEFT | EMU_AC97SLOT_REAR_RIGHT; if (sc->is_emu10k2) ac97slot |= 0x40; - emu_wrptr(sc, 0, AC97SLOT, ac97slot); + emu_wrptr(sc, 0, EMU_AC97SLOT, ac97slot); if (sc->is_emu10k2) /* XXX for later cards? */ - emu_wrptr(sc, 0, SPBYPASS, 0xf00); /* What will happen if + emu_wrptr(sc, 0, EMU_SPBYPASS, 0xf00); /* What will happen if * we write 1 here? */ if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(sc->dev), @@ -2729,61 +2740,61 @@ emu_init(struct emu_sc_info *sc) sc->mem.ptb_pages[i] = tmp | i; for (ch = 0; ch < NUM_G; ch++) { - emu_wrptr(sc, ch, MAPA, tmp | MAP_PTI_MASK); - emu_wrptr(sc, ch, MAPB, tmp | MAP_PTI_MASK); + emu_wrptr(sc, ch, EMU_CHAN_MAPA, tmp | EMU_CHAN_MAP_PTI_MASK); + emu_wrptr(sc, ch, EMU_CHAN_MAPB, tmp | EMU_CHAN_MAP_PTI_MASK); } - emu_wrptr(sc, 0, PTB, (sc->mem.ptb_pages_addr)); - emu_wrptr(sc, 0, TCB, 0); /* taken from original driver */ - emu_wrptr(sc, 0, TCBS, 0); /* taken from original driver */ + emu_wrptr(sc, 0, EMU_PTB, (sc->mem.ptb_pages_addr)); + emu_wrptr(sc, 0, EMU_TCB, 0); /* taken from original driver */ + emu_wrptr(sc, 0, EMU_TCBS, 0); /* taken from original driver */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 23:07:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68B62106566C; Fri, 3 Feb 2012 23:07:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 571A68FC08; Fri, 3 Feb 2012 23:07:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13N7RBo008521; Fri, 3 Feb 2012 23:07:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13N7RgE008519; Fri, 3 Feb 2012 23:07:27 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202032307.q13N7RgE008519@svn.freebsd.org> From: Dimitry Andric Date: Fri, 3 Feb 2012 23:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230966 - stable/9/sys/contrib/rdma X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 23:07:27 -0000 Author: dim Date: Fri Feb 3 23:07:26 2012 New Revision: 230966 URL: http://svn.freebsd.org/changeset/base/230966 Log: MFC r229753: In sys/contrib/rdma/ib_addr.h, bump MAX_ADDR_LEN to 20 bytes (the same value used in sys/ofed/include/linux/netdevice.h), so there will be no buffer overruns in the rest of the inline functions in this file. Reviewed by: kmacy Modified: stable/9/sys/contrib/rdma/ib_addr.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/contrib/rdma/ib_addr.h ============================================================================== --- stable/9/sys/contrib/rdma/ib_addr.h Fri Feb 3 23:00:28 2012 (r230965) +++ stable/9/sys/contrib/rdma/ib_addr.h Fri Feb 3 23:07:26 2012 (r230966) @@ -42,7 +42,7 @@ #include -#define MAX_ADDR_LEN ETHER_ADDR_LEN /* XXX doesn't support IB! */ +#define MAX_ADDR_LEN 20 struct rdma_addr_client { int refcount; From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 23:08:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D48E106566C; Fri, 3 Feb 2012 23:08:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFF018FC0C; Fri, 3 Feb 2012 23:08:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13N8w8O008615; Fri, 3 Feb 2012 23:08:58 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13N8wBc008613; Fri, 3 Feb 2012 23:08:58 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202032308.q13N8wBc008613@svn.freebsd.org> From: Dimitry Andric Date: Fri, 3 Feb 2012 23:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230967 - stable/8/sys/contrib/rdma X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 23:08:59 -0000 Author: dim Date: Fri Feb 3 23:08:58 2012 New Revision: 230967 URL: http://svn.freebsd.org/changeset/base/230967 Log: MFC r229753: In sys/contrib/rdma/ib_addr.h, bump MAX_ADDR_LEN to 20 bytes (the same value used in sys/ofed/include/linux/netdevice.h), so there will be no buffer overruns in the rest of the inline functions in this file. Reviewed by: kmacy Modified: stable/8/sys/contrib/rdma/ib_addr.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/contrib/rdma/ib_addr.h ============================================================================== --- stable/8/sys/contrib/rdma/ib_addr.h Fri Feb 3 23:07:26 2012 (r230966) +++ stable/8/sys/contrib/rdma/ib_addr.h Fri Feb 3 23:08:58 2012 (r230967) @@ -42,7 +42,7 @@ #include -#define MAX_ADDR_LEN ETHER_ADDR_LEN /* XXX doesn't support IB! */ +#define MAX_ADDR_LEN 20 struct rdma_addr_client { int refcount; From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 23:27:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3BF8106566C; Fri, 3 Feb 2012 23:27:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D227C8FC0C; Fri, 3 Feb 2012 23:27:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13NR7hN009254; Fri, 3 Feb 2012 23:27:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13NR7xx009252; Fri, 3 Feb 2012 23:27:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202032327.q13NR7xx009252@svn.freebsd.org> From: Dimitry Andric Date: Fri, 3 Feb 2012 23:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230968 - stable/7/sys/contrib/rdma X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 23:27:08 -0000 Author: dim Date: Fri Feb 3 23:27:07 2012 New Revision: 230968 URL: http://svn.freebsd.org/changeset/base/230968 Log: MFC r229753: In sys/contrib/rdma/ib_addr.h, bump MAX_ADDR_LEN to 20 bytes (the same value used in sys/ofed/include/linux/netdevice.h), so there will be no buffer overruns in the rest of the inline functions in this file. Reviewed by: kmacy Modified: stable/7/sys/contrib/rdma/ib_addr.h Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/contrib/rdma/ib_addr.h ============================================================================== --- stable/7/sys/contrib/rdma/ib_addr.h Fri Feb 3 23:08:58 2012 (r230967) +++ stable/7/sys/contrib/rdma/ib_addr.h Fri Feb 3 23:27:07 2012 (r230968) @@ -42,7 +42,7 @@ #include -#define MAX_ADDR_LEN ETHER_ADDR_LEN /* XXX doesn't support IB! */ +#define MAX_ADDR_LEN 20 struct rdma_addr_client { int refcount; From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 23:32:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CFDD1065670; Fri, 3 Feb 2012 23:32:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B2488FC12; Fri, 3 Feb 2012 23:32:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13NWNBW009480; Fri, 3 Feb 2012 23:32:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13NWN3J009478; Fri, 3 Feb 2012 23:32:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202032332.q13NWN3J009478@svn.freebsd.org> From: Dimitry Andric Date: Fri, 3 Feb 2012 23:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230969 - stable/9/contrib/llvm/lib/Target/X86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 23:32:23 -0000 Author: dim Date: Fri Feb 3 23:32:22 2012 New Revision: 230969 URL: http://svn.freebsd.org/changeset/base/230969 Log: MFC r230393: Pull in r148240 from upstream llvm trunk: Make sure the non-SSE lowering for fences correctly clobbers EFLAGS. PR11768. In particular, this fixes segfaults during the build of devel/icu on i386. The __sync_synchronize() builtin used for implementing icu's internal barrier could lead to incorrect behaviour. Modified: stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Fri Feb 3 23:27:07 2012 (r230968) +++ stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Fri Feb 3 23:32:22 2012 (r230969) @@ -533,7 +533,7 @@ def ATOMSWAP6432 : I<0, Pseudo, (outs GR // Memory barriers // TODO: Get this to fold the constant into the instruction. -let isCodeGenOnly = 1 in +let isCodeGenOnly = 1, Defs = [EFLAGS] in def OR32mrLocked : I<0x09, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$zero), "lock\n\t" "or{l}\t{$zero, $dst|$dst, $zero}", From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 23:35:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E934B106566B; Fri, 3 Feb 2012 23:35:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D64D08FC0A; Fri, 3 Feb 2012 23:35:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13NZdVq009645; Fri, 3 Feb 2012 23:35:39 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13NZdYj009642; Fri, 3 Feb 2012 23:35:39 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202032335.q13NZdYj009642@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 3 Feb 2012 23:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230970 - stable/8/sbin/newfs_msdos X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 23:35:40 -0000 Author: pfg Date: Fri Feb 3 23:35:39 2012 New Revision: 230970 URL: http://svn.freebsd.org/changeset/base/230970 Log: MFC: r228740 Many style fixes. Remove C99 initializers: they don't help in this case. Set errno to 0 before strtoll() (from NetBSD). PR: 151850 Suggested by: bde Approved by: jhb (Mentor) Modified: stable/8/sbin/newfs_msdos/newfs_msdos.8 stable/8/sbin/newfs_msdos/newfs_msdos.c Directory Properties: stable/8/sbin/newfs_msdos/ (props changed) Modified: stable/8/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- stable/8/sbin/newfs_msdos/newfs_msdos.8 Fri Feb 3 23:32:22 2012 (r230969) +++ stable/8/sbin/newfs_msdos/newfs_msdos.8 Fri Feb 3 23:35:39 2012 (r230970) @@ -180,27 +180,27 @@ For reference purposes, this structure i below. .Bd -literal struct bsbpb { - u_int16_t bps; /* [-S] bytes per sector */ - u_int8_t spc; /* [-c] sectors per cluster */ - u_int16_t res; /* [-r] reserved sectors */ - u_int8_t nft; /* [-n] number of FATs */ - u_int16_t rde; /* [-e] root directory entries */ - u_int16_t sec; /* [-s] total sectors */ - u_int8_t mid; /* [-m] media descriptor */ - u_int16_t spf; /* [-a] sectors per FAT */ - u_int16_t spt; /* [-u] sectors per track */ - u_int16_t hds; /* [-h] drive heads */ - u_int32_t hid; /* [-o] hidden sectors */ - u_int32_t bsec; /* [-s] big total sectors */ + u_int16_t bpbBytesPerSec; /* [-S] bytes per sector */ + u_int8_t bpbSecPerClust; /* [-c] sectors per cluster */ + u_int16_t bpbResSectors; /* [-r] reserved sectors */ + u_int8_t bpbFATs; /* [-n] number of FATs */ + u_int16_t bpbRootDirEnts; /* [-e] root directory entries */ + u_int16_t bpbSectors; /* [-s] total sectors */ + u_int8_t bpbMedia; /* [-m] media descriptor */ + u_int16_t bpbFATsecs; /* [-a] sectors per FAT */ + u_int16_t bpbSecPerTrack; /* [-u] sectors per track */ + u_int16_t bpbHeads; /* [-h] drive heads */ + u_int32_t bpbHiddenSecs; /* [-o] hidden sectors */ + u_int32_t bpbHugeSectors; /* [-s] big total sectors */ }; /* FAT32 extensions */ struct bsxbpb { - u_int32_t bspf; /* [-a] big sectors per FAT */ - u_int16_t xflg; /* control flags */ - u_int16_t vers; /* file system version */ - u_int32_t rdcl; /* root directory start cluster */ - u_int16_t infs; /* [-i] file system info sector */ - u_int16_t bkbs; /* [-k] backup boot sector */ + u_int32_t bpbBigFATsecs; /* [-a] big sectors per FAT */ + u_int16_t bpbExtFlags; /* control flags */ + u_int16_t bpbFSVers; /* file system version */ + u_int32_t bpbRootClust; /* root directory start cluster */ + u_int16_t bpbFSInfo; /* [-i] file system info sector */ + u_int16_t bpbBackup; /* [-k] backup boot sector */ }; .Ed .Sh LIMITATION Modified: stable/8/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- stable/8/sbin/newfs_msdos/newfs_msdos.c Fri Feb 3 23:32:22 2012 (r230969) +++ stable/8/sbin/newfs_msdos/newfs_msdos.c Fri Feb 3 23:35:39 2012 (r230970) @@ -66,7 +66,7 @@ static const char rcsid[] = #define MINCLS12 1U /* minimum FAT12 clusters */ #define MINCLS16 0x1000U /* minimum FAT16 clusters */ #define MINCLS32 2U /* minimum FAT32 clusters */ -#define MAXCLS12 0xfedU /* maximum FAT12 clusters */ +#define MAXCLS12 0xfedU /* maximum FAT12 clusters */ #define MAXCLS16 0xfff5U /* maximum FAT16 clusters */ #define MAXCLS32 0xffffff5U /* maximum FAT32 clusters */ @@ -97,7 +97,7 @@ static const char rcsid[] = #define argtox(arg, lo, msg) argtou(arg, lo, UINT_MAX, msg) struct bs { - u_int8_t bsJump[3]; /* bootstrap entry point */ + u_int8_t bsJump[3]; /* bootstrap entry point */ u_int8_t bsOemName[8]; /* OEM name and version */ }; @@ -123,7 +123,7 @@ struct bsxbpb { u_int8_t bpbRootClust[4]; /* root directory start cluster */ u_int8_t bpbFSInfo[2]; /* file system info sector */ u_int8_t bpbBackup[2]; /* backup boot sector */ - u_int8_t bpbReserved[12]; /* reserved */ + u_int8_t bpbReserved[12]; /* reserved */ }; struct bsx { @@ -136,13 +136,13 @@ struct bsx { }; struct de { - u_int8_t deName[11]; /* name and extension */ - u_int8_t deAttributes; /* attributes */ - u_int8_t rsvd[10]; /* reserved */ - u_int8_t deMTime[2]; /* creation time */ - u_int8_t deMDate[2]; /* creation date */ - u_int8_t deStartCluster[2]; /* starting cluster */ - u_int8_t deFileSize[4]; /* size */ + u_int8_t deName[11]; /* name and extension */ + u_int8_t deAttributes; /* attributes */ + u_int8_t rsvd[10]; /* reserved */ + u_int8_t deMTime[2]; /* creation time */ + u_int8_t deMDate[2]; /* creation date */ + u_int8_t deStartCluster[2]; /* starting cluster */ + u_int8_t deFileSize[4]; /* size */ }; struct bpb { @@ -160,29 +160,26 @@ struct bpb { u_int bpbHugeSectors; /* big total sectors */ u_int bpbBigFATsecs; /* big sectors per FAT */ u_int bpbRootClust; /* root directory start cluster */ - u_int bpbFSInfo; /* file system info sector */ - u_int bpbBackup; /* backup boot sector */ + u_int bpbFSInfo; /* file system info sector */ + u_int bpbBackup; /* backup boot sector */ }; #define BPBGAP 0, 0, 0, 0, 0, 0 -#define INIT(a, b, c, d, e, f, g, h, i, j) \ - { .bpbBytesPerSec = a, .bpbSecPerClust = b, .bpbResSectors = c, .bpbFATs = d, .bpbRootDirEnts = e, \ - .bpbSectors = f, .bpbMedia = g, .bpbFATsecs = h, .bpbSecPerTrack = i, .bpbHeads = j, } static struct { const char *name; struct bpb bpb; } const stdfmt[] = { - {"160", INIT(512, 1, 1, 2, 64, 320, 0xfe, 1, 8, 1)}, - {"180", INIT(512, 1, 1, 2, 64, 360, 0xfc, 2, 9, 1)}, - {"320", INIT(512, 2, 1, 2, 112, 640, 0xff, 1, 8, 2)}, - {"360", INIT(512, 2, 1, 2, 112, 720, 0xfd, 2, 9, 2)}, - {"640", INIT(512, 2, 1, 2, 112, 1280, 0xfb, 2, 8, 2)}, - {"720", INIT(512, 2, 1, 2, 112, 1440, 0xf9, 3, 9, 2)}, - {"1200", INIT(512, 1, 1, 2, 224, 2400, 0xf9, 7, 15, 2)}, - {"1232", INIT(1024,1, 1, 2, 192, 1232, 0xfe, 2, 8, 2)}, - {"1440", INIT(512, 1, 1, 2, 224, 2880, 0xf0, 9, 18, 2)}, - {"2880", INIT(512, 2, 1, 2, 240, 5760, 0xf0, 9, 36, 2)} + {"160", {512, 1, 1, 2, 64, 320, 0xfe, 1, 8, 1, BPBGAP}}, + {"180", {512, 1, 1, 2, 64, 360, 0xfc, 2, 9, 1, BPBGAP}}, + {"320", {512, 2, 1, 2, 112, 640, 0xff, 1, 8, 2, BPBGAP}}, + {"360", {512, 2, 1, 2, 112, 720, 0xfd, 2, 9, 2, BPBGAP}}, + {"640", {512, 2, 1, 2, 112, 1280, 0xfb, 2, 8, 2, BPBGAP}}, + {"720", {512, 2, 1, 2, 112, 1440, 0xf9, 3, 9, 2, BPBGAP}}, + {"1200", {512, 1, 1, 2, 224, 2400, 0xf9, 7, 15, 2, BPBGAP}}, + {"1232", {1024,1, 1, 2, 192, 1232, 0xfe, 2, 8, 2, BPBGAP}}, + {"1440", {512, 1, 1, 2, 224, 2880, 0xf0, 9, 18, 2, BPBGAP}}, + {"2880", {512, 2, 1, 2, 240, 5760, 0xf0, 9, 36, 2, BPBGAP}} }; static const u_int8_t bootcode[] = { @@ -494,7 +491,8 @@ main(int argc, char *argv[]) if ((fd1 = open(bname, O_RDONLY)) == -1 || fstat(fd1, &sb)) err(1, "%s", bname); if (!S_ISREG(sb.st_mode) || sb.st_size % bpb.bpbBytesPerSec || - sb.st_size < bpb.bpbBytesPerSec || sb.st_size > bpb.bpbBytesPerSec * MAXU16) + sb.st_size < bpb.bpbBytesPerSec || + sb.st_size > bpb.bpbBytesPerSec * MAXU16) errx(1, "%s: inappropriate file type or format", bname); bss = sb.st_size / bpb.bpbBytesPerSec; } @@ -503,19 +501,23 @@ main(int argc, char *argv[]) if (!fat) { if (bpb.bpbHugeSectors < (bpb.bpbResSectors ? bpb.bpbResSectors : bss) + howmany((RESFTE + (bpb.bpbSecPerClust ? MINCLS16 : MAXCLS12 + 1)) * - ((bpb.bpbSecPerClust ? 16 : 12) / BPN), bpb.bpbBytesPerSec * NPB) * + (bpb.bpbSecPerClust ? 16 : 12) / BPN, + bpb.bpbBytesPerSec * NPB) * bpb.bpbFATs + howmany(bpb.bpbRootDirEnts ? bpb.bpbRootDirEnts : DEFRDE, bpb.bpbBytesPerSec / sizeof(struct de)) + (bpb.bpbSecPerClust ? MINCLS16 : MAXCLS12 + 1) * - (bpb.bpbSecPerClust ? bpb.bpbSecPerClust : howmany(DEFBLK, bpb.bpbBytesPerSec))) + (bpb.bpbSecPerClust ? bpb.bpbSecPerClust : + howmany(DEFBLK, bpb.bpbBytesPerSec))) fat = 12; else if (bpb.bpbRootDirEnts || bpb.bpbHugeSectors < (bpb.bpbResSectors ? bpb.bpbResSectors : bss) + - howmany((RESFTE + MAXCLS16) * 2, bpb.bpbBytesPerSec) * bpb.bpbFATs + + howmany((RESFTE + MAXCLS16) * 2, bpb.bpbBytesPerSec) * + bpb.bpbFATs + howmany(DEFRDE, bpb.bpbBytesPerSec / sizeof(struct de)) + (MAXCLS16 + 1) * - (bpb.bpbSecPerClust ? bpb.bpbSecPerClust : howmany(8192, bpb.bpbBytesPerSec))) + (bpb.bpbSecPerClust ? bpb.bpbSecPerClust : + howmany(8192, bpb.bpbBytesPerSec))) fat = 16; else fat = 32; @@ -539,21 +541,27 @@ main(int argc, char *argv[]) x = bpb.bpbBackup + 1; } if (!bpb.bpbResSectors) - bpb.bpbResSectors = fat == 32 ? MAX(x, MAX(16384 / bpb.bpbBytesPerSec, 4)) : x; + bpb.bpbResSectors = fat == 32 ? + MAX(x, MAX(16384 / bpb.bpbBytesPerSec, 4)) : x; else if (bpb.bpbResSectors < x) - errx(1, "too few reserved sectors (need %d have %d)", x, bpb.bpbResSectors); + errx(1, "too few reserved sectors (need %d have %d)", x, + bpb.bpbResSectors); if (fat != 32 && !bpb.bpbRootDirEnts) bpb.bpbRootDirEnts = DEFRDE; rds = howmany(bpb.bpbRootDirEnts, bpb.bpbBytesPerSec / sizeof(struct de)); if (!bpb.bpbSecPerClust) - for (bpb.bpbSecPerClust = howmany(fat == 16 ? DEFBLK16 : DEFBLK, bpb.bpbBytesPerSec); + for (bpb.bpbSecPerClust = howmany(fat == 16 ? DEFBLK16 : + DEFBLK, bpb.bpbBytesPerSec); bpb.bpbSecPerClust < MAXSPC && bpb.bpbResSectors + howmany((RESFTE + maxcls(fat)) * (fat / BPN), - bpb.bpbBytesPerSec * NPB) * bpb.bpbFATs + + bpb.bpbBytesPerSec * NPB) * + bpb.bpbFATs + rds + - (u_int64_t)(maxcls(fat) + 1) * bpb.bpbSecPerClust <= bpb.bpbHugeSectors; - bpb.bpbSecPerClust <<= 1); + (u_int64_t) (maxcls(fat) + 1) * + bpb.bpbSecPerClust <= bpb.bpbHugeSectors; + bpb.bpbSecPerClust <<= 1) + continue; if (fat != 32 && bpb.bpbBigFATsecs > MAXU16) errx(1, "too many sectors/FAT for FAT12/16"); x1 = bpb.bpbResSectors + rds; @@ -562,7 +570,8 @@ main(int argc, char *argv[]) errx(1, "meta data exceeds file system size"); x1 += x * bpb.bpbFATs; x = (u_int64_t)(bpb.bpbHugeSectors - x1) * bpb.bpbBytesPerSec * NPB / - (bpb.bpbSecPerClust * bpb.bpbBytesPerSec * NPB + fat / BPN * bpb.bpbFATs); + (bpb.bpbSecPerClust * bpb.bpbBytesPerSec * NPB + fat / + BPN * bpb.bpbFATs); x2 = howmany((RESFTE + MIN(x, maxcls(fat))) * (fat / BPN), bpb.bpbBytesPerSec * NPB); if (!bpb.bpbBigFATsecs) { @@ -570,7 +579,8 @@ main(int argc, char *argv[]) x1 += (bpb.bpbBigFATsecs - 1) * bpb.bpbFATs; } cls = (bpb.bpbHugeSectors - x1) / bpb.bpbSecPerClust; - x = (u_int64_t)bpb.bpbBigFATsecs * bpb.bpbBytesPerSec * NPB / (fat / BPN) - RESFTE; + x = (u_int64_t)bpb.bpbBigFATsecs * bpb.bpbBytesPerSec * NPB / (fat / BPN) - + RESFTE; if (cls > x) cls = x; if (bpb.bpbBigFATsecs < x2) @@ -608,7 +618,8 @@ main(int argc, char *argv[]) tm = localtime(&now); if (!(img = malloc(bpb.bpbBytesPerSec))) err(1, NULL); - dir = bpb.bpbResSectors + (bpb.bpbFATsecs ? bpb.bpbFATsecs : bpb.bpbBigFATsecs) * bpb.bpbFATs; + dir = bpb.bpbResSectors + (bpb.bpbFATsecs ? bpb.bpbFATsecs : + bpb.bpbBigFATsecs) * bpb.bpbFATs; memset(&si_sa, 0, sizeof(si_sa)); si_sa.sa_handler = infohandler; if (sigaction(SIGINFO, &si_sa, NULL) == -1) @@ -638,7 +649,8 @@ main(int argc, char *argv[]) } else memset(img, 0, bpb.bpbBytesPerSec); if (!lsn || - (fat == 32 && bpb.bpbBackup != MAXU16 && lsn == bpb.bpbBackup)) { + (fat == 32 && bpb.bpbBackup != MAXU16 && + lsn == bpb.bpbBackup)) { x1 = sizeof(struct bs); bsbpb = (struct bsbpb *)(img + x1); mk2(bsbpb->bpbBytesPerSec, bpb.bpbBytesPerSec); @@ -702,7 +714,8 @@ main(int argc, char *argv[]) mk2(img + MINBPS - 2, DOSMAGIC); } else if (lsn >= bpb.bpbResSectors && lsn < dir && !((lsn - bpb.bpbResSectors) % - (bpb.bpbFATsecs ? bpb.bpbFATsecs : bpb.bpbBigFATsecs))) { + (bpb.bpbFATsecs ? bpb.bpbFATsecs : + bpb.bpbBigFATsecs))) { mk1(img[0], bpb.bpbMedia); for (x = 1; x < fat * (fat == 32 ? 3 : 2) / 8; x++) mk1(img[x], fat == 32 && x % 4 == 3 ? 0x0f : 0xff); @@ -817,16 +830,19 @@ getdiskinfo(int fd, const char *fname, c if (bpb->bpbBytesPerSec) dlp.d_secsize = bpb->bpbBytesPerSec; if (ioctl(fd, DIOCGDINFO, &dlp) == -1) { - if (bpb->bpbBytesPerSec == 0 && ioctl(fd, DIOCGSECTORSIZE, &dlp.d_secsize) == -1) + if (bpb->bpbBytesPerSec == 0 && ioctl(fd, DIOCGSECTORSIZE, + &dlp.d_secsize) == -1) errx(1, "Cannot get sector size, %s", strerror(errno)); dlp.d_secperunit = ms / dlp.d_secsize; - if (bpb->bpbSecPerTrack == 0 && ioctl(fd, DIOCGFWSECTORS, &dlp.d_nsectors) == -1) { + if (bpb->bpbSecPerTrack == 0 && ioctl(fd, DIOCGFWSECTORS, + &dlp.d_nsectors) == -1) { warnx("Cannot get number of sectors per track, %s", strerror(errno)); dlp.d_nsectors = 63; } - if (bpb->bpbHeads == 0 && ioctl(fd, DIOCGFWHEADS, &dlp.d_ntracks) == -1) { + if (bpb->bpbHeads == 0 && + ioctl(fd, DIOCGFWHEADS, &dlp.d_ntracks) == -1) { warnx("Cannot get number of heads, %s", strerror(errno)); if (dlp.d_secperunit <= 63*1*1024) dlp.d_ntracks = 1; @@ -859,7 +875,8 @@ getdiskinfo(int fd, const char *fname, c static void print_bpb(struct bpb *bpb) { - printf("BytesPerSec=%u SecPerClust=%u ResSectors=%u FATs=%u", bpb->bpbBytesPerSec, bpb->bpbSecPerClust, bpb->bpbResSectors, + printf("BytesPerSec=%u SecPerClust=%u ResSectors=%u FATs=%u", + bpb->bpbBytesPerSec, bpb->bpbSecPerClust, bpb->bpbResSectors, bpb->bpbFATs); if (bpb->bpbRootDirEnts) printf(" RootDirEnts=%u", bpb->bpbRootDirEnts); @@ -868,11 +885,13 @@ print_bpb(struct bpb *bpb) printf(" Media=%#x", bpb->bpbMedia); if (bpb->bpbFATsecs) printf(" FATsecs=%u", bpb->bpbFATsecs); - printf(" SecPerTrack=%u Heads=%u HiddenSecs=%u", bpb->bpbSecPerTrack, bpb->bpbHeads, bpb->bpbHiddenSecs); + printf(" SecPerTrack=%u Heads=%u HiddenSecs=%u", bpb->bpbSecPerTrack, + bpb->bpbHeads, bpb->bpbHiddenSecs); if (bpb->bpbHugeSectors) printf(" HugeSectors=%u", bpb->bpbHugeSectors); if (!bpb->bpbFATsecs) { - printf(" FATsecs=%u RootCluster=%u", bpb->bpbBigFATsecs, bpb->bpbRootClust); + printf(" FATsecs=%u RootCluster=%u", bpb->bpbBigFATsecs, + bpb->bpbRootClust); printf(" FSInfo="); printf(bpb->bpbFSInfo == MAXU16 ? "%#x" : "%u", bpb->bpbFSInfo); printf(" Backup="); @@ -919,6 +938,7 @@ argtooff(const char *arg, const char *ms char *s; off_t x; + errno = 0; x = strtoll(arg, &s, 0); /* allow at most one extra char */ if (errno || x < 0 || (s[0] && s[1]) ) @@ -929,30 +949,30 @@ argtooff(const char *arg, const char *ms errx(1, "%s: bad %s", arg, msg); /* notreached */ - case 's': /* sector */ + case 's': /* sector */ case 'S': - x <<= 9; /* times 512 */ + x <<= 9; /* times 512 */ break; - case 'k': /* kilobyte */ + case 'k': /* kilobyte */ case 'K': - x <<= 10; /* times 1024 */ + x <<= 10; /* times 1024 */ break; - case 'm': /* megabyte */ + case 'm': /* megabyte */ case 'M': - x <<= 20; /* times 1024*1024 */ + x <<= 20; /* times 1024*1024 */ break; - case 'g': /* gigabyte */ + case 'g': /* gigabyte */ case 'G': - x <<= 30; /* times 1024*1024*1024 */ + x <<= 30; /* times 1024*1024*1024 */ break; - case 'p': /* partition start */ - case 'P': /* partition start */ - case 'l': /* partition length */ - case 'L': /* partition length */ + case 'p': /* partition start */ + case 'P': + case 'l': /* partition length */ + case 'L': errx(1, "%s: not supported yet %s", arg, msg); /* notreached */ } From owner-svn-src-all@FreeBSD.ORG Fri Feb 3 23:36:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 625431065678; Fri, 3 Feb 2012 23:36:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50EFF8FC17; Fri, 3 Feb 2012 23:36:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13Na9dI009698; Fri, 3 Feb 2012 23:36:09 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13Na9mY009696; Fri, 3 Feb 2012 23:36:09 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202032336.q13Na9mY009696@svn.freebsd.org> From: Dimitry Andric Date: Fri, 3 Feb 2012 23:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230971 - stable/9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 23:36:09 -0000 Author: dim Date: Fri Feb 3 23:36:08 2012 New Revision: 230971 URL: http://svn.freebsd.org/changeset/base/230971 Log: MFC r230622: When the buildkernel stage 2.3 (build tools) runs, the PATH is still set to the default from the top-level Makefile. Therefore, invocations of lex and yacc (used during building of aicasm) will use the executables in /usr/bin, not those optionally built during the previous buildworld or kernel-toolchain. This makes kernel builds from older FreeBSD releases more difficult than necessary. Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the bootstrap tools directories are searched before the regular ones. Silence from: svn-src-{all,head} Modified: stable/9/Makefile.inc1 (contents, props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Fri Feb 3 23:35:39 2012 (r230970) +++ stable/9/Makefile.inc1 Fri Feb 3 23:36:08 2012 (r230971) @@ -830,6 +830,7 @@ buildkernel: @echo ">>> stage 2.3: build tools" @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; \ + PATH=${BPATH}:${PATH} \ MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \ -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile @@ -837,6 +838,7 @@ buildkernel: .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) .for target in obj depend all cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ + PATH=${BPATH}:${PATH} \ MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target} .endfor From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 00:54:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8739106564A; Sat, 4 Feb 2012 00:54:44 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94D888FC0A; Sat, 4 Feb 2012 00:54:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q140sifn012256; Sat, 4 Feb 2012 00:54:44 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q140siBP012241; Sat, 4 Feb 2012 00:54:44 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201202040054.q140siBP012241@svn.freebsd.org> From: Robert Millan Date: Sat, 4 Feb 2012 00:54: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: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 00:54:44 -0000 Author: rmh Date: Sat Feb 4 00:54:43 2012 New Revision: 230972 URL: http://svn.freebsd.org/changeset/base/230972 Log: Add MK_SOURCELESS build option. Setting MK_SOURCELESS to "no" will disable kernel modules that include binary-only code. More fine-grained control is provided via MK_SOURCELESS_HOST (for native code that runs on host CPU) and MK_SOURCELESS_UCODE (for microcode). Reviewed by: julian, delphij, freebsd-arch Approved by: kib (mentor) MFC after: 2 weeks Added: head/sys/amd64/conf/WITHOUT_SOURCELESS (contents, props changed) head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST (contents, props changed) head/sys/amd64/conf/WITHOUT_SOURCELESS_UCODE (contents, props changed) head/sys/i386/conf/WITHOUT_SOURCELESS (contents, props changed) head/sys/i386/conf/WITHOUT_SOURCELESS_HOST (contents, props changed) head/sys/i386/conf/WITHOUT_SOURCELESS_UCODE (contents, props changed) head/tools/build/options/WITHOUT_SOURCELESS (contents, props changed) head/tools/build/options/WITHOUT_SOURCELESS_HOST (contents, props changed) head/tools/build/options/WITHOUT_SOURCELESS_UCODE (contents, props changed) Modified: head/share/mk/bsd.own.mk head/sys/modules/Makefile head/sys/modules/drm/Makefile head/sys/modules/sound/driver/Makefile head/sys/modules/usb/Makefile Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Feb 3 23:36:08 2012 (r230971) +++ head/share/mk/bsd.own.mk Sat Feb 4 00:54:43 2012 (r230972) @@ -320,6 +320,9 @@ __DEFAULT_YES_OPTIONS = \ BOOT \ BSD_CPIO \ BSNMP \ + SOURCELESS \ + SOURCELESS_HOST \ + SOURCELESS_UCODE \ BZIP2 \ CALENDAR \ CAPSICUM \ @@ -511,6 +514,11 @@ MK_BIND_UTILS:= no MK_BIND_ETC:= no .endif +.if ${MK_SOURCELESS} == "no" +MK_SOURCELESS_HOST:= no +MK_SOURCELESS_UCODE:= no +.endif + .if ${MK_CDDL} == "no" MK_ZFS:= no MK_CTF:= no Added: head/sys/amd64/conf/WITHOUT_SOURCELESS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/conf/WITHOUT_SOURCELESS Sat Feb 4 00:54:43 2012 (r230972) @@ -0,0 +1,7 @@ +# +# WITHOUT_SOURCELESS -- Disable drivers that include sourceless code. +# +# $FreeBSD$ + +include WITHOUT_SOURCELESS_HOST +include WITHOUT_SOURCELESS_UCODE Added: head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST Sat Feb 4 00:54:43 2012 (r230972) @@ -0,0 +1,10 @@ +# +# WITHOUT_SOURCELESS_UCODE -- Disable drivers that include sourceless +# native code for host CPU. +# +# $FreeBSD$ + +nodevice hpt27xx +nodevice hptmv +nodevice hptrr +nodevice nve Added: head/sys/amd64/conf/WITHOUT_SOURCELESS_UCODE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/conf/WITHOUT_SOURCELESS_UCODE Sat Feb 4 00:54:43 2012 (r230972) @@ -0,0 +1,40 @@ +# +# WITHOUT_SOURCELESS_UCODE -- Disable drivers that include sourceless +# microcode. +# +# $FreeBSD$ + +nodevice bce +nodevice fatm +nodevice fxp +nodevice ispfw +nodevice mwlfw +nodevice ralfw +nodevice runfw +nodevice sf +nodevice sn +nodevice ti +nodevice txp +nodevice ce +nodevice cp +nodevice ctau +nodevice ipwfw +nodevice iwifw +nodevice iwnfw +nodevice wpifw + +# drm +nodevice mga +nodevice r128 +nodevice radeon + +# sound +nodevice csa +nodevice ds1 +nodevice maestro3 + +# usb +nodevice rum +nodevice uath +nodevice zyd +nodevice kue Added: head/sys/i386/conf/WITHOUT_SOURCELESS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/conf/WITHOUT_SOURCELESS Sat Feb 4 00:54:43 2012 (r230972) @@ -0,0 +1,7 @@ +# +# WITHOUT_SOURCELESS -- Disable drivers that include sourceless code. +# +# $FreeBSD$ + +include WITHOUT_SOURCELESS_HOST +include WITHOUT_SOURCELESS_UCODE Added: head/sys/i386/conf/WITHOUT_SOURCELESS_HOST ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/conf/WITHOUT_SOURCELESS_HOST Sat Feb 4 00:54:43 2012 (r230972) @@ -0,0 +1,10 @@ +# +# WITHOUT_SOURCELESS_UCODE -- Disable drivers that include sourceless +# native code for host CPU. +# +# $FreeBSD$ + +nodevice hpt27xx +nodevice hptmv +nodevice hptrr +nodevice nve Added: head/sys/i386/conf/WITHOUT_SOURCELESS_UCODE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/conf/WITHOUT_SOURCELESS_UCODE Sat Feb 4 00:54:43 2012 (r230972) @@ -0,0 +1,40 @@ +# +# WITHOUT_SOURCELESS_UCODE -- Disable drivers that include sourceless +# microcode. +# +# $FreeBSD$ + +nodevice bce +nodevice fatm +nodevice fxp +nodevice ispfw +nodevice mwlfw +nodevice ralfw +nodevice runfw +nodevice sf +nodevice sn +nodevice ti +nodevice txp +nodevice ce +nodevice cp +nodevice ctau +nodevice ipwfw +nodevice iwifw +nodevice iwnfw +nodevice wpifw + +# drm +nodevice mga +nodevice r128 +nodevice radeon + +# sound +nodevice csa +nodevice ds1 +nodevice maestro3 + +# usb +nodevice rum +nodevice uath +nodevice zyd +nodevice kue Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Feb 3 23:36:08 2012 (r230971) +++ head/sys/modules/Makefile Sat Feb 4 00:54:43 2012 (r230972) @@ -2,6 +2,9 @@ .include +# Modules that include binary-only blobs of microcode should be selectable by +# MK_SOURCELESS_UCODE option (see below). + SUBDIR= ${_3dfx} \ ${_3dfx_linux} \ ${_aac} \ @@ -36,7 +39,7 @@ SUBDIR= ${_3dfx} \ ath \ ath_pci \ ${_auxio} \ - bce \ + ${_bce} \ bfe \ bge \ ${_bxe} \ @@ -95,13 +98,13 @@ SUBDIR= ${_3dfx} \ ${_ex} \ ${_exca} \ ${_ext2fs} \ - fatm \ + ${_fatm} \ fdc \ fdescfs \ ${_fe} \ firewire \ firmware \ - fxp \ + ${_fxp} \ gem \ geom \ ${_glxiic} \ @@ -148,7 +151,7 @@ SUBDIR= ${_3dfx} \ ${_isci} \ iscsi \ isp \ - ispfw \ + ${_ispfw} \ ${_iwi} \ ${_iwifw} \ ${_iwn} \ @@ -209,7 +212,7 @@ SUBDIR= ${_3dfx} \ ${_mthca} \ mvs \ mwl \ - mwlfw \ + ${_mwlfw} \ mxge \ my \ ${_ncp} \ @@ -259,14 +262,14 @@ SUBDIR= ${_3dfx} \ puc \ ${_qlxgb} \ ral \ - ralfw \ + ${_ralfw} \ ${_random} \ rc4 \ ${_rdma} \ re \ reiserfs \ rl \ - runfw \ + ${_runfw} \ ${_s3} \ ${_safe} \ ${_sbni} \ @@ -276,7 +279,7 @@ SUBDIR= ${_3dfx} \ sdhci \ sem \ send \ - sf \ + ${_sf} \ ${_sfxge} \ sge \ siba_bwn \ @@ -285,7 +288,7 @@ SUBDIR= ${_3dfx} \ sis \ sk \ ${_smbfs} \ - sn \ + ${_sn} \ ${_snc} \ snp \ ${_sound} \ @@ -300,7 +303,7 @@ SUBDIR= ${_3dfx} \ ${_sym} \ ${_syscons} \ sysvipc \ - ti \ + ${_ti} \ tl \ tmpfs \ ${_tpm} \ @@ -309,7 +312,7 @@ SUBDIR= ${_3dfx} \ twe \ tws \ tx \ - txp \ + ${_txp} \ uart \ ubsec \ udf \ @@ -358,8 +361,10 @@ _vpo= vpo # No barrier instruction support (specific to this driver) _sym= sym # intr_disable() is a macro, causes problems +.if ${MK_SOURCELESS_UCODE} != "no" _cxgb= cxgb .endif +.endif .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) .if exists(${.CURDIR}/../opencrypto) @@ -402,6 +407,20 @@ _pfsync= pfsync .endif .endif +.if ${MK_SOURCELESS_UCODE} != "no" +_bce= bce +_fatm= fatm +_fxp= fxp +_ispfw= ispfw +_mwlfw= mwlfw +_ralfw= ralfw +_runfw= runfw +_sf= sf +_sn= sn +_ti= ti +_txp= txp +.endif + .if ${MACHINE_CPUARCH} == "i386" # XXX some of these can move to the general case when de-i386'ed # XXX some of these can move now, but are untested on other architectures. @@ -417,9 +436,13 @@ _bktr= bktr _bxe= bxe _cardbus= cardbus _cbb= cbb +.if ${MK_SOURCELESS_UCODE} != "no" _ce= ce +.endif _coff= coff +.if ${MK_SOURCELESS_UCODE} != "no" _cp= cp +.endif _cpuctl= cpuctl _cpufreq= cpufreq _cs= cs @@ -508,36 +531,52 @@ _ciss= ciss _cm= cm _cmx= cmx _coretemp= coretemp +.if ${MK_SOURCELESS_UCODE} != "no" _ctau= ctau +.endif _dpt= dpt _ex= ex +.if ${MK_SOURCELESS_HOST} != "no" _hpt27xx= hpt27xx +.endif _hptiop= hptiop +.if ${MK_SOURCELESS_HOST} != "no" _hptmv= hptmv _hptrr= hptrr +.endif _ichwd= ichwd _ida= ida _iir= iir _ipmi= ipmi _ips= ips _ipw= ipw +.if ${MK_SOURCELESS_UCODE} != "no" _ipwfw= ipwfw +.endif _isci= isci _iwi= iwi +.if ${MK_SOURCELESS_UCODE} != "no" _iwifw= iwifw +.endif _iwn= iwn +.if ${MK_SOURCELESS_UCODE} != "no" _iwnfw= iwnfw +.endif _ixgb= ixgb _ixgbe= ixgbe _mly= mly _nfe= nfe +.if ${MK_SOURCELESS_HOST} != "no" _nve= nve +.endif _nvram= nvram _nxge= nxge _tpm= tpm _viawd= viawd _wpi= wpi +.if ${MK_SOURCELESS_UCODE} != "no" _wpifw= wpifw +.endif .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) _padlock= padlock .endif @@ -589,10 +628,14 @@ _et= et _em= em _exca= exca _ext2fs= ext2fs +.if ${MK_SOURCELESS_HOST} != "no" _hpt27xx= hpt27xx +.endif _hptiop= hptiop +.if ${MK_SOURCELESS_HOST} != "no" _hptmv= hptmv _hptrr= hptrr +.endif _i2c= i2c _ichwd= ichwd _ida= ida @@ -603,12 +646,18 @@ _io= io _ipmi= ipmi _ips= ips _ipw= ipw +.if ${MK_SOURCELESS_UCODE} != "no" _ipwfw= ipwfw +.endif _isci= isci _iwi= iwi +.if ${MK_SOURCELESS_UCODE} != "no" _iwifw= iwifw +.endif _iwn= iwn +.if ${MK_SOURCELESS_UCODE} != "no" _iwnfw= iwnfw +.endif _ixgb= ixgb _ixgbe= ixgbe _lindev= lindev @@ -624,7 +673,9 @@ _mthca= mthca .endif _ndis= ndis _nfe= nfe +.if ${MK_SOURCELESS_HOST} != "no" _nve= nve +.endif _nvram= nvram _nxge= nxge .if ${MK_CDDL} != "no" || defined(ALL_MODULES) @@ -654,7 +705,9 @@ _vxge= vxge _x86bios= x86bios _wi= wi _wpi= wpi +.if ${MK_SOURCELESS_UCODE} != "no" _wpifw= wpifw +.endif .if ${MK_ZFS} != "no" || defined(ALL_MODULES) _zfs= zfs .endif Modified: head/sys/modules/drm/Makefile ============================================================================== --- head/sys/modules/drm/Makefile Fri Feb 3 23:36:08 2012 (r230971) +++ head/sys/modules/drm/Makefile Sat Feb 4 00:54:43 2012 (r230972) @@ -1,15 +1,26 @@ # $FreeBSD$ +.include + +# Modules that include binary-only blobs of microcode should be selectable by +# MK_SOURCELESS_UCODE option (see below). + SUBDIR = \ drm \ i915 \ mach64 \ - mga \ - r128 \ - radeon \ + ${_mga} \ + ${_r128} \ + ${_radeon} \ savage \ sis \ tdfx \ via +.if ${MK_SOURCELESS_UCODE} != "no" +_mga= mga +_r128= r128 +_radeon= radeon +.endif + .include Modified: head/sys/modules/sound/driver/Makefile ============================================================================== --- head/sys/modules/sound/driver/Makefile Fri Feb 3 23:36:08 2012 (r230971) +++ head/sys/modules/sound/driver/Makefile Sat Feb 4 00:54:43 2012 (r230972) @@ -1,10 +1,21 @@ # $FreeBSD$ -SUBDIR= ad1816 als4000 atiixp cs4281 csa ds1 emu10k1 emu10kx -SUBDIR+= envy24 envy24ht es137x ess fm801 hda ich maestro maestro3 +.include + +# Modules that include binary-only blobs of microcode should be selectable by +# MK_SOURCELESS_UCODE option (see below). + +SUBDIR= ad1816 als4000 atiixp cs4281 ${_csa} ${_ds1} emu10k1 emu10kx +SUBDIR+= envy24 envy24ht es137x ess fm801 hda ich maestro ${_maestro3} SUBDIR+= neomagic sb16 sb8 sbc solo spicds t4dwave via8233 SUBDIR+= via82c686 vibes driver uaudio +.if ${MK_SOURCELESS_UCODE} != "no" +_csa= csa +_ds1= ds1 +_maestro3= maestro3 +.endif + .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" SUBDIR+= cmi mss .endif Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Fri Feb 3 23:36:08 2012 (r230971) +++ head/sys/modules/usb/Makefile Sat Feb 4 00:54:43 2012 (r230972) @@ -25,16 +25,28 @@ # SUCH DAMAGE. # +.include + +# Modules that include binary-only blobs of microcode should be selectable by +# MK_SOURCELESS_UCODE option (see below). + SUBDIR = usb SUBDIR += ehci musb ohci uhci xhci uss820dci ${_at91dci} ${_atmegadci} ${_avr32dci} -SUBDIR += rum run uath upgt usie ural zyd ${_urtw} +SUBDIR += ${_rum} run ${_uath} upgt usie ural ${_zyd} ${_urtw} SUBDIR += atp uhid ukbd ums udbp ufm uep SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umcs umodem umoscom uplcom uslcom uvisor uvscom -SUBDIR += uether aue axe cdce cue kue mos rue udav uhso ipheth +SUBDIR += uether aue axe cdce cue ${_kue} mos rue udav uhso ipheth SUBDIR += usfs umass urio SUBDIR += quirk template +.if ${MK_SOURCELESS_UCODE} != "no" +_rum= rum +_uath= uath +_zyd= zyd +_kue= kue +.endif + .if ${MACHINE_CPUARCH} == "amd64" _urtw= urtw .endif Added: head/tools/build/options/WITHOUT_SOURCELESS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_SOURCELESS Sat Feb 4 00:54:43 2012 (r230972) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build kernel modules that include sourceless code (either microcode or native code for host CPU). Added: head/tools/build/options/WITHOUT_SOURCELESS_HOST ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_SOURCELESS_HOST Sat Feb 4 00:54:43 2012 (r230972) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build kernel modules that include sourceless native code for host CPU. Added: head/tools/build/options/WITHOUT_SOURCELESS_UCODE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_SOURCELESS_UCODE Sat Feb 4 00:54:43 2012 (r230972) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build kernel modules that include sourceless microcode. From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 04:31:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60F42106566B; Sat, 4 Feb 2012 04:31:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E47E8FC13; Sat, 4 Feb 2012 04:31:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q144VT65019187; Sat, 4 Feb 2012 04:31:29 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q144VTcm019185; Sat, 4 Feb 2012 04:31:29 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202040431.q144VTcm019185@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 4 Feb 2012 04:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230975 - stable/9/lib/libvgl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 04:31:29 -0000 Author: pfg Date: Sat Feb 4 04:31:28 2012 New Revision: 230975 URL: http://svn.freebsd.org/changeset/base/230975 Log: MFC: r229415, r229516 Integrate the line drawing algorithm from the book "Graphic Gems 1". http://www.graphicsgems.org/ At the time it claimed to be 3-4 times faster than the traditional algorithm. Make sure this doesn't give problems to clang. PR: 18769 Approved by: jhb (mentor) Modified: stable/9/lib/libvgl/simple.c Directory Properties: stable/9/lib/libvgl/ (props changed) Modified: stable/9/lib/libvgl/simple.c ============================================================================== --- stable/9/lib/libvgl/simple.c Sat Feb 4 03:08:23 2012 (r230974) +++ stable/9/lib/libvgl/simple.c Sat Feb 4 04:31:28 2012 (r230975) @@ -198,36 +198,205 @@ get_planar: return 0; /* XXX black? */ } + /* + * Symmetric Double Step Line Algorithm by Brian Wyvill from + * "Graphics Gems", Academic Press, 1990. + */ + +#define SL_SWAP(a,b) {a^=b; b^=a; a^=b;} +#define SL_ABSOLUTE(i,j,k) ( (i-j)*(k = ( (i-j)<0 ? -1 : 1))) + +void +plot(VGLBitmap * object, int x, int y, int flag, byte color) +{ + /* non-zero flag indicates the pixels need swapping back. */ + if (flag) + VGLSetXY(object, y, x, color); + else + VGLSetXY(object, x, y, color); +} + + void VGLLine(VGLBitmap *object, int x1, int y1, int x2, int y2, u_long color) { - int d, x, y, ax, ay, sx, sy, dx, dy; + int dx, dy, incr1, incr2, D, x, y, xend, c, pixels_left; + int sign_x, sign_y, step, reverse, i; - dx = x2-x1; ax = ABS(dx)<<1; sx = SGN(dx); x = x1; - dy = y2-y1; ay = ABS(dy)<<1; sy = SGN(dy); y = y1; + dx = SL_ABSOLUTE(x2, x1, sign_x); + dy = SL_ABSOLUTE(y2, y1, sign_y); + /* decide increment sign by the slope sign */ + if (sign_x == sign_y) + step = 1; + else + step = -1; + + if (dy > dx) { /* chooses axis of greatest movement (make dx) */ + SL_SWAP(x1, y1); + SL_SWAP(x2, y2); + SL_SWAP(dx, dy); + reverse = 1; + } else + reverse = 0; + /* note error check for dx==0 should be included here */ + if (x1 > x2) { /* start from the smaller coordinate */ + x = x2; + y = y2; +/* x1 = x1; + y1 = y1; */ + } else { + x = x1; + y = y1; + x1 = x2; + y1 = y2; + } + + + /* Note dx=n implies 0 - n or (dx+1) pixels to be set */ + /* Go round loop dx/4 times then plot last 0,1,2 or 3 pixels */ + /* In fact (dx-1)/4 as 2 pixels are already plotted */ + xend = (dx - 1) / 4; + pixels_left = (dx - 1) % 4; /* number of pixels left over at the + * end */ + plot(object, x, y, reverse, color); + if (pixels_left < 0) + return; /* plot only one pixel for zero length + * vectors */ + plot(object, x1, y1, reverse, color); /* plot first two points */ + incr2 = 4 * dy - 2 * dx; + if (incr2 < 0) { /* slope less than 1/2 */ + c = 2 * dy; + incr1 = 2 * c; + D = incr1 - dx; + + for (i = 0; i < xend; i++) { /* plotting loop */ + ++x; + --x1; + if (D < 0) { + /* pattern 1 forwards */ + plot(object, x, y, reverse, color); + plot(object, ++x, y, reverse, color); + /* pattern 1 backwards */ + plot(object, x1, y1, reverse, color); + plot(object, --x1, y1, reverse, color); + D += incr1; + } else { + if (D < c) { + /* pattern 2 forwards */ + plot(object, x, y, reverse, color); + plot(object, ++x, y += step, reverse, + color); + /* pattern 2 backwards */ + plot(object, x1, y1, reverse, color); + plot(object, --x1, y1 -= step, reverse, + color); + } else { + /* pattern 3 forwards */ + plot(object, x, y += step, reverse, color); + plot(object, ++x, y, reverse, color); + /* pattern 3 backwards */ + plot(object, x1, y1 -= step, reverse, + color); + plot(object, --x1, y1, reverse, color); + } + D += incr2; + } + } /* end for */ - if (ax>ay) { /* x dominant */ - d = ay-(ax>>1); - for (;;) { - VGLSetXY(object, x, y, color); - if (x==x2) - break; - if (d>=0) { - y += sy; d -= ax; + /* plot last pattern */ + if (pixels_left) { + if (D < 0) { + plot(object, ++x, y, reverse, color); /* pattern 1 */ + if (pixels_left > 1) + plot(object, ++x, y, reverse, color); + if (pixels_left > 2) + plot(object, --x1, y1, reverse, color); + } else { + if (D < c) { + plot(object, ++x, y, reverse, color); /* pattern 2 */ + if (pixels_left > 1) + plot(object, ++x, y += step, reverse, color); + if (pixels_left > 2) + plot(object, --x1, y1, reverse, color); + } else { + /* pattern 3 */ + plot(object, ++x, y += step, reverse, color); + if (pixels_left > 1) + plot(object, ++x, y, reverse, color); + if (pixels_left > 2) + plot(object, --x1, y1 -= step, reverse, color); + } } - x += sx; d += ay; - } + } /* end if pixels_left */ } - else { /* y dominant */ - d = ax-(ay>>1); - for (;;) { - VGLSetXY(object, x, y, color); - if (y==y2) - break; - if (d>=0) { - x += sx; d -= ay; + /* end slope < 1/2 */ + else { /* slope greater than 1/2 */ + c = 2 * (dy - dx); + incr1 = 2 * c; + D = incr1 + dx; + for (i = 0; i < xend; i++) { + ++x; + --x1; + if (D > 0) { + /* pattern 4 forwards */ + plot(object, x, y += step, reverse, color); + plot(object, ++x, y += step, reverse, color); + /* pattern 4 backwards */ + plot(object, x1, y1 -= step, reverse, color); + plot(object, --x1, y1 -= step, reverse, color); + D += incr1; + } else { + if (D < c) { + /* pattern 2 forwards */ + plot(object, x, y, reverse, color); + plot(object, ++x, y += step, reverse, + color); + + /* pattern 2 backwards */ + plot(object, x1, y1, reverse, color); + plot(object, --x1, y1 -= step, reverse, + color); + } else { + /* pattern 3 forwards */ + plot(object, x, y += step, reverse, color); + plot(object, ++x, y, reverse, color); + /* pattern 3 backwards */ + plot(object, x1, y1 -= step, reverse, color); + plot(object, --x1, y1, reverse, color); + } + D += incr2; + } + } /* end for */ + /* plot last pattern */ + if (pixels_left) { + if (D > 0) { + plot(object, ++x, y += step, reverse, color); /* pattern 4 */ + if (pixels_left > 1) + plot(object, ++x, y += step, reverse, + color); + if (pixels_left > 2) + plot(object, --x1, y1 -= step, reverse, + color); + } else { + if (D < c) { + plot(object, ++x, y, reverse, color); /* pattern 2 */ + if (pixels_left > 1) + plot(object, ++x, y += step, reverse, color); + if (pixels_left > 2) + plot(object, --x1, y1, reverse, color); + } else { + /* pattern 3 */ + plot(object, ++x, y += step, reverse, color); + if (pixels_left > 1) + plot(object, ++x, y, reverse, color); + if (pixels_left > 2) { + if (D > c) /* step 3 */ + plot(object, --x1, y1 -= step, reverse, color); + else /* step 2 */ + plot(object, --x1, y1, reverse, color); + } + } } - y += sy; d += ax; } } } From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 07:43:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E06221065688; Sat, 4 Feb 2012 07:43:18 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 90F5B8FC19; Sat, 4 Feb 2012 07:43:18 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id E0974328; Sat, 4 Feb 2012 08:43:15 +0100 (CET) Date: Sat, 4 Feb 2012 08:42:01 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120204074201.GA1694@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pWyiEgJYm5f9v55/" Content-Disposition: inline In-Reply-To: <201202011641.q11Gf0j6095461@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 07:43:19 -0000 --pWyiEgJYm5f9v55/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 01, 2012 at 04:41:00PM +0000, Guy Helmer wrote: > Author: ghelmer > Date: Wed Feb 1 16:40:59 2012 > New Revision: 230869 > URL: http://svn.freebsd.org/changeset/base/230869 >=20 > Log: > Change the notes about the pidfile to include Doug's preference > for pre-creating the pidfile with appropriate owner and permissions. > =20 > Requested by dougb Pre-creating pidfiles? That sounds weird. The common practise is to turn eg. /var/run/.pid into /var/run//pid where directory has appropriate permissions. Pre-creating pidfiles is simply wrong, because applications create pidfile on start and unlink it on exit. If application has no permission to remove files from /var/run/ it will leave pidfile with stale PID in it, which is bad. Changing application to truncate pidfile on exit instead of unlinking it also is a bad idea especially because there is working solution - pid directory. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --pWyiEgJYm5f9v55/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8s4UkACgkQForvXbEpPzTYlgCcDd/fuSdpYRoAO+JpHNM2gfdx t6kAn3tu//ynWDKsXeIUmT+H/nuaxuZH =7xPX -----END PGP SIGNATURE----- --pWyiEgJYm5f9v55/-- From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 07:59:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDFFE106566B; Sat, 4 Feb 2012 07:59:12 +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 DCFD78FC13; Sat, 4 Feb 2012 07:59:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q147xCZS025610; Sat, 4 Feb 2012 07:59:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q147xCpD025608; Sat, 4 Feb 2012 07:59:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201202040759.q147xCpD025608@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 4 Feb 2012 07:59: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: r230976 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 07:59:13 -0000 Author: pjd Date: Sat Feb 4 07:59:12 2012 New Revision: 230976 URL: http://svn.freebsd.org/changeset/base/230976 Log: Fix typo in comment. MFC after: 3 days Modified: head/sbin/hastd/parse.y Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Sat Feb 4 04:31:28 2012 (r230975) +++ head/sbin/hastd/parse.y Sat Feb 4 07:59:12 2012 (r230976) @@ -85,7 +85,7 @@ isitme(const char *name) size_t bufsize; /* - * First check if the give name matches our full hostname. + * First check if the given name matches our full hostname. */ if (gethostname(buf, sizeof(buf)) < 0) { pjdlog_errno(LOG_ERR, "gethostname() failed"); From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 08:03:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C978106566B; Sat, 4 Feb 2012 08:03:02 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B68D8FC14; Sat, 4 Feb 2012 08:03:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14832j4025842; Sat, 4 Feb 2012 08:03:02 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14832TQ025840; Sat, 4 Feb 2012 08:03:02 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201202040803.q14832TQ025840@svn.freebsd.org> From: Joel Dahl Date: Sat, 4 Feb 2012 08: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: r230977 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 08:03:02 -0000 Author: joel (doc committer) Date: Sat Feb 4 08:03:01 2012 New Revision: 230977 URL: http://svn.freebsd.org/changeset/base/230977 Log: Add /usr/src/cddl/ to the hierarchy. Modified: head/share/man/man7/hier.7 Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Sat Feb 4 07:59:12 2012 (r230976) +++ head/share/man/man7/hier.7 Sat Feb 4 08:03:01 2012 (r230977) @@ -639,6 +639,8 @@ third-party, and/or local source files .Bl -tag -width ".Pa kerberos5/" -compact .It Pa bin/ source code for files in /bin +.It Pa cddl/ +Utilities covered by the Common Development and Distribution License .It Pa contrib/ source code for contributed software .It Pa crypto/ From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 08:24:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56C12106564A; Sat, 4 Feb 2012 08:24:01 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id A6BBF8FC0C; Sat, 4 Feb 2012 08:23:59 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so5002066bkb.13 for ; Sat, 04 Feb 2012 00:23:58 -0800 (PST) Received: by 10.204.143.131 with SMTP id v3mr4900132bku.44.1328343838654; Sat, 04 Feb 2012 00:23:58 -0800 (PST) Received: from [10.254.254.77] (ppp95-165-147-239.pppoe.spdop.ru. [95.165.147.239]) by mx.google.com with ESMTPS id cg2sm24123022bkb.12.2012.02.04.00.23.57 (version=SSLv3 cipher=OTHER); Sat, 04 Feb 2012 00:23:58 -0800 (PST) Message-ID: <4F2CEB1D.10607@zonov.org> Date: Sat, 04 Feb 2012 12:23:57 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> In-Reply-To: <20120204074201.GA1694@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, Guy Helmer Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 08:24:01 -0000 On 04.02.2012 11:42, Pawel Jakub Dawidek wrote: > On Wed, Feb 01, 2012 at 04:41:00PM +0000, Guy Helmer wrote: >> Author: ghelmer >> Date: Wed Feb 1 16:40:59 2012 >> New Revision: 230869 >> URL: http://svn.freebsd.org/changeset/base/230869 >> >> Log: >> Change the notes about the pidfile to include Doug's preference >> for pre-creating the pidfile with appropriate owner and permissions. >> >> Requested by dougb > > Pre-creating pidfiles? That sounds weird. The common practise is to turn > eg. /var/run/.pid into /var/run//pid where directory > has appropriate permissions. Pre-creating pidfiles is simply wrong, > because applications create pidfile on start and unlink it on exit. > If application has no permission to remove files from /var/run/ it will > leave pidfile with stale PID in it, which is bad. Changing application > to truncate pidfile on exit instead of unlinking it also is a bad idea > especially because there is working solution - pid directory. > Hi, There's even worse problem - kernel closes pidfile in execvp() because of FD_CLOEXEC flag is set and daemon doesn't hold lock on pidfile. I reported about that earlier, but was ignored. -- Andrey Zonov From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 09:48:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 010C3106566B; Sat, 4 Feb 2012 09:48:26 +0000 (UTC) (envelope-from zeising@daemonic.se) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 6B3A28FC13; Sat, 4 Feb 2012 09:48:25 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 4818640010; Sat, 4 Feb 2012 10:48:24 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 3D34F4000F; Sat, 4 Feb 2012 10:48:24 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (mx.daemonic.se [IPv6:2001:470:dca9:0:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id B1AA34000F; Sat, 4 Feb 2012 10:48:23 +0100 (CET) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 24CF9119D3D; Sat, 4 Feb 2012 10:48:23 +0100 (CET) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([IPv6:2001:470:dca9:0:1::3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [2001:470:dca9:0:1::6]) (amavisd-new, port 10025) with ESMTPS id 6nvIlr2ARTQs; Sat, 4 Feb 2012 10:48:20 +0100 (CET) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2001:470:dca9:0:1::4]) by mx.daemonic.se (Postfix) with ESMTPS id 84F8C119D3C; Sat, 4 Feb 2012 10:48:20 +0100 (CET) Received: from [IPv6:2001:470:dca9:1::4] (vivi.daemonic.se [IPv6:2001:470:dca9:1::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 661A312B089; Sat, 4 Feb 2012 10:48:20 +0100 (CET) Message-ID: <4F2CFEE3.6070306@daemonic.se> Date: Sat, 04 Feb 2012 10:48:19 +0100 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Robert Millan References: <201202040054.q140siBP012241@svn.freebsd.org> In-Reply-To: <201202040054.q140siBP012241@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 09:48:26 -0000 On 2012-02-04 01:54, Robert Millan wrote: > Author: rmh > Date: Sat Feb 4 00:54:43 2012 > New Revision: 230972 > URL: http://svn.freebsd.org/changeset/base/230972 > > Log: > Add MK_SOURCELESS build option. Setting MK_SOURCELESS to "no" will disable > kernel modules that include binary-only code. > > More fine-grained control is provided via MK_SOURCELESS_HOST (for native code > that runs on host CPU) and MK_SOURCELESS_UCODE (for microcode). > > Reviewed by: julian, delphij, freebsd-arch > Approved by: kib (mentor) > MFC after: 2 weeks > > Added: > head/sys/amd64/conf/WITHOUT_SOURCELESS (contents, props changed) > head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST (contents, props changed) > head/sys/amd64/conf/WITHOUT_SOURCELESS_UCODE (contents, props changed) > head/sys/i386/conf/WITHOUT_SOURCELESS (contents, props changed) > head/sys/i386/conf/WITHOUT_SOURCELESS_HOST (contents, props changed) > head/sys/i386/conf/WITHOUT_SOURCELESS_UCODE (contents, props changed) > head/tools/build/options/WITHOUT_SOURCELESS (contents, props changed) > head/tools/build/options/WITHOUT_SOURCELESS_HOST (contents, props changed) > head/tools/build/options/WITHOUT_SOURCELESS_UCODE (contents, props changed) > Modified: > head/share/mk/bsd.own.mk > head/sys/modules/Makefile > head/sys/modules/drm/Makefile > head/sys/modules/sound/driver/Makefile > head/sys/modules/usb/Makefile > > > Added: head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST Sat Feb 4 00:54:43 2012 (r230972) > @@ -0,0 +1,10 @@ > +# > +# WITHOUT_SOURCELESS_UCODE -- Disable drivers that include sourceless ^^^^^ This seems like a typo. Shouldn't it read HOST instead? > +# native code for host CPU. > +# > +# $FreeBSD$ > + > +nodevice hpt27xx > +nodevice hptmv > +nodevice hptrr > +nodevice nve > > > Added: head/sys/i386/conf/WITHOUT_SOURCELESS_HOST > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/i386/conf/WITHOUT_SOURCELESS_HOST Sat Feb 4 00:54:43 2012 (r230972) > @@ -0,0 +1,10 @@ > +# > +# WITHOUT_SOURCELESS_UCODE -- Disable drivers that include sourceless ^^^^^ Same here. > +# native code for host CPU. > +# > +# $FreeBSD$ > + > +nodevice hpt27xx > +nodevice hptmv > +nodevice hptrr > +nodevice nve > > Also, can you please regenerate the src.conf manual page? Perhaps it should be documented somewhere which drivers/modules that are affected by this as well. Thank you! Regards! -- Niclas From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 12:58:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABFA41065673; Sat, 4 Feb 2012 12:58:45 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 2F3D18FC0A; Sat, 4 Feb 2012 12:58:45 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 1518E25D3888; Sat, 4 Feb 2012 12:58:43 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 1933ABDAA27; Sat, 4 Feb 2012 12:58:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id sE6Me9Ccx3cd; Sat, 4 Feb 2012 12:58:41 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 4A24ABDAA26; Sat, 4 Feb 2012 12:58:41 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <4F2CFEE3.6070306@daemonic.se> Date: Sat, 4 Feb 2012 12:58:40 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201202040054.q140siBP012241@svn.freebsd.org> <4F2CFEE3.6070306@daemonic.se> To: Robert Millan X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 12:58:45 -0000 On 4. Feb 2012, at 09:48 , Niclas Zeising wrote: > On 2012-02-04 01:54, Robert Millan wrote: >> Author: rmh >> Date: Sat Feb 4 00:54:43 2012 >> New Revision: 230972 >> URL: http://svn.freebsd.org/changeset/base/230972 >>=20 >> Log: >> Add MK_SOURCELESS build option. Setting MK_SOURCELESS to "no" will = disable >> kernel modules that include binary-only code. >>=20 >> More fine-grained control is provided via MK_SOURCELESS_HOST (for = native code >> that runs on host CPU) and MK_SOURCELESS_UCODE (for microcode). >>=20 >> Reviewed by: julian, delphij, freebsd-arch >> Approved by: kib (mentor) >> MFC after: 2 weeks >>=20 >> Added: >> head/sys/amd64/conf/WITHOUT_SOURCELESS (contents, props changed) >> head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST (contents, props = changed) >> head/sys/amd64/conf/WITHOUT_SOURCELESS_UCODE (contents, props = changed) >> head/sys/i386/conf/WITHOUT_SOURCELESS (contents, props changed) >> head/sys/i386/conf/WITHOUT_SOURCELESS_HOST (contents, props = changed) >> head/sys/i386/conf/WITHOUT_SOURCELESS_UCODE (contents, props = changed) >> head/tools/build/options/WITHOUT_SOURCELESS (contents, props = changed) >> head/tools/build/options/WITHOUT_SOURCELESS_HOST (contents, props = changed) >> head/tools/build/options/WITHOUT_SOURCELESS_UCODE (contents, props = changed) >> Modified: >> head/share/mk/bsd.own.mk >> head/sys/modules/Makefile >> head/sys/modules/drm/Makefile >> head/sys/modules/sound/driver/Makefile >> head/sys/modules/usb/Makefile >>=20 >>=20 >> Added: head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/amd64/conf/WITHOUT_SOURCELESS_HOST Sat Feb 4 = 00:54:43 2012 (r230972) >> @@ -0,0 +1,10 @@ >> +# >> +# WITHOUT_SOURCELESS_UCODE -- Disable drivers that include = sourceless > ^^^^^ > This seems like a typo. Shouldn't it read HOST instead? >> +# native code for host CPU. >> +# >> +# $FreeBSD$ >> + >> +nodevice hpt27xx >> +nodevice hptmv >> +nodevice hptrr >> +nodevice nve >>=20 >>=20 >> Added: head/sys/i386/conf/WITHOUT_SOURCELESS_HOST >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/i386/conf/WITHOUT_SOURCELESS_HOST Sat Feb 4 = 00:54:43 2012 (r230972) >> @@ -0,0 +1,10 @@ >> +# >> +# WITHOUT_SOURCELESS_UCODE -- Disable drivers that include = sourceless > ^^^^^ > Same here. >> +# native code for host CPU. >> +# >> +# $FreeBSD$ >> + >> +nodevice hpt27xx >> +nodevice hptmv >> +nodevice hptrr >> +nodevice nve >>=20 >>=20 >=20 > Also, can you please regenerate the src.conf manual page? Perhaps it > should be documented somewhere which drivers/modules that are affected > by this as well. And can you please include GENERIC at least in these kernel configs? = They are not building and this breaks a make universe and I guess = eventually the tinderbox as well... /bz --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 13:12:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8930E1065672; Sat, 4 Feb 2012 13:12:53 +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 77F898FC08; Sat, 4 Feb 2012 13:12:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14DCrjA036725; Sat, 4 Feb 2012 13:12:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14DCrIV036723; Sat, 4 Feb 2012 13:12:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202041312.q14DCrIV036723@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 4 Feb 2012 13:12: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: r230978 - head/usr.sbin/boot0cfg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 13:12:53 -0000 Author: kib Date: Sat Feb 4 13:12:52 2012 New Revision: 230978 URL: http://svn.freebsd.org/changeset/base/230978 Log: Be as explicit as possible when describing relation between the -m mask argument and slices. Adjust example for the same reason. Submitted by: Valentin Nechayev MFC after: 3 days Modified: head/usr.sbin/boot0cfg/boot0cfg.8 Modified: head/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.8 Sat Feb 4 08:03:01 2012 (r230977) +++ head/usr.sbin/boot0cfg/boot0cfg.8 Sat Feb 4 13:12:52 2012 (r230978) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2011 +.Dd February 4, 2012 .Dt BOOT0CFG 8 .Os .Sh NAME @@ -114,6 +114,9 @@ Specify slices to be enabled/disabled, w .Ar mask is an integer between 0 (no slices enabled) and 0xf (all four slices enabled). +Each mask bit enables corresponding slice if set to 1. +The least significant bit of the mask corresponds to slice 1, +the most significant bit of the mask corresponds to slice 4. .It Fl o Ar options A comma-separated string of any of the following options may be specified (with @@ -172,9 +175,9 @@ To boot slice 2 on the next boot: .Pp .Dl "boot0cfg -s 2 ad0" .Pp -To enable just slices 1 and 2 in the menu: +To enable just slices 1 and 3 in the menu: .Pp -.Dl "boot0cfg -m 0x3 ad0" +.Dl "boot0cfg -m 0x5 ad0" .Pp To go back to non-interactive booting, use .Xr fdisk 8 From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 13:37:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18542106567B; Sat, 4 Feb 2012 13:37:32 +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 EFBA58FC1B; Sat, 4 Feb 2012 13:37:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14DbVZt037488; Sat, 4 Feb 2012 13:37:31 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14DbVTn037485; Sat, 4 Feb 2012 13:37:31 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201202041337.q14DbVTn037485@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 4 Feb 2012 13:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230979 - head/usr.bin/touch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 13:37:32 -0000 Author: jh Date: Sat Feb 4 13:37:31 2012 New Revision: 230979 URL: http://svn.freebsd.org/changeset/base/230979 Log: Remove useless and potentially dangerous rw() function which tries to update access and modification times by reading and writing the file. chmod(2) in rw() doesn't help because utimes(2) allow owner and the super-user to change times. Using just utimes(2) should be sufficient. The -f option becomes no-op. Reviewed by: jilles Modified: head/usr.bin/touch/touch.1 head/usr.bin/touch/touch.c Modified: head/usr.bin/touch/touch.1 ============================================================================== --- head/usr.bin/touch/touch.1 Sat Feb 4 13:12:52 2012 (r230978) +++ head/usr.bin/touch/touch.1 Sat Feb 4 13:37:31 2012 (r230979) @@ -31,7 +31,7 @@ .\" @(#)touch.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd April 28, 1995 +.Dd February 4, 2012 .Dt TOUCH 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Sh SYNOPSIS .Nm .Op Fl A Ar [-][[hh]mm]SS -.Op Fl acfhm +.Op Fl achm .Op Fl r Ar file .Op Fl t Ar [[CC]YY]MMDDhhmm[.SS] .Ar @@ -109,9 +109,6 @@ The .Nm utility does not treat this as an error. No error messages are displayed and the exit value is not affected. -.It Fl f -Attempt to force the update, even if the file permissions do not -currently permit it. .It Fl h If the file is a symbolic link, change the times of the link itself rather than the file that the link points to. Modified: head/usr.bin/touch/touch.c ============================================================================== --- head/usr.bin/touch/touch.c Sat Feb 4 13:12:52 2012 (r230978) +++ head/usr.bin/touch/touch.c Sat Feb 4 13:37:31 2012 (r230979) @@ -55,7 +55,6 @@ static const char sccsid[] = "@(#)touch. #include #include -int rw(char *, struct stat *, int); void stime_arg1(char *, struct timeval *); void stime_arg2(char *, int, struct timeval *); void stime_file(char *, struct timeval *); @@ -69,12 +68,12 @@ main(int argc, char *argv[]) struct timeval tv[2]; int (*stat_f)(const char *, struct stat *); int (*utimes_f)(const char *, const struct timeval *); - int Aflag, aflag, cflag, fflag, mflag, ch, fd, len, rval, timeset; + int Aflag, aflag, cflag, mflag, ch, fd, len, rval, timeset; char *p; char *myname; myname = basename(argv[0]); - Aflag = aflag = cflag = fflag = mflag = timeset = 0; + Aflag = aflag = cflag = mflag = timeset = 0; stat_f = stat; utimes_f = utimes; if (gettimeofday(&tv[0], NULL)) @@ -92,7 +91,7 @@ main(int argc, char *argv[]) cflag = 1; break; case 'f': - fflag = 1; + /* No-op for compatibility. */ break; case 'h': cflag = 1; @@ -222,14 +221,8 @@ main(int argc, char *argv[]) if (!utimes_f(*argv, NULL)) continue; - /* Try reading/writing. */ - if (!S_ISLNK(sb.st_mode) && !S_ISDIR(sb.st_mode)) { - if (rw(*argv, &sb, fflag)) - rval = 1; - } else { - rval = 1; - warn("%s", *argv); - } + rval = 1; + warn("%s", *argv); } exit(rval); } @@ -368,59 +361,10 @@ stime_file(char *fname, struct timeval * TIMESPEC_TO_TIMEVAL(tvp + 1, &sb.st_mtim); } -int -rw(char *fname, struct stat *sbp, int force) -{ - int fd, needed_chmod, rval; - u_char byte; - - /* Try regular files. */ - if (!S_ISREG(sbp->st_mode)) { - warnx("%s: %s", fname, strerror(EFTYPE)); - return (1); - } - - needed_chmod = rval = 0; - if ((fd = open(fname, O_RDWR, 0)) == -1) { - if (!force || chmod(fname, DEFFILEMODE)) - goto err; - if ((fd = open(fname, O_RDWR, 0)) == -1) - goto err; - needed_chmod = 1; - } - - if (sbp->st_size != 0) { - if (read(fd, &byte, sizeof(byte)) != sizeof(byte)) - goto err; - if (lseek(fd, (off_t)0, SEEK_SET) == -1) - goto err; - if (write(fd, &byte, sizeof(byte)) != sizeof(byte)) - goto err; - } else { - if (write(fd, &byte, sizeof(byte)) != sizeof(byte)) { -err: rval = 1; - warn("%s", fname); - } else if (ftruncate(fd, (off_t)0)) { - rval = 1; - warn("%s: file modified", fname); - } - } - - if (close(fd) && rval != 1) { - rval = 1; - warn("%s", fname); - } - if (needed_chmod && chmod(fname, sbp->st_mode) && rval != 1) { - rval = 1; - warn("%s: permissions modified", fname); - } - return (rval); -} - void usage(char *myname) { - fprintf(stderr, "usage:\n" "%s [-A [-][[hh]mm]SS] [-acfhm] [-r file] " + fprintf(stderr, "usage:\n" "%s [-A [-][[hh]mm]SS] [-achm] [-r file] " "[-t [[CC]YY]MMDDhhmm[.SS]] file ...\n", myname); exit(1); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 13:45:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53B0B1065674; Sat, 4 Feb 2012 13:45:40 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42B598FC18; Sat, 4 Feb 2012 13:45:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14DjeR1037770; Sat, 4 Feb 2012 13:45:40 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14DjeQ7037767; Sat, 4 Feb 2012 13:45:40 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201202041345.q14DjeQ7037767@svn.freebsd.org> From: Robert Millan Date: Sat, 4 Feb 2012 13:45: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: r230980 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 13:45:40 -0000 Author: rmh Date: Sat Feb 4 13:45:39 2012 New Revision: 230980 URL: http://svn.freebsd.org/changeset/base/230980 Log: Add "nodevice adw" to WITHOUT_SOURCELESS_UCODE. Approved by: kib (mentor) MFC after: 13 days Modified: head/sys/amd64/conf/WITHOUT_SOURCELESS_UCODE head/sys/i386/conf/WITHOUT_SOURCELESS_UCODE Modified: head/sys/amd64/conf/WITHOUT_SOURCELESS_UCODE ============================================================================== --- head/sys/amd64/conf/WITHOUT_SOURCELESS_UCODE Sat Feb 4 13:37:31 2012 (r230979) +++ head/sys/amd64/conf/WITHOUT_SOURCELESS_UCODE Sat Feb 4 13:45:39 2012 (r230980) @@ -4,6 +4,7 @@ # # $FreeBSD$ +nodevice adw nodevice bce nodevice fatm nodevice fxp Modified: head/sys/i386/conf/WITHOUT_SOURCELESS_UCODE ============================================================================== --- head/sys/i386/conf/WITHOUT_SOURCELESS_UCODE Sat Feb 4 13:37:31 2012 (r230979) +++ head/sys/i386/conf/WITHOUT_SOURCELESS_UCODE Sat Feb 4 13:45:39 2012 (r230980) @@ -4,6 +4,7 @@ # # $FreeBSD$ +nodevice adw nodevice bce nodevice fatm nodevice fxp From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 15:00:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05122106564A; Sat, 4 Feb 2012 15:00:27 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3C498FC0C; Sat, 4 Feb 2012 15:00:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14F0QRi040108; Sat, 4 Feb 2012 15:00:26 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14F0Q7M040106; Sat, 4 Feb 2012 15:00:26 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201202041500.q14F0Q7M040106@svn.freebsd.org> From: Hiroki Sato Date: Sat, 4 Feb 2012 15:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230981 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 15:00:27 -0000 Author: hrs Date: Sat Feb 4 15:00:26 2012 New Revision: 230981 URL: http://svn.freebsd.org/changeset/base/230981 Log: Fix input validation in SO_SETFIB. Reviewed by: bz MFC after: 1 day Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sat Feb 4 13:45:39 2012 (r230980) +++ head/sys/kern/uipc_socket.c Sat Feb 4 15:00:26 2012 (r230981) @@ -2498,7 +2498,7 @@ sosetopt(struct socket *so, struct socko case SO_SETFIB: error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); - if (optval < 0 || optval > rt_numfibs) { + if (optval < 0 || optval >= rt_numfibs) { error = EINVAL; goto bad; } From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 15:42:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B2201065672; Sat, 4 Feb 2012 15:42:08 +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 055278FC14; Sat, 4 Feb 2012 15:42:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14Fg78O041375; Sat, 4 Feb 2012 15:42:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14Fg7gh041373; Sat, 4 Feb 2012 15:42:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202041542.q14Fg7gh041373@svn.freebsd.org> From: Alexander Motin Date: Sat, 4 Feb 2012 15:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230982 - stable/9/usr.sbin/mixer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 15:42:08 -0000 Author: mav Date: Sat Feb 4 15:42:07 2012 New Revision: 230982 URL: http://svn.freebsd.org/changeset/base/230982 Log: MFC r230611: Return proper error message if recording device is not specified. Modified: stable/9/usr.sbin/mixer/mixer.c Directory Properties: stable/9/usr.sbin/mixer/ (props changed) Modified: stable/9/usr.sbin/mixer/mixer.c ============================================================================== --- stable/9/usr.sbin/mixer/mixer.c Sat Feb 4 15:00:26 2012 (r230981) +++ stable/9/usr.sbin/mixer/mixer.c Sat Feb 4 15:42:07 2012 (r230982) @@ -193,13 +193,18 @@ main(int argc, char *argv[]) argc--; argv++; continue; - } else if (argc > 1 && strcmp("rec", *argv + 1) == 0) { + } else if (strcmp("rec", *argv + 1) == 0) { if (**argv != '+' && **argv != '-' && **argv != '=' && **argv != '^') { warnx("unknown modifier: %c", **argv); dusage = 1; break; } + if (argc <= 1) { + warnx("no recording device specified"); + dusage = 1; + break; + } if ((dev = res_name(argv[1], recmask)) == -1) { warnx("unknown recording device: %s", argv[1]); dusage = 1; From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 15:43:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1270106564A; Sat, 4 Feb 2012 15:43:16 +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 8BEB38FC1D; Sat, 4 Feb 2012 15:43:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14FhGQ6041465; Sat, 4 Feb 2012 15:43:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14FhG8n041463; Sat, 4 Feb 2012 15:43:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202041543.q14FhG8n041463@svn.freebsd.org> From: Alexander Motin Date: Sat, 4 Feb 2012 15:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230983 - stable/8/usr.sbin/mixer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 15:43:16 -0000 Author: mav Date: Sat Feb 4 15:43:16 2012 New Revision: 230983 URL: http://svn.freebsd.org/changeset/base/230983 Log: MFC r230611: Return proper error message if recording device is not specified. Modified: stable/8/usr.sbin/mixer/mixer.c Directory Properties: stable/8/usr.sbin/mixer/ (props changed) Modified: stable/8/usr.sbin/mixer/mixer.c ============================================================================== --- stable/8/usr.sbin/mixer/mixer.c Sat Feb 4 15:42:07 2012 (r230982) +++ stable/8/usr.sbin/mixer/mixer.c Sat Feb 4 15:43:16 2012 (r230983) @@ -193,13 +193,18 @@ main(int argc, char *argv[]) argc--; argv++; continue; - } else if (argc > 1 && strcmp("rec", *argv + 1) == 0) { + } else if (strcmp("rec", *argv + 1) == 0) { if (**argv != '+' && **argv != '-' && **argv != '=' && **argv != '^') { warnx("unknown modifier: %c", **argv); dusage = 1; break; } + if (argc <= 1) { + warnx("no recording device specified"); + dusage = 1; + break; + } if ((dev = res_name(argv[1], recmask)) == -1) { warnx("unknown recording device: %s", argv[1]); dusage = 1; From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 16:49:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AE2310656E8; Sat, 4 Feb 2012 16:49:30 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44F268FC13; Sat, 4 Feb 2012 16:49:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14GnU7d043574; Sat, 4 Feb 2012 16:49:30 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14GnUnI043572; Sat, 4 Feb 2012 16:49:30 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201202041649.q14GnUnI043572@svn.freebsd.org> From: Ryan Stone Date: Sat, 4 Feb 2012 16:49: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: r230984 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 16:49:30 -0000 Author: rstone Date: Sat Feb 4 16:49:29 2012 New Revision: 230984 URL: http://svn.freebsd.org/changeset/base/230984 Log: Whenever a new kernel thread is spawned, explicitly clear any CPU affinity set on the new thread. This prevents the thread from inadvertently inheriting affinity from a random sibling. Submitted by: attilio Tested by: pho MFC after: 1 week Modified: head/sys/kern/kern_kthread.c Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Sat Feb 4 15:43:16 2012 (r230983) +++ head/sys/kern/kern_kthread.c Sat Feb 4 16:49:29 2012 (r230984) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -117,6 +118,9 @@ kproc_create(void (*func)(void *), void /* call the processes' main()... */ cpu_set_fork_handler(td, func, arg); + + /* Avoid inheriting affinity from a random parent. */ + cpuset_setthread(td->td_tid, cpuset_root); thread_lock(td); TD_SET_CAN_RUN(td); sched_prio(td, PVM); @@ -299,6 +303,9 @@ kthread_add(void (*func)(void *), void * tidhash_add(newtd); + /* Avoid inheriting affinity from a random parent. */ + cpuset_setthread(newtd->td_tid, cpuset_root); + /* Delay putting it on the run queue until now. */ if (!(flags & RFSTOPPED)) { thread_lock(newtd); From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 16:49:51 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6B6B1065670; Sat, 4 Feb 2012 16:49:51 +0000 (UTC) (envelope-from ghelmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id 84FDE8FC1E; Sat, 4 Feb 2012 16:49:51 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q14GX3Qw006554; Sat, 4 Feb 2012 10:33:03 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) Received: from [192.168.0.105] (173-20-105-176.client.mchsi.com [173.20.105.176]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q14GWvMQ039812 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 4 Feb 2012 10:32:58 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q14GWvMQ039812 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1328373179; bh=bXsZ/MFuiKbuNYyam8ofbrI4y1AqUXXB+1TNZD3Zk7I=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=nG2hinsySkcmS9+R3wxTrtu51NVoIXIWkU+TAgQ6ohOS44QY7zI3hW+yJFhy7pbz+ QWNGic4/tni2gkexco+UVhZseJ0Xx4PXNi57QNOc2ZmSx6ICkzqRg2s+sfzVblEl8t zPRzFKceNCttrGGpFUkMSXZluwXKjb7tZnyflj5M= Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <20120204074201.GA1694@garage.freebsd.pl> Date: Sat, 4 Feb 2012 10:32:56 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1257) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Sat, 04 Feb 2012 10:32:59 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q14GWvMQ039812 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.406, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, RP_8BIT 1.49) X-Palisade-MailScanner-From: ghelmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 16:49:51 -0000 On Feb 4, 2012, at 1:42 AM, Pawel Jakub Dawidek wrote: > On Wed, Feb 01, 2012 at 04:41:00PM +0000, Guy Helmer wrote: >> Author: ghelmer >> Date: Wed Feb 1 16:40:59 2012 >> New Revision: 230869 >> URL: http://svn.freebsd.org/changeset/base/230869 >>=20 >> Log: >> Change the notes about the pidfile to include Doug's preference >> for pre-creating the pidfile with appropriate owner and permissions. >>=20 >> Requested by dougb >=20 > Pre-creating pidfiles? That sounds weird. The common practise is to = turn > eg. /var/run/.pid into /var/run//pid where = directory > has appropriate permissions. Pre-creating pidfiles is simply wrong, > because applications create pidfile on start and unlink it on exit. > If application has no permission to remove files from /var/run/ it = will > leave pidfile with stale PID in it, which is bad. Changing application > to truncate pidfile on exit instead of unlinking it also is a bad idea > especially because there is working solution - pid directory. I prefer this approach, but dougb prefers the other approach. Each has = positives and negatives. I tried to accommodate both approaches. Guy= -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 16:49:52 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 685021065672; Sat, 4 Feb 2012 16:49:52 +0000 (UTC) (envelope-from ghelmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id 155948FC13; Sat, 4 Feb 2012 16:49:52 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q14GU8C6006439; Sat, 4 Feb 2012 10:30:08 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) Received: from [192.168.0.105] (173-20-105-176.client.mchsi.com [173.20.105.176]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q14GU2sX039755 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 4 Feb 2012 10:30:03 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q14GU2sX039755 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1328373004; bh=fkoe7qod3F7agxp9ot7ofzP3aSG4lHkYbgfbsG3Q2dk=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=pCN6Ch51tTU57fagVhO+MwFW+KJg2GK0xJEATAZsOOfeodrgU6pcpHxpqPqEtN0uX 8BEZO7hR3Zo1+VP0Ovn4QUqzhV7PC/SsVQhabzpOaPOg/Z4RpZgfFpvNDLC5Dpbmzw XgwKdxuWWoLtbDjZ2CJzgaR+01zdtOghL1r6G/os= Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=iso-8859-1 From: Guy Helmer In-Reply-To: <4F2CEB1D.10607@zonov.org> Date: Sat, 4 Feb 2012 10:30:00 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> To: Andrey Zonov X-Mailer: Apple Mail (2.1257) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Sat, 04 Feb 2012 10:30:04 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q14GU2sX039755 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.406, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, RP_8BIT 1.49) X-Palisade-MailScanner-From: ghelmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 16:49:52 -0000 On Feb 4, 2012, at 2:23 AM, Andrey Zonov wrote: > On 04.02.2012 11:42, Pawel Jakub Dawidek wrote: >> On Wed, Feb 01, 2012 at 04:41:00PM +0000, Guy Helmer wrote: >>> Author: ghelmer >>> Date: Wed Feb 1 16:40:59 2012 >>> New Revision: 230869 >>> URL: http://svn.freebsd.org/changeset/base/230869 >>>=20 >>> Log: >>> Change the notes about the pidfile to include Doug's preference >>> for pre-creating the pidfile with appropriate owner and = permissions. >>>=20 >>> Requested by dougb >>=20 >> Pre-creating pidfiles? That sounds weird. The common practise is to = turn >> eg. /var/run/.pid into /var/run//pid where = directory >> has appropriate permissions. Pre-creating pidfiles is simply wrong, >> because applications create pidfile on start and unlink it on exit. >> If application has no permission to remove files from /var/run/ it = will >> leave pidfile with stale PID in it, which is bad. Changing = application >> to truncate pidfile on exit instead of unlinking it also is a bad = idea >> especially because there is working solution - pid directory. >>=20 >=20 > Hi, >=20 > There's even worse problem - kernel closes pidfile in execvp() because = of FD_CLOEXEC flag is set and daemon doesn't hold lock on pidfile. >=20 > I reported about that earlier, but was ignored. I don't understand your concern about this -- the daemon(8) program = exists to start a program that does not manage its own user authority or = pid file, and it is inappropriate to leak the open pidfile descriptor to = the program that daemon(8) execs. Guy= -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 17:13:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88ABE1065780; Sat, 4 Feb 2012 17:13:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E25C8FC17; Sat, 4 Feb 2012 17:13:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14HDZMo044357; Sat, 4 Feb 2012 17:13:35 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14HDYbA044352; Sat, 4 Feb 2012 17:13:34 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202041713.q14HDYbA044352@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 4 Feb 2012 17:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230985 - in stable/9/sys: conf dev/sound/pci gnu/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 17:13:35 -0000 Author: pfg Date: Sat Feb 4 17:13:34 2012 New Revision: 230985 URL: http://svn.freebsd.org/changeset/base/230985 Log: MFC: r230401, r230898 Replace GPLd headers from the Maestro3 driver with BSD licensed versions derived from /usr/ports/audio/oss. The particular headers used were taken from the attic/drv/oss_allegro directory and are mostly identical to the previous files. The Maestro3 driver is now free from the GPL. NOTE: due to lack of testers this driver is being considered for deprecation and removal, however the MFC still makes sense instead of distribution a GPL'd firmware without source code. PR: kern/153920 Approved by: jhb (mentor) Added: stable/9/sys/dev/sound/pci/allegro_code.h - copied unchanged from r230401, head/sys/dev/sound/pci/allegro_code.h stable/9/sys/dev/sound/pci/allegro_reg.h - copied unchanged from r230401, head/sys/dev/sound/pci/allegro_reg.h Deleted: stable/9/sys/gnu/dev/sound/pci/maestro3_dsp.h stable/9/sys/gnu/dev/sound/pci/maestro3_reg.h Modified: stable/9/sys/conf/files stable/9/sys/dev/sound/pci/maestro3.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/modules/sound/driver/maestro3/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Sat Feb 4 16:49:29 2012 (r230984) +++ stable/9/sys/conf/files Sat Feb 4 17:13:34 2012 (r230985) @@ -1722,8 +1722,7 @@ dev/sound/pci/es137x.c optional snd_es1 dev/sound/pci/fm801.c optional snd_fm801 pci dev/sound/pci/ich.c optional snd_ich pci dev/sound/pci/maestro.c optional snd_maestro pci -dev/sound/pci/maestro3.c optional snd_maestro3 pci \ - warning "kernel contains GPL contaminated maestro3 headers" +dev/sound/pci/maestro3.c optional snd_maestro3 pci dev/sound/pci/neomagic.c optional snd_neomagic pci dev/sound/pci/solo.c optional snd_solo pci dev/sound/pci/spicds.c optional snd_spicds pci Copied: stable/9/sys/dev/sound/pci/allegro_code.h (from r230401, head/sys/dev/sound/pci/allegro_code.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/sound/pci/allegro_code.h Sat Feb 4 17:13:34 2012 (r230985, copy of r230401, head/sys/dev/sound/pci/allegro_code.h) @@ -0,0 +1,218 @@ +/* $FreeBSD$ */ +/*- + * Copyright (C) 1996-2008, 4Front Technologies + * Copyright (C) 1997-1999 ESS Technology, Inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/*--------------------------------------------------------------------------- + * This source code, its compiled object code, and its associated data sets + * are copyright (C) 1997-1999 ESS Technology, Inc. This source code and its + * associated data sets are trade secrets of ESS Technology, Inc. + *--------------------------------------------------------------------------- + * DESCRIPTION: DSP binaries + *--------------------------------------------------------------------------- + * AUTHOR: Henry Tang / Hong Kim / Alger Yeung/Don Kim + *--------------------------------------------------------------------------- + * For practical purposes we only include what is necessary for current + * Maestro3 driver. Files used in this header include: + * kernel.dat + * 400m_src.dat + * mini_src_lpf from srcmgr.h + *--------------------------------------------------------------------------- + */ +#ifndef _DEV_SOUND_PCI_ALLEGRO_CODE_H +#define _DEV_SOUND_PCI_ALLEGRO_CODE_H + +/* + * Kernel + */ + +uint16_t gaw_kernel_vect_code[] = { + 0x7980, 0x0030, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x00FB, 0x7980, + 0x00DD, 0x7980, 0x03B4, 0x7980, 0x0332, 0x7980, 0x0287, 0x7980, 0x03B4, + 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x031A, 0x7980, + 0x03B4, 0x7980, 0x022F, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x03B4, + 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x0063, 0x7980, 0x006B, 0x7980, + 0x03B4, 0x7980, 0x03B4, 0xBF80, 0x2C7C, 0x8806, 0x8804, 0xBE40, 0xBC20, + 0xAE09, 0x1000, 0xAE0A, 0x0001, 0x6938, 0xEB08, 0x0053, 0x695A, 0xEB08, + 0x00D6, 0x0009, 0x8B88, 0x6980, 0xE388, 0x0036, 0xBE30, 0xBC20, 0x6909, + 0xB801, 0x9009, 0xBE41, 0xBE41, 0x6928, 0xEB88, 0x0078, 0xBE41, 0xBE40, + 0x7980, 0x0038, 0xBE41, 0xBE41, 0x903A, 0x6938, 0xE308, 0x0056, 0x903A, + 0xBE41, 0xBE40, 0xEF00, 0x903A, 0x6939, 0xE308, 0x005E, 0x903A, 0xEF00, + 0x690B, 0x660C, 0xEF8C, 0x690A, 0x660C, 0x620B, 0x6609, 0xEF00, 0x6910, + 0x660F, 0xEF04, 0xE388, 0x0075, 0x690E, 0x660F, 0x6210, 0x660D, 0xEF00, + 0x690E, 0x660D, 0xEF00, 0xAE70, 0x0001, 0xBC20, 0xAE27, 0x0001, 0x6939, + 0xEB08, 0x005D, 0x6926, 0xB801, 0x9026, 0x0026, 0x8B88, 0x6980, 0xE388, + 0x00CB, 0x9028, 0x0D28, 0x4211, 0xE100, 0x007A, 0x4711, 0xE100, 0x00A0, + 0x7A80, 0x0063, 0xB811, 0x660A, 0x6209, 0xE304, 0x007A, 0x0C0B, 0x4005, + 0x100A, 0xBA01, 0x9012, 0x0C12, 0x4002, 0x7980, 0x00AF, 0x7A80, 0x006B, + 0xBE02, 0x620E, 0x660D, 0xBA10, 0xE344, 0x007A, 0x0C10, 0x4005, 0x100E, + 0xBA01, 0x9012, 0x0C12, 0x4002, 0x1003, 0xBA02, 0x9012, 0x0C12, 0x4000, + 0x1003, 0xE388, 0x00BA, 0x1004, 0x7980, 0x00BC, 0x1004, 0xBA01, 0x9012, + 0x0C12, 0x4001, 0x0C05, 0x4003, 0x0C06, 0x4004, 0x1011, 0xBFB0, 0x01FF, + 0x9012, 0x0C12, 0x4006, 0xBC20, 0xEF00, 0xAE26, 0x1028, 0x6970, 0xBFD0, + 0x0001, 0x9070, 0xE388, 0x007A, 0xAE28, 0x0000, 0xEF00, 0xAE70, 0x0300, + 0x0C70, 0xB00C, 0xAE5A, 0x0000, 0xEF00, 0x7A80, 0x038A, 0x697F, 0xB801, + 0x907F, 0x0056, 0x8B88, 0x0CA0, 0xB008, 0xAF71, 0xB000, 0x4E71, 0xE200, + 0x00F3, 0xAE56, 0x1057, 0x0056, 0x0CA0, 0xB008, 0x8056, 0x7980, 0x03A1, + 0x0810, 0xBFA0, 0x1059, 0xE304, 0x03A1, 0x8056, 0x7980, 0x03A1, 0x7A80, + 0x038A, 0xBF01, 0xBE43, 0xBE59, 0x907C, 0x6937, 0xE388, 0x010D, 0xBA01, + 0xE308, 0x010C, 0xAE71, 0x0004, 0x0C71, 0x5000, 0x6936, 0x9037, 0xBF0A, + 0x109E, 0x8B8A, 0xAF80, 0x8014, 0x4C80, 0xBF0A, 0x0560, 0xF500, 0xBF0A, + 0x0520, 0xB900, 0xBB17, 0x90A0, 0x6917, 0xE388, 0x0148, 0x0D17, 0xE100, + 0x0127, 0xBF0C, 0x0578, 0xBF0D, 0x057C, 0x7980, 0x012B, 0xBF0C, 0x0538, + 0xBF0D, 0x053C, 0x6900, 0xE308, 0x0135, 0x8B8C, 0xBE59, 0xBB07, 0x90A0, + 0xBC20, 0x7980, 0x0157, 0x030C, 0x8B8B, 0xB903, 0x8809, 0xBEC6, 0x013E, + 0x69AC, 0x90AB, 0x69AD, 0x90AB, 0x0813, 0x660A, 0xE344, 0x0144, 0x0309, + 0x830C, 0xBC20, 0x7980, 0x0157, 0x6955, 0xE388, 0x0157, 0x7C38, 0xBF0B, + 0x0578, 0xF500, 0xBF0B, 0x0538, 0xB907, 0x8809, 0xBEC6, 0x0156, 0x10AB, + 0x90AA, 0x6974, 0xE388, 0x0163, 0xAE72, 0x0540, 0xF500, 0xAE72, 0x0500, + 0xAE61, 0x103B, 0x7A80, 0x02F6, 0x6978, 0xE388, 0x0182, 0x8B8C, 0xBF0C, + 0x0560, 0xE500, 0x7C40, 0x0814, 0xBA20, 0x8812, 0x733D, 0x7A80, 0x0380, + 0x733E, 0x7A80, 0x0380, 0x8B8C, 0xBF0C, 0x056C, 0xE500, 0x7C40, 0x0814, + 0xBA2C, 0x8812, 0x733F, 0x7A80, 0x0380, 0x7340, 0x7A80, 0x0380, 0x6975, + 0xE388, 0x018E, 0xAE72, 0x0548, 0xF500, 0xAE72, 0x0508, 0xAE61, 0x1041, + 0x7A80, 0x02F6, 0x6979, 0xE388, 0x01AD, 0x8B8C, 0xBF0C, 0x0560, 0xE500, + 0x7C40, 0x0814, 0xBA18, 0x8812, 0x7343, 0x7A80, 0x0380, 0x7344, 0x7A80, + 0x0380, 0x8B8C, 0xBF0C, 0x056C, 0xE500, 0x7C40, 0x0814, 0xBA24, 0x8812, + 0x7345, 0x7A80, 0x0380, 0x7346, 0x7A80, 0x0380, 0x6976, 0xE388, 0x01B9, + 0xAE72, 0x0558, 0xF500, 0xAE72, 0x0518, 0xAE61, 0x1047, 0x7A80, 0x02F6, + 0x697A, 0xE388, 0x01D8, 0x8B8C, 0xBF0C, 0x0560, 0xE500, 0x7C40, 0x0814, + 0xBA08, 0x8812, 0x7349, 0x7A80, 0x0380, 0x734A, 0x7A80, 0x0380, 0x8B8C, + 0xBF0C, 0x056C, 0xE500, 0x7C40, 0x0814, 0xBA14, 0x8812, 0x734B, 0x7A80, + 0x0380, 0x734C, 0x7A80, 0x0380, 0xBC21, 0xAE1C, 0x1090, 0x8B8A, 0xBF0A, + 0x0560, 0xE500, 0x7C40, 0x0812, 0xB804, 0x8813, 0x8B8D, 0xBF0D, 0x056C, + 0xE500, 0x7C40, 0x0815, 0xB804, 0x8811, 0x7A80, 0x034A, 0x8B8A, 0xBF0A, + 0x0560, 0xE500, 0x7C40, 0x731F, 0xB903, 0x8809, 0xBEC6, 0x01F9, 0x548A, + 0xBE03, 0x98A0, 0x7320, 0xB903, 0x8809, 0xBEC6, 0x0201, 0x548A, 0xBE03, + 0x98A0, 0x1F20, 0x2F1F, 0x9826, 0xBC20, 0x6935, 0xE388, 0x03A1, 0x6933, + 0xB801, 0x9033, 0xBFA0, 0x02EE, 0xE308, 0x03A1, 0x9033, 0xBF00, 0x6951, + 0xE388, 0x021F, 0x7334, 0xBE80, 0x5760, 0xBE03, 0x9F7E, 0xBE59, 0x9034, + 0x697E, 0x0D51, 0x9013, 0xBC20, 0x695C, 0xE388, 0x03A1, 0x735E, 0xBE80, + 0x5760, 0xBE03, 0x9F7E, 0xBE59, 0x905E, 0x697E, 0x0D5C, 0x9013, 0x7980, + 0x03A1, 0x7A80, 0x038A, 0xBF01, 0xBE43, 0x6977, 0xE388, 0x024E, 0xAE61, + 0x104D, 0x0061, 0x8B88, 0x6980, 0xE388, 0x024E, 0x9071, 0x0D71, 0x000B, + 0xAFA0, 0x8010, 0xAFA0, 0x8010, 0x0810, 0x660A, 0xE308, 0x0249, 0x0009, + 0x0810, 0x660C, 0xE388, 0x024E, 0x800B, 0xBC20, 0x697B, 0xE388, 0x03A1, + 0xBF0A, 0x109E, 0x8B8A, 0xAF80, 0x8014, 0x4C80, 0xE100, 0x0266, 0x697C, + 0xBF90, 0x0560, 0x9072, 0x0372, 0x697C, 0xBF90, 0x0564, 0x9073, 0x0473, + 0x7980, 0x0270, 0x697C, 0xBF90, 0x0520, 0x9072, 0x0372, 0x697C, 0xBF90, + 0x0524, 0x9073, 0x0473, 0x697C, 0xB801, 0x907C, 0xBF0A, 0x10FD, 0x8B8A, + 0xAF80, 0x8010, 0x734F, 0x548A, 0xBE03, 0x9880, 0xBC21, 0x7326, 0x548B, + 0xBE03, 0x618B, 0x988C, 0xBE03, 0x6180, 0x9880, 0x7980, 0x03A1, 0x7A80, + 0x038A, 0x0D28, 0x4711, 0xE100, 0x02BE, 0xAF12, 0x4006, 0x6912, 0xBFB0, + 0x0C00, 0xE388, 0x02B6, 0xBFA0, 0x0800, 0xE388, 0x02B2, 0x6912, 0xBFB0, + 0x0C00, 0xBFA0, 0x0400, 0xE388, 0x02A3, 0x6909, 0x900B, 0x7980, 0x02A5, + 0xAF0B, 0x4005, 0x6901, 0x9005, 0x6902, 0x9006, 0x4311, 0xE100, 0x02ED, + 0x6911, 0xBFC0, 0x2000, 0x9011, 0x7980, 0x02ED, 0x6909, 0x900B, 0x7980, + 0x02B8, 0xAF0B, 0x4005, 0xAF05, 0x4003, 0xAF06, 0x4004, 0x7980, 0x02ED, + 0xAF12, 0x4006, 0x6912, 0xBFB0, 0x0C00, 0xE388, 0x02E7, 0xBFA0, 0x0800, + 0xE388, 0x02E3, 0x6912, 0xBFB0, 0x0C00, 0xBFA0, 0x0400, 0xE388, 0x02D4, + 0x690D, 0x9010, 0x7980, 0x02D6, 0xAF10, 0x4005, 0x6901, 0x9005, 0x6902, + 0x9006, 0x4311, 0xE100, 0x02ED, 0x6911, 0xBFC0, 0x2000, 0x9011, 0x7980, + 0x02ED, 0x690D, 0x9010, 0x7980, 0x02E9, 0xAF10, 0x4005, 0xAF05, 0x4003, + 0xAF06, 0x4004, 0xBC20, 0x6970, 0x9071, 0x7A80, 0x0078, 0x6971, 0x9070, + 0x7980, 0x03A1, 0xBC20, 0x0361, 0x8B8B, 0x6980, 0xEF88, 0x0272, 0x0372, + 0x7804, 0x9071, 0x0D71, 0x8B8A, 0x000B, 0xB903, 0x8809, 0xBEC6, 0x0309, + 0x69A8, 0x90AB, 0x69A8, 0x90AA, 0x0810, 0x660A, 0xE344, 0x030F, 0x0009, + 0x0810, 0x660C, 0xE388, 0x0314, 0x800B, 0xBC20, 0x6961, 0xB801, 0x9061, + 0x7980, 0x02F7, 0x7A80, 0x038A, 0x5D35, 0x0001, 0x6934, 0xB801, 0x9034, + 0xBF0A, 0x109E, 0x8B8A, 0xAF80, 0x8014, 0x4880, 0xAE72, 0x0550, 0xF500, + 0xAE72, 0x0510, 0xAE61, 0x1051, 0x7A80, 0x02F6, 0x7980, 0x03A1, 0x7A80, + 0x038A, 0x5D35, 0x0002, 0x695E, 0xB801, 0x905E, 0xBF0A, 0x109E, 0x8B8A, + 0xAF80, 0x8014, 0x4780, 0xAE72, 0x0558, 0xF500, 0xAE72, 0x0518, 0xAE61, + 0x105C, 0x7A80, 0x02F6, 0x7980, 0x03A1, 0x001C, 0x8B88, 0x6980, 0xEF88, + 0x901D, 0x0D1D, 0x100F, 0x6610, 0xE38C, 0x0358, 0x690E, 0x6610, 0x620F, + 0x660D, 0xBA0F, 0xE301, 0x037A, 0x0410, 0x8B8A, 0xB903, 0x8809, 0xBEC6, + 0x036C, 0x6A8C, 0x61AA, 0x98AB, 0x6A8C, 0x61AB, 0x98AD, 0x6A8C, 0x61AD, + 0x98A9, 0x6A8C, 0x61A9, 0x98AA, 0x7C04, 0x8B8B, 0x7C04, 0x8B8D, 0x7C04, + 0x8B89, 0x7C04, 0x0814, 0x660E, 0xE308, 0x0379, 0x040D, 0x8410, 0xBC21, + 0x691C, 0xB801, 0x901C, 0x7980, 0x034A, 0xB903, 0x8809, 0x8B8A, 0xBEC6, + 0x0388, 0x54AC, 0xBE03, 0x618C, 0x98AA, 0xEF00, 0xBC20, 0xBE46, 0x0809, + 0x906B, 0x080A, 0x906C, 0x080B, 0x906D, 0x081A, 0x9062, 0x081B, 0x9063, + 0x081E, 0x9064, 0xBE59, 0x881E, 0x8065, 0x8166, 0x8267, 0x8368, 0x8469, + 0x856A, 0xEF00, 0xBC20, 0x696B, 0x8809, 0x696C, 0x880A, 0x696D, 0x880B, + 0x6962, 0x881A, 0x6963, 0x881B, 0x6964, 0x881E, 0x0065, 0x0166, 0x0267, + 0x0368, 0x0469, 0x056A, 0xBE3A, +}; + +/* + * MINI Sample Rate Conversion + */ + +uint16_t gaw_minisrc_code_0400[] = { + 0xBF80, 0x101E, 0x906E, 0x006E, 0x8B88, 0x6980, 0xEF88, 0x906F, 0x0D6F, + 0x6900, 0xEB08, 0x0412, 0xBC20, 0x696E, 0xB801, 0x906E, 0x7980, 0x0403, + 0xB90E, 0x8807, 0xBE43, 0xBF01, 0xBE47, 0xBE41, 0x7A80, 0x002A, 0xBE40, + 0x3029, 0xEFCC, 0xBE41, 0x7A80, 0x0028, 0xBE40, 0x3028, 0xEFCC, 0x6907, + 0xE308, 0x042A, 0x6909, 0x902C, 0x7980, 0x042C, 0x690D, 0x902C, 0x1009, + 0x881A, 0x100A, 0xBA01, 0x881B, 0x100D, 0x881C, 0x100E, 0xBA01, 0x881D, + 0xBF80, 0x00ED, 0x881E, 0x050C, 0x0124, 0xB904, 0x9027, 0x6918, 0xE308, + 0x04B3, 0x902D, 0x6913, 0xBFA0, 0x7598, 0xF704, 0xAE2D, 0x00FF, 0x8B8D, + 0x6919, 0xE308, 0x0463, 0x691A, 0xE308, 0x0456, 0xB907, 0x8809, 0xBEC6, + 0x0453, 0x10A9, 0x90AD, 0x7980, 0x047C, 0xB903, 0x8809, 0xBEC6, 0x0460, + 0x1889, 0x6C22, 0x90AD, 0x10A9, 0x6E23, 0x6C22, 0x90AD, 0x7980, 0x047C, + 0x101A, 0xE308, 0x046F, 0xB903, 0x8809, 0xBEC6, 0x046C, 0x10A9, 0x90A0, + 0x90AD, 0x7980, 0x047C, 0xB901, 0x8809, 0xBEC6, 0x047B, 0x1889, 0x6C22, + 0x90A0, 0x90AD, 0x10A9, 0x6E23, 0x6C22, 0x90A0, 0x90AD, 0x692D, 0xE308, + 0x049C, 0x0124, 0xB703, 0xB902, 0x8818, 0x8B89, 0x022C, 0x108A, 0x7C04, + 0x90A0, 0x692B, 0x881F, 0x7E80, 0x055B, 0x692A, 0x8809, 0x8B89, 0x99A0, + 0x108A, 0x90A0, 0x692B, 0x881F, 0x7E80, 0x055B, 0x692A, 0x8809, 0x8B89, + 0x99AF, 0x7B99, 0x0484, 0x0124, 0x060F, 0x101B, 0x2013, 0x901B, 0xBFA0, + 0x7FFF, 0xE344, 0x04AC, 0x901B, 0x8B89, 0x7A80, 0x051A, 0x6927, 0xBA01, + 0x9027, 0x7A80, 0x0523, 0x6927, 0xE308, 0x049E, 0x7980, 0x050F, 0x0624, + 0x1026, 0x2013, 0x9026, 0xBFA0, 0x7FFF, 0xE304, 0x04C0, 0x8B8D, 0x7A80, + 0x051A, 0x7980, 0x04B4, 0x9026, 0x1013, 0x3026, 0x901B, 0x8B8D, 0x7A80, + 0x051A, 0x7A80, 0x0523, 0x1027, 0xBA01, 0x9027, 0xE308, 0x04B4, 0x0124, + 0x060F, 0x8B89, 0x691A, 0xE308, 0x04EA, 0x6919, 0xE388, 0x04E0, 0xB903, + 0x8809, 0xBEC6, 0x04DD, 0x1FA0, 0x2FAE, 0x98A9, 0x7980, 0x050F, 0xB901, + 0x8818, 0xB907, 0x8809, 0xBEC6, 0x04E7, 0x10EE, 0x90A9, 0x7980, 0x050F, + 0x6919, 0xE308, 0x04FE, 0xB903, 0x8809, 0xBE46, 0xBEC6, 0x04FA, 0x17A0, + 0xBE1E, 0x1FAE, 0xBFBF, 0xFF00, 0xBE13, 0xBFDF, 0x8080, 0x99A9, 0xBE47, + 0x7980, 0x050F, 0xB901, 0x8809, 0xBEC6, 0x050E, 0x16A0, 0x26A0, 0xBFB7, + 0xFF00, 0xBE1E, 0x1EA0, 0x2EAE, 0xBFBF, 0xFF00, 0xBE13, 0xBFDF, 0x8080, + 0x99A9, 0x850C, 0x860F, 0x6907, 0xE388, 0x0516, 0x0D07, 0x8510, 0xBE59, + 0x881E, 0xBE4A, 0xEF00, 0x101E, 0x901C, 0x101F, 0x901D, 0x10A0, 0x901E, + 0x10A0, 0x901F, 0xEF00, 0x101E, 0x301C, 0x9020, 0x731B, 0x5420, 0xBE03, + 0x9825, 0x1025, 0x201C, 0x9025, 0x7325, 0x5414, 0xBE03, 0x8B8E, 0x9880, + 0x692F, 0xE388, 0x0539, 0xBE59, 0xBB07, 0x6180, 0x9880, 0x8BA0, 0x101F, + 0x301D, 0x9021, 0x731B, 0x5421, 0xBE03, 0x982E, 0x102E, 0x201D, 0x902E, + 0x732E, 0x5415, 0xBE03, 0x9880, 0x692F, 0xE388, 0x054F, 0xBE59, 0xBB07, + 0x6180, 0x9880, 0x8BA0, 0x6918, 0xEF08, 0x7325, 0x5416, 0xBE03, 0x98A0, + 0x732E, 0x5417, 0xBE03, 0x98A0, 0xEF00, 0x8BA0, 0xBEC6, 0x056B, 0xBE59, + 0xBB04, 0xAA90, 0xBE04, 0xBE1E, 0x99E0, 0x8BE0, 0x69A0, 0x90D0, 0x69A0, + 0x90D0, 0x081F, 0xB805, 0x881F, 0x8B90, 0x69A0, 0x90D0, 0x69A0, 0x9090, + 0x8BD0, 0x8BD8, 0xBE1F, 0xEF00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +}; + +uint16_t minisrc_lpf[10] = { + 0X0743, 0X1104, 0X0A4C, 0XF88D, 0X242C, + 0X1023, 0X1AA9, 0X0B60, 0XEFDD, 0X186F +}; + +#endif /* !_DEV_SOUND_PCI_ALLEGRO_CODE_H */ Copied: stable/9/sys/dev/sound/pci/allegro_reg.h (from r230401, head/sys/dev/sound/pci/allegro_reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/sound/pci/allegro_reg.h Sat Feb 4 17:13:34 2012 (r230985, copy of r230401, head/sys/dev/sound/pci/allegro_reg.h) @@ -0,0 +1,790 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 1996-2008, 4Front Technologies + * Copyright (C) 1992-2000 Don Kim (don.kim@esstech.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 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, WHETHERIN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/*--------------------------------------------------------------------------- + * Copyright (C) 1997-1999, ESS Technology, Inc. + * This source code, its compiled object code, and its associated data sets + * are copyright (C) 1997-1999 ESS Technology, Inc. + *--------------------------------------------------------------------------- + * This header contains data structures and registers taken from the + * 4Front OSS Allegro BSD licensed driver (in the Attic/ directory). + * Files used for this header include: + * hardware.h + * kernel.h and hckernel.h + * srcmgr.h + *--------------------------------------------------------------------------- + */ + +#ifndef _DEV_SOUND_PCI_ALLEGRO_REG_H +#define _DEV_SOUND_PCI_ALLEGRO_REG_H + +/* Allegro PCI configuration registers */ +#define PCI_LEGACY_AUDIO_CTRL 0x40 +#define SOUND_BLASTER_ENABLE 0x00000001 +#define FM_SYNTHESIS_ENABLE 0x00000002 +#define GAME_PORT_ENABLE 0x00000004 +#define MPU401_IO_ENABLE 0x00000008 +#define MPU401_IRQ_ENABLE 0x00000010 +#define ALIAS_10BIT_IO 0x00000020 +#define SB_DMA_MASK 0x000000C0 +#define SB_DMA_0 0x00000040 +#define SB_DMA_1 0x00000040 +#define SB_DMA_R 0x00000080 +#define SB_DMA_3 0x000000C0 +#define SB_IRQ_MASK 0x00000700 +#define SB_IRQ_5 0x00000000 +#define SB_IRQ_7 0x00000100 +#define SB_IRQ_9 0x00000200 +#define SB_IRQ_10 0x00000300 +#define MIDI_IRQ_MASK 0x00003800 +#define SERIAL_IRQ_ENABLE 0x00004000 +#define DISABLE_LEGACY 0x00008000 + +#define PCI_ALLEGRO_CONFIG 0x50 +#define SB_ADDR_240 0x00000004 +#define MPU_ADDR_MASK 0x00000018 +#define MPU_ADDR_330 0x00000000 +#define MPU_ADDR_300 0x00000008 +#define MPU_ADDR_320 0x00000010 +#define MPU_ADDR_340 0x00000018 +#define USE_PCI_TIMING 0x00000040 +#define POSTED_WRITE_ENABLE 0x00000080 +#define DMA_POLICY_MASK 0x00000700 +#define DMA_DDMA 0x00000000 +#define DMA_TDMA 0x00000100 +#define DMA_PCPCI 0x00000200 +#define DMA_WBDMA16 0x00000400 +#define DMA_WBDMA4 0x00000500 +#define DMA_WBDMA2 0x00000600 +#define DMA_WBDMA1 0x00000700 +#define DMA_SAFE_GUARD 0x00000800 +#define HI_PERF_GP_ENABLE 0x00001000 +#define PIC_SNOOP_MODE_0 0x00002000 +#define PIC_SNOOP_MODE_1 0x00004000 +#define SOUNDBLASTER_IRQ_MASK 0x00008000 +#define RING_IN_ENABLE 0x00010000 +#define SPDIF_TEST_MODE 0x00020000 +#define CLK_MULT_MODE_SELECT_2 0x00040000 +#define EEPROM_WRITE_ENABLE 0x00080000 +#define CODEC_DIR_IN 0x00100000 +#define HV_BUTTON_FROM_GD 0x00200000 +#define REDUCED_DEBOUNCE 0x00400000 +#define HV_CTRL_ENABLE 0x00800000 +#define SPDIF_ENABLE 0x01000000 +#define CLK_DIV_SELECT 0x06000000 +#define CLK_DIV_BY_48 0x00000000 +#define CLK_DIV_BY_49 0x02000000 +#define CLK_DIV_BY_50 0x04000000 +#define CLK_DIV_RESERVED 0x06000000 +#define PM_CTRL_ENABLE 0x08000000 +#define CLK_MULT_MODE_SELECT 0x30000000 +#define CLK_MULT_MODE_SHIFT 28 +#define CLK_MULT_MODE_0 0x00000000 +#define CLK_MULT_MODE_1 0x10000000 +#define CLK_MULT_MODE_2 0x20000000 +#define CLK_MULT_MODE_3 0x30000000 +#define INT_CLK_SELECT 0x40000000 +#define INT_CLK_MULT_RESET 0x80000000 + +/* M3 */ +#define INT_CLK_SRC_NOT_PCI 0x00100000 +#define INT_CLK_MULT_ENABLE 0x80000000 + +#define PCI_ACPI_CONTROL 0x54 +#define PCI_ACPI_D0 0x00000000 +#define PCI_ACPI_D1 0xB4F70000 +#define PCI_ACPI_D2 0xB4F7B4F7 + +#define PCI_USER_CONFIG 0x58 +#define EXT_PCI_MASTER_ENABLE 0x00000001 +#define SPDIF_OUT_SELECT 0x00000002 +#define TEST_PIN_DIR_CTRL 0x00000004 +#define AC97_CODEC_TEST 0x00000020 +#define TRI_STATE_BUFFER 0x00000080 +#define IN_CLK_12MHZ_SELECT 0x00000100 +#define MULTI_FUNC_DISABLE 0x00000200 +#define EXT_MASTER_PAIR_SEL 0x00000400 +#define PCI_MASTER_SUPPORT 0x00000800 +#define STOP_CLOCK_ENABLE 0x00001000 +#define EAPD_DRIVE_ENABLE 0x00002000 +#define REQ_TRI_STATE_ENABLE 0x00004000 +#define REQ_LOW_ENABLE 0x00008000 +#define MIDI_1_ENABLE 0x00010000 +#define MIDI_2_ENABLE 0x00020000 +#define SB_AUDIO_SYNC 0x00040000 +#define HV_CTRL_TEST 0x00100000 +#define SOUNDBLASTER_TEST 0x00400000 + +#define PCI_USER_CONFIG_C 0x5C + +#define PCI_DDMA_CTRL 0x60 +#define DDMA_ENABLE 0x00000001 + + +/* Allegro registers */ +#define HOST_INT_CTRL 0x18 +#define SB_INT_ENABLE 0x0001 +#define MPU401_INT_ENABLE 0x0002 +#define ASSP_INT_ENABLE 0x0010 +#define RING_INT_ENABLE 0x0020 +#define HV_INT_ENABLE 0x0040 +#define CLKRUN_GEN_ENABLE 0x0100 +#define HV_CTRL_TO_PME 0x0400 +#define SOFTWARE_RESET_ENABLE 0x8000 + +#define HOST_INT_STATUS 0x1A +#define SB_INT_PENDING 0x01 +#define MPU401_INT_PENDING 0x02 +#define ASSP_INT_PENDING 0x10 +#define RING_INT_PENDING 0x20 +#define HV_INT_PENDING 0x40 + +#define HARDWARE_VOL_CTRL 0x1B +#define SHADOW_MIX_REG_VOICE 0x1C +#define HW_VOL_COUNTER_VOICE 0x1D +#define SHADOW_MIX_REG_MASTER 0x1E +#define HW_VOL_COUNTER_MASTER 0x1F + +#define CODEC_COMMAND 0x30 +#define CODEC_READ_B 0x80 + +#define CODEC_STATUS 0x30 +#define CODEC_BUSY_B 0x01 + +#define CODEC_DATA 0x32 + +/* AC97 registers */ +#ifndef M3_MODEL +#define AC97_RESET 0x00 +#endif + +#define AC97_VOL_MUTE_B 0x8000 +#define AC97_VOL_M 0x1F +#define AC97_LEFT_VOL_S 8 + +#define AC97_MASTER_VOL 0x02 +#define AC97_LINE_LEVEL_VOL 0x04 +#define AC97_MASTER_MONO_VOL 0x06 +#define AC97_PC_BEEP_VOL 0x0A +#define AC97_PC_BEEP_VOL_M 0x0F +#define AC97_SROUND_MASTER_VOL 0x38 +#define AC97_PC_BEEP_VOL_S 1 + +#ifndef M3_MODEL +#define AC97_PHONE_VOL 0x0C +#define AC97_MIC_VOL 0x0E +#endif +#define AC97_MIC_20DB_ENABLE 0x40 + +#ifndef M3_MODEL +#define AC97_LINEIN_VOL 0x10 +#define AC97_CD_VOL 0x12 +#define AC97_VIDEO_VOL 0x14 +#define AC97_AUX_VOL 0x16 +#endif +#define AC97_PCM_OUT_VOL 0x18 +#ifndef M3_MODEL +#define AC97_RECORD_SELECT 0x1A +#endif +#define AC97_RECORD_MIC 0x00 +#define AC97_RECORD_CD 0x01 +#define AC97_RECORD_VIDEO 0x02 +#define AC97_RECORD_AUX 0x03 +#define AC97_RECORD_MONO_MUX 0x02 +#define AC97_RECORD_DIGITAL 0x03 +#define AC97_RECORD_LINE 0x04 +#define AC97_RECORD_STEREO 0x05 +#define AC97_RECORD_MONO 0x06 +#define AC97_RECORD_PHONE 0x07 + +#ifndef M3_MODEL +#define AC97_RECORD_GAIN 0x1C +#endif +#define AC97_RECORD_VOL_M 0x0F + +#ifndef M3_MODEL +#define AC97_GENERAL_PURPOSE 0x20 +#endif +#define AC97_POWER_DOWN_CTRL 0x26 +#define AC97_ADC_READY 0x0001 +#define AC97_DAC_READY 0x0002 +#define AC97_ANALOG_READY 0x0004 +#define AC97_VREF_ON 0x0008 +#define AC97_PR0 0x0100 +#define AC97_PR1 0x0200 +#define AC97_PR2 0x0400 +#define AC97_PR3 0x0800 +#define AC97_PR4 0x1000 + +#define AC97_RESERVED1 0x28 + +#define AC97_VENDOR_TEST 0x5A + +#define AC97_CLOCK_DELAY 0x5C +#define AC97_LINEOUT_MUX_SEL 0x0001 +#define AC97_MONO_MUX_SEL 0x0002 +#define AC97_CLOCK_DELAY_SEL 0x1F +#define AC97_DAC_CDS_SHIFT 6 +#define AC97_ADC_CDS_SHIFT 11 + +#define AC97_MULTI_CHANNEL_SEL 0x74 + +#ifndef M3_MODEL +#define AC97_VENDOR_ID1 0x7C +#define AC97_VENDOR_ID2 0x7E +#endif + +#define RING_BUS_CTRL_A 0x36 +#define RAC_PME_ENABLE 0x0100 +#define RAC_SDFS_ENABLE 0x0200 +#define LAC_PME_ENABLE 0x0400 +#define LAC_SDFS_ENABLE 0x0800 +#define SERIAL_AC_LINK_ENABLE 0x1000 +#define IO_SRAM_ENABLE 0x2000 +#define IIS_INPUT_ENABLE 0x8000 + +#define RING_BUS_CTRL_B 0x38 +#define SECOND_CODEC_ID_MASK 0x0003 +#define SPDIF_FUNC_ENABLE 0x0010 +#define SECOND_AC_ENABLE 0x0020 +#define SB_MODULE_INTF_ENABLE 0x0040 +#define SSPE_ENABLE 0x0040 +#define M3I_DOCK_ENABLE 0x0080 + +#define SDO_OUT_DEST_CTRL 0x3A +#define COMMAND_ADDR_OUT 0x0003 +#define PCM_LR_OUT_LOCAL 0x0000 +#define PCM_LR_OUT_REMOTE 0x0004 +#define PCM_LR_OUT_MUTE 0x0008 +#define PCM_LR_OUT_BOTH 0x000C +#define LINE1_DAC_OUT_LOCAL 0x0000 +#define LINE1_DAC_OUT_REMOTE 0x0010 +#define LINE1_DAC_OUT_MUTE 0x0020 +#define LINE1_DAC_OUT_BOTH 0x0030 +#define PCM_CLS_OUT_LOCAL 0x0000 +#define PCM_CLS_OUT_REMOTE 0x0040 +#define PCM_CLS_OUT_MUTE 0x0080 +#define PCM_CLS_OUT_BOTH 0x00C0 +#define PCM_RLF_OUT_LOCAL 0x0000 +#define PCM_RLF_OUT_REMOTE 0x0100 +#define PCM_RLF_OUT_MUTE 0x0200 +#define PCM_RLF_OUT_BOTH 0x0300 +#define LINE2_DAC_OUT_LOCAL 0x0000 +#define LINE2_DAC_OUT_REMOTE 0x0400 +#define LINE2_DAC_OUT_MUTE 0x0800 +#define LINE2_DAC_OUT_BOTH 0x0C00 +#define HANDSET_OUT_LOCAL 0x0000 +#define HANDSET_OUT_REMOTE 0x1000 +#define HANDSET_OUT_MUTE 0x2000 +#define HANDSET_OUT_BOTH 0x3000 +#define IO_CTRL_OUT_LOCAL 0x0000 +#define IO_CTRL_OUT_REMOTE 0x4000 +#define IO_CTRL_OUT_MUTE 0x8000 +#define IO_CTRL_OUT_BOTH 0xC000 + +#define SDO_IN_DEST_CTRL 0x3C +#define STATUS_ADDR_IN 0x0003 +#define PCM_LR_IN_LOCAL 0x0000 +#define PCM_LR_IN_REMOTE 0x0004 +#define PCM_LR_RESERVED 0x0008 +#define PCM_LR_IN_BOTH 0x000C +#define LINE1_ADC_IN_LOCAL 0x0000 +#define LINE1_ADC_IN_REMOTE 0x0010 +#define LINE1_ADC_IN_MUTE 0x0020 +#define MIC_ADC_IN_LOCAL 0x0000 +#define MIC_ADC_IN_REMOTE 0x0040 +#define MIC_ADC_IN_MUTE 0x0080 +#define LINE2_DAC_IN_LOCAL 0x0000 +#define LINE2_DAC_IN_REMOTE 0x0400 +#define LINE2_DAC_IN_MUTE 0x0800 +#define HANDSET_IN_LOCAL 0x0000 +#define HANDSET_IN_REMOTE 0x1000 +#define HANDSET_IN_MUTE 0x2000 +#define IO_STATUS_IN_LOCAL 0x0000 +#define IO_STATUS_IN_REMOTE 0x4000 + +#define SPDIF_IN_CTRL 0x3E +#define SPDIF_IN_ENABLE 0x0001 + +#define GPIO_DATA 0x60 +#define GPIO_DATA_MASK 0x0FFF +#define GPIO_HV_STATUS 0x3000 +#define GPIO_PME_STATUS 0x4000 + +#define GPIO_MASK 0x64 +#define GPIO_DIRECTION 0x68 +#define GPO_PRIMARY_AC97 0x0001 +#define GPI_LINEOUT_SENSE 0x0004 +#define GPO_SECONDARY_AC97 0x0008 +#define GPI_VOL_DOWN 0x0010 +#define GPI_VOL_UP 0x0020 +#define GPI_IIS_CLK 0x0040 +#define GPI_IIS_LRCLK 0x0080 +#define GPI_IIS_DATA 0x0100 +#define GPI_DOCKING_STATUS 0x0100 +#define GPI_HEADPHONE_SENSE 0x0200 +#define GPO_EXT_AMP_SHUTDOWN 0x1000 + +/* M3 */ +#define GPO_M3_EXT_AMP_SHUTDN 0x0002 + +#define ASSP_INDEX_PORT 0x80 +#define ASSP_MEMORY_PORT 0x82 +#define ASSP_DATA_PORT 0x84 + +#define MPU401_DATA_PORT 0x98 +#define MPU401_STATUS_PORT 0x99 + +#define CLK_MULT_DATA_PORT 0x9C + +#define ASSP_CONTROL_A 0xA2 +#define ASSP_0_WS_ENABLE 0x01 +#define ASSP_CTRL_A_RESERVED1 0x02 +#define ASSP_CTRL_A_RESERVED2 0x04 +#define ASSP_CLK_49MHZ_SELECT 0x08 +#define FAST_PLU_ENABLE 0x10 +#define ASSP_CTRL_A_RESERVED3 0x20 +#define DSP_CLK_36MHZ_SELECT 0x40 + +#define ASSP_CONTROL_B 0xA4 +#define RESET_ASSP 0x00 +#define RUN_ASSP 0x01 +#define ENABLE_ASSP_CLOCK 0x00 +#define STOP_ASSP_CLOCK 0x10 +#define RESET_TOGGLE 0x40 + +#define ASSP_CONTROL_C 0xA6 +#define ASSP_HOST_INT_ENABLE 0x01 +#define FM_ADDR_REMAP_DISABLE 0x02 +#define HOST_WRITE_PORT_ENABLE 0x08 + +#define ASSP_HOST_INT_STATUS 0xAC +#define DSP2HOST_REQ_PIORECORD 0x01 +#define DSP2HOST_REQ_I2SRATE 0x02 +#define DSP2HOST_REQ_TIMER 0x04 + +/* + * DSP memory map + */ + +#define REV_A_CODE_MEMORY_BEGIN 0x0000 +#define REV_A_CODE_MEMORY_END 0x0FFF +#define REV_A_CODE_MEMORY_UNIT_LENGTH 0x0040 +#define REV_A_CODE_MEMORY_LENGTH (REV_A_CODE_MEMORY_END - REV_A_CODE_MEMORY_BEGIN + 1) + +#define REV_B_CODE_MEMORY_BEGIN 0x0000 +#define REV_B_CODE_MEMORY_END 0x0BFF +#define REV_B_CODE_MEMORY_UNIT_LENGTH 0x0040 +#define REV_B_CODE_MEMORY_LENGTH (REV_B_CODE_MEMORY_END - REV_B_CODE_MEMORY_BEGIN + 1) + +#if (REV_A_CODE_MEMORY_LENGTH % REV_A_CODE_MEMORY_UNIT_LENGTH) +#error Assumption about code memory unit length failed. +#endif +#if (REV_B_CODE_MEMORY_LENGTH % REV_B_CODE_MEMORY_UNIT_LENGTH) +#error Assumption about code memory unit length failed. +#endif + +#define REV_A_DATA_MEMORY_BEGIN 0x1000 +#define REV_A_DATA_MEMORY_END 0x2FFF +#define REV_A_DATA_MEMORY_UNIT_LENGTH 0x0080 +#define REV_A_DATA_MEMORY_LENGTH (REV_A_DATA_MEMORY_END - REV_A_DATA_MEMORY_BEGIN + 1) + +#define REV_B_DATA_MEMORY_BEGIN 0x1000 +/*#define REV_B_DATA_MEMORY_END 0x23FF */ +#define REV_B_DATA_MEMORY_END 0x2BFF +#define REV_B_DATA_MEMORY_UNIT_LENGTH 0x0080 +#define REV_B_DATA_MEMORY_LENGTH (REV_B_DATA_MEMORY_END - REV_B_DATA_MEMORY_BEGIN + 1) + +#if (REV_A_DATA_MEMORY_LENGTH % REV_A_DATA_MEMORY_UNIT_LENGTH) +#error Assumption about data memory unit length failed. +#endif +#if (REV_B_DATA_MEMORY_LENGTH % REV_B_DATA_MEMORY_UNIT_LENGTH) +#error Assumption about data memory unit length failed. +#endif + +#define CODE_MEMORY_MAP_LENGTH (64 + 1) +#define DATA_MEMORY_MAP_LENGTH (64 + 1) + +#if (CODE_MEMORY_MAP_LENGTH < ((REV_A_CODE_MEMORY_LENGTH / REV_A_CODE_MEMORY_UNIT_LENGTH) + 1)) +#error Code memory map length too short. +#endif +#if (DATA_MEMORY_MAP_LENGTH < ((REV_A_DATA_MEMORY_LENGTH / REV_A_DATA_MEMORY_UNIT_LENGTH) + 1)) +#error Data memory map length too short. +#endif +#if (CODE_MEMORY_MAP_LENGTH < ((REV_B_CODE_MEMORY_LENGTH / REV_B_CODE_MEMORY_UNIT_LENGTH) + 1)) +#error Code memory map length too short. +#endif +#if (DATA_MEMORY_MAP_LENGTH < ((REV_B_DATA_MEMORY_LENGTH / REV_B_DATA_MEMORY_UNIT_LENGTH) + 1)) +#error Data memory map length too short. +#endif + + +/* + * Kernel code memory definition + */ + +#define KCODE_VECTORS_BEGIN 0x0000 +#define KCODE_VECTORS_END 0x002F +#define KCODE_VECTORS_UNIT_LENGTH 0x0002 +#define KCODE_VECTORS_LENGTH (KCODE_VECTORS_END - KCODE_VECTORS_BEGIN + 1) + + +/* + * Kernel data memory definition + */ + +#define KDATA_BASE_ADDR 0x1000 +#define KDATA_BASE_ADDR2 0x1080 + +#define KDATA_TASK0 (KDATA_BASE_ADDR + 0x0000) +#define KDATA_TASK1 (KDATA_BASE_ADDR + 0x0001) +#define KDATA_TASK2 (KDATA_BASE_ADDR + 0x0002) +#define KDATA_TASK3 (KDATA_BASE_ADDR + 0x0003) +#define KDATA_TASK4 (KDATA_BASE_ADDR + 0x0004) +#define KDATA_TASK5 (KDATA_BASE_ADDR + 0x0005) +#define KDATA_TASK6 (KDATA_BASE_ADDR + 0x0006) +#define KDATA_TASK7 (KDATA_BASE_ADDR + 0x0007) +#define KDATA_TASK_ENDMARK (KDATA_BASE_ADDR + 0x0008) + +#define KDATA_CURRENT_TASK (KDATA_BASE_ADDR + 0x0009) +#define KDATA_TASK_SWITCH (KDATA_BASE_ADDR + 0x000A) + +#define KDATA_INSTANCE0_POS3D (KDATA_BASE_ADDR + 0x000B) +#define KDATA_INSTANCE1_POS3D (KDATA_BASE_ADDR + 0x000C) +#define KDATA_INSTANCE2_POS3D (KDATA_BASE_ADDR + 0x000D) +#define KDATA_INSTANCE3_POS3D (KDATA_BASE_ADDR + 0x000E) +#define KDATA_INSTANCE4_POS3D (KDATA_BASE_ADDR + 0x000F) +#define KDATA_INSTANCE5_POS3D (KDATA_BASE_ADDR + 0x0010) +#define KDATA_INSTANCE6_POS3D (KDATA_BASE_ADDR + 0x0011) +#define KDATA_INSTANCE7_POS3D (KDATA_BASE_ADDR + 0x0012) +#define KDATA_INSTANCE8_POS3D (KDATA_BASE_ADDR + 0x0013) +#define KDATA_INSTANCE_POS3D_ENDMARK (KDATA_BASE_ADDR + 0x0014) + +#define KDATA_INSTANCE0_SPKVIRT (KDATA_BASE_ADDR + 0x0015) +#define KDATA_INSTANCE_SPKVIRT_ENDMARK (KDATA_BASE_ADDR + 0x0016) + +#define KDATA_INSTANCE0_SPDIF (KDATA_BASE_ADDR + 0x0017) +#define KDATA_INSTANCE_SPDIF_ENDMARK (KDATA_BASE_ADDR + 0x0018) + +#define KDATA_INSTANCE0_MODEM (KDATA_BASE_ADDR + 0x0019) +#define KDATA_INSTANCE_MODEM_ENDMARK (KDATA_BASE_ADDR + 0x001A) + +#define KDATA_INSTANCE0_SRC (KDATA_BASE_ADDR + 0x001B) +#define KDATA_INSTANCE1_SRC (KDATA_BASE_ADDR + 0x001C) +#define KDATA_INSTANCE_SRC_ENDMARK (KDATA_BASE_ADDR + 0x001D) + +#define KDATA_INSTANCE0_MINISRC (KDATA_BASE_ADDR + 0x001E) +#define KDATA_INSTANCE1_MINISRC (KDATA_BASE_ADDR + 0x001F) +#define KDATA_INSTANCE2_MINISRC (KDATA_BASE_ADDR + 0x0020) +#define KDATA_INSTANCE3_MINISRC (KDATA_BASE_ADDR + 0x0021) +#define KDATA_INSTANCE_MINISRC_ENDMARK (KDATA_BASE_ADDR + 0x0022) + +#define KDATA_INSTANCE0_CPYTHRU (KDATA_BASE_ADDR + 0x0023) +#define KDATA_INSTANCE1_CPYTHRU (KDATA_BASE_ADDR + 0x0024) +#define KDATA_INSTANCE_CPYTHRU_ENDMARK (KDATA_BASE_ADDR + 0x0025) + +#define KDATA_CURRENT_DMA (KDATA_BASE_ADDR + 0x0026) +#define KDATA_DMA_SWITCH (KDATA_BASE_ADDR + 0x0027) +#define KDATA_DMA_ACTIVE (KDATA_BASE_ADDR + 0x0028) + +#define KDATA_DMA_XFER0 (KDATA_BASE_ADDR + 0x0029) +#define KDATA_DMA_XFER1 (KDATA_BASE_ADDR + 0x002A) +#define KDATA_DMA_XFER2 (KDATA_BASE_ADDR + 0x002B) +#define KDATA_DMA_XFER3 (KDATA_BASE_ADDR + 0x002C) +#define KDATA_DMA_XFER4 (KDATA_BASE_ADDR + 0x002D) +#define KDATA_DMA_XFER5 (KDATA_BASE_ADDR + 0x002E) +#define KDATA_DMA_XFER6 (KDATA_BASE_ADDR + 0x002F) +#define KDATA_DMA_XFER7 (KDATA_BASE_ADDR + 0x0030) +#define KDATA_DMA_XFER8 (KDATA_BASE_ADDR + 0x0031) +#define KDATA_DMA_XFER_ENDMARK (KDATA_BASE_ADDR + 0x0032) + +#define KDATA_I2S_SAMPLE_COUNT (KDATA_BASE_ADDR + 0x0033) +#define KDATA_I2S_INT_METER (KDATA_BASE_ADDR + 0x0034) +#define KDATA_I2S_ACTIVE (KDATA_BASE_ADDR + 0x0035) + +#define KDATA_TIMER_COUNT_RELOAD (KDATA_BASE_ADDR + 0x0036) +#define KDATA_TIMER_COUNT_CURRENT (KDATA_BASE_ADDR + 0x0037) + +#define KDATA_HALT_SYNCH_CLIENT (KDATA_BASE_ADDR + 0x0038) +#define KDATA_HALT_SYNCH_DMA (KDATA_BASE_ADDR + 0x0039) +#define KDATA_HALT_ACKNOWLEDGE (KDATA_BASE_ADDR + 0x003A) + +#define KDATA_ADC1_XFER0 (KDATA_BASE_ADDR + 0x003B) +#define KDATA_ADC1_XFER_ENDMARK (KDATA_BASE_ADDR + 0x003C) +#define KDATA_ADC1_LEFT_VOLUME (KDATA_BASE_ADDR + 0x003D) +#define KDATA_ADC1_RIGHT_VOLUME (KDATA_BASE_ADDR + 0x003E) +#define KDATA_ADC1_LEFT_SUR_VOL (KDATA_BASE_ADDR + 0x003F) +#define KDATA_ADC1_RIGHT_SUR_VOL (KDATA_BASE_ADDR + 0x0040) + +#define KDATA_ADC2_XFER0 (KDATA_BASE_ADDR + 0x0041) +#define KDATA_ADC2_XFER_ENDMARK (KDATA_BASE_ADDR + 0x0042) +#define KDATA_ADC2_LEFT_VOLUME (KDATA_BASE_ADDR + 0x0043) +#define KDATA_ADC2_RIGHT_VOLUME (KDATA_BASE_ADDR + 0x0044) +#define KDATA_ADC2_LEFT_SUR_VOL (KDATA_BASE_ADDR + 0x0045) +#define KDATA_ADC2_RIGHT_SUR_VOL (KDATA_BASE_ADDR + 0x0046) + +#define KDATA_CD_XFER0 (KDATA_BASE_ADDR + 0x0047) +#define KDATA_CD_XFER_ENDMARK (KDATA_BASE_ADDR + 0x0048) +#define KDATA_CD_LEFT_VOLUME (KDATA_BASE_ADDR + 0x0049) +#define KDATA_CD_RIGHT_VOLUME (KDATA_BASE_ADDR + 0x004A) +#define KDATA_CD_LEFT_SUR_VOL (KDATA_BASE_ADDR + 0x004B) +#define KDATA_CD_RIGHT_SUR_VOL (KDATA_BASE_ADDR + 0x004C) + +#define KDATA_MIC_XFER0 (KDATA_BASE_ADDR + 0x004D) +#define KDATA_MIC_XFER_ENDMARK (KDATA_BASE_ADDR + 0x004E) +#define KDATA_MIC_VOLUME (KDATA_BASE_ADDR + 0x004F) +#define KDATA_MIC_SUR_VOL (KDATA_BASE_ADDR + 0x0050) + +#define KDATA_I2S_XFER0 (KDATA_BASE_ADDR + 0x0051) +#define KDATA_I2S_XFER_ENDMARK (KDATA_BASE_ADDR + 0x0052) + +#define KDATA_CHI_XFER0 (KDATA_BASE_ADDR + 0x0053) +#define KDATA_CHI_XFER_ENDMARK (KDATA_BASE_ADDR + 0x0054) + +#define KDATA_SPDIF_XFER (KDATA_BASE_ADDR + 0x0055) +#define KDATA_SPDIF_CURRENT_FRAME (KDATA_BASE_ADDR + 0x0056) +#define KDATA_SPDIF_FRAME0 (KDATA_BASE_ADDR + 0x0057) +#define KDATA_SPDIF_FRAME1 (KDATA_BASE_ADDR + 0x0058) +#define KDATA_SPDIF_FRAME2 (KDATA_BASE_ADDR + 0x0059) + +#define KDATA_SPDIF_REQUEST (KDATA_BASE_ADDR + 0x005A) +#define KDATA_SPDIF_TEMP (KDATA_BASE_ADDR + 0x005B) + +/*AY SPDIF IN */ +#define KDATA_SPDIFIN_XFER0 (KDATA_BASE_ADDR + 0x005C) +#define KDATA_SPDIFIN_XFER_ENDMARK (KDATA_BASE_ADDR + 0x005D) +#define KDATA_SPDIFIN_INT_METER (KDATA_BASE_ADDR + 0x005E) + +#define KDATA_DSP_RESET_COUNT (KDATA_BASE_ADDR + 0x005F) +#define KDATA_DEBUG_OUTPUT (KDATA_BASE_ADDR + 0x0060) + +#define KDATA_KERNEL_ISR_LIST (KDATA_BASE_ADDR + 0x0061) + +#define KDATA_KERNEL_ISR_CBSR1 (KDATA_BASE_ADDR + 0x0062) +#define KDATA_KERNEL_ISR_CBER1 (KDATA_BASE_ADDR + 0x0063) +#define KDATA_KERNEL_ISR_CBCR (KDATA_BASE_ADDR + 0x0064) +#define KDATA_KERNEL_ISR_AR0 (KDATA_BASE_ADDR + 0x0065) +#define KDATA_KERNEL_ISR_AR1 (KDATA_BASE_ADDR + 0x0066) +#define KDATA_KERNEL_ISR_AR2 (KDATA_BASE_ADDR + 0x0067) +#define KDATA_KERNEL_ISR_AR3 (KDATA_BASE_ADDR + 0x0068) +#define KDATA_KERNEL_ISR_AR4 (KDATA_BASE_ADDR + 0x0069) +#define KDATA_KERNEL_ISR_AR5 (KDATA_BASE_ADDR + 0x006A) +#define KDATA_KERNEL_ISR_BRCR (KDATA_BASE_ADDR + 0x006B) +#define KDATA_KERNEL_ISR_PASR (KDATA_BASE_ADDR + 0x006C) +#define KDATA_KERNEL_ISR_PAER (KDATA_BASE_ADDR + 0x006D) + +#define KDATA_CLIENT_SCRATCH0 (KDATA_BASE_ADDR + 0x006E) +#define KDATA_CLIENT_SCRATCH1 (KDATA_BASE_ADDR + 0x006F) +#define KDATA_KERNEL_SCRATCH (KDATA_BASE_ADDR + 0x0070) +#define KDATA_KERNEL_ISR_SCRATCH (KDATA_BASE_ADDR + 0x0071) + +#define KDATA_OUEUE_LEFT (KDATA_BASE_ADDR + 0x0072) +#define KDATA_QUEUE_RIGHT (KDATA_BASE_ADDR + 0x0073) + +#define KDATA_ADC1_REQUEST (KDATA_BASE_ADDR + 0x0074) +#define KDATA_ADC2_REQUEST (KDATA_BASE_ADDR + 0x0075) +#define KDATA_CD_REQUEST (KDATA_BASE_ADDR + 0x0076) +#define KDATA_MIC_REQUEST (KDATA_BASE_ADDR + 0x0077) + +#define KDATA_ADC1_MIXER_REQUEST (KDATA_BASE_ADDR + 0x0078) +#define KDATA_ADC2_MIXER_REQUEST (KDATA_BASE_ADDR + 0x0079) +#define KDATA_CD_MIXER_REQUEST (KDATA_BASE_ADDR + 0x007A) +#define KDATA_MIC_MIXER_REQUEST (KDATA_BASE_ADDR + 0x007B) +#define KDATA_MIC_SYNC_COUNTER (KDATA_BASE_ADDR + 0x007C) + +/* + * second segment + */ + +/* smart mixer buffer */ + +#define KDATA_MIXER_WORD0 (KDATA_BASE_ADDR2 + 0x0000) +#define KDATA_MIXER_WORD1 (KDATA_BASE_ADDR2 + 0x0001) +#define KDATA_MIXER_WORD2 (KDATA_BASE_ADDR2 + 0x0002) +#define KDATA_MIXER_WORD3 (KDATA_BASE_ADDR2 + 0x0003) +#define KDATA_MIXER_WORD4 (KDATA_BASE_ADDR2 + 0x0004) +#define KDATA_MIXER_WORD5 (KDATA_BASE_ADDR2 + 0x0005) +#define KDATA_MIXER_WORD6 (KDATA_BASE_ADDR2 + 0x0006) +#define KDATA_MIXER_WORD7 (KDATA_BASE_ADDR2 + 0x0007) +#define KDATA_MIXER_WORD8 (KDATA_BASE_ADDR2 + 0x0008) +#define KDATA_MIXER_WORD9 (KDATA_BASE_ADDR2 + 0x0009) +#define KDATA_MIXER_WORDA (KDATA_BASE_ADDR2 + 0x000A) +#define KDATA_MIXER_WORDB (KDATA_BASE_ADDR2 + 0x000B) +#define KDATA_MIXER_WORDC (KDATA_BASE_ADDR2 + 0x000C) +#define KDATA_MIXER_WORDD (KDATA_BASE_ADDR2 + 0x000D) +#define KDATA_MIXER_WORDE (KDATA_BASE_ADDR2 + 0x000E) +#define KDATA_MIXER_WORDF (KDATA_BASE_ADDR2 + 0x000F) + +#define KDATA_MIXER_XFER0 (KDATA_BASE_ADDR2 + 0x0010) +#define KDATA_MIXER_XFER1 (KDATA_BASE_ADDR2 + 0x0011) +#define KDATA_MIXER_XFER2 (KDATA_BASE_ADDR2 + 0x0012) +#define KDATA_MIXER_XFER3 (KDATA_BASE_ADDR2 + 0x0013) +#define KDATA_MIXER_XFER4 (KDATA_BASE_ADDR2 + 0x0014) +#define KDATA_MIXER_XFER5 (KDATA_BASE_ADDR2 + 0x0015) +#define KDATA_MIXER_XFER6 (KDATA_BASE_ADDR2 + 0x0016) +#define KDATA_MIXER_XFER7 (KDATA_BASE_ADDR2 + 0x0017) +#define KDATA_MIXER_XFER8 (KDATA_BASE_ADDR2 + 0x0018) +#define KDATA_MIXER_XFER9 (KDATA_BASE_ADDR2 + 0x0019) +#define KDATA_MIXER_XFER_ENDMARK (KDATA_BASE_ADDR2 + 0x001A) + +#define KDATA_MIXER_TASK_NUMBER (KDATA_BASE_ADDR2 + 0x001B) +#define KDATA_CURRENT_MIXER (KDATA_BASE_ADDR2 + 0x001C) +#define KDATA_MIXER_ACTIVE (KDATA_BASE_ADDR2 + 0x001D) +#define KDATA_MIXER_BANK_STATUS (KDATA_BASE_ADDR2 + 0x001E) +#define KDATA_DAC_LEFT_VOLUME (KDATA_BASE_ADDR2 + 0x001F) +#define KDATA_DAC_RIGHT_VOLUME (KDATA_BASE_ADDR2 + 0x0020) + +/* + * Client data memory definition + */ + +#define CDATA_INSTANCE_READY 0x00 + +#define CDATA_HOST_SRC_ADDRL 0x01 +#define CDATA_HOST_SRC_ADDRH 0x02 +#define CDATA_HOST_SRC_END_PLUS_1L 0x03 +#define CDATA_HOST_SRC_END_PLUS_1H 0x04 +#define CDATA_HOST_SRC_CURRENTL 0x05 +#define CDATA_HOST_SRC_CURRENTH 0x06 + +#define CDATA_IN_BUF_CONNECT 0x07 +#define CDATA_OUT_BUF_CONNECT 0x08 + +#define CDATA_IN_BUF_BEGIN 0x09 +#define CDATA_IN_BUF_END_PLUS_1 0x0A +#define CDATA_IN_BUF_HEAD 0x0B +#define CDATA_IN_BUF_TAIL 0x0C + +#define CDATA_OUT_BUF_BEGIN 0x0D +#define CDATA_OUT_BUF_END_PLUS_1 0x0E +#define CDATA_OUT_BUF_HEAD 0x0F +#define CDATA_OUT_BUF_TAIL 0x10 + +#define CDATA_DMA_CONTROL 0x11 +#define CDATA_RESERVED 0x12 + +#define CDATA_FREQUENCY 0x13 +#define CDATA_LEFT_VOLUME 0x14 +#define CDATA_RIGHT_VOLUME 0x15 +#define CDATA_LEFT_SUR_VOL 0x16 +#define CDATA_RIGHT_SUR_VOL 0x17 + +/* These are from Allegro hckernel.h */ +#define CDATA_HEADER_LEN 0x18 +#define SRC3_DIRECTION_OFFSET CDATA_HEADER_LEN +#define SRC3_MODE_OFFSET CDATA_HEADER_LEN + 1 +#define SRC3_WORD_LENGTH_OFFSET CDATA_HEADER_LEN + 2 +#define SRC3_PARAMETER_OFFSET CDATA_HEADER_LEN + 3 +#define SRC3_COEFF_ADDR_OFFSET CDATA_HEADER_LEN + 8 +#define SRC3_FILTAP_ADDR_OFFSET CDATA_HEADER_LEN + 10 +#define SRC3_TEMP_INBUF_ADDR_OFFSET CDATA_HEADER_LEN + 16 +#define SRC3_TEMP_OUTBUF_ADDR_OFFSET CDATA_HEADER_LEN + 17 +#define FOR_FUTURE_USE 10 /* for storing temporary variable in future */ + +/* + * DMA control definition + */ + +#define DMACONTROL_BLOCK_MASK 0x000F +#define DMAC_BLOCK0_SELECTOR 0x0000 +#define DMAC_BLOCK1_SELECTOR 0x0001 +#define DMAC_BLOCK2_SELECTOR 0x0002 +#define DMAC_BLOCK3_SELECTOR 0x0003 +#define DMAC_BLOCK4_SELECTOR 0x0004 +#define DMAC_BLOCK5_SELECTOR 0x0005 +#define DMAC_BLOCK6_SELECTOR 0x0006 +#define DMAC_BLOCK7_SELECTOR 0x0007 +#define DMAC_BLOCK8_SELECTOR 0x0008 +#define DMAC_BLOCK9_SELECTOR 0x0009 +#define DMAC_BLOCKA_SELECTOR 0x000A +#define DMAC_BLOCKB_SELECTOR 0x000B +#define DMAC_BLOCKC_SELECTOR 0x000C +#define DMAC_BLOCKD_SELECTOR 0x000D +#define DMAC_BLOCKE_SELECTOR 0x000E +#define DMAC_BLOCKF_SELECTOR 0x000F +#define DMACONTROL_PAGE_MASK 0x00F0 +#define DMAC_PAGE0_SELECTOR 0x0030 +#define DMAC_PAGE1_SELECTOR 0x0020 +#define DMAC_PAGE2_SELECTOR 0x0010 +#define DMAC_PAGE3_SELECTOR 0x0000 +#define DMACONTROL_AUTOREPEAT 0x1000 +#define DMACONTROL_STOPPED 0x2000 +#define DMACONTROL_DIRECTION 0x0100 + +/* + * Kernel/client memory allocation + */ + +#define NUM_UNITS_KERNEL_CODE 16 +#define NUM_UNITS_KERNEL_DATA 2 + +#define NUM_UNITS_KERNEL_CODE_WITH_HSP 16 +#ifdef M3_MODEL +#define NUM_UNITS_KERNEL_DATA_WITH_HSP 5 +#else +#define NUM_UNITS_KERNEL_DATA_WITH_HSP 4 +#endif + +#define NUM_UNITS( BYTES, UNITLEN ) ((((BYTES+1)>>1) + (UNITLEN-1)) / UNITLEN) + +/* + * DSP hardware + */ + +#define DSP_PORT_TIMER_COUNT 0x06 +#define DSP_PORT_MEMORY_INDEX 0x80 +#define DSP_PORT_MEMORY_TYPE 0x82 +#define DSP_PORT_MEMORY_DATA 0x84 +#define DSP_PORT_CONTROL_REG_A 0xA2 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 17:53:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56415106566C; Sat, 4 Feb 2012 17:53:23 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 421938FC08; Sat, 4 Feb 2012 17:53:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14HrN9k045664; Sat, 4 Feb 2012 17:53:23 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14HrN8N045662; Sat, 4 Feb 2012 17:53:23 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201202041753.q14HrN8N045662@svn.freebsd.org> From: Hiroki Sato Date: Sat, 4 Feb 2012 17:53: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: r230989 - head/sbin/route X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 17:53:23 -0000 Author: hrs Date: Sat Feb 4 17:53:22 2012 New Revision: 230989 URL: http://svn.freebsd.org/changeset/base/230989 Log: Fix a possible infinite loop in "route flush" on 64-bit archs. MFC after: 3 days Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Sat Feb 4 17:43:15 2012 (r230988) +++ head/sbin/route/route.c Sat Feb 4 17:53:22 2012 (r230989) @@ -460,8 +460,8 @@ netname(struct sockaddr *sa) * Guess at the subnet mask, assuming reasonable * width subnet fields. */ - while (in.s_addr &~ mask) - mask = (long)mask >> subnetshift; + while (in.s_addr & ~mask) + mask |= mask >> subnetshift; net = in.s_addr & mask; while ((mask & 1) == 0) mask >>= 1, net >>= 1; From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 18:14:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66D20106564A; Sat, 4 Feb 2012 18:14:40 +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 514AD8FC0C; Sat, 4 Feb 2012 18:14:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14IEeBR046403; Sat, 4 Feb 2012 18:14:40 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14IEemR046401; Sat, 4 Feb 2012 18:14:40 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202041814.q14IEemR046401@svn.freebsd.org> From: Ed Maste Date: Sat, 4 Feb 2012 18:14: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: r230990 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 18:14:40 -0000 Author: emaste Date: Sat Feb 4 18:14:39 2012 New Revision: 230990 URL: http://svn.freebsd.org/changeset/base/230990 Log: Correct typo in comment (numbver) Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sat Feb 4 17:53:22 2012 (r230989) +++ head/sys/geom/part/g_part.c Sat Feb 4 18:14:39 2012 (r230990) @@ -215,7 +215,7 @@ g_part_geometry(struct g_part_table *tab continue; /* * Prefer a geometry with sectors > 1, but only if - * it doesn't bump down the numbver of heads to 1. + * it doesn't bump down the number of heads to 1. */ if (chs > bestchs || (chs == bestchs && heads > 1 && table->gpt_sectors == 1)) { From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 18:14:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5AA11065678; Sat, 4 Feb 2012 18:14:49 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A077E8FC1C; Sat, 4 Feb 2012 18:14:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14IEnD0046443; Sat, 4 Feb 2012 18:14:49 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14IEnnt046441; Sat, 4 Feb 2012 18:14:49 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201202041814.q14IEnnt046441@svn.freebsd.org> From: Hiroki Sato Date: Sat, 4 Feb 2012 18:14: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: r230991 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 18:14:49 -0000 Author: hrs Date: Sat Feb 4 18:14:49 2012 New Revision: 230991 URL: http://svn.freebsd.org/changeset/base/230991 Log: Fix $ipv6_network_interfaces handling in rc.d/routing. It could fail when it was set to "auto", for example. MFC after: 3 days Modified: head/etc/rc.d/routing Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Sat Feb 4 18:14:39 2012 (r230990) +++ head/etc/rc.d/routing Sat Feb 4 18:14:49 2012 (r230991) @@ -98,8 +98,10 @@ routing_stop_inet6() local i route -n flush -inet6 - for i in ${ipv6_network_interfaces}; do - ifconfig $i inet6 -defaultif + for i in `list_net_interfaces`; do + if ipv6if $i; then + ifconfig $i inet6 -defaultif + fi done } From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 18:16:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76E1D106564A; Sat, 4 Feb 2012 18:16:50 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2C3308FC08; Sat, 4 Feb 2012 18:16:49 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so5285921bkb.13 for ; Sat, 04 Feb 2012 10:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=OtmKWiHpxUZgZ8fw/YJGZxajsmxY33u5PSeuDGFOWIw=; b=rRvYUECJByrSCi5Fe8LHJLnSik/8uDIISZxTfModxul7X7C5YZLG244OuC8ZTHCMTe O676VEDVgOtQ8z4rmB/GyxR4KGCZh/pfdQGFMYrtcv7OldFrpi2w2ZPRSRS28Wt7jeJA SUdUNoXsQIAfJgi235WXvKhv75JJBrqJr6di4= Received: by 10.204.133.204 with SMTP id g12mr5550045bkt.107.1328379408282; Sat, 04 Feb 2012 10:16:48 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id cz3sm28052968bkb.3.2012.02.04.10.16.44 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 04 Feb 2012 10:16:46 -0800 (PST) From: Mikolaj Golub To: Guy Helmer References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> X-Comment-To: Guy Helmer Sender: Mikolaj Golub Date: Sat, 04 Feb 2012 20:16:42 +0200 In-Reply-To: <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> (Guy Helmer's message of "Sat, 4 Feb 2012 10:30:00 -0600") Message-ID: <86zkcy5ur9.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Andrey Zonov , Pawel Jakub Dawidek , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 18:16:50 -0000 On Sat, 4 Feb 2012 10:30:00 -0600 Guy Helmer wrote: GH> On Feb 4, 2012, at 2:23 AM, Andrey Zonov wrote: >> On 04.02.2012 11:42, Pawel Jakub Dawidek wrote: >>> On Wed, Feb 01, 2012 at 04:41:00PM +0000, Guy Helmer wrote: >>>> Author: ghelmer >>>> Date: Wed Feb 1 16:40:59 2012 >>>> New Revision: 230869 >>>> URL: http://svn.freebsd.org/changeset/base/230869 >>>> >>>> Log: >>>> Change the notes about the pidfile to include Doug's preference >>>> for pre-creating the pidfile with appropriate owner and permissions. >>>> >>>> Requested by dougb >>> >>> Pre-creating pidfiles? That sounds weird. The common practise is to turn >>> eg. /var/run/.pid into /var/run//pid where directory >>> has appropriate permissions. Pre-creating pidfiles is simply wrong, >>> because applications create pidfile on start and unlink it on exit. >>> If application has no permission to remove files from /var/run/ it will >>> leave pidfile with stale PID in it, which is bad. Changing application >>> to truncate pidfile on exit instead of unlinking it also is a bad idea >>> especially because there is working solution - pid directory. >>> >> >> Hi, >> >> There's even worse problem - kernel closes pidfile in execvp() because of >> FD_CLOEXEC flag is set and daemon doesn't hold lock on pidfile. >> >> I reported about that earlier, but was ignored. GH> I don't understand your concern about this -- the daemon(8) program GH> exists to start a program that does not manage its own user authority or GH> pid file, and it is inappropriate to leak the open pidfile descriptor to GH> the program that daemon(8) execs. ref8-amd64:/home/trociny% uname -r 8.2-STABLE ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 daemon: process already running, pid: 19799 kopusha:~% uname -r 10.0-CURRENT kopusha:~% daemon -p /tmp/sleep.pid sleep 10 kopusha:~% daemon -p /tmp/sleep.pid sleep 10 kopusha:~% -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 19:50:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 507B4106564A; Sat, 4 Feb 2012 19:50:27 +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 3ACF78FC08; Sat, 4 Feb 2012 19:50:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14JoRTG049296; Sat, 4 Feb 2012 19:50:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14JoRdi049293; Sat, 4 Feb 2012 19:50:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202041950.q14JoRdi049293@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 4 Feb 2012 19:50: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: r230992 - in head/sys/powerpc: ofw ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 19:50:27 -0000 Author: nwhitehorn Date: Sat Feb 4 19:50:26 2012 New Revision: 230992 URL: http://svn.freebsd.org/changeset/base/230992 Log: Avoid warnings about duplicate modules. MFC after: 2 weeks Modified: head/sys/powerpc/ofw/ofw_syscons.c head/sys/powerpc/ps3/ps3_syscons.c Modified: head/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- head/sys/powerpc/ofw/ofw_syscons.c Sat Feb 4 18:14:49 2012 (r230991) +++ head/sys/powerpc/ofw/ofw_syscons.c Sat Feb 4 19:50:26 2012 (r230992) @@ -984,7 +984,7 @@ static driver_t ofwfb_sc_driver = { static devclass_t sc_devclass; -DRIVER_MODULE(sc, nexus, ofwfb_sc_driver, sc_devclass, 0, 0); +DRIVER_MODULE(ofwfb, nexus, ofwfb_sc_driver, sc_devclass, 0, 0); /* * Define a stub keyboard driver in case one hasn't been Modified: head/sys/powerpc/ps3/ps3_syscons.c ============================================================================== --- head/sys/powerpc/ps3/ps3_syscons.c Sat Feb 4 18:14:49 2012 (r230991) +++ head/sys/powerpc/ps3/ps3_syscons.c Sat Feb 4 19:50:26 2012 (r230992) @@ -749,7 +749,7 @@ static driver_t ps3fb_sc_driver = { static devclass_t sc_devclass; -DRIVER_MODULE(sc, nexus, ps3fb_sc_driver, sc_devclass, 0, 0); +DRIVER_MODULE(ps3fb, nexus, ps3fb_sc_driver, sc_devclass, 0, 0); /* * Define a stub keyboard driver in case one hasn't been From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 19:54:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80DA6106564A; Sat, 4 Feb 2012 19:54:14 +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 680968FC15; Sat, 4 Feb 2012 19:54:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14JsE99049456; Sat, 4 Feb 2012 19:54:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14JsE1S049451; Sat, 4 Feb 2012 19:54:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202041954.q14JsE1S049451@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 4 Feb 2012 19:54: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: r230993 - in head/sys/powerpc: ofw powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 19:54:14 -0000 Author: nwhitehorn Date: Sat Feb 4 19:54:13 2012 New Revision: 230993 URL: http://svn.freebsd.org/changeset/base/230993 Log: Unify OF PCI infrastructure, including changing from parsing the device tree based on heuristics to parsing it based on the spec. This should also lay the foundation for NEW_PCIB on PowerPC. MFC after: 3 months Added: head/sys/powerpc/ofw/ofw_pci.c (contents, props changed) head/sys/powerpc/ofw/ofw_pci.h (contents, props changed) Modified: head/sys/powerpc/powermac/cpcht.c head/sys/powerpc/powermac/grackle.c head/sys/powerpc/powermac/gracklevar.h head/sys/powerpc/powermac/uninorthpci.c head/sys/powerpc/powermac/uninorthvar.h Added: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/ofw/ofw_pci.c Sat Feb 4 19:54:13 2012 (r230993) @@ -0,0 +1,501 @@ +/*- + * Copyright (c) 2011 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +#include "pcib_if.h" + +/* + * Bus interface. + */ +static int ofw_pci_read_ivar(device_t, device_t, int, + uintptr_t *); +static struct resource * ofw_pci_alloc_resource(device_t bus, + device_t child, int type, int *rid, u_long start, + u_long end, u_long count, u_int flags); +static int ofw_pci_release_resource(device_t bus, device_t child, + int type, int rid, struct resource *res); +static int ofw_pci_activate_resource(device_t bus, device_t child, + int type, int rid, struct resource *res); +static int ofw_pci_deactivate_resource(device_t bus, + device_t child, int type, int rid, + struct resource *res); + +/* + * pcib interface. + */ +static int ofw_pci_maxslots(device_t); +static int ofw_pci_route_interrupt(device_t, device_t, int); + +/* + * ofw_bus interface + */ +static phandle_t ofw_pci_get_node(device_t bus, device_t dev); + +/* + * local methods + */ + +static int ofw_pci_nranges(phandle_t node); +static int ofw_pci_fill_ranges(phandle_t node, struct ofw_pci_range *ranges); + +/* + * Driver methods. + */ +static device_method_t ofw_pci_methods[] = { + /* Device interface */ + DEVMETHOD(device_attach, ofw_pci_attach), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_read_ivar, ofw_pci_read_ivar), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, ofw_pci_alloc_resource), + DEVMETHOD(bus_release_resource, ofw_pci_release_resource), + DEVMETHOD(bus_activate_resource, ofw_pci_activate_resource), + DEVMETHOD(bus_deactivate_resource, ofw_pci_deactivate_resource), + + /* pcib interface */ + DEVMETHOD(pcib_maxslots, ofw_pci_maxslots), + DEVMETHOD(pcib_route_interrupt, ofw_pci_route_interrupt), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, ofw_pci_get_node), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(ofw_pci, ofw_pci_driver, ofw_pci_methods, 0); + +int +ofw_pci_attach(device_t dev) +{ + struct ofw_pci_softc *sc; + phandle_t node; + u_int32_t busrange[2]; + struct ofw_pci_range *rp; + int error; + + node = ofw_bus_get_node(dev); + sc = device_get_softc(dev); + + if (OF_getprop(node, "reg", &sc->sc_pcir, sizeof(sc->sc_pcir)) == -1) + return (ENXIO); + + if (OF_getprop(node, "bus-range", busrange, sizeof(busrange)) != 8) + busrange[0] = 0; + + sc->sc_dev = dev; + sc->sc_node = node; + sc->sc_bus = busrange[0]; + + if (sc->sc_quirks & OFW_PCI_QUIRK_RANGES_ON_CHILDREN) { + phandle_t c; + int n, i; + + sc->sc_nrange = 0; + for (c = OF_child(node); c != 0; c = OF_peer(c)) { + n = ofw_pci_nranges(c); + if (n > 0) + sc->sc_nrange += n; + } + if (sc->sc_nrange == 0) + return (ENXIO); + sc->sc_range = malloc(sc->sc_nrange * sizeof(sc->sc_range[0]), + M_DEVBUF, M_WAITOK); + i = 0; + for (c = OF_child(node); c != 0; c = OF_peer(c)) { + n = ofw_pci_fill_ranges(c, &sc->sc_range[i]); + if (n > 0) + i += n; + } + KASSERT(i == sc->sc_nrange, ("range count mismatch")); + } else { + sc->sc_nrange = ofw_pci_nranges(node); + if (sc->sc_nrange <= 0) { + device_printf(dev, "could not get ranges\n"); + return (ENXIO); + } + sc->sc_range = malloc(sc->sc_nrange * sizeof(sc->sc_range[0]), + M_DEVBUF, M_WAITOK); + ofw_pci_fill_ranges(node, sc->sc_range); + } + + sc->sc_io_rman.rm_type = RMAN_ARRAY; + sc->sc_io_rman.rm_descr = "PCI I/O Ports"; + error = rman_init(&sc->sc_io_rman); + if (error) { + device_printf(dev, "rman_init() failed. error = %d\n", error); + return (error); + } + + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "PCI Memory"; + error = rman_init(&sc->sc_mem_rman); + if (error) { + device_printf(dev, "rman_init() failed. error = %d\n", error); + return (error); + } + + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && + rp->pci_hi != 0; rp++) { + error = 0; + + switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { + case OFW_PCI_PHYS_HI_SPACE_CONFIG: + break; + case OFW_PCI_PHYS_HI_SPACE_IO: + error = rman_manage_region(&sc->sc_io_rman, rp->pci, + rp->pci + rp->size - 1); + break; + case OFW_PCI_PHYS_HI_SPACE_MEM32: + case OFW_PCI_PHYS_HI_SPACE_MEM64: + error = rman_manage_region(&sc->sc_mem_rman, rp->pci, + rp->pci + rp->size - 1); + break; + } + + if (error) { + device_printf(dev, + "rman_manage_region(%x, %#jx, %#jx) failed. " + "error = %d\n", rp->pci_hi & + OFW_PCI_PHYS_HI_SPACEMASK, rp->pci, + rp->pci + rp->size - 1, error); + panic("AHOY"); + return (error); + } + } + + ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(cell_t)); + + device_add_child(dev, "pci", device_get_unit(dev)); + return (bus_generic_attach(dev)); +} + +static int +ofw_pci_maxslots(device_t dev) +{ + + return (PCI_SLOTMAX); +} + +static int +ofw_pci_route_interrupt(device_t bus, device_t dev, int pin) +{ + struct ofw_pci_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), + &iparent, maskbuf)) + return (MAP_IRQ(iparent, mintr)); + + /* Maybe it's a real interrupt, not an intpin */ + if (pin > 4) + return (pin); + + device_printf(bus, "could not route pin %d for device %d.%d\n", + pin, pci_get_slot(dev), pci_get_function(dev)); + return (PCI_INVALID_IRQ); +} + +static int +ofw_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct ofw_pci_softc *sc; + + sc = device_get_softc(dev); + + switch (which) { + case PCIB_IVAR_DOMAIN: + *result = device_get_unit(dev); + return (0); + case PCIB_IVAR_BUS: + *result = sc->sc_bus; + return (0); + } + + return (ENOENT); +} + +static struct resource * +ofw_pci_alloc_resource(device_t bus, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct ofw_pci_softc *sc; + struct resource *rv; + struct rman *rm; + int needactivate; + + needactivate = flags & RF_ACTIVE; + flags &= ~RF_ACTIVE; + + sc = device_get_softc(bus); + + switch (type) { + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + + case SYS_RES_IOPORT: + rm = &sc->sc_io_rman; + break; + + case SYS_RES_IRQ: + return (bus_alloc_resource(bus, type, rid, start, end, count, + flags)); + + default: + device_printf(bus, "unknown resource request from %s\n", + device_get_nameunit(child)); + return (NULL); + } + + rv = rman_reserve_resource(rm, start, end, count, flags, child); + if (rv == NULL) { + device_printf(bus, "failed to reserve resource for %s\n", + device_get_nameunit(child)); + return (NULL); + } + + rman_set_rid(rv, *rid); + + if (needactivate) { + if (bus_activate_resource(child, type, *rid, rv) != 0) { + device_printf(bus, + "failed to activate resource for %s\n", + device_get_nameunit(child)); + rman_release_resource(rv); + return (NULL); + } + } + + return (rv); +} + +static int +ofw_pci_release_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + if (rman_get_flags(res) & RF_ACTIVE) { + int error = bus_deactivate_resource(child, type, rid, res); + if (error) + return error; + } + + return (rman_release_resource(res)); +} + +static int +ofw_pci_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + struct ofw_pci_softc *sc; + void *p; + + sc = device_get_softc(bus); + + if (type == SYS_RES_IRQ) { + return (bus_activate_resource(bus, type, rid, res)); + } + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + struct ofw_pci_range *rp; + vm_offset_t start; + int space; + + start = (vm_offset_t)rman_get_start(res); + + /* + * Map this through the ranges list + */ + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && + rp->pci_hi != 0; rp++) { + if (start < rp->pci || start >= rp->pci + rp->size) + continue; + + switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { + case OFW_PCI_PHYS_HI_SPACE_IO: + space = SYS_RES_IOPORT; + break; + case OFW_PCI_PHYS_HI_SPACE_MEM32: + case OFW_PCI_PHYS_HI_SPACE_MEM64: + space = SYS_RES_MEMORY; + break; + default: + space = -1; + } + + if (type == space) { + start += (rp->host - rp->pci); + break; + } + } + + if (bootverbose) + printf("ofw_pci mapdev: start %zx, len %ld\n", start, + rman_get_size(res)); + + p = pmap_mapdev(start, (vm_size_t)rman_get_size(res)); + if (p == NULL) + return (ENOMEM); + + rman_set_virtual(res, p); + rman_set_bustag(res, &bs_le_tag); + rman_set_bushandle(res, (u_long)p); + } + + return (rman_activate_resource(res)); +} + +static int +ofw_pci_deactivate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + /* + * If this is a memory resource, unmap it. + */ + if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { + u_int32_t psize; + + psize = rman_get_size(res); + pmap_unmapdev((vm_offset_t)rman_get_virtual(res), psize); + } + + return (rman_deactivate_resource(res)); +} + +static phandle_t +ofw_pci_get_node(device_t bus, device_t dev) +{ + struct ofw_pci_softc *sc; + + sc = device_get_softc(bus); + /* We only have one child, the PCI bus, which needs our own node. */ + + return (sc->sc_node); +} + +static int +ofw_pci_nranges(phandle_t node) +{ + int host_address_cells = 1, pci_address_cells = 3, size_cells = 2; + ssize_t nbase_ranges; + + OF_getprop(OF_parent(node), "#address-cells", &host_address_cells, + sizeof(host_address_cells)); + OF_getprop(node, "#address-cells", &pci_address_cells, + sizeof(pci_address_cells)); + OF_getprop(node, "#size-cells", &size_cells, sizeof(size_cells)); + + nbase_ranges = OF_getproplen(node, "ranges"); + if (nbase_ranges <= 0) + return (-1); + + return (nbase_ranges / sizeof(cell_t) / + (pci_address_cells + host_address_cells + size_cells)); +} + +static int +ofw_pci_fill_ranges(phandle_t node, struct ofw_pci_range *ranges) +{ + int host_address_cells = 1, pci_address_cells = 3, size_cells = 2; + cell_t *base_ranges; + ssize_t nbase_ranges; + int nranges; + int i, j, k; + + OF_getprop(OF_parent(node), "#address-cells", &host_address_cells, + sizeof(host_address_cells)); + OF_getprop(node, "#address-cells", &pci_address_cells, + sizeof(pci_address_cells)); + OF_getprop(node, "#size-cells", &size_cells, sizeof(size_cells)); + + nbase_ranges = OF_getproplen(node, "ranges"); + if (nbase_ranges <= 0) + return (-1); + nranges = nbase_ranges / sizeof(cell_t) / + (pci_address_cells + host_address_cells + size_cells); + + base_ranges = malloc(nbase_ranges, M_DEVBUF, M_WAITOK); + OF_getprop(node, "ranges", base_ranges, nbase_ranges); + + for (i = 0, j = 0; i < nranges; i++) { + ranges[i].pci_hi = base_ranges[j++]; + ranges[i].pci = 0; + for (k = 0; k < pci_address_cells - 1; k++) { + ranges[i].pci <<= 32; + ranges[i].pci |= base_ranges[j++]; + } + ranges[i].host = 0; + for (k = 0; k < host_address_cells; k++) { + ranges[i].host <<= 32; + ranges[i].host |= base_ranges[j++]; + } + ranges[i].size = 0; + for (k = 0; k < size_cells; k++) { + ranges[i].size <<= 32; + ranges[i].size |= base_ranges[j++]; + } + } + + free(base_ranges, M_DEVBUF); + return (nranges); +} + Added: head/sys/powerpc/ofw/ofw_pci.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/ofw/ofw_pci.h Sat Feb 4 19:54:13 2012 (r230993) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2011 Nathan Whitehorn + * 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 POWERPC_OFW_OFW_PCI_H +#define POWERPC_OFW_OFW_PCI_H + +/* + * Export class definition for inheritance purposes + */ +DECLARE_CLASS(ofw_pci_driver); + +struct ofw_pci_range { + uint32_t pci_hi; + uint64_t pci; + uint64_t host; + uint64_t size; +}; + +/* + * Quirks for some adapters + */ +enum { + OFW_PCI_QUIRK_RANGES_ON_CHILDREN = 1, +}; + +struct ofw_pci_softc { + device_t sc_dev; + phandle_t sc_node; + int sc_bus; + + int sc_quirks; + + struct ofw_pci_register sc_pcir; + + struct ofw_pci_range *sc_range; + int sc_nrange; + + struct rman sc_io_rman; + struct rman sc_mem_rman; + bus_space_tag_t sc_memt; + bus_dma_tag_t sc_dmat; + + struct ofw_bus_iinfo sc_pci_iinfo; +}; + +int ofw_pci_attach(device_t dev); + +#endif // POWERPC_OFW_OFW_PCI_H + Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Sat Feb 4 19:50:26 2012 (r230992) +++ head/sys/powerpc/powermac/cpcht.c Sat Feb 4 19:54:13 2012 (r230993) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -66,30 +67,13 @@ static int cpcht_attach(device_t); static void cpcht_configure_htbridge(device_t, phandle_t); /* - * Bus interface. - */ -static int cpcht_read_ivar(device_t, device_t, int, - uintptr_t *); -static struct resource *cpcht_alloc_resource(device_t bus, device_t child, - int type, int *rid, u_long start, u_long end, - u_long count, u_int flags); -static int cpcht_activate_resource(device_t bus, device_t child, - int type, int rid, struct resource *res); -static int cpcht_release_resource(device_t bus, device_t child, - int type, int rid, struct resource *res); -static int cpcht_deactivate_resource(device_t bus, device_t child, - int type, int rid, struct resource *res); - -/* * pcib interface. */ -static int cpcht_maxslots(device_t); static u_int32_t cpcht_read_config(device_t, u_int, u_int, u_int, u_int, int); static void cpcht_write_config(device_t, u_int, u_int, u_int, u_int, u_int32_t, int); -static int cpcht_route_interrupt(device_t bus, device_t dev, - int pin); +static int cpcht_route_interrupt(device_t, device_t, int); 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, @@ -102,12 +86,6 @@ static int cpcht_map_msi(device_t dev, int irq, uint64_t *addr, uint32_t *data); /* - * ofw_bus interface - */ - -static phandle_t cpcht_get_node(device_t bus, device_t child); - -/* * Driver methods. */ static device_method_t cpcht_methods[] = { @@ -115,17 +93,7 @@ static device_method_t cpcht_methods[] = DEVMETHOD(device_probe, cpcht_probe), DEVMETHOD(device_attach, cpcht_attach), - /* Bus interface */ - DEVMETHOD(bus_read_ivar, cpcht_read_ivar), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - DEVMETHOD(bus_alloc_resource, cpcht_alloc_resource), - DEVMETHOD(bus_release_resource, cpcht_release_resource), - DEVMETHOD(bus_activate_resource, cpcht_activate_resource), - DEVMETHOD(bus_deactivate_resource, cpcht_deactivate_resource), - /* pcib interface */ - DEVMETHOD(pcib_maxslots, cpcht_maxslots), DEVMETHOD(pcib_read_config, cpcht_read_config), DEVMETHOD(pcib_write_config, cpcht_write_config), DEVMETHOD(pcib_route_interrupt, cpcht_route_interrupt), @@ -135,9 +103,6 @@ static device_method_t cpcht_methods[] = 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), - DEVMETHOD_END }; @@ -158,25 +123,17 @@ static struct cpcht_irq *cpcht_irqmap = uint32_t cpcht_msipic = 0; struct cpcht_softc { - device_t sc_dev; - phandle_t sc_node; + struct ofw_pci_softc pci_sc; vm_offset_t sc_data; uint64_t sc_populated_slots; - struct rman sc_mem_rman; - struct rman sc_io_rman; struct cpcht_irq htirq_map[128]; struct mtx htirq_mtx; }; -static driver_t cpcht_driver = { - "pcib", - cpcht_methods, - sizeof(struct cpcht_softc) -}; - static devclass_t cpcht_devclass; - +DEFINE_CLASS_1(pcib, cpcht_driver, cpcht_methods, sizeof(struct cpcht_softc), + ofw_pci_driver); DRIVER_MODULE(cpcht, nexus, cpcht_driver, cpcht_devclass, 0, 0); #define CPCHT_IOPORT_BASE 0xf4000000UL /* Hardwired */ @@ -186,17 +143,6 @@ DRIVER_MODULE(cpcht, nexus, cpcht_driver #define HTAPIC_TRIGGER_LEVEL 0x02 #define HTAPIC_MASK 0x01 -struct cpcht_range { - u_int32_t pci_hi; - u_int32_t pci_mid; - u_int32_t pci_lo; - u_int32_t junk; - u_int32_t host_hi; - u_int32_t host_lo; - u_int32_t size_hi; - u_int32_t size_lo; -}; - static int cpcht_probe(device_t dev) { @@ -214,7 +160,6 @@ cpcht_probe(device_t dev) if (strcmp(compatible, "u3-ht") != 0) return (ENXIO); - device_set_desc(dev, "IBM CPC9X5 HyperTransport Tunnel"); return (0); } @@ -225,7 +170,7 @@ cpcht_attach(device_t dev) struct cpcht_softc *sc; phandle_t node, child; u_int32_t reg[3]; - int i, error; + int i; node = ofw_bus_get_node(dev); sc = device_get_softc(dev); @@ -233,35 +178,20 @@ cpcht_attach(device_t dev) if (OF_getprop(node, "reg", reg, sizeof(reg)) < 12) return (ENXIO); - sc->sc_dev = dev; - sc->sc_node = node; + sc->pci_sc.sc_quirks = OFW_PCI_QUIRK_RANGES_ON_CHILDREN; sc->sc_populated_slots = 0; sc->sc_data = (vm_offset_t)pmap_mapdev(reg[1], reg[2]); - sc->sc_mem_rman.rm_type = RMAN_ARRAY; - sc->sc_mem_rman.rm_descr = "CPCHT Device Memory"; - error = rman_init(&sc->sc_mem_rman); - if (error) { - device_printf(dev, "rman_init() failed. error = %d\n", error); - return (error); - } - - sc->sc_io_rman.rm_type = RMAN_ARRAY; - sc->sc_io_rman.rm_descr = "CPCHT I/O Memory"; - error = rman_init(&sc->sc_io_rman); - if (error) { - device_printf(dev, "rman_init() failed. error = %d\n", error); - return (error); - } - /* * Set up the resource manager and the HT->MPIC mapping. For cpcht, * the ranges are properties of the child bridges, and this is also * where we get the HT interrupts properties. */ +#if 0 /* I/O port mappings are usually not in the device tree */ - rman_manage_region(&sc->sc_io_rman, 0, CPCHT_IOPORT_SIZE - 1); + rman_manage_region(&sc->pci_sc.sc_io_rman, 0, CPCHT_IOPORT_SIZE - 1); +#endif bzero(sc->htirq_map, sizeof(sc->htirq_map)); mtx_init(&sc->htirq_mtx, "cpcht irq", NULL, MTX_DEF); @@ -273,9 +203,7 @@ cpcht_attach(device_t dev) /* Now make the mapping table available to the MPIC */ cpcht_irqmap = sc->htirq_map; - device_add_child(dev, "pci", device_get_unit(dev)); - - return (bus_generic_attach(dev)); + return (ofw_pci_attach(dev)); } static void @@ -283,8 +211,7 @@ cpcht_configure_htbridge(device_t dev, p { struct cpcht_softc *sc; struct ofw_pci_register pcir; - struct cpcht_range ranges[7], *rp; - int nranges, ptr, nextptr; + int ptr, nextptr; uint32_t vend, val; int i, nirq, irq; u_int f, s; @@ -303,32 +230,6 @@ cpcht_configure_htbridge(device_t dev, p sc->sc_populated_slots |= (1 << s); /* - * Next grab this child bus's bus ranges. - */ - bzero(ranges, sizeof(ranges)); - nranges = OF_getprop(child, "ranges", ranges, sizeof(ranges)); - nranges /= sizeof(ranges[0]); - - ranges[6].pci_hi = 0; - for (rp = ranges; rp < ranges + nranges && rp->pci_hi != 0; rp++) { - switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { - case OFW_PCI_PHYS_HI_SPACE_CONFIG: - break; - case OFW_PCI_PHYS_HI_SPACE_IO: - rman_manage_region(&sc->sc_io_rman, rp->pci_lo, - rp->pci_lo + rp->size_lo - 1); - break; - case OFW_PCI_PHYS_HI_SPACE_MEM32: - rman_manage_region(&sc->sc_mem_rman, rp->pci_lo, - rp->pci_lo + rp->size_lo - 1); - break; - case OFW_PCI_PHYS_HI_SPACE_MEM64: - panic("64-bit CPCHT reserved memory!"); - break; - } - } - - /* * Next build up any HT->MPIC mappings for this sub-bus. One would * naively hope that enabling, disabling, and EOIing interrupts would * cause the appropriate HT bus transactions to that effect. This is @@ -404,13 +305,6 @@ cpcht_configure_htbridge(device_t dev, p } } -static int -cpcht_maxslots(device_t dev) -{ - - return (PCI_SLOTMAX); -} - static u_int32_t cpcht_read_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, int width) @@ -474,156 +368,11 @@ cpcht_write_config(device_t dev, u_int b } static int -cpcht_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) -{ - switch (which) { - case PCIB_IVAR_DOMAIN: - *result = device_get_unit(dev); - return (0); - case PCIB_IVAR_BUS: - *result = 0; /* Root bus */ - return (0); - } - - return (ENOENT); -} - -static phandle_t -cpcht_get_node(device_t bus, device_t dev) -{ - struct cpcht_softc *sc; - - sc = device_get_softc(bus); - /* We only have one child, the PCI bus, which needs our own node. */ - return (sc->sc_node); -} - -static int cpcht_route_interrupt(device_t bus, device_t dev, int pin) { return (pin); } -static struct resource * -cpcht_alloc_resource(device_t bus, device_t child, int type, int *rid, - u_long start, u_long end, u_long count, u_int flags) -{ - struct cpcht_softc *sc; - struct resource *rv; - struct rman *rm; - int needactivate; - - needactivate = flags & RF_ACTIVE; - flags &= ~RF_ACTIVE; - - sc = device_get_softc(bus); - - switch (type) { - case SYS_RES_IOPORT: - end = min(end, start + count); - rm = &sc->sc_io_rman; - break; - - case SYS_RES_MEMORY: - rm = &sc->sc_mem_rman; - break; - - case SYS_RES_IRQ: - return (bus_alloc_resource(bus, type, rid, start, end, count, - flags)); - - default: - device_printf(bus, "unknown resource request from %s\n", - device_get_nameunit(child)); - return (NULL); - } - - rv = rman_reserve_resource(rm, start, end, count, flags, child); - if (rv == NULL) { - device_printf(bus, "failed to reserve resource for %s\n", - device_get_nameunit(child)); - return (NULL); - } - - rman_set_rid(rv, *rid); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv) != 0) { - device_printf(bus, - "failed to activate resource for %s\n", - device_get_nameunit(child)); - rman_release_resource(rv); - return (NULL); - } - } - - return (rv); -} - -static int -cpcht_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) -{ - void *p; - - if (type == SYS_RES_IRQ) - return (bus_activate_resource(bus, type, rid, res)); - - if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { - vm_offset_t start; - - start = (vm_offset_t)rman_get_start(res); - - if (type == SYS_RES_IOPORT) - start += CPCHT_IOPORT_BASE; - - if (bootverbose) - printf("cpcht mapdev: start %zx, len %ld\n", start, - rman_get_size(res)); - - p = pmap_mapdev(start, (vm_size_t)rman_get_size(res)); - if (p == NULL) - return (ENOMEM); - rman_set_virtual(res, p); - rman_set_bustag(res, &bs_le_tag); - rman_set_bushandle(res, (u_long)p); - } - - return (rman_activate_resource(res)); -} - -static int -cpcht_release_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) -{ - - if (rman_get_flags(res) & RF_ACTIVE) { - int error = bus_deactivate_resource(child, type, rid, res); - if (error) - return error; - } - - return (rman_release_resource(res)); -} - -static int -cpcht_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *res) -{ - - /* - * If this is a memory resource, unmap it. - */ - if ((type == SYS_RES_MEMORY) || (type == SYS_RES_IOPORT)) { - u_int32_t psize; - - psize = rman_get_size(res); - pmap_unmapdev((vm_offset_t)rman_get_virtual(res), psize); - } - - return (rman_deactivate_resource(res)); -} - static int cpcht_alloc_msi(device_t dev, device_t child, int count, int maxcount, int *irqs) Modified: head/sys/powerpc/powermac/grackle.c ============================================================================== --- head/sys/powerpc/powermac/grackle.c Sat Feb 4 19:50:26 2012 (r230992) +++ head/sys/powerpc/powermac/grackle.c Sat Feb 4 19:54:13 2012 (r230993) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 20:04:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47868106566B; Sat, 4 Feb 2012 20:04:36 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 326978FC17; Sat, 4 Feb 2012 20:04:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14K4aLO049844; Sat, 4 Feb 2012 20:04:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14K4ax4049842; Sat, 4 Feb 2012 20:04:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202042004.q14K4ax4049842@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 4 Feb 2012 20:04: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: r230994 - head/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 20:04:36 -0000 Author: nwhitehorn Date: Sat Feb 4 20:04:35 2012 New Revision: 230994 URL: http://svn.freebsd.org/changeset/base/230994 Log: Miffed r230993 due to a one-character typo while reviewing the patch. Modified: head/sys/powerpc/powermac/grackle.c Modified: head/sys/powerpc/powermac/grackle.c ============================================================================== --- head/sys/powerpc/powermac/grackle.c Sat Feb 4 19:54:13 2012 (r230993) +++ head/sys/powerpc/powermac/grackle.c Sat Feb 4 20:04:35 2012 (r230994) @@ -98,7 +98,7 @@ static device_method_t grackle_methods[] }; static devclass_t grackle_devclass; -DEFINE_CLASS_1(pci, grackle_driver, grackle_methods, +DEFINE_CLASS_1(pcib, grackle_driver, grackle_methods, sizeof(struct grackle_softc), ofw_pci_driver); DRIVER_MODULE(grackle, nexus, grackle_driver, grackle_devclass, 0, 0); From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 20:09:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6774D106564A; Sat, 4 Feb 2012 20:09:07 +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 513868FC12; Sat, 4 Feb 2012 20:09:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14K97wV050018; Sat, 4 Feb 2012 20:09:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14K97Ra050016; Sat, 4 Feb 2012 20:09:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202042009.q14K97Ra050016@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 4 Feb 2012 20:09: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: r230995 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 20:09:07 -0000 Author: nwhitehorn Date: Sat Feb 4 20:09:06 2012 New Revision: 230995 URL: http://svn.freebsd.org/changeset/base/230995 Log: Missed file in r230993. Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Feb 4 20:04:35 2012 (r230994) +++ head/sys/conf/files.powerpc Sat Feb 4 20:09:06 2012 (r230995) @@ -133,6 +133,7 @@ powerpc/mpc85xx/openpic_fdt.c optional f powerpc/mpc85xx/pci_fdt.c optional pci mpc85xx powerpc/ofw/ofw_cpu.c optional aim powerpc/ofw/ofw_machdep.c optional aim +powerpc/ofw/ofw_pci.c optional pci aim powerpc/ofw/ofw_pcibus.c optional pci aim powerpc/ofw/ofw_pcib_pci.c optional pci aim powerpc/ofw/ofw_real.c optional aim From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 20:17:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C734F106566B; Sat, 4 Feb 2012 20:17:07 +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 B1BE38FC08; Sat, 4 Feb 2012 20:17:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14KH7Kf050344; Sat, 4 Feb 2012 20:17:07 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14KH72v050342; Sat, 4 Feb 2012 20:17:07 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201202042017.q14KH72v050342@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 4 Feb 2012 20:17: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: r230996 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 20:17:07 -0000 Author: pjd Date: Sat Feb 4 20:17:07 2012 New Revision: 230996 URL: http://svn.freebsd.org/changeset/base/230996 Log: After multiple requests for back out, after multiple promisses from adrian@ to fix it (without fixing it), after making one of my servers unbootable, after now making also my laptop unbootable and after running out of patiance back out r229800 until better solution is found. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Feb 4 20:09:06 2012 (r230995) +++ head/sys/conf/files Sat Feb 4 20:17:07 2012 (r230996) @@ -2405,9 +2405,8 @@ kern/sched_ule.c optional sched_ule kern/serdev_if.m standard kern/stack_protector.c standard \ compile-with "${NORMAL_C:N-fstack-protector*}" -# XXX subr_acl_nfs4.c is also used by ZFS -kern/subr_acl_nfs4.c optional ufs_acl -kern/subr_acl_posix1e.c optional ufs_acl +kern/subr_acl_nfs4.c standard +kern/subr_acl_posix1e.c standard kern/subr_autoconf.c standard kern/subr_blist.c standard kern/subr_bus.c standard From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 23:00:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64464106564A; Sat, 4 Feb 2012 23:00: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 4E9B88FC15; Sat, 4 Feb 2012 23:00:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14N0Sd8055617; Sat, 4 Feb 2012 23:00:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14N0SYD055615; Sat, 4 Feb 2012 23:00:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202042300.q14N0SYD055615@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 4 Feb 2012 23:00:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230997 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 23:00:28 -0000 Author: nwhitehorn Date: Sat Feb 4 23:00:27 2012 New Revision: 230997 URL: http://svn.freebsd.org/changeset/base/230997 Log: Fix installation script after r230482 -- a missing character apparently. Now, back to convalescing. Modified: head/release/rc.local Modified: head/release/rc.local ============================================================================== --- head/release/rc.local Sat Feb 4 20:17:07 2012 (r230996) +++ head/release/rc.local Sat Feb 4 23:00:27 2012 (r230997) @@ -18,7 +18,7 @@ if [ $? -eq 0 ]; then # goes multiuser touch /tmp/bsdinstall_log tail -f /tmp/bsdinstall_log > /dev/ttyv2 & - /usr/libexec/getty autologin ttyv3 + /usr/libexec/getty autologin ttyv3 & EXTERNAL_VTY_STARTED=1 fi else From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 23:12:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB619106564A; Sat, 4 Feb 2012 23:12:15 +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 7B8C58FC14; Sat, 4 Feb 2012 23:12:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14NCFbn056000; Sat, 4 Feb 2012 23:12:15 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14NCFPQ055994; Sat, 4 Feb 2012 23:12:15 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202042312.q14NCFPQ055994@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 4 Feb 2012 23:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230998 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 23:12:15 -0000 Author: jilles Date: Sat Feb 4 23:12:14 2012 New Revision: 230998 URL: http://svn.freebsd.org/changeset/base/230998 Log: sh: Use vfork in a few common cases. This uses vfork() for simple commands and command substitutions containing a single simple command, invoking an external program under certain conditions (no redirections or variable assignments, non-interactive shell, no job control). These restrictions limit the amount of code executed in a vforked child. There is a large speedup (for example 35%) in microbenchmarks. The difference in buildkernel is smaller (for example 0.5%) but still statistically significant. See http://lists.freebsd.org/pipermail/freebsd-hackers/2012-January/037581.html for some numbers. The use of vfork() can be disabled by setting a variable named SH_DISABLE_VFORK. Modified: head/bin/sh/eval.c head/bin/sh/jobs.c head/bin/sh/jobs.h head/bin/sh/var.c head/bin/sh/var.h Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sat Feb 4 23:00:27 2012 (r230997) +++ head/bin/sh/eval.c Sat Feb 4 23:12:14 2012 (r230998) @@ -921,6 +921,15 @@ evalcommand(union node *cmd, int flags, if (pipe(pip) < 0) error("Pipe call failed: %s", strerror(errno)); } + if (cmdentry.cmdtype == CMDNORMAL && + cmd->ncmd.redirect == NULL && + varlist.list == NULL && + (mode == FORK_FG || mode == FORK_NOJOB) && + !disvforkset() && !iflag && !mflag) { + vforkexecshell(jp, argv, environment(), path, + cmdentry.u.index, flags & EV_BACKCMD ? pip : NULL); + goto parent; + } if (forkshell(jp, cmd, mode) != 0) goto parent; /* at end of routine */ if (flags & EV_BACKCMD) { Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat Feb 4 23:00:27 2012 (r230997) +++ head/bin/sh/jobs.c Sat Feb 4 23:12:14 2012 (r230998) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #undef CEOF /* syntax.h redefines this */ #endif #include "redir.h" +#include "exec.h" #include "show.h" #include "main.h" #include "parser.h" @@ -885,6 +886,54 @@ forkshell(struct job *jp, union node *n, } +pid_t +vforkexecshell(struct job *jp, char **argv, char **envp, const char *path, int idx, int pip[2]) +{ + pid_t pid; + struct jmploc jmploc; + struct jmploc *savehandler; + + TRACE(("vforkexecshell(%%%td, %p, %d) called\n", jp - jobtab, (void *)n, + mode)); + INTOFF; + flushall(); + savehandler = handler; + pid = vfork(); + if (pid == -1) { + TRACE(("Vfork failed, errno=%d\n", errno)); + INTON; + error("Cannot fork: %s", strerror(errno)); + } + if (pid == 0) { + TRACE(("Child shell %d\n", (int)getpid())); + if (setjmp(jmploc.loc)) + _exit(exception == EXEXEC ? exerrno : 2); + if (pip != NULL) { + close(pip[0]); + if (pip[1] != 1) { + dup2(pip[1], 1); + close(pip[1]); + } + } + handler = &jmploc; + shellexec(argv, envp, path, idx); + } + handler = savehandler; + if (jp) { + struct procstat *ps = &jp->ps[jp->nprocs++]; + ps->pid = pid; + ps->status = -1; + ps->cmd = nullstr; + jp->foreground = 1; +#if JOBS + setcurjob(jp); +#endif + } + INTON; + TRACE(("In parent shell: child = %d\n", (int)pid)); + return pid; +} + /* * Wait for job to finish. Modified: head/bin/sh/jobs.h ============================================================================== --- head/bin/sh/jobs.h Sat Feb 4 23:00:27 2012 (r230997) +++ head/bin/sh/jobs.h Sat Feb 4 23:12:14 2012 (r230998) @@ -91,6 +91,7 @@ void setjobctl(int); void showjobs(int, int); struct job *makejob(union node *, int); pid_t forkshell(struct job *, union node *, int); +pid_t vforkexecshell(struct job *, char **, char **, const char *, int, int []); int waitforjob(struct job *, int *); int stoppedjobs(void); int backgndpidset(void); Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Sat Feb 4 23:00:27 2012 (r230997) +++ head/bin/sh/var.c Sat Feb 4 23:12:14 2012 (r230998) @@ -94,6 +94,7 @@ struct var vps2; struct var vps4; struct var vvers; static struct var voptind; +struct var vdisvfork; int forcelocal; @@ -125,6 +126,8 @@ static const struct varinit varinit[] = #endif { &voptind, 0, "OPTIND=1", getoptsreset }, + { &vdisvfork, VUNSET, "SH_DISABLE_VFORK=", + NULL }, { NULL, 0, NULL, NULL } }; Modified: head/bin/sh/var.h ============================================================================== --- head/bin/sh/var.h Sat Feb 4 23:00:27 2012 (r230997) +++ head/bin/sh/var.h Sat Feb 4 23:12:14 2012 (r230998) @@ -79,6 +79,7 @@ extern struct var vppid; extern struct var vps1; extern struct var vps2; extern struct var vps4; +extern struct var vdisvfork; #ifndef NO_HISTORY extern struct var vhistsize; extern struct var vterm; @@ -109,6 +110,7 @@ extern int initial_localeisutf8; #endif #define mpathset() ((vmpath.flags & VUNSET) == 0) +#define disvforkset() ((vdisvfork.flags & VUNSET) == 0) void initvar(void); void setvar(const char *, const char *, int); From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 23:25:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73F18106566B; Sat, 4 Feb 2012 23:25:19 +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 545528FC15; Sat, 4 Feb 2012 23:25:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14NPJmN056447; Sat, 4 Feb 2012 23:25:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14NPJ7L056445; Sat, 4 Feb 2012 23:25:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202042325.q14NPJ7L056445@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 4 Feb 2012 23:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230999 - head/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 23:25:19 -0000 Author: nwhitehorn Date: Sat Feb 4 23:25:18 2012 New Revision: 230999 URL: http://svn.freebsd.org/changeset/base/230999 Log: Compatibility with IBM firmware. Modified: head/sys/powerpc/powermac/cpcht.c Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Sat Feb 4 23:12:14 2012 (r230998) +++ head/sys/powerpc/powermac/cpcht.c Sat Feb 4 23:25:18 2012 (r230999) @@ -178,7 +178,8 @@ cpcht_attach(device_t dev) if (OF_getprop(node, "reg", reg, sizeof(reg)) < 12) return (ENXIO); - sc->pci_sc.sc_quirks = OFW_PCI_QUIRK_RANGES_ON_CHILDREN; + if (OF_getproplen(node, "ranges") <= 0) + sc->pci_sc.sc_quirks = OFW_PCI_QUIRK_RANGES_ON_CHILDREN; sc->sc_populated_slots = 0; sc->sc_data = (vm_offset_t)pmap_mapdev(reg[1], reg[2]); @@ -214,12 +215,13 @@ cpcht_configure_htbridge(device_t dev, p int ptr, nextptr; uint32_t vend, val; int i, nirq, irq; - u_int f, s; + u_int b, f, s; sc = device_get_softc(dev); if (OF_getprop(child, "reg", &pcir, sizeof(pcir)) == -1) return; + b = OFW_PCI_PHYS_HI_BUS(pcir.phys_hi); s = OFW_PCI_PHYS_HI_DEVICE(pcir.phys_hi); f = OFW_PCI_PHYS_HI_FUNCTION(pcir.phys_hi); @@ -242,41 +244,41 @@ cpcht_configure_htbridge(device_t dev, p */ /* All the devices we are interested in have caps */ - if (!(PCIB_READ_CONFIG(dev, 0, s, f, PCIR_STATUS, 2) + if (!(PCIB_READ_CONFIG(dev, b, s, f, PCIR_STATUS, 2) & PCIM_STATUS_CAPPRESENT)) return; - nextptr = PCIB_READ_CONFIG(dev, 0, s, f, PCIR_CAP_PTR, 1); + nextptr = PCIB_READ_CONFIG(dev, b, s, f, PCIR_CAP_PTR, 1); while (nextptr != 0) { ptr = nextptr; - nextptr = PCIB_READ_CONFIG(dev, 0, s, f, + nextptr = PCIB_READ_CONFIG(dev, b, s, f, ptr + PCICAP_NEXTPTR, 1); /* Find the HT IRQ capabilities */ - if (PCIB_READ_CONFIG(dev, 0, s, f, + if (PCIB_READ_CONFIG(dev, b, s, f, ptr + PCICAP_ID, 1) != PCIY_HT) continue; - val = PCIB_READ_CONFIG(dev, 0, s, f, ptr + PCIR_HT_COMMAND, 2); + val = PCIB_READ_CONFIG(dev, b, s, f, ptr + PCIR_HT_COMMAND, 2); if ((val & PCIM_HTCMD_CAP_MASK) != PCIM_HTCAP_INTERRUPT) continue; /* Ask for the IRQ count */ - PCIB_WRITE_CONFIG(dev, 0, s, f, ptr + PCIR_HT_COMMAND, 0x1, 1); - nirq = PCIB_READ_CONFIG(dev, 0, s, f, ptr + 4, 4); + PCIB_WRITE_CONFIG(dev, b, s, f, ptr + PCIR_HT_COMMAND, 0x1, 1); + nirq = PCIB_READ_CONFIG(dev, b, s, f, ptr + 4, 4); nirq = ((nirq >> 16) & 0xff) + 1; device_printf(dev, "%d HT IRQs on device %d.%d\n", nirq, s, f); for (i = 0; i < nirq; i++) { - PCIB_WRITE_CONFIG(dev, 0, s, f, + PCIB_WRITE_CONFIG(dev, b, s, f, ptr + PCIR_HT_COMMAND, 0x10 + (i << 1), 1); - irq = PCIB_READ_CONFIG(dev, 0, s, f, ptr + 4, 4); + irq = PCIB_READ_CONFIG(dev, b, s, f, ptr + 4, 4); /* * Mask this interrupt for now. */ - PCIB_WRITE_CONFIG(dev, 0, s, f, ptr + 4, + PCIB_WRITE_CONFIG(dev, b, s, f, ptr + 4, irq | HTAPIC_MASK, 4); irq = (irq >> 16) & 0xff; @@ -285,10 +287,10 @@ cpcht_configure_htbridge(device_t dev, p sc->htirq_map[irq].ht_base = sc->sc_data + (((((s & 0x1f) << 3) | (f & 0x07)) << 8) | (ptr)); - PCIB_WRITE_CONFIG(dev, 0, s, f, + PCIB_WRITE_CONFIG(dev, b, s, f, ptr + PCIR_HT_COMMAND, 0x11 + (i << 1), 1); sc->htirq_map[irq].eoi_data = - PCIB_READ_CONFIG(dev, 0, s, f, ptr + 4, 4) | + PCIB_READ_CONFIG(dev, b, s, f, ptr + 4, 4) | 0x80000000; /* @@ -296,7 +298,7 @@ cpcht_configure_htbridge(device_t dev, p * in how we signal EOIs. Check if this device was * made by Apple, and act accordingly. */ - vend = PCIB_READ_CONFIG(dev, 0, s, f, + vend = PCIB_READ_CONFIG(dev, b, s, f, PCIR_DEVVENDOR, 4); if ((vend & 0xffff) == 0x106b) sc->htirq_map[irq].apple_eoi = From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 23:29:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6383B106566B; Sat, 4 Feb 2012 23:29:08 +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 4DE158FC17; Sat, 4 Feb 2012 23:29:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14NT8wm056657; Sat, 4 Feb 2012 23:29:08 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14NT8ro056655; Sat, 4 Feb 2012 23:29:08 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202042329.q14NT8ro056655@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 4 Feb 2012 23:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231001 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 23:29:08 -0000 Author: jilles Date: Sat Feb 4 23:29:07 2012 New Revision: 231001 URL: http://svn.freebsd.org/changeset/base/231001 Log: sh: Fix swapped INTON/INTOFF. A possible consequence of this bug was a memory leak if SIGINT arrived during a 'set' command (listing variables). MFC after: 1 week Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Sat Feb 4 23:27:16 2012 (r231000) +++ head/bin/sh/var.c Sat Feb 4 23:29:07 2012 (r231001) @@ -603,7 +603,7 @@ showvarscmd(int argc __unused, char **ar } } - INTON; + INTOFF; vars = ckmalloc(n * sizeof(*vars)); i = 0; for (vpp = vartab; vpp < vartab + VTABSIZE; vpp++) { @@ -628,7 +628,7 @@ showvarscmd(int argc __unused, char **ar out1c('\n'); } ckfree(vars); - INTOFF; + INTON; return 0; }