From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 00:46:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9733B106566C; Sun, 26 Aug 2012 00:46:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82A488FC0C; Sun, 26 Aug 2012 00:46: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 q7Q0kwS1025556; Sun, 26 Aug 2012 00:46:58 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q0kwg0025554; Sun, 26 Aug 2012 00:46:58 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208260046.q7Q0kwg0025554@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 26 Aug 2012 00:46: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: r239697 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 00:46:58 -0000 Author: gonzo Date: Sun Aug 26 00:46:57 2012 New Revision: 239697 URL: http://svn.freebsd.org/changeset/base/239697 Log: Merge fix for hang on ARM11 from NetBSD Modified: head/sys/arm/arm/cpufunc_asm_arm11.S Modified: head/sys/arm/arm/cpufunc_asm_arm11.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_arm11.S Sat Aug 25 23:59:31 2012 (r239696) +++ head/sys/arm/arm/cpufunc_asm_arm11.S Sun Aug 26 00:46:57 2012 (r239697) @@ -44,9 +44,11 @@ __FBSDID("$FreeBSD$"); * addresses that are about to change. */ ENTRY(arm11_setttb) +#ifdef PMAP_CACHE_VIVT stmfd sp!, {r0, lr} bl _C_LABEL(armv5_idcache_wbinv_all) ldmfd sp!, {r0, lr} +#endif mcr p15, 0, r0, c2, c0, 0 /* load new TTB */ From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 00:53:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7280A1065670; Sun, 26 Aug 2012 00:53:01 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DAB68FC0C; Sun, 26 Aug 2012 00:53: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 q7Q0r1j3026484; Sun, 26 Aug 2012 00:53:01 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q0r1WU026482; Sun, 26 Aug 2012 00:53:01 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208260053.q7Q0r1WU026482@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 26 Aug 2012 00:53: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: r239698 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 00:53:01 -0000 Author: gonzo Date: Sun Aug 26 00:53:00 2012 New Revision: 239698 URL: http://svn.freebsd.org/changeset/base/239698 Log: Call set_pcpu for ARMv6 architecture too Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Aug 26 00:46:57 2012 (r239697) +++ head/sys/arm/arm/machdep.c Sun Aug 26 00:53:00 2012 (r239698) @@ -791,7 +791,7 @@ fake_preload_metadata(struct arm_boot_pa void pcpu0_init(void) { -#if ARM_ARCH_7A || defined(CPU_MV_PJ4B) +#if ARM_ARCH_6 || ARM_ARCH_7A || defined(CPU_MV_PJ4B) set_pcpu(pcpup); #endif pcpu_init(pcpup, 0, sizeof(struct pcpu)); From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 01:21:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31144106566C; Sun, 26 Aug 2012 01:21:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 113648FC0C; Sun, 26 Aug 2012 01:21: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 q7Q1L2iK031032; Sun, 26 Aug 2012 01:21:02 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q1L27W031021; Sun, 26 Aug 2012 01:21:02 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201208260121.q7Q1L27W031021@svn.freebsd.org> From: Glen Barber Date: Sun, 26 Aug 2012 01:21: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: r239699 - in head/sys: amd64/conf arm/conf i386/conf pc98/conf sparc64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 01:21:03 -0000 Author: gjb (doc,ports committer) Date: Sun Aug 26 01:21:02 2012 New Revision: 239699 URL: http://svn.freebsd.org/changeset/base/239699 Log: Grammar fix: s/NIC's/NICs/ MFC after: 3 days Modified: head/sys/amd64/conf/GENERIC head/sys/arm/conf/AVILA head/sys/arm/conf/AVILA.hints head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CAMBRIA.hints head/sys/i386/conf/GENERIC head/sys/i386/conf/PAE head/sys/pc98/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/amd64/conf/GENERIC Sun Aug 26 01:21:02 2012 (r239699) @@ -270,7 +270,7 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm device an # Aironet 4500/4800 802.11 wireless NICs. -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/arm/conf/AVILA Sun Aug 26 01:21:02 2012 (r239699) @@ -119,7 +119,7 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_xauth -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue options ATH_DEBUG options ATH_DIAGAPI Modified: head/sys/arm/conf/AVILA.hints ============================================================================== --- head/sys/arm/conf/AVILA.hints Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/arm/conf/AVILA.hints Sun Aug 26 01:21:02 2012 (r239699) @@ -19,7 +19,7 @@ hint.uart.1.ier_rxbits=0x5d # NB: need U # NPE Hardware Queue Manager hint.ixpqmgr.0.at="ixp0" -# NPE wired NIC's, requires ixpqmgr +# NPE wired NICs, requires ixpqmgr hint.npe.0.at="ixp0" hint.npe.0.npeid="B" hint.npe.0.mac="B" Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/arm/conf/CAMBRIA Sun Aug 26 01:21:02 2012 (r239699) @@ -122,7 +122,7 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_xauth -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue options ATH_DEBUG options ATH_DIAGAPI Modified: head/sys/arm/conf/CAMBRIA.hints ============================================================================== --- head/sys/arm/conf/CAMBRIA.hints Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/arm/conf/CAMBRIA.hints Sun Aug 26 01:21:02 2012 (r239699) @@ -28,7 +28,7 @@ hint.uart.0.ier_rxbits=0x5d # NB: need U # NPE Hardware Queue Manager hint.ixpqmgr.0.at="ixp0" -# NPE wired NIC's, requires ixpqmgr +# NPE wired NICs, requires ixpqmgr hint.npe.0.at="ixp0" hint.npe.0.npeid="C" hint.npe.0.mac="C" Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/i386/conf/GENERIC Sun Aug 26 01:21:02 2012 (r239699) @@ -282,7 +282,7 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm device an # Aironet 4500/4800 802.11 wireless NICs. -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors Modified: head/sys/i386/conf/PAE ============================================================================== --- head/sys/i386/conf/PAE Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/i386/conf/PAE Sun Aug 26 01:21:02 2012 (r239699) @@ -75,7 +75,7 @@ nodevice sn nodevice xe nodevice an -nodevice ath # Atheros pci/cardbus NIC's +nodevice ath # Atheros pci/cardbus NICs nodevice ath_pci nodevice ath_hal nodevice ath_rate_sample # SampleRate tx rate control for ath Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/pc98/conf/GENERIC Sun Aug 26 01:21:02 2012 (r239699) @@ -207,7 +207,7 @@ options IEEE80211_SUPPORT_MESH # enable #device wlan_tkip # 802.11 TKIP support #device wlan_amrr # AMRR transmit rate control algorithm #device an # Aironet 4500/4800 802.11 wireless NICs. -#device ath # Atheros NIC's +#device ath # Atheros NICs #device ath_pci # Atheros pci/cardbus glue #device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sun Aug 26 00:53:00 2012 (r239698) +++ head/sys/sparc64/conf/GENERIC Sun Aug 26 01:21:02 2012 (r239699) @@ -207,7 +207,7 @@ device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm -device ath # Atheros NIC's +device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # Atheros HAL (Hardware Access Layer) options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 02:23:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A59FB1065673; Sun, 26 Aug 2012 02:23:22 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EB408FC16; Sun, 26 Aug 2012 02:23: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 q7Q2NMGD040542; Sun, 26 Aug 2012 02:23:22 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q2NMv1040538; Sun, 26 Aug 2012 02:23:22 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208260223.q7Q2NMv1040538@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 26 Aug 2012 02:23: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: r239701 - in head/sys/arm: arm include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 02:23:22 -0000 Author: gonzo Date: Sun Aug 26 02:23:21 2012 New Revision: 239701 URL: http://svn.freebsd.org/changeset/base/239701 Log: Add support for ARM11 cpufunc Obtained from: NetBSD (partially) Added: head/sys/arm/arm/cpufunc_asm_armv6.S (contents, props changed) Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/include/cpufunc.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Sun Aug 26 01:41:41 2012 (r239700) +++ head/sys/arm/arm/cpufunc.c Sun Aug 26 02:23:21 2012 (r239701) @@ -968,6 +968,68 @@ struct cpu_functions fa526_cpufuncs = { }; #endif /* CPU_FA526 || CPU_FA626TE */ +#if defined(CPU_ARM11) +struct cpu_functions arm11_cpufuncs = { + /* CPU functions */ + + cpufunc_id, /* id */ + arm11_drain_writebuf, /* cpwait */ + + /* MMU functions */ + + cpufunc_control, /* control */ + cpufunc_domains, /* Domain */ + arm11_setttb, /* Setttb */ + cpufunc_faultstatus, /* Faultstatus */ + cpufunc_faultaddress, /* Faultaddress */ + + /* TLB functions */ + + arm11_tlb_flushID, /* tlb_flushID */ + arm11_tlb_flushID_SE, /* tlb_flushID_SE */ + arm11_tlb_flushI, /* tlb_flushI */ + arm11_tlb_flushI_SE, /* tlb_flushI_SE */ + arm11_tlb_flushD, /* tlb_flushD */ + arm11_tlb_flushD_SE, /* tlb_flushD_SE */ + + /* Cache operations */ + + armv6_icache_sync_all, /* icache_sync_all */ + armv6_icache_sync_range, /* icache_sync_range */ + + armv6_dcache_wbinv_all, /* dcache_wbinv_all */ + armv6_dcache_wbinv_range, /* dcache_wbinv_range */ + armv6_dcache_inv_range, /* dcache_inv_range */ + armv6_dcache_wb_range, /* dcache_wb_range */ + + armv6_idcache_wbinv_all, /* idcache_wbinv_all */ + armv6_idcache_wbinv_range, /* idcache_wbinv_range */ + + (void*)cpufunc_nullop, /* l2cache_wbinv_all */ + (void *)cpufunc_nullop, /* l2cache_wbinv_range */ + (void *)cpufunc_nullop, /* l2cache_inv_range */ + (void *)cpufunc_nullop, /* l2cache_wb_range */ + + /* Other functions */ + + cpufunc_nullop, /* flush_prefetchbuf */ + arm11_drain_writebuf, /* drain_writebuf */ + cpufunc_nullop, /* flush_brnchtgt_C */ + (void *)cpufunc_nullop, /* flush_brnchtgt_E */ + + arm11_sleep, /* sleep */ + + /* Soft functions */ + + cpufunc_null_fixup, /* dataabt_fixup */ + cpufunc_null_fixup, /* prefetchabt_fixup */ + + arm11_context_switch, /* context_switch */ + + arm11_setup /* cpu setup */ +}; +#endif /* CPU_ARM11 */ + #if defined(CPU_CORTEXA) struct cpu_functions cortexa_cpufuncs = { /* CPU functions */ @@ -1324,6 +1386,15 @@ set_cpufuncs() goto out; } #endif /* CPU_ARM10 */ +#ifdef CPU_ARM11 + cpufuncs = arm11_cpufuncs; + cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ + get_cachetype_cp15(); + + pmap_pte_init_mmu_v6(); + + goto out; +#endif /* CPU_ARM11 */ #ifdef CPU_CORTEXA if (cputype == CPU_ID_CORTEXA8R1 || cputype == CPU_ID_CORTEXA8R2 || @@ -2197,38 +2268,36 @@ void arm11_setup(args) char *args; { - int cpuctrl, cpuctrlmask; - - cpuctrl = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_SYST_ENABLE - | CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE - /* | CPU_CONTROL_BPRD_ENABLE */; - cpuctrlmask = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_SYST_ENABLE - | CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE - | CPU_CONTROL_ROM_ENABLE | CPU_CONTROL_BPRD_ENABLE - | CPU_CONTROL_BEND_ENABLE | CPU_CONTROL_AFLT_ENABLE - | CPU_CONTROL_ROUNDROBIN | CPU_CONTROL_CPCLK; + int cpuctrl; + cpuctrl = CPU_CONTROL_MMU_ENABLE; #ifndef ARM32_DISABLE_ALIGNMENT_FAULTS cpuctrl |= CPU_CONTROL_AFLT_ENABLE; #endif - + cpuctrl |= CPU_CONTROL_DC_ENABLE; + cpuctrl |= (0xf << 3); cpuctrl = parse_cpu_options(args, arm11_options, cpuctrl); - #ifdef __ARMEB__ cpuctrl |= CPU_CONTROL_BEND_ENABLE; #endif + cpuctrl |= CPU_CONTROL_SYST_ENABLE; + cpuctrl |= CPU_CONTROL_BPRD_ENABLE; + cpuctrl |= CPU_CONTROL_IC_ENABLE; + if (vector_page == ARM_VECTORS_HIGH) + cpuctrl |= CPU_CONTROL_VECRELOC; + cpuctrl |= (0x5 << 16); + cpuctrl |= CPU_CONTROL_V6_EXTPAGE; - /* Clear out the cache */ + /* Make sure caches are clean. */ cpu_idcache_wbinv_all(); - - /* Now really make sure they are clean. */ - __asm __volatile ("mcr\tp15, 0, r0, c7, c7, 0" : : ); + cpu_l2cache_wbinv_all(); /* Set the control register */ + ctrl = cpuctrl; cpu_control(0xffffffff, cpuctrl); - /* And again. */ cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); } #endif /* CPU_ARM11 */ Added: head/sys/arm/arm/cpufunc_asm_armv6.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/cpufunc_asm_armv6.S Sun Aug 26 02:23:21 2012 (r239701) @@ -0,0 +1,140 @@ +/* $NetBSD: cpufunc_asm_armv6.S,v 1.4 2010/12/10 02:06:22 bsh Exp $ */ + +/* + * Copyright (c) 2002, 2005 ARM Limited + * Portions Copyright (c) 2007 Microsoft + * 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 company 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 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. + * + * ARMv6 assembly functions for manipulating caches. + * These routines can be used by any core that supports the mcrr address + * range operations. + */ + +/* + * $FreeBSD$ + */ + +#include + + .arch armv6 + +/* + * Functions to set the MMU Translation Table Base register + * + * We need to clean and flush the cache as it uses virtual + * addresses that are about to change. + */ +ENTRY(armv6_setttb) +#ifdef PMAP_CACHE_VIVT + mcr p15, 0, r0, c7, c5, 0 /* Flush I cache */ + mcr p15, 0, r0, c7, c14, 0 /* clean and invalidate D cache */ +#endif + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + + mcr p15, 0, r0, c2, c0, 0 /* load new TTB */ + + mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */ + RET + +/* + * Cache operations. + */ + +/* LINTSTUB: void armv6_icache_sync_range(vaddr_t, vsize_t); */ +ENTRY_NP(armv6_icache_sync_range) + add r1, r1, r0 + sub r1, r1, #1 + mcrr p15, 0, r1, r0, c5 /* invalidate I cache range */ + mcrr p15, 0, r1, r0, c12 /* clean D cache range */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET + +/* LINTSTUB: void armv6_icache_sync_all(void); */ +ENTRY_NP(armv6_icache_sync_all) + /* + * We assume that the code here can never be out of sync with the + * dcache, so that we can safely flush the Icache and fall through + * into the Dcache cleaning code. + */ + mcr p15, 0, r0, c7, c5, 0 /* Flush I cache */ + mcr p15, 0, r0, c7, c10, 0 /* Clean D cache */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET + +/* LINTSTUB: void armv6_dcache_wb_range(vaddr_t, vsize_t); */ +ENTRY(armv6_dcache_wb_range) + add r1, r1, r0 + sub r1, r1, #1 + mcrr p15, 0, r1, r0, c12 /* clean D cache range */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET + +/* LINTSTUB: void armv6_dcache_wbinv_range(vaddr_t, vsize_t); */ +ENTRY(armv6_dcache_wbinv_range) + add r1, r1, r0 + sub r1, r1, #1 + mcrr p15, 0, r1, r0, c14 /* clean and invaliate D cache range */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET + +/* + * Note, we must not invalidate everything. If the range is too big we + * must use wb-inv of the entire cache. + * + * LINTSTUB: void armv6_dcache_inv_range(vaddr_t, vsize_t); + */ +ENTRY(armv6_dcache_inv_range) + add r1, r1, r0 + sub r1, r1, #1 + mcrr p15, 0, r1, r0, c6 /* invaliate D cache range */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET + +/* LINTSTUB: void armv6_idcache_wbinv_range(vaddr_t, vsize_t); */ +ENTRY(armv6_idcache_wbinv_range) + add r1, r1, r0 + sub r1, r1, #1 + mcrr p15, 0, r1, r0, c5 /* invaliate I cache range */ + mcrr p15, 0, r1, r0, c14 /* clean & invaliate D cache range */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET + +/* LINTSTUB: void armv6_idcache_wbinv_all(void); */ +ENTRY_NP(armv6_idcache_wbinv_all) + /* + * We assume that the code here can never be out of sync with the + * dcache, so that we can safely flush the Icache and fall through + * into the Dcache purging code. + */ + mcr p15, 0, r0, c7, c5, 0 /* Flush I cache */ + /* Fall through to purge Dcache. */ + +/* LINTSTUB: void armv6_dcache_wbinv_all(void); */ +ENTRY(armv6_dcache_wbinv_all) + mcr p15, 0, r0, c7, c14, 0 /* clean & invalidate D cache */ + mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ + RET Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Sun Aug 26 01:41:41 2012 (r239700) +++ head/sys/arm/include/cpufunc.h Sun Aug 26 02:23:21 2012 (r239701) @@ -495,8 +495,15 @@ void pj4b_flush_brnchtgt_va (u_int); void pj4b_sleep (int); void armv6_icache_sync_all (void); +void armv6_icache_sync_range (vm_offset_t, vm_size_t); + void armv6_dcache_wbinv_all (void); +void armv6_dcache_wbinv_range (vm_offset_t, vm_size_t); +void armv6_dcache_inv_range (vm_offset_t, vm_size_t); +void armv6_dcache_wb_range (vm_offset_t, vm_size_t); + void armv6_idcache_wbinv_all (void); +void armv6_idcache_wbinv_range (vm_offset_t, vm_size_t); void armv7_setttb (u_int); void armv7_tlb_flushID (void); From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 02:34:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6321B106566C; Sun, 26 Aug 2012 02:34:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E60D8FC08; Sun, 26 Aug 2012 02:34: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 q7Q2Y45F042245; Sun, 26 Aug 2012 02:34:04 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q2Y4Am042243; Sun, 26 Aug 2012 02:34:04 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208260234.q7Q2Y4Am042243@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 26 Aug 2012 02:34: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: r239702 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 02:34:04 -0000 Author: gonzo Date: Sun Aug 26 02:34:03 2012 New Revision: 239702 URL: http://svn.freebsd.org/changeset/base/239702 Log: Add ARM11 support for elf trampoline Modified: head/sys/arm/arm/elf_trampoline.c Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Sun Aug 26 02:23:21 2012 (r239701) +++ head/sys/arm/arm/elf_trampoline.c Sun Aug 26 02:34:03 2012 (r239702) @@ -63,6 +63,8 @@ void __startC(void); #define cpu_idcache_wbinv_all armv5_ec_idcache_wbinv_all #elif defined(CPU_ARM10) #define cpu_idcache_wbinv_all arm10_idcache_wbinv_all +#elif defined(CPU_ARM11) +#define cpu_idcache_wbinv_all armv6_idcache_wbinv_all #elif defined(CPU_SA110) || defined(CPU_SA1110) || defined(CPU_SA1100) || \ defined(CPU_IXP12X0) #define cpu_idcache_wbinv_all sa1_cache_purgeID From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 04:26:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85B9A106564A; Sun, 26 Aug 2012 04:26:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7161B8FC0A; Sun, 26 Aug 2012 04: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 q7Q4QQb2059922; Sun, 26 Aug 2012 04:26:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q4QQ3B059920; Sun, 26 Aug 2012 04:26:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208260426.q7Q4QQ3B059920@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Aug 2012 04:26: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: r239703 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 04:26:26 -0000 Author: adrian Date: Sun Aug 26 04:26:25 2012 New Revision: 239703 URL: http://svn.freebsd.org/changeset/base/239703 Log: Add EEPROM data hooks for the AR9287. Tested: * AP99 Reference board (AR7241 + AR9287) Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Sun Aug 26 02:34:03 2012 (r239702) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Sun Aug 26 04:26:25 2012 (r239703) @@ -137,6 +137,13 @@ ar9287Attach(uint16_t devid, HAL_SOFTC s ar5416InitState(AH5416(ah), devid, sc, st, sh, status); + if (eepromdata != AH_NULL) { + AH_PRIVATE(ah)->ah_eepromRead = ath_hal_EepromDataRead; + AH_PRIVATE(ah)->ah_eepromWrite = NULL; + ah->ah_eepromdata = eepromdata; + } + + /* XXX override with 9280 specific state */ /* override 5416 methods for our needs */ AH5416(ah)->ah_initPLL = ar9280InitPLL; From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 04:26:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42305106566B; Sun, 26 Aug 2012 04:26: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 2E1D58FC14; Sun, 26 Aug 2012 04:26: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 q7Q4QosL060008; Sun, 26 Aug 2012 04:26:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q4Qnvk060005; Sun, 26 Aug 2012 04:26:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208260426.q7Q4Qnvk060005@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Aug 2012 04:26: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: r239704 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 04:26:50 -0000 Author: adrian Date: Sun Aug 26 04:26:49 2012 New Revision: 239704 URL: http://svn.freebsd.org/changeset/base/239704 Log: Move this magic check to only occur if no eeprom data is given. Tested on: * AP99 (AR7241+AR9287) Modified: head/sys/dev/ath/ath_hal/ah_eeprom_9287.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom_9287.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_9287.c Sun Aug 26 04:26:25 2012 (r239703) +++ head/sys/dev/ath/ath_hal/ah_eeprom_9287.c Sun Aug 26 04:26:49 2012 (r239704) @@ -310,12 +310,12 @@ ath_hal_9287EepromAttach(struct ath_hal "%s Error reading Eeprom MAGIC\n", __func__); return HAL_EEREAD; } - } - HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s Eeprom Magic = 0x%x\n", - __func__, magic); - if (magic != AR5416_EEPROM_MAGIC) { - HALDEBUG(ah, HAL_DEBUG_ANY, "Bad magic number\n"); - return HAL_EEMAGIC; + HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s Eeprom Magic = 0x%x\n", + __func__, magic); + if (magic != AR5416_EEPROM_MAGIC) { + HALDEBUG(ah, HAL_DEBUG_ANY, "Bad magic number\n"); + return HAL_EEMAGIC; + } } ee = ath_hal_malloc(sizeof(HAL_EEPROM_9287)); From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 04:37:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84A8D106566B; Sun, 26 Aug 2012 04:37:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65AD38FC0C; Sun, 26 Aug 2012 04:37: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 q7Q4b0ib061596; Sun, 26 Aug 2012 04:37:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q4b0xT061593; Sun, 26 Aug 2012 04:37:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208260437.q7Q4b0xT061593@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Aug 2012 04:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239705 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 04:37:00 -0000 Author: adrian Date: Sun Aug 26 04:36:59 2012 New Revision: 239705 URL: http://svn.freebsd.org/changeset/base/239705 Log: Create a skeleton AR724x SoC board configuration for use by AR724x devices. Added: head/sys/mips/conf/AR724X_BASE (contents, props changed) head/sys/mips/conf/AR724X_BASE.hints (contents, props changed) Added: head/sys/mips/conf/AR724X_BASE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AR724X_BASE Sun Aug 26 04:36:59 2012 (r239705) @@ -0,0 +1,125 @@ +# +# AR724X -- Kernel configuration file for FreeBSD/MIPS for Atheros 724x systems +# +# This includes all the common drivers for the AR724x boards along with +# the usb, net80211 and atheros driver code. +# +# $FreeBSD$ +# + +machine mips mips +ident AR724X_BASE +cpu CPU_MIPS4KC +makeoptions KERNLOADADDR=0x80050000 +options HZ=1000 +options HWPMC_HOOKS + +files "../atheros/files.ar71xx" + +# For now, hints are per-board. + +hints "AR724X_BASE.hints" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols + +# Build these as modules so small platform builds will have the +# modules already built. +makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci" + +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 # IPv6 + +# options NFS_CL #Network Filesystem Client + +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +# options NFS_LEGACYRPC +# Debugging for use in -current +options INVARIANTS +options INVARIANT_SUPPORT +options WITNESS +options WITNESS_SKIPSPIN +options DEBUG_REDZONE +options DEBUG_MEMGUARD + +options FFS #Berkeley Fast Filesystem +# options SOFTUPDATES #Enable FFS soft updates support +# options UFS_ACL #Support for access control lists +# options UFS_DIRHASH #Improve performance on big directories +# options MSDOSFS # Read MSDOS filesystems; useful for USB/CF + +device pci +device ar724x_pci + +# 802.11 framework +options IEEE80211_DEBUG +options IEEE80211_ALQ +options IEEE80211_SUPPORT_MESH +# This option is currently broken for if_ath_tx. +options IEEE80211_SUPPORT_TDMA +options IEEE80211_AMPDU_AGE +device wlan # 802.11 support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_xauth # 802.11 hostap support + +# Atheros wireless NICs +device ath # Atheros interface support +device ath_pci # Atheros PCI/Cardbus bus +options ATH_DEBUG +options ATH_DIAGAPI +options ATH_ENABLE_11N +options AH_DEBUG +options AH_DEBUG_ALQ +options ALQ +device ath_hal +option AH_SUPPORT_AR5416 +device ath_rate_sample +option AH_RXCFG_SDMAMW_4BYTES +option AH_AR5416_INTERRUPT_MITIGATION +# There's no DFS radar detection support yet so this won't actually +# detect radars. It however does enable the rest of the channel change +# machinery so DFS can be debugged. +option ATH_ENABLE_DFS + +device mii +device arge + +device usb +options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +options USB_DEBUG +options USB_HOST_ALIGN=32 # AR724X (MIPS in general?) requires this +device ehci + +device scbus +device umass +device da + +# On-board SPI flash +device spibus +device ar71xx_spi +device mx25l +device ar71xx_wdog + +device uart + +device loop +device ether +device md +device bpf +device random +device if_bridge +device gif # ip[46] in ip[46] tunneling protocol +device gre # generic encapsulation - only for IPv4 in IPv4 though atm + +options ARGE_DEBUG # Enable if_arge debugging for now + +# Enable GPIO +device gpio +device gpioled Added: head/sys/mips/conf/AR724X_BASE.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AR724X_BASE.hints Sun Aug 26 04:36:59 2012 (r239705) @@ -0,0 +1,66 @@ +# +# $FreeBSD$ +# +hint.apb.0.at="nexus0" +hint.apb.0.irq=4 + +# uart0 +hint.uart.0.at="apb0" +# see atheros/uart_cpu_ar71xx.c why +3 +hint.uart.0.maddr=0x18020003 +hint.uart.0.msize=0x18 +hint.uart.0.irq=3 + +#ohci +hint.ohci.0.at="apb0" +hint.ohci.0.maddr=0x1c000000 +hint.ohci.0.msize=0x01000000 +hint.ohci.0.irq=6 + +#ehci +hint.ehci.0.at="nexus0" +hint.ehci.0.maddr=0x1b000100 +hint.ehci.0.msize=0x01000000 +hint.ehci.0.irq=1 + +# pci +hint.pcib.0.at="nexus0" +hint.pcib.0.irq=0 + +hint.arge.0.at="nexus0" +hint.arge.0.maddr=0x19000000 +hint.arge.0.msize=0x1000 +hint.arge.0.irq=2 + +# phymask, media and fduplex depend upon the specific +# board. +# So each board will override the settings as needed. + +hint.arge.1.at="nexus0" +hint.arge.1.maddr=0x1a000000 +hint.arge.1.msize=0x1000 +hint.arge.1.irq=3 + +# SPI flash +hint.spi.0.at="nexus0" +hint.spi.0.maddr=0x1f000000 +hint.spi.0.msize=0x10 + +hint.mx25l.0.at="spibus0" +hint.mx25l.0.cs=0 + +# Watchdog +hint.ar71xx_wdog.0.at="nexus0" + +# GPIO +hint.gpio.0.at="apb0" +hint.gpio.0.maddr=0x18040000 +hint.gpio.0.msize=0x1000 +hint.gpio.0.irq=2 + +# Each board should override the GPIO bus pins with the configuration +# relevant to it. Thus no pins are defined here. + +# hwpmc device +hint.ar71xx_pmc.0.at="apb0" +hint.ar71xx_pmc.0.irq=5 From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 04:39:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BAE5B106564A; Sun, 26 Aug 2012 04:39:20 +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 A67FD8FC1A; Sun, 26 Aug 2012 04:39: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 q7Q4dK5x061950; Sun, 26 Aug 2012 04:39:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q4dKHU061948; Sun, 26 Aug 2012 04:39:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208260439.q7Q4dKHU061948@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Aug 2012 04:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239706 - head/sys/mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 04:39:20 -0000 Author: adrian Date: Sun Aug 26 04:39:20 2012 New Revision: 239706 URL: http://svn.freebsd.org/changeset/base/239706 Log: Ensure that BAR(0) is set for the PCI slot before the ath(4) PCI registers are written out. This allows EEPROM-less NICs on the AR7241 PCIe bus to be correctly initialised. Tested: * AP91 (AR7240+AR9285) - the existing board support didn't break; * AP99 (AR7241+AR9287) - this fixed the configuration of the AR9287 PCI. Modified: head/sys/mips/atheros/ar724x_pci.c Modified: head/sys/mips/atheros/ar724x_pci.c ============================================================================== --- head/sys/mips/atheros/ar724x_pci.c Sun Aug 26 04:36:59 2012 (r239705) +++ head/sys/mips/atheros/ar724x_pci.c Sun Aug 26 04:39:20 2012 (r239706) @@ -270,6 +270,10 @@ ar724x_pci_fixup(device_t dev, long flas /* Save bar(0) address - just to flush bar(0) (SoC WAR) ? */ bar0 = ar724x_pci_read_config(dev, 0, 0, 0, PCIR_BAR(0), 4); + /* Write temporary BAR0 to map the NIC into a fixed location */ + ar724x_pci_write_config(dev, 0, 0, 0, PCIR_BAR(0), + AR71XX_PCI_MEM_BASE, 4); + val = ar724x_pci_read_config(dev, 0, 0, 0, PCIR_COMMAND, 2); val |= (PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN); ar724x_pci_write_config(dev, 0, 0, 0, PCIR_COMMAND, val, 2); From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 09:22:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E757106566B; Sun, 26 Aug 2012 09:22:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7571B8FC0A; Sun, 26 Aug 2012 09:22: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 q7Q9M0GW096205; Sun, 26 Aug 2012 09:22:00 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q9M0S9096188; Sun, 26 Aug 2012 09:22:00 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208260922.q7Q9M0S9096188@svn.freebsd.org> From: Robert Watson Date: Sun, 26 Aug 2012 09:22: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: r239709 - in head/sys: dev/terasic/de4led mips/beri mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 09:22:00 -0000 Author: rwatson Date: Sun Aug 26 09:21:59 2012 New Revision: 239709 URL: http://svn.freebsd.org/changeset/base/239709 Log: Add terasic_de4led, a led(4) driver for the on-board 8-element LED on the Terasic DE-4 board. Allow LED configuration to be set using loader tunables, not just from userspace, and preconfigure LED 8 as a kernel heartbeat. For now, this is a Nexus-attached, BERI-only driver, but it could be used with other hard and soft cores on Altera FPGAs as well, in principle. Sponsored by: DARPA, AFRL Added: head/sys/dev/terasic/de4led/ head/sys/dev/terasic/de4led/terasic_de4led.c (contents, props changed) head/sys/dev/terasic/de4led/terasic_de4led.h (contents, props changed) head/sys/dev/terasic/de4led/terasic_de4led_nexus.c (contents, props changed) Modified: head/sys/mips/beri/files.beri head/sys/mips/conf/BERI_DE4.hints head/sys/mips/conf/BERI_DE4_MDROOT head/sys/mips/conf/BERI_DE4_SDROOT Added: head/sys/dev/terasic/de4led/terasic_de4led.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/de4led/terasic_de4led.c Sun Aug 26 09:21:59 2012 (r239709) @@ -0,0 +1,188 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +static void +terasic_de4led_update(struct terasic_de4led_softc *sc) +{ + + TERASIC_DE4LED_LOCK_ASSERT(sc); + + bus_write_1(sc->tdl_res, TERASIC_DE4LED_OFF_LED, sc->tdl_bits); +} + +static void +led_update(struct terasic_de4led_softc *sc, int bit, int onoff) +{ + + TERASIC_DE4LED_LOCK(sc); + TERASIC_DE4LED_SETLED(sc, bit, onoff); + terasic_de4led_update(sc); + TERASIC_DE4LED_UNLOCK(sc); +} + +static void +led_0(void *arg, int onoff) +{ + + led_update(arg, 0, onoff); +} + +static void +led_1(void *arg, int onoff) +{ + + led_update(arg, 1, onoff); +} + +static void +led_2(void *arg, int onoff) +{ + + led_update(arg, 2, onoff); +} + +static void +led_3(void *arg, int onoff) +{ + + led_update(arg, 3, onoff); +} + +static void +led_4(void *arg, int onoff) +{ + + led_update(arg, 4, onoff); +} + +static void +led_5(void *arg, int onoff) +{ + + led_update(arg, 5, onoff); +} + +static void +led_6(void *arg, int onoff) +{ + + led_update(arg, 6, onoff); +} + +static void +led_7(void *arg, int onoff) +{ + + led_update(arg, 7, onoff); +} + +void +terasic_de4led_attach(struct terasic_de4led_softc *sc) +{ + const char *cmd; + + TERASIC_DE4LED_LOCK_INIT(sc); + + /* + * Clear the LED array before we start. + */ + TERASIC_DE4LED_LOCK(sc); + TERASIC_DE4LED_CLEARBAR(sc); + terasic_de4led_update(sc); + TERASIC_DE4LED_UNLOCK(sc); + + /* + * Register the LED array with led(4). + */ + sc->tdl_leds[0] = led_create(led_0, sc, "de4led_0"); + sc->tdl_leds[1] = led_create(led_1, sc, "de4led_1"); + sc->tdl_leds[2] = led_create(led_2, sc, "de4led_2"); + sc->tdl_leds[3] = led_create(led_3, sc, "de4led_3"); + sc->tdl_leds[4] = led_create(led_4, sc, "de4led_4"); + sc->tdl_leds[5] = led_create(led_5, sc, "de4led_5"); + sc->tdl_leds[6] = led_create(led_6, sc, "de4led_6"); + sc->tdl_leds[7] = led_create(led_7, sc, "de4led_7"); + + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_0_cmd", &cmd) == 0) + led_set("de4led_0", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_1_cmd", &cmd) == 0) + led_set("de4led_1", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_2_cmd", &cmd) == 0) + led_set("de4led_2", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_3_cmd", &cmd) == 0) + led_set("de4led_3", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_4_cmd", &cmd) == 0) + led_set("de4led_4", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_5_cmd", &cmd) == 0) + led_set("de4led_5", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_6_cmd", &cmd) == 0) + led_set("de4led_6", cmd); + if (resource_string_value(device_get_name(sc->tdl_dev), + sc->tdl_unit, "de4led_7_cmd", &cmd) == 0) + led_set("de4led_7", cmd); +} + +void +terasic_de4led_detach(struct terasic_de4led_softc *sc) +{ + int i; + + for (i = 0; i < 8; i++) { + led_destroy(sc->tdl_leds[i]); + sc->tdl_leds[i] = NULL; + } + TERASIC_DE4LED_LOCK(sc); + TERASIC_DE4LED_CLEARBAR(sc); + terasic_de4led_update(sc); + TERASIC_DE4LED_UNLOCK(sc); + TERASIC_DE4LED_LOCK_DESTROY(sc); +} Added: head/sys/dev/terasic/de4led/terasic_de4led.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/de4led/terasic_de4led.h Sun Aug 26 09:21:59 2012 (r239709) @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_TERASIC_DE4LED_H_ +#define _DEV_TERASIC_DE4LED_H_ + +#define TERASIC_DE4LED_NUMLEDS 8 +struct terasic_de4led_softc { + device_t tdl_dev; + int tdl_unit; + struct resource *tdl_res; + int tdl_rid; + struct mtx tdl_lock; + uint8_t tdl_bits; + struct cdev *tdl_leds[TERASIC_DE4LED_NUMLEDS]; +}; + +#define TERASIC_DE4LED_LOCK(sc) mtx_lock(&(sc)->tdl_lock) +#define TERASIC_DE4LED_LOCK_ASSERT(sc) mtx_assert(&(sc)->tdl_lock, MA_OWNED) +#define TERASIC_DE4LED_LOCK_DESTROY(sc) mtx_destroy(&(sc)->tdl_lock) +#define TERASIC_DE4LED_LOCK_INIT(sc) mtx_init(&(sc)->tdl_lock, \ + "terasic_de4led", NULL, MTX_DEF) +#define TERASIC_DE4LED_UNLOCK(sc) mtx_unlock(&(sc)->tdl_lock) + +/* + * Setting and clearing LEDs. tdl_bits is in the bit order preferred for I/O. + * The LED elements are labelled 1..8 on the DE-4, so bit 0 is LED 1, and so + * on. + */ +#define TERASIC_DE4LED_CLEARBAR(sc) do { \ + (sc)->tdl_bits = 0; \ +} while (0) +#define TERASIC_DE4LED_SETLED(sc, led, onoff) do { \ + (sc)->tdl_bits &= ~(1 << (led)); \ + (sc)->tdl_bits |= ((onoff != 0) ? 1 : 0) << (led); \ +} while (0) + +/* + * Only one offset matters for this device -- 0. + */ +#define TERASIC_DE4LED_OFF_LED 0 + +void terasic_de4led_attach(struct terasic_de4led_softc *sc); +void terasic_de4led_detach(struct terasic_de4led_softc *sc); + +#endif /* _DEV_TERASIC_DE4LED_H_ */ Added: head/sys/dev/terasic/de4led/terasic_de4led_nexus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/terasic/de4led/terasic_de4led_nexus.c Sun Aug 26 09:21:59 2012 (r239709) @@ -0,0 +1,112 @@ +/*- + * Copyright (c) 2012 Robert N. M. Watson + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +/* + * Nexus bus attachment for the 8-element LED on the Terasic DE-4 FPGA board, + * which is hooked up to the processor via a memory-mapped Avalon bus. + */ +static int +terasic_de4led_nexus_probe(device_t dev) +{ + + device_set_desc(dev, "Terasic DE4 8-element LED"); + return (BUS_PROBE_DEFAULT); +} + +static int +terasic_de4led_nexus_attach(device_t dev) +{ + struct terasic_de4led_softc *sc; + + sc = device_get_softc(dev); + sc->tdl_dev = dev; + sc->tdl_unit = device_get_unit(dev); + sc->tdl_rid = 0; + sc->tdl_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->tdl_rid, RF_ACTIVE); + if (sc->tdl_res == NULL) { + device_printf(dev, "couldn't map memory\n"); + return (ENXIO); + } + terasic_de4led_attach(sc); + return (0); +} + +static int +terasic_de4led_nexus_detach(device_t dev) +{ + struct terasic_de4led_softc *sc; + + sc = device_get_softc(dev); + KASSERT(sc->tdl_res != NULL, ("%s: resources not allocated", + __func__)); + terasic_de4led_detach(sc); + bus_release_resource(dev, SYS_RES_MEMORY, sc->tdl_rid, sc->tdl_res); + return (0); +} + +static device_method_t terasic_de4led_nexus_methods[] = { + DEVMETHOD(device_probe, terasic_de4led_nexus_probe), + DEVMETHOD(device_attach, terasic_de4led_nexus_attach), + DEVMETHOD(device_detach, terasic_de4led_nexus_detach), + { 0, 0 } +}; + +static driver_t terasic_de4led_nexus_driver = { + "terasic_de4led", + terasic_de4led_nexus_methods, + sizeof(struct terasic_de4led_softc), +}; + +static devclass_t terasic_de4led_devclass; + +DRIVER_MODULE(terasic_de4led, nexus, terasic_de4led_nexus_driver, + terasic_de4led_devclass, 0, 0); Modified: head/sys/mips/beri/files.beri ============================================================================== --- head/sys/mips/beri/files.beri Sun Aug 26 05:20:32 2012 (r239708) +++ head/sys/mips/beri/files.beri Sun Aug 26 09:21:59 2012 (r239709) @@ -2,6 +2,8 @@ dev/altera/jtag_uart/altera_jtag_uart_cons.c optional altera_jtag_uart dev/altera/jtag_uart/altera_jtag_uart_tty.c optional altera_jtag_uart dev/altera/jtag_uart/altera_jtag_uart_nexus.c optional altera_jtag_uart +dev/terasic/de4led/terasic_de4led.c optional terasic_de4led +dev/terasic/de4led/terasic_de4led_nexus.c optional terasic_de4led dev/terasic/mtl/terasic_mtl.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_nexus.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_pixel.c optional terasic_mtl Modified: head/sys/mips/conf/BERI_DE4.hints ============================================================================== --- head/sys/mips/conf/BERI_DE4.hints Sun Aug 26 05:20:32 2012 (r239708) +++ head/sys/mips/conf/BERI_DE4.hints Sun Aug 26 09:21:59 2012 (r239709) @@ -25,6 +25,14 @@ hint.altera_sdcardc.0.maddr=0x7f008000 hint.altera_sdcardc.0.msize=0x400 # +# On-board DE4 8-element LED +# +hint.terasic_de4led.0.at="nexus0" +hint.terasic_de4led.0.maddr=0x7f006000 +hint.terasic_de4led.0.msize=1 +hint.terasic_de4led.0.de4led_0_cmd="f9" + +# # Terasic Multi-touch LCD (MTL), an optional feature in DE-4 configurations. # hint.terasic_mtl.0.at="nexus0" Modified: head/sys/mips/conf/BERI_DE4_MDROOT ============================================================================== --- head/sys/mips/conf/BERI_DE4_MDROOT Sun Aug 26 05:20:32 2012 (r239708) +++ head/sys/mips/conf/BERI_DE4_MDROOT Sun Aug 26 09:21:59 2012 (r239709) @@ -24,6 +24,7 @@ options ROOTDEVNAME=\"ufs:md0\" device altera_avgen device altera_jtag_uart device altera_sdcard +device terasic_de4led device terasic_mtl device isf Modified: head/sys/mips/conf/BERI_DE4_SDROOT ============================================================================== --- head/sys/mips/conf/BERI_DE4_SDROOT Sun Aug 26 05:20:32 2012 (r239708) +++ head/sys/mips/conf/BERI_DE4_SDROOT Sun Aug 26 09:21:59 2012 (r239709) @@ -17,6 +17,7 @@ options ROOTDEVNAME=\"ufs:altera_sdcard device altera_avgen device altera_jtag_uart device altera_sdcard +device terasic_de4led device terasic_mtl device isf From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 09:54:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDC0C106564A; Sun, 26 Aug 2012 09:54:11 +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 A96808FC08; Sun, 26 Aug 2012 09:54: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 q7Q9sBdu000652; Sun, 26 Aug 2012 09:54:11 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q9sBXI000649; Sun, 26 Aug 2012 09:54:11 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201208260954.q7Q9sBXI000649@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 26 Aug 2012 09:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239710 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 09:54:11 -0000 Author: glebius Date: Sun Aug 26 09:54:11 2012 New Revision: 239710 URL: http://svn.freebsd.org/changeset/base/239710 Log: Fix function name in keg_cachespread_init() assert. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Aug 26 09:21:59 2012 (r239709) +++ head/sys/vm/uma_core.c Sun Aug 26 09:54:11 2012 (r239710) @@ -1238,7 +1238,7 @@ keg_cachespread_init(uma_keg_t keg) keg->uk_ipers = ((pages * PAGE_SIZE) + trailer) / rsize; keg->uk_flags |= UMA_ZONE_OFFPAGE | UMA_ZONE_VTOSLAB; KASSERT(keg->uk_ipers <= uma_max_ipers, - ("keg_small_init: keg->uk_ipers too high(%d) increase max_ipers", + ("%s: keg->uk_ipers too high(%d) increase max_ipers", __func__, keg->uk_ipers)); } From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 10:38:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D7DA106566C; Sun, 26 Aug 2012 10:38:03 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 788F88FC0A; Sun, 26 Aug 2012 10:38: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 q7QAc3nD008201; Sun, 26 Aug 2012 10:38:03 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7QAc3I7008199; Sun, 26 Aug 2012 10:38:03 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208261038.q7QAc3I7008199@svn.freebsd.org> From: Robert Watson Date: Sun, 26 Aug 2012 10:38: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: r239712 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 10:38:03 -0000 Author: rwatson Date: Sun Aug 26 10:38:02 2012 New Revision: 239712 URL: http://svn.freebsd.org/changeset/base/239712 Log: Add a altera_sdcardc(4) man page link for altera_sdcard(4), as that is the name that will appear in dmesg. Sponsored by: DARPA, AFRL Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Aug 26 10:30:01 2012 (r239711) +++ head/share/man/man4/Makefile Sun Aug 26 10:38:02 2012 (r239712) @@ -558,6 +558,7 @@ MLINKS+=age.4 if_age.4 MLINKS+=agp.4 agpgart.4 MLINKS+=alc.4 if_alc.4 MLINKS+=ale.4 if_ale.4 +MLINKS+=altera_sdcard.4 altera_sdcardc.4 MLINKS+=altq.4 ALTQ.4 MLINKS+=ath.4 if_ath.4 MLINKS+=ath_pci.4 if_ath_pci.4 From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 10:40:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 81781106564A; Sun, 26 Aug 2012 10:40:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C6F38FC0C; Sun, 26 Aug 2012 10:40: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 q7QAeEup008489; Sun, 26 Aug 2012 10:40:14 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7QAeERP008487; Sun, 26 Aug 2012 10:40:14 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201208261040.q7QAeERP008487@svn.freebsd.org> From: Robert Watson Date: Sun, 26 Aug 2012 10:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239713 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 10:40:14 -0000 Author: rwatson Date: Sun Aug 26 10:40:13 2012 New Revision: 239713 URL: http://svn.freebsd.org/changeset/base/239713 Log: Expose DE4 buttons and switches via a de4bsw device, implemented using altera_avgen(4). Fix white space nit that must have arisen during the merge from Perforce. Submitted by: brooks Sponsored by: DARPA, AFRL Modified: head/sys/mips/conf/BERI_DE4.hints Modified: head/sys/mips/conf/BERI_DE4.hints ============================================================================== --- head/sys/mips/conf/BERI_DE4.hints Sun Aug 26 10:38:02 2012 (r239712) +++ head/sys/mips/conf/BERI_DE4.hints Sun Aug 26 10:40:13 2012 (r239713) @@ -66,6 +66,16 @@ hint.altera_avgen.0.devname="berirom" #hint.altera_avgen.0.devname="de4flash" # +# Expose the DE4 buttons and switches via an Avalon "generic" device. +# +hint.altera_avgen.0.at="nexus0" +hint.altera_avgen.0.maddr=0x7f009000 +hint.altera_avgen.0.msize=2 +hint.altera_avgen.0.width=1 +hint.altera_avgen.0.fileio="r" +hint.altera_avgen.0.devname="de4bsw" + +# # General Intel StrataFlash driver # hint.isf.0.at="nexus0" @@ -73,7 +83,7 @@ hint.isf.0.maddr=0x74000000 hint.isf.0.msize=0x2000000 hint.isf.1.at="nexus0" hint.isf.1.maddr=0x76000000 -hint.isf.1.msize=0x2000000 +hint.isf.1.msize=0x2000000 # Reserved configuration blocks. Don't touch. hint.map.0.at="isf0" From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 14:30:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39432106564A; Sun, 26 Aug 2012 14:30:15 +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 1A11A8FC0A; Sun, 26 Aug 2012 14:30:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7QEUE1X035678; Sun, 26 Aug 2012 14:30:14 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7QEUEja035676; Sun, 26 Aug 2012 14:30:14 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208261430.q7QEUEja035676@svn.freebsd.org> From: Dimitry Andric Date: Sun, 26 Aug 2012 14:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239715 - head/tools/build/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 14:30:15 -0000 Author: dim Date: Sun Aug 26 14:30:14 2012 New Revision: 239715 URL: http://svn.freebsd.org/changeset/base/239715 Log: Add libc++ and libcxxrt related files to OptionalObsoleteFiles.inc. MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Aug 26 12:07:23 2012 (r239714) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Aug 26 14:30:14 2012 (r239715) @@ -3256,6 +3256,121 @@ OLD_FILES+=usr/share/man/man8/verify_krb # to be filled in #.endif +.if ${MK_LIBCPLUSPLUS} == no +OLD_LIBS+=lib/libcxxrt.so.1 +OLD_FILES+=usr/lib/libc++.a +OLD_FILES+=usr/lib/libc++_p.a +OLD_FILES+=usr/lib/libc++.so +OLD_LIBS+=usr/lib/libc++.so.1 +OLD_FILES+=usr/lib/libcxxrt.a +OLD_FILES+=usr/lib/libcxxrt.so +OLD_FILES+=usr/lib/libcxxrt_p.a +OLD_FILES+=usr/include/c++/v1/__bit_reference +OLD_FILES+=usr/include/c++/v1/__config +OLD_FILES+=usr/include/c++/v1/__debug +OLD_FILES+=usr/include/c++/v1/__functional_03 +OLD_FILES+=usr/include/c++/v1/__functional_base +OLD_FILES+=usr/include/c++/v1/__functional_base_03 +OLD_FILES+=usr/include/c++/v1/__hash_table +OLD_FILES+=usr/include/c++/v1/__locale +OLD_FILES+=usr/include/c++/v1/__mutex_base +OLD_FILES+=usr/include/c++/v1/__split_buffer +OLD_FILES+=usr/include/c++/v1/__sso_allocator +OLD_FILES+=usr/include/c++/v1/__std_stream +OLD_FILES+=usr/include/c++/v1/__tree +OLD_FILES+=usr/include/c++/v1/__tuple +OLD_FILES+=usr/include/c++/v1/__tuple_03 +OLD_FILES+=usr/include/c++/v1/__undef_min_max +OLD_FILES+=usr/include/c++/v1/algorithm +OLD_FILES+=usr/include/c++/v1/array +OLD_FILES+=usr/include/c++/v1/atomic +OLD_FILES+=usr/include/c++/v1/bitset +OLD_FILES+=usr/include/c++/v1/cassert +OLD_FILES+=usr/include/c++/v1/ccomplex +OLD_FILES+=usr/include/c++/v1/cctype +OLD_FILES+=usr/include/c++/v1/cerrno +OLD_FILES+=usr/include/c++/v1/cfenv +OLD_FILES+=usr/include/c++/v1/cfloat +OLD_FILES+=usr/include/c++/v1/chrono +OLD_FILES+=usr/include/c++/v1/cinttypes +OLD_FILES+=usr/include/c++/v1/ciso646 +OLD_FILES+=usr/include/c++/v1/climits +OLD_FILES+=usr/include/c++/v1/clocale +OLD_FILES+=usr/include/c++/v1/cmath +OLD_FILES+=usr/include/c++/v1/codecvt +OLD_FILES+=usr/include/c++/v1/complex +OLD_FILES+=usr/include/c++/v1/complex.h +OLD_FILES+=usr/include/c++/v1/condition_variable +OLD_FILES+=usr/include/c++/v1/csetjmp +OLD_FILES+=usr/include/c++/v1/csignal +OLD_FILES+=usr/include/c++/v1/cstdarg +OLD_FILES+=usr/include/c++/v1/cstdbool +OLD_FILES+=usr/include/c++/v1/cstddef +OLD_FILES+=usr/include/c++/v1/cstdint +OLD_FILES+=usr/include/c++/v1/cstdio +OLD_FILES+=usr/include/c++/v1/cstdlib +OLD_FILES+=usr/include/c++/v1/cstring +OLD_FILES+=usr/include/c++/v1/ctgmath +OLD_FILES+=usr/include/c++/v1/ctime +OLD_FILES+=usr/include/c++/v1/cwchar +OLD_FILES+=usr/include/c++/v1/cwctype +OLD_FILES+=usr/include/c++/v1/cxxabi.h +OLD_FILES+=usr/include/c++/v1/deque +OLD_FILES+=usr/include/c++/v1/exception +OLD_FILES+=usr/include/c++/v1/ext/__hash +OLD_FILES+=usr/include/c++/v1/ext/hash_map +OLD_FILES+=usr/include/c++/v1/ext/hash_set +OLD_FILES+=usr/include/c++/v1/forward_list +OLD_FILES+=usr/include/c++/v1/fstream +OLD_FILES+=usr/include/c++/v1/functional +OLD_FILES+=usr/include/c++/v1/future +OLD_FILES+=usr/include/c++/v1/initializer_list +OLD_FILES+=usr/include/c++/v1/iomanip +OLD_FILES+=usr/include/c++/v1/ios +OLD_FILES+=usr/include/c++/v1/iosfwd +OLD_FILES+=usr/include/c++/v1/iostream +OLD_FILES+=usr/include/c++/v1/istream +OLD_FILES+=usr/include/c++/v1/iterator +OLD_FILES+=usr/include/c++/v1/limits +OLD_FILES+=usr/include/c++/v1/list +OLD_FILES+=usr/include/c++/v1/locale +OLD_FILES+=usr/include/c++/v1/map +OLD_FILES+=usr/include/c++/v1/memory +OLD_FILES+=usr/include/c++/v1/mutex +OLD_FILES+=usr/include/c++/v1/new +OLD_FILES+=usr/include/c++/v1/numeric +OLD_FILES+=usr/include/c++/v1/ostream +OLD_FILES+=usr/include/c++/v1/queue +OLD_FILES+=usr/include/c++/v1/random +OLD_FILES+=usr/include/c++/v1/ratio +OLD_FILES+=usr/include/c++/v1/regex +OLD_FILES+=usr/include/c++/v1/scoped_allocator +OLD_FILES+=usr/include/c++/v1/set +OLD_FILES+=usr/include/c++/v1/sstream +OLD_FILES+=usr/include/c++/v1/stack +OLD_FILES+=usr/include/c++/v1/stdexcept +OLD_FILES+=usr/include/c++/v1/streambuf +OLD_FILES+=usr/include/c++/v1/string +OLD_FILES+=usr/include/c++/v1/strstream +OLD_FILES+=usr/include/c++/v1/system_error +OLD_FILES+=usr/include/c++/v1/tgmath.h +OLD_FILES+=usr/include/c++/v1/thread +OLD_FILES+=usr/include/c++/v1/tuple +OLD_FILES+=usr/include/c++/v1/type_traits +OLD_FILES+=usr/include/c++/v1/typeindex +OLD_FILES+=usr/include/c++/v1/typeinfo +OLD_FILES+=usr/include/c++/v1/unordered_map +OLD_FILES+=usr/include/c++/v1/unordered_set +OLD_FILES+=usr/include/c++/v1/unwind-arm.h +OLD_FILES+=usr/include/c++/v1/unwind-itanium.h +OLD_FILES+=usr/include/c++/v1/unwind.h +OLD_FILES+=usr/include/c++/v1/utility +OLD_FILES+=usr/include/c++/v1/valarray +OLD_FILES+=usr/include/c++/v1/vector +OLD_DIRS+=usr/include/c++/v1/ext +OLD_DIRS+=usr/include/c++/v1 +.endif + #.if ${MK_LIBTHR} == no # to be filled in #.endif From owner-svn-src-head@FreeBSD.ORG Sun Aug 26 20:22:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99C9A1065670; Sun, 26 Aug 2012 20:22:44 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84EF38FC08; Sun, 26 Aug 2012 20:22: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 q7QKMiiF077982; Sun, 26 Aug 2012 20:22:44 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7QKMiCI077979; Sun, 26 Aug 2012 20:22:44 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201208262022.q7QKMiCI077979@svn.freebsd.org> From: Aleksandr Rybalko Date: Sun, 26 Aug 2012 20:22: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: r239716 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 20:22:44 -0000 Author: ray Date: Sun Aug 26 20:22:43 2012 New Revision: 239716 URL: http://svn.freebsd.org/changeset/base/239716 Log: Move AR71XX (MIPS SoCs family) options to options.mips file. PR: 170859 Submitted by: Luiz Otavio O Souza Approved by: adrian (mentor) Modified: head/sys/conf/options head/sys/conf/options.mips Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Aug 26 14:30:14 2012 (r239715) +++ head/sys/conf/options Sun Aug 26 20:22:43 2012 (r239716) @@ -906,11 +906,3 @@ RACCT opt_global.h # Resource Limits RCTL opt_global.h - -# At least one of the AR71XX ubiquiti boards has a Redboot configuration -# that "lies" about the amount of RAM it has. Until a cleaner method is -# defined, this option will suffice in overriding what Redboot says. -AR71XX_REALMEM opt_ar71xx.h -AR71XX_ENV_UBOOT opt_ar71xx.h -AR71XX_ENV_REDBOOT opt_ar71xx.h -AR71XX_ATH_EEPROM opt_ar71xx.h Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Sun Aug 26 14:30:14 2012 (r239715) +++ head/sys/conf/options.mips Sun Aug 26 20:22:43 2012 (r239716) @@ -74,6 +74,16 @@ ARGE_DEBUG opt_arge.h ARGE_MDIO opt_arge.h # +# At least one of the AR71XX ubiquiti boards has a Redboot configuration +# that "lies" about the amount of RAM it has. Until a cleaner method is +# defined, this option will suffice in overriding what Redboot says. +# +AR71XX_REALMEM opt_ar71xx.h +AR71XX_ENV_UBOOT opt_ar71xx.h +AR71XX_ENV_REDBOOT opt_ar71xx.h +AR71XX_ATH_EEPROM opt_ar71xx.h + +# # Options that control the Ralink RT305xF Etherenet MAC. # IF_RT_DEBUG opt_if_rt.h From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 03:09:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8607F1065670; Mon, 27 Aug 2012 03:09:40 +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 706588FC1D; Mon, 27 Aug 2012 03:09: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 q7R39eDK029703; Mon, 27 Aug 2012 03:09:40 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7R39erT029697; Mon, 27 Aug 2012 03:09:40 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201208270309.q7R39erT029697@svn.freebsd.org> From: David Xu Date: Mon, 27 Aug 2012 03:09:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239718 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 03:09:40 -0000 Author: davidxu Date: Mon Aug 27 03:09:39 2012 New Revision: 239718 URL: http://svn.freebsd.org/changeset/base/239718 Log: In suspend_common(), don't wait for a thread which is in creation, because pthread_suspend_all_np() may have already suspended its parent thread. Add locking code in pthread_suspend_all_np() to only allow one thread to suspend other threads, this eliminates a deadlock where two or more threads try to suspend each others. Modified: head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_resume_np.c head/lib/libthr/thread/thr_sig.c head/lib/libthr/thread/thr_suspend_np.c Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Mon Aug 27 02:56:58 2012 (r239717) +++ head/lib/libthr/thread/thr_init.c Mon Aug 27 03:09:39 2012 (r239718) @@ -120,6 +120,10 @@ struct umutex _rwlock_static_lock = DEFA struct umutex _keytable_lock = DEFAULT_UMUTEX; struct urwlock _thr_list_lock = DEFAULT_URWLOCK; struct umutex _thr_event_lock = DEFAULT_UMUTEX; +struct umutex _suspend_all_lock = DEFAULT_UMUTEX; +struct pthread *_single_thread; +int _suspend_all_cycle; +int _suspend_all_waiters; int __pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); int __pthread_mutex_lock(pthread_mutex_t *); @@ -441,11 +445,14 @@ init_private(void) _thr_umutex_init(&_keytable_lock); _thr_urwlock_init(&_thr_atfork_lock); _thr_umutex_init(&_thr_event_lock); + _thr_umutex_init(&_suspend_all_lock); _thr_once_init(); _thr_spinlock_init(); _thr_list_init(); _thr_wake_addr_init(); _sleepq_init(); + _single_thread = NULL; + _suspend_all_waiters = 0; /* * Avoid reinitializing some things if they don't need to be, Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Mon Aug 27 02:56:58 2012 (r239717) +++ head/lib/libthr/thread/thr_private.h Mon Aug 27 03:09:39 2012 (r239718) @@ -721,6 +721,10 @@ extern struct umutex _rwlock_static_lock extern struct umutex _keytable_lock __hidden; extern struct urwlock _thr_list_lock __hidden; extern struct umutex _thr_event_lock __hidden; +extern struct umutex _suspend_all_lock __hidden; +extern int _suspend_all_waiters __hidden; +extern int _suspend_all_cycle __hidden; +extern struct pthread *_single_thread __hidden; /* * Function prototype definitions. @@ -777,6 +781,8 @@ int _thr_setscheduler(lwpid_t, int, cons void _thr_signal_prefork(void) __hidden; void _thr_signal_postfork(void) __hidden; void _thr_signal_postfork_child(void) __hidden; +void _thr_suspend_all_lock(struct pthread *) __hidden; +void _thr_suspend_all_unlock(struct pthread *) __hidden; void _thr_try_gc(struct pthread *, struct pthread *) __hidden; int _rtp_to_schedparam(const struct rtprio *rtp, int *policy, struct sched_param *param) __hidden; Modified: head/lib/libthr/thread/thr_resume_np.c ============================================================================== --- head/lib/libthr/thread/thr_resume_np.c Mon Aug 27 02:56:58 2012 (r239717) +++ head/lib/libthr/thread/thr_resume_np.c Mon Aug 27 03:09:39 2012 (r239718) @@ -63,7 +63,11 @@ _pthread_resume_all_np(void) { struct pthread *curthread = _get_curthread(); struct pthread *thread; + int old_nocancel; + old_nocancel = curthread->no_cancel; + curthread->no_cancel = 1; + _thr_suspend_all_lock(curthread); /* Take the thread list lock: */ THREAD_LIST_RDLOCK(curthread); @@ -77,6 +81,9 @@ _pthread_resume_all_np(void) /* Release the thread list lock: */ THREAD_LIST_UNLOCK(curthread); + _thr_suspend_all_unlock(curthread); + curthread->no_cancel = old_nocancel; + _thr_testcancel(curthread); } static void Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Mon Aug 27 02:56:58 2012 (r239717) +++ head/lib/libthr/thread/thr_sig.c Mon Aug 27 03:09:39 2012 (r239718) @@ -356,7 +356,8 @@ check_suspend(struct pthread *curthread) (THR_FLAGS_NEED_SUSPEND | THR_FLAGS_SUSPENDED)) != THR_FLAGS_NEED_SUSPEND)) return; - + if (curthread == _single_thread) + return; if (curthread->force_exit) return; Modified: head/lib/libthr/thread/thr_suspend_np.c ============================================================================== --- head/lib/libthr/thread/thr_suspend_np.c Mon Aug 27 02:56:58 2012 (r239717) +++ head/lib/libthr/thread/thr_suspend_np.c Mon Aug 27 03:09:39 2012 (r239718) @@ -70,14 +70,48 @@ _pthread_suspend_np(pthread_t thread) } void +_thr_suspend_all_lock(struct pthread *curthread) +{ + int old; + + THR_LOCK_ACQUIRE(curthread, &_suspend_all_lock); + while (_single_thread != NULL) { + old = _suspend_all_cycle; + _suspend_all_waiters++; + THR_LOCK_RELEASE(curthread, &_suspend_all_lock); + _thr_umtx_wait_uint(&_suspend_all_cycle, old, NULL, 0); + THR_LOCK_ACQUIRE(curthread, &_suspend_all_lock); + _suspend_all_waiters--; + } + _single_thread = curthread; + THR_LOCK_RELEASE(curthread, &_suspend_all_lock); +} + +void +_thr_suspend_all_unlock(struct pthread *curthread) +{ + + THR_LOCK_ACQUIRE(curthread, &_suspend_all_lock); + _single_thread = NULL; + if (_suspend_all_waiters != 0) { + _suspend_all_cycle++; + _thr_umtx_wake(&_suspend_all_cycle, INT_MAX, 0); + } + THR_LOCK_RELEASE(curthread, &_suspend_all_lock); +} + +void _pthread_suspend_all_np(void) { struct pthread *curthread = _get_curthread(); struct pthread *thread; + int old_nocancel; int ret; + old_nocancel = curthread->no_cancel; + curthread->no_cancel = 1; + _thr_suspend_all_lock(curthread); THREAD_LIST_RDLOCK(curthread); - TAILQ_FOREACH(thread, &_thread_list, tle) { if (thread != curthread) { THR_THREAD_LOCK(curthread, thread); @@ -115,19 +149,24 @@ restart: THR_THREAD_UNLOCK(curthread, thread); } } - THREAD_LIST_UNLOCK(curthread); + _thr_suspend_all_unlock(curthread); + curthread->no_cancel = old_nocancel; + _thr_testcancel(curthread); } static int suspend_common(struct pthread *curthread, struct pthread *thread, int waitok) { - long tmp; + uint32_t tmp; while (thread->state != PS_DEAD && !(thread->flags & THR_FLAGS_SUSPENDED)) { thread->flags |= THR_FLAGS_NEED_SUSPEND; + /* Thread is in creation. */ + if (thread->tid == TID_TERMINATED) + return (1); tmp = thread->cycle; _thr_send_sig(thread, SIGCANCEL); THR_THREAD_UNLOCK(curthread, thread); From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 04:03:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21714106566C; Mon, 27 Aug 2012 04:03:50 +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 0C1638FC15; Mon, 27 Aug 2012 04:03: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 q7R43neM035805; Mon, 27 Aug 2012 04:03:49 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7R43nhJ035803; Mon, 27 Aug 2012 04:03:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208270403.q7R43nhJ035803@svn.freebsd.org> From: Warner Losh Date: Mon, 27 Aug 2012 04: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: r239719 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 04:03:50 -0000 Author: imp Date: Mon Aug 27 04:03:49 2012 New Revision: 239719 URL: http://svn.freebsd.org/changeset/base/239719 Log: Don't puprosely overclock the SD bus to 30MHz, make the user explicltly enable that. The driver chose to use 60MHz / 2 (30MHz) most of the time rather than 60MHz / 4 (15MHz) based on the Linux driver of the time. This pushes the spec a little in order to not suffer the penalty of running at 15MHz. However, when other bus masters are active in the system, and the user tries 4-wire mode, the internal bus arbitration would fail with data loss as a result. # Comments from PR were reworked to reflect my historical perspective PR: 155214 (partial) Submitted by: Ian Lepore Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Mon Aug 27 03:09:39 2012 (r239718) +++ head/sys/arm/at91/at91_mci.c Mon Aug 27 04:03:49 2012 (r239719) @@ -67,6 +67,53 @@ __FBSDID("$FreeBSD$"); #include "opt_at91.h" +/* + * About running the MCI bus at 30mhz... + * + * Historically, the MCI bus has been run at 30mhz on systems with a 60mhz + * master clock, due to a bug in the mantissa table in dev/mmc.c making it + * appear that the card's max speed was always 30mhz. Fixing that bug causes + * the mmc driver to request a 25mhz clock (as it should) and the logic in + * at91_mci_update_ios() picks the highest speed that doesn't exceed that limit. + * With a 60mhz MCK that would be 15mhz, and that's a real performance buzzkill + * when you've been getting away with 30mhz all along. + * + * By defining AT91_MCI_USE_30MHZ (or setting the 30mhz=1 device hint or + * sysctl) you can enable logic in at91_mci_update_ios() to overlcock the SD + * bus a little by running it at MCK / 2 when MCK is between greater than + * 50MHz and the requested speed is 25mhz. This appears to work on virtually + * all SD cards, since it is what this driver has been doing prior to the + * introduction of this option, where the overclocking vs underclocking + * decision was automaticly "overclock". Modern SD cards can run at + * 45mhz/1-bit in standard mode (high speed mode enable commands not sent) + * without problems. + * + * Speaking of high-speed mode, the rm9200 manual says the MCI device supports + * the SD v1.0 specification and can run up to 50mhz. This is interesting in + * that the SD v1.0 spec caps the speed at 25mhz; high speed mode was added in + * the v1.10 spec. Furthermore, high speed mode doesn't just crank up the + * clock, it alters the signal timing. The rm9200 MCI device doesn't support + * these altered timings. So while speeds over 25mhz may work, they only work + * in what the SD spec calls "default" speed mode, and it amounts to violating + * the spec by overclocking the bus. + * + * If you also enable 4-wire mode it's possible the 30mhz transfers will fail. + * On the AT91RM9200, due to bugs in the bus contention logic, if you have the + * USB host device and OHCI driver enabled will fail. Even underclocking to + * 15MHz, intermittant overrun and underrun errors occur. Note that you don't + * even need to have usb devices attached to the system, the errors begin to + * occur as soon as the OHCI driver sets the register bit to enable periodic + * transfers. It appears (based on brief investigation) that the usb host + * controller uses so much ASB bandwidth that sometimes the DMA for MCI + * transfers doesn't get a bus grant in time and data gets dropped. Adding + * even a modicum of network activity changes the symptom from intermittant to + * very frequent. Members of the AT91SAM9 family have corrected this problem, or + * are at least better about their use of the bus. + */ +#ifndef AT91_MCI_USE_30MHZ +#define AT91_MCI_USE_30MHZ 1 +#endif + #define BBSZ 512 struct at91_mci_softc { @@ -76,9 +123,10 @@ struct at91_mci_softc { #define CAP_HAS_4WIRE 1 /* Has 4 wire bus */ #define CAP_NEEDS_BYTESWAP 2 /* broken hardware needing bounce */ int flags; - int has_4wire; #define CMD_STARTED 1 #define STOP_STARTED 2 + int has_4wire; + int use_30mhz; struct resource *irq_res; /* IRQ resource */ struct resource *mem_res; /* Memory resource */ struct mtx sc_mtx; @@ -236,16 +284,33 @@ at91_mci_attach(device_t dev) if (sc->has_4wire) sc->sc_cap |= CAP_HAS_4WIRE; - sc->host.f_min = at91_master_clock / 512; +#if defined(AT91_MCI_USE_30MHZ) && AT91_MCI_USE_30MHZ != 0 + sc->use_30mhz = 1; +#endif + resource_int_value(device_get_name(dev), device_get_unit(dev), + "30mhz", &sc->use_30mhz); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "30mhz", + CTLFLAG_RW, &sc->use_30mhz, 0, "use 30mhz clock for 25mhz request"); + + /* Our real min freq is master_clock/512, but upper driver layers are + * going to set the min speed during card discovery, and the right speed + * for that is 400khz, so advertise a safe value just under that. + * + * For max speed, while the rm9200 manual says the max is 50mhz, it also + * says it supports only the SD v1.0 spec, which means the real limit is + * 25mhz. On the other hand, historical use has been to slightly violate + * the standard by running the bus at 30mhz. For more information on + * that, see the comments at the top of this file. + */ sc->host.f_min = 375000; sc->host.f_max = at91_master_clock / 2; - if (sc->host.f_max > 50000000) - sc->host.f_max = 50000000; /* Limit to 50MHz */ - + if (sc->host.f_max > 25000000) + sc->host.f_max = 25000000; /* Limit to 25MHz */ sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; sc->host.caps = 0; if (sc->sc_cap & CAP_HAS_4WIRE) sc->host.caps |= MMC_CAP_4_BIT_DATA; + child = device_add_child(dev, "mmc", 0); device_set_ivars(dev, &sc->host); err = bus_generic_attach(dev); @@ -338,23 +403,38 @@ static int at91_mci_update_ios(device_t brdev, device_t reqdev) { struct at91_mci_softc *sc; - struct mmc_host *host; struct mmc_ios *ios; uint32_t clkdiv; sc = device_get_softc(brdev); - host = &sc->host; - ios = &host->ios; - // bus mode? + ios = &sc->host.ios; + + /* + * Calculate our closest available clock speed that doesn't exceed the + * requested speed. + * + * If the master clock is greater than 50MHz and the requested bus + * speed is 25mhz and the use_30mhz flag is on, set clkdiv to zero to + * get a master_clock / 2 (25-30MHz) MMC/SD clock rather than settle for + * the next lower click (12-15MHz). See comments near the top of the + * file for more info. + * + * Whatever we come up with, store it back into ios->clock so that the + * upper layer drivers can report the actual speed of the bus. + */ if (ios->clock == 0) { WR4(sc, MCI_CR, MCI_CR_MCIDIS); clkdiv = 0; } else { - WR4(sc, MCI_CR, MCI_CR_MCIEN); - if ((at91_master_clock % (ios->clock * 2)) == 0) + WR4(sc, MCI_CR, MCI_CR_MCIEN|MCI_CR_PWSEN); + if (sc->use_30mhz && ios->clock == 25000000 && + at91_master_clock > 50000000) + clkdiv = 0; + else if ((at91_master_clock % (ios->clock * 2)) == 0) clkdiv = ((at91_master_clock / ios->clock) / 2) - 1; else clkdiv = (at91_master_clock / ios->clock) / 2; + ios->clock = at91_master_clock / ((clkdiv+1) * 2); } if (ios->bus_width == bus_width_4) WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) | MCI_SDCR_SDCBUS); From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 04:08:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C51DA106566B; Mon, 27 Aug 2012 04:08:44 +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 B08B28FC08; Mon, 27 Aug 2012 04:08: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 q7R48iOY036390; Mon, 27 Aug 2012 04:08:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7R48iiO036387; Mon, 27 Aug 2012 04:08:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208270408.q7R48iiO036387@svn.freebsd.org> From: Warner Losh Date: Mon, 27 Aug 2012 04:08: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: r239720 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 04:08:44 -0000 Author: imp Date: Mon Aug 27 04:08:43 2012 New Revision: 239720 URL: http://svn.freebsd.org/changeset/base/239720 Log: Minor style(9) nit. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Mon Aug 27 04:03:49 2012 (r239719) +++ head/sys/arm/at91/at91_mci.c Mon Aug 27 04:08:43 2012 (r239720) @@ -292,7 +292,8 @@ at91_mci_attach(device_t dev) SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "30mhz", CTLFLAG_RW, &sc->use_30mhz, 0, "use 30mhz clock for 25mhz request"); - /* Our real min freq is master_clock/512, but upper driver layers are + /* + * Our real min freq is master_clock/512, but upper driver layers are * going to set the min speed during card discovery, and the right speed * for that is 400khz, so advertise a safe value just under that. * From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 04:30:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA194106566C; Mon, 27 Aug 2012 04:30:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94A978FC08; Mon, 27 Aug 2012 04:30: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 q7R4Urvj038885; Mon, 27 Aug 2012 04:30:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7R4Urrt038883; Mon, 27 Aug 2012 04:30:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208270430.q7R4Urrt038883@svn.freebsd.org> From: Warner Losh Date: Mon, 27 Aug 2012 04:30: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: r239721 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 04:30:53 -0000 Author: imp Date: Mon Aug 27 04:30:53 2012 New Revision: 239721 URL: http://svn.freebsd.org/changeset/base/239721 Log: Add hint and sysctl support for 4 wire mode. PR: 155241 Submitted by: Ian Lapore Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Mon Aug 27 04:08:43 2012 (r239720) +++ head/sys/arm/at91/at91_mci.c Mon Aug 27 04:30:53 2012 (r239721) @@ -236,8 +236,10 @@ at91_mci_attach(device_t dev) device_t child; int err; - sc->dev = dev; + sctx = device_get_sysctl_ctx(dev); + soid = device_get_sysctl_tree(dev); + sc->dev = dev; sc->sc_cap = 0; if (at91_is_rm92()) sc->sc_cap |= CAP_NEEDS_BYTESWAP; @@ -273,14 +275,18 @@ at91_mci_attach(device_t dev) goto out; } - sctx = device_get_sysctl_ctx(dev); - soid = device_get_sysctl_tree(dev); - SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "4wire", - CTLFLAG_RW, &sc->has_4wire, 0, "has 4 wire SD Card bus"); - -#ifdef AT91_MCI_HAS_4WIRE + /* + * Allow 4-wire to be initially set via #define. + * Allow a device hint to override that. + * Allow a sysctl to override that. + */ +#if defined(AT91_MCI_HAS_4WIRE) && AT91_MCI_HAS_4WIRE != 0 sc->has_4wire = 1; #endif + resource_int_value(device_get_name(dev), device_get_unit(dev), + "4wire", &sc->has_4wire); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "4wire", + CTLFLAG_RW, &sc->has_4wire, 0, "has 4 wire SD Card bus"); if (sc->has_4wire) sc->sc_cap |= CAP_HAS_4WIRE; From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 04:43:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 666E8106566B; Mon, 27 Aug 2012 04:43:31 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50FAD8FC17; Mon, 27 Aug 2012 04:43: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 q7R4hVGj040322; Mon, 27 Aug 2012 04:43:31 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7R4hVoL040319; Mon, 27 Aug 2012 04:43:31 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201208270443.q7R4hVoL040319@svn.freebsd.org> From: Tim Kientzle Date: Mon, 27 Aug 2012 04:43: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: r239722 - head/sys/arm/ti/cpsw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 04:43:31 -0000 Author: kientzle Date: Mon Aug 27 04:43:30 2012 New Revision: 239722 URL: http://svn.freebsd.org/changeset/base/239722 Log: Correctly fetch the MAC address. Break down the bytes directly into the softc; the intermediate buffer isn't needed here. Break down the bytes in the correct order. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Mon Aug 27 04:30:53 2012 (r239721) +++ head/sys/arm/ti/cpsw/if_cpsw.c Mon Aug 27 04:43:30 2012 (r239722) @@ -216,13 +216,11 @@ cpsw_attach(device_t dev) struct cpsw_softc *sc; struct mii_softc *miisc; struct ifnet *ifp; - uint8_t mac_addr[ETHER_ADDR_LEN]; int i, error, phy; uint32_t reg; sc = device_get_softc(dev); sc->dev = dev; - memcpy(sc->mac_addr, mac_addr, ETHER_ADDR_LEN); sc->node = ofw_bus_get_node(dev); /* Get phy address from fdt */ @@ -279,17 +277,17 @@ cpsw_attach(device_t dev) IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); - /* Get low part of MAC address from control module (mac_id0_lo) */ - ti_scm_reg_read_4(0x630, ®); - mac_addr[0] = (reg >> 8) & 0xFF; - mac_addr[1] = reg & 0xFF; - /* Get high part of MAC address from control module (mac_id0_hi) */ ti_scm_reg_read_4(0x634, ®); - mac_addr[2] = (reg >> 24) & 0xFF; - mac_addr[3] = (reg >> 16) & 0xFF; - mac_addr[4] = (reg >> 8) & 0xFF; - mac_addr[5] = reg & 0xFF; + sc->mac_addr[0] = reg & 0xFF; + sc->mac_addr[1] = (reg >> 8) & 0xFF; + sc->mac_addr[2] = (reg >> 16) & 0xFF; + sc->mac_addr[3] = (reg >> 24) & 0xFF; + + /* Get low part of MAC address from control module (mac_id0_lo) */ + ti_scm_reg_read_4(0x630, ®); + sc->mac_addr[4] = reg & 0xFF; + sc->mac_addr[5] = (reg >> 8) & 0xFF; ether_ifattach(ifp, sc->mac_addr); callout_init(&sc->wd_callout, 0); From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 07:52:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ABEE3106564A; Mon, 27 Aug 2012 07:52:09 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 6EA7E8FC16; Mon, 27 Aug 2012 07:52:08 +0000 (UTC) Received: from localhost (dlk19.neoplus.adsl.tpnet.pl [83.24.40.19]) by mail.dawidek.net (Postfix) with ESMTPSA id D1C46E2E; Mon, 27 Aug 2012 09:51:26 +0200 (CEST) Date: Mon, 27 Aug 2012 09:51:59 +0200 From: Pawel Jakub Dawidek To: David Schultz Message-ID: <20120827075158.GA1370@garage.freebsd.pl> References: <201110210635.p9L6Zw2o010312@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline In-Reply-To: <201110210635.p9L6Zw2o010312@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r226604 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 07:52:09 -0000 --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 21, 2011 at 06:35:58AM +0000, David Schultz wrote: > Author: das > Date: Fri Oct 21 06:35:58 2011 > New Revision: 226604 > URL: http://svn.freebsd.org/changeset/base/226604 >=20 > Log: > Add support for the 'x' mode option in fopen() as specified in the C1X > draft standard. The option is equivalent to O_EXCL. Apart from adding the 'x' mode option this change heavly modifies manual page. For example you removed information that the 'w' option truncates the file to zero length. I had to look at the code to figure it out. Why those changes to manual page were made? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --W/nzBZO5zC0uMSeA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlA7Jx4ACgkQForvXbEpPzT7WACdHog/uZ2RSR9qs5Mvt/QACaoh B8gAn1/R6PmOVvKyylyu51Gtus5eO53T =8hlH -----END PGP SIGNATURE----- --W/nzBZO5zC0uMSeA-- From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 10:59:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D8BA0106564A; Mon, 27 Aug 2012 10:59:49 +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 C46E58FC1F; Mon, 27 Aug 2012 10:59: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 q7RAxndn085269; Mon, 27 Aug 2012 10:59:49 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RAxnK7085267; Mon, 27 Aug 2012 10:59:49 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201208271059.q7RAxnK7085267@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 27 Aug 2012 10:59: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: r239723 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 10:59:49 -0000 Author: pluknet Date: Mon Aug 27 10:59:49 2012 New Revision: 239723 URL: http://svn.freebsd.org/changeset/base/239723 Log: Typo in previous change: print half the theoretical maximum as maximum recommended amount. Reported by: Reviewed by: des Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Aug 27 04:43:30 2012 (r239722) +++ head/sys/vm/swap_pager.c Mon Aug 27 10:59:49 2012 (r239723) @@ -2135,7 +2135,7 @@ swapon_check_swzone(unsigned long npages if (npages > maxpages / 2) { printf("warning: total configured swap (%lu pages) " "exceeds maximum recommended amount (%lu pages).\n", - npages, maxpages); + npages, maxpages / 2); printf("warning: increase kern.maxswzone " "or reduce amount of swap.\n"); return (-1); From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 13:22:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E58AB1065670; Mon, 27 Aug 2012 13:22:28 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D3108FC20; Mon, 27 Aug 2012 13:22: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 q7RDMSgD002947; Mon, 27 Aug 2012 13:22:28 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RDMSEw002945; Mon, 27 Aug 2012 13:22:28 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208271322.q7RDMSEw002945@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 27 Aug 2012 13:22: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: r239730 - head/sys/i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 13:22:29 -0000 Author: des Date: Mon Aug 27 13:22:27 2012 New Revision: 239730 URL: http://svn.freebsd.org/changeset/base/239730 Log: Parly revert r239255: reinstate a default maxswzone on i386, where KVA is scarce, but set it slightly higher so we can handle 8 GB of swap. Modified: head/sys/i386/include/param.h Modified: head/sys/i386/include/param.h ============================================================================== --- head/sys/i386/include/param.h Mon Aug 27 13:05:15 2012 (r239729) +++ head/sys/i386/include/param.h Mon Aug 27 13:22:27 2012 (r239730) @@ -123,6 +123,20 @@ #define KSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */ /* + * Ceiling on amount of swblock kva space, can be changed via + * the kern.maxswzone /boot/loader.conf variable. + * + * 276 is sizeof(struct swblock), but we do not always have a definition + * in scope for struct swblock, so we have to hardcode it. Each struct + * swblock holds metadata for 32 pages, so in theory, this is enough for + * 16 GB of swap. In practice, however, the usable amount is considerably + * lower due to fragmentation. + */ +#ifndef VM_SWZONE_SIZE_MAX +#define VM_SWZONE_SIZE_MAX (276 * 128 * 1024) +#endif + +/* * Ceiling on size of buffer cache (really only effects write queueing, * the VM page cache is not effected), can be changed via * the kern.maxbcache /boot/loader.conf variable. From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 14:51:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C22DA106566B; Mon, 27 Aug 2012 14:51:26 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC7F98FC14; Mon, 27 Aug 2012 14:51: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 q7REpQpq013161; Mon, 27 Aug 2012 14:51:26 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7REpQ6W013159; Mon, 27 Aug 2012 14:51:26 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201208271451.q7REpQ6W013159@svn.freebsd.org> From: Roman Divacky Date: Mon, 27 Aug 2012 14:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239733 - head/usr.sbin/nvram X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 14:51:26 -0000 Author: rdivacky Date: Mon Aug 27 14:51:26 2012 New Revision: 239733 URL: http://svn.freebsd.org/changeset/base/239733 Log: Dont cast from char* to struct chrp_header* which has a bigger alignment requirements. Copy it via union instead. Fixes a clang warning about alignment. Reviewed by: sobomax Modified: head/usr.sbin/nvram/nvram.c Modified: head/usr.sbin/nvram/nvram.c ============================================================================== --- head/usr.sbin/nvram/nvram.c Mon Aug 27 14:44:40 2012 (r239732) +++ head/usr.sbin/nvram/nvram.c Mon Aug 27 14:51:26 2012 (r239733) @@ -51,12 +51,16 @@ struct deletelist { struct deletelist *last; }; +union { + uint8_t buf[sizeof(struct chrp_header)]; + struct chrp_header header; +} conv; + int main(int argc, char **argv) { int opt, dump, fd, res, i, size; uint8_t buf[NVRAM_SIZE], *cp, *common; - struct chrp_header *header; struct deletelist *dl; dump = 0; @@ -116,9 +120,9 @@ main(int argc, char **argv) /* Locate common block */ size = 0; for (cp = buf; cp < buf + sizeof(buf); cp += size) { - header = (struct chrp_header *)cp; - size = header->length * 0x10; - if (strncmp(header->name, "common", 7) == 0) + memcpy(conv.buf, cp, sizeof(struct chrp_header)); + size = conv.header.length * 0x10; + if (strncmp(conv.header.name, "common", 7) == 0) break; } if (cp >= buf + sizeof(buf) || size <= (int)sizeof(struct chrp_header)) From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 16:42:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52050106564A; Mon, 27 Aug 2012 16:42:33 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CF268FC0C; Mon, 27 Aug 2012 16:42: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 q7RGgX4K026014; Mon, 27 Aug 2012 16:42:33 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RGgX7q026012; Mon, 27 Aug 2012 16:42:33 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201208271642.q7RGgX7q026012@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 27 Aug 2012 16:42: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: r239738 - head/release/picobsd/build X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 16:42:33 -0000 Author: luigi Date: Mon Aug 27 16:42:32 2012 New Revision: 239738 URL: http://svn.freebsd.org/changeset/base/239738 Log: use MALLOC_PRODUCTION for picobsd builds, be more frugal in memory usage. Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Mon Aug 27 15:57:33 2012 (r239737) +++ head/release/picobsd/build/picobsd Mon Aug 27 16:42:32 2012 (r239738) @@ -7,6 +7,8 @@ # # picobsd [options] image_type [site_name] # +# CWARNFLAGS can be used to pass -Wall or similar options +# # Where image_type is a directory with the picobsd config info, # and ${image_type}/floppy.tree.${site_name} contains # optional site-specific configuration. @@ -164,7 +166,7 @@ create_includes_and_libraries2() { # opt log "create_includes_and_libraries2() for ${SRC} $1" if [ ${OSVERSION} -ge 600000 ] ; then no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1" - no="$no -DWITHOUT_CLANG" + no="$no -DWITHOUT_CLANG -DMALLOC_PRODUCTION" else no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" fi From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 17:15:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35D99106564A; Mon, 27 Aug 2012 17:15:15 +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 213B58FC19; Mon, 27 Aug 2012 17:15:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RHFE3F029703; Mon, 27 Aug 2012 17:15:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RHFEO3029701; Mon, 27 Aug 2012 17:15:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208271715.q7RHFEO3029701@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Aug 2012 17:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239739 - head/share/doc/smm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 17:15:15 -0000 Author: jhb Date: Mon Aug 27 17:15:14 2012 New Revision: 239739 URL: http://svn.freebsd.org/changeset/base/239739 Log: Don't build and install the 07.lpd doc if WITHOUT_LPR is set. MFC after: 1 week Modified: head/share/doc/smm/Makefile Modified: head/share/doc/smm/Makefile ============================================================================== --- head/share/doc/smm/Makefile Mon Aug 27 16:42:32 2012 (r239738) +++ head/share/doc/smm/Makefile Mon Aug 27 17:15:14 2012 (r239739) @@ -18,7 +18,7 @@ SUBDIR= title \ 04.quotas \ 05.fastfs \ 06.nfs \ - 07.lpd \ + ${_07.lpd} \ ${_08.sendmailop} \ 11.timedop \ 12.timed \ @@ -28,4 +28,8 @@ SUBDIR= title \ _08.sendmailop= 08.sendmailop .endif +.if ${MK_LPR} != "no" +_07.lpd= 07.lpd +.endif + .include From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 17:24:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 38D10106566B; Mon, 27 Aug 2012 17:24:08 +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 232FC8FC15; Mon, 27 Aug 2012 17:24: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 q7RHO8bJ030659; Mon, 27 Aug 2012 17:24:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RHO7R0030652; Mon, 27 Aug 2012 17:24:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208271724.q7RHO7R0030652@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Aug 2012 17:24: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: r239740 - head/sys/dev/ida X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 17:24:08 -0000 Author: jhb Date: Mon Aug 27 17:24:07 2012 New Revision: 239740 URL: http://svn.freebsd.org/changeset/base/239740 Log: Rework the DMA handling in ida(4) and add locking to make this driver MPSAFE. - Preallocate a full set of QCBs during attach rather than allocating new ones on demand to avoid allocations in the I/O path. - Remove the explicit bus space tag/handle and use bus_*() on the relevant 'struct resource' instead. - Defer logical drive probing to an intrhook. - Fix ida_detach() to detach and delete child devices (logical drives). - Update the DMA handling to support EINPROGRESS by moving the work to submit a mapped request into the bus_dma callback routine as well as add support for freezing the queue when EINPROGRESS is encountered. Tested by: Marco Steinbach coco executive-computing de Modified: head/sys/dev/ida/ida.c head/sys/dev/ida/ida_disk.c head/sys/dev/ida/ida_eisa.c head/sys/dev/ida/ida_pci.c head/sys/dev/ida/idavar.h Modified: head/sys/dev/ida/ida.c ============================================================================== --- head/sys/dev/ida/ida.c Mon Aug 27 17:15:14 2012 (r239739) +++ head/sys/dev/ida/ida.c Mon Aug 27 17:24:07 2012 (r239740) @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -56,17 +58,17 @@ __FBSDID("$FreeBSD$"); #include /* prototypes */ -static void ida_alloc_qcb(struct ida_softc *ida); -static void ida_construct_qcb(struct ida_softc *ida); -static void ida_start(struct ida_softc *ida); +static int ida_alloc_qcbs(struct ida_softc *ida); static void ida_done(struct ida_softc *ida, struct ida_qcb *qcb); +static void ida_start(struct ida_softc *ida); +static void ida_startio(struct ida_softc *ida); +static void ida_startup(void *arg); +static void ida_timeout(void *arg); static int ida_wait(struct ida_softc *ida, struct ida_qcb *qcb); -static void ida_timeout (void *arg); static d_ioctl_t ida_ioctl; static struct cdevsw ida_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_ioctl = ida_ioctl, .d_name = "ida", }; @@ -76,10 +78,16 @@ ida_free(struct ida_softc *ida) { int i; + if (ida->ih != NULL) + bus_teardown_intr(ida->dev, ida->irq, ida->ih); + + mtx_lock(&ida->lock); callout_stop(&ida->ch); + mtx_unlock(&ida->lock); + callout_drain(&ida->ch); if (ida->buffer_dmat) { - for (i = 0; i < ida->num_qcbs; i++) + for (i = 0; i < IDA_QCB_MAX; i++) bus_dmamap_destroy(ida->buffer_dmat, ida->qcbs[i].dmamap); bus_dma_tag_destroy(ida->buffer_dmat); } @@ -96,9 +104,6 @@ ida_free(struct ida_softc *ida) if (ida->qcbs != NULL) free(ida->qcbs, M_DEVBUF); - if (ida->ih != NULL) - bus_teardown_intr(ida->dev, ida->irq, ida->ih); - if (ida->irq != NULL) bus_release_resource(ida->dev, ida->irq_res_type, 0, ida->irq); @@ -109,6 +114,8 @@ ida_free(struct ida_softc *ida) if (ida->regs != NULL) bus_release_resource(ida->dev, ida->regs_res_type, ida->regs_res_id, ida->regs); + + mtx_destroy(&ida->lock); } /* @@ -130,14 +137,21 @@ ida_get_qcb(struct ida_softc *ida) if ((qcb = SLIST_FIRST(&ida->free_qcbs)) != NULL) { SLIST_REMOVE_HEAD(&ida->free_qcbs, link.sle); - } else { - ida_alloc_qcb(ida); - if ((qcb = SLIST_FIRST(&ida->free_qcbs)) != NULL) - SLIST_REMOVE_HEAD(&ida->free_qcbs, link.sle); + bzero(qcb->hwqcb, sizeof(struct ida_hdr) + sizeof(struct ida_req)); } return (qcb); } +static __inline void +ida_free_qcb(struct ida_softc *ida, struct ida_qcb *qcb) +{ + + qcb->state = QCB_FREE; + qcb->buf = NULL; + qcb->error = 0; + SLIST_INSERT_HEAD(&ida->free_qcbs, qcb, link.sle); +} + static __inline bus_addr_t idahwqcbvtop(struct ida_softc *ida, struct ida_hardware_qcb *hwqcb) { @@ -155,42 +169,35 @@ idahwqcbptov(struct ida_softc *ida, bus_ return (hwqcb->qcb); } -/* - * XXX - * since we allocate all QCB space up front during initialization, then - * why bother with this routine? - */ -static void -ida_alloc_qcb(struct ida_softc *ida) +static int +ida_alloc_qcbs(struct ida_softc *ida) { struct ida_qcb *qcb; - int error; - - if (ida->num_qcbs >= IDA_QCB_MAX) - return; - - qcb = &ida->qcbs[ida->num_qcbs]; + int error, i; - error = bus_dmamap_create(ida->buffer_dmat, /*flags*/0, &qcb->dmamap); - if (error != 0) - return; + for (i = 0; i < IDA_QCB_MAX; i++) { + qcb = &ida->qcbs[i]; - qcb->flags = QCB_FREE; - qcb->hwqcb = &ida->hwqcbs[ida->num_qcbs]; - qcb->hwqcb->qcb = qcb; - qcb->hwqcb_busaddr = idahwqcbvtop(ida, qcb->hwqcb); - SLIST_INSERT_HEAD(&ida->free_qcbs, qcb, link.sle); - ida->num_qcbs++; + error = bus_dmamap_create(ida->buffer_dmat, /*flags*/0, &qcb->dmamap); + if (error != 0) + return (error); + + qcb->ida = ida; + qcb->flags = QCB_FREE; + qcb->hwqcb = &ida->hwqcbs[i]; + qcb->hwqcb->qcb = qcb; + qcb->hwqcb_busaddr = idahwqcbvtop(ida, qcb->hwqcb); + SLIST_INSERT_HEAD(&ida->free_qcbs, qcb, link.sle); + } + return (0); } int ida_init(struct ida_softc *ida) { - int error; - - ida->unit = device_get_unit(ida->dev); - ida->tag = rman_get_bustag(ida->regs); - ida->bsh = rman_get_bushandle(ida->regs); + struct ida_controller_info cinfo; + device_t child; + int error, i, unit; SLIST_INIT(&ida->free_qcbs); STAILQ_INIT(&ida->qcb_queue); @@ -219,8 +226,8 @@ ida_init(struct ida_softc *ida) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &ida->hwqcb_dmat); if (error) return (ENOMEM); @@ -258,26 +265,19 @@ ida_init(struct ida_softc *ida) bzero(ida->hwqcbs, IDA_QCB_MAX * sizeof(struct ida_hardware_qcb)); - ida_alloc_qcb(ida); /* allocate an initial qcb */ - - callout_init(&ida->ch, CALLOUT_MPSAFE); - - return (0); -} - -void -ida_attach(struct ida_softc *ida) -{ - struct ida_controller_info cinfo; - int error, i; + error = ida_alloc_qcbs(ida); + if (error) + return (error); + mtx_lock(&ida->lock); ida->cmd.int_enable(ida, 0); error = ida_command(ida, CMD_GET_CTRL_INFO, &cinfo, sizeof(cinfo), IDA_CONTROLLER, 0, DMA_DATA_IN); if (error) { + mtx_unlock(&ida->lock); device_printf(ida->dev, "CMD_GET_CTRL_INFO failed.\n"); - return; + return (error); } device_printf(ida->dev, "drives=%d firm_rev=%c%c%c%c\n", @@ -290,33 +290,68 @@ ida_attach(struct ida_softc *ida) error = ida_command(ida, CMD_START_FIRMWARE, &data, sizeof(data), IDA_CONTROLLER, 0, DMA_DATA_IN); if (error) { + mtx_unlock(&ida->lock); device_printf(ida->dev, "CMD_START_FIRMWARE failed.\n"); - return; + return (error); } } + + ida->cmd.int_enable(ida, 1); + ida->flags |= IDA_ATTACHED; + mtx_unlock(&ida->lock); + + for (i = 0; i < cinfo.num_drvs; i++) { + child = device_add_child(ida->dev, /*"idad"*/NULL, -1); + if (child != NULL) + device_set_ivars(child, (void *)(intptr_t)i); + } - ida->ida_dev_t = make_dev(&ida_cdevsw, ida->unit, + ida->ich.ich_func = ida_startup; + ida->ich.ich_arg = ida; + if (config_intrhook_establish(&ida->ich) != 0) { + device_delete_children(ida->dev); + device_printf(ida->dev, "Cannot establish configuration hook\n"); + return (error); + } + + unit = device_get_unit(ida->dev); + ida->ida_dev_t = make_dev(&ida_cdevsw, unit, UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR, - "ida%d", ida->unit); + "ida%d", unit); ida->ida_dev_t->si_drv1 = ida; - ida->num_drives = 0; - for (i = 0; i < cinfo.num_drvs; i++) - device_add_child(ida->dev, /*"idad"*/NULL, -1); + return (0); +} + +static void +ida_startup(void *arg) +{ + struct ida_softc *ida; - bus_generic_attach(ida->dev); + ida = arg; - ida->cmd.int_enable(ida, 1); + config_intrhook_disestablish(&ida->ich); + + mtx_lock(&Giant); + bus_generic_attach(ida->dev); + mtx_unlock(&Giant); } int ida_detach(device_t dev) { struct ida_softc *ida; - int error = 0; + int error; ida = (struct ida_softc *)device_get_softc(dev); + error = bus_generic_detach(dev); + if (error) + return (error); + error = device_delete_children(dev); + if (error) + return (error); + /* * XXX * before detaching, we must make sure that the system is @@ -335,11 +370,25 @@ ida_detach(device_t dev) } static void -ida_setup_dmamap(void *arg, bus_dma_segment_t *segs, int nsegments, int error) +ida_data_cb(void *arg, bus_dma_segment_t *segs, int nsegments, int error) { - struct ida_hardware_qcb *hwqcb = (struct ida_hardware_qcb *)arg; + struct ida_hardware_qcb *hwqcb; + struct ida_softc *ida; + struct ida_qcb *qcb; + bus_dmasync_op_t op; int i; + qcb = arg; + ida = qcb->ida; + if (!dumping) + mtx_assert(&ida->lock, MA_OWNED); + if (error) { + qcb->error = error; + ida_done(ida, qcb); + return; + } + + hwqcb = qcb->hwqcb; hwqcb->hdr.size = htole16((sizeof(struct ida_req) + sizeof(struct ida_sgb) * IDA_NSEG) >> 2); @@ -348,6 +397,47 @@ ida_setup_dmamap(void *arg, bus_dma_segm hwqcb->seg[i].length = htole32(segs[i].ds_len); } hwqcb->req.sgcount = nsegments; + if (qcb->flags & DMA_DATA_TRANSFER) { + switch (qcb->flags & DMA_DATA_TRANSFER) { + case DMA_DATA_TRANSFER: + op = BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE; + break; + case DMA_DATA_IN: + op = BUS_DMASYNC_PREREAD; + break; + default: + KASSERT((qcb->flags & DMA_DATA_TRANSFER) == + DMA_DATA_OUT, ("bad DMA data flags")); + op = BUS_DMASYNC_PREWRITE; + break; + } + bus_dmamap_sync(ida->buffer_dmat, qcb->dmamap, op); + } + bus_dmamap_sync(ida->hwqcb_dmat, ida->hwqcb_dmamap, + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + + STAILQ_INSERT_TAIL(&ida->qcb_queue, qcb, link.stqe); + ida_start(ida); + ida->flags &= ~IDA_QFROZEN; +} + +static int +ida_map_qcb(struct ida_softc *ida, struct ida_qcb *qcb, void *data, + bus_size_t datasize) +{ + int error, flags; + + if (ida->flags & IDA_INTERRUPTS) + flags = BUS_DMA_WAITOK; + else + flags = BUS_DMA_NOWAIT; + error = bus_dmamap_load(ida->buffer_dmat, qcb->dmamap, data, datasize, + ida_data_cb, qcb, flags); + if (error == EINPROGRESS) { + ida->flags |= IDA_QFROZEN; + error = 0; + } + return (error); } int @@ -356,105 +446,96 @@ ida_command(struct ida_softc *ida, int c { struct ida_hardware_qcb *hwqcb; struct ida_qcb *qcb; - bus_dmasync_op_t op; - int s, error; + int error; - s = splbio(); + if (!dumping) + mtx_assert(&ida->lock, MA_OWNED); qcb = ida_get_qcb(ida); - splx(s); if (qcb == NULL) { - printf("ida_command: out of QCBs"); + device_printf(ida->dev, "out of QCBs\n"); return (EAGAIN); } + qcb->flags = flags | IDA_COMMAND; hwqcb = qcb->hwqcb; - bzero(hwqcb, sizeof(struct ida_hdr) + sizeof(struct ida_req)); - - bus_dmamap_load(ida->buffer_dmat, qcb->dmamap, - (void *)data, datasize, ida_setup_dmamap, hwqcb, 0); - op = qcb->flags & DMA_DATA_IN ? - BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE; - bus_dmamap_sync(ida->buffer_dmat, qcb->dmamap, op); - hwqcb->hdr.drive = drive; hwqcb->req.blkno = htole32(pblkno); hwqcb->req.bcount = htole16(howmany(datasize, DEV_BSIZE)); hwqcb->req.command = command; - qcb->flags = flags | IDA_COMMAND; - - s = splbio(); - STAILQ_INSERT_TAIL(&ida->qcb_queue, qcb, link.stqe); - ida_start(ida); - error = ida_wait(ida, qcb); - splx(s); + error = ida_map_qcb(ida, qcb, data, datasize); + if (error == 0) { + error = ida_wait(ida, qcb); + /* Don't free QCB on a timeout in case it later completes. */ + if (error) + return (error); + error = qcb->error; + } /* XXX should have status returned here? */ /* XXX have "status pointer" area in QCB? */ + ida_free_qcb(ida, qcb); return (error); } void ida_submit_buf(struct ida_softc *ida, struct bio *bp) { + mtx_lock(&ida->lock); bioq_insert_tail(&ida->bio_queue, bp); - ida_construct_qcb(ida); - ida_start(ida); + ida_startio(ida); + mtx_unlock(&ida->lock); } static void -ida_construct_qcb(struct ida_softc *ida) +ida_startio(struct ida_softc *ida) { struct ida_hardware_qcb *hwqcb; struct ida_qcb *qcb; - bus_dmasync_op_t op; + struct idad_softc *drv; struct bio *bp; + int error; - bp = bioq_first(&ida->bio_queue); - if (bp == NULL) - return; /* no more buffers */ - - qcb = ida_get_qcb(ida); - if (qcb == NULL) - return; /* out of resources */ - - bioq_remove(&ida->bio_queue, bp); - qcb->buf = bp; - qcb->flags = bp->bio_cmd == BIO_READ ? DMA_DATA_IN : DMA_DATA_OUT; - - hwqcb = qcb->hwqcb; - bzero(hwqcb, sizeof(struct ida_hdr) + sizeof(struct ida_req)); - - bus_dmamap_load(ida->buffer_dmat, qcb->dmamap, - (void *)bp->bio_data, bp->bio_bcount, ida_setup_dmamap, hwqcb, 0); - op = qcb->flags & DMA_DATA_IN ? - BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE; - bus_dmamap_sync(ida->buffer_dmat, qcb->dmamap, op); + mtx_assert(&ida->lock, MA_OWNED); + for (;;) { + if (ida->flags & IDA_QFROZEN) + return; + bp = bioq_first(&ida->bio_queue); + if (bp == NULL) + return; /* no more buffers */ + + qcb = ida_get_qcb(ida); + if (qcb == NULL) + return; /* out of resources */ + + bioq_remove(&ida->bio_queue, bp); + qcb->buf = bp; + qcb->flags = bp->bio_cmd == BIO_READ ? DMA_DATA_IN : DMA_DATA_OUT; - { - struct idad_softc *drv = (struct idad_softc *)bp->bio_driver1; + hwqcb = qcb->hwqcb; + drv = bp->bio_driver1; hwqcb->hdr.drive = drv->drive; - } + hwqcb->req.blkno = bp->bio_pblkno; + hwqcb->req.bcount = howmany(bp->bio_bcount, DEV_BSIZE); + hwqcb->req.command = bp->bio_cmd == BIO_READ ? CMD_READ : CMD_WRITE; - hwqcb->req.blkno = bp->bio_pblkno; - hwqcb->req.bcount = howmany(bp->bio_bcount, DEV_BSIZE); - hwqcb->req.command = bp->bio_cmd == BIO_READ ? CMD_READ : CMD_WRITE; - - STAILQ_INSERT_TAIL(&ida->qcb_queue, qcb, link.stqe); + error = ida_map_qcb(ida, qcb, bp->bio_data, bp->bio_bcount); + if (error) { + qcb->error = error; + ida_done(ida, qcb); + } + } } -/* - * This routine will be called from ida_intr in order to queue up more - * I/O, meaning that we may be in an interrupt context. Hence, we should - * not muck around with spl() in this routine. - */ static void ida_start(struct ida_softc *ida) { struct ida_qcb *qcb; + if (!dumping) + mtx_assert(&ida->lock, MA_OWNED); while ((qcb = STAILQ_FIRST(&ida->qcb_queue)) != NULL) { if (ida->cmd.fifo_full(ida)) break; @@ -465,7 +546,7 @@ ida_start(struct ida_softc *ida) */ /* Set a timeout. */ - if (!ida->qactive) + if (!ida->qactive && !dumping) callout_reset(&ida->ch, hz * 5, ida_timeout, ida); ida->qactive++; @@ -481,17 +562,23 @@ ida_wait(struct ida_softc *ida, struct i bus_addr_t completed; int delay; + if (!dumping) + mtx_assert(&ida->lock, MA_OWNED); if (ida->flags & IDA_INTERRUPTS) { - if (tsleep(qcb, PRIBIO, "idacmd", 5 * hz)) + if (mtx_sleep(qcb, &ida->lock, PRIBIO, "idacmd", 5 * hz)) { + qcb->state = QCB_TIMEDOUT; return (ETIMEDOUT); + } return (0); } again: delay = 5 * 1000 * 100; /* 5 sec delay */ while ((completed = ida->cmd.done(ida)) == 0) { - if (delay-- == 0) + if (delay-- == 0) { + qcb->state = QCB_TIMEDOUT; return (ETIMEDOUT); + } DELAY(10); } @@ -511,8 +598,11 @@ ida_intr(void *data) ida = (struct ida_softc *)data; - if (ida->cmd.int_pending(ida) == 0) + mtx_lock(&ida->lock); + if (ida->cmd.int_pending(ida) == 0) { + mtx_unlock(&ida->lock); return; /* not our interrupt */ + } while ((completed = ida->cmd.done(ida)) != 0) { qcb = idahwqcbptov(ida, completed & ~3); @@ -527,7 +617,8 @@ ida_intr(void *data) qcb->hwqcb->req.error = CMD_REJECTED; ida_done(ida, qcb); } - ida_start(ida); + ida_startio(ida); + mtx_unlock(&ida->lock); } /* @@ -536,19 +627,35 @@ ida_intr(void *data) static void ida_done(struct ida_softc *ida, struct ida_qcb *qcb) { - int error = 0; + bus_dmasync_op_t op; + int active, error = 0; /* * finish up command */ - if (qcb->flags & DMA_DATA_TRANSFER) { - bus_dmasync_op_t op; - - op = qcb->flags & DMA_DATA_IN ? - BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE; + if (!dumping) + mtx_assert(&ida->lock, MA_OWNED); + active = (qcb->state != QCB_FREE); + if (qcb->flags & DMA_DATA_TRANSFER && active) { + switch (qcb->flags & DMA_DATA_TRANSFER) { + case DMA_DATA_TRANSFER: + op = BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE; + break; + case DMA_DATA_IN: + op = BUS_DMASYNC_POSTREAD; + break; + default: + KASSERT((qcb->flags & DMA_DATA_TRANSFER) == + DMA_DATA_OUT, ("bad DMA data flags")); + op = BUS_DMASYNC_POSTWRITE; + break; + } bus_dmamap_sync(ida->buffer_dmat, qcb->dmamap, op); bus_dmamap_unload(ida->buffer_dmat, qcb->dmamap); } + if (active) + bus_dmamap_sync(ida->hwqcb_dmat, ida->hwqcb_dmamap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); if (qcb->hwqcb->req.error & SOFT_ERROR) { if (qcb->buf) @@ -571,32 +678,37 @@ ida_done(struct ida_softc *ida, struct i error = 1; device_printf(ida->dev, "invalid request\n"); } + if (qcb->error) { + error = 1; + device_printf(ida->dev, "request failed to map: %d\n", qcb->error); + } if (qcb->flags & IDA_COMMAND) { if (ida->flags & IDA_INTERRUPTS) wakeup(qcb); + if (qcb->state == QCB_TIMEDOUT) + ida_free_qcb(ida, qcb); } else { KASSERT(qcb->buf != NULL, ("ida_done(): qcb->buf is NULL!")); if (error) qcb->buf->bio_flags |= BIO_ERROR; idad_intr(qcb->buf); + ida_free_qcb(ida, qcb); } + if (!active) + return; + ida->qactive--; /* Reschedule or cancel timeout */ if (ida->qactive) callout_reset(&ida->ch, hz * 5, ida_timeout, ida); else callout_stop(&ida->ch); - - qcb->state = QCB_FREE; - qcb->buf = NULL; - SLIST_INSERT_HEAD(&ida->free_qcbs, qcb, link.sle); - ida_construct_qcb(ida); } static void -ida_timeout (void *arg) +ida_timeout(void *arg) { struct ida_softc *ida; @@ -661,8 +773,10 @@ ida_ioctl (struct cdev *dev, u_long cmd, daddr = &data; len = sizeof(data); } + mtx_lock(&sc->lock); error = ida_command(sc, uc->command, daddr, len, uc->drive, uc->blkno, flags); + mtx_unlock(&sc->lock); break; default: error = ENOIOCTL; Modified: head/sys/dev/ida/ida_disk.c ============================================================================== --- head/sys/dev/ida/ida_disk.c Mon Aug 27 17:15:14 2012 (r239739) +++ head/sys/dev/ida/ida_disk.c Mon Aug 27 17:24:07 2012 (r239740) @@ -87,7 +87,6 @@ static void idad_strategy(struct bio *bp) { struct idad_softc *drv; - int s; drv = bp->bio_disk->d_drv1; if (drv == NULL) { @@ -104,9 +103,7 @@ idad_strategy(struct bio *bp) } bp->bio_driver1 = drv; - s = splbio(); ida_submit_buf(drv->controller, bp); - splx(s); return; bad: @@ -179,11 +176,12 @@ idad_attach(device_t dev) drv->dev = dev; drv->controller = (struct ida_softc *)device_get_softc(parent); drv->unit = device_get_unit(dev); - drv->drive = drv->controller->num_drives; - drv->controller->num_drives++; + drv->drive = (intptr_t)device_get_ivars(dev); + mtx_lock(&drv->controller->lock); error = ida_command(drv->controller, CMD_GET_LOG_DRV_INFO, &dinfo, sizeof(dinfo), drv->drive, 0, DMA_DATA_IN); + mtx_unlock(&drv->controller->lock); if (error) { device_printf(dev, "CMD_GET_LOG_DRV_INFO failed\n"); return (ENXIO); @@ -213,7 +211,6 @@ idad_attach(device_t dev) drv->disk->d_drv1 = drv; drv->disk->d_maxsize = DFLTPHYS; /* XXX guess? */ drv->disk->d_unit = drv->unit; - drv->disk->d_flags = DISKFLAG_NEEDSGIANT; disk_create(drv->disk, DISK_VERSION); return (0); Modified: head/sys/dev/ida/ida_eisa.c ============================================================================== --- head/sys/dev/ida/ida_eisa.c Mon Aug 27 17:15:14 2012 (r239739) +++ head/sys/dev/ida/ida_eisa.c Mon Aug 27 17:24:07 2012 (r239740) @@ -282,6 +282,8 @@ ida_eisa_attach(device_t dev) board = ida_eisa_match(eisa_get_id(dev)); ida->cmd = *board->accessor; ida->flags = board->flags; + mtx_init(&ida->lock, "ida", NULL, MTX_DEF); + callout_init_mtx(&ida->ch, &ida->lock, 0); ida->regs_res_type = SYS_RES_IOPORT; ida->regs_res_id = 0; @@ -293,7 +295,7 @@ ida_eisa_attach(device_t dev) } error = bus_dma_tag_create( - /* parent */ NULL, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 0, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, @@ -323,7 +325,7 @@ ida_eisa_attach(device_t dev) return (ENOMEM); } - error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY, + error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY | INTR_MPSAFE, NULL, ida_intr, ida, &ida->ih); if (error) { device_printf(dev, "can't setup interrupt\n"); @@ -337,9 +339,6 @@ ida_eisa_attach(device_t dev) return (error); } - ida_attach(ida); - ida->flags |= IDA_ATTACHED; - return (0); } Modified: head/sys/dev/ida/ida_pci.c ============================================================================== --- head/sys/dev/ida/ida_pci.c Mon Aug 27 17:15:14 2012 (r239739) +++ head/sys/dev/ida/ida_pci.c Mon Aug 27 17:24:07 2012 (r239740) @@ -236,23 +236,14 @@ ida_pci_attach(device_t dev) struct ida_board *board = ida_pci_match(dev); u_int32_t id = pci_get_devid(dev); struct ida_softc *ida; - u_int command; int error, rid; - command = pci_read_config(dev, PCIR_COMMAND, 1); - - /* - * it appears that this board only does MEMIO access. - */ - if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(dev, "Only memory mapped I/O is supported\n"); - return (ENXIO); - } - ida = (struct ida_softc *)device_get_softc(dev); ida->dev = dev; ida->cmd = *board->accessor; ida->flags = board->flags; + mtx_init(&ida->lock, "ida", NULL, MTX_DEF); + callout_init_mtx(&ida->ch, &ida->lock, 0); ida->regs_res_type = SYS_RES_MEMORY; ida->regs_res_id = IDA_PCI_MEMADDR; @@ -295,7 +286,7 @@ ida_pci_attach(device_t dev) ida_free(ida); return (ENOMEM); } - error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY, + error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY | INTR_MPSAFE, NULL, ida_intr, ida, &ida->ih); if (error) { device_printf(dev, "can't setup interrupt\n"); @@ -308,8 +299,6 @@ ida_pci_attach(device_t dev) ida_free(ida); return (error); } - ida_attach(ida); - ida->flags |= IDA_ATTACHED; return (0); } Modified: head/sys/dev/ida/idavar.h ============================================================================== --- head/sys/dev/ida/idavar.h Mon Aug 27 17:15:14 2012 (r239739) +++ head/sys/dev/ida/idavar.h Mon Aug 27 17:24:07 2012 (r239740) @@ -34,18 +34,18 @@ #define _IDAVAR_H #define ida_inb(ida, port) \ - bus_space_read_1((ida)->tag, (ida)->bsh, port) + bus_read_1((ida)->regs, port) #define ida_inw(ida, port) \ - bus_space_read_2((ida)->tag, (ida)->bsh, port) + bus_read_2((ida)->regs, port) #define ida_inl(ida, port) \ - bus_space_read_4((ida)->tag, (ida)->bsh, port) + bus_read_4((ida)->regs, port) #define ida_outb(ida, port, val) \ - bus_space_write_1((ida)->tag, (ida)->bsh, port, val) + bus_write_1((ida)->regs, port, val) #define ida_outw(ida, port, val) \ - bus_space_write_2((ida)->tag, (ida)->bsh, port, val) + bus_write_2((ida)->regs, port, val) #define ida_outl(ida, port, val) \ - bus_space_write_4((ida)->tag, (ida)->bsh, port, val) + bus_write_4((ida)->regs, port, val) struct ida_hdr { u_int8_t drive; /* logical drive */ @@ -83,6 +83,7 @@ struct ida_hardware_qcb { typedef enum { QCB_FREE = 0x0000, QCB_ACTIVE = 0x0001, /* waiting for completion */ + QCB_TIMEDOUT = 0x0002, } qcb_state; #define DMA_DATA_IN 0x0001 @@ -93,8 +94,11 @@ typedef enum { #define IDA_QCB_MAX 256 #define IDA_CONTROLLER 0 /* drive "number" for controller */ +struct ida_softc; + struct ida_qcb { struct ida_hardware_qcb *hwqcb; + struct ida_softc *ida; qcb_state state; short flags; union { @@ -104,10 +108,9 @@ struct ida_qcb { bus_dmamap_t dmamap; bus_addr_t hwqcb_busaddr; struct bio *buf; /* bio associated with qcb */ + int error; }; -struct ida_softc; - struct ida_access { int (*fifo_full)(struct ida_softc *); void (*submit)(struct ida_softc *, struct ida_qcb *); @@ -122,10 +125,10 @@ struct ida_access { #define IDA_ATTACHED 0x01 /* attached */ #define IDA_FIRMWARE 0x02 /* firmware must be started */ #define IDA_INTERRUPTS 0x04 /* interrupts enabled */ +#define IDA_QFROZEN 0x08 /* request queue frozen */ struct ida_softc { device_t dev; - int unit; struct callout ch; struct cdev *ida_dev_t; @@ -138,8 +141,8 @@ struct ida_softc { struct resource *irq; void *ih; - bus_space_tag_t tag; - bus_space_handle_t bsh; + struct mtx lock; + struct intr_config_hook ich; /* various DMA tags */ bus_dma_tag_t parent_dmat; @@ -151,8 +154,6 @@ struct ida_softc { bus_dma_tag_t sg_dmat; - int num_drives; - int num_qcbs; int flags; int qactive; @@ -197,7 +198,6 @@ extern struct ida_softc *ida_alloc(devic int regs_type, int regs_id, bus_dma_tag_t parent_dmat); extern void ida_free(struct ida_softc *ida); extern int ida_init(struct ida_softc *ida); -extern void ida_attach(struct ida_softc *ida); extern int ida_command(struct ida_softc *ida, int command, void *data, int datasize, int drive, u_int32_t pblkno, int flags); extern void ida_submit_buf(struct ida_softc *ida, struct bio *bp); From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 19:08:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 424D410656DF; Mon, 27 Aug 2012 19:08:48 +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 2DC738FC1C; Mon, 27 Aug 2012 19:08:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RJ8mui043044; Mon, 27 Aug 2012 19:08:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RJ8l79043041; Mon, 27 Aug 2012 19:08:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201208271908.q7RJ8l79043041@svn.freebsd.org> From: Xin LI Date: Mon, 27 Aug 2012 19:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239744 - head/usr.sbin/mountd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 19:08:48 -0000 Author: delphij Date: Mon Aug 27 19:08:47 2012 New Revision: 239744 URL: http://svn.freebsd.org/changeset/base/239744 Log: Show error messages if nmount() failed. MFC after: 1 month Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Mon Aug 27 18:14:22 2012 (r239743) +++ head/usr.sbin/mountd/mountd.c Mon Aug 27 19:08:47 2012 (r239744) @@ -2461,11 +2461,11 @@ do_mount(struct exportlist *ep, struct g } if (errno == EPERM) { if (debug) - warnx("can't change attributes for %s", - dirp); + warnx("can't change attributes for %s: %s", + dirp, errmsg); syslog(LOG_ERR, - "can't change attributes for %s", - dirp); + "can't change attributes for %s: %s", + dirp, errmsg); ret = 1; goto error_exit; } From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 19:30:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F27AE1065670; Mon, 27 Aug 2012 19:30:21 +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 DECD68FC1F; Mon, 27 Aug 2012 19:30: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 q7RJULwc045608; Mon, 27 Aug 2012 19:30:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RJUL2Z045605; Mon, 27 Aug 2012 19:30:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208271930.q7RJUL2Z045605@svn.freebsd.org> From: Dimitry Andric Date: Mon, 27 Aug 2012 19:30: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: r239747 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 19:30:22 -0000 Author: dim Date: Mon Aug 27 19:30:21 2012 New Revision: 239747 URL: http://svn.freebsd.org/changeset/base/239747 Log: Add a few other files that are obsolete if WITH_CLANG_EXTRAS is enabled, and clang is updated to 3.2. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Aug 27 19:25:20 2012 (r239746) +++ head/ObsoleteFiles.inc Mon Aug 27 19:30:21 2012 (r239747) @@ -39,6 +39,8 @@ # done # 20120816: new clang import which bumps version from 3.1 to 3.2 +OLD_FILES+=usr/bin/llvm-ld +OLD_FILES+=usr/bin/llvm-stub OLD_FILES+=usr/include/clang/3.1/altivec.h OLD_FILES+=usr/include/clang/3.1/avx2intrin.h OLD_FILES+=usr/include/clang/3.1/avxintrin.h @@ -63,6 +65,7 @@ OLD_FILES+=usr/include/clang/3.1/wmmintr OLD_FILES+=usr/include/clang/3.1/x86intrin.h OLD_FILES+=usr/include/clang/3.1/xmmintrin.h OLD_DIRS+=usr/include/clang/3.1 +OLD_FILES+=usr/share/man/man1/llvm-ld.1.gz # 20120712: OpenSSL 1.0.1c import OLD_LIBS+=lib/libcrypto.so.6 OLD_LIBS+=usr/lib/libssl.so.6 From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 19:52:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5ED89106566B; Mon, 27 Aug 2012 19:52:56 +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 49B368FC08; Mon, 27 Aug 2012 19:52:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RJqurX048294; Mon, 27 Aug 2012 19:52:56 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RJqu3R048292; Mon, 27 Aug 2012 19:52:56 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208271952.q7RJqu3R048292@svn.freebsd.org> From: Martin Matuska Date: Mon, 27 Aug 2012 19:52:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239749 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 19:52:56 -0000 Author: mm Date: Mon Aug 27 19:52:55 2012 New Revision: 239749 URL: http://svn.freebsd.org/changeset/base/239749 Log: Add missing parts to zpool-features.5 manual page Obtained from: vendor/illumos/dist MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Mon Aug 27 19:37:02 2012 (r239748) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Mon Aug 27 19:52:55 2012 (r239749) @@ -21,7 +21,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 28, 2012 +.Dd Aug 27, 2012 .Dt ZPOOL-FEATURES 8 .Os .Sh NAME @@ -32,8 +32,10 @@ ZFS pool on\-disk format versions are sp the old on\-disk format numbers (the last supported on\-disk format number is 28). To enable a feature on a pool use the +.Cm upgrade +subcommand of the .Xr zpool 8 -command to set the +command, or set the .Sy feature@feature_name property to .Ar enabled . @@ -154,6 +156,12 @@ The amount of space remaining to be recl available through the .Sy freeing property. +.Pp +This feature is only +.Sy active +while +.Sy freeing +is non\-zero. .Sh SEE ALSO .Xr zpool 8 .Sh AUTHORS From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 20:03:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B16E0106566C; Mon, 27 Aug 2012 20:03:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CDB78FC1D; Mon, 27 Aug 2012 20:03: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 q7RK38MV049624; Mon, 27 Aug 2012 20:03:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RK38qZ049622; Mon, 27 Aug 2012 20:03:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272003.q7RK38qZ049622@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 20:03: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: r239752 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 20:03:08 -0000 Author: adrian Date: Mon Aug 27 20:03:08 2012 New Revision: 239752 URL: http://svn.freebsd.org/changeset/base/239752 Log: Fix the debugging output to correctly log CCK errors. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Mon Aug 27 19:55:31 2012 (r239751) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Mon Aug 27 20:03:08 2012 (r239752) @@ -988,7 +988,7 @@ ar5416AniPoll(struct ath_hal *ah, const params->cckTrigHigh / 1000) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: CCK err %u listenTime %u\n", __func__, - aniState->ofdmPhyErrCount, aniState->listenTime); + aniState->cckPhyErrCount, aniState->listenTime); ar5416AniCckErrTrigger(ah); ar5416AniRestart(ah, aniState); } From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 20:10:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D92961065677; Mon, 27 Aug 2012 20:10:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA3848FC08; Mon, 27 Aug 2012 20:10: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 q7RKAcos050553; Mon, 27 Aug 2012 20:10:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RKAcRs050551; Mon, 27 Aug 2012 20:10:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272010.q7RKAcRs050551@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 20:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239753 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 20:10:39 -0000 Author: adrian Date: Mon Aug 27 20:10:38 2012 New Revision: 239753 URL: http://svn.freebsd.org/changeset/base/239753 Log: Ensure that all firstep values are available in ANI. The comparison assumes maxFirstepLevel is a count, rather than a maximum value. The array is 3 entries in size however 'maxFirstepLevel' is 2. This bug also exists in the AR5212 HAL. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Mon Aug 27 20:03:08 2012 (r239752) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Mon Aug 27 20:10:38 2012 (r239753) @@ -422,7 +422,7 @@ ar5416AniOfdmErrTrigger(struct ath_hal * * If weak sig detect is already off, as last resort, * raise firstep level */ - if (aniState->firstepLevel+1 < params->maxFirstepLevel) { + if (aniState->firstepLevel < params->maxFirstepLevel) { if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, aniState->firstepLevel + 1)) return; @@ -436,7 +436,7 @@ ar5416AniOfdmErrTrigger(struct ath_hal * ar5416AniControl(ah, HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION, AH_TRUE); - if (aniState->firstepLevel+1 < params->maxFirstepLevel) + if (aniState->firstepLevel < params->maxFirstepLevel) if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, aniState->firstepLevel + 1)) return; @@ -490,7 +490,7 @@ ar5416AniCckErrTrigger(struct ath_hal *a * Beacon signal in mid and high range, * raise firstep level. */ - if (aniState->firstepLevel+1 < params->maxFirstepLevel) + if (aniState->firstepLevel < params->maxFirstepLevel) ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, aniState->firstepLevel + 1); } else { @@ -954,6 +954,8 @@ ar5416AniPoll(struct ath_hal *ah, const if (listenTime < 0) { ahp->ah_stats.ast_ani_lneg++; /* restart ANI period if listenTime is invalid */ + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: invalid listenTime\n", + __func__); ar5416AniRestart(ah, aniState); } /* XXX beware of overflow? */ @@ -973,6 +975,8 @@ ar5416AniPoll(struct ath_hal *ah, const aniState->cckPhyErrCount <= aniState->listenTime * params->cckTrigLow/1000) ar5416AniLowerImmunity(ah); + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: lower immunity\n", + __func__); ar5416AniRestart(ah, aniState); } else if (aniState->listenTime > params->period) { updateMIBStats(ah, aniState); From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 20:30:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C63241065670; Mon, 27 Aug 2012 20:30:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B150B8FC0A; Mon, 27 Aug 2012 20:30: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 q7RKU7bE052886; Mon, 27 Aug 2012 20:30:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RKU7ak052883; Mon, 27 Aug 2012 20:30:07 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272030.q7RKU7ak052883@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 20:30: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: r239756 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 20:30:07 -0000 Author: adrian Date: Mon Aug 27 20:30:07 2012 New Revision: 239756 URL: http://svn.freebsd.org/changeset/base/239756 Log: Improve the sample rate logging. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Mon Aug 27 20:25:26 2012 (r239755) +++ head/sys/dev/ath/ath_rate/sample/sample.c Mon Aug 27 20:30:07 2012 (r239756) @@ -929,7 +929,7 @@ ath_rate_tx_complete(struct ath_softc *s * Only one rate was used; optimize work. */ IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, - &an->an_node, "%s: size %d (%d bytes) %s rate/try %d %s/%d/%d nframes/nbad [%d/%d]", + &an->an_node, "%s: size %d (%d bytes) %s rate/short/long %d %s/%d/%d nframes/nbad [%d/%d]", __func__, bin_to_size(size_to_bin(frame_size)), frame_size, @@ -961,11 +961,12 @@ ath_rate_tx_complete(struct ath_softc *s IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, -"%s: size %d (%d bytes) finaltsidx %d tries %d %s rate/try [%d %s/%d %d %s/%d %d %s/%d %d %s/%d] nframes/nbad [%d/%d]", +"%s: size %d (%d bytes) finaltsidx %d short %d long %d %s rate/try [%d %s/%d %d %s/%d %d %s/%d %d %s/%d] nframes/nbad [%d/%d]", __func__, bin_to_size(size_to_bin(frame_size)), frame_size, finalTSIdx, + short_tries, long_tries, status ? "FAIL" : "OK", dot11rate(rt, rc[0].rix), From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 21:49:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C8C8106564A; Mon, 27 Aug 2012 21:49:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECB118FC17; Mon, 27 Aug 2012 21:49: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 q7RLnbNZ062565; Mon, 27 Aug 2012 21:49:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RLnbdv062563; Mon, 27 Aug 2012 21:49:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272149.q7RLnbdv062563@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 21:49: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: r239757 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 21:49:38 -0000 Author: adrian Date: Mon Aug 27 21:49:37 2012 New Revision: 239757 URL: http://svn.freebsd.org/changeset/base/239757 Log: Convert to using ulzma. Modified: head/sys/mips/conf/AP96 Modified: head/sys/mips/conf/AP96 ============================================================================== --- head/sys/mips/conf/AP96 Mon Aug 27 20:30:07 2012 (r239756) +++ head/sys/mips/conf/AP96 Mon Aug 27 21:49:37 2012 (r239757) @@ -25,15 +25,13 @@ options AR71XX_ENV_UBOOT options MSDOSFS # uncompress - to boot read-only lzma natively from flash -device geom_uzip -options GEOM_UZIP +device geom_uncompress +options GEOM_UNCOMPRESS +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" # Used for the static uboot partition map device geom_map -# Boot off of the rootfs, as defined in the geom_map setup. -options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" - # Options needed for the EEPROM based calibration/PCI configuration data. options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash options ATH_EEPROM_FIRMWARE # Use EEPROM from flash From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 21:53:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9DCC21065673; Mon, 27 Aug 2012 21:53:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88C008FC15; Mon, 27 Aug 2012 21:53: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 q7RLr29Y063051; Mon, 27 Aug 2012 21:53:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RLr2Ua063049; Mon, 27 Aug 2012 21:53:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272153.q7RLr2Ua063049@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 21:53: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: r239758 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 21:53:02 -0000 Author: adrian Date: Mon Aug 27 21:53:01 2012 New Revision: 239758 URL: http://svn.freebsd.org/changeset/base/239758 Log: Slim down the default AR724X build. The AR724X boards tend to come with minimal RAM/flash. Modified: head/sys/mips/conf/AR724X_BASE Modified: head/sys/mips/conf/AR724X_BASE ============================================================================== --- head/sys/mips/conf/AR724X_BASE Mon Aug 27 21:49:37 2012 (r239757) +++ head/sys/mips/conf/AR724X_BASE Mon Aug 27 21:53:01 2012 (r239758) @@ -1,8 +1,9 @@ # # AR724X -- Kernel configuration file for FreeBSD/MIPS for Atheros 724x systems # -# This includes all the common drivers for the AR724x boards along with -# the usb, net80211 and atheros driver code. +# This includes all the common drivers for the AR724x boards. +# Since the AR724x boards tend to have minimal flash (sometimes 4MB!), +# the majority of the kernel framework will be built as modules. # # $FreeBSD$ # @@ -24,21 +25,19 @@ makeoptions DEBUG=-g #Build kernel with # Build these as modules so small platform builds will have the # modules already built. -makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci" +makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci hwpmc" options DDB options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking -options INET6 # IPv6 - -# options NFS_CL #Network Filesystem Client - +#options INET6 # IPv6 +#options NFS_CL #Network Filesystem Client options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -# options NFS_LEGACYRPC +#options NFS_LEGACYRPC # Debugging for use in -current options INVARIANTS options INVARIANT_SUPPORT @@ -47,6 +46,10 @@ options WITNESS_SKIPSPIN options DEBUG_REDZONE options DEBUG_MEMGUARD +# Don't include the SCSI/CAM strings in the default build +options SCSI_NO_SENSE_STRINGS +options SCSI_NO_OP_STRINGS + options FFS #Berkeley Fast Filesystem # options SOFTUPDATES #Enable FFS soft updates support # options UFS_ACL #Support for access control lists @@ -60,27 +63,27 @@ device ar724x_pci options IEEE80211_DEBUG options IEEE80211_ALQ options IEEE80211_SUPPORT_MESH -# This option is currently broken for if_ath_tx. +options IEEE80211_SUPPORT_SUPERG options IEEE80211_SUPPORT_TDMA options IEEE80211_AMPDU_AGE -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_xauth # 802.11 hostap support +#device wlan # 802.11 support +#device wlan_wep # 802.11 WEP support +#device wlan_ccmp # 802.11 CCMP support +#device wlan_tkip # 802.11 TKIP support +#device wlan_xauth # 802.11 hostap support # Atheros wireless NICs -device ath # Atheros interface support -device ath_pci # Atheros PCI/Cardbus bus +#device ath # Atheros interface support +#device ath_pci # Atheros PCI/Cardbus bus options ATH_DEBUG options ATH_DIAGAPI options ATH_ENABLE_11N options AH_DEBUG options AH_DEBUG_ALQ options ALQ -device ath_hal +#device ath_hal option AH_SUPPORT_AR5416 -device ath_rate_sample +#device ath_rate_sample option AH_RXCFG_SDMAMW_4BYTES option AH_AR5416_INTERRUPT_MITIGATION # There's no DFS radar detection support yet so this won't actually @@ -90,15 +93,16 @@ option ATH_ENABLE_DFS device mii device arge +options ARGE_DEBUG # Enable if_arge debugging for now -device usb +#device usb options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order options USB_DEBUG options USB_HOST_ALIGN=32 # AR724X (MIPS in general?) requires this -device ehci +#device ehci device scbus -device umass +#device umass device da # On-board SPI flash @@ -114,12 +118,10 @@ device ether device md device bpf device random -device if_bridge -device gif # ip[46] in ip[46] tunneling protocol -device gre # generic encapsulation - only for IPv4 in IPv4 though atm - -options ARGE_DEBUG # Enable if_arge debugging for now +#device if_bridge +#device gif # ip[46] in ip[46] tunneling protocol +#device gre # generic encapsulation - only for IPv4 in IPv4 though atm # Enable GPIO -device gpio -device gpioled +#device gpio +#device gpioled From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 21:59:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93402106566C; Mon, 27 Aug 2012 21:59:53 +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 7DF3E8FC26; Mon, 27 Aug 2012 21:59: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 q7RLxr3E064028; Mon, 27 Aug 2012 21:59:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RLxr4B064025; Mon, 27 Aug 2012 21:59:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272159.q7RLxr4B064025@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 21:59: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: r239759 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 21:59:53 -0000 Author: adrian Date: Mon Aug 27 21:59:52 2012 New Revision: 239759 URL: http://svn.freebsd.org/changeset/base/239759 Log: Convert AP93 to use the new AR724X_BASE configuration file. Modified: head/sys/mips/conf/AP93 head/sys/mips/conf/AP93.hints Modified: head/sys/mips/conf/AP93 ============================================================================== --- head/sys/mips/conf/AP93 Mon Aug 27 21:53:01 2012 (r239758) +++ head/sys/mips/conf/AP93 Mon Aug 27 21:59:52 2012 (r239759) @@ -1,136 +1,44 @@ # -# AP93 -- Kernel configuration file for FreeBSD/mips for Atheros AP93 reference -# board (AR7240) +# Specific board setup for the Atheros AP91 reference board. # -# $FreeBSD$ +# The AP93 has the following hardware: # +# + AR7240 CPU SoC +# + AR9280 Wifi +# + Integrated switch (XXX speed?) +# + 16MB flash +# + 64MB RAM +# + uboot environment -ident AP93 +# $FreeBSD$ -# XXX The default load address in the Uboot environment is 0x80010000 -makeoptions KERNLOADADDR=0x80050000 -options HZ=1000 +include "AR724X_BASE" +ident "AP93" +hints "AP93.hints" -# The AP93 has 64mb of RAM; hard-code that options AR71XX_REALMEM=64*1024*1024 -# It's UBOOT, not Redboot - without this, things will hang at startup options AR71XX_ENV_UBOOT -makeoptions MODULES_OVERRIDE="ath ath_pci ath_ahb bridgestp if_bridge if_gif if_gre random wlan wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt wlan_tkip wlan_wep wlan_xauth usb ar71xx" - -hints "AP93.hints" -include "../atheros/std.ar71xx" - -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions MODULES_OVERRIDE="" +# For DOS - enable if required +options MSDOSFS -options DDB -options KDB - -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -# Can't do IPv6 - it just doesn't fit. -# options INET6 -# options NFSCL #Network Filesystem Client -options PSEUDOFS #Pseudo-filesystem framework -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -options ALQ - -# Debugging for use in -current -options DEADLKRES -options INVARIANTS -options INVARIANT_SUPPORT -options WITNESS -options WITNESS_SKIPSPIN -options FFS #Berkeley Fast Filesystem - -# Support uncompress lzma rootfs +# uncompress - to boot read-only lzma natively from flash device geom_uncompress options GEOM_UNCOMPRESS options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" -# PCI bus -device pci -device ar724x_pci -# Enable the AR71xx EEPROM PCI(e) workaround -options AR71XX_ATH_EEPROM - -# NVRAM U-Boot Environment -> Kernel environment -device nvram2env - -# Wireless NIC cards -options IEEE80211_DEBUG -options IEEE80211_SUPPORT_MESH -options IEEE80211_SUPPORT_TDMA -options IEEE80211_ALQ - -device wlan # 802.11 support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_xauth # 802.11 hostap support - -device ath # Atheros pci/cardbus NIC's -device ath_pci # PCI/PCIe bus glue -options ATH_DEBUG -options ATH_ENABLE_11N -options ATH_DIAGAPI -device firmware -options ATH_EEPROM_FIRMWARE - -device ath_hal -options AH_SUPPORT_AR5416 -options AH_DEBUG -options AH_DEBUG_ALQ - -device ath_rate_sample - -device mii -device arge -device miiproxy -options ARGE_DEBUG -options ARGE_MDIO -device etherswitch -device arswitch +# Used for the static uboot partition map +device geom_map -# USB devices - (todo: does AR7240 have OHCI, or just EHCI?) +# Options needed for the EEPROM based calibration/PCI configuration data. +options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash +options ATH_EEPROM_FIRMWARE # Use EEPROM from flash +device firmware # Used by the above + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous -#device usb -options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order -options USB_DEBUG -options USB_HOST_ALIGN=32 -#device ehci - -# Mass storage -#device scbus -#device umass -#device da - -# Read MSDOS formatted disks -#options MSDOSFS - -# GPIO Bus -#device gpio -#device gpioled - -# SPI and flash -device spibus -device ar71xx_spi -device mx25l - -# The flash is statically partitioned; add in that -device geom_map - -device ar71xx_wdog - -# Serial -device uart - -# Network twiddling -device loop -device ether -device md -device bpf -device random -device if_bridge +device etherswitch +device arswitch Modified: head/sys/mips/conf/AP93.hints ============================================================================== --- head/sys/mips/conf/AP93.hints Mon Aug 27 21:53:01 2012 (r239758) +++ head/sys/mips/conf/AP93.hints Mon Aug 27 21:59:52 2012 (r239759) @@ -1,15 +1,5 @@ # $FreeBSD$ -hint.apb.0.at="nexus0" -hint.apb.0.irq=4 - -# uart0 -hint.uart.0.at="apb0" -# see atheros/uart_cpu_ar71xx.c why +3 -hint.uart.0.maddr=0x18020003 -hint.uart.0.msize=0x18 -hint.uart.0.irq=3 - # arge0 MDIO bus hint.argemdio.0.at="nexus0" hint.argemdio.0.maddr=0x19000000 @@ -21,21 +11,12 @@ hint.argemdio.0.order=0 # arge0: MII; dedicated PHY 4 on switch, connected via internal switch # MDIO bus. -hint.arge.0.at="nexus0" -hint.arge.0.maddr=0x19000000 -hint.arge.0.msize=0x1000 -hint.arge.0.irq=2 # hint.arge.0.eeprommac=0x83fe9ff0 hint.arge.0.phymask=0x10 # PHY 4 # hint.arge.0.miimode=2 # MII hint.arge.0.mdio=mdioproxy1 # Hanging off the arswitch MDIO bus # arge1: connected to the LAN switch MAC, at 1000BaseTX / GMII. -hint.arge.1.at="nexus0" -hint.arge.1.maddr=0x1A000000 -hint.arge.1.msize=0x1000 -hint.arge.1.irq=3 - hint.arge.1.phymask=0x0 # hint.arge.1.miimode=1 # GMII hint.arge.1.media=1000 # Force to 1000BaseTX/full @@ -54,25 +35,6 @@ hint.arswitch.0.is_gmii=0 # No, not GMII hint.pcib.0.bus.0.0.0.ath_fixup_addr=0x1fff1000 hint.pcib.0.bus.0.0.0.ath_fixup_size=4096 -# ehci - note the 0x100 offset for the AR913x/AR724x -hint.ehci.0.at="nexus0" -hint.ehci.0.maddr=0x1b000100 -hint.ehci.0.msize=0x00ffff00 -hint.ehci.0.irq=1 - -# pci -hint.pcib.0.at="nexus0" -hint.pcib.0.irq=0 - -# ath -hint.ath.0.eeprom_firmware="pcib.0.bus.0.0.0.eeprom_firmware" - -# GPIO -hint.gpio.0.at="apb0" -hint.gpio.0.maddr=0x18040000 -hint.gpio.0.msize=0x1000 -hint.gpio.0.irq=2 - # Signal leds hint.gpioled.0.at="gpiobus0" hint.gpioled.0.name="sig1" @@ -87,18 +49,6 @@ hint.gpioled.3.at="gpiobus0" hint.gpioled.3.name="sig4" hint.gpioled.3.pins=0x0080 # pin 7 -# SPI controller/bus -hint.spi.0.at="nexus0" -hint.spi.0.maddr=0x1f000000 -hint.spi.0.msize=0x10 - -# SPI flash -hint.mx25l.0.at="spibus0" -hint.mx25l.0.cs=0 - -# Watchdog -hint.ar71xx_wdog.0.at="nexus0" - # nvram mapping - XXX ? hint.nvram.0.base=0x1f030000 hint.nvram.0.maxsize=0x2000 From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 23:18:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 428C3106566B; Mon, 27 Aug 2012 23:18:42 +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 2D0C38FC16; Mon, 27 Aug 2012 23:18: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 q7RNIgce073174; Mon, 27 Aug 2012 23:18:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RNIfcO073172; Mon, 27 Aug 2012 23:18:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272318.q7RNIfcO073172@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 23: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: r239760 - head/sys/dev/wtap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 23:18:42 -0000 Author: adrian Date: Mon Aug 27 23:18:41 2012 New Revision: 239760 URL: http://svn.freebsd.org/changeset/base/239760 Log: Don't grab an unreferenced pointer to the VAP bss node. Modified: head/sys/dev/wtap/if_wtap.c Modified: head/sys/dev/wtap/if_wtap.c ============================================================================== --- head/sys/dev/wtap/if_wtap.c Mon Aug 27 21:59:52 2012 (r239759) +++ head/sys/dev/wtap/if_wtap.c Mon Aug 27 23:18:41 2012 (r239760) @@ -268,7 +268,7 @@ wtap_newstate(struct ieee80211vap *vap, DWTAP_PRINTF("%s\n", __func__); - ni = vap->iv_bss; + ni = ieee80211_ref_node(vap->iv_bss); /* * Invoke the parent method to do net80211 work. */ @@ -278,7 +278,8 @@ wtap_newstate(struct ieee80211vap *vap, if (nstate == IEEE80211_S_RUN) { /* NB: collect bss node again, it may have changed */ - ni = vap->iv_bss; + ieee80211_free_node(ni); + ni = ieee80211_ref_node(vap->iv_bss); switch (vap->iv_opmode) { case IEEE80211_M_MBSS: error = wtap_beacon_alloc(sc, ni); @@ -294,9 +295,11 @@ wtap_newstate(struct ieee80211vap *vap, } else if (nstate == IEEE80211_S_INIT) { callout_stop(&avp->av_swba); } + ieee80211_free_node(ni); return 0; bad: printf("%s: bad\n", __func__); + ieee80211_free_node(ni); return error; } @@ -319,6 +322,7 @@ wtap_vap_create(struct ieee80211com *ic, struct ieee80211vap *vap; struct wtap_vap *avp; int error; + struct ieee80211_node *ni; DWTAP_PRINTF("%s\n", __func__); @@ -347,7 +351,9 @@ wtap_vap_create(struct ieee80211com *ic, (const char *)ic->ic_ifp->if_xname); /* TODO this is a hack to force it to choose the rate we want */ - vap->iv_bss->ni_txrate = 130; + ni = ieee80211_ref_node(vap->iv_bss); + ni->ni_txrate = 130; + ieee80211_free_node(ni); return vap; } From owner-svn-src-head@FreeBSD.ORG Mon Aug 27 23:27:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E4E5B106566C; Mon, 27 Aug 2012 23:27:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D06408FC1B; Mon, 27 Aug 2012 23:27: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 q7RNRfWk074357; Mon, 27 Aug 2012 23:27:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7RNRf01074355; Mon, 27 Aug 2012 23:27:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208272327.q7RNRf01074355@svn.freebsd.org> From: Adrian Chadd Date: Mon, 27 Aug 2012 23:27: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: r239761 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 23:27:42 -0000 Author: adrian Date: Mon Aug 27 23:27:41 2012 New Revision: 239761 URL: http://svn.freebsd.org/changeset/base/239761 Log: Only print the descriptor contents! Found by: magical CLANG build environments Submitted by: Sevan Modified: head/sys/dev/ath/if_ath_debug.c Modified: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- head/sys/dev/ath/if_ath_debug.c Mon Aug 27 23:18:41 2012 (r239760) +++ head/sys/dev/ath/if_ath_debug.c Mon Aug 27 23:27:41 2012 (r239761) @@ -178,10 +178,10 @@ ath_printtxbuf_edma(struct ath_softc *sc eds->ds_hw[8], eds->ds_hw[9], eds->ds_hw[10], eds->ds_hw[11], eds->ds_hw[12], eds->ds_hw[13]); - printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", + printf(" %08x %08x %08x %08x %08x %08x %08x\n", eds->ds_hw[14], eds->ds_hw[15], eds->ds_hw[16], eds->ds_hw[17], eds->ds_hw[18], eds->ds_hw[19], - eds->ds_hw[20], eds->ds_hw[21]); + eds->ds_hw[20]); #if 0 printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", ds->ds_hw[22],ds->ds_hw[23],ds->ds_hw[24], From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 01:28:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 539771065676; Tue, 28 Aug 2012 01:28:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A4E48FC0C; Tue, 28 Aug 2012 01:28: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 q7S1Sr9x088040; Tue, 28 Aug 2012 01:28:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S1SriX088038; Tue, 28 Aug 2012 01:28:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208280128.q7S1SriX088038@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Aug 2012 01:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239762 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 01:28:53 -0000 Author: imp Date: Tue Aug 28 01:28:52 2012 New Revision: 239762 URL: http://svn.freebsd.org/changeset/base/239762 Log: Bring in the multi-block patches for mci. These required extensive restructuring of the driver. I've tried to preserve the other silicon workarounds that we've added over the years, but haven't had a chance to extensively test on other hardware. On my AT91RM9200 with 30MHz/1 wire/64 block transfers, I've been able to go from ~.66MB/s to 2.25MB/s in the simple tests I performed, almost a 3.5x improvement. This cuts the boot time almost in half when everything else goes right (timed from rtc message to login: prompt). PR: 155214 Submitted by: Ian Lapore Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Mon Aug 27 23:27:41 2012 (r239761) +++ head/sys/arm/at91/at91_mci.c Tue Aug 28 01:28:52 2012 (r239762) @@ -114,7 +114,24 @@ __FBSDID("$FreeBSD$"); #define AT91_MCI_USE_30MHZ 1 #endif -#define BBSZ 512 +/* + * Allocate 2 bounce buffers we'll use to endian-swap the data due to the rm9200 + * erratum. We use a pair of buffers because when reading that lets us begin + * endian-swapping the data in the first buffer while the DMA is reading into + * the second buffer. (We can't use the same trick for writing because we might + * not get all the data in the 2nd buffer swapped before the hardware needs it; + * dealing with that would add complexity to the driver.) + * + * The buffers are sized at 16K each due to the way the busdma cache sync + * operations work on arm. A dcache_inv_range() operation on a range larger + * than 16K gets turned into a dcache_wbinv_all(). That needlessly flushes the + * entire data cache, impacting overall system performance. + */ +#define BBCOUNT 2 +#define BBSIZE (16*1024) +#define MAX_BLOCKS ((BBSIZE*BBCOUNT)/512) + +static int mci_debug; struct at91_mci_softc { void *intrhand; /* Interrupt handle */ @@ -123,21 +140,25 @@ struct at91_mci_softc { #define CAP_HAS_4WIRE 1 /* Has 4 wire bus */ #define CAP_NEEDS_BYTESWAP 2 /* broken hardware needing bounce */ int flags; -#define CMD_STARTED 1 -#define STOP_STARTED 2 +#define PENDING_CMD 0x01 +#define PENDING_STOP 0x02 +#define CMD_MULTIREAD 0x10 +#define CMD_MULTIWRITE 0x20 int has_4wire; int use_30mhz; struct resource *irq_res; /* IRQ resource */ struct resource *mem_res; /* Memory resource */ struct mtx sc_mtx; bus_dma_tag_t dmatag; - bus_dmamap_t map; - int mapped; struct mmc_host host; int bus_busy; struct mmc_request *req; struct mmc_command *curcmd; - char bounce_buffer[BBSZ]; + bus_dmamap_t bbuf_map[BBCOUNT]; + char * bbuf_vaddr[BBCOUNT]; /* bounce bufs in KVA space */ + uint32_t bbuf_len[BBCOUNT]; /* len currently queued for bounce buf */ + uint32_t bbuf_curidx; /* which bbuf is the active DMA buffer */ + uint32_t xfer_offset; /* offset so far into caller's buf */ }; static inline uint32_t @@ -172,6 +193,51 @@ static int at91_mci_is_mci1rev2xx(void); #define AT91_MCI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); #define AT91_MCI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +static void +at91_bswap_buf(struct at91_mci_softc *sc, void * dptr, void * sptr, uint32_t memsize) +{ + uint32_t * dst = (uint32_t *)dptr; + uint32_t * src = (uint32_t *)sptr; + uint32_t i; + + /* + * If the hardware doesn't need byte-swapping, let bcopy() do the + * work. Use bounce buffer even if we don't need byteswap, since + * buffer may straddle a page boundry, and we don't handle + * multi-segment transfers in hardware. Seen from 'bsdlabel -w' which + * uses raw geom access to the volume. Greg Ansley (gja (at) + * ansley.com) + */ + if (!(sc->sc_cap & CAP_NEEDS_BYTESWAP)) { + bcopy(dptr, sptr, memsize); + return; + } + + /* + * Nice performance boost for slightly unrolling this loop. + * (But very little extra boost for further unrolling it.) + */ + for (i = 0; i < memsize; i += 16) { + *dst++ = bswap32(*src++); + *dst++ = bswap32(*src++); + *dst++ = bswap32(*src++); + *dst++ = bswap32(*src++); + } + + /* Mop up the last 1-3 words, if any. */ + for (i = 0; i < (memsize & 0x0F); i += 4) { + *dst++ = bswap32(*src++); + } +} + +static void +at91_mci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + if (error != 0) + return; + *(bus_addr_t *)arg = segs[0].ds_addr; +} + static void at91_mci_pdc_disable(struct at91_mci_softc *sc) { @@ -186,13 +252,57 @@ at91_mci_pdc_disable(struct at91_mci_sof WR4(sc, PDC_TNCR, 0); } +/* + * Reset the controller, then restore most of the current state. + * + * This is called after detecting an error. It's also called after stopping a + * multi-block write, to un-wedge the device so that it will handle the NOTBUSY + * signal correctly. See comments in at91_mci_stop_done() for more details. + */ +static void at91_mci_reset(struct at91_mci_softc *sc) +{ + uint32_t mr; + uint32_t sdcr; + uint32_t dtor; + uint32_t imr; + + at91_mci_pdc_disable(sc); + + /* save current state */ + + imr = RD4(sc, MCI_IMR); + mr = RD4(sc, MCI_MR) & 0x7fff; + sdcr = RD4(sc, MCI_SDCR); + dtor = RD4(sc, MCI_DTOR); + + /* reset the controller */ + + WR4(sc, MCI_IDR, 0xffffffff); + WR4(sc, MCI_CR, MCI_CR_MCIDIS | MCI_CR_SWRST); + + /* restore state */ + + WR4(sc, MCI_CR, MCI_CR_MCIEN|MCI_CR_PWSEN); + WR4(sc, MCI_MR, mr); + WR4(sc, MCI_SDCR, sdcr); + WR4(sc, MCI_DTOR, dtor); + WR4(sc, MCI_IER, imr); + + /* + * Make sure sdio interrupts will fire. Not sure why reading + * SR ensures that, but this is in the linux driver. + */ + + RD4(sc, MCI_SR); +} + static void at91_mci_init(device_t dev) { struct at91_mci_softc *sc = device_get_softc(dev); uint32_t val; - WR4(sc, MCI_CR, MCI_CR_MCIEN); /* Enable controller */ + WR4(sc, MCI_CR, MCI_CR_MCIDIS | MCI_CR_SWRST); /* device into reset */ WR4(sc, MCI_IDR, 0xffffffff); /* Turn off interrupts */ WR4(sc, MCI_DTOR, MCI_DTOR_DTOMUL_1M | 1); val = MCI_MR_PDCMODE; @@ -203,10 +313,19 @@ at91_mci_init(device_t dev) #ifndef AT91_MCI_SLOT_B WR4(sc, MCI_SDCR, 0); /* SLOT A, 1 bit bus */ #else - /* XXX Really should add second "unit" but nobody using using - * a two slot card that we know of. -- except they are... XXX */ + /* + * XXX Really should add second "unit" but nobody using using + * a two slot card that we know of. XXX + */ WR4(sc, MCI_SDCR, 1); /* SLOT B, 1 bit bus */ #endif + /* + * Enable controller, including power-save. The slower clock + * of the power-save mode is only in effect when there is no + * transfer in progress, so it can be left in this mode all + * the time. + */ + WR4(sc, MCI_CR, MCI_CR_MCIEN|MCI_CR_PWSEN); } static void @@ -216,7 +335,7 @@ at91_mci_fini(device_t dev) WR4(sc, MCI_IDR, 0xffffffff); /* Turn off interrupts */ at91_mci_pdc_disable(sc); - WR4(sc, MCI_CR, MCI_CR_MCIDIS | MCI_CR_SWRST); /* Put the device into reset */ + WR4(sc, MCI_CR, MCI_CR_MCIDIS | MCI_CR_SWRST); /* device into reset */ } static int @@ -234,7 +353,7 @@ at91_mci_attach(device_t dev) struct sysctl_ctx_list *sctx; struct sysctl_oid *soid; device_t child; - int err; + int err, i; sctx = device_get_sysctl_ctx(dev); soid = device_get_sysctl_tree(dev); @@ -249,21 +368,33 @@ at91_mci_attach(device_t dev) AT91_MCI_LOCK_INIT(sc); + at91_mci_fini(dev); + at91_mci_init(dev); + /* - * Allocate DMA tags and maps + * Allocate DMA tags and maps and bounce buffers. + * + * The parms in the tag_create call cause the dmamem_alloc call to + * create each bounce buffer as a single contiguous buffer of BBSIZE + * bytes aligned to a 4096 byte boundary. + * + * Do not use DMA_COHERENT for these buffers because that maps the + * memory as non-cachable, which prevents cache line burst fills/writes, + * which is something we need since we're trying to overlap the + * byte-swapping with the DMA operations. */ - err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MAXPHYS, 1, - MAXPHYS, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->dmatag); + err = bus_dma_tag_create(bus_get_dma_tag(dev), 4096, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BBSIZE, 1, BBSIZE, 0, NULL, NULL, &sc->dmatag); if (err != 0) goto out; - err = bus_dmamap_create(sc->dmatag, 0, &sc->map); - if (err != 0) - goto out; - - at91_mci_fini(dev); - at91_mci_init(dev); + for (i = 0; i < BBCOUNT; ++i) { + err = bus_dmamem_alloc(sc->dmatag, (void **)&sc->bbuf_vaddr[i], + BUS_DMA_NOWAIT, &sc->bbuf_map[i]); + if (err != 0) + goto out; + } /* * Activate the interrupt @@ -330,8 +461,15 @@ out: static int at91_mci_detach(device_t dev) { + struct at91_mci_softc *sc = device_get_softc(dev); + at91_mci_fini(dev); at91_mci_deactivate(dev); + + bus_dmamem_free(sc->dmatag, sc->bbuf_vaddr[0], sc->bbuf_map[0]); + bus_dmamem_free(sc->dmatag, sc->bbuf_vaddr[1], sc->bbuf_map[1]); + bus_dma_tag_destroy(sc->dmatag); + return (EBUSY); /* XXX */ } @@ -398,14 +536,6 @@ at91_mci_is_mci1rev2xx(void) } } -static void -at91_mci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) -{ - if (error != 0) - return; - *(bus_addr_t *)arg = segs[0].ds_addr; -} - static int at91_mci_update_ios(device_t brdev, device_t reqdev) { @@ -437,7 +567,7 @@ at91_mci_update_ios(device_t brdev, devi if (sc->use_30mhz && ios->clock == 25000000 && at91_master_clock > 50000000) clkdiv = 0; - else if ((at91_master_clock % (ios->clock * 2)) == 0) + else if ((at91_master_clock % (ios->clock * 2)) == 0) clkdiv = ((at91_master_clock / ios->clock) / 2) - 1; else clkdiv = (at91_master_clock / ios->clock) / 2; @@ -456,73 +586,182 @@ at91_mci_update_ios(device_t brdev, devi static void at91_mci_start_cmd(struct at91_mci_softc *sc, struct mmc_command *cmd) { - size_t len; - uint32_t cmdr, ier = 0, mr; - uint32_t *src, *dst; - int i; + uint32_t cmdr, mr; struct mmc_data *data; - void *vaddr; - bus_addr_t paddr; sc->curcmd = cmd; data = cmd->data; - cmdr = cmd->opcode; /* XXX Upper layers don't always set this */ cmd->mrq = sc->req; + /* Begin setting up command register. */ + + cmdr = cmd->opcode; + + if (sc->host.ios.bus_mode == opendrain) + cmdr |= MCI_CMDR_OPDCMD; + + /* Set up response handling. Allow max timeout for responses. */ + if (MMC_RSP(cmd->flags) == MMC_RSP_NONE) cmdr |= MCI_CMDR_RSPTYP_NO; else { - /* Allow big timeout for responses */ cmdr |= MCI_CMDR_MAXLAT; if (cmd->flags & MMC_RSP_136) cmdr |= MCI_CMDR_RSPTYP_136; else cmdr |= MCI_CMDR_RSPTYP_48; } - if (cmd->opcode == MMC_STOP_TRANSMISSION) - cmdr |= MCI_CMDR_TRCMD_STOP; - if (sc->host.ios.bus_mode == opendrain) - cmdr |= MCI_CMDR_OPDCMD; - if (!data) { - // The no data case is fairly simple + + /* + * If there is no data transfer, just set up the right interrupt mask + * and start the command. + * + * The interrupt mask needs to be CMDRDY plus all non-data-transfer + * errors. It's important to leave the transfer-related errors out, to + * avoid spurious timeout or crc errors on a STOP command following a + * multiblock read. When a multiblock read is in progress, sending a + * STOP in the middle of a block occasionally triggers such errors, but + * we're totally disinterested in them because we've already gotten all + * the data we wanted without error before sending the STOP command. + */ + + if (data == NULL) { + uint32_t ier = MCI_SR_CMDRDY | + MCI_SR_RTOE | MCI_SR_RENDE | + MCI_SR_RCRCE | MCI_SR_RDIRE | MCI_SR_RINDE; + at91_mci_pdc_disable(sc); -// printf("CMDR %x ARGR %x\n", cmdr, cmd->arg); + + if (cmd->opcode == MMC_STOP_TRANSMISSION) + cmdr |= MCI_CMDR_TRCMD_STOP; + + /* Ignore response CRC on CMD2 and ACMD41, per standard. */ + + if (cmd->opcode == MMC_SEND_OP_COND || + cmd->opcode == ACMD_SD_SEND_OP_COND) + ier &= ~MCI_SR_RCRCE; + + if (mci_debug) + printf("CMDR %x (opcode %d) ARGR %x no data\n", + cmdr, cmd->opcode, cmd->arg); + WR4(sc, MCI_ARGR, cmd->arg); WR4(sc, MCI_CMDR, cmdr); - WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_CMDRDY); + WR4(sc, MCI_IDR, 0xffffffff); + WR4(sc, MCI_IER, ier); return; } + + /* There is data, set up the transfer-related parts of the command. */ + if (data->flags & MMC_DATA_READ) cmdr |= MCI_CMDR_TRDIR; + if (data->flags & (MMC_DATA_READ | MMC_DATA_WRITE)) cmdr |= MCI_CMDR_TRCMD_START; + if (data->flags & MMC_DATA_STREAM) cmdr |= MCI_CMDR_TRTYP_STREAM; - if (data->flags & MMC_DATA_MULTI) + else if (data->flags & MMC_DATA_MULTI) { cmdr |= MCI_CMDR_TRTYP_MULTIPLE; - // Set block size and turn on PDC mode for dma xfer and disable - // PDC until we're ready. - mr = RD4(sc, MCI_MR) & ~MCI_MR_BLKLEN; - WR4(sc, MCI_MR, mr | (data->len << 16) | MCI_MR_PDCMODE); - WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); - if (cmdr & MCI_CMDR_TRCMD_START) { - len = data->len; - if (cmdr & MCI_CMDR_TRDIR) - vaddr = cmd->data->data; - else { - /* Use bounce buffer even if we don't need - * byteswap, since buffer may straddle a page - * boundry, and we don't handle multi-segment - * transfers in hardware. - * (page issues seen from 'bsdlabel -w' which - * uses raw geom access to the volume). - * Greg Ansley (gja (at) ansley.com) - */ - vaddr = sc->bounce_buffer; - src = (uint32_t *)cmd->data->data; - dst = (uint32_t *)vaddr; + sc->flags |= (data->flags & MMC_DATA_READ) ? + CMD_MULTIREAD : CMD_MULTIWRITE; + } + + /* + * Disable PDC until we're ready. + * + * Set block size and turn on PDC mode for dma xfer. + * Note that the block size is the smaller of the amount of data to be + * transferred, or 512 bytes. The 512 size is fixed by the standard; + * smaller blocks are possible, but never larger. + */ + + WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); + + mr = RD4(sc,MCI_MR) & ~MCI_MR_BLKLEN; + mr |= min(data->len, 512) << 16; + WR4(sc, MCI_MR, mr | MCI_MR_PDCMODE|MCI_MR_PDCPADV); + + /* + * Set up DMA. + * + * Use bounce buffers even if we don't need to byteswap, because doing + * multi-block IO with large DMA buffers is way fast (compared to + * single-block IO), even after incurring the overhead of also copying + * from/to the caller's buffers (which may be in non-contiguous physical + * pages). + * + * In an ideal non-byteswap world we could create a dma tag that allows + * for discontiguous segments and do the IO directly from/to the + * caller's buffer(s), using ENDRX/ENDTX interrupts to chain the + * discontiguous buffers through the PDC. Someday. + * + * If a read is bigger than 2k, split it in half so that we can start + * byte-swapping the first half while the second half is on the wire. + * It would be best if we could split it into 8k chunks, but we can't + * always keep up with the byte-swapping due to other system activity, + * and if an RXBUFF interrupt happens while we're still handling the + * byte-swap from the prior buffer (IE, we haven't returned from + * handling the prior interrupt yet), then data will get dropped on the + * floor and we can't easily recover from that. The right fix for that + * would be to have the interrupt handling only keep the DMA flowing and + * enqueue filled buffers to be byte-swapped in a non-interrupt context. + * Even that won't work on the write side of things though; in that + * context we have to have all the data ready to go before starting the + * dma. + * + * XXX what about stream transfers? + */ + sc->xfer_offset = 0; + sc->bbuf_curidx = 0; + + if (data->flags & (MMC_DATA_READ | MMC_DATA_WRITE)) { + uint32_t len; + uint32_t remaining = data->len; + bus_addr_t paddr; + int err; + + if (remaining > (BBCOUNT*BBSIZE)) + panic("IO read size exceeds MAXDATA\n"); + + if (data->flags & MMC_DATA_READ) { + if (remaining > 2048) // XXX + len = remaining / 2; + else + len = remaining; + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], + sc->bbuf_vaddr[0], len, at91_mci_getaddr, + &paddr, BUS_DMA_NOWAIT); + if (err != 0) + panic("IO read dmamap_load failed\n"); + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], + BUS_DMASYNC_PREREAD); + WR4(sc, PDC_RPR, paddr); + WR4(sc, PDC_RCR, len / 4); + sc->bbuf_len[0] = len; + remaining -= len; + if (remaining == 0) { + sc->bbuf_len[1] = 0; + } else { + len = remaining; + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[1], + sc->bbuf_vaddr[1], len, at91_mci_getaddr, + &paddr, BUS_DMA_NOWAIT); + if (err != 0) + panic("IO read dmamap_load failed\n"); + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], + BUS_DMASYNC_PREREAD); + WR4(sc, PDC_RNPR, paddr); + WR4(sc, PDC_RNCR, len / 4); + sc->bbuf_len[1] = len; + remaining -= len; + } + WR4(sc, PDC_PTCR, PDC_PTCR_RXTEN); + } else { + len = min(BBSIZE, remaining); /* * If this is MCI1 revision 2xx controller, apply * a work-around for the "Data Write Operation and @@ -530,74 +769,75 @@ at91_mci_start_cmd(struct at91_mci_softc */ if (at91_mci_is_mci1rev2xx() && data->len < 12) { len = 12; - memset(dst, 0, 12); + memset(data->data, 0, 12); } - if (sc->sc_cap & CAP_NEEDS_BYTESWAP) { - for (i = 0; i < data->len / 4; i++) - dst[i] = bswap32(src[i]); - } else - memcpy(dst, src, data->len); - } - data->xfer_len = 0; - if (bus_dmamap_load(sc->dmatag, sc->map, vaddr, len, - at91_mci_getaddr, &paddr, 0) != 0) { - cmd->error = MMC_ERR_NO_MEMORY; - sc->req = NULL; - sc->curcmd = NULL; - cmd->mrq->done(cmd->mrq); - return; - } - sc->mapped++; - if (cmdr & MCI_CMDR_TRDIR) { - bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_PREREAD); - WR4(sc, PDC_RPR, paddr); - WR4(sc, PDC_RCR, len / 4); - ier = MCI_SR_ENDRX; - } else { - bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_PREWRITE); - WR4(sc, PDC_TPR, paddr); + at91_bswap_buf(sc, sc->bbuf_vaddr[0], data->data, len); + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], + sc->bbuf_vaddr[0], len, at91_mci_getaddr, + &paddr, BUS_DMA_NOWAIT); + if (err != 0) + panic("IO write dmamap_load failed\n"); + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], + BUS_DMASYNC_PREWRITE); + WR4(sc, PDC_TPR,paddr); WR4(sc, PDC_TCR, len / 4); - ier = MCI_SR_TXBUFE; + sc->bbuf_len[0] = len; + remaining -= len; + if (remaining == 0) { + sc->bbuf_len[1] = 0; + } else { + len = remaining; + at91_bswap_buf(sc, sc->bbuf_vaddr[1], + ((char *)data->data)+BBSIZE, len); + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[1], + sc->bbuf_vaddr[1], len, at91_mci_getaddr, + &paddr, BUS_DMA_NOWAIT); + if (err != 0) + panic("IO write dmamap_load failed\n"); + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], + BUS_DMASYNC_PREWRITE); + WR4(sc, PDC_TNPR, paddr); + WR4(sc, PDC_TNCR, len / 4); + sc->bbuf_len[1] = len; + remaining -= len; + } + /* do not enable PDC xfer until CMDRDY asserted */ } + data->xfer_len = 0; /* XXX what's this? appears to be unused. */ } -// printf("CMDR %x ARGR %x with data\n", cmdr, cmd->arg); + + if (mci_debug) + printf("CMDR %x (opcode %d) ARGR %x with data len %d\n", + cmdr, cmd->opcode, cmd->arg, cmd->data->len); + WR4(sc, MCI_ARGR, cmd->arg); - if (cmdr & MCI_CMDR_TRCMD_START) { - if (cmdr & MCI_CMDR_TRDIR) { - WR4(sc, PDC_PTCR, PDC_PTCR_RXTEN); - WR4(sc, MCI_CMDR, cmdr); - } else { - WR4(sc, MCI_CMDR, cmdr); - WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN); - } - } - WR4(sc, MCI_IER, MCI_SR_ERROR | ier); + WR4(sc, MCI_CMDR, cmdr); + WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_CMDRDY); } static void -at91_mci_start(struct at91_mci_softc *sc) +at91_mci_next_operation(struct at91_mci_softc *sc) { struct mmc_request *req; req = sc->req; if (req == NULL) return; - // assert locked - if (!(sc->flags & CMD_STARTED)) { - sc->flags |= CMD_STARTED; -// printf("Starting CMD\n"); + + if (sc->flags & PENDING_CMD) { + sc->flags &= ~PENDING_CMD; at91_mci_start_cmd(sc, req->cmd); return; - } - if (!(sc->flags & STOP_STARTED) && req->stop) { -// printf("Starting Stop\n"); - sc->flags |= STOP_STARTED; + } else if (sc->flags & PENDING_STOP) { + sc->flags &= ~PENDING_STOP; at91_mci_start_cmd(sc, req->stop); return; } - /* We must be done -- bad idea to do this while locked? */ + + WR4(sc, MCI_IDR, 0xffffffff); sc->req = NULL; sc->curcmd = NULL; + //printf("req done\n"); req->done(req); } @@ -607,16 +847,16 @@ at91_mci_request(device_t brdev, device_ struct at91_mci_softc *sc = device_get_softc(brdev); AT91_MCI_LOCK(sc); - // XXX do we want to be able to queue up multiple commands? - // XXX sounds like a good idea, but all protocols are sync, so - // XXX maybe the idea is naive... if (sc->req != NULL) { AT91_MCI_UNLOCK(sc); return (EBUSY); } + //printf("new req\n"); sc->req = req; - sc->flags = 0; - at91_mci_start(sc); + sc->flags = PENDING_CMD; + if (sc->req->stop) + sc->flags |= PENDING_STOP; + at91_mci_next_operation(sc); AT91_MCI_UNLOCK(sc); return (0); } @@ -654,120 +894,351 @@ at91_mci_release_host(device_t brdev, de } static void -at91_mci_read_done(struct at91_mci_softc *sc) +at91_mci_read_done(struct at91_mci_softc *sc, uint32_t sr) { - uint32_t *walker; - struct mmc_command *cmd; - int i, len; - - cmd = sc->curcmd; - bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->dmatag, sc->map); - sc->mapped--; - if (sc->sc_cap & CAP_NEEDS_BYTESWAP) { - walker = (uint32_t *)cmd->data->data; - len = cmd->data->len / 4; - for (i = 0; i < len; i++) - walker[i] = bswap32(walker[i]); - } - // Finish up the sequence... - WR4(sc, MCI_IDR, MCI_SR_ENDRX); - WR4(sc, MCI_IER, MCI_SR_RXBUFF); - WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); + struct mmc_command *cmd = sc->curcmd; + char * dataptr = (char *)cmd->data->data; + uint32_t curidx = sc->bbuf_curidx; + uint32_t len = sc->bbuf_len[curidx]; + + /* + * We arrive here when a DMA transfer for a read is done, whether it's + * a single or multi-block read. + * + * We byte-swap the buffer that just completed, and if that is the + * last buffer that's part of this read then we move on to the next + * operation, otherwise we wait for another ENDRX for the next bufer. + */ + + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[curidx], BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->dmatag, sc->bbuf_map[curidx]); + + at91_bswap_buf(sc, dataptr + sc->xfer_offset, sc->bbuf_vaddr[curidx], len); + + if (mci_debug) { + printf("read done sr %x curidx %d len %d xfer_offset %d\n", + sr, curidx, len, sc->xfer_offset); + } + + sc->xfer_offset += len; + sc->bbuf_curidx = !curidx; /* swap buffers */ + + /* + * If we've transferred all the data, move on to the next operation. + * + * If we're still transferring the last buffer, RNCR is already zero but + * we have to write a zero anyway to clear the ENDRX status so we don't + * re-interrupt until the last buffer is done. + */ + if (sc->xfer_offset == cmd->data->len) { + WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); + cmd->error = MMC_ERR_NONE; + at91_mci_next_operation(sc); + } else { + WR4(sc, PDC_RNCR, 0); + WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_ENDRX); + } } static void -at91_mci_xmit_done(struct at91_mci_softc *sc) +at91_mci_write_done(struct at91_mci_softc *sc, uint32_t sr) { - // Finish up the sequence... + struct mmc_command *cmd = sc->curcmd; + + /* + * We arrive here when the entire DMA transfer for a write is done, + * whether it's a single or multi-block write. If it's multi-block we + * have to immediately move on to the next operation which is to send + * the stop command. If it's a single-block transfer we need to wait + * for NOTBUSY, but if that's already asserted we can avoid another + * interrupt and just move on to completing the request right away. + */ + WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); - WR4(sc, MCI_IDR, MCI_SR_TXBUFE); - WR4(sc, MCI_IER, MCI_SR_NOTBUSY); - bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->dmatag, sc->map); - sc->mapped--; + + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[sc->bbuf_curidx], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->dmatag, sc->bbuf_map[sc->bbuf_curidx]); + + if ((cmd->data->flags & MMC_DATA_MULTI) || (sr & MCI_SR_NOTBUSY)) { + cmd->error = MMC_ERR_NONE; + at91_mci_next_operation(sc); + } else { + WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_NOTBUSY); + } +} + +static void +at91_mci_notbusy(struct at91_mci_softc *sc) +{ + struct mmc_command *cmd = sc->curcmd; + + /* + * We arrive here by either completion of a single-block write, or + * completion of the stop command that ended a multi-block write (and, + * I suppose, after a card-select or erase, but I haven't tested + * those). Anyway, we're done and it's time to move on to the next + * command. + */ + + cmd->error = MMC_ERR_NONE; + at91_mci_next_operation(sc); +} + +static void +at91_mci_stop_done(struct at91_mci_softc *sc, uint32_t sr) +{ + struct mmc_command *cmd = sc->curcmd; + + /* + * We arrive here after receiving CMDRDY for a MMC_STOP_TRANSMISSION + * command. Depending on the operation being stopped, we may have to + * do some unusual things to work around hardware bugs. + */ + + /* + * This is known to be true of at91rm9200 hardware; it may or may not + * apply to more recent chips: + * + * After stopping a multi-block write, the NOTBUSY bit in MCI_SR does + * not properly reflect the actual busy state of the card as signaled + * on the DAT0 line; it always claims the card is not-busy. If we + * believe that and let operations continue, following commands will + * fail with response timeouts (except of course MMC_SEND_STATUS -- it + * indicates the card is busy in the PRG state, which was the smoking + * gun that showed MCI_SR NOTBUSY was not tracking DAT0 correctly). + * + * The atmel docs are emphatic: "This flag [NOTBUSY] must be used only + * for Write Operations." I guess technically since we sent a stop + * it's not a write operation anymore. But then just what did they + * think it meant for the stop command to have "...an optional busy + * signal transmitted on the data line" according to the SD spec? + * + * I tried a variety of things to un-wedge the MCI and get the status + * register to reflect NOTBUSY correctly again, but the only thing + * that worked was a full device reset. It feels like an awfully big + * hammer, but doing a full reset after every multiblock write is + * still faster than doing single-block IO (by almost two orders of + * magnitude: 20KB/sec improves to about 1.8MB/sec best case). + * + * After doing the reset, wait for a NOTBUSY interrupt before + * continuing with the next operation. + */ + if (sc->flags & CMD_MULTIWRITE) { + at91_mci_reset(sc); + WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_NOTBUSY); + return; + } + + /* + * This is known to be true of at91rm9200 hardware; it may or may not + * apply to more recent chips: + * + * After stopping a multi-block read, loop to read and discard any + * data that coasts in after we sent the stop command. The docs don't + * say anything about it, but empirical testing shows that 1-3 + * additional words of data get buffered up in some unmentioned + * internal fifo and if we don't read and discard them here they end + * up on the front of the next read DMA transfer we do. + */ + if (sc->flags & CMD_MULTIREAD) { + uint32_t sr; + int count = 0; + + do { + sr = RD4(sc, MCI_SR); + if (sr & MCI_SR_RXRDY) { + RD4(sc, MCI_RDR); + ++count; + } + } while (sr & MCI_SR_RXRDY); + at91_mci_reset(sc); +// if (count != 0) +// printf("Had to soak up %d words after read\n", count); + } + + cmd->error = MMC_ERR_NONE; + at91_mci_next_operation(sc); + +} + +static void +at91_mci_cmdrdy(struct at91_mci_softc *sc, uint32_t sr) +{ + struct mmc_command *cmd = sc->curcmd; + int i; + + if (cmd == NULL) + return; + + /* + * We get here at the end of EVERY command. We retrieve the command + * response (if any) then decide what to do next based on the command. + */ + + if (cmd->flags & MMC_RSP_PRESENT) { + for (i = 0; i < ((cmd->flags & MMC_RSP_136) ? 4 : 1); i++) { + cmd->resp[i] = RD4(sc, MCI_RSPR + i * 4); + if (mci_debug) + printf("RSPR[%d] = %x sr=%x\n", i, cmd->resp[i], sr); + } + } + + /* + * If this was a stop command, go handle the various special + * conditions (read: bugs) that have to be dealt with following a stop. + */ + if (cmd->opcode == MMC_STOP_TRANSMISSION) { + at91_mci_stop_done(sc, sr); + return; + } + + /* + * If this command can continue to assert BUSY beyond the response then + * we need to wait for NOTBUSY before the command is really done. + * + * Note that this may not work properly on the at91rm9200. It certainly + * doesn't work for the STOP command that follows a multi-block write, + * so post-stop CMDRDY is handled separately; see the special handling + * in at91_mci_stop_done(). + * + * Beside STOP, there are other R1B-type commands that use the busy + * signal after CMDRDY: CMD7 (card select), CMD28-29 (write protect), + * CMD38 (erase). I haven't tested any of them, but I rather expect + * them all to have the same sort of problem with MCI_SR not actually + * reflecting the state of the DAT0-line busy indicator. So this code + * may need to grow some sort of special handling for them too. (This + * just in: CMD7 isn't a problem right now because dev/mmc.c incorrectly + * sets the response flags to R1 rather than R1B.) XXX + */ + if ((cmd->flags & MMC_RSP_BUSY)) { + WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_NOTBUSY); + return; + } + + /* + * If there is a data transfer with this command, then... + * - If it's a read, we need to wait for ENDRX. + * - If it's a write, now is the time to enable the PDC, and we need + * to wait for a BLKE that follows a TXBUFE, because if we're doing + * a split transfer we get a BLKE after the first half (when TPR/TCR + * get loaded from TNPR/TNCR). So first we wait for the TXBUFE, and + * the handling for that interrupt will then invoke the wait for the + * subsequent BLKE which indicates actual completion. + */ + if (cmd->data) { + uint32_t ier; + if (cmd->data->flags & MMC_DATA_READ) { + ier = MCI_SR_ENDRX; + } else { + ier = MCI_SR_TXBUFE; + WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN); + } + WR4(sc, MCI_IER, MCI_SR_ERROR | ier); + return; + } + + /* + * If we made it to here, we don't need to wait for anything more for + * the current command, move on to the next command (will complete the + * request if there is no next command). + */ + cmd->error = MMC_ERR_NONE; + at91_mci_next_operation(sc); } static void at91_mci_intr(void *arg) { struct at91_mci_softc *sc = (struct at91_mci_softc*)arg; - uint32_t sr; - int i, done = 0; - struct mmc_command *cmd; + struct mmc_command *cmd = sc->curcmd; + uint32_t sr, isr; AT91_MCI_LOCK(sc); - sr = RD4(sc, MCI_SR) & RD4(sc, MCI_IMR); -// printf("i 0x%x\n", sr); - cmd = sc->curcmd; - if (sr & MCI_SR_ERROR) { - // Ignore CRC errors on CMD2 and ACMD47, per relevant standards - if ((sr & MCI_SR_RCRCE) && (cmd->opcode == MMC_SEND_OP_COND || - cmd->opcode == ACMD_SD_SEND_OP_COND)) - cmd->error = MMC_ERR_NONE; - else if (sr & (MCI_SR_RTOE | MCI_SR_DTOE)) + + sr = RD4(sc, MCI_SR); + isr = sr & RD4(sc, MCI_IMR); + + if (mci_debug) + printf("i 0x%x sr 0x%x\n", isr, sr); + + /* + * All interrupts are one-shot; disable it now. + * The next operation will re-enable whatever interrupts it wants. + */ + WR4(sc, MCI_IDR, isr); + if (isr & MCI_SR_ERROR) { + if (isr & (MCI_SR_RTOE | MCI_SR_DTOE)) cmd->error = MMC_ERR_TIMEOUT; - else if (sr & (MCI_SR_RCRCE | MCI_SR_DCRCE)) + else if (isr & (MCI_SR_RCRCE | MCI_SR_DCRCE)) cmd->error = MMC_ERR_BADCRC; - else if (sr & (MCI_SR_OVRE | MCI_SR_UNRE)) + else if (isr & (MCI_SR_OVRE | MCI_SR_UNRE)) cmd->error = MMC_ERR_FIFO; else cmd->error = MMC_ERR_FAILED; - done = 1; - if (sc->mapped && cmd->error) { - bus_dmamap_unload(sc->dmatag, sc->map); - sc->mapped--; + /* + * CMD8 is used to probe for SDHC cards, a standard SD card + * will get a response timeout; don't report it because it's a + * normal and expected condition. One might argue that all + * error reporting should be left to higher levels, but when + * they report at all it's always EIO, which isn't very + * helpful. XXX bootverbose? + */ + if (cmd->opcode != 8) { + device_printf(sc->dev, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 03:27:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59C001065673; Tue, 28 Aug 2012 03:27:49 +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 42F728FC14; Tue, 28 Aug 2012 03:27: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 q7S3RnQo001955; Tue, 28 Aug 2012 03:27:49 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S3RntR001953; Tue, 28 Aug 2012 03:27:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208280327.q7S3RntR001953@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Aug 2012 03:27: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: r239763 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 03:27:49 -0000 Author: imp Date: Tue Aug 28 03:27:48 2012 New Revision: 239763 URL: http://svn.freebsd.org/changeset/base/239763 Log: Style: Move these routines to be before the forward declared functions as is the normal practice. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Tue Aug 28 01:28:52 2012 (r239762) +++ head/sys/arm/at91/at91_mci.c Tue Aug 28 03:27:48 2012 (r239763) @@ -161,18 +161,6 @@ struct at91_mci_softc { uint32_t xfer_offset; /* offset so far into caller's buf */ }; -static inline uint32_t -RD4(struct at91_mci_softc *sc, bus_size_t off) -{ - return (bus_read_4(sc->mem_res, off)); -} - -static inline void -WR4(struct at91_mci_softc *sc, bus_size_t off, uint32_t val) -{ - bus_write_4(sc->mem_res, off, val); -} - /* bus entry points */ static int at91_mci_probe(device_t dev); static int at91_mci_attach(device_t dev); @@ -193,6 +181,18 @@ static int at91_mci_is_mci1rev2xx(void); #define AT91_MCI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); #define AT91_MCI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +static inline uint32_t +RD4(struct at91_mci_softc *sc, bus_size_t off) +{ + return (bus_read_4(sc->mem_res, off)); +} + +static inline void +WR4(struct at91_mci_softc *sc, bus_size_t off, uint32_t val) +{ + bus_write_4(sc->mem_res, off, val); +} + static void at91_bswap_buf(struct at91_mci_softc *sc, void * dptr, void * sptr, uint32_t memsize) { From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 03:46:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB9AC106566B; Tue, 28 Aug 2012 03:46:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6FBF8FC14; Tue, 28 Aug 2012 03:46: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 q7S3kVOl004139; Tue, 28 Aug 2012 03:46:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S3kVJK004137; Tue, 28 Aug 2012 03:46:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208280346.q7S3kVJK004137@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Aug 2012 03:46: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: r239764 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 03:46:31 -0000 Author: imp Date: Tue Aug 28 03:46:31 2012 New Revision: 239764 URL: http://svn.freebsd.org/changeset/base/239764 Log: Move to using a flag instead of checking the CPU type each transaction for the MCI1 rev 2.x write workarounds. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Tue Aug 28 03:27:48 2012 (r239763) +++ head/sys/arm/at91/at91_mci.c Tue Aug 28 03:46:31 2012 (r239764) @@ -139,6 +139,7 @@ struct at91_mci_softc { int sc_cap; #define CAP_HAS_4WIRE 1 /* Has 4 wire bus */ #define CAP_NEEDS_BYTESWAP 2 /* broken hardware needing bounce */ +#define CAP_MCI1_REV2XX 4 /* MCI 1 rev 2.x */ int flags; #define PENDING_CMD 0x01 #define PENDING_STOP 0x02 @@ -307,7 +308,7 @@ at91_mci_init(device_t dev) WR4(sc, MCI_DTOR, MCI_DTOR_DTOMUL_1M | 1); val = MCI_MR_PDCMODE; val |= 0x34a; /* PWSDIV = 3; CLKDIV = 74 */ - if (at91_mci_is_mci1rev2xx()) + if (sc->sc_cap & CAP_MCI1_REV2XX) val |= MCI_MR_RDPROOF | MCI_MR_WRPROOF; WR4(sc, MCI_MR, val); #ifndef AT91_MCI_SLOT_B @@ -407,6 +408,12 @@ at91_mci_attach(device_t dev) } /* + * MCI1 Rev 2 controllers need some workarounds, flag if so. + */ + if (at91_mci_is_mci1rev2xx()) + sc->sc_cap |= CAP_MCI1_REV2XX; + + /* * Allow 4-wire to be initially set via #define. * Allow a device hint to override that. * Allow a sysctl to override that. @@ -767,7 +774,7 @@ at91_mci_start_cmd(struct at91_mci_softc * a work-around for the "Data Write Operation and * number of bytes" erratum. */ - if (at91_mci_is_mci1rev2xx() && data->len < 12) { + if ((sc->sc_cap & CAP_MCI1_REV2XX) && data->len < 12) { len = 12; memset(data->data, 0, 12); } From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 06:17:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8FE6106566C; Tue, 28 Aug 2012 06:17:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B98788FC0A; Tue, 28 Aug 2012 06:17: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 q7S6HiRP021929; Tue, 28 Aug 2012 06:17:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S6Hih5021927; Tue, 28 Aug 2012 06:17:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208280617.q7S6Hih5021927@svn.freebsd.org> From: Adrian Chadd Date: Tue, 28 Aug 2012 06:17: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: r239765 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 06:17:45 -0000 Author: adrian Date: Tue Aug 28 06:17:44 2012 New Revision: 239765 URL: http://svn.freebsd.org/changeset/base/239765 Log: This is an initial board configuration for the D-Link DIR-825 dual-band 802.11n router. The flash layout defaults to a 1 MiB section for the kernel so I'm trying very hard to squeeze a minimialistic (LZMA compressde) kernel image into that. I've verified that it boots through to single user mode fine. Issues: * USB doesn't yet work as a module - I need to add something else to the USB AR71xx build before that will work. * There's no switch PHY support - but for now it quite happily behaves as a useful dumb switch out of the box. Phew. * Since a previous flash attempt trashed my radio configuration block, I haven't yet verified whether the wireless works correctly. I'll test that out shortly (read: once I re-calibrate the board somehow.) Thanks to ray@ and the zrouter project for doing some of the initial hard work in figuring out how to bring this board up. Added: head/sys/mips/conf/DIR-825 (contents, props changed) head/sys/mips/conf/DIR-825.hints (contents, props changed) Added: head/sys/mips/conf/DIR-825 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DIR-825 Tue Aug 28 06:17:44 2012 (r239765) @@ -0,0 +1,68 @@ +# +# Specific board setup for the D-Link DIR-825 router. +# +# The DIR-825 has the following hardware: +# +# + AR7161 CPU SoC +# + AR9223 2.4GHz 11n +# + AR9220 5GHz 11n +# + RealTek RTL8366S Gigabit switch +# + m25p64 based 8MB flash +# + 64MB RAM +# + uboot environment + +# $FreeBSD$ + +include "AR71XX_BASE" +ident "DIR-825" +hints "DIR-825.hints" + +# Since the kernel image must fit inside 1024KiB, we have to build almost +# everything as modules. +nodevice random +nodevice gpio +nodevice gpioled +nodevice gif +nodevice gre +nodevice bridge +nodevice usb +nodevice ehci +nodevice wlan +nodevice wlan_xauth +nodevice wlan_acl +nodevice wlan_wep +nodevice wlan_tkip +nodevice wlan_ccmp +nodevice wlan_rssadapt +nodevice wlan_amrr +nodevice ath +nodevice ath_pci +nodevice ath_hal +nodevice umass +nodevice ath_rate_sample + +nooptions INET6 + +# Don't include the SCSI/CAM strings in the default build +options SCSI_NO_SENSE_STRINGS +options SCSI_NO_OP_STRINGS + +# .. And no sysctl strings +options NO_SYSCTL_DESCR + +# GEOM modules +device geom_map # to get access to the SPI flash partitions +device geom_uncompress # compressed in-memory filesystem hackery! +options GEOM_UNCOMPRESS + +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" +options AR71XX_REALMEM=64*1024*1024 + +options AR71XX_ENV_UBOOT + +# options MD_ROOT +# options MD_ROOT_SIZE="6144" + +options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash +options ATH_EEPROM_FIRMWARE # Use EEPROM from flash +device firmware # Used by the above Added: head/sys/mips/conf/DIR-825.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DIR-825.hints Tue Aug 28 06:17:44 2012 (r239765) @@ -0,0 +1,67 @@ +# $FreeBSD$ + +# arge0 is connected to the LAN side of the switch PHY. +# arge1 is connected to the single port WAN side of the switch PHY. + +hint.arge.0.phymask=0x0 +hint.arge.0.media=1000 +hint.arge.0.fduplex=1 + +# XXX grab these from uboot? +# hint.arge.0.eeprommac=0x1f01fc00 + +hint.arge.1.phymask=0x0 +hint.arge.1.media=1000 +hint.arge.1.fduplex=1 + +# ath0 - slot 17 +hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1fff1000 +hint.pcib.0.bus.0.17.0.ath_fixup_size=4096 + +# ath1 - slot 18 +hint.pcib.0.bus.0.18.0.ath_fixup_addr=0x1fff5000 +hint.pcib.0.bus.0.18.0.ath_fixup_size=4096 + +# .. and now, telling each ath(4) NIC where to find the firmware +# image. +hint.ath.0.eeprom_firmware="pcib.0.bus.0.17.0.eeprom_firmware" +hint.ath.1.eeprom_firmware="pcib.0.bus.0.18.0.eeprom_firmware" + +# TODO: gpio LEDs + +# Geom MAP + +# mtdparts=ar7100-nor0:256k(uboot),64k(Config),1024k(vmlinux),5184k(rootfs),64k(caldata) + +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x000040000 +hint.map.0.name="uboot" +hint.map.0.readonly=1 + +# This config partition is the D-Link specific configuration area. +# I'm re-purposing it for FreeBSD. +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00040000 +hint.map.1.end=0x00050000 +hint.map.1.name="cfg" +hint.map.1.readonly=1 + +hint.map.2.at="flash/spi0" +hint.map.2.start=0x0050000 +hint.map.2.end=0x00150000 +hint.map.2.name="kernel" +hint.map.2.readonly=1 + +hint.map.3.at="flash/spi0" +hint.map.3.start=0x00150000 +hint.map.3.end=0x007f0000 +hint.map.3.name="rootfs" +hint.map.3.readonly=0 + +hint.map.4.at="flash/spi0" +hint.map.4.start=0x007f0000 +hint.map.4.end=0x00800000 +hint.map.4.name="art" +hint.map.4.readonly=1 + From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 06:52:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AECA106564A; Tue, 28 Aug 2012 06:52:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 157E68FC16; Tue, 28 Aug 2012 06:52: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 q7S6q05h026070; Tue, 28 Aug 2012 06:52:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S6q0BO026068; Tue, 28 Aug 2012 06:52:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208280652.q7S6q0BO026068@svn.freebsd.org> From: Adrian Chadd Date: Tue, 28 Aug 2012 06:52: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: r239768 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 06:52:01 -0000 Author: adrian Date: Tue Aug 28 06:52:00 2012 New Revision: 239768 URL: http://svn.freebsd.org/changeset/base/239768 Log: oops, make cfg read-write. Modified: head/sys/mips/conf/DIR-825.hints Modified: head/sys/mips/conf/DIR-825.hints ============================================================================== --- head/sys/mips/conf/DIR-825.hints Tue Aug 28 06:49:33 2012 (r239767) +++ head/sys/mips/conf/DIR-825.hints Tue Aug 28 06:52:00 2012 (r239768) @@ -45,7 +45,7 @@ hint.map.1.at="flash/spi0" hint.map.1.start=0x00040000 hint.map.1.end=0x00050000 hint.map.1.name="cfg" -hint.map.1.readonly=1 +hint.map.1.readonly=0 hint.map.2.at="flash/spi0" hint.map.2.start=0x0050000 From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 08:38:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3F208106564A; Tue, 28 Aug 2012 08:38:54 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A8068FC14; Tue, 28 Aug 2012 08:38: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 q7S8csoe038106; Tue, 28 Aug 2012 08:38:54 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7S8crqM038104; Tue, 28 Aug 2012 08:38:53 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208280838.q7S8crqM038104@svn.freebsd.org> From: Andrey Zonov Date: Tue, 28 Aug 2012 08:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239769 - head/usr.sbin/watchdogd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 08:38:54 -0000 Author: zont Date: Tue Aug 28 08:38:53 2012 New Revision: 239769 URL: http://svn.freebsd.org/changeset/base/239769 Log: - Don't allow watchdogd(8) to be swapped out. On machines with huge amount of swap and high IO activity, watchdogd(8) may wait for a swap memory longer than timeout and sometimes fires. Approved by: kib (mentor) MFC after: 1 week Modified: head/usr.sbin/watchdogd/watchdogd.c Modified: head/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.c Tue Aug 28 06:52:00 2012 (r239768) +++ head/usr.sbin/watchdogd/watchdogd.c Tue Aug 28 08:38:53 2012 (r239769) @@ -118,6 +118,8 @@ main(int argc, char *argv[]) pidfile_write(pfh); if (madvise(0, 0, MADV_PROTECT) != 0) warn("madvise failed"); + if (mlockall(MCL_FUTURE) != 0) + warn("mlockall failed"); watchdog_loop(); From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 11:34:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D38DC1065670; Tue, 28 Aug 2012 11:34: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 BEEEA8FC0C; Tue, 28 Aug 2012 11:34: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 q7SBY9wp060289; Tue, 28 Aug 2012 11:34:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SBY9TM060285; Tue, 28 Aug 2012 11:34:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208281134.q7SBY9TM060285@svn.freebsd.org> From: John Baldwin Date: Tue, 28 Aug 2012 11:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239771 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 11:34:10 -0000 Author: jhb Date: Tue Aug 28 11:34:09 2012 New Revision: 239771 URL: http://svn.freebsd.org/changeset/base/239771 Log: Fix misspelled "Infiniband". Submitted by: gcooper MFC after: 3 days Modified: head/sys/amd64/conf/NOTES head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Aug 28 10:15:30 2012 (r239770) +++ head/sys/amd64/conf/NOTES Tue Aug 28 11:34:09 2012 (r239771) @@ -98,7 +98,7 @@ options OFED_DEBUG_INIT options SDP options SDP_DEBUG -# IP over Inifiband +# IP over Infiniband options IPOIB options IPOIB_DEBUG options IPOIB_CM Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Tue Aug 28 10:15:30 2012 (r239770) +++ head/sys/i386/conf/NOTES Tue Aug 28 11:34:09 2012 (r239771) @@ -268,7 +268,7 @@ options OFED_DEBUG_INIT options SDP options SDP_DEBUG -# IP over Inifiband +# IP over Infiniband options IPOIB options IPOIB_DEBUG options IPOIB_CM From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 12:25:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84257106566C; Tue, 28 Aug 2012 12:25:38 +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 6BC8B8FC08; Tue, 28 Aug 2012 12:25: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 q7SCPc4n066867; Tue, 28 Aug 2012 12:25:38 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SCPcB1066844; Tue, 28 Aug 2012 12:25:38 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208281225.q7SCPcB1066844@svn.freebsd.org> From: Martin Matuska Date: Tue, 28 Aug 2012 12:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239774 - in head: . cddl/contrib/opensolaris/cmd/zinject cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 12:25:38 -0000 Author: mm Date: Tue Aug 28 12:25:37 2012 New Revision: 239774 URL: http://svn.freebsd.org/changeset/base/239774 Log: Merge recent vendor changes: 3100 zvol rename fails with EBUSY when dirty 3104 eliminate empty bpobjs 3120 zinject hangs in zfsdev_ioctl() due to uninitialized zc References: https://www.illumos.org/issues/3100 https://www.illumos.org/issues/3104 https://www.illumos.org/issues/3120 Obtained from: illumos (vendor/illumos, vendor/illumos-sys) MFC after: 2 weeks Modified: head/UPDATING head/cddl/contrib/opensolaris/cmd/zinject/zinject.c head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Aug 28 12:19:14 2012 (r239773) +++ head/UPDATING Tue Aug 28 12:25:37 2012 (r239774) @@ -24,6 +24,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20120828: + A new ZFS feature flag "com.delphix:empty_bpobj" has been merged + to -HEAD. Pools that have empty_bpobj in active state can not be + imported read-write with ZFS implementations that do not support + this feature. For more information read the zpool-features(5) + manual page. + 20120727: The sparc64 ZFS loader has been changed to no longer try to auto- detect ZFS providers based on diskN aliases but now requires these Modified: head/cddl/contrib/opensolaris/cmd/zinject/zinject.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zinject/zinject.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/cddl/contrib/opensolaris/cmd/zinject/zinject.c Tue Aug 28 12:25:37 2012 (r239774) @@ -297,11 +297,9 @@ static int iter_handlers(int (*func)(int, const char *, zinject_record_t *, void *), void *data) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; int ret; - zc.zc_guid = 0; - while (ioctl(zfs_fd, ZFS_IOC_INJECT_LIST_NEXT, &zc) == 0) if ((ret = func((int)zc.zc_guid, zc.zc_name, &zc.zc_inject_record, data)) != 0) @@ -424,7 +422,7 @@ static int cancel_one_handler(int id, const char *pool, zinject_record_t *record, void *data) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; zc.zc_guid = (uint64_t)id; @@ -457,7 +455,7 @@ cancel_all_handlers(void) static int cancel_handler(int id) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; zc.zc_guid = (uint64_t)id; @@ -479,7 +477,7 @@ static int register_handler(const char *pool, int flags, zinject_record_t *record, int quiet) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; (void) strcpy(zc.zc_name, pool); zc.zc_inject_record = *record; @@ -536,7 +534,7 @@ register_handler(const char *pool, int f int perform_action(const char *pool, zinject_record_t *record, int cmd) { - zfs_cmd_t zc; + zfs_cmd_t zc = { 0 }; ASSERT(cmd == VDEV_STATE_DEGRADED || cmd == VDEV_STATE_FAULTED); (void) strlcpy(zc.zc_name, pool, sizeof (zc.zc_name)); Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Tue Aug 28 12:19:14 2012 (r239773) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Tue Aug 28 12:25:37 2012 (r239774) @@ -21,7 +21,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Aug 27, 2012 +.Dd Aug 28, 2012 .Dt ZPOOL-FEATURES 8 .Os .Sh NAME @@ -162,6 +162,29 @@ This feature is only while .Sy freeing is non\-zero. +.It Sy empty_bpobj +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:empty_bpobj" +.It GUID Ta com.delphix:empty_bpobj +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta none +.El +.Pp +This feature increases the performance of creating and using a large number +of snapshots of a single filesystem or volume, and also reduces the disk +space required. +.Pp +When there are many snapshots, each snapshot uses many Block Pointer Objects +.Pq bpobj's +to track blocks associated with that snapshot. +However, in common use cases, most of these bpobj's are empty. +This feature allows us to create each bpobj on-demand, thus eliminating the +empty bpobjs. +.Pp +This feature is +.Sy active +while there are any filesystems, volumes, or snapshots which were created +after enabling this feature. +.El .Sh SEE ALSO .Xr zpool 8 .Sh AUTHORS Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Aug 28 12:25:37 2012 (r239774) @@ -3546,7 +3546,7 @@ zfs_rollback(zfs_handle_t *zhp, zfs_hand zhp->zfs_type == ZFS_TYPE_VOLUME); /* - * Destroy all recent snapshots and its dependends. + * Destroy all recent snapshots and their dependents. */ cb.cb_force = force; cb.cb_target = snap->zfs_name; Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Tue Aug 28 12:25:37 2012 (r239774) @@ -152,4 +152,7 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_ASYNC_DESTROY, "com.delphix:async_destroy", "async_destroy", "Destroy filesystems asynchronously.", B_TRUE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_EMPTY_BPOBJ, + "com.delphix:empty_bpobj", "empty_bpobj", + "Snapshots use less space.", B_TRUE, B_FALSE, NULL); } Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Tue Aug 28 12:25:37 2012 (r239774) @@ -50,6 +50,7 @@ typedef int (zfeature_func_t)(zfeature_i static enum spa_feature { SPA_FEATURE_ASYNC_DESTROY, + SPA_FEATURE_EMPTY_BPOBJ, SPA_FEATURES } spa_feature_t; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Tue Aug 28 12:25:37 2012 (r239774) @@ -20,13 +20,61 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include #include #include #include +#include +#include + +/* + * Return an empty bpobj, preferably the empty dummy one (dp_empty_bpobj). + */ +uint64_t +bpobj_alloc_empty(objset_t *os, int blocksize, dmu_tx_t *tx) +{ + zfeature_info_t *empty_bpobj_feat = + &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ]; + spa_t *spa = dmu_objset_spa(os); + dsl_pool_t *dp = dmu_objset_pool(os); + + if (spa_feature_is_enabled(spa, empty_bpobj_feat)) { + if (!spa_feature_is_active(spa, empty_bpobj_feat)) { + ASSERT3U(dp->dp_empty_bpobj, ==, 0); + dp->dp_empty_bpobj = + bpobj_alloc(os, SPA_MAXBLOCKSIZE, tx); + VERIFY(zap_add(os, + DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, + &dp->dp_empty_bpobj, tx) == 0); + } + spa_feature_incr(spa, empty_bpobj_feat, tx); + ASSERT(dp->dp_empty_bpobj != 0); + return (dp->dp_empty_bpobj); + } else { + return (bpobj_alloc(os, blocksize, tx)); + } +} + +void +bpobj_decr_empty(objset_t *os, dmu_tx_t *tx) +{ + zfeature_info_t *empty_bpobj_feat = + &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ]; + dsl_pool_t *dp = dmu_objset_pool(os); + + spa_feature_decr(dmu_objset_spa(os), empty_bpobj_feat, tx); + if (!spa_feature_is_active(dmu_objset_spa(os), empty_bpobj_feat)) { + VERIFY3U(0, ==, zap_remove(dp->dp_meta_objset, + DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_EMPTY_BPOBJ, tx)); + VERIFY3U(0, ==, dmu_object_free(os, dp->dp_empty_bpobj, tx)); + dp->dp_empty_bpobj = 0; + } +} uint64_t bpobj_alloc(objset_t *os, int blocksize, dmu_tx_t *tx) @@ -53,6 +101,7 @@ bpobj_free(objset_t *os, uint64_t obj, d int epb; dmu_buf_t *dbuf = NULL; + ASSERT(obj != dmu_objset_pool(os)->dp_empty_bpobj); VERIFY3U(0, ==, bpobj_open(&bpo, os, obj)); mutex_enter(&bpo.bpo_lock); @@ -320,6 +369,12 @@ bpobj_enqueue_subobj(bpobj_t *bpo, uint6 ASSERT(bpo->bpo_havesubobj); ASSERT(bpo->bpo_havecomp); + ASSERT(bpo->bpo_object != dmu_objset_pool(bpo->bpo_os)->dp_empty_bpobj); + + if (subobj == dmu_objset_pool(bpo->bpo_os)->dp_empty_bpobj) { + bpobj_decr_empty(bpo->bpo_os, tx); + return; + } VERIFY3U(0, ==, bpobj_open(&subbpo, bpo->bpo_os, subobj)); VERIFY3U(0, ==, bpobj_space(&subbpo, &used, &comp, &uncomp)); @@ -388,6 +443,7 @@ bpobj_enqueue(bpobj_t *bpo, const blkptr blkptr_t *bparray; ASSERT(!BP_IS_HOLE(bp)); + ASSERT(bpo->bpo_object != dmu_objset_pool(bpo->bpo_os)->dp_empty_bpobj); /* We never need the fill count. */ stored_bp.blk_fill = 0; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Aug 28 12:25:37 2012 (r239774) @@ -1187,15 +1187,6 @@ dmu_objset_is_dirty(objset_t *os, uint64 !list_is_empty(&os->os_free_dnodes[txg & TXG_MASK])); } -boolean_t -dmu_objset_is_dirty_anywhere(objset_t *os) -{ - for (int t = 0; t < TXG_SIZE; t++) - if (dmu_objset_is_dirty(os, t)) - return (B_TRUE); - return (B_FALSE); -} - static objset_used_cb_t *used_cbs[DMU_OST_NUMTYPES]; void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Aug 28 12:25:37 2012 (r239774) @@ -1258,6 +1258,17 @@ dsl_dataset_dirty(dsl_dataset_t *ds, dmu } } +boolean_t +dsl_dataset_is_dirty(dsl_dataset_t *ds) +{ + for (int t = 0; t < TXG_SIZE; t++) { + if (txg_list_member(&ds->ds_dir->dd_pool->dp_dirty_datasets, + ds, t)) + return (B_TRUE); + } + return (B_FALSE); +} + /* * The unique space in the head dataset can be calculated by subtracting * the space used in the most recent snapshot, that is still being used @@ -3495,10 +3506,6 @@ dsl_dataset_set_quota_sync(void *arg1, v if (ds->ds_quota != effective_value) { dmu_buf_will_dirty(ds->ds_dbuf, tx); ds->ds_quota = effective_value; - - spa_history_log_internal(LOG_DS_REFQUOTA, - ds->ds_dir->dd_pool->dp_spa, tx, "%lld dataset = %llu ", - (longlong_t)ds->ds_quota, ds->ds_object); } } @@ -3602,10 +3609,6 @@ dsl_dataset_set_reservation_sync(void *a dsl_dir_diduse_space(ds->ds_dir, DD_USED_REFRSRV, delta, 0, 0, tx); mutex_exit(&ds->ds_dir->dd_lock); - - spa_history_log_internal(LOG_DS_REFRESERV, - ds->ds_dir->dd_pool->dp_spa, tx, "%lld dataset = %llu", - (longlong_t)effective_value, ds->ds_object); } int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c Tue Aug 28 12:25:37 2012 (r239774) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -163,12 +163,49 @@ dsl_deadlist_free(objset_t *os, uint64_t for (zap_cursor_init(&zc, os, dlobj); zap_cursor_retrieve(&zc, &za) == 0; - zap_cursor_advance(&zc)) - bpobj_free(os, za.za_first_integer, tx); + zap_cursor_advance(&zc)) { + uint64_t obj = za.za_first_integer; + if (obj == dmu_objset_pool(os)->dp_empty_bpobj) + bpobj_decr_empty(os, tx); + else + bpobj_free(os, obj, tx); + } zap_cursor_fini(&zc); VERIFY3U(0, ==, dmu_object_free(os, dlobj, tx)); } +static void +dle_enqueue(dsl_deadlist_t *dl, dsl_deadlist_entry_t *dle, + const blkptr_t *bp, dmu_tx_t *tx) +{ + if (dle->dle_bpobj.bpo_object == + dmu_objset_pool(dl->dl_os)->dp_empty_bpobj) { + uint64_t obj = bpobj_alloc(dl->dl_os, SPA_MAXBLOCKSIZE, tx); + bpobj_close(&dle->dle_bpobj); + bpobj_decr_empty(dl->dl_os, tx); + VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj)); + VERIFY3U(0, ==, zap_update_int_key(dl->dl_os, dl->dl_object, + dle->dle_mintxg, obj, tx)); + } + bpobj_enqueue(&dle->dle_bpobj, bp, tx); +} + +static void +dle_enqueue_subobj(dsl_deadlist_t *dl, dsl_deadlist_entry_t *dle, + uint64_t obj, dmu_tx_t *tx) +{ + if (dle->dle_bpobj.bpo_object != + dmu_objset_pool(dl->dl_os)->dp_empty_bpobj) { + bpobj_enqueue_subobj(&dle->dle_bpobj, obj, tx); + } else { + bpobj_close(&dle->dle_bpobj); + bpobj_decr_empty(dl->dl_os, tx); + VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj)); + VERIFY3U(0, ==, zap_update_int_key(dl->dl_os, dl->dl_object, + dle->dle_mintxg, obj, tx)); + } +} + void dsl_deadlist_insert(dsl_deadlist_t *dl, const blkptr_t *bp, dmu_tx_t *tx) { @@ -197,7 +234,7 @@ dsl_deadlist_insert(dsl_deadlist_t *dl, dle = avl_nearest(&dl->dl_tree, where, AVL_BEFORE); else dle = AVL_PREV(&dl->dl_tree, dle); - bpobj_enqueue(&dle->dle_bpobj, bp, tx); + dle_enqueue(dl, dle, bp, tx); } /* @@ -217,7 +254,7 @@ dsl_deadlist_add_key(dsl_deadlist_t *dl, dle = kmem_alloc(sizeof (*dle), KM_SLEEP); dle->dle_mintxg = mintxg; - obj = bpobj_alloc(dl->dl_os, SPA_MAXBLOCKSIZE, tx); + obj = bpobj_alloc_empty(dl->dl_os, SPA_MAXBLOCKSIZE, tx); VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj)); avl_add(&dl->dl_tree, dle); @@ -243,8 +280,7 @@ dsl_deadlist_remove_key(dsl_deadlist_t * dle = avl_find(&dl->dl_tree, &dle_tofind, NULL); dle_prev = AVL_PREV(&dl->dl_tree, dle); - bpobj_enqueue_subobj(&dle_prev->dle_bpobj, - dle->dle_bpobj.bpo_object, tx); + dle_enqueue_subobj(dl, dle_prev, dle->dle_bpobj.bpo_object, tx); avl_remove(&dl->dl_tree, dle); bpobj_close(&dle->dle_bpobj); @@ -302,7 +338,7 @@ dsl_deadlist_clone(dsl_deadlist_t *dl, u if (dle->dle_mintxg >= maxtxg) break; - obj = bpobj_alloc(dl->dl_os, SPA_MAXBLOCKSIZE, tx); + obj = bpobj_alloc_empty(dl->dl_os, SPA_MAXBLOCKSIZE, tx); VERIFY3U(0, ==, zap_add_int_key(dl->dl_os, newobj, dle->dle_mintxg, obj, tx)); } @@ -400,7 +436,7 @@ dsl_deadlist_insert_bpobj(dsl_deadlist_t dle = avl_find(&dl->dl_tree, &dle_tofind, &where); if (dle == NULL) dle = avl_nearest(&dl->dl_tree, where, AVL_BEFORE); - bpobj_enqueue_subobj(&dle->dle_bpobj, obj, tx); + dle_enqueue_subobj(dl, dle, obj, tx); } static int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Aug 28 12:25:37 2012 (r239774) @@ -1061,10 +1061,6 @@ dsl_dir_set_quota_sync(void *arg1, void mutex_enter(&dd->dd_lock); dd->dd_phys->dd_quota = effective_value; mutex_exit(&dd->dd_lock); - - spa_history_log_internal(LOG_DS_QUOTA, dd->dd_pool->dp_spa, - tx, "%lld dataset = %llu ", - (longlong_t)effective_value, dd->dd_phys->dd_head_dataset_obj); } int @@ -1177,10 +1173,6 @@ dsl_dir_set_reservation_sync(void *arg1, delta, 0, 0, tx); } mutex_exit(&dd->dd_lock); - - spa_history_log_internal(LOG_DS_RESERVATION, dd->dd_pool->dp_spa, - tx, "%lld dataset = %llu", - (longlong_t)effective_value, dd->dd_phys->dd_head_dataset_obj); } int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Tue Aug 28 12:25:37 2012 (r239774) @@ -151,8 +151,6 @@ dsl_pool_open(dsl_pool_t *dp) dsl_dataset_t *ds; uint64_t obj; - ASSERT(!dmu_objset_is_dirty_anywhere(dp->dp_meta_objset)); - rw_enter(&dp->dp_config_rwlock, RW_WRITER); err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_ROOT_DATASET, sizeof (uint64_t), 1, @@ -209,6 +207,15 @@ dsl_pool_open(dsl_pool_t *dp) goto out; } + if (spa_feature_is_active(dp->dp_spa, + &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ])) { + err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, + DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, + &dp->dp_empty_bpobj); + if (err != 0) + goto out; + } + err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_TMP_USERREFS, sizeof (uint64_t), 1, &dp->dp_tmp_userrefs_obj); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h Tue Aug 28 12:25:37 2012 (r239774) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_BPOBJ_H @@ -67,7 +68,9 @@ typedef struct bpobj { typedef int bpobj_itor_t(void *arg, const blkptr_t *bp, dmu_tx_t *tx); uint64_t bpobj_alloc(objset_t *mos, int blocksize, dmu_tx_t *tx); +uint64_t bpobj_alloc_empty(objset_t *os, int blocksize, dmu_tx_t *tx); void bpobj_free(objset_t *os, uint64_t obj, dmu_tx_t *tx); +void bpobj_decr_empty(objset_t *os, dmu_tx_t *tx); int bpobj_open(bpobj_t *bpo, objset_t *mos, uint64_t object); void bpobj_close(bpobj_t *bpo); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Tue Aug 28 12:25:37 2012 (r239774) @@ -314,6 +314,7 @@ typedef void dmu_buf_evict_func_t(struct #define DMU_POOL_SCAN "scan" #define DMU_POOL_FREE_BPOBJ "free_bpobj" #define DMU_POOL_BPTREE_OBJ "bptree_obj" +#define DMU_POOL_EMPTY_BPOBJ "empty_bpobj" /* * Allocate an object from this objset. The range of object numbers Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Tue Aug 28 12:25:37 2012 (r239774) @@ -161,7 +161,6 @@ timestruc_t dmu_objset_snap_cmtime(objse /* called from dsl */ void dmu_objset_sync(objset_t *os, zio_t *zio, dmu_tx_t *tx); boolean_t dmu_objset_is_dirty(objset_t *os, uint64_t txg); -boolean_t dmu_objset_is_dirty_anywhere(objset_t *os); objset_t *dmu_objset_create_impl(spa_t *spa, struct dsl_dataset *ds, blkptr_t *bp, dmu_objset_type_t type, dmu_tx_t *tx); int dmu_objset_open_impl(spa_t *spa, struct dsl_dataset *ds, blkptr_t *bp, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Aug 28 12:25:37 2012 (r239774) @@ -271,6 +271,7 @@ int dsl_dataset_space_written(dsl_datase uint64_t *usedp, uint64_t *compp, uint64_t *uncompp); int dsl_dataset_space_wouldfree(dsl_dataset_t *firstsnap, dsl_dataset_t *last, uint64_t *usedp, uint64_t *compp, uint64_t *uncompp); +boolean_t dsl_dataset_is_dirty(dsl_dataset_t *ds); int dsl_dsobj_to_dsname(char *pname, uint64_t obj, char *buf); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Tue Aug 28 12:25:37 2012 (r239774) @@ -88,6 +88,7 @@ typedef struct dsl_pool { uint64_t dp_tmp_userrefs_obj; bpobj_t dp_free_bpobj; uint64_t dp_bptree_obj; + uint64_t dp_empty_bpobj; struct dsl_scan *dp_scan; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Tue Aug 28 12:25:37 2012 (r239774) @@ -300,6 +300,8 @@ int zap_increment_int(objset_t *os, uint /* Here the key is an int and the value is a different int. */ int zap_add_int_key(objset_t *os, uint64_t obj, uint64_t key, uint64_t value, dmu_tx_t *tx); +int zap_update_int_key(objset_t *os, uint64_t obj, + uint64_t key, uint64_t value, dmu_tx_t *tx); int zap_lookup_int_key(objset_t *os, uint64_t obj, uint64_t key, uint64_t *valuep); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Tue Aug 28 12:25:37 2012 (r239774) @@ -1094,6 +1094,16 @@ zap_add_int_key(objset_t *os, uint64_t o } int +zap_update_int_key(objset_t *os, uint64_t obj, + uint64_t key, uint64_t value, dmu_tx_t *tx) +{ + char name[20]; + + (void) snprintf(name, sizeof (name), "%llx", (longlong_t)key); + return (zap_update(os, obj, name, 8, 1, &value, tx)); +} + +int zap_lookup_int_key(objset_t *os, uint64_t obj, uint64_t key, uint64_t *valuep) { char name[20]; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Tue Aug 28 12:25:37 2012 (r239774) @@ -221,7 +221,12 @@ feature_get_refcount(objset_t *os, uint6 uint64_t refcount; uint64_t zapobj = feature->fi_can_readonly ? write_obj : read_obj; - ASSERT(0 != zapobj); + /* + * If the pool is currently being created, the feature objects may not + * have been allocated yet. Act as though all features are disabled. + */ + if (zapobj == 0) + return (ENOTSUP); err = zap_lookup(os, zapobj, feature->fi_guid, sizeof (uint64_t), 1, &refcount); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Tue Aug 28 12:25:37 2012 (r239774) @@ -1839,9 +1839,9 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea /* * Evict cached data */ - if (dmu_objset_is_dirty_anywhere(zfsvfs->z_os)) - if (!(zfsvfs->z_vfs->vfs_flag & VFS_RDONLY)) - txg_wait_synced(dmu_objset_pool(zfsvfs->z_os), 0); + if (dsl_dataset_is_dirty(dmu_objset_ds(zfsvfs->z_os)) && + !(zfsvfs->z_vfs->vfs_flag & VFS_RDONLY)) + txg_wait_synced(dmu_objset_pool(zfsvfs->z_os), 0); (void) dmu_objset_evict_dbufs(zfsvfs->z_os); return (0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Aug 28 12:19:14 2012 (r239773) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Aug 28 12:25:37 2012 (r239774) @@ -671,8 +671,18 @@ zvol_last_close(zvol_state_t *zv) { zil_close(zv->zv_zilog); zv->zv_zilog = NULL; + dmu_buf_rele(zv->zv_dbuf, zvol_tag); zv->zv_dbuf = NULL; + + /* + * Evict cached data + */ + if (dsl_dataset_is_dirty(dmu_objset_ds(zv->zv_objset)) && + !(zv->zv_flags & ZVOL_RDONLY)) + txg_wait_synced(dmu_objset_pool(zv->zv_objset), 0); + (void) dmu_objset_evict_dbufs(zv->zv_objset); + dmu_objset_disown(zv->zv_objset, zvol_tag); zv->zv_objset = NULL; } From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 12:33:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDFD1106564A; Tue, 28 Aug 2012 12:33:54 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8F148FC1C; Tue, 28 Aug 2012 12:33: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 q7SCXsDN067845; Tue, 28 Aug 2012 12:33:54 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SCXskC067843; Tue, 28 Aug 2012 12:33:54 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201208281233.q7SCXskC067843@svn.freebsd.org> From: Isabell Long Date: Tue, 28 Aug 2012 12:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239775 - head/sbin/ipf/ipf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 12:33:55 -0000 Author: issyl0 (doc committer) Date: Tue Aug 28 12:33:54 2012 New Revision: 239775 URL: http://svn.freebsd.org/changeset/base/239775 Log: Link ipfilter(4) and ipfilter(5) to the build to stop the wrong man page displaying for 'man 4 ipfilter'. PR: docs/118020 Approved by: gjb (mentor) MFC after: 5 days Modified: head/sbin/ipf/ipf/Makefile Modified: head/sbin/ipf/ipf/Makefile ============================================================================== --- head/sbin/ipf/ipf/Makefile Tue Aug 28 12:25:37 2012 (r239774) +++ head/sbin/ipf/ipf/Makefile Tue Aug 28 12:33:54 2012 (r239775) @@ -2,8 +2,8 @@ PROG= ipf SRCS= ${GENHDRS} ipf.c ipfcomp.c ipf_y.c ipf_l.c bpf_filter.c -MAN= ipf.8 ipf.4 ipf.5 ipl.4 -MLINKS= ipl.4 ipfilter.4 ipf.5 ipf.conf.5 ipf.5 ipf6.conf.5 +MAN= ipfilter.4 ipfilter.5 ipf.8 ipf.4 ipf.5 ipl.4 +MLINKS= ipf.5 ipf.conf.5 ipf.5 ipf6.conf.5 CFLAGS+= -I. -DIPFILTER_BPF GENHDRS= ipf_l.h ipf_y.h From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 13:35:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E69A1065670; Tue, 28 Aug 2012 13:35:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 391F08FC14; Tue, 28 Aug 2012 13:35: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 q7SDZci1075480; Tue, 28 Aug 2012 13:35:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SDZchp075478; Tue, 28 Aug 2012 13:35:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208281335.q7SDZchp075478@svn.freebsd.org> From: John Baldwin Date: Tue, 28 Aug 2012 13:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239779 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 13:35:38 -0000 Author: jhb Date: Tue Aug 28 13:35:37 2012 New Revision: 239779 URL: http://svn.freebsd.org/changeset/base/239779 Log: Shorten the name of the fast SWI taskqueue to "fast taskq" so that it fits. Reported by: lev MFC after: 1 week Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Tue Aug 28 12:56:35 2012 (r239778) +++ head/sys/kern/subr_taskqueue.c Tue Aug 28 13:35:37 2012 (r239779) @@ -565,7 +565,7 @@ taskqueue_fast_run(void *dummy) } TASKQUEUE_FAST_DEFINE(fast, taskqueue_fast_enqueue, NULL, - swi_add(NULL, "Fast task queue", taskqueue_fast_run, NULL, + swi_add(NULL, "fast taskq", taskqueue_fast_run, NULL, SWI_TQ_FAST, INTR_MPSAFE, &taskqueue_fast_ih)); int From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 14:19:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2133E106566C; Tue, 28 Aug 2012 14:19:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BF4E8FC0A; Tue, 28 Aug 2012 14:19: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 q7SEJAOD080322; Tue, 28 Aug 2012 14:19:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SEJAc6080320; Tue, 28 Aug 2012 14:19:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208281419.q7SEJAc6080320@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Aug 2012 14:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239780 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 14:19:11 -0000 Author: imp Date: Tue Aug 28 14:19:10 2012 New Revision: 239780 URL: http://svn.freebsd.org/changeset/base/239780 Log: Clip the upper end to 31MHz for slow clock speeds. On faster machines, we wind up with a 66MHz clock, which is too fast. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Tue Aug 28 13:35:37 2012 (r239779) +++ head/sys/arm/at91/at91_mci.c Tue Aug 28 14:19:10 2012 (r239780) @@ -557,10 +557,10 @@ at91_mci_update_ios(device_t brdev, devi * Calculate our closest available clock speed that doesn't exceed the * requested speed. * - * If the master clock is greater than 50MHz and the requested bus - * speed is 25mhz and the use_30mhz flag is on, set clkdiv to zero to - * get a master_clock / 2 (25-30MHz) MMC/SD clock rather than settle for - * the next lower click (12-15MHz). See comments near the top of the + * If the master clock is 50MHz-62MHz and the requested bus speed is + * 25mhz and the use_30mhz flag is on, set clkdiv to zero to get a + * master_clock / 2 (25-31MHz) MMC/SD clock rather than settle for the + * next lower click (12.5-15.5MHz). See comments near the top of the * file for more info. * * Whatever we come up with, store it back into ios->clock so that the @@ -572,7 +572,8 @@ at91_mci_update_ios(device_t brdev, devi } else { WR4(sc, MCI_CR, MCI_CR_MCIEN|MCI_CR_PWSEN); if (sc->use_30mhz && ios->clock == 25000000 && - at91_master_clock > 50000000) + at91_master_clock > 50000000 && + at91_master_clock < 62000000) clkdiv = 0; else if ((at91_master_clock % (ios->clock * 2)) == 0) clkdiv = ((at91_master_clock / ios->clock) / 2) - 1; From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 14:20:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F5341065687; Tue, 28 Aug 2012 14:20:42 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58B3A8FC12; Tue, 28 Aug 2012 14:20: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 q7SEKgYf080520; Tue, 28 Aug 2012 14:20:42 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SEKgLL080518; Tue, 28 Aug 2012 14:20:42 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201208281420.q7SEKgLL080518@svn.freebsd.org> From: Brooks Davis Date: Tue, 28 Aug 2012 14:20: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: r239781 - head/sbin/gvinum X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 14:20:42 -0000 Author: brooks Date: Tue Aug 28 14:20:41 2012 New Revision: 239781 URL: http://svn.freebsd.org/changeset/base/239781 Log: Don't overwrite the global default CFLAGS when setting include paths. MFC after: 3 days Modified: head/sbin/gvinum/Makefile Modified: head/sbin/gvinum/Makefile ============================================================================== --- head/sbin/gvinum/Makefile Tue Aug 28 14:19:10 2012 (r239780) +++ head/sbin/gvinum/Makefile Tue Aug 28 14:20:41 2012 (r239781) @@ -5,7 +5,7 @@ SRCS= gvinum.c gvinum.h geom_vinum_share MAN= gvinum.8 WARNS?= 2 -CFLAGS= -I${.CURDIR}/../../sys -I${DESTDIR}/${INCLUDEDIR}/edit +CFLAGS+= -I${.CURDIR}/../../sys -I${DESTDIR}/${INCLUDEDIR}/edit DPADD= ${LIBEDIT} ${LIBTERMCAP} ${LIBDEVSTAT} ${LIBKVM} ${LIBGEOM} LDADD= -ledit -ltermcap -ldevstat -lkvm -lgeom From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 17:27:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88CBC106566B; Tue, 28 Aug 2012 17:27:47 +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 71D798FC25; Tue, 28 Aug 2012 17:27: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 q7SHRlJK002219; Tue, 28 Aug 2012 17:27:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SHRlAh002217; Tue, 28 Aug 2012 17:27:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208281727.q7SHRlAh002217@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Aug 2012 17:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239785 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 17:27:47 -0000 Author: imp Date: Tue Aug 28 17:27:46 2012 New Revision: 239785 URL: http://svn.freebsd.org/changeset/base/239785 Log: Make AT91_MCI_ALLOW_OVERCLOCK a real option. Rename old use 30MHz to this new option. Only try to use > 25MHz when our best frequency is < 15MHz and overclocking is enabled. Fix minor style chaff. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Tue Aug 28 17:09:34 2012 (r239784) +++ head/sys/arm/at91/at91_mci.c Tue Aug 28 17:27:46 2012 (r239785) @@ -68,50 +68,51 @@ __FBSDID("$FreeBSD$"); #include "opt_at91.h" /* - * About running the MCI bus at 30mhz... + * About running the MCI bus above 25MHz * - * Historically, the MCI bus has been run at 30mhz on systems with a 60mhz - * master clock, due to a bug in the mantissa table in dev/mmc.c making it - * appear that the card's max speed was always 30mhz. Fixing that bug causes - * the mmc driver to request a 25mhz clock (as it should) and the logic in - * at91_mci_update_ios() picks the highest speed that doesn't exceed that limit. - * With a 60mhz MCK that would be 15mhz, and that's a real performance buzzkill - * when you've been getting away with 30mhz all along. + * Historically, the MCI bus has been run at 30MHz on systems with a 60MHz + * master clock, in part due to a bug in dev/mmc.c making always request + * 30MHz, and in part over clocking the bus because 15MHz was too slow. + * Fixing that bug causes the mmc driver to request a 25MHz clock (as it + * should) and the logic in at91_mci_update_ios() picks the highest speed that + * doesn't exceed that limit. With a 60MHz MCK that would be 15MHz, and + * that's a real performance buzzkill when you've been getting away with 30MHz + * all along. * - * By defining AT91_MCI_USE_30MHZ (or setting the 30mhz=1 device hint or - * sysctl) you can enable logic in at91_mci_update_ios() to overlcock the SD - * bus a little by running it at MCK / 2 when MCK is between greater than - * 50MHz and the requested speed is 25mhz. This appears to work on virtually - * all SD cards, since it is what this driver has been doing prior to the - * introduction of this option, where the overclocking vs underclocking - * decision was automaticly "overclock". Modern SD cards can run at - * 45mhz/1-bit in standard mode (high speed mode enable commands not sent) - * without problems. + * By defining AT91_MCI_ALLOW_OVERCLOCK (or setting the allow_overclock=1 + * device hint or sysctl) you can enable logic in at91_mci_update_ios() to + * overlcock the SD bus a little by running it at MCK / 2 when the requested + * speed is 25MHz and the next highest speed is 15MHz or less. This appears + * to work on virtually all SD cards, since it is what this driver has been + * doing prior to the introduction of this option, where the overclocking vs + * underclocking decision was automaticly "overclock". Modern SD cards can + * run at 45mhz/1-bit in standard mode (high speed mode enable commands not + * sent) without problems. * * Speaking of high-speed mode, the rm9200 manual says the MCI device supports - * the SD v1.0 specification and can run up to 50mhz. This is interesting in - * that the SD v1.0 spec caps the speed at 25mhz; high speed mode was added in + * the SD v1.0 specification and can run up to 50MHz. This is interesting in + * that the SD v1.0 spec caps the speed at 25MHz; high speed mode was added in * the v1.10 spec. Furthermore, high speed mode doesn't just crank up the * clock, it alters the signal timing. The rm9200 MCI device doesn't support - * these altered timings. So while speeds over 25mhz may work, they only work + * these altered timings. So while speeds over 25MHz may work, they only work * in what the SD spec calls "default" speed mode, and it amounts to violating * the spec by overclocking the bus. * - * If you also enable 4-wire mode it's possible the 30mhz transfers will fail. - * On the AT91RM9200, due to bugs in the bus contention logic, if you have the - * USB host device and OHCI driver enabled will fail. Even underclocking to - * 15MHz, intermittant overrun and underrun errors occur. Note that you don't - * even need to have usb devices attached to the system, the errors begin to - * occur as soon as the OHCI driver sets the register bit to enable periodic - * transfers. It appears (based on brief investigation) that the usb host - * controller uses so much ASB bandwidth that sometimes the DMA for MCI - * transfers doesn't get a bus grant in time and data gets dropped. Adding - * even a modicum of network activity changes the symptom from intermittant to - * very frequent. Members of the AT91SAM9 family have corrected this problem, or - * are at least better about their use of the bus. + * If you also enable 4-wire mode it's possible transfers faster than 25MHz + * will fail. On the AT91RM9200, due to bugs in the bus contention logic, if + * you have the USB host device and OHCI driver enabled will fail. Even + * underclocking to 15MHz, intermittant overrun and underrun errors occur. + * Note that you don't even need to have usb devices attached to the system, + * the errors begin to occur as soon as the OHCI driver sets the register bit + * to enable periodic transfers. It appears (based on brief investigation) + * that the usb host controller uses so much ASB bandwidth that sometimes the + * DMA for MCI transfers doesn't get a bus grant in time and data gets + * dropped. Adding even a modicum of network activity changes the symptom + * from intermittant to very frequent. Members of the AT91SAM9 family have + * corrected this problem, or are at least better about their use of the bus. */ -#ifndef AT91_MCI_USE_30MHZ -#define AT91_MCI_USE_30MHZ 1 +#ifndef AT91_MCI_ALLOW_OVERCLOCK +#define AT91_MCI_ALLOW_OVERCLOCK 1 #endif /* @@ -146,7 +147,7 @@ struct at91_mci_softc { #define CMD_MULTIREAD 0x10 #define CMD_MULTIWRITE 0x20 int has_4wire; - int use_30mhz; + int allow_overclock; struct resource *irq_res; /* IRQ resource */ struct resource *mem_res; /* Memory resource */ struct mtx sc_mtx; @@ -194,7 +195,7 @@ WR4(struct at91_mci_softc *sc, bus_size_ bus_write_4(sc->mem_res, off, val); } -static void +static void at91_bswap_buf(struct at91_mci_softc *sc, void * dptr, void * sptr, uint32_t memsize) { uint32_t * dst = (uint32_t *)dptr; @@ -315,7 +316,7 @@ at91_mci_init(device_t dev) WR4(sc, MCI_SDCR, 0); /* SLOT A, 1 bit bus */ #else /* - * XXX Really should add second "unit" but nobody using using + * XXX Really should add second "unit" but nobody using using * a two slot card that we know of. XXX */ WR4(sc, MCI_SDCR, 1); /* SLOT B, 1 bit bus */ @@ -385,7 +386,7 @@ at91_mci_attach(device_t dev) * byte-swapping with the DMA operations. */ err = bus_dma_tag_create(bus_get_dma_tag(dev), 4096, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, BBSIZE, 1, BBSIZE, 0, NULL, NULL, &sc->dmatag); if (err != 0) goto out; @@ -421,36 +422,35 @@ at91_mci_attach(device_t dev) #if defined(AT91_MCI_HAS_4WIRE) && AT91_MCI_HAS_4WIRE != 0 sc->has_4wire = 1; #endif - resource_int_value(device_get_name(dev), device_get_unit(dev), + resource_int_value(device_get_name(dev), device_get_unit(dev), "4wire", &sc->has_4wire); SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "4wire", CTLFLAG_RW, &sc->has_4wire, 0, "has 4 wire SD Card bus"); if (sc->has_4wire) sc->sc_cap |= CAP_HAS_4WIRE; -#if defined(AT91_MCI_USE_30MHZ) && AT91_MCI_USE_30MHZ != 0 - sc->use_30mhz = 1; -#endif - resource_int_value(device_get_name(dev), device_get_unit(dev), - "30mhz", &sc->use_30mhz); - SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "30mhz", - CTLFLAG_RW, &sc->use_30mhz, 0, "use 30mhz clock for 25mhz request"); + sc->allow_overclock = AT91_MCI_ALLOW_OVERCLOCK; + resource_int_value(device_get_name(dev), device_get_unit(dev), + "allow_overclock", &sc->allow_overclock); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "allow_overclock", + CTLFLAG_RW, &sc->allow_overclock, 0, + "Allow up to 30MHz clock for 25MHz request when next highest speed 15MHz or less."); /* * Our real min freq is master_clock/512, but upper driver layers are * going to set the min speed during card discovery, and the right speed - * for that is 400khz, so advertise a safe value just under that. + * for that is 400kHz, so advertise a safe value just under that. * * For max speed, while the rm9200 manual says the max is 50mhz, it also * says it supports only the SD v1.0 spec, which means the real limit is * 25mhz. On the other hand, historical use has been to slightly violate - * the standard by running the bus at 30mhz. For more information on + * the standard by running the bus at 30MHz. For more information on * that, see the comments at the top of this file. */ sc->host.f_min = 375000; sc->host.f_max = at91_master_clock / 2; - if (sc->host.f_max > 25000000) - sc->host.f_max = 25000000; /* Limit to 25MHz */ + if (sc->host.f_max > 25000000) + sc->host.f_max = 25000000; sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; sc->host.caps = 0; if (sc->sc_cap & CAP_HAS_4WIRE) @@ -549,6 +549,7 @@ at91_mci_update_ios(device_t brdev, devi struct at91_mci_softc *sc; struct mmc_ios *ios; uint32_t clkdiv; + uint32_t freq; sc = device_get_softc(brdev); ios = &sc->host.ios; @@ -557,11 +558,10 @@ at91_mci_update_ios(device_t brdev, devi * Calculate our closest available clock speed that doesn't exceed the * requested speed. * - * If the master clock is 50MHz-62MHz and the requested bus speed is - * 25mhz and the use_30mhz flag is on, set clkdiv to zero to get a - * master_clock / 2 (25-31MHz) MMC/SD clock rather than settle for the - * next lower click (12.5-15.5MHz). See comments near the top of the - * file for more info. + * When overclocking is allowed, the requested clock is 25MHz, the + * computed frequency is 15MHz or smaller and clockdiv is 1, use + * clockdiv of 0 to double that. If less than 12.5MHz, double + * regardless of the overclocking setting. * * Whatever we come up with, store it back into ios->clock so that the * upper layer drivers can report the actual speed of the bus. @@ -571,15 +571,18 @@ at91_mci_update_ios(device_t brdev, devi clkdiv = 0; } else { WR4(sc, MCI_CR, MCI_CR_MCIEN|MCI_CR_PWSEN); - if (sc->use_30mhz && ios->clock == 25000000 && - at91_master_clock > 50000000 && - at91_master_clock < 62000000) - clkdiv = 0; - else if ((at91_master_clock % (ios->clock * 2)) == 0) + if ((at91_master_clock % (ios->clock * 2)) == 0) clkdiv = ((at91_master_clock / ios->clock) / 2) - 1; else clkdiv = (at91_master_clock / ios->clock) / 2; - ios->clock = at91_master_clock / ((clkdiv+1) * 2); + freq = at91_master_clock / ((clkdiv+1) * 2); + if (clkdiv == 1 && ios->clock == 25000000 && freq <= 15000000) { + if (sc->allow_overclock || freq <= 12500000) { + clkdiv = 0; + freq = at91_master_clock / ((clkdiv+1) * 2); + } + } + ios->clock = freq; } if (ios->bus_width == bus_width_4) WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) | MCI_SDCR_SDCBUS); @@ -636,8 +639,8 @@ at91_mci_start_cmd(struct at91_mci_softc */ if (data == NULL) { - uint32_t ier = MCI_SR_CMDRDY | - MCI_SR_RTOE | MCI_SR_RENDE | + uint32_t ier = MCI_SR_CMDRDY | + MCI_SR_RTOE | MCI_SR_RENDE | MCI_SR_RCRCE | MCI_SR_RDIRE | MCI_SR_RINDE; at91_mci_pdc_disable(sc); @@ -652,7 +655,7 @@ at91_mci_start_cmd(struct at91_mci_softc ier &= ~MCI_SR_RCRCE; if (mci_debug) - printf("CMDR %x (opcode %d) ARGR %x no data\n", + printf("CMDR %x (opcode %d) ARGR %x no data\n", cmdr, cmd->opcode, cmd->arg); WR4(sc, MCI_ARGR, cmd->arg); @@ -674,8 +677,8 @@ at91_mci_start_cmd(struct at91_mci_softc cmdr |= MCI_CMDR_TRTYP_STREAM; else if (data->flags & MMC_DATA_MULTI) { cmdr |= MCI_CMDR_TRTYP_MULTIPLE; - sc->flags |= (data->flags & MMC_DATA_READ) ? - CMD_MULTIREAD : CMD_MULTIWRITE; + sc->flags |= (data->flags & MMC_DATA_READ) ? + CMD_MULTIREAD : CMD_MULTIWRITE; } /* @@ -687,10 +690,10 @@ at91_mci_start_cmd(struct at91_mci_softc * smaller blocks are possible, but never larger. */ - WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); + WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); - mr = RD4(sc,MCI_MR) & ~MCI_MR_BLKLEN; - mr |= min(data->len, 512) << 16; + mr = RD4(sc,MCI_MR) & ~MCI_MR_BLKLEN; + mr |= min(data->len, 512) << 16; WR4(sc, MCI_MR, mr | MCI_MR_PDCMODE|MCI_MR_PDCPADV); /* @@ -740,12 +743,12 @@ at91_mci_start_cmd(struct at91_mci_softc len = remaining / 2; else len = remaining; - err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], - sc->bbuf_vaddr[0], len, at91_mci_getaddr, + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], + sc->bbuf_vaddr[0], len, at91_mci_getaddr, &paddr, BUS_DMA_NOWAIT); if (err != 0) panic("IO read dmamap_load failed\n"); - bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], BUS_DMASYNC_PREREAD); WR4(sc, PDC_RPR, paddr); WR4(sc, PDC_RCR, len / 4); @@ -755,12 +758,12 @@ at91_mci_start_cmd(struct at91_mci_softc sc->bbuf_len[1] = 0; } else { len = remaining; - err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[1], - sc->bbuf_vaddr[1], len, at91_mci_getaddr, + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[1], + sc->bbuf_vaddr[1], len, at91_mci_getaddr, &paddr, BUS_DMA_NOWAIT); if (err != 0) panic("IO read dmamap_load failed\n"); - bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], BUS_DMASYNC_PREREAD); WR4(sc, PDC_RNPR, paddr); WR4(sc, PDC_RNCR, len / 4); @@ -780,12 +783,12 @@ at91_mci_start_cmd(struct at91_mci_softc memset(data->data, 0, 12); } at91_bswap_buf(sc, sc->bbuf_vaddr[0], data->data, len); - err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], - sc->bbuf_vaddr[0], len, at91_mci_getaddr, + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], + sc->bbuf_vaddr[0], len, at91_mci_getaddr, &paddr, BUS_DMA_NOWAIT); if (err != 0) panic("IO write dmamap_load failed\n"); - bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], BUS_DMASYNC_PREWRITE); WR4(sc, PDC_TPR,paddr); WR4(sc, PDC_TCR, len / 4); @@ -797,12 +800,12 @@ at91_mci_start_cmd(struct at91_mci_softc len = remaining; at91_bswap_buf(sc, sc->bbuf_vaddr[1], ((char *)data->data)+BBSIZE, len); - err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[1], - sc->bbuf_vaddr[1], len, at91_mci_getaddr, + err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[1], + sc->bbuf_vaddr[1], len, at91_mci_getaddr, &paddr, BUS_DMA_NOWAIT); if (err != 0) panic("IO write dmamap_load failed\n"); - bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], + bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], BUS_DMASYNC_PREWRITE); WR4(sc, PDC_TNPR, paddr); WR4(sc, PDC_TNCR, len / 4); @@ -815,7 +818,7 @@ at91_mci_start_cmd(struct at91_mci_softc } if (mci_debug) - printf("CMDR %x (opcode %d) ARGR %x with data len %d\n", + printf("CMDR %x (opcode %d) ARGR %x with data len %d\n", cmdr, cmd->opcode, cmd->arg, cmd->data->len); WR4(sc, MCI_ARGR, cmd->arg); @@ -1006,7 +1009,7 @@ at91_mci_stop_done(struct at91_mci_softc /* * This is known to be true of at91rm9200 hardware; it may or may not - * apply to more recent chips: + * apply to more recent chips: * * After stopping a multi-block write, the NOTBUSY bit in MCI_SR does * not properly reflect the actual busy state of the card as signaled @@ -1193,10 +1196,10 @@ at91_mci_intr(void *arg) * helpful. XXX bootverbose? */ if (cmd->opcode != 8) { - device_printf(sc->dev, - "IO error; status MCI_SR = 0x%x cmd opcode = %d%s\n", + device_printf(sc->dev, + "IO error; status MCI_SR = 0x%x cmd opcode = %d%s\n", sr, cmd->opcode, - (cmd->opcode != 12) ? "" : + (cmd->opcode != 12) ? "" : (sc->flags & CMD_MULTIREAD) ? " after read" : " after write"); at91_mci_reset(sc); } From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 18:16:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 664) id 09999106566C; Tue, 28 Aug 2012 18:16:09 +0000 (UTC) Date: Tue, 28 Aug 2012 11:16:08 -0700 From: David O'Brien To: Dag-Erling =?unknown-8bit?Q?Sm=F8rgrav?= Message-ID: <20120828181607.GA56329@dragon.NUXI.org> References: <201208271322.q7RDMSEw002945@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201208271322.q7RDMSEw002945@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239730 - head/sys/i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 18:16:09 -0000 On Mon, Aug 27, 2012 at 01:22:28PM +0000, Dag-Erling Smrgrav wrote: > Author: des > Date: Mon Aug 27 13:22:27 2012 > New Revision: 239730 > URL: http://svn.freebsd.org/changeset/base/239730 > > Log: > Parly revert r239255: reinstate a default maxswzone on i386, where KVA is > scarce, but set it slightly higher so we can handle 8 GB of swap. Thank you for dealing with this issue. I had a diff addressing this I had prepared but had yet to send to alc for review. The comment below says to me the target swap size is 16GB, not 8GB. >From recent 10-CURRENT experience where I hit the VM_SWZONE_SIZE_MAX limit many times I think shooting for 16GB is more realistic with today's desktop application mix. Or at least 12GB if KVA usage for supporting 16GB is a concern. All it took to hit this was a 2GB tmpfs and running two web browsers with many tabs open. > + * 276 is sizeof(struct swblock), but we do not always have a definition > + * in scope for struct swblock, so we have to hardcode it. Each struct > + * swblock holds metadata for 32 pages, so in theory, this is enough for > + * 16 GB of swap. In practice, however, the usable amount is considerably > + * lower due to fragmentation. The old definition from r102738 (dillon 2002-08-31) was "32 * 1024 * 1024" or 32MB. This allowed for 7GB of swap from a 16GB swap partition, per top(8)'s "Swap total" reporting of swap usage when I would get kernel: swap zone exhausted, increase kern.maxswzone kernel: pid 81073 (firefox-bin), uid 1765, was killed: out of swap space every couple of days. > +#define VM_SWZONE_SIZE_MAX (276 * 128 * 1024) Will 34.5MB, really allow 16GB swap? On the machine you tested this on, what did top(8) report when the swap partition was say 20GB? thanks, -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 18:33:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07AB9106566C; Tue, 28 Aug 2012 18:33:13 +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 CD53F8FC08; Tue, 28 Aug 2012 18:33: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 q7SIXCMS009591; Tue, 28 Aug 2012 18:33:12 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SIXClS009589; Tue, 28 Aug 2012 18:33:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208281833.q7SIXClS009589@svn.freebsd.org> From: Ed Schouten Date: Tue, 28 Aug 2012 18:33: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: r239786 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 18:33:13 -0000 Author: ed Date: Tue Aug 28 18:33:12 2012 New Revision: 239786 URL: http://svn.freebsd.org/changeset/base/239786 Log: Use a proper destructor function. When calling a revoke(2) on a dtrace device, dtrace_close() could be called, even if threads are still stuck in the device. Defer the actual deallocation of datastructures to the cdevpriv destructor. While there, remove the unneeded D_TRACKCLOSE and D_NEEDMINOR flags. For the helper device, we never need it. For the regular dtrace devices, we only need these flags on FreeBSD pre-8. MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 28 17:27:46 2012 (r239785) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 28 18:33:12 2012 (r239786) @@ -15342,10 +15342,7 @@ dtrace_attach(dev_info_t *devi, ddi_atta #if !defined(sun) #if __FreeBSD_version >= 800039 -static void -dtrace_dtr(void *data __unused) -{ -} +static void dtrace_dtr(void *); #endif #endif @@ -15470,11 +15467,15 @@ dtrace_open(struct cdev *dev, int oflags } /*ARGSUSED*/ -static int #if defined(sun) +static int dtrace_close(dev_t dev, int flag, int otyp, cred_t *cred_p) -#else +#elif __FreeBSD_version < 800039 +static int dtrace_close(struct cdev *dev, int flags, int fmt __unused, struct thread *td) +#else +static void +dtrace_dtr(void *data) #endif { #if defined(sun) @@ -15493,8 +15494,7 @@ dtrace_close(struct cdev *dev, int flags if (dev2unit(dev) == 0) return (0); #else - dtrace_state_t *state; - devfs_get_cdevpriv((void **) &state); + dtrace_state_t *state = data; #endif #endif @@ -15537,7 +15537,9 @@ dtrace_close(struct cdev *dev, int flags destroy_dev_sched(dev); #endif +#if defined(sun) || __FreeBSD_version < 800039 return (0); +#endif } #if defined(sun) @@ -16584,8 +16586,10 @@ void dtrace_invop_uninit(void); static struct cdevsw dtrace_cdevsw = { .d_version = D_VERSION, +#if __FreeBSD_version < 800039 .d_flags = D_TRACKCLOSE | D_NEEDMINOR, .d_close = dtrace_close, +#endif .d_ioctl = dtrace_ioctl, .d_open = dtrace_open, .d_name = "dtrace", @@ -16593,7 +16597,6 @@ static struct cdevsw dtrace_cdevsw = { static struct cdevsw helper_cdevsw = { .d_version = D_VERSION, - .d_flags = D_TRACKCLOSE | D_NEEDMINOR, .d_ioctl = dtrace_ioctl_helper, .d_name = "helper", }; From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 19:28:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB6F106566C; Tue, 28 Aug 2012 19:28: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 95CB08FC16; Tue, 28 Aug 2012 19:28: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 q7SJSWPb018100; Tue, 28 Aug 2012 19:28:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SJSWeg018090; Tue, 28 Aug 2012 19:28:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208281928.q7SJSWeg018090@svn.freebsd.org> From: Ed Schouten Date: Tue, 28 Aug 2012 19:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239790 - in head/sys/geom: . bde part uncompress uzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 19:28:32 -0000 Author: ed Date: Tue Aug 28 19:28:31 2012 New Revision: 239790 URL: http://svn.freebsd.org/changeset/base/239790 Log: Remove unneeded G_PF_CANDELETE flag. This flag is only used by GEOM so it can be propagated to the character device's SI_CANDELETE. Unfortunately, SI_CANDELETE seems to do nothing. Modified: head/sys/geom/bde/g_bde.c head/sys/geom/geom.h head/sys/geom/geom_dev.c head/sys/geom/geom_disk.c head/sys/geom/geom_slice.c head/sys/geom/geom_subr.c head/sys/geom/part/g_part.c head/sys/geom/uncompress/g_uncompress.c head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/bde/g_bde.c ============================================================================== --- head/sys/geom/bde/g_bde.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/bde/g_bde.c Tue Aug 28 19:28:31 2012 (r239790) @@ -185,14 +185,6 @@ g_bde_create_geom(struct gctl_req *req, kproc_create(g_bde_worker, gp, &sc->thread, 0, 0, "g_bde %s", gp->name); pp = g_new_providerf(gp, gp->name); -#if 0 - /* - * XXX: Disable this for now. Appearantly UFS no longer - * XXX: issues BIO_DELETE requests correctly, with the obvious - * XXX: outcome that userdata is trashed. - */ - pp->flags |= G_PF_CANDELETE; -#endif pp->stripesize = kp->zone_cont; pp->stripeoffset = 0; pp->mediasize = sc->mediasize; Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/geom.h Tue Aug 28 19:28:31 2012 (r239790) @@ -203,7 +203,6 @@ struct g_provider { struct devstat *stat; u_int nstart, nend; u_int flags; -#define G_PF_CANDELETE 0x1 #define G_PF_WITHER 0x2 #define G_PF_ORPHAN 0x4 Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/geom_dev.c Tue Aug 28 19:28:31 2012 (r239790) @@ -208,15 +208,11 @@ g_dev_taste(struct g_class *mp, struct g } } - if (pp->flags & G_PF_CANDELETE) - dev->si_flags |= SI_CANDELETE; dev->si_iosize_max = MAXPHYS; gp->softc = dev; dev->si_drv1 = gp; dev->si_drv2 = cp; if (adev != NULL) { - if (pp->flags & G_PF_CANDELETE) - adev->si_flags |= SI_CANDELETE; adev->si_iosize_max = MAXPHYS; adev->si_drv1 = gp; adev->si_drv2 = cp; Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/geom_disk.c Tue Aug 28 19:28:31 2012 (r239790) @@ -162,10 +162,6 @@ g_disk_access(struct g_provider *pp, int } pp->mediasize = dp->d_mediasize; pp->sectorsize = dp->d_sectorsize; - if (dp->d_flags & DISKFLAG_CANDELETE) - pp->flags |= G_PF_CANDELETE; - else - pp->flags &= ~G_PF_CANDELETE; pp->stripeoffset = dp->d_stripeoffset; pp->stripesize = dp->d_stripesize; dp->d_flags |= DISKFLAG_OPEN; @@ -487,8 +483,6 @@ g_disk_create(void *arg, int flag) pp = g_new_providerf(gp, "%s", gp->name); pp->mediasize = dp->d_mediasize; pp->sectorsize = dp->d_sectorsize; - if (dp->d_flags & DISKFLAG_CANDELETE) - pp->flags |= G_PF_CANDELETE; pp->stripeoffset = dp->d_stripeoffset; pp->stripesize = dp->d_stripesize; if (bootverbose) Modified: head/sys/geom/geom_slice.c ============================================================================== --- head/sys/geom/geom_slice.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/geom_slice.c Tue Aug 28 19:28:31 2012 (r239790) @@ -392,7 +392,6 @@ g_slice_config(struct g_geom *gp, u_int sbuf_finish(sb); pp = g_new_providerf(gp, sbuf_data(sb)); pp2 = LIST_FIRST(&gp->consumer)->provider; - pp->flags = pp2->flags & G_PF_CANDELETE; pp->stripesize = pp2->stripesize; pp->stripeoffset = pp2->stripeoffset + offset; if (pp->stripesize > 0) Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/geom_subr.c Tue Aug 28 19:28:31 2012 (r239790) @@ -1261,7 +1261,6 @@ provider_flags_to_string(struct g_provid strlcpy(str, "NONE", size); return (str); } - ADDFLAG(pp, G_PF_CANDELETE, "G_PF_CANDELETE"); ADDFLAG(pp, G_PF_WITHER, "G_PF_WITHER"); ADDFLAG(pp, G_PF_ORPHAN, "G_PF_ORPHAN"); return (str); Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/part/g_part.c Tue Aug 28 19:28:31 2012 (r239790) @@ -423,7 +423,6 @@ g_part_new_provider(struct g_geom *gp, s pp->sectorsize; entry->gpe_pp->mediasize -= entry->gpe_offset - offset; entry->gpe_pp->sectorsize = pp->sectorsize; - entry->gpe_pp->flags = pp->flags & G_PF_CANDELETE; entry->gpe_pp->stripesize = pp->stripesize; entry->gpe_pp->stripeoffset = pp->stripeoffset + entry->gpe_offset; if (pp->stripesize > 0) Modified: head/sys/geom/uncompress/g_uncompress.c ============================================================================== --- head/sys/geom/uncompress/g_uncompress.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/uncompress/g_uncompress.c Tue Aug 28 19:28:31 2012 (r239790) @@ -594,7 +594,6 @@ g_uncompress_taste(struct g_class *mp, s pp2 = g_new_providerf(gp, "%s", gp->name); pp2->sectorsize = 512; pp2->mediasize = (off_t)sc->nblocks * sc->blksz; - pp2->flags = pp->flags & G_PF_CANDELETE; if (pp->stripesize > 0) { pp2->stripesize = pp->stripesize; pp2->stripeoffset = pp->stripeoffset; Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Tue Aug 28 19:23:04 2012 (r239789) +++ head/sys/geom/uzip/g_uzip.c Tue Aug 28 19:28:31 2012 (r239790) @@ -467,7 +467,6 @@ g_uzip_taste(struct g_class *mp, struct pp2 = g_new_providerf(gp, "%s", gp->name); pp2->sectorsize = 512; pp2->mediasize = (off_t)sc->nblocks * sc->blksz; - pp2->flags = pp->flags & G_PF_CANDELETE; pp2->stripesize = pp->stripesize; pp2->stripeoffset = pp->stripeoffset; g_error_provider(pp2, 0); From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 19:30:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 098E31065673; Tue, 28 Aug 2012 19:30:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E96518FC18; Tue, 28 Aug 2012 19:30: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 q7SJUTVL018345; Tue, 28 Aug 2012 19:30:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SJUTXY018342; Tue, 28 Aug 2012 19:30:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208281930.q7SJUTXY018342@svn.freebsd.org> From: Ed Schouten Date: Tue, 28 Aug 2012 19:30: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: r239791 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 19:30:30 -0000 Author: ed Date: Tue Aug 28 19:30:29 2012 New Revision: 239791 URL: http://svn.freebsd.org/changeset/base/239791 Log: Remove unused SI_* flags. The SI_DEVOPEN, SI_CONSOPEN and SI_CANDELETE flags are not used by any piece of code in the tree. Modified: head/sys/kern/kern_conf.c head/sys/sys/conf.h Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Tue Aug 28 19:28:31 2012 (r239790) +++ head/sys/kern/kern_conf.c Tue Aug 28 19:30:29 2012 (r239791) @@ -1431,10 +1431,7 @@ DB_SHOW_COMMAND(cdev, db_show_cdev) SI_FLAG(SI_NAMED); SI_FLAG(SI_CHEAPCLONE); SI_FLAG(SI_CHILD); - SI_FLAG(SI_DEVOPEN); - SI_FLAG(SI_CONSOPEN); SI_FLAG(SI_DUMPDEV); - SI_FLAG(SI_CANDELETE); SI_FLAG(SI_CLONELIST); db_printf("si_flags %s\n", buf); Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Tue Aug 28 19:28:31 2012 (r239790) +++ head/sys/sys/conf.h Tue Aug 28 19:30:29 2012 (r239791) @@ -59,10 +59,7 @@ struct cdev { #define SI_NAMED 0x0004 /* make_dev{_alias} has been called */ #define SI_CHEAPCLONE 0x0008 /* can be removed_dev'ed when vnode reclaims */ #define SI_CHILD 0x0010 /* child of another struct cdev **/ -#define SI_DEVOPEN 0x0020 /* opened by device */ -#define SI_CONSOPEN 0x0040 /* opened by console */ #define SI_DUMPDEV 0x0080 /* is kernel dumpdev */ -#define SI_CANDELETE 0x0100 /* can do BIO_DELETE */ #define SI_CLONELIST 0x0200 /* on a clone list */ struct timespec si_atime; struct timespec si_ctime; From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 22:17:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B720A1065680; Tue, 28 Aug 2012 22:17:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2F778FC0C; Tue, 28 Aug 2012 22:17: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 q7SMHMUI037959; Tue, 28 Aug 2012 22:17:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SMHMOP037957; Tue, 28 Aug 2012 22:17:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208282217.q7SMHMOP037957@svn.freebsd.org> From: Adrian Chadd Date: Tue, 28 Aug 2012 22:17: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: r239794 - head/sys/dev/flash X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 22:17:22 -0000 Author: adrian Date: Tue Aug 28 22:17:22 2012 New Revision: 239794 URL: http://svn.freebsd.org/changeset/base/239794 Log: Add a new flash part - 4MB SPI flash from Winbond. Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Tue Aug 28 19:37:54 2012 (r239793) +++ head/sys/dev/flash/mx25l.c Tue Aug 28 22:17:22 2012 (r239794) @@ -104,6 +104,7 @@ struct mx25l_flash_ident flash_devices[] { "s25s1032", 0x01, 0x0215, 64 * 1024, 64, FL_NONE }, { "s25sl064a", 0x01, 0x0216, 64 * 1024, 128, FL_NONE }, { "w25q64bv", 0xef, 0x4017, 64 * 1024, 128, FL_ERASE_4K }, + { "w25x32", 0xef, 0x3016, 64 * 1024, 64, FL_ERASE_4K }, }; static uint8_t From owner-svn-src-head@FreeBSD.ORG Tue Aug 28 22:50:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD224106566B; Tue, 28 Aug 2012 22:50:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C88588FC16; Tue, 28 Aug 2012 22:50: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 q7SMolME041664; Tue, 28 Aug 2012 22:50:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7SMolaK041662; Tue, 28 Aug 2012 22:50:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208282250.q7SMolaK041662@svn.freebsd.org> From: Adrian Chadd Date: Tue, 28 Aug 2012 22:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239795 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 22:50:48 -0000 Author: adrian Date: Tue Aug 28 22:50:47 2012 New Revision: 239795 URL: http://svn.freebsd.org/changeset/base/239795 Log: * Don't compile in sysctl descriptions * random is fine as a module Modified: head/sys/mips/conf/AR724X_BASE Modified: head/sys/mips/conf/AR724X_BASE ============================================================================== --- head/sys/mips/conf/AR724X_BASE Tue Aug 28 22:17:22 2012 (r239794) +++ head/sys/mips/conf/AR724X_BASE Tue Aug 28 22:50:47 2012 (r239795) @@ -50,6 +50,9 @@ options DEBUG_MEMGUARD options SCSI_NO_SENSE_STRINGS options SCSI_NO_OP_STRINGS +# .. And no sysctl strings +options NO_SYSCTL_DESCR + options FFS #Berkeley Fast Filesystem # options SOFTUPDATES #Enable FFS soft updates support # options UFS_ACL #Support for access control lists @@ -117,7 +120,7 @@ device loop device ether device md device bpf -device random +#device random #device if_bridge #device gif # ip[46] in ip[46] tunneling protocol #device gre # generic encapsulation - only for IPv4 in IPv4 though atm From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 00:53:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE59F1065679; Wed, 29 Aug 2012 00:53:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8BDC8FC1E; Wed, 29 Aug 2012 00:53: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 q7T0rfGa055973; Wed, 29 Aug 2012 00:53:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T0rfCi055971; Wed, 29 Aug 2012 00:53:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290053.q7T0rfCi055971@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 00:53: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: r239796 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 00:53:41 -0000 Author: adrian Date: Wed Aug 29 00:53:41 2012 New Revision: 239796 URL: http://svn.freebsd.org/changeset/base/239796 Log: Remove extra debugging - there's no longer any need. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Tue Aug 28 22:50:47 2012 (r239795) +++ head/sys/dev/ath/if_ath_rx.c Wed Aug 29 00:53:41 2012 (r239796) @@ -1093,8 +1093,6 @@ void ath_recv_setup_legacy(struct ath_softc *sc) { - device_printf(sc->sc_dev, "DMA setup: legacy\n"); - /* Sensible legacy defaults */ sc->sc_rx_statuslen = 0; From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 00:53:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF76D10657DA; Wed, 29 Aug 2012 00:53:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A8248FC0A; Wed, 29 Aug 2012 00:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T0rwbX056035; Wed, 29 Aug 2012 00:53:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T0rwCZ056033; Wed, 29 Aug 2012 00:53:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290053.q7T0rwCZ056033@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 00:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239797 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 00:53:58 -0000 Author: adrian Date: Wed Aug 29 00:53:58 2012 New Revision: 239797 URL: http://svn.freebsd.org/changeset/base/239797 Log: Remove - not needed. Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Wed Aug 29 00:53:41 2012 (r239796) +++ head/sys/dev/ath/if_ath_rx_edma.c Wed Aug 29 00:53:58 2012 (r239797) @@ -817,8 +817,6 @@ void ath_recv_setup_edma(struct ath_softc *sc) { - device_printf(sc->sc_dev, "DMA setup: EDMA\n"); - /* Set buffer size to 4k */ sc->sc_edma_bufsize = 4096; From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 01:08:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A25106564A; Wed, 29 Aug 2012 01:08: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 9A2678FC0A; Wed, 29 Aug 2012 01: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 q7T18agA057897; Wed, 29 Aug 2012 01:08:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T18aLc057894; Wed, 29 Aug 2012 01:08:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290108.q7T18aLc057894@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 01:08: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: r239799 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 01:08:36 -0000 Author: adrian Date: Wed Aug 29 01:08:36 2012 New Revision: 239799 URL: http://svn.freebsd.org/changeset/base/239799 Log: Bring over a configuration for the Atheros AP91 reference board. This has an AR7240 SoC with an AR9285 wireless NIC on-board. Since the kernel partition on the 4MiB flash is 960KiB, quite a bit is disabled to try and squeeze the build into that. Even lzma'ed, it's still quite large. Added: head/sys/mips/conf/AP91 (contents, props changed) head/sys/mips/conf/AP91.hints (contents, props changed) Added: head/sys/mips/conf/AP91 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AP91 Wed Aug 29 01:08:36 2012 (r239799) @@ -0,0 +1,64 @@ +# +# Specific board setup for the Atheros AP91 reference board. +# +# The AP91 has the following hardware: +# +# + AR7241 CPU SoC +# + AR9287 Wifi +# + Integrated switch (XXX speed?) +# + 4MB flash +# + 16MB RAM +# + uboot environment + +# $FreeBSD$ + +include "AR724X_BASE" +ident "AP91" +hints "AP91.hints" + +options AR71XX_REALMEM=16*1024*1024 + +options AR71XX_ENV_UBOOT + +# Limit inlines +makeoptions INLINE_LIMIT=768 + +# We bite the performance overhead for now; the kernel won't +# fit if the mutexes are inlined. +options MUTEX_NOINLINE +options RWLOCK_NOINLINE +options SX_NOINLINE + +# There's no need to enable swapping on this platform. +options NO_SWAPPING + +# For DOS - enable if required +# options MSDOSFS + +# uncompress - to boot read-only lzma natively from flash +device geom_uncompress +options GEOM_UNCOMPRESS +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" + +# Not enough space for these.. +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions DEBUG_REDZONE +nooptions DEBUG_MEMGUARD + +# Used for the static uboot partition map +device geom_map + +# Options needed for the EEPROM based calibration/PCI configuration data. +options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash +options ATH_EEPROM_FIRMWARE # Use EEPROM from flash +device firmware # Used by the above + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous + +device etherswitch +device arswitch Added: head/sys/mips/conf/AP91.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AP91.hints Wed Aug 29 01:08:36 2012 (r239799) @@ -0,0 +1,103 @@ +# $FreeBSD$ + +# arge0 MDIO bus +hint.argemdio.0.at="nexus0" +hint.argemdio.0.maddr=0x19000000 +hint.argemdio.0.msize=0x1000 +hint.argemdio.0.order=0 + +# arge1 MDIO bus doesn't exist on the AR7240 + +# arge0: MII; dedicated PHY 4 on switch, connected via internal switch +# MDIO bus. + +hint.arge.0.at="nexus0" +hint.arge.0.maddr=0x19000000 +hint.arge.0.msize=0x1000 +hint.arge.0.irq=2 +# hint.arge.0.eeprommac=0x83fe9ff0 +hint.arge.0.phymask=0x10 # PHY 4 +# hint.arge.0.miimode=2 # MII +hint.arge.0.mdio=mdioproxy1 # Hanging off the arswitch MDIO bus + +# arge1: connected to the LAN switch MAC, at 1000BaseTX / GMII. + +hint.arge.1.phymask=0x0 +# hint.arge.1.miimode=1 # GMII +hint.arge.1.media=1000 # Force to 1000BaseTX/full +hint.arge.1.fduplex=1 + +# +# AR7240 switch config +# +hint.arswitch.0.is_7240=1 # We need to be explicitly told this +hint.arswitch.0.numphys=4 # 4 active switch PHYs (PHY 0 -> 3) +hint.arswitch.0.phy4cpu=1 # Yes, PHY 4 == dedicated PHY +hint.arswitch.0.is_rgmii=0 # No, not RGMII +hint.arswitch.0.is_gmii=0 # No, not GMII + +# ath0 hint - pcie slot 0 +hint.pcib.0.bus.0.0.0.ath_fixup_addr=0x1fff1000 +hint.pcib.0.bus.0.0.0.ath_fixup_size=4096 + +# ath +hint.ath.0.eeprom_firmware="pcib.0.bus.0.0.0.eeprom_firmware" + +# Signal leds +hint.gpioled.0.at="gpiobus0" +hint.gpioled.0.name="sig1" +hint.gpioled.0.pins=0x0001 # pin 0 +hint.gpioled.1.at="gpiobus0" +hint.gpioled.1.name="sig2" +hint.gpioled.1.pins=0x0002 # pin 1 +hint.gpioled.2.at="gpiobus0" +hint.gpioled.2.name="sig3" +hint.gpioled.2.pins=0x0800 # pin 11 +hint.gpioled.3.at="gpiobus0" +hint.gpioled.3.name="sig4" +hint.gpioled.3.pins=0x0080 # pin 7 + +# nvram mapping - XXX ? +hint.nvram.0.base=0x1f030000 +hint.nvram.0.maxsize=0x2000 +hint.nvram.0.flags=3 # 1 = No check, 2 = Format Generic +hint.nvram.1.base=0x1f032000 +hint.nvram.1.maxsize=0x4000 +hint.nvram.1.flags=3 # 1 = No check, 2 = Format Generic + +# GEOM_MAP +# +# From my AP91 environment: +# +# mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),2752k(rootfs), +# 960k(uImage),64k(ART) + +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x00040000 # 256k u-boot +hint.map.0.name="u-boot" +hint.map.0.readonly=1 + +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00040000 +hint.map.1.end=0x00050000 # 64k u-boot-env +hint.map.1.name="u-boot-env" +hint.map.1.readonly=0 + +hint.map.2.at="flash/spi0" +hint.map.2.start=0x00050000 +hint.map.2.end=0x00300000 # 2752k rootfs +hint.map.2.name="rootfs" +hint.map.2.readonly=1 + +hint.map.3.at="flash/spi0" +hint.map.3.start=0x00300000 +hint.map.3.end=0x003f0000 # 896k uImage +hint.map.3.name="uImage" +hint.map.3.readonly=1 + +hint.map.4.at="flash/spi0" +hint.map.4.start=0x003f0000 +hint.map.4.end=0x00400000 # 64k ART +hint.map.4.name="ART" +hint.map.4.readonly=1 From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 03:50:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5E5C1065674; Wed, 29 Aug 2012 03:50:59 +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 C19568FC14; Wed, 29 Aug 2012 03:50: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 q7T3oxoF077771; Wed, 29 Aug 2012 03:50:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T3ox8L077769; Wed, 29 Aug 2012 03:50:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290350.q7T3ox8L077769@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 03:50: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: r239800 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 03:51:00 -0000 Author: adrian Date: Wed Aug 29 03:50:59 2012 New Revision: 239800 URL: http://svn.freebsd.org/changeset/base/239800 Log: Add a (temporarily located) definition. Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Wed Aug 29 01:08:36 2012 (r239799) +++ head/sys/dev/ath/ath_hal/ah_internal.h Wed Aug 29 03:50:59 2012 (r239800) @@ -79,6 +79,11 @@ typedef enum { } HAL_PHYDIAG_CAPS; /* + * Enable/disable strong signal fast diversity + */ +#define HAL_CAP_STRONG_DIV 2 + +/* * Each chip or class of chips registers to offer support. */ struct ath_hal_chip { From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 03:58:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2D1AC106564A; Wed, 29 Aug 2012 03:58:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 176058FC12; Wed, 29 Aug 2012 03:58: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 q7T3wD0x078655; Wed, 29 Aug 2012 03:58:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T3wDqW078652; Wed, 29 Aug 2012 03:58:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290358.q7T3wDqW078652@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 03:58: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: r239801 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 03:58:14 -0000 Author: adrian Date: Wed Aug 29 03:58:13 2012 New Revision: 239801 URL: http://svn.freebsd.org/changeset/base/239801 Log: Add AR5413 radar parameters and strong signal diversity capability. This is a re-implementation based on the reference carrier code for the AR5413. Tested: * Pulse detection for AR5212 and AR5413, to ensure the correct behaviour for both chips PR: kern/170904 Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c head/sys/dev/ath/ath_hal/ar5212/ar5212phy.h Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Wed Aug 29 03:50:59 2012 (r239800) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Wed Aug 29 03:58:13 2012 (r239801) @@ -843,6 +843,10 @@ ar5212GetCapability(struct ath_hal *ah, return HAL_OK; case 1: /* current setting */ return ahp->ah_diversity ? HAL_OK : HAL_ENXIO; + case HAL_CAP_STRONG_DIV: + *result = OS_REG_READ(ah, AR_PHY_RESTART); + *result = MS(*result, AR_PHY_RESTART_DIV_GC); + return HAL_OK; } return HAL_EINVAL; case HAL_CAP_DIAG: @@ -950,16 +954,34 @@ ar5212SetCapability(struct ath_hal *ah, OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp->ah_miscMode); return AH_TRUE; case HAL_CAP_DIVERSITY: - if (ahp->ah_phyPowerOn) { - v = OS_REG_READ(ah, AR_PHY_CCK_DETECT); - if (setting) - v |= AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; - else - v &= ~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; - OS_REG_WRITE(ah, AR_PHY_CCK_DETECT, v); + switch (capability) { + case 0: + return AH_FALSE; + case 1: /* setting */ + if (ahp->ah_phyPowerOn) { + if (capability == HAL_CAP_STRONG_DIV) { + } + v = OS_REG_READ(ah, AR_PHY_CCK_DETECT); + if (setting) + v |= AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; + else + v &= ~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; + OS_REG_WRITE(ah, AR_PHY_CCK_DETECT, v); + } + ahp->ah_diversity = (setting != 0); + return AH_TRUE; + + case HAL_CAP_STRONG_DIV: + if (! ahp->ah_phyPowerOn) + return AH_FALSE; + v = OS_REG_READ(ah, AR_PHY_RESTART); + v &= ~AR_PHY_RESTART_DIV_GC; + v |= SM(setting, AR_PHY_RESTART_DIV_GC); + OS_REG_WRITE(ah, AR_PHY_RESTART, v); + return AH_TRUE; + default: + return AH_FALSE; } - ahp->ah_diversity = (setting != 0); - return AH_TRUE; case HAL_CAP_DIAG: /* hardware diagnostic support */ /* * NB: could split this up into virtual capabilities, @@ -1165,14 +1187,61 @@ ar5212EnableDfs(struct ath_hal *ah, HAL_ else val &= ~ AR_PHY_RADAR_0_ENA; + if (IS_5413(ah)) { + + if (pe->pe_blockradar == 1) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_BLOCKOFDMWEAK); + else + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_BLOCKOFDMWEAK); + + if (pe->pe_en_relstep_check == 1) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_ENRELSTEPCHK); + else + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_ENRELSTEPCHK); + + if (pe->pe_usefir128 == 1) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_USEFIR128); + else + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_USEFIR128); + + if (pe->pe_enmaxrssi == 1) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_ENMAXRSSI); + else + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_ENMAXRSSI); + + if (pe->pe_enrelpwr == 1) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_ENRELPWRCHK); + else + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_ENRELPWRCHK); + + if (pe->pe_relpwr != HAL_PHYERR_PARAM_NOVAL) + OS_REG_RMW_FIELD(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_RELPWR, pe->pe_relpwr); + + if (pe->pe_relstep != HAL_PHYERR_PARAM_NOVAL) + OS_REG_RMW_FIELD(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_RELSTEP, pe->pe_relstep); + + if (pe->pe_maxlen != HAL_PHYERR_PARAM_NOVAL) + OS_REG_RMW_FIELD(ah, AR_PHY_RADAR_2, + AR_PHY_RADAR_2_MAXLEN, pe->pe_maxlen); + } + OS_REG_WRITE(ah, AR_PHY_RADAR_0, val); } /* * Parameters for the AR5212 PHY. - * - * TODO: figure out what values were added for the AR5413 and later - * PHY; update these here. */ #define AR5212_DFS_FIRPWR -41 #define AR5212_DFS_RRSSI 12 @@ -1180,19 +1249,52 @@ ar5212EnableDfs(struct ath_hal *ah, HAL_ #define AR5212_DFS_PRSSI 22 #define AR5212_DFS_INBAND 6 +/* + * Default parameters for the AR5413 PHY. + */ +#define AR5413_DFS_FIRPWR -34 +#define AR5413_DFS_RRSSI 20 +#define AR5413_DFS_HEIGHT 10 +#define AR5413_DFS_PRSSI 15 +#define AR5413_DFS_INBAND 6 +#define AR5413_DFS_RELPWR 8 +#define AR5413_DFS_RELSTEP 31 +#define AR5413_DFS_MAXLEN 255 + + HAL_BOOL ar5212GetDfsDefaultThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) { - pe->pe_firpwr = AR5212_DFS_FIRPWR; - pe->pe_rrssi = AR5212_DFS_RRSSI; - pe->pe_height = AR5212_DFS_HEIGHT; - pe->pe_prssi = AR5212_DFS_PRSSI; - pe->pe_inband = AR5212_DFS_INBAND; - /* XXX look up what is needed for the AR5413 */ - pe->pe_relpwr = 0; - pe->pe_relstep = 0; - pe->pe_maxlen = 0; + if (IS_5413(ah)) { + pe->pe_firpwr = AR5413_DFS_FIRPWR; + pe->pe_rrssi = AR5413_DFS_RRSSI; + pe->pe_height = AR5413_DFS_HEIGHT; + pe->pe_prssi = AR5413_DFS_PRSSI; + pe->pe_inband = AR5413_DFS_INBAND; + pe->pe_relpwr = AR5413_DFS_RELPWR; + pe->pe_relstep = AR5413_DFS_RELSTEP; + pe->pe_maxlen = AR5413_DFS_MAXLEN; + pe->pe_usefir128 = 0; + pe->pe_blockradar = 1; + pe->pe_enmaxrssi = 1; + pe->pe_enrelpwr = 1; + pe->pe_en_relstep_check = 0; + } else { + pe->pe_firpwr = AR5212_DFS_FIRPWR; + pe->pe_rrssi = AR5212_DFS_RRSSI; + pe->pe_height = AR5212_DFS_HEIGHT; + pe->pe_prssi = AR5212_DFS_PRSSI; + pe->pe_inband = AR5212_DFS_INBAND; + pe->pe_relpwr = 0; + pe->pe_relstep = 0; + pe->pe_maxlen = 0; + pe->pe_usefir128 = 0; + pe->pe_blockradar = 0; + pe->pe_enmaxrssi = 0; + pe->pe_enrelpwr = 0; + pe->pe_en_relstep_check = 0; + } return (AH_TRUE); } @@ -1216,7 +1318,26 @@ ar5212GetDfsThresh(struct ath_hal *ah, H pe->pe_relpwr = 0; pe->pe_relstep = 0; pe->pe_maxlen = 0; + pe->pe_usefir128 = 0; + pe->pe_blockradar = 0; + pe->pe_enmaxrssi = 0; + pe->pe_enrelpwr = 0; + pe->pe_en_relstep_check = 0; pe->pe_extchannel = AH_FALSE; + + if (IS_5413(ah)) { + val = OS_REG_READ(ah, AR_PHY_RADAR_2); + pe->pe_relpwr = !! MS(val, AR_PHY_RADAR_2_RELPWR); + pe->pe_relstep = !! MS(val, AR_PHY_RADAR_2_RELSTEP); + pe->pe_maxlen = !! MS(val, AR_PHY_RADAR_2_MAXLEN); + + pe->pe_usefir128 = !! (val & AR_PHY_RADAR_2_USEFIR128); + pe->pe_blockradar = !! (val & AR_PHY_RADAR_2_BLOCKOFDMWEAK); + pe->pe_enmaxrssi = !! (val & AR_PHY_RADAR_2_ENMAXRSSI); + pe->pe_enrelpwr = !! (val & AR_PHY_RADAR_2_ENRELPWRCHK); + pe->pe_en_relstep_check = + !! (val & AR_PHY_RADAR_2_ENRELSTEPCHK); + } } /* Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212phy.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212phy.h Wed Aug 29 03:50:59 2012 (r239800) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212phy.h Wed Aug 29 03:58:13 2012 (r239801) @@ -221,6 +221,19 @@ #define AR_PHY_RADAR_0_FIRPWR 0x7F000000 /* Radar firpwr threshold */ #define AR_PHY_RADAR_0_FIRPWR_S 24 +/* ar5413 specific */ +#define AR_PHY_RADAR_2 0x9958 /* radar detection settings */ +#define AR_PHY_RADAR_2_ENRELSTEPCHK 0x00002000 /* Enable using max rssi */ +#define AR_PHY_RADAR_2_ENMAXRSSI 0x00004000 /* Enable using max rssi */ +#define AR_PHY_RADAR_2_BLOCKOFDMWEAK 0x00008000 /* En block OFDM weak sig as radar */ +#define AR_PHY_RADAR_2_USEFIR128 0x00400000 /* En measuring pwr over 128 cycles */ +#define AR_PHY_RADAR_2_ENRELPWRCHK 0x00800000 /* Enable using max rssi */ +#define AR_PHY_RADAR_2_MAXLEN 0x000000FF /* Max Pulse duration threshold */ +#define AR_PHY_RADAR_2_MAXLEN_S 0 +#define AR_PHY_RADAR_2_RELSTEP 0x00001F00 /* Pulse relative step threshold */ +#define AR_PHY_RADAR_2_RELSTEP_S 8 +#define AR_PHY_RADAR_2_RELPWR 0x003F0000 /* pulse relative power threshold */ +#define AR_PHY_RADAR_2_RELPWR_S 16 #define AR_PHY_SIGMA_DELTA 0x996C /* AR5312 only */ #define AR_PHY_SIGMA_DELTA_ADC_SEL 0x00000003 From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 04:09:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3BC21065674; Wed, 29 Aug 2012 04:09:54 +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 CF17C8FC1F; Wed, 29 Aug 2012 04:09: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 q7T49sC1080008; Wed, 29 Aug 2012 04:09:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T49s4V080006; Wed, 29 Aug 2012 04:09:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290409.q7T49s4V080006@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 04:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239802 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 04:09:55 -0000 Author: adrian Date: Wed Aug 29 04:09:54 2012 New Revision: 239802 URL: http://svn.freebsd.org/changeset/base/239802 Log: Add a new capability bit - whether the hardware supports AR9285 style combined diversity. Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Wed Aug 29 03:58:13 2012 (r239801) +++ head/sys/dev/ath/ath_hal/ah_internal.h Wed Aug 29 04:09:54 2012 (r239802) @@ -234,7 +234,8 @@ typedef struct { uint32_t halIsrRacSupport : 1, halApmEnable : 1, halIntrMitigation : 1, - hal49GhzSupport : 1; + hal49GhzSupport : 1, + halAntDivCombSupport : 1; uint32_t halWirelessModes; uint16_t halTotalQueues; From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 04:11:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD63E1065678; Wed, 29 Aug 2012 04:11:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A781F8FC1A; Wed, 29 Aug 2012 04:11:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7T4B0gp080189; Wed, 29 Aug 2012 04:11:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T4B0bM080187; Wed, 29 Aug 2012 04:11:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208290411.q7T4B0bM080187@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 04:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239803 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 04:11:01 -0000 Author: adrian Date: Wed Aug 29 04:11:00 2012 New Revision: 239803 URL: http://svn.freebsd.org/changeset/base/239803 Log: Set the HAL combined antenna diversity capability if the AR9285 EEPROM settings allow it. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Wed Aug 29 04:09:54 2012 (r239802) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Wed Aug 29 04:11:00 2012 (r239803) @@ -504,6 +504,9 @@ ar9285FillCapabilityInfo(struct ath_hal pCap->halTxStreams = 1; pCap->halRxStreams = 1; + if (ar9285_check_div_comb(ah)) + pCap->halAntDivCombSupport = AH_TRUE; + pCap->halCSTSupport = AH_TRUE; pCap->halRifsRxSupport = AH_TRUE; pCap->halRifsTxSupport = AH_TRUE; From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 04:41:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ADF1D106566B; Wed, 29 Aug 2012 04:41:25 +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 98FF58FC08; Wed, 29 Aug 2012 04:41: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 q7T4fPTA083964; Wed, 29 Aug 2012 04:41:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T4fPVX083962; Wed, 29 Aug 2012 04:41:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208290441.q7T4fPVX083962@svn.freebsd.org> From: Warner Losh Date: Wed, 29 Aug 2012 04:41: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: r239804 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 04:41:25 -0000 Author: imp Date: Wed Aug 29 04:41:25 2012 New Revision: 239804 URL: http://svn.freebsd.org/changeset/base/239804 Log: When copying data, use memcpy instead of bcopy. It matches the arguments better. Also, set the need to use the workaround flag before we actually need to use it, rather than after. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Wed Aug 29 04:11:00 2012 (r239803) +++ head/sys/arm/at91/at91_mci.c Wed Aug 29 04:41:25 2012 (r239804) @@ -211,7 +211,7 @@ at91_bswap_buf(struct at91_mci_softc *sc * ansley.com) */ if (!(sc->sc_cap & CAP_NEEDS_BYTESWAP)) { - bcopy(dptr, sptr, memsize); + memcpy(dptr, sptr, memsize); return; } @@ -364,6 +364,12 @@ at91_mci_attach(device_t dev) sc->sc_cap = 0; if (at91_is_rm92()) sc->sc_cap |= CAP_NEEDS_BYTESWAP; + /* + * MCI1 Rev 2 controllers need some workarounds, flag if so. + */ + if (at91_mci_is_mci1rev2xx()) + sc->sc_cap |= CAP_MCI1_REV2XX; + err = at91_mci_activate(dev); if (err) goto out; @@ -409,12 +415,6 @@ at91_mci_attach(device_t dev) } /* - * MCI1 Rev 2 controllers need some workarounds, flag if so. - */ - if (at91_mci_is_mci1rev2xx()) - sc->sc_cap |= CAP_MCI1_REV2XX; - - /* * Allow 4-wire to be initially set via #define. * Allow a device hint to override that. * Allow a sysctl to override that. From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 06:42:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 22695106566C; Wed, 29 Aug 2012 06:42:40 +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 0D5A68FC14; Wed, 29 Aug 2012 06:42: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 q7T6gd5C098834; Wed, 29 Aug 2012 06:42:39 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T6gdmK098832; Wed, 29 Aug 2012 06:42:39 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208290642.q7T6gdmK098832@svn.freebsd.org> From: Warner Losh Date: Wed, 29 Aug 2012 06:42: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: r239805 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 06:42:40 -0000 Author: imp Date: Wed Aug 29 06:42:39 2012 New Revision: 239805 URL: http://svn.freebsd.org/changeset/base/239805 Log: Make this work on the AT91SAM9G20: o Disable multi-block operations: they sometimes fail. o Don't use the PROOF bits yet: they hang the system hard. o Disable the the multi-block operations for !rm9200, but it still doesn't help. o Fix writing < 12 bytes errata to actually work. o Enable, for the moment, reporting extra bytes soaked up. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Wed Aug 29 04:41:25 2012 (r239804) +++ head/sys/arm/at91/at91_mci.c Wed Aug 29 06:42:39 2012 (r239805) @@ -309,8 +309,8 @@ at91_mci_init(device_t dev) WR4(sc, MCI_DTOR, MCI_DTOR_DTOMUL_1M | 1); val = MCI_MR_PDCMODE; val |= 0x34a; /* PWSDIV = 3; CLKDIV = 74 */ - if (sc->sc_cap & CAP_MCI1_REV2XX) - val |= MCI_MR_RDPROOF | MCI_MR_WRPROOF; +// if (sc->sc_cap & CAP_MCI1_REV2XX) +// val |= MCI_MR_RDPROOF | MCI_MR_WRPROOF; WR4(sc, MCI_MR, val); #ifndef AT91_MCI_SLOT_B WR4(sc, MCI_SDCR, 0); /* SLOT A, 1 bit bus */ @@ -778,9 +778,9 @@ at91_mci_start_cmd(struct at91_mci_softc * a work-around for the "Data Write Operation and * number of bytes" erratum. */ - if ((sc->sc_cap & CAP_MCI1_REV2XX) && data->len < 12) { + if ((sc->sc_cap & CAP_MCI1_REV2XX) && len < 12) { len = 12; - memset(data->data, 0, 12); + memset(sc->bbuf_vaddr[0], 0, 12); } at91_bswap_buf(sc, sc->bbuf_vaddr[0], data->data, len); err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], @@ -1034,8 +1034,11 @@ at91_mci_stop_done(struct at91_mci_softc * * After doing the reset, wait for a NOTBUSY interrupt before * continuing with the next operation. + * + * This workaround breaks multiwrite on the rev2xx parts, but some other + * workaround is needed. */ - if (sc->flags & CMD_MULTIWRITE) { + if ((sc->flags & CMD_MULTIWRITE) && (sc->sc_cap & CAP_NEEDS_BYTESWAP)) { at91_mci_reset(sc); WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_NOTBUSY); return; @@ -1051,8 +1054,10 @@ at91_mci_stop_done(struct at91_mci_softc * additional words of data get buffered up in some unmentioned * internal fifo and if we don't read and discard them here they end * up on the front of the next read DMA transfer we do. + * + * This appears to be unnecessary for rev2xx parts. */ - if (sc->flags & CMD_MULTIREAD) { + if ((sc->flags & CMD_MULTIREAD) && (sc->sc_cap & CAP_NEEDS_BYTESWAP)) { uint32_t sr; int count = 0; @@ -1064,8 +1069,8 @@ at91_mci_stop_done(struct at91_mci_softc } } while (sr & MCI_SR_RXRDY); at91_mci_reset(sc); -// if (count != 0) -// printf("Had to soak up %d words after read\n", count); + if (count != 0) + printf("Had to soak up %d words after read\n", count); } cmd->error = MMC_ERR_NONE; @@ -1306,7 +1311,15 @@ at91_mci_read_ivar(device_t bus, device_ *(int *)result = sc->host.caps; break; case MMCBR_IVAR_MAX_DATA: - *(int *)result = MAX_BLOCKS; + /* + * Something is wrong with the 2x parts and multiblock, so + * just do 1 block at a time for now, which really kills + * performance. + */ + if (sc->sc_cap & CAP_MCI1_REV2XX) + *(int *)result = 1; + else + *(int *)result = MAX_BLOCKS; break; } return (0); From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 06:43:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6127A106566C; Wed, 29 Aug 2012 06:43: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 331C38FC21; Wed, 29 Aug 2012 06:43: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 q7T6hT9D098958; Wed, 29 Aug 2012 06:43:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T6hTI5098956; Wed, 29 Aug 2012 06:43:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201208290643.q7T6hTI5098956@svn.freebsd.org> From: Warner Losh Date: Wed, 29 Aug 2012 06:43: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: r239806 - head/sys/arm/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 06:43:29 -0000 Author: imp Date: Wed Aug 29 06:43:28 2012 New Revision: 239806 URL: http://svn.freebsd.org/changeset/base/239806 Log: 4-wire mode isn't working quite right, so turn it off for a bit. Modified: head/sys/arm/conf/SAM9G20EK Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Wed Aug 29 06:42:39 2012 (r239805) +++ head/sys/arm/conf/SAM9G20EK Wed Aug 29 06:43:28 2012 (r239806) @@ -105,7 +105,7 @@ device at91_mci device mmc device mmcsd option AT91_MCI_SLOT_B -option AT91_MCI_HAS_4WIRE +#option AT91_MCI_HAS_4WIRE # iic device iic From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 09:37:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A8051065708; Wed, 29 Aug 2012 09:37:01 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 077C28FC1B; Wed, 29 Aug 2012 09:37:00 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 69B8E6771; Wed, 29 Aug 2012 11:36:54 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 3A2158253; Wed, 29 Aug 2012 11:36:54 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: obrien@freebsd.org References: <201208271322.q7RDMSEw002945@svn.freebsd.org> <20120828181607.GA56329@dragon.NUXI.org> Date: Wed, 29 Aug 2012 11:36:53 +0200 In-Reply-To: <20120828181607.GA56329@dragon.NUXI.org> (David O'Brien's message of "Tue, 28 Aug 2012 11:16:08 -0700") Message-ID: <86y5ky11l6.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239730 - head/sys/i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 09:37:01 -0000 David O'Brien writes: > The comment below says to me the target swap size is 16GB, not 8GB. The target is 8 assuming 50% waste. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 11:23:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A38121065680; Wed, 29 Aug 2012 11:23:59 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2F98FC1D; Wed, 29 Aug 2012 11:23: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 q7TBNxVI035459; Wed, 29 Aug 2012 11:23:59 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TBNxJb035457; Wed, 29 Aug 2012 11:23:59 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208291123.q7TBNxJb035457@svn.freebsd.org> From: Andrey Zonov Date: Wed, 29 Aug 2012 11:23: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: r239818 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 11:23:59 -0000 Author: zont Date: Wed Aug 29 11:23:59 2012 New Revision: 239818 URL: http://svn.freebsd.org/changeset/base/239818 Log: - Don't take an account of locked memory for current process in vslock(9). There are two consumers of vslock(9): sysctl code and drm driver. These consumers are using locked memory as transient memory, it doesn't belong to a process's memory. Suggested by: avg Reviewed by: alc Approved by: kib (mentor) MFC after: 2 weeks Modified: head/sys/vm/vm_glue.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Wed Aug 29 11:23:20 2012 (r239817) +++ head/sys/vm/vm_glue.c Wed Aug 29 11:23:59 2012 (r239818) @@ -183,7 +183,6 @@ int vslock(void *addr, size_t len) { vm_offset_t end, last, start; - unsigned long nsize; vm_size_t npages; int error; @@ -195,18 +194,6 @@ vslock(void *addr, size_t len) npages = atop(end - start); if (npages > vm_page_max_wired) return (ENOMEM); - PROC_LOCK(curproc); - nsize = ptoa(npages + - pmap_wired_count(vm_map_pmap(&curproc->p_vmspace->vm_map))); - if (nsize > lim_cur(curproc, RLIMIT_MEMLOCK)) { - PROC_UNLOCK(curproc); - return (ENOMEM); - } - if (racct_set(curproc, RACCT_MEMLOCK, nsize)) { - PROC_UNLOCK(curproc); - return (ENOMEM); - } - PROC_UNLOCK(curproc); #if 0 /* * XXX - not yet @@ -222,14 +209,6 @@ vslock(void *addr, size_t len) #endif error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end, VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); -#ifdef RACCT - if (error != KERN_SUCCESS) { - PROC_LOCK(curproc); - racct_set(curproc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(vm_map_pmap(&curproc->p_vmspace->vm_map)))); - PROC_UNLOCK(curproc); - } -#endif /* * Return EFAULT on error to match copy{in,out}() behaviour * rather than returning ENOMEM like mlock() would. From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 12:09:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A719D106567A; Wed, 29 Aug 2012 12:09:39 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 170A98FC1A; Wed, 29 Aug 2012 12:09:39 +0000 (UTC) Received: by ialo14 with SMTP id o14so1230072ial.13 for ; Wed, 29 Aug 2012 05:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Zlvr4KqWnvqAGmMHgWjxx/GeeUZcmCX8B0/DVVVj/28=; b=B94Yrj+5Gtoff1Zv97Qxy2jLyvj5zC9ux35BqVL+gKeqAAIlkYUfMVdjNnsvj7kKfq qZQRjTxSW5gJq0hw41eRPuYDbljQSap/2oHsXYS++qMaYXAxjURXUUVi1Fd8fKpByY0n +2bh41/zQNiTzMWVWqrPP5vyjH+510U/rG71AFJX43y+tMQwpeZed5kqMjFvxG69gT2v QhtGhlUrkCoZrRrK23/ETj5BJuuMzW3bNN4GKZIlSRzPi4Q61D7p/hTZ6Xh9g0qfWRch w2xsUphBiM4SR/FhRBRjR2H6CL4V3jrCHY1eqx5PxkC6ZFITfDOqnaSdpg+hBZQ/8mHA cJaA== MIME-Version: 1.0 Received: by 10.50.163.66 with SMTP id yg2mr16938206igb.3.1346242178464; Wed, 29 Aug 2012 05:09:38 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.64.165.34 with HTTP; Wed, 29 Aug 2012 05:09:38 -0700 (PDT) In-Reply-To: <201208291123.q7TBNxJb035457@svn.freebsd.org> References: <201208291123.q7TBNxJb035457@svn.freebsd.org> Date: Wed, 29 Aug 2012 16:09:38 +0400 X-Google-Sender-Auth: mtFXD8qmsf_f2vVyZi8mNV2haj0 Message-ID: From: Sergey Kandaurov To: Andrey Zonov Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239818 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:09:39 -0000 On 29 August 2012 15:23, Andrey Zonov wrote: > Author: zont > Date: Wed Aug 29 11:23:59 2012 > New Revision: 239818 > URL: http://svn.freebsd.org/changeset/base/239818 > > Log: > - Don't take an account of locked memory for current process in vslock(9). > > There are two consumers of vslock(9): sysctl code and drm driver. These > consumers are using locked memory as transient memory, it doesn't belong > to a process's memory. Hi. So, since we do not account such memory in vslock() anymore, I think this one shall be applied as well. Index: share/man/man9/vslock.9 =================================================================== --- share/man/man9/vslock.9 (revision 239171) +++ share/man/man9/vslock.9 (working copy) @@ -82,9 +82,6 @@ .It Bq Er ENOMEM The size of the specified address range exceeds the system limit on locked memory. -.It Bq Er ENOMEM -Locking the requested address range would cause the process to exceed -its per-process locked memory limit. .It Bq Er EFAULT Some portion of the indicated address range is not allocated. There was an error faulting/mapping a page. -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 12:29:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4544106567D for ; Wed, 29 Aug 2012 12:29:20 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 466578FC2A for ; Wed, 29 Aug 2012 12:29:19 +0000 (UTC) Received: by eeke52 with SMTP id e52so215618eek.13 for ; Wed, 29 Aug 2012 05:29:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=w9nfm3iaR0Xg+/ZVfG2cpujXDffSW6SClJqpGdkktyk=; b=PAmRGD6XJRc4IBG83VLlBNYTUCWaC6yrbQYFjjmhHO9cZF9ORWSwRyjtOsPUgvm54x kAmHA5PyPWBzKjLwZIQc0QX2MvMwgU7XQRiYz1HVxD74pNH5srhfR5GQXqejgLA3LZzA 2tC7Anv+YiOV/MVJlSgNXt4swAoPIEUQ8/9GjTHz4vZ2w3dqYbIqJGnYV2lnvZyn0anl nf1uiDwn8wrww2Pa7UJ6xjiXjUtaJQcHeJsTTpxjzR2lPZKeCxMy5RpaoXQdeiZdgk+B qNjsKHXEAHoZq8XOiEHD42KDiq20zB+ksFoinCeSnU+/KOw4gy+RoGlLZ+P79hkGHPYT q/eg== Received: by 10.14.202.66 with SMTP id c42mr1749810eeo.35.1346243358810; Wed, 29 Aug 2012 05:29:18 -0700 (PDT) Received: from dhcp170-234-red.yandex.net ([2a02:6b8:0:401:f907:1f1a:380d:eba]) by mx.google.com with ESMTPS id e7sm69602565eep.2.2012.08.29.05.29.17 (version=SSLv3 cipher=OTHER); Wed, 29 Aug 2012 05:29:18 -0700 (PDT) Sender: Andrey Zonov Message-ID: <503E0B18.70605@FreeBSD.org> Date: Wed, 29 Aug 2012 16:29:12 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Sergey Kandaurov References: <201208291123.q7TBNxJb035457@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.4.3 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig8F54062FBFD303E943129D3E" X-Gm-Message-State: ALoCoQn/mcJ/83LfkwU+gzkf/XgumkqCky5Hs4gSSeUq4U93V/0tROEnqpBNn88RO0Uc0RjDLQPP Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239818 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 12:29:20 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8F54062FBFD303E943129D3E Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 8/29/12 4:09 PM, Sergey Kandaurov wrote: > On 29 August 2012 15:23, Andrey Zonov wrote: >> Author: zont >> Date: Wed Aug 29 11:23:59 2012 >> New Revision: 239818 >> URL: http://svn.freebsd.org/changeset/base/239818 >> >> Log: >> - Don't take an account of locked memory for current process in vslo= ck(9). >> >> There are two consumers of vslock(9): sysctl code and drm driver. T= hese >> consumers are using locked memory as transient memory, it doesn't be= long >> to a process's memory. >=20 > Hi. > So, since we do not account such memory in vslock() anymore, > I think this one shall be applied as well. >=20 > Index: share/man/man9/vslock.9 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- share/man/man9/vslock.9 (revision 239171) > +++ share/man/man9/vslock.9 (working copy) > @@ -82,9 +82,6 @@ > .It Bq Er ENOMEM > The size of the specified address range exceeds the system > limit on locked memory. > -.It Bq Er ENOMEM > -Locking the requested address range would cause the process to exceed > -its per-process locked memory limit. > .It Bq Er EFAULT > Some portion of the indicated address range is not allocated. > There was an error faulting/mapping a page. >=20 >=20 Please, commit it. Thanks! --=20 Andrey Zonov --------------enig8F54062FBFD303E943129D3E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJQPgscAAoJEBWLemxX/CvTXAMH/1VYb33/kIRplvX9ztEE1yuW fBA0iUNSxMc3EU496wMGnmZWP/Bw5FtzhItQ8VZD06RqFL6xxJCv+sAGsKrY+M/k auEb8+U2dqf0XKpNXxnbaDN2NoR62Hu50wR8xiAdU5AD1M4YktAc7RVjpW2We016 ZToK6ewHr570kdQMuJIqLrUXybJSqARD1ey6B1q9kzt9uyB3LdUyV0b0FqtCd0ws 9QGuCHMSKjtPpyXk7BKQ6XEYl0XE6f6LLy2tFb70CPoYjMs6rIx2mg/SIylrvMpd owJxDEkDQI8C9CIBTegj0zHZxp1gqFnygqepc9ekPv9HUWezSz9zqgQC11fwx8Y= =z/x9 -----END PGP SIGNATURE----- --------------enig8F54062FBFD303E943129D3E-- From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 13:00:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76982106566C; Wed, 29 Aug 2012 13:00:01 +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 5598D8FC18; Wed, 29 Aug 2012 13:00: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 q7TD01mw048167; Wed, 29 Aug 2012 13:00:01 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TD01j6048159; Wed, 29 Aug 2012 13:00:01 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201208291300.q7TD01j6048159@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 29 Aug 2012 13:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239829 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 13:00:01 -0000 Author: pluknet Date: Wed Aug 29 13:00:00 2012 New Revision: 239829 URL: http://svn.freebsd.org/changeset/base/239829 Log: Follow r239818 and remove no more relevant vslock() ENOMEM error. Reviewed by: zont MFC after: 2 weeks Modified: head/share/man/man9/vslock.9 Modified: head/share/man/man9/vslock.9 ============================================================================== --- head/share/man/man9/vslock.9 Wed Aug 29 12:52:04 2012 (r239828) +++ head/share/man/man9/vslock.9 Wed Aug 29 13:00:00 2012 (r239829) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2004 +.Dd August 29, 2012 .Dt VSLOCK 9 .Os .Sh NAME @@ -82,9 +82,6 @@ machine address space. .It Bq Er ENOMEM The size of the specified address range exceeds the system limit on locked memory. -.It Bq Er ENOMEM -Locking the requested address range would cause the process to exceed -its per-process locked memory limit. .It Bq Er EFAULT Some portion of the indicated address range is not allocated. There was an error faulting/mapping a page. From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 15:18:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F3AE1065673; Wed, 29 Aug 2012 15:18:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B69A8FC0A; Wed, 29 Aug 2012 15: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 q7TFIuTL066973; Wed, 29 Aug 2012 15:18:56 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFIup7066971; Wed, 29 Aug 2012 15:18:56 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208291518.q7TFIup7066971@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 Aug 2012 15:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239836 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:18:57 -0000 Author: des Date: Wed Aug 29 15:18:56 2012 New Revision: 239836 URL: http://svn.freebsd.org/changeset/base/239836 Log: Change the gptboot example so the boot partition is aligned on a 4 kB boundary. MFC after: 3 days Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Wed Aug 29 15:13:13 2012 (r239835) +++ head/sbin/geom/class/part/gpart.8 Wed Aug 29 15:18:56 2012 (r239836) @@ -1006,11 +1006,12 @@ or but smaller than 545 kB since the first-stage loader will load the entire partition into memory during boot, regardless of how much data it actually contains. -This example uses 94 blocks (47 kB) so the next partition will be +This example uses 88 blocks (44 kB) so the next partition will be aligned on a 64 kB boundary without the need to specify an explicit offset or alignment. +The boot partition itself is aligned on a 4 kB boundary. .Bd -literal -offset indent -/sbin/gpart add -b 34 -s 94 -t freebsd-boot ad0 +/sbin/gpart add -b 40 -s 88 -t freebsd-boot ad0 /sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 .Ed .Pp From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 15:34:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2ADEF1065670; Wed, 29 Aug 2012 15:34:32 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16C938FC14; Wed, 29 Aug 2012 15:34: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 q7TFYVkA069143; Wed, 29 Aug 2012 15:34:31 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFYVm6069141; Wed, 29 Aug 2012 15:34:31 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201208291534.q7TFYVm6069141@svn.freebsd.org> From: Isabell Long Date: Wed, 29 Aug 2012 15:34: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: r239840 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:34:32 -0000 Author: issyl0 (doc committer) Date: Wed Aug 29 15:34:31 2012 New Revision: 239840 URL: http://svn.freebsd.org/changeset/base/239840 Log: Fix a dead link in sk(4). PR: docs/146958 Approved by: gjb (mentor) MFC after: 3 days Modified: head/share/man/man4/sk.4 Modified: head/share/man/man4/sk.4 ============================================================================== --- head/share/man/man4/sk.4 Wed Aug 29 15:34:26 2012 (r239839) +++ head/share/man/man4/sk.4 Wed Aug 29 15:34:31 2012 (r239840) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 23, 2010 +.Dd August 29, 2012 .Dt SK 4 .Os .Sh NAME @@ -223,7 +223,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T XaQti XMAC II datasheet -.%U http://www.xaqti.com +.%U http://people.freebsd.org/~wpaul/SysKonnect/xmacii_datasheet_rev_c_9-29.pdf .Re .Rs .%T SysKonnect GEnesis programming manual From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 16:15:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABDB51065673; Wed, 29 Aug 2012 16:15:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 991668FC1D; Wed, 29 Aug 2012 16:15: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 q7TGFMbW075914; Wed, 29 Aug 2012 16:15:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGFMPr075912; Wed, 29 Aug 2012 16:15:22 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208291615.q7TGFMPr075912@svn.freebsd.org> From: Ed Schouten Date: Wed, 29 Aug 2012 16:15: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: r239855 - head/usr.sbin/ac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:15:22 -0000 Author: ed Date: Wed Aug 29 16:15:22 2012 New Revision: 239855 URL: http://svn.freebsd.org/changeset/base/239855 Log: Fix whitespace. Modified: head/usr.sbin/ac/ac.c Modified: head/usr.sbin/ac/ac.c ============================================================================== --- head/usr.sbin/ac/ac.c Wed Aug 29 16:11:03 2012 (r239854) +++ head/usr.sbin/ac/ac.c Wed Aug 29 16:15:22 2012 (r239855) @@ -60,7 +60,7 @@ struct tty_list { * globals - yes yuk */ #ifdef CONSOLE_TTY -static char *Console = CONSOLE_TTY; +static char *Console = CONSOLE_TTY; #endif static time_t Total = 0; static time_t FirstTime = 0; @@ -406,7 +406,6 @@ log_out(struct utmp_list *head, struct u return head; } - /* * if do_tty says ok, login a user */ From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 16:56:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08232106566C; Wed, 29 Aug 2012 16:56: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 DC9478FC12; Wed, 29 Aug 2012 16:56: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 q7TGuolh081562; Wed, 29 Aug 2012 16:56:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGuoed081557; Wed, 29 Aug 2012 16:56:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201208291656.q7TGuoed081557@svn.freebsd.org> From: Marius Strobl Date: Wed, 29 Aug 2012 16:56: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: r239864 - in head/sys: kern sparc64/include sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:56:51 -0000 Author: marius Date: Wed Aug 29 16:56:50 2012 New Revision: 239864 URL: http://svn.freebsd.org/changeset/base/239864 Log: - Unlike cache invalidation and TLB demapping IPIs, reading registers from other CPUs doesn't require locking so get rid of it. As the latter is used for the timecounter on certain machine models, using a spin lock in this case can lead to a deadlock with the upcoming callout(9) rework. - Merge r134227/r167250 from x86: Avoid cross-IPI SMP deadlock by using the smp_ipi_mtx spin lock not only for smp_rendezvous_cpus() but also for the MD cache invalidation and TLB demapping IPIs. - Mark some unused function arguments as such. MFC after: 1 week Modified: head/sys/kern/subr_witness.c head/sys/sparc64/include/smp.h head/sys/sparc64/sparc64/mp_machdep.c head/sys/sparc64/sparc64/tick.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Wed Aug 29 16:44:50 2012 (r239863) +++ head/sys/kern/subr_witness.c Wed Aug 29 16:56:50 2012 (r239864) @@ -669,9 +669,6 @@ static struct witness_order_list_entry o */ { "intrcnt", &lock_class_mtx_spin }, { "icu", &lock_class_mtx_spin }, -#if defined(SMP) && defined(__sparc64__) - { "ipi", &lock_class_mtx_spin }, -#endif #ifdef __i386__ { "allpmaps", &lock_class_mtx_spin }, { "descriptor tables", &lock_class_mtx_spin }, Modified: head/sys/sparc64/include/smp.h ============================================================================== --- head/sys/sparc64/include/smp.h Wed Aug 29 16:44:50 2012 (r239863) +++ head/sys/sparc64/include/smp.h Wed Aug 29 16:56:50 2012 (r239864) @@ -109,7 +109,6 @@ extern cpu_ipi_single_t *cpu_ipi_single; void mp_init(u_int cpu_impl); -extern struct mtx ipi_mtx; extern struct ipi_cache_args ipi_cache_args; extern struct ipi_rd_args ipi_rd_args; extern struct ipi_tlb_args ipi_tlb_args; @@ -169,7 +168,7 @@ ipi_dcache_page_inval(void *func, vm_pad return (NULL); sched_pin(); ica = &ipi_cache_args; - mtx_lock_spin(&ipi_mtx); + mtx_lock_spin(&smp_ipi_mtx); ica->ica_mask = all_cpus; CPU_CLR(PCPU_GET(cpuid), &ica->ica_mask); ica->ica_pa = pa; @@ -186,7 +185,7 @@ ipi_icache_page_inval(void *func, vm_pad return (NULL); sched_pin(); ica = &ipi_cache_args; - mtx_lock_spin(&ipi_mtx); + mtx_lock_spin(&smp_ipi_mtx); ica->ica_mask = all_cpus; CPU_CLR(PCPU_GET(cpuid), &ica->ica_mask); ica->ica_pa = pa; @@ -203,7 +202,6 @@ ipi_rd(u_int cpu, void *func, u_long *va return (NULL); sched_pin(); ira = &ipi_rd_args; - mtx_lock_spin(&ipi_mtx); CPU_SETOF(cpu, &ira->ira_mask); ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); @@ -227,7 +225,7 @@ ipi_tlb_context_demap(struct pmap *pm) return (NULL); } ita = &ipi_tlb_args; - mtx_lock_spin(&ipi_mtx); + mtx_lock_spin(&smp_ipi_mtx); ita->ita_mask = cpus; ita->ita_pmap = pm; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_context_demap, @@ -252,7 +250,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o return (NULL); } ita = &ipi_tlb_args; - mtx_lock_spin(&ipi_mtx); + mtx_lock_spin(&smp_ipi_mtx); ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_va = va; @@ -277,7 +275,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ return (NULL); } ita = &ipi_tlb_args; - mtx_lock_spin(&ipi_mtx); + mtx_lock_spin(&smp_ipi_mtx); ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_start = start; @@ -295,7 +293,19 @@ ipi_wait(void *cookie) if ((mask = cookie) != NULL) { while (!CPU_EMPTY(mask)) ; - mtx_unlock_spin(&ipi_mtx); + mtx_unlock_spin(&smp_ipi_mtx); + sched_unpin(); + } +} + +static __inline void +ipi_wait_unlocked(void *cookie) +{ + volatile cpuset_t *mask; + + if ((mask = cookie) != NULL) { + while (!CPU_EMPTY(mask)) + ; sched_unpin(); } } @@ -352,7 +362,13 @@ ipi_tlb_range_demap(struct pmap *pm __un } static __inline void -ipi_wait(void *cookie) +ipi_wait(void *cookie __unused) +{ + +} + +static __inline void +ipi_wait_unlocked(void *cookie __unused) { } Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Wed Aug 29 16:44:50 2012 (r239863) +++ head/sys/sparc64/sparc64/mp_machdep.c Wed Aug 29 16:56:50 2012 (r239864) @@ -113,8 +113,6 @@ struct ipi_rd_args ipi_rd_args; struct ipi_tlb_args ipi_tlb_args; struct pcb stoppcbs[MAXCPU]; -struct mtx ipi_mtx; - cpu_ipi_selected_t *cpu_ipi_selected; cpu_ipi_single_t *cpu_ipi_single; @@ -280,8 +278,6 @@ void cpu_mp_start(void) { - mtx_init(&ipi_mtx, "ipi", NULL, MTX_SPIN); - intr_setup(PIL_AST, cpu_ipi_ast, -1, NULL, NULL); intr_setup(PIL_RENDEZVOUS, (ih_func_t *)smp_rendezvous_action, -1, NULL, NULL); @@ -503,13 +499,13 @@ cpu_mp_shutdown(void) } static void -cpu_ipi_ast(struct trapframe *tf) +cpu_ipi_ast(struct trapframe *tf __unused) { } static void -cpu_ipi_stop(struct trapframe *tf) +cpu_ipi_stop(struct trapframe *tf __unused) { u_int cpuid; Modified: head/sys/sparc64/sparc64/tick.c ============================================================================== --- head/sys/sparc64/sparc64/tick.c Wed Aug 29 16:44:50 2012 (r239863) +++ head/sys/sparc64/sparc64/tick.c Wed Aug 29 16:56:50 2012 (r239864) @@ -332,7 +332,7 @@ stick_get_timecount_mp(struct timecounte if (curcpu == 0) stick = rdstick(); else - ipi_wait(ipi_rd(0, tl_ipi_stick_rd, &stick)); + ipi_wait_unlocked(ipi_rd(0, tl_ipi_stick_rd, &stick)); sched_unpin(); return (stick); } @@ -346,7 +346,7 @@ tick_get_timecount_mp(struct timecounter if (curcpu == 0) tick = rd(tick); else - ipi_wait(ipi_rd(0, tl_ipi_tick_rd, &tick)); + ipi_wait_unlocked(ipi_rd(0, tl_ipi_tick_rd, &tick)); sched_unpin(); return (tick); } From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 16:58:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F12F1065674; Wed, 29 Aug 2012 16:58:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20BB48FC1E; Wed, 29 Aug 2012 16:58:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TGwpeS081833; Wed, 29 Aug 2012 16:58:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TGwpH1081831; Wed, 29 Aug 2012 16:58:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208291658.q7TGwpH1081831@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 16:58: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: r239865 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 16:58:52 -0000 Author: adrian Date: Wed Aug 29 16:58:51 2012 New Revision: 239865 URL: http://svn.freebsd.org/changeset/base/239865 Log: There's no nede to allocate a DMA map just before calling bus_dmamem_alloc(). In fact, bus_dmamem_alloc() happily NULLs the dmat pointer passed in, before replacing it with its own. This fixes a MIPS crash when kldload'ing if_ath/if_ath_pci - bus_dmamap_destroy() was passed in a NULL dmat pointer and was doing all kinds of very bad things. Reviewed by: scottl Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Aug 29 16:56:50 2012 (r239864) +++ head/sys/dev/ath/if_ath.c Wed Aug 29 16:58:51 2012 (r239865) @@ -2856,13 +2856,6 @@ ath_descdma_alloc_desc(struct ath_softc } /* allocate descriptors */ - error = bus_dmamap_create(dd->dd_dmat, BUS_DMA_NOWAIT, &dd->dd_dmamap); - if (error != 0) { - if_printf(ifp, "unable to create dmamap for %s descriptors, " - "error %u\n", dd->dd_name, error); - goto fail0; - } - error = bus_dmamem_alloc(dd->dd_dmat, (void**) &dd->dd_desc, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &dd->dd_dmamap); @@ -2892,8 +2885,6 @@ ath_descdma_alloc_desc(struct ath_softc fail2: bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); fail1: - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); -fail0: bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); return error; @@ -2976,7 +2967,6 @@ ath_descdma_setup(struct ath_softc *sc, fail3: bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); return error; @@ -3057,7 +3047,6 @@ ath_descdma_cleanup(struct ath_softc *sc if (dd->dd_dmamap != 0) { bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); bus_dma_tag_destroy(dd->dd_dmat); } From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 18:14:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A8DAB106564A; Wed, 29 Aug 2012 18:14:21 +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 9326A8FC08; Wed, 29 Aug 2012 18:14: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 q7TIELwp090923; Wed, 29 Aug 2012 18:14:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TIELXN090920; Wed, 29 Aug 2012 18:14:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208291814.q7TIELXN090920@svn.freebsd.org> From: Dimitry Andric Date: Wed, 29 Aug 2012 18:14: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: r239868 - in head/sys: conf modules/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 18:14:21 -0000 Author: dim Date: Wed Aug 29 18:14:20 2012 New Revision: 239868 URL: http://svn.freebsd.org/changeset/base/239868 Log: Remove workaround for the clang 3.2 warning in ah_eeprom_9287.c, since the fix has been applied now. Modified: head/sys/conf/files head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Aug 29 17:36:31 2012 (r239867) +++ head/sys/conf/files Wed Aug 29 18:14:20 2012 (r239868) @@ -767,7 +767,7 @@ dev/ath/ath_hal/ah_eeprom_v4k.c \ # XXX Work around clang warning, until maintainer approves fix. dev/ath/ath_hal/ah_eeprom_9287.c \ optional ath_hal | ath_ar9287 \ - compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED} -I$S/dev/ath" + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_hal/ah_regdomain.c optional ath \ compile-with "${NORMAL_C} ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW} -I$S/dev/ath" # ar5210 Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Wed Aug 29 17:36:31 2012 (r239867) +++ head/sys/modules/ath/Makefile Wed Aug 29 18:14:20 2012 (r239868) @@ -150,6 +150,5 @@ opt_ah.h: CWARNFLAGS.ah_regdomain.c= ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW} # XXX Work around clang warnings, until maintainer approves fix. -CWARNFLAGS.ah_eeprom_9287.c= ${NO_WSOMETIMES_UNINITIALIZED} CWARNFLAGS.if_ath.c= ${NO_WSOMETIMES_UNINITIALIZED} CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 18:22:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4A42106564A; Wed, 29 Aug 2012 18:22:52 +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 C009A8FC08; Wed, 29 Aug 2012 18:22: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 q7TIMqTQ091958; Wed, 29 Aug 2012 18:22:52 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TIMqw1091955; Wed, 29 Aug 2012 18:22:52 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208291822.q7TIMqw1091955@svn.freebsd.org> From: Dimitry Andric Date: Wed, 29 Aug 2012 18:22: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: r239869 - head/sys/i386/bios X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 18:22:53 -0000 Author: dim Date: Wed Aug 29 18:22:52 2012 New Revision: 239869 URL: http://svn.freebsd.org/changeset/base/239869 Log: Remove the argument-less .align directive in sys/i386/bios/smapi_bios.S. Specifying no argument is undocumented in the gas manual, and clang's integrated assembler refuses to parse it. Also, removing it causes no change at all in the resulting object file. MFC after: 1 week Modified: head/sys/i386/bios/smapi_bios.S Modified: head/sys/i386/bios/smapi_bios.S ============================================================================== --- head/sys/i386/bios/smapi_bios.S Wed Aug 29 18:14:20 2012 (r239868) +++ head/sys/i386/bios/smapi_bios.S Wed Aug 29 18:22:52 2012 (r239869) @@ -6,7 +6,6 @@ __FBSDID("$FreeBSD$"); * Thomas Hood. */ - .align smapi32_entry: /* far pointer to SMAPI entry */ .globl smapi32_offset smapi32_offset: .long 0x00000000 /* set by caller */ From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 18:37:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DFF71065670; Wed, 29 Aug 2012 18:37:11 +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 78DB98FC18; Wed, 29 Aug 2012 18:37: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 q7TIbBdh094459; Wed, 29 Aug 2012 18:37:11 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TIbB6W094456; Wed, 29 Aug 2012 18:37:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208291837.q7TIbB6W094456@svn.freebsd.org> From: Dimitry Andric Date: Wed, 29 Aug 2012 18:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239870 - in head/contrib: binutils/include/elf gdb/gdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 18:37:11 -0000 Author: dim Date: Wed Aug 29 18:37:10 2012 New Revision: 239870 URL: http://svn.freebsd.org/changeset/base/239870 Log: Teach gdb about the DW_FORM_flag_present dwarf attribute, so it doesn't error out on files that contain it. (This attribute can be emitted by newer versions of clang.) MFC after: 2 weeks Modified: head/contrib/binutils/include/elf/dwarf2.h head/contrib/gdb/gdb/dwarf2read.c Modified: head/contrib/binutils/include/elf/dwarf2.h ============================================================================== --- head/contrib/binutils/include/elf/dwarf2.h Wed Aug 29 18:22:52 2012 (r239869) +++ head/contrib/binutils/include/elf/dwarf2.h Wed Aug 29 18:37:10 2012 (r239870) @@ -238,7 +238,8 @@ enum dwarf_form DW_FORM_ref4 = 0x13, DW_FORM_ref8 = 0x14, DW_FORM_ref_udata = 0x15, - DW_FORM_indirect = 0x16 + DW_FORM_indirect = 0x16, + DW_FORM_flag_present = 0x19 }; /* Attribute names and codes. */ Modified: head/contrib/gdb/gdb/dwarf2read.c ============================================================================== --- head/contrib/gdb/gdb/dwarf2read.c Wed Aug 29 18:22:52 2012 (r239869) +++ head/contrib/gdb/gdb/dwarf2read.c Wed Aug 29 18:37:10 2012 (r239870) @@ -4604,6 +4604,9 @@ read_attribute_value (struct attribute * DW_UNSND (attr) = read_1_byte (abfd, info_ptr); info_ptr += 1; break; + case DW_FORM_flag_present: + DW_UNSND (attr) = 1; + break; case DW_FORM_sdata: DW_SND (attr) = read_signed_leb128 (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; @@ -7226,6 +7229,9 @@ dump_die (struct die_info *die) else fprintf_unfiltered (gdb_stderr, "flag: FALSE"); break; + case DW_FORM_flag_present: + fprintf_unfiltered (gdb_stderr, "flag: TRUE"); + break; case DW_FORM_indirect: /* the reader will have reduced the indirect form to the "base form" so this form should not occur */ From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 18:49:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB3B9106566C; Wed, 29 Aug 2012 18:49:42 +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 8CEE78FC16; Wed, 29 Aug 2012 18:49: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 q7TIngE5096128; Wed, 29 Aug 2012 18:49:42 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TIng9H096123; Wed, 29 Aug 2012 18:49:42 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208291849.q7TIng9H096123@svn.freebsd.org> From: Dimitry Andric Date: Wed, 29 Aug 2012 18:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239872 - head/lib/libdwarf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 18:49:42 -0000 Author: dim Date: Wed Aug 29 18:49:41 2012 New Revision: 239872 URL: http://svn.freebsd.org/changeset/base/239872 Log: Teach libdwarf about the DW_FORM_flag_present dwarf attribute, so programs using libdwarf (such as ctfconvert) don't error out on files containing the attribute. MFC after: 2 weeks Modified: head/lib/libdwarf/dwarf.h head/lib/libdwarf/dwarf_attrval.c head/lib/libdwarf/dwarf_dump.c head/lib/libdwarf/dwarf_init.c Modified: head/lib/libdwarf/dwarf.h ============================================================================== --- head/lib/libdwarf/dwarf.h Wed Aug 29 18:40:12 2012 (r239871) +++ head/lib/libdwarf/dwarf.h Wed Aug 29 18:49:41 2012 (r239872) @@ -184,6 +184,7 @@ #define DW_FORM_ref8 0x14 #define DW_FORM_ref_udata 0x15 #define DW_FORM_indirect 0x16 +#define DW_FORM_flag_present 0x19 #define DW_OP_addr 0x03 #define DW_OP_deref 0x06 Modified: head/lib/libdwarf/dwarf_attrval.c ============================================================================== --- head/lib/libdwarf/dwarf_attrval.c Wed Aug 29 18:40:12 2012 (r239871) +++ head/lib/libdwarf/dwarf_attrval.c Wed Aug 29 18:49:41 2012 (r239872) @@ -101,6 +101,7 @@ dwarf_attrval_flag(Dwarf_Die die, uint64 } else { switch (av->av_form) { case DW_FORM_flag: + case DW_FORM_flag_present: *valp = (Dwarf_Bool) av->u[0].u64; break; default: Modified: head/lib/libdwarf/dwarf_dump.c ============================================================================== --- head/lib/libdwarf/dwarf_dump.c Wed Aug 29 18:40:12 2012 (r239871) +++ head/lib/libdwarf/dwarf_dump.c Wed Aug 29 18:49:41 2012 (r239872) @@ -240,6 +240,8 @@ get_form_desc(uint32_t form) return "DW_FORM_data8"; case DW_FORM_flag: return "DW_FORM_flag"; + case DW_FORM_flag_present: + return "DW_FORM_flag_present"; case DW_FORM_indirect: return "DW_FORM_indirect"; case DW_FORM_ref1: @@ -648,6 +650,7 @@ dwarf_dump_av(Dwarf_Die die, Dwarf_AttrV case DW_FORM_data4: case DW_FORM_data8: case DW_FORM_flag: + case DW_FORM_flag_present: printf("%llu", (unsigned long long) av->u[0].u64); break; case DW_FORM_ref1: Modified: head/lib/libdwarf/dwarf_init.c ============================================================================== --- head/lib/libdwarf/dwarf_init.c Wed Aug 29 18:40:12 2012 (r239871) +++ head/lib/libdwarf/dwarf_init.c Wed Aug 29 18:49:41 2012 (r239872) @@ -396,6 +396,10 @@ dwarf_init_attr(Dwarf_Debug dbg, Elf_Dat avref.u[1].s = elf_strptr(dbg->dbg_elf, dbg->dbg_s[DWARF_debug_str].s_shnum, avref.u[0].u64); break; + case DW_FORM_flag_present: + /* This form has no value encoded in the DIE. */ + avref.u[0].u64 = 1; + break; default: DWARF_SET_ERROR(error, DWARF_E_NOT_IMPLEMENTED); ret = DWARF_E_NOT_IMPLEMENTED; From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 18:58:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DB96106564A; Wed, 29 Aug 2012 18:58:04 +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 08CB88FC08; Wed, 29 Aug 2012 18:58: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 q7TIw3hN097180; Wed, 29 Aug 2012 18:58:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TIw336097178; Wed, 29 Aug 2012 18:58:03 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208291858.q7TIw336097178@svn.freebsd.org> From: Dimitry Andric Date: Wed, 29 Aug 2012 18:58: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: r239873 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 18:58:04 -0000 Author: dim Date: Wed Aug 29 18:58:03 2012 New Revision: 239873 URL: http://svn.freebsd.org/changeset/base/239873 Log: After r239868, also remove the comment about the workaround for ah_eeprom_9287.c. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Aug 29 18:49:41 2012 (r239872) +++ head/sys/conf/files Wed Aug 29 18:58:03 2012 (r239873) @@ -764,7 +764,6 @@ dev/ath/ath_hal/ah_eeprom_v14.c \ dev/ath/ath_hal/ah_eeprom_v4k.c \ optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath" -# XXX Work around clang warning, until maintainer approves fix. dev/ath/ath_hal/ah_eeprom_9287.c \ optional ath_hal | ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath" From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 21:38:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A76F4106564A; Wed, 29 Aug 2012 21:38:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 931718FC1D; Wed, 29 Aug 2012 21:38: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 q7TLcZs5019195; Wed, 29 Aug 2012 21:38:35 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TLcZuF019193; Wed, 29 Aug 2012 21:38:35 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201208292138.q7TLcZuF019193@svn.freebsd.org> From: Ed Maste Date: Wed, 29 Aug 2012 21:38: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: r239883 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 21:38:35 -0000 Author: emaste Date: Wed Aug 29 21:38:34 2012 New Revision: 239883 URL: http://svn.freebsd.org/changeset/base/239883 Log: Avoid passing uninitialized stack to addelem() if called with an empty arg. PR: bin/171174 Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Wed Aug 29 21:12:19 2012 (r239882) +++ head/bin/ps/ps.c Wed Aug 29 21:38:34 2012 (r239883) @@ -889,8 +889,8 @@ add_list(struct listinfo *inf, const cha int toolong; char elemcopy[PATH_MAX]; - if (*argp == 0) - inf->addelem(inf, elemcopy); + if (*argp == '\0') + inf->addelem(inf, argp); while (*argp != '\0') { while (*argp != '\0' && strchr(W_SEP, *argp) != NULL) argp++; From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 22:53:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C8A9106564A; Wed, 29 Aug 2012 22:53:55 +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 47B418FC16; Wed, 29 Aug 2012 22:53: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 q7TMrtcN029007; Wed, 29 Aug 2012 22:53:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TMrtEu029005; Wed, 29 Aug 2012 22:53:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208292253.q7TMrtEu029005@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 22:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239884 - head/tools/bsdbox X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 22:53:55 -0000 Author: adrian Date: Wed Aug 29 22:53:54 2012 New Revision: 239884 URL: http://svn.freebsd.org/changeset/base/239884 Log: For now, disable building wpa_supplicant. My 4MB flash builds can't handle the bloat. Modified: head/tools/bsdbox/Makefile.hostapd Modified: head/tools/bsdbox/Makefile.hostapd ============================================================================== --- head/tools/bsdbox/Makefile.hostapd Wed Aug 29 21:38:34 2012 (r239883) +++ head/tools/bsdbox/Makefile.hostapd Wed Aug 29 22:53:54 2012 (r239884) @@ -7,9 +7,9 @@ CRUNCH_PROGS_usr.sbin+= hostapd hostapd_ CRUNCH_SRCDIR_hostapd= $(.CURDIR)/../../usr.sbin/wpa/hostapd CRUNCH_SRCDIR_hostapd_cli= $(.CURDIR)/../../usr.sbin/wpa/hostapd_cli -CRUNCH_PROGS_usr.sbin+= wpa_supplicant wpa_cli -CRUNCH_SRCDIR_wpa_supplicant= $(.CURDIR)/../../usr.sbin/wpa/wpa_supplicant -CRUNCH_SRCDIR_wpa_cli= $(.CURDIR)/../../usr.sbin/wpa/wpa_cli +#CRUNCH_PROGS_usr.sbin+= wpa_supplicant wpa_cli +#CRUNCH_SRCDIR_wpa_supplicant= $(.CURDIR)/../../usr.sbin/wpa/wpa_supplicant +#CRUNCH_SRCDIR_wpa_cli= $(.CURDIR)/../../usr.sbin/wpa/wpa_cli CRUNCH_LIBS+= -lpcap From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 22:54:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3019106566B; Wed, 29 Aug 2012 22:54: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 9DB1F8FC15; Wed, 29 Aug 2012 22:54: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 q7TMsRjf029105; Wed, 29 Aug 2012 22:54:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TMsRIL029103; Wed, 29 Aug 2012 22:54:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208292254.q7TMsRIL029103@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 22:54: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: r239885 - head/tools/bsdbox X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 22:54:27 -0000 Author: adrian Date: Wed Aug 29 22:54:27 2012 New Revision: 239885 URL: http://svn.freebsd.org/changeset/base/239885 Log: Disable building textproc for now, it doesn't fit on my 4MB flash partition. Add -lcrypt as a dynamic target. Modified: head/tools/bsdbox/Makefile Modified: head/tools/bsdbox/Makefile ============================================================================== --- head/tools/bsdbox/Makefile Wed Aug 29 22:53:54 2012 (r239884) +++ head/tools/bsdbox/Makefile Wed Aug 29 22:54:27 2012 (r239885) @@ -55,7 +55,7 @@ CRUNCH_SRCDIRS+= bin # setuid binaries - they use these libraries. PAM needs to be # built dynamically or it tries to build _all_ of the modules # statically - and that ends very badly. -CRUNCH_SHLIBS+= -lc -lutil +CRUNCH_SHLIBS+= -lc -lutil -lcrypt CRUNCH_LIBS+= -lkvm -lmemstat -lnetgraph CRUNCH_LIBS+= -lcrypt -ledit -ll -ltermcap @@ -98,7 +98,7 @@ CRUNCH_LIBS+= -lm .include "Makefile.base" .include "Makefile.net" .include "Makefile.hostapd" -.include "Makefile.textproc" +#.include "Makefile.textproc" .include "Makefile.login" .include "Makefile.kld" # telnet/telnetd are too broken to include as a crunchgen'ed binary, From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 22:54:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCA7F10657D7; Wed, 29 Aug 2012 22:54:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7DC28FC26; Wed, 29 Aug 2012 22:54: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 q7TMsd4H029170; Wed, 29 Aug 2012 22:54:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TMsdBH029168; Wed, 29 Aug 2012 22:54:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208292254.q7TMsdBH029168@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 22:54: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: r239886 - head/tools/bsdbox X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 22:54:40 -0000 Author: adrian Date: Wed Aug 29 22:54:39 2012 New Revision: 239886 URL: http://svn.freebsd.org/changeset/base/239886 Log: Disable fsck_ffs for now, 4MB target size issues. Modified: head/tools/bsdbox/Makefile.fs Modified: head/tools/bsdbox/Makefile.fs ============================================================================== --- head/tools/bsdbox/Makefile.fs Wed Aug 29 22:54:27 2012 (r239885) +++ head/tools/bsdbox/Makefile.fs Wed Aug 29 22:54:39 2012 (r239886) @@ -8,7 +8,7 @@ CRUNCH_PROGS_sbin+= mdmfs mdconfig newfs CRUNCH_ALIAS_mdmfs= mount_mfs # UFS -CRUNCH_PROGS_sbin+= fsck_ffs +# CRUNCH_PROGS_sbin+= fsck_ffs CRUNCH_LIBS+= -lgeom CRUNCH_LIBS+= -lufs From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 22:55:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F6BB106567D; Wed, 29 Aug 2012 22:55:51 +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 3AF168FC2D; Wed, 29 Aug 2012 22:55: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 q7TMtpZl029362; Wed, 29 Aug 2012 22:55:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TMtpKu029360; Wed, 29 Aug 2012 22:55:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208292255.q7TMtpKu029360@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 22:55: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: r239887 - head/tools/bsdbox X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 22:55:51 -0000 Author: adrian Date: Wed Aug 29 22:55:50 2012 New Revision: 239887 URL: http://svn.freebsd.org/changeset/base/239887 Log: Do a bunch of fixing and refactoring. Fix up gzip to crunch right. Add kenv, although I'm not yet sure why it isn't working on my MIPS boards (reading kenv always returns blank.) Modified: head/tools/bsdbox/Makefile.base Modified: head/tools/bsdbox/Makefile.base ============================================================================== --- head/tools/bsdbox/Makefile.base Wed Aug 29 22:54:39 2012 (r239886) +++ head/tools/bsdbox/Makefile.base Wed Aug 29 22:55:50 2012 (r239887) @@ -5,16 +5,19 @@ # $FreeBSD$ # CRUNCH_PROGS_sbin+= dmesg sysctl init reboot -CRUNCH_PROGS_bin+= ls cat dd df cp hostname kill mkdir sleep ps ln rm hostname +CRUNCH_PROGS_bin+= ls cat dd df cp hostname kill mkdir sleep ps +CRUNCH_PROGS_bin+= ln rm hostname kenv CRUNCH_PROGS_usr.bin+= true false hexdump tail nc w head uname tset CRUNCH_PROGS_usr.sbin+= gpioctl CRUNCH_ALIAS_w= uptime CRUNCH_ALIAS_tset= reset -CRUNCH_PROGS_usr.bin+= vmstat systat +CRUNCH_PROGS_usr.bin+= vmstat +#CRUNCH_PROGS_user.bin+= systat CRUNCH_LIBS+= -ldevstat -lncursesw -lncurses -lmemstat -lkvm -CRUNCH_PROGS_usr.bin+= tar cpio +# CRUNCH_PROGS_usr.bin+= tar +CRUNCH_PROGS_usr.bin+= cpio # XXX SSL ? CRUNCH_LIBS+= -larchive -lbz2 -lz -llzma -lbsdxml -lssl -lcrypto @@ -36,11 +39,11 @@ CRUNCH_PROGS_sbin+= mount umount # grep # grep doesn't yet work -adrian -CRUNCH_PROGS_usr.bin+= grep +#CRUNCH_PROGS_usr.bin+= grep # less/more -CRUNCH_PROGS_usr.bin+= less -CRUNCH_ALIAS_less= more +#CRUNCH_PROGS_usr.bin+= less +#CRUNCH_ALIAS_less= more # passwd CRUNCH_PROGS_usr.bin+= passwd @@ -50,6 +53,5 @@ CRUNCH_SHLIBS+= -lpam -lbsm # gzip/gunzip CRUNCH_PROGS_usr.bin+= gzip -CRUNCH_ALIAS_gunzip= gzip -CRUNCH_ALIAS_gzcat= gzip +CRUNCH_ALIAS_gzip= gunzip gzcat zcat CRUNCH_LIBS+= -lz -llzma -lbz2 From owner-svn-src-head@FreeBSD.ORG Wed Aug 29 22:58:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B69D106566C; Wed, 29 Aug 2012 22:58:53 +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 46D3D8FC0A; Wed, 29 Aug 2012 22:58: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 q7TMwr93029759; Wed, 29 Aug 2012 22:58:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TMwrcF029757; Wed, 29 Aug 2012 22:58:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208292258.q7TMwrcF029757@svn.freebsd.org> From: Adrian Chadd Date: Wed, 29 Aug 2012 22:58: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: r239888 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 22:58:53 -0000 Author: adrian Date: Wed Aug 29 22:58:52 2012 New Revision: 239888 URL: http://svn.freebsd.org/changeset/base/239888 Log: More attempts at space saving. * add cam as a module to build - but build in scbus/da for now, as "cam" as a module includes all cam devices. Hardly space saving. * Don't build FFS snapshot support. Modified: head/sys/mips/conf/AR724X_BASE Modified: head/sys/mips/conf/AR724X_BASE ============================================================================== --- head/sys/mips/conf/AR724X_BASE Wed Aug 29 22:55:50 2012 (r239887) +++ head/sys/mips/conf/AR724X_BASE Wed Aug 29 22:58:52 2012 (r239888) @@ -25,7 +25,7 @@ makeoptions DEBUG=-g #Build kernel with # Build these as modules so small platform builds will have the # modules already built. -makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci hwpmc" +makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci hwpmc cam" options DDB options KDB @@ -54,6 +54,7 @@ options SCSI_NO_OP_STRINGS options NO_SYSCTL_DESCR options FFS #Berkeley Fast Filesystem +options NO_FFS_SNAPSHOT # options SOFTUPDATES #Enable FFS soft updates support # options UFS_ACL #Support for access control lists # options UFS_DIRHASH #Improve performance on big directories @@ -104,8 +105,9 @@ options USB_DEBUG options USB_HOST_ALIGN=32 # AR724X (MIPS in general?) requires this #device ehci -device scbus #device umass + +device scbus device da # On-board SPI flash From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 00:43:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2E05106566B; Thu, 30 Aug 2012 00:43:14 +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 BD7FD8FC12; Thu, 30 Aug 2012 00:43: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 q7U0hENw042568; Thu, 30 Aug 2012 00:43:14 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U0hEQk042566; Thu, 30 Aug 2012 00:43:14 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208300043.q7U0hEQk042566@svn.freebsd.org> From: Jim Harris Date: Thu, 30 Aug 2012 00:43: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: r239889 - head/sys/dev/isci/scil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 00:43:14 -0000 Author: jimharris Date: Thu Aug 30 00:43:14 2012 New Revision: 239889 URL: http://svn.freebsd.org/changeset/base/239889 Log: Do not call sati_check_data_io() for SATI_UNMAP sequences. This routine is intended only for commands such as INQUIRY where the controller may fill out a smaller amount of data than allocated by the host. The end result of this bug was that isci(4) would report non-zero resid for successful SCSI_UNMAP commands. Sponsored by: Intel MFC after: 3 days Modified: head/sys/dev/isci/scil/sati.c Modified: head/sys/dev/isci/scil/sati.c ============================================================================== --- head/sys/dev/isci/scil/sati.c Wed Aug 29 22:58:52 2012 (r239888) +++ head/sys/dev/isci/scil/sati.c Thu Aug 30 00:43:14 2012 (r239889) @@ -1095,10 +1095,6 @@ SATI_STATUS sati_translate_command_respo status = sati_unmap_translate_response( sequence, scsi_io, ata_io ); - if(status == SATI_COMPLETE) - { - status = sati_check_data_io(sequence); - } break; #endif // !defined(DISABLE_SATI_UNMAP) From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 06:55:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D47F9106564A; Thu, 30 Aug 2012 06:55:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B51918FC08; Thu, 30 Aug 2012 06:55: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 q7U6tlrb093980; Thu, 30 Aug 2012 06:55:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U6tll1093976; Thu, 30 Aug 2012 06:55:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208300655.q7U6tll1093976@svn.freebsd.org> From: Adrian Chadd Date: Thu, 30 Aug 2012 06:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239890 - in head/sys/dev/ath/ath_hal: . ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 06:55:48 -0000 Author: adrian Date: Thu Aug 30 06:55:47 2012 New Revision: 239890 URL: http://svn.freebsd.org/changeset/base/239890 Log: Migrate the AR9285 diversity configuration LNA configuration to use some HAL definitions rather than local definitions. The original source (ath9k) pulled this stuff from the QCA driver and removed the HAL_* prefix. I'm just restoring the correct order of things. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar9002/ar9285.h head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Thu Aug 30 00:43:14 2012 (r239889) +++ head/sys/dev/ath/ath_hal/ah.h Thu Aug 30 06:55:47 2012 (r239890) @@ -855,6 +855,29 @@ typedef enum { HAL_MFP_HW_CRYPTO /* hardware decryption enabled. Merlin can do it. */ } HAL_MFP_OPT_T; +/* LNA config supported */ +typedef enum { + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2 = 0, + HAL_ANT_DIV_COMB_LNA2 = 1, + HAL_ANT_DIV_COMB_LNA1 = 2, + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2 = 3, +} HAL_ANT_DIV_COMB_LNA_CONF; + +typedef struct { + u_int8_t main_lna_conf; + u_int8_t alt_lna_conf; + u_int8_t fast_div_bias; + u_int8_t main_gaintb; + u_int8_t alt_gaintb; + u_int8_t antdiv_configgroup; + int8_t lna1_lna2_delta; +} HAL_ANT_COMB_CONFIG; + +#define DEFAULT_ANTDIV_CONFIG_GROUP 0x00 +#define HAL_ANTDIV_CONFIG_GROUP_1 0x01 +#define HAL_ANTDIV_CONFIG_GROUP_2 0x02 +#define HAL_ANTDIV_CONFIG_GROUP_3 0x03 + /* * Flag for setting QUIET period */ Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285.h Thu Aug 30 00:43:14 2012 (r239889) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285.h Thu Aug 30 06:55:47 2012 (r239890) @@ -20,13 +20,6 @@ #include "ar5416/ar5416.h" -enum ar9285_ant_div_comb_lna_conf { - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 = 0, - ATH_ANT_DIV_COMB_LNA2 = 1, - ATH_ANT_DIV_COMB_LNA1 = 2, - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 = 3, -}; - struct ar9285_ant_comb { uint16_t count; uint16_t total_pkt_count; @@ -46,8 +39,8 @@ struct ar9285_ant_comb { HAL_BOOL alt_good; int quick_scan_cnt; int main_conf; - enum ar9285_ant_div_comb_lna_conf first_quick_scan_conf; - enum ar9285_ant_div_comb_lna_conf second_quick_scan_conf; + HAL_ANT_DIV_COMB_LNA_CONF first_quick_scan_conf; + HAL_ANT_DIV_COMB_LNA_CONF second_quick_scan_conf; int first_bias; int second_bias; HAL_BOOL first_ratio; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Thu Aug 30 00:43:14 2012 (r239889) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Thu Aug 30 06:55:47 2012 (r239890) @@ -63,49 +63,49 @@ ath_lnaconf_alt_good_scan(struct ar9285_ { antcomb->quick_scan_cnt = 0; - if (ant_conf.main_lna_conf == ATH_ANT_DIV_COMB_LNA2) + if (ant_conf.main_lna_conf == HAL_ANT_DIV_COMB_LNA2) antcomb->rssi_lna2 = main_rssi_avg; - else if (ant_conf.main_lna_conf == ATH_ANT_DIV_COMB_LNA1) + else if (ant_conf.main_lna_conf == HAL_ANT_DIV_COMB_LNA1) antcomb->rssi_lna1 = main_rssi_avg; switch ((ant_conf.main_lna_conf << 4) | ant_conf.alt_lna_conf) { case (0x10): /* LNA2 A-B */ - antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + antcomb->main_conf = HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; antcomb->first_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; - antcomb->second_quick_scan_conf = ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; + antcomb->second_quick_scan_conf = HAL_ANT_DIV_COMB_LNA1; break; case (0x20): /* LNA1 A-B */ - antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + antcomb->main_conf = HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; antcomb->first_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; - antcomb->second_quick_scan_conf = ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; + antcomb->second_quick_scan_conf = HAL_ANT_DIV_COMB_LNA2; break; case (0x21): /* LNA1 LNA2 */ - antcomb->main_conf = ATH_ANT_DIV_COMB_LNA2; + antcomb->main_conf = HAL_ANT_DIV_COMB_LNA2; antcomb->first_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; antcomb->second_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; break; case (0x12): /* LNA2 LNA1 */ - antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1; + antcomb->main_conf = HAL_ANT_DIV_COMB_LNA1; antcomb->first_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; antcomb->second_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; break; case (0x13): /* LNA2 A+B */ - antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + antcomb->main_conf = HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; antcomb->first_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; - antcomb->second_quick_scan_conf = ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; + antcomb->second_quick_scan_conf = HAL_ANT_DIV_COMB_LNA1; break; case (0x23): /* LNA1 A+B */ - antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + antcomb->main_conf = HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; antcomb->first_quick_scan_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; - antcomb->second_quick_scan_conf = ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; + antcomb->second_quick_scan_conf = HAL_ANT_DIV_COMB_LNA2; break; default: break; @@ -131,7 +131,7 @@ ath_select_ant_div_from_quick_scan(struc antcomb->rssi_first = main_rssi_avg; antcomb->rssi_second = alt_rssi_avg; - if (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA1) { + if (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA1) { /* main is LNA1 */ if (ath_is_alt_ant_ratio_better(alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_HI, @@ -141,7 +141,7 @@ ath_select_ant_div_from_quick_scan(struc antcomb->first_ratio = AH_TRUE; else antcomb->first_ratio = AH_FALSE; - } else if (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA2) { + } else if (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA2) { if (ath_is_alt_ant_ratio_better(alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_MID, ATH_ANT_DIV_COMB_LNA1_DELTA_LOW, @@ -168,26 +168,26 @@ ath_select_ant_div_from_quick_scan(struc antcomb->rssi_first = main_rssi_avg; antcomb->rssi_third = alt_rssi_avg; - if (antcomb->second_quick_scan_conf == ATH_ANT_DIV_COMB_LNA1) + if (antcomb->second_quick_scan_conf == HAL_ANT_DIV_COMB_LNA1) antcomb->rssi_lna1 = alt_rssi_avg; else if (antcomb->second_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA2) antcomb->rssi_lna2 = alt_rssi_avg; else if (antcomb->second_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2) { - if (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2) { + if (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA2) antcomb->rssi_lna2 = main_rssi_avg; - else if (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA1) + else if (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA1) antcomb->rssi_lna1 = main_rssi_avg; } if (antcomb->rssi_lna2 > antcomb->rssi_lna1 + ATH_ANT_DIV_COMB_LNA1_LNA2_SWITCH_DELTA) - div_ant_conf->main_lna_conf = ATH_ANT_DIV_COMB_LNA2; + div_ant_conf->main_lna_conf = HAL_ANT_DIV_COMB_LNA2; else - div_ant_conf->main_lna_conf = ATH_ANT_DIV_COMB_LNA1; + div_ant_conf->main_lna_conf = HAL_ANT_DIV_COMB_LNA1; - if (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA1) { + if (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA1) { if (ath_is_alt_ant_ratio_better(alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_HI, ATH_ANT_DIV_COMB_LNA1_DELTA_LOW, @@ -196,7 +196,7 @@ ath_select_ant_div_from_quick_scan(struc antcomb->second_ratio = AH_TRUE; else antcomb->second_ratio = AH_FALSE; - } else if (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA2) { + } else if (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA2) { if (ath_is_alt_ant_ratio_better(alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_MID, ATH_ANT_DIV_COMB_LNA1_DELTA_LOW, @@ -221,33 +221,33 @@ ath_select_ant_div_from_quick_scan(struc if (antcomb->rssi_second > antcomb->rssi_third) { /* first alt*/ if ((antcomb->first_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA1) || + HAL_ANT_DIV_COMB_LNA1) || (antcomb->first_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA2)) + HAL_ANT_DIV_COMB_LNA2)) /* Set alt LNA1 or LNA2*/ if (div_ant_conf->main_lna_conf == - ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA2) div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; else div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; else /* Set alt to A+B or A-B */ div_ant_conf->alt_lna_conf = antcomb->first_quick_scan_conf; } else if ((antcomb->second_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA1) || + HAL_ANT_DIV_COMB_LNA1) || (antcomb->second_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA2)) { + HAL_ANT_DIV_COMB_LNA2)) { /* Set alt LNA1 or LNA2 */ if (div_ant_conf->main_lna_conf == - ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA2) div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; else div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; } else { /* Set alt to A+B or A-B */ div_ant_conf->alt_lna_conf = @@ -256,17 +256,17 @@ ath_select_ant_div_from_quick_scan(struc } else if (antcomb->first_ratio) { /* first alt */ if ((antcomb->first_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA1) || + HAL_ANT_DIV_COMB_LNA1) || (antcomb->first_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA2)) + HAL_ANT_DIV_COMB_LNA2)) /* Set alt LNA1 or LNA2 */ if (div_ant_conf->main_lna_conf == - ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA2) div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; else div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; else /* Set alt to A+B or A-B */ div_ant_conf->alt_lna_conf = @@ -274,33 +274,33 @@ ath_select_ant_div_from_quick_scan(struc } else if (antcomb->second_ratio) { /* second alt */ if ((antcomb->second_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA1) || + HAL_ANT_DIV_COMB_LNA1) || (antcomb->second_quick_scan_conf == - ATH_ANT_DIV_COMB_LNA2)) + HAL_ANT_DIV_COMB_LNA2)) /* Set alt LNA1 or LNA2 */ if (div_ant_conf->main_lna_conf == - ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA2) div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; else div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; else /* Set alt to A+B or A-B */ div_ant_conf->alt_lna_conf = antcomb->second_quick_scan_conf; } else { /* main is largest */ - if ((antcomb->main_conf == ATH_ANT_DIV_COMB_LNA1) || - (antcomb->main_conf == ATH_ANT_DIV_COMB_LNA2)) + if ((antcomb->main_conf == HAL_ANT_DIV_COMB_LNA1) || + (antcomb->main_conf == HAL_ANT_DIV_COMB_LNA2)) /* Set alt LNA1 or LNA2 */ if (div_ant_conf->main_lna_conf == - ATH_ANT_DIV_COMB_LNA2) + HAL_ANT_DIV_COMB_LNA2) div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; else div_ant_conf->alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; else /* Set alt to A+B or A-B */ div_ant_conf->alt_lna_conf = antcomb->main_conf; @@ -454,29 +454,29 @@ ar9285_ant_comb_scan(struct ath_hal *ah, if (!antcomb->scan) { if (alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO) { - if (curr_alt_set == ATH_ANT_DIV_COMB_LNA2) { + if (curr_alt_set == HAL_ANT_DIV_COMB_LNA2) { /* Switch main and alt LNA */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; - } else if (curr_alt_set == ATH_ANT_DIV_COMB_LNA1) { + HAL_ANT_DIV_COMB_LNA1; + } else if (curr_alt_set == HAL_ANT_DIV_COMB_LNA1) { div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; } goto div_comb_done; - } else if ((curr_alt_set != ATH_ANT_DIV_COMB_LNA1) && - (curr_alt_set != ATH_ANT_DIV_COMB_LNA2)) { + } else if ((curr_alt_set != HAL_ANT_DIV_COMB_LNA1) && + (curr_alt_set != HAL_ANT_DIV_COMB_LNA2)) { /* Set alt to another LNA */ - if (curr_main_set == ATH_ANT_DIV_COMB_LNA2) + if (curr_main_set == HAL_ANT_DIV_COMB_LNA2) div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; - else if (curr_main_set == ATH_ANT_DIV_COMB_LNA1) + HAL_ANT_DIV_COMB_LNA1; + else if (curr_main_set == HAL_ANT_DIV_COMB_LNA1) div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; goto div_comb_done; } @@ -488,33 +488,33 @@ ar9285_ant_comb_scan(struct ath_hal *ah, if (!antcomb->scan_not_start) { switch (curr_alt_set) { - case ATH_ANT_DIV_COMB_LNA2: + case HAL_ANT_DIV_COMB_LNA2: antcomb->rssi_lna2 = alt_rssi_avg; antcomb->rssi_lna1 = main_rssi_avg; antcomb->scan = AH_TRUE; /* set to A+B */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; break; - case ATH_ANT_DIV_COMB_LNA1: + case HAL_ANT_DIV_COMB_LNA1: antcomb->rssi_lna1 = alt_rssi_avg; antcomb->rssi_lna2 = main_rssi_avg; antcomb->scan = AH_TRUE; /* set to A+B */ - div_ant_conf.main_lna_conf = ATH_ANT_DIV_COMB_LNA2; + div_ant_conf.main_lna_conf = HAL_ANT_DIV_COMB_LNA2; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; break; - case ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2: + case HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2: antcomb->rssi_add = alt_rssi_avg; antcomb->scan = AH_TRUE; /* set to A-B */ div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; break; - case ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2: + case HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2: antcomb->rssi_sub = alt_rssi_avg; antcomb->scan = AH_FALSE; if (antcomb->rssi_lna2 > @@ -525,22 +525,22 @@ ar9285_ant_comb_scan(struct ath_hal *ah, (antcomb->rssi_add > antcomb->rssi_sub)) { /* set to A+B */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; } else if (antcomb->rssi_sub > antcomb->rssi_lna1) { /* set to A-B */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; } else { /* set to LNA1 */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; } } else { /* use LNA1 as main LNA */ @@ -548,22 +548,22 @@ ar9285_ant_comb_scan(struct ath_hal *ah, (antcomb->rssi_add > antcomb->rssi_sub)) { /* set to A+B */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_PLUS_LNA2; } else if (antcomb->rssi_sub > antcomb->rssi_lna1) { /* set to A-B */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; + HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2; } else { /* set to LNA2 */ div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; } } break; @@ -574,16 +574,16 @@ ar9285_ant_comb_scan(struct ath_hal *ah, if (!antcomb->alt_good) { antcomb->scan_not_start = AH_FALSE; /* Set alt to another LNA */ - if (curr_main_set == ATH_ANT_DIV_COMB_LNA2) { + if (curr_main_set == HAL_ANT_DIV_COMB_LNA2) { div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA1; - } else if (curr_main_set == ATH_ANT_DIV_COMB_LNA1) { + HAL_ANT_DIV_COMB_LNA1; + } else if (curr_main_set == HAL_ANT_DIV_COMB_LNA1) { div_ant_conf.main_lna_conf = - ATH_ANT_DIV_COMB_LNA1; + HAL_ANT_DIV_COMB_LNA1; div_ant_conf.alt_lna_conf = - ATH_ANT_DIV_COMB_LNA2; + HAL_ANT_DIV_COMB_LNA2; } goto div_comb_done; } @@ -697,8 +697,8 @@ ar9285SetAntennaSwitch(struct ath_hal *a /* Diversity disabled, RX = LNA1 */ HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: HAL_ANT_FIXED_A\n", __func__); - regVal |= SM(ATH_ANT_DIV_COMB_LNA2, AR_PHY_9285_ANT_DIV_ALT_LNACONF); - regVal |= SM(ATH_ANT_DIV_COMB_LNA1, AR_PHY_9285_ANT_DIV_MAIN_LNACONF); + regVal |= SM(HAL_ANT_DIV_COMB_LNA2, AR_PHY_9285_ANT_DIV_ALT_LNACONF); + regVal |= SM(HAL_ANT_DIV_COMB_LNA1, AR_PHY_9285_ANT_DIV_MAIN_LNACONF); regVal |= SM(AR_PHY_9285_ANT_DIV_GAINTB_0, AR_PHY_9285_ANT_DIV_ALT_GAINTB); regVal |= SM(AR_PHY_9285_ANT_DIV_GAINTB_1, AR_PHY_9285_ANT_DIV_MAIN_GAINTB); } @@ -706,8 +706,8 @@ ar9285SetAntennaSwitch(struct ath_hal *a /* Diversity disabled, RX = LNA2 */ HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: HAL_ANT_FIXED_B\n", __func__); - regVal |= SM(ATH_ANT_DIV_COMB_LNA1, AR_PHY_9285_ANT_DIV_ALT_LNACONF); - regVal |= SM(ATH_ANT_DIV_COMB_LNA2, AR_PHY_9285_ANT_DIV_MAIN_LNACONF); + regVal |= SM(HAL_ANT_DIV_COMB_LNA1, AR_PHY_9285_ANT_DIV_ALT_LNACONF); + regVal |= SM(HAL_ANT_DIV_COMB_LNA2, AR_PHY_9285_ANT_DIV_MAIN_LNACONF); regVal |= SM(AR_PHY_9285_ANT_DIV_GAINTB_1, AR_PHY_9285_ANT_DIV_ALT_GAINTB); regVal |= SM(AR_PHY_9285_ANT_DIV_GAINTB_0, AR_PHY_9285_ANT_DIV_MAIN_GAINTB); } @@ -740,8 +740,8 @@ ar9285SetAntennaSwitch(struct ath_hal *a __func__); regVal = OS_REG_READ(ah, AR_PHY_MULTICHAIN_GAIN_CTL); regVal &= (~(AR_PHY_9285_ANT_DIV_MAIN_LNACONF | AR_PHY_9285_ANT_DIV_ALT_LNACONF)); - regVal |= (ATH_ANT_DIV_COMB_LNA1 << AR_PHY_9285_ANT_DIV_MAIN_LNACONF_S); - regVal |= (ATH_ANT_DIV_COMB_LNA2 << AR_PHY_9285_ANT_DIV_ALT_LNACONF_S); + regVal |= (HAL_ANT_DIV_COMB_LNA1 << AR_PHY_9285_ANT_DIV_MAIN_LNACONF_S); + regVal |= (HAL_ANT_DIV_COMB_LNA2 << AR_PHY_9285_ANT_DIV_ALT_LNACONF_S); regVal &= (~(AR_PHY_9285_FAST_DIV_BIAS)); regVal |= (0 << AR_PHY_9285_FAST_DIV_BIAS_S); OS_REG_WRITE(ah, AR_PHY_MULTICHAIN_GAIN_CTL, regVal); From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 08:03:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF49B106564A; Thu, 30 Aug 2012 08:03:33 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB2A68FC0C; Thu, 30 Aug 2012 08:03: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 q7U83XTI004015; Thu, 30 Aug 2012 08:03:33 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U83XIW004013; Thu, 30 Aug 2012 08:03:33 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208300803.q7U83XIW004013@svn.freebsd.org> From: Andrey Zonov Date: Thu, 30 Aug 2012 08:03: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: r239895 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 08:03:34 -0000 Author: zont Date: Thu Aug 30 08:03:33 2012 New Revision: 239895 URL: http://svn.freebsd.org/changeset/base/239895 Log: - Remove accounting of locked memory from vsunlock(9) that I missed in r239818. Approved by: kib (mentor) Modified: head/sys/vm/vm_glue.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Thu Aug 30 07:45:25 2012 (r239894) +++ head/sys/vm/vm_glue.c Thu Aug 30 08:03:33 2012 (r239895) @@ -224,13 +224,6 @@ vsunlock(void *addr, size_t len) (void)vm_map_unwire(&curproc->p_vmspace->vm_map, trunc_page((vm_offset_t)addr), round_page((vm_offset_t)addr + len), VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); - -#ifdef RACCT - PROC_LOCK(curproc); - racct_set(curproc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(vm_map_pmap(&curproc->p_vmspace->vm_map)))); - PROC_UNLOCK(curproc); -#endif } /* From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 08:07:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A82EA1065670; Thu, 30 Aug 2012 08:07:37 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 936128FC20; Thu, 30 Aug 2012 08:07: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 q7U87bRL004540; Thu, 30 Aug 2012 08:07:37 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U87bfx004538; Thu, 30 Aug 2012 08:07:37 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208300807.q7U87bfx004538@svn.freebsd.org> From: Andrey Zonov Date: Thu, 30 Aug 2012 08:07: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: r239896 - head/usr.sbin/watchdogd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 08:07:37 -0000 Author: zont Date: Thu Aug 30 08:07:37 2012 New Revision: 239896 URL: http://svn.freebsd.org/changeset/base/239896 Log: - It's also need to lock current memory. Approved by: kib (mentor) MFC after: 1 week Modified: head/usr.sbin/watchdogd/watchdogd.c Modified: head/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.c Thu Aug 30 08:03:33 2012 (r239895) +++ head/usr.sbin/watchdogd/watchdogd.c Thu Aug 30 08:07:37 2012 (r239896) @@ -118,7 +118,7 @@ main(int argc, char *argv[]) pidfile_write(pfh); if (madvise(0, 0, MADV_PROTECT) != 0) warn("madvise failed"); - if (mlockall(MCL_FUTURE) != 0) + if (mlockall(MCL_CURRENT | MCL_FUTURE) != 0) warn("mlockall failed"); watchdog_loop(); From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 08:54:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2EFAD1065670; Thu, 30 Aug 2012 08:54:14 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19E688FC08; Thu, 30 Aug 2012 08: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 q7U8sDAc010450; Thu, 30 Aug 2012 08:54:13 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7U8sDon010446; Thu, 30 Aug 2012 08:54:13 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208300854.q7U8sDon010446@svn.freebsd.org> From: Andrey Zonov Date: Thu, 30 Aug 2012 08:54: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: r239898 - head/usr.bin/truss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 08:54:14 -0000 Author: zont Date: Thu Aug 30 08:54:13 2012 New Revision: 239898 URL: http://svn.freebsd.org/changeset/base/239898 Log: - Remove unused variables. - Fix warnings about comparing signed and unsigned ints. Approved by: kib (mentor) Modified: head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/powerpc64-fbsd.c Modified: head/usr.bin/truss/powerpc-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc-fbsd.c Thu Aug 30 08:37:06 2012 (r239897) +++ head/usr.bin/truss/powerpc-fbsd.c Thu Aug 30 08:54:13 2012 (r239898) @@ -115,12 +115,11 @@ clear_fsc(void) { void powerpc_syscall_entry(struct trussinfo *trussinfo, int nargs) { - char buf[32]; struct reg regs; void *args; int syscall_num; int i; - unsigned int regargs; + int regargs; struct syscall *sc; /* Account for a 64-bit argument with corresponding alignment. */ Modified: head/usr.bin/truss/powerpc64-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-fbsd.c Thu Aug 30 08:37:06 2012 (r239897) +++ head/usr.bin/truss/powerpc64-fbsd.c Thu Aug 30 08:54:13 2012 (r239898) @@ -110,12 +110,11 @@ clear_fsc(void) { void powerpc64_syscall_entry(struct trussinfo *trussinfo, int nargs) { - char buf[32]; struct reg regs; void *args; int syscall_num; int i; - unsigned int regargs; + int regargs; struct syscall *sc; cpid = trussinfo->curthread->tid; From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 11:52:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C405C1065670; Thu, 30 Aug 2012 11:52:26 +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 AF25F8FC16; Thu, 30 Aug 2012 11:52: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 q7UBqQm2035565; Thu, 30 Aug 2012 11:52:26 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UBqQwK035563; Thu, 30 Aug 2012 11:52:26 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201208301152.q7UBqQwK035563@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 30 Aug 2012 11:52: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: r239904 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 11:52:26 -0000 Author: pluknet Date: Thu Aug 30 11:52:26 2012 New Revision: 239904 URL: http://svn.freebsd.org/changeset/base/239904 Log: Remove a duplicated "thread". Modified: head/share/man/man9/locking.9 Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Thu Aug 30 11:00:00 2012 (r239903) +++ head/share/man/man9/locking.9 Thu Aug 30 11:52:26 2012 (r239904) @@ -155,7 +155,7 @@ A thread must hold the mutex before call .Fn cv_wait* , functions. When a thread waits on a condition, the mutex -is atomically released before the thread thread yields the processor, +is atomically released before the thread yields the processor, then reacquired before the function call returns. .Pp See From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 12:18:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7059D106566C; Thu, 30 Aug 2012 12:18:46 +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 5B39A8FC0A; Thu, 30 Aug 2012 12:18: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 q7UCIkCr039183; Thu, 30 Aug 2012 12:18:46 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UCIkBT039181; Thu, 30 Aug 2012 12:18:46 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201208301218.q7UCIkBT039181@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 30 Aug 2012 12:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239905 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 12:18:46 -0000 Author: glebius Date: Thu Aug 30 12:18:45 2012 New Revision: 239905 URL: http://svn.freebsd.org/changeset/base/239905 Log: In ifc_alloc_unit(): - In the !wildcard case, return ENOSPC instead of confusing EEXIST in case if ifc->ifc_maxunit reached. - Fix unit leak, that I've introduced in previous revision. Submitted by: Daan Vreeken Modified: head/sys/net/if_clone.c Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Thu Aug 30 11:52:26 2012 (r239904) +++ head/sys/net/if_clone.c Thu Aug 30 12:18:45 2012 (r239905) @@ -443,21 +443,30 @@ ifc_alloc_unit(struct if_clone *ifc, int wildcard = (*unit < 0); retry: - if (wildcard) { + if (*unit > ifc->ifc_maxunit) + return (ENOSPC); + if (*unit < 0) { *unit = alloc_unr(ifc->ifc_unrhdr); if (*unit == -1) return (ENOSPC); } else { *unit = alloc_unr_specific(ifc->ifc_unrhdr, *unit); - if (*unit == -1) - return (EEXIST); + if (*unit == -1) { + if (wildcard) { + (*unit)++; + goto retry; + } else + return (EEXIST); + } } snprintf(name, IFNAMSIZ, "%s%d", ifc->ifc_name, *unit); if (ifunit(name) != NULL) { - if (wildcard) - goto retry; /* XXXGL: yep, it's a unit leak */ - else + free_unr(ifc->ifc_unrhdr, *unit); + if (wildcard) { + (*unit)++; + goto retry; + } else return (EEXIST); } From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 14:44:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75E4C1065670; Thu, 30 Aug 2012 14:44:31 +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 623028FC21; Thu, 30 Aug 2012 14:44: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 q7UEiVwA059513; Thu, 30 Aug 2012 14:44:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UEiVKu059511; Thu, 30 Aug 2012 14:44:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208301444.q7UEiVKu059511@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 14:44: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: r239906 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 14:44:31 -0000 Author: jhb Date: Thu Aug 30 14:44:30 2012 New Revision: 239906 URL: http://svn.freebsd.org/changeset/base/239906 Log: Clarify that bus_dma does not stall future load requests once a load is deferred. The caller is required to enforce that if that is desired. MFC after: 2 weeks Modified: head/share/man/man9/bus_dma.9 Modified: head/share/man/man9/bus_dma.9 ============================================================================== --- head/share/man/man9/bus_dma.9 Thu Aug 30 12:18:45 2012 (r239905) +++ head/share/man/man9/bus_dma.9 Thu Aug 30 14:44:30 2012 (r239906) @@ -580,8 +580,13 @@ The status of the mapping has been deliv The mapping has been deferred for lack of resources. The callback will be called as soon as resources are available. Callbacks are serviced in FIFO order. -To ensure that ordering is guaranteed, all subsequent load requests will also -be deferred until all callbacks have been processed. +.Pp +Note that subsequent load operations for the same tag that do not require +extra resources will still succeed. +This may result in out-of-order processing of requests. +If the caller requires the order of requests to be preserved, +then the caller is required to stall subsequent requests until a pending +request's callback is invoked. .It Er ENOMEM The load request has failed due to insufficient resources, and the caller specifically used the From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 15:24:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A310B1065674; Thu, 30 Aug 2012 15:24:00 +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 748548FC16; Thu, 30 Aug 2012 15:24: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 q7UFO03f067773; Thu, 30 Aug 2012 15:24:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UFO0lr067769; Thu, 30 Aug 2012 15:24:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208301524.q7UFO0lr067769@svn.freebsd.org> From: Alexander Motin Date: Thu, 30 Aug 2012 15:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239907 - in head/sys/dev: ahci ata ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 15:24:00 -0000 Author: mav Date: Thu Aug 30 15:23:59 2012 New Revision: 239907 URL: http://svn.freebsd.org/changeset/base/239907 Log: Add IDs for JMicron JMB360/JMB362 AHCI SATA controllers. MFC after: 1 week Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-jmicron.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu Aug 30 14:44:30 2012 (r239906) +++ head/sys/dev/ahci/ahci.c Thu Aug 30 15:23:59 2012 (r239907) @@ -175,7 +175,9 @@ static struct { {0x1e0e8086, 0x00, "Intel Panther Point", 0}, {0x1e0f8086, 0x00, "Intel Panther Point", 0}, {0x23238086, 0x00, "Intel DH89xxCC", 0}, + {0x2360197b, 0x00, "JMicron JMB360", 0}, {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, + {0x2362197b, 0x00, "JMicron JMB362", 0}, {0x2363197b, 0x00, "JMicron JMB363", AHCI_Q_NOFORCE}, {0x2365197b, 0x00, "JMicron JMB365", AHCI_Q_NOFORCE}, {0x2366197b, 0x00, "JMicron JMB366", AHCI_Q_NOFORCE}, Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Thu Aug 30 14:44:30 2012 (r239906) +++ head/sys/dev/ata/ata-pci.h Thu Aug 30 15:23:59 2012 (r239907) @@ -266,6 +266,7 @@ struct ata_pci_controller { #define ATA_JMICRON_ID 0x197b #define ATA_JMB360 0x2360197b #define ATA_JMB361 0x2361197b +#define ATA_JMB362 0x2362197b #define ATA_JMB363 0x2363197b #define ATA_JMB365 0x2365197b #define ATA_JMB366 0x2366197b Modified: head/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-jmicron.c Thu Aug 30 14:44:30 2012 (r239906) +++ head/sys/dev/ata/chipsets/ata-jmicron.c Thu Aug 30 15:23:59 2012 (r239907) @@ -67,6 +67,7 @@ ata_jmicron_probe(device_t dev) static const struct ata_chip_id const ids[] = {{ ATA_JMB360, 0, 1, 0, ATA_SA300, "JMB360" }, { ATA_JMB361, 0, 1, 1, ATA_UDMA6, "JMB361" }, + { ATA_JMB362, 0, 2, 0, ATA_SA300, "JMB362" }, { ATA_JMB363, 0, 2, 1, ATA_UDMA6, "JMB363" }, { ATA_JMB365, 0, 1, 2, ATA_UDMA6, "JMB365" }, { ATA_JMB366, 0, 2, 2, ATA_UDMA6, "JMB366" }, From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 15:47:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9A3B106564A; Thu, 30 Aug 2012 15:47:21 +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 9B6318FC0A; Thu, 30 Aug 2012 15:47: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 q7UFlLYm070679; Thu, 30 Aug 2012 15:47:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UFlL6C070676; Thu, 30 Aug 2012 15:47:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201208301547.q7UFlL6C070676@svn.freebsd.org> From: Alexander Motin Date: Thu, 30 Aug 2012 15:47: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: r239908 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 15:47:21 -0000 Author: mav Date: Thu Aug 30 15:47:20 2012 New Revision: 239908 URL: http://svn.freebsd.org/changeset/base/239908 Log: Add bunch of ATI HDMI HDA controller IDs. Submitted by: Dmitry Luhtionov MFC after: 1 week Modified: head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Thu Aug 30 15:23:59 2012 (r239907) +++ head/sys/dev/sound/pci/hda/hdac.c Thu Aug 30 15:47:20 2012 (r239908) @@ -138,6 +138,15 @@ static const struct { { HDA_ATI_RV730, "ATI RV730", 0, 0 }, { HDA_ATI_RV740, "ATI RV740", 0, 0 }, { HDA_ATI_RV770, "ATI RV770", 0, 0 }, + { HDA_ATI_RV810, "ATI RV810", 0, 0 }, + { HDA_ATI_RV830, "ATI RV830", 0, 0 }, + { HDA_ATI_RV840, "ATI RV840", 0, 0 }, + { HDA_ATI_RV870, "ATI RV870", 0, 0 }, + { HDA_ATI_RV910, "ATI RV910", 0, 0 }, + { HDA_ATI_RV930, "ATI RV930", 0, 0 }, + { HDA_ATI_RV940, "ATI RV940", 0, 0 }, + { HDA_ATI_RV970, "ATI RV970", 0, 0 }, + { HDA_ATI_R1000, "ATI R1000", 0, 0 }, { HDA_RDC_M3010, "RDC M3010", 0, 0 }, { HDA_VIA_VT82XX, "VIA VT8251/8237A",0, 0 }, { HDA_SIS_966, "SiS 966", 0, 0 }, Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Thu Aug 30 15:23:59 2012 (r239907) +++ head/sys/dev/sound/pci/hda/hdac.h Thu Aug 30 15:47:20 2012 (r239908) @@ -110,6 +110,15 @@ #define HDA_ATI_RV730 HDA_MODEL_CONSTRUCT(ATI, 0xaa38) #define HDA_ATI_RV710 HDA_MODEL_CONSTRUCT(ATI, 0xaa40) #define HDA_ATI_RV740 HDA_MODEL_CONSTRUCT(ATI, 0xaa48) +#define HDA_ATI_RV870 HDA_MODEL_CONSTRUCT(ATI, 0xaa50) +#define HDA_ATI_RV840 HDA_MODEL_CONSTRUCT(ATI, 0xaa58) +#define HDA_ATI_RV830 HDA_MODEL_CONSTRUCT(ATI, 0xaa60) +#define HDA_ATI_RV810 HDA_MODEL_CONSTRUCT(ATI, 0xaa68) +#define HDA_ATI_RV970 HDA_MODEL_CONSTRUCT(ATI, 0xaa80) +#define HDA_ATI_RV940 HDA_MODEL_CONSTRUCT(ATI, 0xaa88) +#define HDA_ATI_RV930 HDA_MODEL_CONSTRUCT(ATI, 0xaa90) +#define HDA_ATI_RV910 HDA_MODEL_CONSTRUCT(ATI, 0xaa98) +#define HDA_ATI_R1000 HDA_MODEL_CONSTRUCT(ATI, 0xaaa0) #define HDA_ATI_ALL HDA_MODEL_CONSTRUCT(ATI, 0xffff) /* RDC */ From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 16:19:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E1BC106564A; Thu, 30 Aug 2012 16:19:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBBAC8FC08; Thu, 30 Aug 2012 16:19: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 q7UGJ5BA074288; Thu, 30 Aug 2012 16:19:05 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UGJ5hW074284; Thu, 30 Aug 2012 16:19:05 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201208301619.q7UGJ5hW074284@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 30 Aug 2012 16:19: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: r239909 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 16:19:06 -0000 Author: hselasky Date: Thu Aug 30 16:19:05 2012 New Revision: 239909 URL: http://svn.freebsd.org/changeset/base/239909 Log: Preparations for adding USB HOST mode to the DWC OTG driver. Merge register file with external one and put all register definitions in a separate file. Submitted by: ray @ Added: head/sys/dev/usb/controller/dwc_otgreg.h (contents, props changed) Modified: head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/dwc_otg.h Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Thu Aug 30 15:47:20 2012 (r239908) +++ head/sys/dev/usb/controller/dwc_otg.c Thu Aug 30 16:19:05 2012 (r239909) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #define DWC_OTG_BUS2SC(bus) \ ((struct dwc_otg_softc *)(((uint8_t *)(bus)) - \ @@ -90,12 +91,12 @@ __FBSDID("$FreeBSD$"); DWC_OTG_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) #define DWC_OTG_MSK_GINT_ENABLED \ - (DWC_OTG_MSK_GINT_ENUM_DONE | \ - DWC_OTG_MSK_GINT_USB_RESET | \ - DWC_OTG_MSK_GINT_USB_SUSPEND | \ - DWC_OTG_MSK_GINT_INEP | \ - DWC_OTG_MSK_GINT_RXFLVL | \ - DWC_OTG_MSK_GINT_SESSREQINT) + (GINTSTS_ENUMDONE | \ + GINTSTS_USBRST | \ + GINTSTS_USBSUSP | \ + GINTSTS_IEPINT | \ + GINTSTS_RXFLVL | \ + GINTSTS_SESSREQINT) #define DWC_OTG_USE_HSIC 0 @@ -172,7 +173,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc * /* split equally for IN and OUT */ fifo_size /= 2; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRXFSIZ, fifo_size / 4); + DWC_OTG_WRITE_4(sc, DOTG_GRXFSIZ, fifo_size / 4); /* align to 4-bytes */ fifo_size &= ~3; @@ -185,7 +186,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc * return (EINVAL); } - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GNPTXFSIZ, (0x10 << 16) | (tx_start / 4)); + DWC_OTG_WRITE_4(sc, DOTG_GNPTXFSIZ, (0x10 << 16) | (tx_start / 4)); fifo_size -= 0x40; tx_start += 0x40; @@ -210,7 +211,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc * (DWC_OTG_MAX_TXN / 2); if (fifo_size >= limit) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTXF(x), + DWC_OTG_WRITE_4(sc, DOTG_DIEPTXF(x), ((limit / 4) << 16) | (tx_start / 4)); tx_start += limit; @@ -220,7 +221,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc * pf->max_buffer = limit; } else if (fifo_size >= 0x80) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTXF(x), + DWC_OTG_WRITE_4(sc, DOTG_DIEPTXF(x), ((0x80 / 4) << 16) | (tx_start / 4)); tx_start += 0x80; fifo_size -= 0x80; @@ -229,7 +230,7 @@ dwc_otg_init_fifo(struct dwc_otg_softc * } else { pf->usb.is_simplex = 1; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTXF(x), + DWC_OTG_WRITE_4(sc, DOTG_DIEPTXF(x), (0x0 << 16) | (tx_start / 4)); } } else { @@ -242,13 +243,13 @@ dwc_otg_init_fifo(struct dwc_otg_softc * } /* reset RX FIFO */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, - DWC_OTG_MSK_GRSTCTL_RXFFLUSH); + DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, + GRSTCTL_RXFFLSH); /* reset all TX FIFOs */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, - DWC_OTG_MSK_GRSTCTL_TXFIFO(0x10) | - DWC_OTG_MSK_GRSTCTL_TXFFLUSH); + DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, + GRSTCTL_TXFIFO(0x10) | + GRSTCTL_TXFFLSH); return (0); } @@ -291,9 +292,9 @@ dwc_otg_pull_up(struct dwc_otg_softc *sc sc->sc_flags.port_powered) { sc->sc_flags.d_pulled_up = 1; - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCTL); - temp &= ~DWC_OTG_MSK_DCTL_SOFT_DISC; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); + temp = DWC_OTG_READ_4(sc, DOTG_DCTL); + temp &= ~DCTL_SFTDISCON; + DWC_OTG_WRITE_4(sc, DOTG_DCTL, temp); } } @@ -307,9 +308,9 @@ dwc_otg_pull_down(struct dwc_otg_softc * if (sc->sc_flags.d_pulled_up) { sc->sc_flags.d_pulled_up = 0; - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCTL); - temp |= DWC_OTG_MSK_DCTL_SOFT_DISC; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); + temp = DWC_OTG_READ_4(sc, DOTG_DCTL); + temp |= DCTL_SFTDISCON; + DWC_OTG_WRITE_4(sc, DOTG_DCTL, temp); } } @@ -325,9 +326,9 @@ dwc_otg_resume_irq(struct dwc_otg_softc * Disable resume interrupt and enable suspend * interrupt: */ - sc->sc_irq_mask &= ~DWC_OTG_MSK_GINT_WKUPINT; - sc->sc_irq_mask |= DWC_OTG_MSK_GINT_USB_SUSPEND; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + sc->sc_irq_mask &= ~GINTSTS_WKUPINT; + sc->sc_irq_mask |= GINTSTS_USBSUSP; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* complete root HUB interrupt endpoint */ dwc_otg_root_intr(sc); @@ -345,15 +346,15 @@ dwc_otg_wakeup_peer(struct dwc_otg_softc DPRINTFN(5, "Remote wakeup\n"); /* enable remote wakeup signalling */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCTL); - temp |= DWC_OTG_MSK_DCTL_REMOTE_WAKEUP; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); + temp = DWC_OTG_READ_4(sc, DOTG_DCTL); + temp |= DCTL_RMTWKUPSIG; + DWC_OTG_WRITE_4(sc, DOTG_DCTL, temp); /* Wait 8ms for remote wakeup to complete. */ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); - temp &= ~DWC_OTG_MSK_DCTL_REMOTE_WAKEUP; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); + temp &= ~DCTL_RMTWKUPSIG; + DWC_OTG_WRITE_4(sc, DOTG_DCTL, temp); /* need to fake resume IRQ */ dwc_otg_resume_irq(sc); @@ -366,10 +367,10 @@ dwc_otg_set_address(struct dwc_otg_softc DPRINTFN(5, "addr=%d\n", addr); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCFG); - temp &= ~DWC_OTG_MSK_DCFG_SET_DEV_ADDR(0x7F); - temp |= DWC_OTG_MSK_DCFG_SET_DEV_ADDR(addr); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCFG, temp); + temp = DWC_OTG_READ_4(sc, DOTG_DCFG); + temp &= ~DCFG_DEVADDR_SET(0x7F); + temp |= DCFG_DEVADDR_SET(addr); + DWC_OTG_WRITE_4(sc, DOTG_DCFG, temp); } static void @@ -378,8 +379,8 @@ dwc_otg_common_rx_ack(struct dwc_otg_sof DPRINTFN(5, "RX status clear\n"); /* enable RX FIFO level interrupt */ - sc->sc_irq_mask |= DWC_OTG_MSK_GINT_RXFLVL; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + sc->sc_irq_mask |= GINTSTS_RXFLVL; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* clear cached status */ sc->sc_last_rx_status = 0; @@ -401,18 +402,18 @@ dwc_otg_setup_rx(struct dwc_otg_td *td) if (sc->sc_last_rx_status == 0) goto not_complete; - if (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(sc->sc_last_rx_status) != 0) + if (GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) != 0) goto not_complete; - if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PID) != - DWC_OTG_MSK_GRXSTS_PID_DATA0) { + if ((sc->sc_last_rx_status & GRXSTSRD_DPID_MASK) != + GRXSTSRD_DPID_DATA0) { /* release FIFO */ dwc_otg_common_rx_ack(sc); goto not_complete; } - if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PACKET_STS) != - DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { + if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) != + GRXSTSRD_STP_DATA) { /* release FIFO */ dwc_otg_common_rx_ack(sc); goto not_complete; @@ -424,7 +425,7 @@ dwc_otg_setup_rx(struct dwc_otg_td *td) td->did_stall = 0; /* get the packet byte count */ - count = DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT(sc->sc_last_rx_status); + count = GRXSTSRD_BCNT_GET(sc->sc_last_rx_status); /* verify data length */ if (count != td->remainder) { @@ -459,22 +460,22 @@ dwc_otg_setup_rx(struct dwc_otg_td *td) } /* don't send any data by default */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTSIZ(0), - DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(0) | - DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(0)); + DWC_OTG_WRITE_4(sc, DOTG_DIEPTSIZ(0), + DXEPTSIZ_SET_NPKT(0) | + DXEPTSIZ_SET_NBYTES(0)); temp = sc->sc_in_ctl[0]; /* enable IN endpoint */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(0), - temp | DWC_OTG_MSK_DIEPCTL_ENABLE); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(0), - temp | DWC_OTG_MSK_DIEPCTL_SET_NAK); + DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(0), + temp | DIEPCTL_EPENA); + DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(0), + temp | DIEPCTL_SNAK); /* reset IN endpoint buffer */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, - DWC_OTG_MSK_GRSTCTL_TXFIFO(0) | - DWC_OTG_MSK_GRSTCTL_TXFFLUSH); + DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, + GRSTCTL_TXFIFO(0) | + GRSTCTL_TXFFLSH); /* acknowledge RX status */ dwc_otg_common_rx_ack(sc); @@ -485,11 +486,11 @@ not_complete: temp = sc->sc_out_ctl[0]; - temp |= DWC_OTG_MSK_DOEPCTL_ENABLE | - DWC_OTG_MSK_DOEPCTL_SET_NAK; + temp |= DOEPCTL_EPENA | + DOEPCTL_SNAK; /* enable OUT endpoint */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(0), temp); + DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(0), temp); if (!td->did_stall) { td->did_stall = 1; @@ -497,21 +498,21 @@ not_complete: DPRINTFN(5, "stalling IN and OUT direction\n"); /* set stall after enabling endpoint */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(0), - temp | DWC_OTG_MSK_DOEPCTL_STALL); + DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(0), + temp | DOEPCTL_STALL); temp = sc->sc_in_ctl[0]; /* set stall assuming endpoint is enabled */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(0), - temp | DWC_OTG_MSK_DIEPCTL_STALL); + DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(0), + temp | DIEPCTL_STALL); } /* setup number of buffers to receive */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPTSIZ(0), - DWC_OTG_MSK_DXEPTSIZ_SET_MULTI(3) | - DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(1) | - DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(sizeof(req))); + DWC_OTG_WRITE_4(sc, DOTG_DOEPTSIZ(0), + DXEPTSIZ_SET_MULTI(3) | + DXEPTSIZ_SET_NPKT(1) | + DXEPTSIZ_SET_NBYTES(sizeof(req))); return (1); /* not complete */ } @@ -533,12 +534,12 @@ dwc_otg_data_rx(struct dwc_otg_td *td) if (sc->sc_last_rx_status == 0) goto not_complete; - if (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(sc->sc_last_rx_status) != td->ep_no) + if (GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) != td->ep_no) goto not_complete; /* check for SETUP packet */ - if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PACKET_STS) == - DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { + if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) == + GRXSTSRD_STP_DATA) { if (td->remainder == 0) { /* * We are actually complete and have @@ -554,15 +555,15 @@ dwc_otg_data_rx(struct dwc_otg_td *td) return (0); /* complete */ } - if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PACKET_STS) != - DWC_OTG_MSK_GRXSTS_DEV_OUT_DATA) { + if ((sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) != + GRXSTSRD_OUT_DATA) { /* release FIFO */ dwc_otg_common_rx_ack(sc); goto not_complete; } /* get the packet byte count */ - count = DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT(sc->sc_last_rx_status); + count = GRXSTSRD_BCNT_GET(sc->sc_last_rx_status); /* verify the packet byte count */ if (count != td->max_packet_size) { @@ -609,22 +610,22 @@ not_complete: temp = sc->sc_out_ctl[td->ep_no]; - temp |= DWC_OTG_MSK_DOEPCTL_ENABLE | - DWC_OTG_MSK_DOEPCTL_CLR_NAK; + temp |= DOEPCTL_EPENA | + DOEPCTL_CNAK; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(td->ep_no), temp); + DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(td->ep_no), temp); /* enable SETUP and transfer complete interrupt */ if (td->ep_no == 0) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPTSIZ(0), - DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(1) | - DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(td->max_packet_size)); + DWC_OTG_WRITE_4(sc, DOTG_DOEPTSIZ(0), + DXEPTSIZ_SET_NPKT(1) | + DXEPTSIZ_SET_NBYTES(td->max_packet_size)); } else { /* allow reception of multiple packets */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPTSIZ(td->ep_no), - DWC_OTG_MSK_DXEPTSIZ_SET_MULTI(1) | - DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(4) | - DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(4 * + DWC_OTG_WRITE_4(sc, DOTG_DOEPTSIZ(td->ep_no), + DXEPTSIZ_SET_MULTI(1) | + DXEPTSIZ_SET_NPKT(4) | + DXEPTSIZ_SET_NBYTES(4 * ((td->max_packet_size + 3) & ~3))); } return (1); /* not complete */ @@ -654,10 +655,10 @@ repeat: temp = sc->sc_last_rx_status; if ((td->ep_no == 0) && (temp != 0) && - (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(temp) == 0)) { + (GRXSTSRD_CHNUM_GET(temp) == 0)) { - if ((temp & DWC_OTG_MSK_GRXSTS_PACKET_STS) != - DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { + if ((temp & GRXSTSRD_PKTSTS_MASK) != + GRXSTSRD_STP_DATA) { /* dump data - wrong direction */ dwc_otg_common_rx_ack(sc); @@ -677,10 +678,10 @@ repeat: uint16_t cpkt; /* check if packets have been transferred */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no)); + temp = DWC_OTG_READ_4(sc, DOTG_DIEPTSIZ(td->ep_no)); /* get current packet number */ - cpkt = DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp); + cpkt = DXEPTSIZ_GET_NPKT(temp); if (cpkt >= td->npkt) { fifo_left = 0; @@ -711,7 +712,7 @@ repeat: /* transfer data into FIFO */ bus_space_write_region_4(sc->sc_io_tag, sc->sc_io_hdl, - DWC_OTG_REG_DFIFO(td->ep_no), + DOTG_DFIFO(td->ep_no), sc->sc_tx_bounce_buffer, (count + 3) / 4); td->tx_bytes -= count; @@ -735,14 +736,14 @@ repeat: goto not_complete; /* check if not all packets have been transferred */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no)); + temp = DWC_OTG_READ_4(sc, DOTG_DIEPTSIZ(td->ep_no)); - if (DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp) != 0) { + if (DXEPTSIZ_GET_NPKT(temp) != 0) { DPRINTFN(5, "busy ep=%d npkt=%d DIEPTSIZ=0x%08x " "DIEPCTL=0x%08x\n", td->ep_no, - DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp), - temp, DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPCTL(td->ep_no))); + DXEPTSIZ_GET_NPKT(temp), + temp, DWC_OTG_READ_4(sc, DOTG_DIEPCTL(td->ep_no))); goto not_complete; } @@ -791,10 +792,10 @@ repeat: } td->npkt = 1; } - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no), - DWC_OTG_MSK_DXEPTSIZ_SET_MULTI(1) | - DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(td->npkt) | - DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(count)); + DWC_OTG_WRITE_4(sc, DOTG_DIEPTSIZ(td->ep_no), + DXEPTSIZ_SET_MULTI(1) | + DXEPTSIZ_SET_NPKT(td->npkt) | + DXEPTSIZ_SET_NBYTES(count)); /* make room for buffering */ td->npkt += mpkt; @@ -802,9 +803,9 @@ repeat: temp = sc->sc_in_ctl[td->ep_no]; /* must enable before writing data to FIFO */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(td->ep_no), temp | - DWC_OTG_MSK_DIEPCTL_ENABLE | - DWC_OTG_MSK_DIEPCTL_CLR_NAK); + DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(td->ep_no), temp | + DIEPCTL_EPENA | + DIEPCTL_CNAK); td->tx_bytes = count; @@ -834,10 +835,10 @@ dwc_otg_data_tx_sync(struct dwc_otg_td * /* * If all packets are transferred we are complete: */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no)); + temp = DWC_OTG_READ_4(sc, DOTG_DIEPTSIZ(td->ep_no)); /* check that all packets have been transferred */ - if (DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp) != 0) { + if (DXEPTSIZ_GET_NPKT(temp) != 0) { DPRINTFN(5, "busy ep=%d\n", td->ep_no); goto not_complete; } @@ -850,10 +851,10 @@ not_complete: temp = sc->sc_last_rx_status; if ((td->ep_no == 0) && (temp != 0) && - (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(temp) == 0)) { + (GRXSTSRD_CHNUM_GET(temp) == 0)) { - if ((temp & DWC_OTG_MSK_GRXSTS_PACKET_STS) == - DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { + if ((temp & GRXSTSRD_PKTSTS_MASK) == + GRXSTSRD_STP_DATA) { DPRINTFN(5, "faking complete\n"); /* * Race condition: We are complete! @@ -920,36 +921,36 @@ dwc_otg_interrupt_poll(struct dwc_otg_so repeat: if (sc->sc_last_rx_status == 0) { - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GINTSTS); - if (temp & DWC_OTG_MSK_GINT_RXFLVL) { + temp = DWC_OTG_READ_4(sc, DOTG_GINTSTS); + if (temp & GINTSTS_RXFLVL) { /* pop current status */ sc->sc_last_rx_status = - DWC_OTG_READ_4(sc, DWC_OTG_REG_GRXSTSP); + DWC_OTG_READ_4(sc, DOTG_GRXSTSPD); } if (sc->sc_last_rx_status != 0) { uint8_t ep_no; - temp = DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT( + temp = GRXSTSRD_BCNT_GET( sc->sc_last_rx_status); - ep_no = DWC_OTG_MSK_GRXSTS_GET_CHANNEL( + ep_no = GRXSTSRD_CHNUM_GET( sc->sc_last_rx_status); /* receive data, if any */ if (temp != 0) { DPRINTF("Reading %d bytes from ep %d\n", temp, ep_no); bus_space_read_region_4(sc->sc_io_tag, sc->sc_io_hdl, - DWC_OTG_REG_DFIFO(ep_no), + DOTG_DFIFO(ep_no), sc->sc_rx_bounce_buffer, (temp + 3) / 4); } temp = sc->sc_last_rx_status & - DWC_OTG_MSK_GRXSTS_PACKET_STS; + GRXSTSRD_PKTSTS_MASK; /* non-data messages we simply skip */ - if (temp != DWC_OTG_MSK_GRXSTS_DEV_STP_DATA && - temp != DWC_OTG_MSK_GRXSTS_DEV_OUT_DATA) { + if (temp != GRXSTSRD_STP_DATA && + temp != GRXSTSRD_OUT_DATA) { dwc_otg_common_rx_ack(sc); goto repeat; } @@ -965,7 +966,7 @@ repeat: DPRINTFN(5, "RX status = 0x%08x: ch=%d pid=%d bytes=%d sts=%d\n", sc->sc_last_rx_status, ep_no, (sc->sc_last_rx_status >> 15) & 3, - DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT(sc->sc_last_rx_status), + GRXSTSRD_BCNT_GET(sc->sc_last_rx_status), (sc->sc_last_rx_status >> 17) & 15); } else { got_rx_status = 0; @@ -973,7 +974,7 @@ repeat: } else { uint8_t ep_no; - ep_no = DWC_OTG_MSK_GRXSTS_GET_CHANNEL( + ep_no = GRXSTSRD_CHNUM_GET( sc->sc_last_rx_status); /* check if we should dump the data */ @@ -997,8 +998,8 @@ repeat: goto repeat; /* disable RX FIFO level interrupt */ - sc->sc_irq_mask &= ~DWC_OTG_MSK_GINT_RXFLVL; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + sc->sc_irq_mask &= ~GINTSTS_RXFLVL; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); } } @@ -1038,12 +1039,12 @@ dwc_otg_interrupt(struct dwc_otg_softc * USB_BUS_LOCK(&sc->sc_bus); /* read and clear interrupt status */ - status = DWC_OTG_READ_4(sc, DWC_OTG_REG_GINTSTS); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTSTS, status); + status = DWC_OTG_READ_4(sc, DOTG_GINTSTS); + DWC_OTG_WRITE_4(sc, DOTG_GINTSTS, status); DPRINTFN(14, "GINTSTS=0x%08x\n", status); - if (status & DWC_OTG_MSK_GINT_USB_RESET) { + if (status & GINTSTS_USBRST) { /* set correct state */ sc->sc_flags.status_bus_reset = 0; @@ -1056,7 +1057,7 @@ dwc_otg_interrupt(struct dwc_otg_softc * } /* check for any bus state change interrupts */ - if (status & DWC_OTG_MSK_GINT_ENUM_DONE) { + if (status & GINTSTS_ENUMDONE) { uint32_t temp; @@ -1078,18 +1079,18 @@ dwc_otg_interrupt(struct dwc_otg_softc * sc->sc_active_out_ep = 1; /* figure out enumeration speed */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DSTS); - if (DWC_OTG_MSK_DSTS_GET_ENUM_SPEED(temp) == - DWC_OTG_MSK_DSTS_ENUM_SPEED_HI) + temp = DWC_OTG_READ_4(sc, DOTG_DSTS); + if (DSTS_ENUMSPD_GET(temp) == + DSTS_ENUMSPD_HI) sc->sc_flags.status_high_speed = 1; else sc->sc_flags.status_high_speed = 0; /* disable resume interrupt and enable suspend interrupt */ - sc->sc_irq_mask &= ~DWC_OTG_MSK_GINT_WKUPINT; - sc->sc_irq_mask |= DWC_OTG_MSK_GINT_USB_SUSPEND; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + sc->sc_irq_mask &= ~GINTSTS_WKUPINT; + sc->sc_irq_mask |= GINTSTS_USBSUSP; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* complete root HUB interrupt endpoint */ dwc_otg_root_intr(sc); @@ -1099,13 +1100,13 @@ dwc_otg_interrupt(struct dwc_otg_softc * * that like RESUME. Resume is set when there is at least 3 * milliseconds of inactivity on the USB BUS. */ - if (status & DWC_OTG_MSK_GINT_WKUPINT) { + if (status & GINTSTS_WKUPINT) { DPRINTFN(5, "resume interrupt\n"); dwc_otg_resume_irq(sc); - } else if (status & DWC_OTG_MSK_GINT_USB_SUSPEND) { + } else if (status & GINTSTS_USBSUSP) { DPRINTFN(5, "suspend interrupt\n"); @@ -1118,45 +1119,45 @@ dwc_otg_interrupt(struct dwc_otg_softc * * Disable suspend interrupt and enable resume * interrupt: */ - sc->sc_irq_mask &= ~DWC_OTG_MSK_GINT_USB_SUSPEND; - sc->sc_irq_mask |= DWC_OTG_MSK_GINT_WKUPINT; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + sc->sc_irq_mask &= ~GINTSTS_USBSUSP; + sc->sc_irq_mask |= GINTSTS_WKUPINT; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* complete root HUB interrupt endpoint */ dwc_otg_root_intr(sc); } } /* check VBUS */ - if (status & (DWC_OTG_MSK_GINT_USB_SUSPEND | - DWC_OTG_MSK_GINT_USB_RESET | - DWC_OTG_MSK_GINT_SESSREQINT)) { + if (status & (GINTSTS_USBSUSP | + GINTSTS_USBRST | + GINTSTS_SESSREQINT)) { uint32_t temp; - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GOTGCTL); + temp = DWC_OTG_READ_4(sc, DOTG_GOTGCTL); DPRINTFN(5, "GOTGCTL=0x%08x\n", temp); dwc_otg_vbus_interrupt(sc, - (temp & DWC_OTG_MSK_GOTGCTL_BSESS_VALID) ? 1 : 0); + (temp & GOTGCTL_BSESVLD) ? 1 : 0); } /* clear all IN endpoint interrupts */ - if (status & DWC_OTG_MSK_GINT_INEP) { + if (status & GINTSTS_IEPINT) { uint32_t temp; uint8_t x; for (x = 0; x != sc->sc_dev_in_ep_max; x++) { - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPINT(x)); - if (temp & DWC_OTG_MSK_DIEP_XFER_COMPLETE) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPINT(x), - DWC_OTG_MSK_DIEP_XFER_COMPLETE); + temp = DWC_OTG_READ_4(sc, DOTG_DIEPINT(x)); + if (temp & DIEPMSK_XFERCOMPLMSK) { + DWC_OTG_WRITE_4(sc, DOTG_DIEPINT(x), + DIEPMSK_XFERCOMPLMSK); } } } #if 0 /* check if we should poll the FIFOs */ - if (status & (DWC_OTG_MSK_GINT_RXFLVL | DWC_OTG_MSK_GINT_INEP)) + if (status & (GINTSTS_RXFLVL | GINTSTS_IEPINT)) #endif /* poll FIFO(s) */ dwc_otg_interrupt_poll(sc); @@ -1548,16 +1549,16 @@ dwc_otg_set_stall(struct usb_device *ude DPRINTFN(5, "endpoint=0x%x\n", ep_no); if (ep_no & UE_DIR_IN) { - reg = DWC_OTG_REG_DIEPCTL(ep_no & UE_ADDR); + reg = DOTG_DIEPCTL(ep_no & UE_ADDR); temp = sc->sc_in_ctl[ep_no & UE_ADDR]; } else { - reg = DWC_OTG_REG_DOEPCTL(ep_no & UE_ADDR); + reg = DOTG_DOEPCTL(ep_no & UE_ADDR); temp = sc->sc_out_ctl[ep_no & UE_ADDR]; } /* disable and stall endpoint */ - DWC_OTG_WRITE_4(sc, reg, temp | DWC_OTG_MSK_DOEPCTL_DISABLE); - DWC_OTG_WRITE_4(sc, reg, temp | DWC_OTG_MSK_DOEPCTL_STALL); + DWC_OTG_WRITE_4(sc, reg, temp | DOEPCTL_EPDIS); + DWC_OTG_WRITE_4(sc, reg, temp | DOEPCTL_STALL); /* clear active OUT ep */ if (!(ep_no & UE_DIR_IN)) { @@ -1565,7 +1566,7 @@ dwc_otg_set_stall(struct usb_device *ude sc->sc_active_out_ep &= ~(1U << (ep_no & UE_ADDR)); if (sc->sc_last_rx_status != 0 && - (ep_no & UE_ADDR) == DWC_OTG_MSK_GRXSTS_GET_CHANNEL( + (ep_no & UE_ADDR) == GRXSTSRD_CHNUM_GET( sc->sc_last_rx_status)) { /* dump data */ dwc_otg_common_rx_ack(sc); @@ -1588,9 +1589,9 @@ dwc_otg_clear_stall_sub(struct dwc_otg_s } if (ep_dir) { - reg = DWC_OTG_REG_DIEPCTL(ep_no); + reg = DOTG_DIEPCTL(ep_no); } else { - reg = DWC_OTG_REG_DOEPCTL(ep_no); + reg = DOTG_DOEPCTL(ep_no); sc->sc_active_out_ep |= (1U << ep_no); } @@ -1598,39 +1599,39 @@ dwc_otg_clear_stall_sub(struct dwc_otg_s mps = (mps + 3) & 0x7FC; if (ep_type == UE_BULK) { - temp = DWC_OTG_MSK_EP_SET_TYPE( - DWC_OTG_MSK_EP_TYPE_BULK) | - DWC_OTG_MSK_DIEPCTL_USB_AEP; + temp = DIEPCTL_EPTYPE_SET( + DIEPCTL_EPTYPE_BULK) | + DIEPCTL_USBACTEP; } else if (ep_type == UE_INTERRUPT) { - temp = DWC_OTG_MSK_EP_SET_TYPE( - DWC_OTG_MSK_EP_TYPE_INTERRUPT) | - DWC_OTG_MSK_DIEPCTL_USB_AEP; + temp = DIEPCTL_EPTYPE_SET( + DIEPCTL_EPTYPE_INTERRUPT) | + DIEPCTL_USBACTEP; } else { - temp = DWC_OTG_MSK_EP_SET_TYPE( - DWC_OTG_MSK_EP_TYPE_ISOC) | - DWC_OTG_MSK_DIEPCTL_USB_AEP; + temp = DIEPCTL_EPTYPE_SET( + DIEPCTL_EPTYPE_ISOC) | + DIEPCTL_USBACTEP; } - temp |= DWC_OTG_MSK_DIEPCTL_MPS(mps); - temp |= DWC_OTG_MSK_DIEPCTL_FNUM(ep_no); + temp |= DIEPCTL_MPS_SET(mps); + temp |= DIEPCTL_TXFNUM_SET(ep_no); if (ep_dir) sc->sc_in_ctl[ep_no] = temp; else sc->sc_out_ctl[ep_no] = temp; - DWC_OTG_WRITE_4(sc, reg, temp | DWC_OTG_MSK_DOEPCTL_DISABLE); - DWC_OTG_WRITE_4(sc, reg, temp | DWC_OTG_MSK_DOEPCTL_SET_DATA0); - DWC_OTG_WRITE_4(sc, reg, temp | DWC_OTG_MSK_DIEPCTL_SET_NAK); + DWC_OTG_WRITE_4(sc, reg, temp | DOEPCTL_EPDIS); + DWC_OTG_WRITE_4(sc, reg, temp | DOEPCTL_SETD0PID); + DWC_OTG_WRITE_4(sc, reg, temp | DIEPCTL_SNAK); /* we only reset the transmit FIFO */ if (ep_dir) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, - DWC_OTG_MSK_GRSTCTL_TXFIFO(ep_no) | - DWC_OTG_MSK_GRSTCTL_TXFFLUSH); + DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, + GRSTCTL_TXFIFO(ep_no) | + GRSTCTL_TXFFLSH); DWC_OTG_WRITE_4(sc, - DWC_OTG_REG_DIEPTSIZ(ep_no), 0); + DOTG_DIEPTSIZ(ep_no), 0); } /* poll interrupt */ @@ -1684,14 +1685,14 @@ dwc_otg_device_state_change(struct usb_d for (x = 1; x != sc->sc_dev_ep_max; x++) { if (x < sc->sc_dev_in_ep_max) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(x), - DWC_OTG_MSK_DIEPCTL_DISABLE); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(x), 0); + DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(x), + DIEPCTL_EPDIS); + DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(x), 0); } - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(x), - DWC_OTG_MSK_DOEPCTL_DISABLE); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(x), 0); + DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(x), + DOEPCTL_EPDIS); + DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(x), 0); } USB_BUS_UNLOCK(&sc->sc_bus); } @@ -1716,68 +1717,68 @@ dwc_otg_init(struct dwc_otg_softc *sc) /* turn on clocks */ dwc_otg_clocks_on(sc); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GSNPSID); + temp = DWC_OTG_READ_4(sc, DOTG_GSNPSID); DPRINTF("Version = 0x%08x\n", temp); /* disconnect */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, - DWC_OTG_MSK_DCTL_SOFT_DISC); + DWC_OTG_WRITE_4(sc, DOTG_DCTL, + DCTL_SFTDISCON); /* wait for host to detect disconnect */ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 32); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, - DWC_OTG_MSK_GRSTCTL_CSFTRST); + DWC_OTG_WRITE_4(sc, DOTG_GRSTCTL, + GRSTCTL_CSFTRST); /* wait a little bit for block to reset */ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 128); /* select HSIC or non-HSIC mode */ if (DWC_OTG_USE_HSIC) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GUSBCFG, - DWC_OTG_MSK_GUSBCFG_PHY_INTF | - DWC_OTG_MSK_GUSBCFG_TRD_TIM(5)); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GOTGCTL, + DWC_OTG_WRITE_4(sc, DOTG_GUSBCFG, + GUSBCFG_PHYIF | + GUSBCFG_TRD_TIM_SET(5)); + DWC_OTG_WRITE_4(sc, DOTG_GOTGCTL, 0x000000EC); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GLPMCFG); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GLPMCFG, - temp & ~DWC_OTG_MSK_GLPMCFG_HSIC_CONN); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GLPMCFG, - temp | DWC_OTG_MSK_GLPMCFG_HSIC_CONN); + temp = DWC_OTG_READ_4(sc, DOTG_GLPMCFG); + DWC_OTG_WRITE_4(sc, DOTG_GLPMCFG, + temp & ~GLPMCFG_HSIC_CONN); + DWC_OTG_WRITE_4(sc, DOTG_GLPMCFG, + temp | GLPMCFG_HSIC_CONN); } else { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GUSBCFG, - DWC_OTG_MSK_GUSBCFG_ULPI_UMTI_SEL | - DWC_OTG_MSK_GUSBCFG_TRD_TIM(5)); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GOTGCTL, 0); - - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GLPMCFG); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GLPMCFG, - temp & ~DWC_OTG_MSK_GLPMCFG_HSIC_CONN); + DWC_OTG_WRITE_4(sc, DOTG_GUSBCFG, + GUSBCFG_ULPI_UTMI_SEL | + GUSBCFG_TRD_TIM_SET(5)); + DWC_OTG_WRITE_4(sc, DOTG_GOTGCTL, 0); + + temp = DWC_OTG_READ_4(sc, DOTG_GLPMCFG); + DWC_OTG_WRITE_4(sc, DOTG_GLPMCFG, + temp & ~GLPMCFG_HSIC_CONN); } /* clear global nak */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, - DWC_OTG_MSK_DCTL_CGOUT_NAK | - DWC_OTG_MSK_DCTL_CGNPIN_NAK); + DWC_OTG_WRITE_4(sc, DOTG_DCTL, + DCTL_CGOUTNAK | + DCTL_CGNPINNAK); /* enable USB port */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_PCGCCTL, 0); + DWC_OTG_WRITE_4(sc, DOTG_PCGCCTL, 0); /* pull up D+ */ dwc_otg_pull_up(sc); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GHWCFG3); + temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG3); - sc->sc_fifo_size = 4 * DWC_OTG_MSK_GHWCFG3_GET_DFIFO(temp); + sc->sc_fifo_size = 4 * GHWCFG3_DFIFODEPTH_GET(temp); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GHWCFG2); + temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG2); - sc->sc_dev_ep_max = DWC_OTG_MSK_GHWCFG2_NUM_DEV_EP(temp); + sc->sc_dev_ep_max = GHWCFG2_NUMDEVEPS_GET(temp); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GHWCFG4); + temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG4); - sc->sc_dev_in_ep_max = DWC_OTG_MSK_GHWCFG4_NUM_IN_EPS(temp); + sc->sc_dev_in_ep_max = GHWCFG4_NUM_IN_EP_GET(temp); DPRINTF("Total FIFO size = %d bytes, Device EPs = %d/%d\n", sc->sc_fifo_size, sc->sc_dev_ep_max, sc->sc_dev_in_ep_max); @@ -1788,43 +1789,43 @@ dwc_otg_init(struct dwc_otg_softc *sc) /* enable interrupts */ sc->sc_irq_mask = DWC_OTG_MSK_GINT_ENABLED; - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* enable all endpoint interrupts */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GHWCFG2); - if (temp & DWC_OTG_MSK_GHWCFG2_MPI) { + temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG2); + if (temp & GHWCFG2_MPI) { uint8_t x; DPRINTF("Multi Process Interrupts\n"); for (x = 0; x != sc->sc_dev_in_ep_max; x++) { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPEACHMSK(x), - DWC_OTG_MSK_DIEP_XFER_COMPLETE); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPEACHMSK(x), 0); + DWC_OTG_WRITE_4(sc, DOTG_DIEPEACHINTMSK(x), + DIEPMSK_XFERCOMPLMSK); + DWC_OTG_WRITE_4(sc, DOTG_DOEPEACHINTMSK(x), 0); } - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DEACHINTMSK, 0xFFFF); + DWC_OTG_WRITE_4(sc, DOTG_DEACHINTMSK, 0xFFFF); } else { - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPMSK, - DWC_OTG_MSK_DIEP_XFER_COMPLETE); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPMSK, 0); - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DAINTMSK, 0xFFFF); + DWC_OTG_WRITE_4(sc, DOTG_DIEPMSK, + DIEPMSK_XFERCOMPLMSK); + DWC_OTG_WRITE_4(sc, DOTG_DOEPMSK, 0); + DWC_OTG_WRITE_4(sc, DOTG_DAINTMSK, 0xFFFF); } /* enable global IRQ */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GAHBCFG, - DWC_OTG_MSK_GAHBCFG_GLOBAL_IRQ); + DWC_OTG_WRITE_4(sc, DOTG_GAHBCFG, + GAHBCFG_GLBLINTRMSK); /* turn off clocks */ dwc_otg_clocks_off(sc); /* read initial VBUS state */ - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GOTGCTL); + temp = DWC_OTG_READ_4(sc, DOTG_GOTGCTL); DPRINTFN(5, "GOTCTL=0x%08x\n", temp); dwc_otg_vbus_interrupt(sc, - (temp & DWC_OTG_MSK_GOTGCTL_BSESS_VALID) ? 1 : 0); + (temp & GOTGCTL_BSESVLD) ? 1 : 0); USB_BUS_UNLOCK(&sc->sc_bus); @@ -1841,11 +1842,11 @@ dwc_otg_uninit(struct dwc_otg_softc *sc) USB_BUS_LOCK(&sc->sc_bus); /* set disconnect */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, - DWC_OTG_MSK_DCTL_SOFT_DISC); + DWC_OTG_WRITE_4(sc, DOTG_DCTL, + DCTL_SFTDISCON); /* turn off global IRQ */ - DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GAHBCFG, 0); + DWC_OTG_WRITE_4(sc, DOTG_GAHBCFG, 0); sc->sc_flags.port_powered = 0; sc->sc_flags.status_vbus = 0; @@ -1946,11 +1947,11 @@ dwc_otg_device_isoc_fs_enter(struct usb_ DPRINTFN(6, "xfer=%p next=%d nframes=%d\n", xfer, xfer->endpoint->isoc_next, xfer->nframes); - temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DSTS); + temp = DWC_OTG_READ_4(sc, DOTG_DSTS); /* get the current frame index */ - nframes = DWC_OTG_MSK_DSTS_GET_FNUM(temp); + nframes = DSTS_SOFFN_GET(temp); if (sc->sc_flags.status_high_speed) nframes /= 8; Modified: head/sys/dev/usb/controller/dwc_otg.h ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.h Thu Aug 30 15:47:20 2012 (r239908) +++ head/sys/dev/usb/controller/dwc_otg.h Thu Aug 30 16:19:05 2012 (r239909) @@ -32,290 +32,6 @@ #define DWC_OTG_MAX_TXP 4 #define DWC_OTG_MAX_TXN (0x200 * DWC_OTG_MAX_TXP) -/* Global CSR registers */ - -#define DWC_OTG_REG_GOTGCTL 0x0000 -#define DWC_OTG_MSK_GOTGCTL_CHIRP_ON (1U << 27) -#define DWC_OTG_MSK_GOTGCTL_BSESS_VALID (1U << 19) -#define DWC_OTG_MSK_GOTGCTL_ASESS_VALID (1U << 18) -#define DWC_OTG_MSK_GOTGCTL_CONN_ID_STATUS (1U << 16) -#define DWC_OTG_MSK_GOTGCTL_SESS_REQ (1U << 1) -#define DWC_OTG_MSK_GOTGCTL_SESS_VALID (1U << 0) - -#define DWC_OTG_REG_GOTGINT 0x0004 -#define DWC_OTG_REG_GAHBCFG 0x0008 -#define DWC_OTG_MSK_GAHBCFG_GLOBAL_IRQ (1U << 0) - -#define DWC_OTG_REG_GUSBCFG 0x000C *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 16:45:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92DCA1065670; Thu, 30 Aug 2012 16:45:28 +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 7C17A8FC15; Thu, 30 Aug 2012 16:45: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 q7UGjSn3077653; Thu, 30 Aug 2012 16:45:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UGjSok077650; Thu, 30 Aug 2012 16:45:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208301645.q7UGjSok077650@svn.freebsd.org> From: Ed Schouten Date: Thu, 30 Aug 2012 16:45: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: r239910 - head/usr.sbin/ac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 16:45:28 -0000 Author: ed Date: Thu Aug 30 16:45:27 2012 New Revision: 239910 URL: http://svn.freebsd.org/changeset/base/239910 Log: Massively refactor ac(8). - Use queue(3) -- not some homegrown implementation of linked lists. - Rename structures to _entry, as they are entries in the linked list -- not the lists themselves. - Don't store entire copies of struct utmpx in utmpx_entry, but only the members we're interested in. Large fields such as hostnames are not needed during the execution of the program. - Give structure members useful names, instead of `name'. - While there, use struct timevals instead of time_t's internally. This is not strictly useful, but while we're at it... - Mark stuff static. - Add missing const keywords. - Remove unneeded prototypes. - Remove workaround for sparc64-specific utmp problems. These don't apply to utmpx. - Don't discard entries when timestamps are not monotone. This shouldn't ever happen with utmpx, but discarding them is a bit too harsh. - Remove debug code. We nowadays have `getent utmpx', which can be used to analyze logfiles in depth. - Use proper uppercasing/periods in comments. - Print output of `ac -p' sorted alphabetically, instead of first occurrence. - Properly check against pts/* instead of tty[PQRSpqrs]* to determine whether a TTY is a pseudo-terminal. MFC after: 1 month Modified: head/usr.sbin/ac/Makefile head/usr.sbin/ac/ac.c Modified: head/usr.sbin/ac/Makefile ============================================================================== --- head/usr.sbin/ac/Makefile Thu Aug 30 16:19:05 2012 (r239909) +++ head/usr.sbin/ac/Makefile Thu Aug 30 16:45:27 2012 (r239910) @@ -3,11 +3,6 @@ PROG= ac MAN= ac.8 -# Temporary, while tracking down problem wrt 64-bit time_t's on sparc64 -.if ${MACHINE_CPUARCH} == "sparc64" -CFLAGS+=-DDEBUG -.endif - # If "CONSOLE_TTY" is not defined, this program is compatible with the # traditional implementation (using SunOS 4.x as the sample traditional # implementation). This is the default. Modified: head/usr.sbin/ac/ac.c ============================================================================== --- head/usr.sbin/ac/ac.c Thu Aug 30 16:19:05 2012 (r239909) +++ head/usr.sbin/ac/ac.c Thu Aug 30 16:45:27 2012 (r239910) @@ -16,8 +16,9 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include + #include #include #include @@ -32,43 +33,47 @@ __FBSDID("$FreeBSD$"); /* * this is for our list of currently logged in sessions */ -struct utmp_list { - struct utmp_list *next; - struct utmpx usr; +struct utmpx_entry { + SLIST_ENTRY(utmpx_entry) next; + char user[sizeof(((struct utmpx *)0)->ut_user)]; + char id[sizeof(((struct utmpx *)0)->ut_id)]; +#ifdef CONSOLE_TTY + char line[sizeof(((struct utmpx *)0)->ut_line)]; +#endif + struct timeval time; }; /* * this is for our list of users that are accumulating time. */ -struct user_list { - struct user_list *next; - char name[sizeof(((struct utmpx *)0)->ut_user)]; - time_t secs; +struct user_entry { + SLIST_ENTRY(user_entry) next; + char user[sizeof(((struct utmpx *)0)->ut_user)]; + struct timeval time; }; /* * this is for chosing whether to ignore a login */ -struct tty_list { - struct tty_list *next; - char name[sizeof(((struct utmpx *)0)->ut_host) + 2]; - size_t len; - int ret; +struct tty_entry { + SLIST_ENTRY(tty_entry) next; + char line[sizeof(((struct utmpx *)0)->ut_line) + 2]; + size_t len; + int ret; }; /* * globals - yes yuk */ #ifdef CONSOLE_TTY -static char *Console = CONSOLE_TTY; +static const char *Console = CONSOLE_TTY; #endif -static time_t Total = 0; -static time_t FirstTime = 0; +static struct timeval Total = { 0, 0 }; +static struct timeval FirstTime = { 0, 0 }; static int Flags = 0; -static struct user_list *Users = NULL; -static struct tty_list *Ttys = NULL; - -#define NEW(type) (type *)malloc(sizeof (type)) +static SLIST_HEAD(, utmpx_entry) CurUtmpx = SLIST_HEAD_INITIALIZER(CurUtmpx); +static SLIST_HEAD(, user_entry) Users = SLIST_HEAD_INITIALIZER(Users); +static SLIST_HEAD(, tty_entry) Ttys = SLIST_HEAD_INITIALIZER(Ttys); #define AC_W 1 /* not _PATH_WTMP */ #define AC_D 2 /* daily totals (ignore -p) */ @@ -76,182 +81,112 @@ static struct tty_list *Ttys = NULL; #define AC_U 8 /* specified users only */ #define AC_T 16 /* specified ttys only */ -#ifdef DEBUG -static int Debug = 0; -#endif - -int main(int, char **); -int ac(const char *); -struct tty_list *add_tty(char *); -#ifdef DEBUG -const char *debug_pfx(const struct utmpx *, const struct utmpx *); -#endif -int do_tty(char *); -struct utmp_list *log_in(struct utmp_list *, struct utmpx *); -struct utmp_list *log_out(struct utmp_list *, struct utmpx *); -int on_console(struct utmp_list *); -void show(const char *, time_t); -void show_today(struct user_list *, struct utmp_list *, - time_t); -void show_users(struct user_list *); -struct user_list *update_user(struct user_list *, char *, time_t); -void usage(void); +static void ac(const char *); +static void usage(void); -struct tty_list * -add_tty(char *name) +static void +add_tty(const char *line) { - struct tty_list *tp; + struct tty_entry *tp; char *rcp; Flags |= AC_T; - if ((tp = NEW(struct tty_list)) == NULL) + if ((tp = malloc(sizeof(*tp))) == NULL) errx(1, "malloc failed"); tp->len = 0; /* full match */ tp->ret = 1; /* do if match */ - if (*name == '!') { /* don't do if match */ + if (*line == '!') { /* don't do if match */ tp->ret = 0; - name++; + line++; } - strlcpy(tp->name, name, sizeof (tp->name)); - if ((rcp = strchr(tp->name, '*')) != NULL) { /* wild card */ + strlcpy(tp->line, line, sizeof(tp->line)); + /* Wildcard. */ + if ((rcp = strchr(tp->line, '*')) != NULL) { *rcp = '\0'; - tp->len = strlen(tp->name); /* match len bytes only */ + /* Match len bytes only. */ + tp->len = strlen(tp->line); } - tp->next = Ttys; - Ttys = tp; - return Ttys; + SLIST_INSERT_HEAD(&Ttys, tp, next); } /* * should we process the named tty? */ -int -do_tty(char *name) +static int +do_tty(const char *line) { - struct tty_list *tp; + struct tty_entry *tp; int def_ret = 0; - for (tp = Ttys; tp != NULL; tp = tp->next) { + SLIST_FOREACH(tp, &Ttys, next) { if (tp->ret == 0) /* specific don't */ def_ret = 1; /* default do */ if (tp->len != 0) { - if (strncmp(name, tp->name, tp->len) == 0) + if (strncmp(line, tp->line, tp->len) == 0) return tp->ret; } else { - if (strncmp(name, tp->name, sizeof (tp->name)) == 0) + if (strncmp(line, tp->line, sizeof(tp->line)) == 0) return tp->ret; } } - return def_ret; + return (def_ret); } #ifdef CONSOLE_TTY /* * is someone logged in on Console? */ -int -on_console(struct utmp_list *head) +static int +on_console(void) { - struct utmp_list *up; + struct utmpx_entry *up; - for (up = head; up; up = up->next) { - if (strcmp(up->usr.ut_line, Console) == 0) - return 1; - } - return 0; + SLIST_FOREACH(up, &CurUtmpx, next) + if (strcmp(up->line, Console) == 0) + return (1); + return (0); } #endif /* - * update user's login time + * Update user's login time. + * If no entry for this user is found, a new entry is inserted into the + * list alphabetically. */ -struct user_list * -update_user(struct user_list *head, char *name, time_t secs) +static void +update_user(const char *user, struct timeval secs) { - struct user_list *up; + struct user_entry *up, *aup; + int c; - for (up = head; up != NULL; up = up->next) { - if (strcmp(up->name, name) == 0) { - up->secs += secs; - Total += secs; - return head; - } + aup = NULL; + SLIST_FOREACH(up, &Users, next) { + c = strcmp(up->user, user); + if (c == 0) { + timeradd(&up->time, &secs, &up->time); + timeradd(&Total, &secs, &Total); + return; + } else if (c > 0) + break; + aup = up; } /* * not found so add new user unless specified users only */ if (Flags & AC_U) - return head; + return; - if ((up = NEW(struct user_list)) == NULL) + if ((up = malloc(sizeof(*up))) == NULL) errx(1, "malloc failed"); - up->next = head; - strlcpy(up->name, name, sizeof (up->name)); - up->secs = secs; - Total += secs; - return up; -} - -#ifdef DEBUG -/* - * Create a string which is the standard prefix for a debug line. It - * includes a timestamp (perhaps with year), device-name, and user-name. - */ -const char * -debug_pfx(const struct utmpx *event_up, const struct utmpx *userinf_up) -{ - static char str_result[40 + sizeof(userinf_up->ut_line) + - sizeof(userinf_up->ut_user)]; - static char thisyear[5]; - size_t maxcopy; - time_t ut_timecopy; - - if (thisyear[0] == '\0') { - /* Figure out what "this year" is. */ - time(&ut_timecopy); - strlcpy(str_result, ctime(&ut_timecopy), sizeof(str_result)); - strlcpy(thisyear, &str_result[20], sizeof(thisyear)); - } - - if (event_up->ut_tv.tv_sec == 0) - strlcpy(str_result, "*ZeroTime* --:--:-- ", sizeof(str_result)); - else { - ut_timecopy = event_up->ut_tv.tv_sec; - strlcpy(str_result, ctime(&ut_timecopy), sizeof(str_result)); - /* - * Include the year, if it is not the same year as "now". - */ - if (strncmp(&str_result[20], thisyear, 4) == 0) - str_result[20] = '\0'; - else { - str_result[24] = ' '; /* Replace a '\n' */ - str_result[25] = '\0'; - } - } - - if (userinf_up->ut_line[0] == '\0') - strlcat(str_result, "NoDev", sizeof(str_result)); - else { - maxcopy = strlen(str_result) + sizeof(userinf_up->ut_line); - if (maxcopy > sizeof(str_result)) - maxcopy = sizeof(str_result); - strlcat(str_result, userinf_up->ut_line, maxcopy); - } - strlcat(str_result, ": ", sizeof(str_result)); - - if (userinf_up->ut_user[0] == '\0') - strlcat(str_result, "LogOff", sizeof(str_result)); - else { - maxcopy = strlen(str_result) + sizeof(userinf_up->ut_user); - if (maxcopy > sizeof(str_result)) - maxcopy = sizeof(str_result); - strlcat(str_result, userinf_up->ut_user, maxcopy); - } - - return (str_result); + if (aup == NULL) + SLIST_INSERT_HEAD(&Users, up, next); + else + SLIST_INSERT_AFTER(aup, up, next); + strlcpy(up->user, user, sizeof(up->user)); + up->time = secs; + timeradd(&Total, &secs, &Total); } -#endif int main(int argc, char *argv[]) @@ -261,13 +196,8 @@ main(int argc, char *argv[]) (void) setlocale(LC_TIME, ""); - while ((c = getopt(argc, argv, "Dc:dpt:w:")) != -1) { + while ((c = getopt(argc, argv, "c:dpt:w:")) != -1) { switch (c) { -#ifdef DEBUG - case 'D': - Debug++; - break; -#endif case 'c': #ifdef CONSOLE_TTY Console = optarg; @@ -299,7 +229,7 @@ main(int argc, char *argv[]) * initialize user list */ for (; optind < argc; optind++) { - Users = update_user(Users, argv[optind], (time_t)0); + update_user(argv[optind], (struct timeval){ 0, 0 }); } Flags |= AC_U; /* freeze user list */ } @@ -307,112 +237,108 @@ main(int argc, char *argv[]) Flags &= ~AC_P; ac(wtmpf); - return 0; + return (0); } /* * print login time in decimal hours */ -void -show(const char *name, time_t secs) +static void +show(const char *user, struct timeval secs) { (void)printf("\t%-*s %8.2f\n", - (int)sizeof(((struct utmpx *)0)->ut_user), name, - ((double)secs / 3600)); + (int)sizeof(((struct user_entry *)0)->user), user, + (double)secs.tv_sec / 3600); } -void -show_users(struct user_list *list) +static void +show_users(void) { - struct user_list *lp; + struct user_entry *lp; - for (lp = list; lp; lp = lp->next) - show(lp->name, lp->secs); + SLIST_FOREACH(lp, &Users, next) + show(lp->user, lp->time); } /* * print total login time for 24hr period in decimal hours */ -void -show_today(struct user_list *users, struct utmp_list *logins, time_t secs) +static void +show_today(struct timeval today) { - struct user_list *up; - struct utmp_list *lp; + struct user_entry *up; + struct utmpx_entry *lp; char date[64]; - time_t yesterday = secs - 1; + struct timeval usec = { 0, 1 }; + struct timeval yesterday; static int d_first = -1; if (d_first < 0) d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); - (void)strftime(date, sizeof (date), + timersub(&today, &usec, &yesterday); + (void)strftime(date, sizeof(date), d_first ? "%e %b total" : "%b %e total", - localtime(&yesterday)); + localtime(&yesterday.tv_sec)); /* restore the missing second */ - yesterday++; + timeradd(&today, &usec, &yesterday); - for (lp = logins; lp != NULL; lp = lp->next) { - secs = yesterday - lp->usr.ut_tv.tv_sec; - Users = update_user(Users, lp->usr.ut_user, secs); - lp->usr.ut_tv.tv_sec = yesterday; /* as if they just logged in */ + SLIST_FOREACH(lp, &CurUtmpx, next) { + timersub(&yesterday, &lp->time, &today); + update_user(lp->user, today); + /* As if they just logged in. */ + lp->time = yesterday; } - secs = 0; - for (up = users; up != NULL; up = up->next) { - secs += up->secs; - up->secs = 0; /* for next day */ + timerclear(&today); + SLIST_FOREACH(up, &Users, next) { + timeradd(&today, &up->time, &today); + /* For next day. */ + timerclear(&up->time); } - if (secs) - (void)printf("%s %11.2f\n", date, ((double)secs / 3600)); + if (timerisset(&today)) + (void)printf("%s %11.2f\n", date, (double)today.tv_sec / 3600); } /* - * log a user out and update their times. - * if ut_line is "~", we log all users out as the system has - * been shut down. + * Log a user out and update their times. + * If ut_type is BOOT_TIME or SHUTDOWN_TIME, we log all users out as the + * system has been shut down. */ -struct utmp_list * -log_out(struct utmp_list *head, struct utmpx *up) +static void +log_out(const struct utmpx *up) { - struct utmp_list *lp, *lp2, *tlp; - time_t secs; + struct utmpx_entry *lp, *lp2, *tlp; + struct timeval secs; - for (lp = head, lp2 = NULL; lp != NULL; ) + for (lp = SLIST_FIRST(&CurUtmpx), lp2 = NULL; lp != NULL;) if (up->ut_type == BOOT_TIME || up->ut_type == SHUTDOWN_TIME || (up->ut_type == DEAD_PROCESS && - memcmp(lp->usr.ut_id, up->ut_id, sizeof up->ut_id) == 0)) { - secs = up->ut_tv.tv_sec - lp->usr.ut_tv.tv_sec; - Users = update_user(Users, lp->usr.ut_user, secs); -#ifdef DEBUG - if (Debug) - printf("%s logged out (%2d:%02d:%02d)\n", - debug_pfx(up, &lp->usr), (int)(secs / 3600), - (int)((secs % 3600) / 60), - (int)(secs % 60)); -#endif + memcmp(lp->id, up->ut_id, sizeof(up->ut_id)) == 0)) { + timersub(&up->ut_tv, &lp->time, &secs); + update_user(lp->user, secs); /* * now lose it */ tlp = lp; - lp = lp->next; - if (tlp == head) - head = lp; - else if (lp2 != NULL) - lp2->next = lp; + lp = SLIST_NEXT(lp, next); + if (lp2 == NULL) + SLIST_REMOVE_HEAD(&CurUtmpx, next); + else + SLIST_REMOVE_AFTER(lp2, next); free(tlp); } else { lp2 = lp; - lp = lp->next; + lp = SLIST_NEXT(lp, next); } - return head; } /* * if do_tty says ok, login a user */ -struct utmp_list * -log_in(struct utmp_list *head, struct utmpx *up) +static void +log_in(struct utmpx *up) { - struct utmp_list *lp; + struct utmpx_entry *lp; /* * this could be a login. if we're not dealing with @@ -431,198 +357,150 @@ log_in(struct utmp_list *head, struct ut * SunOS 4.0.2 does not treat ":0.0" as special but we * do. */ - if (on_console(head)) - return head; + if (on_console()) + return; /* * ok, no recorded login, so they were here when wtmp * started! Adjust ut_time! */ - up->ut_time = FirstTime; + up->ut_tv = FirstTime; /* * this allows us to pick the right logout */ - strlcpy(up->ut_line, Console, sizeof (up->ut_line)); + strlcpy(up->ut_line, Console, sizeof(up->ut_line)); } #endif /* * If we are doing specified ttys only, we ignore * anything else. */ - if (Flags & AC_T) - if (!do_tty(up->ut_line)) - return head; + if (Flags & AC_T && !do_tty(up->ut_line)) + return; /* * go ahead and log them in */ - if ((lp = NEW(struct utmp_list)) == NULL) + if ((lp = malloc(sizeof(*lp))) == NULL) errx(1, "malloc failed"); - lp->next = head; - head = lp; - memmove(&lp->usr, up, sizeof *up); -#ifdef DEBUG - if (Debug) { - printf("%s logged in", debug_pfx(&lp->usr, up)); - if (*up->ut_host) - printf(" (%-.*s)", (int)sizeof(up->ut_host), - up->ut_host); - putchar('\n'); - } + SLIST_INSERT_HEAD(&CurUtmpx, lp, next); + strlcpy(lp->user, up->ut_user, sizeof(lp->user)); + memcpy(lp->id, up->ut_id, sizeof(lp->id)); +#ifdef CONSOLE_TTY + memcpy(lp->line, up->ut_line, sizeof(lp->line)); #endif - return head; + lp->time = up->ut_tv; } -int +static void ac(const char *file) { - struct utmp_list *lp, *head = NULL; + struct utmpx_entry *lp; struct utmpx *usr, usht; struct tm *ltm; - time_t prev_secs, secs, ut_timecopy; - int day, rfound, tchanged, tskipped; + struct timeval prev_secs, ut_timecopy, secs, clock_shift, now; + int day, rfound; day = -1; - prev_secs = 1; /* Minimum acceptable date == 1970 */ - rfound = tchanged = tskipped = 0; - secs = 0; + timerclear(&prev_secs); /* Minimum acceptable date == 1970. */ + timerclear(&secs); + timerclear(&clock_shift); + rfound = 0; if (setutxdb(UTXDB_LOG, file) != 0) err(1, "%s", file); while ((usr = getutxent()) != NULL) { rfound++; - ut_timecopy = usr->ut_tv.tv_sec; - /* - * With sparc64 using 64-bit time_t's, there is some system - * routine which sets ut_time==0 (the high-order word of a - * 64-bit time) instead of a 32-bit time value. For those - * wtmp files, it is "more-accurate" to substitute the most- - * recent time found, instead of throwing away the entire - * record. While it is still just a guess, it is a better - * guess than throwing away a log-off record and therefore - * counting a session as if it continued to the end of the - * month, or the next system-reboot. - */ - if (ut_timecopy == 0 && prev_secs > 1) { -#ifdef DEBUG - if (Debug) - printf("%s - date changed to: %s", - debug_pfx(usr, usr), ctime(&prev_secs)); -#endif - tchanged++; - usr->ut_tv.tv_sec = ut_timecopy = prev_secs; - } - /* - * Skip records where the time goes backwards. - */ - if (ut_timecopy < prev_secs) { -#ifdef DEBUG - if (Debug) - printf("%s - bad date, record skipped\n", - debug_pfx(usr, usr)); -#endif - tskipped++; - continue; /* Skip this invalid record. */ - } + ut_timecopy = usr->ut_tv; + /* Don't let the time run backwards. */ + if (timercmp(&ut_timecopy, &prev_secs, <)) + ut_timecopy = prev_secs; prev_secs = ut_timecopy; - if (!FirstTime) + if (!timerisset(&FirstTime)) FirstTime = ut_timecopy; if (Flags & AC_D) { - ltm = localtime(&ut_timecopy); + ltm = localtime(&ut_timecopy.tv_sec); if (day >= 0 && day != ltm->tm_yday) { day = ltm->tm_yday; /* * print yesterday's total */ secs = ut_timecopy; - secs -= ltm->tm_sec; - secs -= 60 * ltm->tm_min; - secs -= 3600 * ltm->tm_hour; - show_today(Users, head, secs); + secs.tv_sec -= ltm->tm_sec; + secs.tv_sec -= 60 * ltm->tm_min; + secs.tv_sec -= 3600 * ltm->tm_hour; + secs.tv_usec = 0; + show_today(secs); } else day = ltm->tm_yday; } switch(usr->ut_type) { case OLD_TIME: - secs = ut_timecopy; + clock_shift = ut_timecopy; break; case NEW_TIME: - secs -= ut_timecopy; + timersub(&clock_shift, &ut_timecopy, &clock_shift); /* * adjust time for those logged in */ - for (lp = head; lp != NULL; lp = lp->next) - lp->usr.ut_tv.tv_sec -= secs; + SLIST_FOREACH(lp, &CurUtmpx, next) + timersub(&lp->time, &clock_shift, &lp->time); break; case BOOT_TIME: case SHUTDOWN_TIME: - head = log_out(head, usr); + log_out(usr); FirstTime = ut_timecopy; /* shouldn't be needed */ break; case USER_PROCESS: /* - * if they came in on tty[p-sP-S]*, then it is only - * a login session if the ut_host field is non-empty + * If they came in on pts/..., then it is only + * a login session if the ut_host field is non-empty. */ - if (strncmp(usr->ut_line, "tty", 3) != 0 || - strchr("pqrsPQRS", usr->ut_line[3]) == NULL || + if (strncmp(usr->ut_line, "pts/", 4) != 0 || *usr->ut_host != '\0') - head = log_in(head, usr); -#ifdef DEBUG - else if (Debug > 1) - /* Things such as 'screen' sessions. */ - printf("%s - record ignored\n", - debug_pfx(usr, usr)); -#endif + log_in(usr); break; case DEAD_PROCESS: - head = log_out(head, usr); + log_out(usr); break; } } endutxent(); - if (!(Flags & AC_W)) - usht.ut_tv.tv_sec = time(NULL); + (void)gettimeofday(&now, NULL); + if (Flags & AC_W) + usht.ut_tv = ut_timecopy; else - usht.ut_tv.tv_sec = ut_timecopy; + usht.ut_tv = now; usht.ut_type = SHUTDOWN_TIME; if (Flags & AC_D) { - ltm = localtime(&ut_timecopy); + ltm = localtime(&ut_timecopy.tv_sec); if (day >= 0 && day != ltm->tm_yday) { /* * print yesterday's total */ secs = ut_timecopy; - secs -= ltm->tm_sec; - secs -= 60 * ltm->tm_min; - secs -= 3600 * ltm->tm_hour; - show_today(Users, head, secs); + secs.tv_sec -= ltm->tm_sec; + secs.tv_sec -= 60 * ltm->tm_min; + secs.tv_sec -= 3600 * ltm->tm_hour; + secs.tv_usec = 0; + show_today(secs); } } /* * anyone still logged in gets time up to now */ - head = log_out(head, &usht); + log_out(&usht); if (Flags & AC_D) - show_today(Users, head, time((time_t *)0)); + show_today(now); else { if (Flags & AC_P) - show_users(Users); + show_users(); show("total", Total); } - - if (tskipped > 0) - printf("(Skipped %d of %d records due to invalid time values)\n", - tskipped, rfound); - if (tchanged > 0) - printf("(Changed %d of %d records to have a more likely time value)\n", - tchanged, rfound); - - return 0; } -void +static void usage(void) { (void)fprintf(stderr, From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 17:35:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B6D8106566B; Thu, 30 Aug 2012 17:35:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD1EE8FC1C; Thu, 30 Aug 2012 17:35:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UHZCC7084897; Thu, 30 Aug 2012 17:35:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UHZCMM084895; Thu, 30 Aug 2012 17:35:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208301735.q7UHZCMM084895@svn.freebsd.org> From: Adrian Chadd Date: Thu, 30 Aug 2012 17:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239911 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 17:35:13 -0000 Author: adrian Date: Thu Aug 30 17:35:12 2012 New Revision: 239911 URL: http://svn.freebsd.org/changeset/base/239911 Log: The DIR-825 cal data is in an odd spot. I don't know why it's here. (This works on my board because I wrote new caldata into this spot; but this obviously won't work for stock DIR-825 units out there.) Modified: head/sys/mips/conf/DIR-825.hints Modified: head/sys/mips/conf/DIR-825.hints ============================================================================== --- head/sys/mips/conf/DIR-825.hints Thu Aug 30 16:45:27 2012 (r239910) +++ head/sys/mips/conf/DIR-825.hints Thu Aug 30 17:35:12 2012 (r239911) @@ -31,6 +31,9 @@ hint.ath.1.eeprom_firmware="pcib.0.bus.0 # Geom MAP +# The DIR-825 has an 8MB flash part - HOWEVER, the 64k caldata isn't +# at the end of the flash. It's ~ 6MB into the flash image. + # mtdparts=ar7100-nor0:256k(uboot),64k(Config),1024k(vmlinux),5184k(rootfs),64k(caldata) hint.map.0.at="flash/spi0" @@ -55,13 +58,13 @@ hint.map.2.readonly=1 hint.map.3.at="flash/spi0" hint.map.3.start=0x00150000 -hint.map.3.end=0x007f0000 +hint.map.3.end=0x00660000 hint.map.3.name="rootfs" hint.map.3.readonly=0 hint.map.4.at="flash/spi0" -hint.map.4.start=0x007f0000 -hint.map.4.end=0x00800000 +hint.map.4.start=0x00660000 +hint.map.4.end=0x00670000 hint.map.4.name="art" hint.map.4.readonly=1 From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 17:37:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B5471065694; Thu, 30 Aug 2012 17:37:02 +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 348978FC29; Thu, 30 Aug 2012 17:37:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UHb2hU085140; Thu, 30 Aug 2012 17:37:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UHb1H5085136; Thu, 30 Aug 2012 17:37:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208301737.q7UHb1H5085136@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 17:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239912 - head/sys/dev/amr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 17:37:02 -0000 Author: jhb Date: Thu Aug 30 17:37:01 2012 New Revision: 239912 URL: http://svn.freebsd.org/changeset/base/239912 Log: Use callout(9) rather than timeout(9). Note that the periodic timer in amr(4) is never started, so this should be even more of a NOP than normal. Modified: head/sys/dev/amr/amr.c head/sys/dev/amr/amr_pci.c head/sys/dev/amr/amrvar.h Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Thu Aug 30 17:35:12 2012 (r239911) +++ head/sys/dev/amr/amr.c Thu Aug 30 17:37:01 2012 (r239912) @@ -351,7 +351,7 @@ amr_startup(void *arg) /* * Start the timeout routine. */ -/* sc->amr_timeout = timeout(amr_periodic, sc, hz);*/ +/* callout_reset(&sc->amr_timeout, hz, amr_periodic, sc);*/ return; } @@ -392,7 +392,7 @@ amr_free(struct amr_softc *sc) device_delete_child(sc->amr_dev, sc->amr_pass); /* cancel status timeout */ - untimeout(amr_periodic, sc, sc->amr_timeout); + callout_drain(&sc->amr_timeout); /* throw away any command buffers */ while ((acc = TAILQ_FIRST(&sc->amr_cmd_clusters)) != NULL) { @@ -979,7 +979,7 @@ amr_periodic(void *data) amr_done(sc); /* reschedule */ - sc->amr_timeout = timeout(amr_periodic, sc, hz); + callout_reset(&sc->amr_timeout, hz, amr_periodic, sc); } /******************************************************************************** Modified: head/sys/dev/amr/amr_pci.c ============================================================================== --- head/sys/dev/amr/amr_pci.c Thu Aug 30 17:35:12 2012 (r239911) +++ head/sys/dev/amr/amr_pci.c Thu Aug 30 17:37:01 2012 (r239912) @@ -331,6 +331,7 @@ amr_pci_attach(device_t dev) */ mtx_init(&sc->amr_list_lock, "AMR List Lock", NULL, MTX_DEF); mtx_init(&sc->amr_hw_lock, "AMR HW Lock", NULL, MTX_DEF); + callout_init(&sc->amr_timeout, CALLOUT_MPSAFE); if ((error = amr_setup_mbox(sc)) != 0) goto out; Modified: head/sys/dev/amr/amrvar.h ============================================================================== --- head/sys/dev/amr/amrvar.h Thu Aug 30 17:35:12 2012 (r239911) +++ head/sys/dev/amr/amrvar.h Thu Aug 30 17:37:01 2012 (r239912) @@ -256,7 +256,7 @@ struct amr_softc device_t amr_pass; int (*amr_cam_command)(struct amr_softc *sc, struct amr_command **acp); struct intr_config_hook amr_ich; /* wait-for-interrupts probe hook */ - struct callout_handle amr_timeout; /* periodic status check */ + struct callout amr_timeout; /* periodic status check */ int amr_allow_vol_config; int amr_linux_no_adapters; int amr_ld_del_supported; From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 17:47:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F6141065670; Thu, 30 Aug 2012 17:47: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 855408FC14; Thu, 30 Aug 2012 17:47: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 q7UHleF5086455; Thu, 30 Aug 2012 17:47:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UHle21086453; Thu, 30 Aug 2012 17:47:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208301747.q7UHle21086453@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 17:47: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: r239913 - head/sys/dev/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 17:47:40 -0000 Author: jhb Date: Thu Aug 30 17:47:39 2012 New Revision: 239913 URL: http://svn.freebsd.org/changeset/base/239913 Log: Attach interrupt handlers during attach instead of during the first time the interface is brought up. Without this, the boot time interrupt round-robin assignment does not think the allocated interrupt resources are active and leaves them assigned to CPU 0. While here, add descriptive tags to each interrupt handler when MSI-X is used. Reviewed by: np MFC after: 1 week Modified: head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Thu Aug 30 17:37:01 2012 (r239912) +++ head/sys/dev/cxgb/cxgb_main.c Thu Aug 30 17:47:39 2012 (r239913) @@ -675,6 +675,9 @@ cxgb_controller_attach(device_t dev) for (i = 0; i < NUM_CPL_HANDLERS; i++) sc->cpl_handler[i] = cpl_not_handled; #endif + + t3_intr_clear(sc); + error = cxgb_setup_interrupts(sc); out: if (error) cxgb_free(sc); @@ -922,6 +925,7 @@ cxgb_setup_interrupts(adapter_t *sc) if (!(intr_flag & USING_MSIX) || err) return (err); + bus_describe_intr(sc->dev, sc->irq_res, sc->intr_tag, "err"); for (i = 0; i < sc->msi_count - 1; i++) { rid = i + 2; res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid, @@ -945,6 +949,7 @@ cxgb_setup_interrupts(adapter_t *sc) sc->msix_irq_rid[i] = rid; sc->msix_irq_res[i] = res; sc->msix_intr_tag[i] = tag; + bus_describe_intr(sc->dev, res, tag, "qs%d", i); } if (err) @@ -1611,11 +1616,6 @@ cxgb_up(struct adapter *sc) alloc_filters(sc); setup_rss(sc); - t3_intr_clear(sc); - err = cxgb_setup_interrupts(sc); - if (err) - goto out; - t3_add_configured_sysctls(sc); sc->flags |= FULL_INIT_DONE; } From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 20:31:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E1BC1065673; Thu, 30 Aug 2012 20:31:54 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2618FC0C; Thu, 30 Aug 2012 20:31:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UKVsL6009417; Thu, 30 Aug 2012 20:31:54 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UKVsv5009412; Thu, 30 Aug 2012 20:31:54 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208302031.q7UKVsv5009412@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 30 Aug 2012 20:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239919 - in head/sys: conf dev/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 20:31:54 -0000 Author: gonzo Date: Thu Aug 30 20:31:53 2012 New Revision: 239919 URL: http://svn.freebsd.org/changeset/base/239919 Log: Add PrimeCell UART (PL011) driver Obtained from: Semihalf Added: head/sys/dev/uart/uart_dev_pl011.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/uart/uart.h head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Aug 30 19:47:15 2012 (r239918) +++ head/sys/conf/files Thu Aug 30 20:31:53 2012 (r239919) @@ -2065,6 +2065,7 @@ dev/uart/uart_bus_scc.c optional uart s dev/uart/uart_core.c optional uart dev/uart/uart_dbg.c optional uart gdb dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 +dev/uart/uart_dev_pl011.c optional uart pl011 dev/uart/uart_dev_quicc.c optional uart quicc dev/uart/uart_dev_sab82532.c optional uart uart_sab82532 dev/uart/uart_dev_sab82532.c optional uart scc Modified: head/sys/dev/uart/uart.h ============================================================================== --- head/sys/dev/uart/uart.h Thu Aug 30 19:47:15 2012 (r239918) +++ head/sys/dev/uart/uart.h Thu Aug 30 20:31:53 2012 (r239919) @@ -70,6 +70,7 @@ extern struct uart_class uart_sab82532_c extern struct uart_class uart_sbbc_class __attribute__((weak)); extern struct uart_class uart_z8530_class __attribute__((weak)); extern struct uart_class uart_lpc_class __attribute__((weak)); +extern struct uart_class uart_pl011_class __attribute__((weak)); #ifdef PC98 struct uart_class *uart_pc98_getdev(u_long port); Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Thu Aug 30 19:47:15 2012 (r239918) +++ head/sys/dev/uart/uart_bus_fdt.c Thu Aug 30 20:31:53 2012 (r239919) @@ -105,6 +105,8 @@ uart_fdt_probe(device_t dev) sc->sc_class = &uart_ns8250_class; else if (ofw_bus_is_compatible(dev, "lpc,uart")) sc->sc_class = &uart_lpc_class; + else if (ofw_bus_is_compatible(dev, "arm,pl011")) + sc->sc_class = &uart_pl011_class; else return (ENXIO); @@ -188,6 +190,8 @@ uart_cpu_getdev(int devtype, struct uart class = &uart_lpc_class; if (fdt_is_compatible(node, "ns16550")) class = &uart_ns8250_class; + if (fdt_is_compatible(node, "arm,pl011")) + class = &uart_pl011_class; di->bas.chan = 0; di->bas.regshft = (u_int)shift; Added: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_dev_pl011.c Thu Aug 30 20:31:53 2012 (r239919) @@ -0,0 +1,436 @@ +/*- + * Copyright (c) 2012 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include "uart_if.h" + +#include + +/* PL011 UART registers and masks*/ +#define UART_DR 0x00 /* Data register */ +#define DR_FE (1 << 8) /* Framing error */ +#define DR_PE (1 << 9) /* Parity error */ +#define DR_BE (1 << 10) /* Break error */ +#define DR_OE (1 << 11) /* Overrun error */ + +#define UART_FR 0x06 /* Flag register */ +#define FR_RXFF (1 << 6) /* Receive FIFO/reg full */ +#define FR_TXFE (1 << 7) /* Transmit FIFO/reg empty */ + +#define UART_IBRD 0x09 /* Integer baud rate register */ +#define IBRD_BDIVINT 0xffff /* Significant part of int. divisor value */ + +#define UART_FBRD 0x0a /* Fractional baud rate register */ +#define FBRD_BDIVFRAC 0x3f /* Significant part of frac. divisor value */ + +#define UART_LCR_H 0x0b /* Line control register */ +#define LCR_H_WLEN8 (0x3 << 5) +#define LCR_H_WLEN7 (0x2 << 5) +#define LCR_H_WLEN6 (0x1 << 5) +#define LCR_H_FEN (1 << 4) /* FIFO mode enable */ +#define LCR_H_STP2 (1 << 3) /* 2 stop frames at the end */ +#define LCR_H_EPS (1 << 2) /* Even parity select */ +#define LCR_H_PEN (1 << 1) /* Parity enable */ + +#define UART_CR 0x0c /* Control register */ +#define CR_RXE (1 << 9) /* Receive enable */ +#define CR_TXE (1 << 8) /* Transmit enable */ +#define CR_UARTEN (1 << 0) /* UART enable */ + +#define UART_IMSC 0x0e /* Interrupt mask set/clear register */ +#define IMSC_MASK_ALL 0x7ff /* Mask all interrupts */ + +#define UART_RIS 0x0f /* Raw interrupt status register */ +#define UART_RXREADY (1 << 4) /* RX buffer full */ +#define UART_TXEMPTY (1 << 5) /* TX buffer empty */ +#define RIS_FE (1 << 7) /* Framing error interrupt status */ +#define RIS_PE (1 << 8) /* Parity error interrupt status */ +#define RIS_BE (1 << 9) /* Break error interrupt status */ +#define RIS_OE (1 << 10) /* Overrun interrupt status */ + +#define UART_MIS 0x10 /* Masked interrupt status register */ +#define UART_ICR 0x11 /* Interrupt clear register */ + +/* + * FIXME: actual register size is SoC-dependent, we need to handle it + */ +#define __uart_getreg(bas, reg) \ + bus_space_read_4((bas)->bst, (bas)->bsh, uart_regofs(bas, reg)) +#define __uart_setreg(bas, reg, value) \ + bus_space_write_4((bas)->bst, (bas)->bsh, uart_regofs(bas, reg), value) + +/* + * Low-level UART interface. + */ +static int uart_pl011_probe(struct uart_bas *bas); +static void uart_pl011_init(struct uart_bas *bas, int, int, int, int); +static void uart_pl011_term(struct uart_bas *bas); +static void uart_pl011_putc(struct uart_bas *bas, int); +static int uart_pl011_rxready(struct uart_bas *bas); +static int uart_pl011_getc(struct uart_bas *bas, struct mtx *); + +static struct uart_ops uart_pl011_ops = { + .probe = uart_pl011_probe, + .init = uart_pl011_init, + .term = uart_pl011_term, + .putc = uart_pl011_putc, + .rxready = uart_pl011_rxready, + .getc = uart_pl011_getc, +}; + +static int +uart_pl011_probe(struct uart_bas *bas) +{ + + return (0); +} + +static void +uart_pl011_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, + int parity) +{ + uint32_t ctrl, line; + uint32_t baud; + + /* Mask all interrupts */ + __uart_setreg(bas, UART_IMSC, __uart_getreg(bas, UART_IMSC) & + ~IMSC_MASK_ALL); + + /* + * Zero all settings to make sure + * UART is disabled and not configured + */ + ctrl = line = 0x0; + __uart_setreg(bas, UART_CR, ctrl); + + /* As we know UART is disabled we may setup the line */ + switch (databits) { + case 7: + line |= LCR_H_WLEN7; + break; + case 6: + line |= LCR_H_WLEN6; + break; + case 8: + default: + line |= LCR_H_WLEN8; + break; + } + + /* TODO: Calculate divisors */ + baud = (0x1 << 16) | 0x28; + + if (stopbits == 2) + line |= LCR_H_STP2; + else + line &= ~LCR_H_STP2; + + if (parity) + line |= LCR_H_PEN; + else + line &= ~LCR_H_PEN; + + /* Configure the rest */ + line &= ~LCR_H_FEN; + ctrl |= (CR_RXE | CR_TXE | CR_UARTEN); + + __uart_setreg(bas, UART_IBRD, ((uint32_t)(baud >> 16)) & IBRD_BDIVINT); + __uart_setreg(bas, UART_FBRD, (uint32_t)(baud) & FBRD_BDIVFRAC); + + /* Add config. to line before reenabling UART */ + __uart_setreg(bas, UART_LCR_H, (__uart_getreg(bas, UART_LCR_H) & + ~0xff) | line); + + __uart_setreg(bas, UART_CR, ctrl); +} + +static void +uart_pl011_term(struct uart_bas *bas) +{ +} + +static void +uart_pl011_putc(struct uart_bas *bas, int c) +{ + + while (!(__uart_getreg(bas, UART_FR) & FR_TXFE)) + ; + __uart_setreg(bas, UART_DR, c & 0xff); +} + +static int +uart_pl011_rxready(struct uart_bas *bas) +{ + + return (__uart_getreg(bas, UART_FR) & FR_RXFF); +} + +static int +uart_pl011_getc(struct uart_bas *bas, struct mtx *hwmtx) +{ + int c; + + while (!uart_pl011_rxready(bas)) + ; + c = __uart_getreg(bas, UART_DR) & 0xff; + + return (c); +} + +/* + * High-level UART interface. + */ +struct uart_pl011_softc { + struct uart_softc base; + uint8_t fcr; + uint8_t ier; + uint8_t mcr; + + uint8_t ier_mask; + uint8_t ier_rxbits; +}; + +static int uart_pl011_bus_attach(struct uart_softc *); +static int uart_pl011_bus_detach(struct uart_softc *); +static int uart_pl011_bus_flush(struct uart_softc *, int); +static int uart_pl011_bus_getsig(struct uart_softc *); +static int uart_pl011_bus_ioctl(struct uart_softc *, int, intptr_t); +static int uart_pl011_bus_ipend(struct uart_softc *); +static int uart_pl011_bus_param(struct uart_softc *, int, int, int, int); +static int uart_pl011_bus_probe(struct uart_softc *); +static int uart_pl011_bus_receive(struct uart_softc *); +static int uart_pl011_bus_setsig(struct uart_softc *, int); +static int uart_pl011_bus_transmit(struct uart_softc *); + +static kobj_method_t uart_pl011_methods[] = { + KOBJMETHOD(uart_attach, uart_pl011_bus_attach), + KOBJMETHOD(uart_detach, uart_pl011_bus_detach), + KOBJMETHOD(uart_flush, uart_pl011_bus_flush), + KOBJMETHOD(uart_getsig, uart_pl011_bus_getsig), + KOBJMETHOD(uart_ioctl, uart_pl011_bus_ioctl), + KOBJMETHOD(uart_ipend, uart_pl011_bus_ipend), + KOBJMETHOD(uart_param, uart_pl011_bus_param), + KOBJMETHOD(uart_probe, uart_pl011_bus_probe), + KOBJMETHOD(uart_receive, uart_pl011_bus_receive), + KOBJMETHOD(uart_setsig, uart_pl011_bus_setsig), + KOBJMETHOD(uart_transmit, uart_pl011_bus_transmit), + { 0, 0 } +}; + +struct uart_class uart_pl011_class = { + "uart_pl011", + uart_pl011_methods, + sizeof(struct uart_pl011_softc), + .uc_ops = &uart_pl011_ops, + .uc_range = 0x48, + .uc_rclk = 0 +}; + +static int +uart_pl011_bus_attach(struct uart_softc *sc) +{ + struct uart_bas *bas; + + bas = &sc->sc_bas; + /* Enable RX & TX interrupts */ + __uart_setreg(bas, UART_IMSC, (UART_RXREADY | UART_TXEMPTY)); + /* Clear RX & TX interrupts */ + __uart_setreg(bas, UART_ICR, IMSC_MASK_ALL); + + sc->sc_rxfifosz = 1; + sc->sc_txfifosz = 1; + + return (0); +} + +static int +uart_pl011_bus_detach(struct uart_softc *sc) +{ + + return (0); +} + +static int +uart_pl011_bus_flush(struct uart_softc *sc, int what) +{ + + return (0); +} + +static int +uart_pl011_bus_getsig(struct uart_softc *sc) +{ + + return (0); +} + +static int +uart_pl011_bus_ioctl(struct uart_softc *sc, int request, intptr_t data) +{ + struct uart_bas *bas; + int error; + + bas = &sc->sc_bas; + error = 0; + uart_lock(sc->sc_hwmtx); + switch (request) { + case UART_IOCTL_BREAK: + break; + case UART_IOCTL_BAUD: + *(int*)data = 115200; + break; + default: + error = EINVAL; + break; + } + uart_unlock(sc->sc_hwmtx); + + return (error); +} + +static int +uart_pl011_bus_ipend(struct uart_softc *sc) +{ + struct uart_bas *bas; + int ipend; + uint32_t ints; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + ints = __uart_getreg(bas, UART_MIS); + ipend = 0; + + if (ints & UART_RXREADY) + ipend |= SER_INT_RXREADY; + if (ints & RIS_BE) + ipend |= SER_INT_BREAK; + if (ints & RIS_OE) + ipend |= SER_INT_OVERRUN; + if (ints & UART_TXEMPTY) { + if (sc->sc_txbusy) + ipend |= SER_INT_TXIDLE; + + __uart_setreg(bas, UART_IMSC, UART_RXREADY); + } + + uart_unlock(sc->sc_hwmtx); + + return (ipend); +} + +static int +uart_pl011_bus_param(struct uart_softc *sc, int baudrate, int databits, + int stopbits, int parity) +{ + + uart_lock(sc->sc_hwmtx); + uart_pl011_init(&sc->sc_bas, baudrate, databits, stopbits, parity); + uart_unlock(sc->sc_hwmtx); + + return (0); +} + +static int +uart_pl011_bus_probe(struct uart_softc *sc) +{ + + device_set_desc(sc->sc_dev, "PrimeCell UART (PL011)"); + + return (0); +} + +static int +uart_pl011_bus_receive(struct uart_softc *sc) +{ + struct uart_bas *bas; + int rx; + uint32_t ints, xc; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + + ints = __uart_getreg(bas, UART_MIS); + while (ints & UART_RXREADY) { + if (uart_rx_full(sc)) { + sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; + break; + } + xc = __uart_getreg(bas, UART_DR); + rx = xc & 0xff; + + if (xc & DR_FE) + rx |= UART_STAT_FRAMERR; + if (xc & DR_PE) + rx |= UART_STAT_PARERR; + + __uart_setreg(bas, UART_ICR, UART_RXREADY); + + uart_rx_put(sc, rx); + ints = __uart_getreg(bas, UART_MIS); + } + + uart_unlock(sc->sc_hwmtx); + + return (0); +} + +static int +uart_pl011_bus_setsig(struct uart_softc *sc, int sig) +{ + + return (0); +} + +static int +uart_pl011_bus_transmit(struct uart_softc *sc) +{ + struct uart_bas *bas; + int i; + + bas = &sc->sc_bas; + uart_lock(sc->sc_hwmtx); + + for (i = 0; i < sc->sc_txdatasz; i++) { + __uart_setreg(bas, UART_DR, sc->sc_txbuf[i]); + uart_barrier(bas); + } + sc->sc_txbusy = 1; + __uart_setreg(bas, UART_IMSC, (UART_RXREADY | UART_TXEMPTY)); + uart_unlock(sc->sc_hwmtx); + + return (0); +} From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 20:59:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DDD24106566C; Thu, 30 Aug 2012 20:59:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C74CF8FC16; Thu, 30 Aug 2012 20:59: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 q7UKxbYQ013263; Thu, 30 Aug 2012 20:59:37 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UKxbpT013259; Thu, 30 Aug 2012 20:59:37 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201208302059.q7UKxbpT013259@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 30 Aug 2012 20:59: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: r239922 - in head/sys: arm/broadcom arm/broadcom/bcm2835 arm/conf boot/fdt/dts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 20:59:38 -0000 Author: gonzo Date: Thu Aug 30 20:59:37 2012 New Revision: 239922 URL: http://svn.freebsd.org/changeset/base/239922 Log: Add barebone Raspberry Pi port. Supported parts: - Interrupts controller - Watchdog - System timer - Framebuffer (hardcoded resolution/bpp) Added: head/sys/arm/broadcom/ head/sys/arm/broadcom/bcm2835/ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_intr.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_mbox.h (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.h (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c (contents, props changed) head/sys/arm/broadcom/bcm2835/bcm2835_wdog.h (contents, props changed) head/sys/arm/broadcom/bcm2835/bus_space.c (contents, props changed) head/sys/arm/broadcom/bcm2835/common.c (contents, props changed) head/sys/arm/broadcom/bcm2835/files.bcm2835 (contents, props changed) head/sys/arm/conf/RPI-B (contents, props changed) head/sys/boot/fdt/dts/bcm2835-rpi-b.dts (contents, props changed) Added: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Thu Aug 30 20:59:37 2012 (r239922) @@ -0,0 +1,714 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * 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 +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#define BCMFB_FONT_HEIGHT 16 + +#define FB_WIDTH 640 +#define FB_HEIGHT 480 + +struct bcm_fb_config { + uint32_t xres; + uint32_t yres; + uint32_t vxres; + uint32_t vyres; + uint32_t pitch; + uint32_t bpp; + uint32_t xoffset; + uint32_t yoffset; + /* Filled by videocore */ + uint32_t base; + uint32_t screen_size; +}; + +struct bcmsc_softc { + device_t dev; + struct cdev * cdev; + struct mtx mtx; + bus_dma_tag_t dma_tag; + bus_dmamap_t dma_map; + struct bcm_fb_config* fb_config; + bus_addr_t fb_config_phys; + struct intr_config_hook init_hook; + +}; + +struct video_adapter_softc { + /* Videoadpater part */ + video_adapter_t va; + int console; + + intptr_t fb_addr; + unsigned int fb_size; + + unsigned int height; + unsigned int width; + unsigned int stride; + + unsigned int xmargin; + unsigned int ymargin; + + unsigned char *font; + int initialized; +}; + +static struct bcmsc_softc *bcmsc_softc; +static struct video_adapter_softc va_softc; + +#define bcm_fb_lock(_sc) mtx_lock(&(_sc)->mtx) +#define bcm_fb_unlock(_sc) mtx_unlock(&(_sc)->mtx) +#define bcm_fb_lock_assert(sc) mtx_assert(&(_sc)->mtx, MA_OWNED) + +static int bcm_fb_probe(device_t); +static int bcm_fb_attach(device_t); +static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err); + +static void +bcm_fb_init(void *arg) +{ + struct bcmsc_softc *sc = arg; + struct video_adapter_softc *va_sc = &va_softc; + int err; + volatile struct bcm_fb_config* fb_config = sc->fb_config; + + /* TODO: replace it with FDT stuff */ + fb_config->xres = FB_WIDTH; + fb_config->yres = FB_HEIGHT; + fb_config->vxres = 0; + fb_config->vyres = 0; + fb_config->xoffset = 0; + fb_config->yoffset = 0; + fb_config->bpp = 24; + fb_config->base = 0; + fb_config->pitch = 0; + fb_config->screen_size = 0; + + bus_dmamap_sync(sc->dma_tag, sc->dma_map, + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + bcm_mbox_write(BCM2835_MBOX_CHAN_FB, sc->fb_config_phys); + bcm_mbox_read(BCM2835_MBOX_CHAN_FB, &err); + bus_dmamap_sync(sc->dma_tag, sc->dma_map, + BUS_DMASYNC_POSTREAD); + + if (err == 0) { + device_printf(sc->dev, "%dx%d(%dx%d@%d,%d) %dbpp\n", + fb_config->xres, fb_config->yres, + fb_config->vxres, fb_config->vyres, + fb_config->xoffset, fb_config->yoffset, + fb_config->bpp); + + + device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n", + fb_config->pitch, fb_config->base, + fb_config->screen_size); + + if (fb_config->base) { + va_sc->fb_addr = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size); + va_sc->fb_size = fb_config->screen_size; + va_sc->stride = fb_config->pitch; + } + } + else + device_printf(sc->dev, "Failed to set framebuffer info\n"); + + config_intrhook_disestablish(&sc->init_hook); +} + +static int +bcm_fb_probe(device_t dev) +{ + int error; + + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-fb")) + return (ENXIO); + + device_set_desc(dev, "BCM2835 framebuffer device"); + + error = sc_probe_unit(device_get_unit(dev), + device_get_flags(dev) | SC_AUTODETECT_KBD); + + if (error != 0) + return (error); + + return (BUS_PROBE_DEFAULT); +} + +static int +bcm_fb_attach(device_t dev) +{ + struct bcmsc_softc *sc = device_get_softc(dev); + int dma_size = sizeof(struct bcm_fb_config); + int err; + + if (bcmsc_softc) + return (ENXIO); + + bcmsc_softc = sc; + + sc->dev = dev; + mtx_init(&sc->mtx, "bcm2835fb", "fb", MTX_DEF); + + err = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), + PAGE_SIZE, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + dma_size, 1, /* maxsize, nsegments */ + dma_size, 0, /* maxsegsize, flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->dma_tag); + + err = bus_dmamem_alloc(sc->dma_tag, (void **)&sc->fb_config, + 0, &sc->dma_map); + if (err) { + device_printf(dev, "cannot allocate framebuffer\n"); + goto fail; + } + + err = bus_dmamap_load(sc->dma_tag, sc->dma_map, sc->fb_config, + dma_size, bcm_fb_dmamap_cb, &sc->fb_config_phys, BUS_DMA_NOWAIT); + + if (err) { + device_printf(dev, "cannot load DMA map\n"); + goto fail; + } + + err = (sc_attach_unit(device_get_unit(dev), + device_get_flags(dev) | SC_AUTODETECT_KBD)); + + if (err) { + device_printf(dev, "failed to attach syscons\n"); + goto fail; + } + + /* + * We have to wait until interrupts are enabled. + * Mailbox relies on it to get data from VideoCore + */ + sc->init_hook.ich_func = bcm_fb_init; + sc->init_hook.ich_arg = sc; + + if (config_intrhook_establish(&sc->init_hook) != 0) { + device_printf(dev, "failed to establish intrhook\n"); + return (ENOMEM); + } + + return (0); + +fail: + return (ENXIO); +} + + +static void +bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) +{ + bus_addr_t *addr; + + if (err) + return; + + addr = (bus_addr_t*)arg; + *addr = PHYS_TO_VCBUS(segs[0].ds_addr); +} + +static device_method_t bcm_fb_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bcm_fb_probe), + DEVMETHOD(device_attach, bcm_fb_attach), + + { 0, 0 } +}; + +static devclass_t bcm_fb_devclass; + +static driver_t bcm_fb_driver = { + "fb", + bcm_fb_methods, + sizeof(struct bcmsc_softc), +}; + +DRIVER_MODULE(bcm2835fb, simplebus, bcm_fb_driver, bcm_fb_devclass, 0, 0); + +/* + * Video driver routines and glue. + */ +static int bcmfb_configure(int); +static vi_probe_t bcmfb_probe; +static vi_init_t bcmfb_init; +static vi_get_info_t bcmfb_get_info; +static vi_query_mode_t bcmfb_query_mode; +static vi_set_mode_t bcmfb_set_mode; +static vi_save_font_t bcmfb_save_font; +static vi_load_font_t bcmfb_load_font; +static vi_show_font_t bcmfb_show_font; +static vi_save_palette_t bcmfb_save_palette; +static vi_load_palette_t bcmfb_load_palette; +static vi_set_border_t bcmfb_set_border; +static vi_save_state_t bcmfb_save_state; +static vi_load_state_t bcmfb_load_state; +static vi_set_win_org_t bcmfb_set_win_org; +static vi_read_hw_cursor_t bcmfb_read_hw_cursor; +static vi_set_hw_cursor_t bcmfb_set_hw_cursor; +static vi_set_hw_cursor_shape_t bcmfb_set_hw_cursor_shape; +static vi_blank_display_t bcmfb_blank_display; +static vi_mmap_t bcmfb_mmap; +static vi_ioctl_t bcmfb_ioctl; +static vi_clear_t bcmfb_clear; +static vi_fill_rect_t bcmfb_fill_rect; +static vi_bitblt_t bcmfb_bitblt; +static vi_diag_t bcmfb_diag; +static vi_save_cursor_palette_t bcmfb_save_cursor_palette; +static vi_load_cursor_palette_t bcmfb_load_cursor_palette; +static vi_copy_t bcmfb_copy; +static vi_putp_t bcmfb_putp; +static vi_putc_t bcmfb_putc; +static vi_puts_t bcmfb_puts; +static vi_putm_t bcmfb_putm; + +static video_switch_t bcmfbvidsw = { + .probe = bcmfb_probe, + .init = bcmfb_init, + .get_info = bcmfb_get_info, + .query_mode = bcmfb_query_mode, + .set_mode = bcmfb_set_mode, + .save_font = bcmfb_save_font, + .load_font = bcmfb_load_font, + .show_font = bcmfb_show_font, + .save_palette = bcmfb_save_palette, + .load_palette = bcmfb_load_palette, + .set_border = bcmfb_set_border, + .save_state = bcmfb_save_state, + .load_state = bcmfb_load_state, + .set_win_org = bcmfb_set_win_org, + .read_hw_cursor = bcmfb_read_hw_cursor, + .set_hw_cursor = bcmfb_set_hw_cursor, + .set_hw_cursor_shape = bcmfb_set_hw_cursor_shape, + .blank_display = bcmfb_blank_display, + .mmap = bcmfb_mmap, + .ioctl = bcmfb_ioctl, + .clear = bcmfb_clear, + .fill_rect = bcmfb_fill_rect, + .bitblt = bcmfb_bitblt, + .diag = bcmfb_diag, + .save_cursor_palette = bcmfb_save_cursor_palette, + .load_cursor_palette = bcmfb_load_cursor_palette, + .copy = bcmfb_copy, + .putp = bcmfb_putp, + .putc = bcmfb_putc, + .puts = bcmfb_puts, + .putm = bcmfb_putm, +}; + +VIDEO_DRIVER(bcmfb, bcmfbvidsw, bcmfb_configure); + +extern sc_rndr_sw_t txtrndrsw; +RENDERER(bcmfb, 0, txtrndrsw, gfb_set); +RENDERER_MODULE(bcmfb, gfb_set); + +static uint16_t bcmfb_static_window[ROW*COL]; +extern u_char dflt_font_16[]; + +static int +bcmfb_configure(int flags) +{ + struct video_adapter_softc *sc; + + sc = &va_softc; + + if (sc->initialized) + return 0; + + sc->height = FB_HEIGHT; + sc->width = FB_WIDTH; + + bcmfb_init(0, &sc->va, 0); + + sc->initialized = 1; + + return (0); +} + +static int +bcmfb_probe(int unit, video_adapter_t **adp, void *arg, int flags) +{ + + return (0); +} + +static int +bcmfb_init(int unit, video_adapter_t *adp, int flags) +{ + struct video_adapter_softc *sc; + video_info_t *vi; + + sc = (struct video_adapter_softc *)adp; + vi = &adp->va_info; + + vid_init_struct(adp, "bcmfb", -1, unit); + + sc->font = dflt_font_16; + vi->vi_cheight = BCMFB_FONT_HEIGHT; + vi->vi_cwidth = 8; + vi->vi_width = sc->width/8; + vi->vi_height = sc->height/vi->vi_cheight; + + /* + * Clamp width/height to syscons maximums + */ + if (vi->vi_width > COL) + vi->vi_width = COL; + if (vi->vi_height > ROW) + vi->vi_height = ROW; + + sc->xmargin = (sc->width - (vi->vi_width * vi->vi_cwidth)) / 2; + sc->ymargin = (sc->height - (vi->vi_height * vi->vi_cheight))/2; + + adp->va_window = (vm_offset_t) bcmfb_static_window; + adp->va_flags |= V_ADP_FONT /* | V_ADP_COLOR | V_ADP_MODECHANGE */; + + vid_register(&sc->va); + + return (0); +} + +static int +bcmfb_get_info(video_adapter_t *adp, int mode, video_info_t *info) +{ + bcopy(&adp->va_info, info, sizeof(*info)); + return (0); +} + +static int +bcmfb_query_mode(video_adapter_t *adp, video_info_t *info) +{ + return (0); +} + +static int +bcmfb_set_mode(video_adapter_t *adp, int mode) +{ + return (0); +} + +static int +bcmfb_save_font(video_adapter_t *adp, int page, int size, int width, + u_char *data, int c, int count) +{ + return (0); +} + +static int +bcmfb_load_font(video_adapter_t *adp, int page, int size, int width, + u_char *data, int c, int count) +{ + struct video_adapter_softc *sc = (struct video_adapter_softc *)adp; + + sc->font = data; + + return (0); +} + +static int +bcmfb_show_font(video_adapter_t *adp, int page) +{ + return (0); +} + +static int +bcmfb_save_palette(video_adapter_t *adp, u_char *palette) +{ + return (0); +} + +static int +bcmfb_load_palette(video_adapter_t *adp, u_char *palette) +{ + return (0); +} + +static int +bcmfb_set_border(video_adapter_t *adp, int border) +{ + return (bcmfb_blank_display(adp, border)); +} + +static int +bcmfb_save_state(video_adapter_t *adp, void *p, size_t size) +{ + return (0); +} + +static int +bcmfb_load_state(video_adapter_t *adp, void *p) +{ + return (0); +} + +static int +bcmfb_set_win_org(video_adapter_t *adp, off_t offset) +{ + return (0); +} + +static int +bcmfb_read_hw_cursor(video_adapter_t *adp, int *col, int *row) +{ + *col = *row = 0; + + return (0); +} + +static int +bcmfb_set_hw_cursor(video_adapter_t *adp, int col, int row) +{ + return (0); +} + +static int +bcmfb_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, + int celsize, int blink) +{ + return (0); +} + +static int +bcmfb_blank_display(video_adapter_t *adp, int mode) +{ + + return (0); +} + +static int +bcmfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) +{ + struct video_adapter_softc *sc; + + sc = (struct video_adapter_softc *)adp; + + /* + * This might be a legacy VGA mem request: if so, just point it at the + * framebuffer, since it shouldn't be touched + */ + if (offset < sc->stride*sc->height) { + *paddr = sc->fb_addr + offset; + return (0); + } + + return (EINVAL); +} + +static int +bcmfb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data) +{ + + return (0); +} + +static int +bcmfb_clear(video_adapter_t *adp) +{ + + return (bcmfb_blank_display(adp, 0)); +} + +static int +bcmfb_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy) +{ + + return (0); +} + +static int +bcmfb_bitblt(video_adapter_t *adp, ...) +{ + + return (0); +} + +static int +bcmfb_diag(video_adapter_t *adp, int level) +{ + + return (0); +} + +static int +bcmfb_save_cursor_palette(video_adapter_t *adp, u_char *palette) +{ + + return (0); +} + +static int +bcmfb_load_cursor_palette(video_adapter_t *adp, u_char *palette) +{ + + return (0); +} + +static int +bcmfb_copy(video_adapter_t *adp, vm_offset_t src, vm_offset_t dst, int n) +{ + + return (0); +} + +static int +bcmfb_putp(video_adapter_t *adp, vm_offset_t off, uint32_t p, uint32_t a, + int size, int bpp, int bit_ltor, int byte_ltor) +{ + + return (0); +} + +static int +bcmfb_putc(video_adapter_t *adp, vm_offset_t off, uint8_t c, uint8_t a) +{ + struct video_adapter_softc *sc; + int row; + int col; + int i, j, k; + uint8_t *addr; + u_char *p; + uint8_t fg, bg, color; + + sc = (struct video_adapter_softc *)adp; + + if (sc->fb_addr == 0) + return (0); + + row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight; + col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth; + p = sc->font + c*BCMFB_FONT_HEIGHT; + addr = (uint8_t *)sc->fb_addr + + (row + sc->ymargin)*(sc->stride) + + 3 * (col + sc->xmargin); + + /* + * FIXME: hardcoded + */ + bg = 0x00; + fg = 0x80; + + for (i = 0; i < BCMFB_FONT_HEIGHT; i++) { + for (j = 0, k = 7; j < 8; j++, k--) { + if ((p[i] & (1 << k)) == 0) + color = bg; + else + color = fg; + + addr[3*j] = color; + addr[3*j+1] = color; + addr[3*j+2] = color; + } + + addr += (sc->stride); + } + + return (0); +} + +static int +bcmfb_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len) +{ + int i; + + for (i = 0; i < len; i++) + bcmfb_putc(adp, off + i, s[i] & 0xff, (s[i] & 0xff00) >> 8); + + return (0); +} + +static int +bcmfb_putm(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, + uint32_t pixel_mask, int size, int width) +{ + + return (0); +} + +/* + * Define a stub keyboard driver in case one hasn't been + * compiled into the kernel + */ +#include +#include + +static int dummy_kbd_configure(int flags); + +keyboard_switch_t bcmdummysw; + +static int +dummy_kbd_configure(int flags) +{ + + return (0); +} +KEYBOARD_DRIVER(bcmdummy, bcmdummysw, dummy_kbd_configure); Added: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Thu Aug 30 20:59:37 2012 (r239922) @@ -0,0 +1,203 @@ +/*- + * Copyright (c) 2012 Damjan Marion + * All rights reserved. + * + * Based on OMAP3 INTC code by Ben Gray + * + * 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 + +#define INTC_PENDING_BASIC 0x00 +#define INTC_PENDING_BANK1 0x04 +#define INTC_PENDING_BANK2 0x08 +#define INTC_FIQ_CONTROL 0x0C +#define INTC_ENABLE_BANK1 0x10 +#define INTC_ENABLE_BANK2 0x14 +#define INTC_ENABLE_BASIC 0x18 +#define INTC_DISABLE_BANK1 0x1C +#define INTC_DISABLE_BANK2 0x20 +#define INTC_DISABLE_BASIC 0x24 + +#define BANK1_START 8 +#define BANK1_END (BANK1_START + 32 - 1) +#define BANK2_START (BANK1_START + 32) +#define BANK2_END (BANK2_START + 32 - 1) + +#define IS_IRQ_BASIC(n) (((n) >= 0) && ((n) < BANK1_START)) +#define IS_IRQ_BANK1(n) (((n) >= BANK1_START) && ((n) <= BANK1_END)) +#define IS_IRQ_BANK2(n) (((n) >= BANK2_START) && ((n) <= BANK2_END)) +#define IRQ_BANK1(n) ((n) - BANK1_START) +#define IRQ_BANK2(n) ((n) - BANK2_START) + +#ifdef DEBUG +#define dprintf(fmt, args...) printf(fmt, ##args) +#else +#define dprintf(fmt, args...) +#endif + +struct bcm_intc_softc { + device_t sc_dev; + struct resource * intc_res; + bus_space_tag_t intc_bst; + bus_space_handle_t intc_bsh; +}; + +static struct bcm_intc_softc *bcm_intc_sc = NULL; + +#define intc_read_4(reg) \ + bus_space_read_4(bcm_intc_sc->intc_bst, bcm_intc_sc->intc_bsh, reg) +#define intc_write_4(reg, val) \ + bus_space_write_4(bcm_intc_sc->intc_bst, bcm_intc_sc->intc_bsh, reg, val) + +static int +bcm_intc_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-armctrl-ic")) + return (ENXIO); + device_set_desc(dev, "BCM2835 Interrupt Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +bcm_intc_attach(device_t dev) +{ + struct bcm_intc_softc *sc = device_get_softc(dev); + int rid = 0; + + sc->sc_dev = dev; + + if (bcm_intc_sc) + return (ENXIO); + + sc->intc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->intc_res == NULL) { + device_printf(dev, "could not allocate memory resource\n"); + return (ENXIO); + } + + sc->intc_bst = rman_get_bustag(sc->intc_res); + sc->intc_bsh = rman_get_bushandle(sc->intc_res); + + bcm_intc_sc = sc; + + return (0); +} + +static device_method_t bcm_intc_methods[] = { + DEVMETHOD(device_probe, bcm_intc_probe), + DEVMETHOD(device_attach, bcm_intc_attach), + { 0, 0 } +}; + +static driver_t bcm_intc_driver = { + "intc", + bcm_intc_methods, + sizeof(struct bcm_intc_softc), +}; + +static devclass_t bcm_intc_devclass; + +DRIVER_MODULE(intc, simplebus, bcm_intc_driver, bcm_intc_devclass, 0, 0); + +int +arm_get_next_irq(int last_irq) +{ + uint32_t pending; + int32_t irq = last_irq + 1; + + /* Sanity check */ + if (irq < 0) + irq = 0; + + /* TODO: should we mask last_irq? */ + pending = intc_read_4(INTC_PENDING_BASIC); + while (irq < BANK1_START) { + if (pending & (1 << irq)) + return irq; + irq++; + } + + pending = intc_read_4(INTC_PENDING_BANK1); + while (irq < BANK2_START) { + if (pending & (1 << IRQ_BANK1(irq))) + return irq; + irq++; + } + + pending = intc_read_4(INTC_PENDING_BANK2); + while (irq <= BANK2_END) { + if (pending & (1 << IRQ_BANK2(irq))) + return irq; + irq++; + } + + return (-1); +} + +void +arm_mask_irq(uintptr_t nb) +{ + dprintf("%s: %d\n", __func__, nb); + + if (IS_IRQ_BASIC(nb)) + intc_write_4(INTC_DISABLE_BASIC, (1 << nb)); + else if (IS_IRQ_BANK1(nb)) + intc_write_4(INTC_DISABLE_BANK1, (1 << IRQ_BANK1(nb))); + else if (IS_IRQ_BANK2(nb)) + intc_write_4(INTC_DISABLE_BANK2, (1 << IRQ_BANK2(nb))); + else + printf("arm_mask_irq: Invalid IRQ number: %d\n", nb); +} + +void +arm_unmask_irq(uintptr_t nb) +{ + dprintf("%s: %d\n", __func__, nb); + + if (IS_IRQ_BASIC(nb)) + intc_write_4(INTC_ENABLE_BASIC, (1 << nb)); + else if (IS_IRQ_BANK1(nb)) + intc_write_4(INTC_ENABLE_BANK1, (1 << IRQ_BANK1(nb))); + else if (IS_IRQ_BANK2(nb)) + intc_write_4(INTC_ENABLE_BANK2, (1 << IRQ_BANK2(nb))); + else + printf("arm_mask_irq: Invalid IRQ number: %d\n", nb); +} Added: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Thu Aug 30 20:59:37 2012 (r239922) @@ -0,0 +1,603 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko. + * Copyright (c) 1994-1998 Mark Brinicombe. + * Copyright (c) 1994 Brini. + * All rights reserved. + * + * This code is derived from software written for Brini by Mark Brinicombe + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Brini. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI 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. + * + * from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 45 + */ + +#include "opt_ddb.h" +#include "opt_platform.h" +#include "opt_global.h" + +#include +__FBSDID("$FreeBSD$"); + +#define _ARM32_BUS_DMA_PRIVATE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 21:22:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5B051065678; Thu, 30 Aug 2012 21:22:47 +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 B6A198FC0C; Thu, 30 Aug 2012 21:22: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 q7ULMl2n016080; Thu, 30 Aug 2012 21:22:47 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7ULMlPa016075; Thu, 30 Aug 2012 21:22:47 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201208302122.q7ULMlPa016075@svn.freebsd.org> From: Attilio Rao Date: Thu, 30 Aug 2012 21:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239923 - in head/sys: conf kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 21:22:48 -0000 Author: attilio Date: Thu Aug 30 21:22:47 2012 New Revision: 239923 URL: http://svn.freebsd.org/changeset/base/239923 Log: Post r222812 KTR_CPUMASK started being initialized only as a tunable handler and not more statically. Unfortunately, it seems that this is not ideal for new platform bringup and boot low level development (which needs ktr_cpumask to be effective before tunables can be setup). Because of this, add a way to statically initialize cpusets, by passing an list of initializers, divided by commas. Also, provide a way to enforce an all-set mask, for above mentioned initializers. This imposes some differences on how KTR_CPUMASK is setup now as a kernel option, and in particular this makes the words specifications backward wrt. what is currently in -CURRENT. In order to avoid mismatches between KTR_CPUMASK definition and other way to setup the mask (tunable, sysctl) and to print it, change the ordering how cpusetobj_print() and cpusetobj_scan() acquire the words belonging to the set. Please give a look to sys/conf/NOTES in order to understand how the new format is supposed to work. Also, ktr manpages will be updated shortly by gjb which volountereed for this. This patch won't be merged because it changes a POLA (at least from the theoretical standpoint) and this is however a patch that proves to be effective only in development environments. Requested by: rpaulo Reviewed by: jeff, rpaulo Modified: head/sys/conf/NOTES head/sys/kern/kern_cpuset.c head/sys/kern/kern_ktr.c head/sys/sys/_cpuset.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Aug 30 20:59:37 2012 (r239922) +++ head/sys/conf/NOTES Thu Aug 30 21:22:47 2012 (r239923) @@ -442,8 +442,8 @@ options KTRACE_REQUEST_POOL=101 # what events to trace. KTR_CPUMASK determines which CPU's log # events, with bit X corresponding to CPU X. The layout of the string # passed as KTR_CPUMASK must match a series of bitmasks each of them -# separated by the ", " characters (ie: -# KTR_CPUMASK=("0xAF, 0xFFFFFFFFFFFFFFFF")). KTR_VERBOSE enables +# separated by the "," character (ie: +# KTR_CPUMASK=0xAF,0xFFFFFFFFFFFFFFFF). KTR_VERBOSE enables # dumping of KTR events to the console by default. This functionality # can be toggled via the debug.ktr_verbose sysctl and defaults to off # if KTR_VERBOSE is not defined. See ktr(4) and ktrdump(8) for details. @@ -452,7 +452,7 @@ options KTR options KTR_ENTRIES=1024 options KTR_COMPILE=(KTR_INTR|KTR_PROC) options KTR_MASK=KTR_INTR -options KTR_CPUMASK=("0x3") +options KTR_CPUMASK=0x3 options KTR_VERBOSE # Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Thu Aug 30 20:59:37 2012 (r239922) +++ head/sys/kern/kern_cpuset.c Thu Aug 30 21:22:47 2012 (r239923) @@ -651,12 +651,12 @@ cpusetobj_strprint(char *buf, const cpus bytesp = 0; bufsiz = CPUSETBUFSIZ; - for (i = _NCPUWORDS - 1; i > 0; i--) { - bytesp = snprintf(tbuf, bufsiz, "%lx, ", set->__bits[i]); + for (i = 0; i < (_NCPUWORDS - 1); i++) { + bytesp = snprintf(tbuf, bufsiz, "%lx,", set->__bits[i]); bufsiz -= bytesp; tbuf += bytesp; } - snprintf(tbuf, bufsiz, "%lx", set->__bits[0]); + snprintf(tbuf, bufsiz, "%lx", set->__bits[_NCPUWORDS - 1]); return (buf); } @@ -682,16 +682,16 @@ cpusetobj_strscan(cpuset_t *set, const c return (-1); CPU_ZERO(set); - for (i = nwords - 1; i > 0; i--) { - ret = sscanf(buf, "%lx, ", &set->__bits[i]); + for (i = 0; i < (nwords - 1); i++) { + ret = sscanf(buf, "%lx,", &set->__bits[i]); if (ret == 0 || ret == -1) return (-1); - buf = strstr(buf, " "); + buf = strstr(buf, ","); if (buf == NULL) return (-1); buf++; } - ret = sscanf(buf, "%lx", &set->__bits[0]); + ret = sscanf(buf, "%lx", &set->__bits[nwords - 1]); if (ret == 0 || ret == -1) return (-1); return (0); Modified: head/sys/kern/kern_ktr.c ============================================================================== --- head/sys/kern/kern_ktr.c Thu Aug 30 20:59:37 2012 (r239922) +++ head/sys/kern/kern_ktr.c Thu Aug 30 21:22:47 2012 (r239923) @@ -70,6 +70,10 @@ __FBSDID("$FreeBSD$"); #define KTR_MASK (0) #endif +#ifndef KTR_CPUMASK +#define KTR_CPUMASK CPUSET_FSET +#endif + #ifndef KTR_TIME #define KTR_TIME get_cyclecount() #endif @@ -99,7 +103,7 @@ int ktr_version = KTR_VERSION; SYSCTL_INT(_debug_ktr, OID_AUTO, version, CTLFLAG_RD, &ktr_version, 0, "Version of the KTR interface"); -cpuset_t ktr_cpumask; +cpuset_t ktr_cpumask = CPUSET_T_INITIALIZER(KTR_CPUMASK); static char ktr_cpumask_str[CPUSETBUFSIZ]; TUNABLE_STR("debug.ktr.cpumask", ktr_cpumask_str, sizeof(ktr_cpumask_str)); @@ -107,12 +111,6 @@ static void ktr_cpumask_initializer(void *dummy __unused) { - CPU_FILL(&ktr_cpumask); -#ifdef KTR_CPUMASK - if (cpusetobj_strscan(&ktr_cpumask, KTR_CPUMASK) == -1) - CPU_FILL(&ktr_cpumask); -#endif - /* * TUNABLE_STR() runs with SI_ORDER_MIDDLE priority, thus it must be * already set, if necessary. Modified: head/sys/sys/_cpuset.h ============================================================================== --- head/sys/sys/_cpuset.h Thu Aug 30 20:59:37 2012 (r239922) +++ head/sys/sys/_cpuset.h Thu Aug 30 21:22:47 2012 (r239923) @@ -49,4 +49,10 @@ typedef struct _cpuset { long __bits[howmany(CPU_SETSIZE, _NCPUBITS)]; } cpuset_t; +#define CPUSET_FSET \ + [ 0 ... (_NCPUWORDS - 1) ] = (-1L) + +#define CPUSET_T_INITIALIZER(x) \ + { .__bits = { x } } + #endif /* !_SYS__CPUSET_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Aug 30 22:56:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 298211065676; Thu, 30 Aug 2012 22:56:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEDE08FC18; Thu, 30 Aug 2012 22:56: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 q7UMuWEH027496; Thu, 30 Aug 2012 22:56:32 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UMuWE7027494; Thu, 30 Aug 2012 22:56:32 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201208302256.q7UMuWE7027494@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 30 Aug 2012 22:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239927 - head/tools/tools/track X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 22:56:33 -0000 Author: des Date: Thu Aug 30 22:56:32 2012 New Revision: 239927 URL: http://svn.freebsd.org/changeset/base/239927 Log: The error syntax has changed. Modified: head/tools/tools/track/track.sh Modified: head/tools/tools/track/track.sh ============================================================================== --- head/tools/tools/track/track.sh Thu Aug 30 22:18:25 2012 (r239926) +++ head/tools/tools/track/track.sh Thu Aug 30 22:56:32 2012 (r239927) @@ -35,7 +35,7 @@ do \>\>\>*) endl="\r\n" ;; - \*\*\*\ Error*) + \*\*\**) endl="\r\n" ;; \=\=\=*) From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 00:32:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id 20B19106566C; Fri, 31 Aug 2012 00:32:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 8DADC14EFD1; Fri, 31 Aug 2012 00:31:30 +0000 (UTC) Message-ID: <504005E1.7040602@FreeBSD.org> Date: Thu, 30 Aug 2012 14:31:29 -1000 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbe+/vXJncmF2?= References: <201208302256.q7UMuWE7027494@svn.freebsd.org> In-Reply-To: <201208302256.q7UMuWE7027494@svn.freebsd.org> X-Enigmail-Version: 1.4.4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239927 - head/tools/tools/track X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 00:32:02 -0000 On 08/30/2012 12:56 PM, Dag-Erling Sm�rgrav wrote: > Author: des > Date: Thu Aug 30 22:56:32 2012 > New Revision: 239927 > URL: http://svn.freebsd.org/changeset/base/239927 > > Log: > The error syntax has changed. > > Modified: > head/tools/tools/track/track.sh > > Modified: head/tools/tools/track/track.sh > ============================================================================== > --- head/tools/tools/track/track.sh Thu Aug 30 22:18:25 2012 (r239926) > +++ head/tools/tools/track/track.sh Thu Aug 30 22:56:32 2012 (r239927) > @@ -35,7 +35,7 @@ do > \>\>\>*) > endl="\r\n" > ;; > - \*\*\*\ Error*) > + \*\*\**) Are you sure that the double ** is necessary here? > endl="\r\n" > ;; > \=\=\=*) > From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 02:59:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4FAB5106564A; Fri, 31 Aug 2012 02:59:45 +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 3A2198FC14; Fri, 31 Aug 2012 02:59: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 q7V2xjeC055617; Fri, 31 Aug 2012 02:59:45 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7V2xjKS055615; Fri, 31 Aug 2012 02:59:45 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201208310259.q7V2xjKS055615@svn.freebsd.org> From: Alan Cox Date: Fri, 31 Aug 2012 02:59: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: r239934 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 02:59:45 -0000 Author: alc Date: Fri Aug 31 02:59:44 2012 New Revision: 239934 URL: http://svn.freebsd.org/changeset/base/239934 Log: Replace all uses of the vm page queues lock by a r/w lock that is private to this pmap. Tested by: Ian Lepore Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Fri Aug 31 00:39:04 2012 (r239933) +++ head/sys/arm/arm/pmap.c Fri Aug 31 02:59:44 2012 (r239934) @@ -150,6 +150,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -408,6 +409,7 @@ static vm_offset_t pmap_kernel_l2ptp_kva static vm_paddr_t pmap_kernel_l2ptp_phys; static struct vm_object pvzone_obj; static int pv_entry_count=0, pv_entry_max=0, pv_entry_high_water=0; +static struct rwlock pvh_global_lock; /* * This list exists for the benefit of pmap_map_chunk(). It keeps track @@ -866,7 +868,7 @@ pmap_alloc_l2_bucket(pmap_t pm, vm_offse l1idx = L1_IDX(va); PMAP_ASSERT_LOCKED(pm); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); if ((l2 = pm->pm_l2[L2_IDX(l1idx)]) == NULL) { /* * No mapping at this address, as there is @@ -875,19 +877,19 @@ pmap_alloc_l2_bucket(pmap_t pm, vm_offse */ again_l2table: PMAP_UNLOCK(pm); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); if ((l2 = pmap_alloc_l2_dtable()) == NULL) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); return (NULL); } - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (pm->pm_l2[L2_IDX(l1idx)] != NULL) { PMAP_UNLOCK(pm); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); uma_zfree(l2table_zone, l2); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); l2 = pm->pm_l2[L2_IDX(l1idx)]; if (l2 == NULL) @@ -919,16 +921,16 @@ again_l2table: */ again_ptep: PMAP_UNLOCK(pm); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); ptep = (void*)uma_zalloc(l2zone, M_NOWAIT|M_USE_RESERVE); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (l2b->l2b_kva != 0) { /* We lost the race. */ PMAP_UNLOCK(pm); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); uma_zfree(l2zone, ptep); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (l2b->l2b_kva == 0) goto again_ptep; @@ -1314,7 +1316,7 @@ pmap_fix_cache(struct vm_page *pg, pmap_ int entries = 0, kentries = 0, uentries = 0; struct pv_entry *pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); /* the cache gets written back/invalidated on context switch. * therefore, if a user page shares an entry in the same page or @@ -1426,7 +1428,7 @@ pmap_clearbit(struct vm_page *pg, u_int u_int oflags; int count = 0; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if (maskbits & PVF_WRITE) maskbits |= PVF_MOD; @@ -1436,7 +1438,7 @@ pmap_clearbit(struct vm_page *pg, u_int pg->md.pvh_attrs &= ~(maskbits & (PVF_MOD | PVF_REF)); if (TAILQ_EMPTY(&pg->md.pv_list)) { - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (0); } @@ -1572,7 +1574,7 @@ pmap_clearbit(struct vm_page *pg, u_int if (maskbits & PVF_WRITE) vm_page_aflag_clear(pg, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (count); } @@ -1601,7 +1603,7 @@ pmap_enter_pv(struct vm_page *pg, struct int km; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); if (pg->md.pv_kva) { /* PMAP_ASSERT_LOCKED(pmap_kernel()); */ @@ -1615,10 +1617,10 @@ pmap_enter_pv(struct vm_page *pg, struct TAILQ_INSERT_HEAD(&pg->md.pv_list, pve, pv_list); TAILQ_INSERT_HEAD(&pve->pv_pmap->pm_pvlist, pve, pv_plist); PMAP_UNLOCK(pmap_kernel()); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); if ((pve = pmap_get_pv_entry()) == NULL) panic("pmap_kenter_internal: no pv entries"); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if (km) PMAP_LOCK(pmap_kernel()); } @@ -1647,7 +1649,7 @@ pmap_find_pv(struct vm_page *pg, pmap_t { struct pv_entry *pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); TAILQ_FOREACH(pv, &pg->md.pv_list, pv_list) if (pm == pv->pv_pmap && va == pv->pv_va) break; @@ -1691,7 +1693,7 @@ pmap_nuke_pv(struct vm_page *pg, pmap_t { struct pv_entry *pv; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_ASSERT_LOCKED(pm); TAILQ_REMOVE(&pg->md.pv_list, pve, pv_list); TAILQ_REMOVE(&pm->pm_pvlist, pve, pv_plist); @@ -1737,7 +1739,7 @@ pmap_remove_pv(struct vm_page *pg, pmap_ { struct pv_entry *pve; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); pve = TAILQ_FIRST(&pg->md.pv_list); while (pve) { @@ -1771,7 +1773,7 @@ pmap_modify_pv(struct vm_page *pg, pmap_ u_int flags, oflags; PMAP_ASSERT_LOCKED(pm); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); if ((npv = pmap_find_pv(pg, pm, va)) == NULL) return (0); @@ -1878,7 +1880,7 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t int rv = 0; l1idx = L1_IDX(va); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); /* @@ -2075,7 +2077,7 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t rv = 1; out: - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pm); return (rv); } @@ -2400,6 +2402,11 @@ pmap_bootstrap(vm_offset_t firstaddr, vm CPU_FILL(&kernel_pmap->pm_active); kernel_pmap->pm_domain = PMAP_DOMAIN_KERNEL; TAILQ_INIT(&kernel_pmap->pm_pvlist); + + /* + * Initialize the global pv list lock. + */ + rw_init_flags(&pvh_global_lock, "pmap pv global", RW_RECURSE); /* * Reserve some special page table entries/VA space for temporary @@ -2672,7 +2679,7 @@ pmap_remove_pages(pmap_t pmap) vm_page_t m; pt_entry_t *pt; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); cpu_idcache_wbinv_all(); cpu_l2cache_wbinv_all(); @@ -2701,7 +2708,7 @@ pmap_remove_pages(pmap_t pmap) pmap_free_pv_entry(pv); pmap_free_l2_bucket(pmap, l2b, 1); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); cpu_tlb_flushID(); cpu_cpwait(); PMAP_UNLOCK(pmap); @@ -2826,13 +2833,13 @@ pmap_kenter_internal(vm_offset_t va, vm_ * This expects the physical memory to have vm_page_array entry. */ if (pvzone != NULL && (m = vm_phys_paddr_to_vm_page(pa))) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); if (!TAILQ_EMPTY(&m->md.pv_list) || m->md.pv_kva) { /* release vm_page lock for pv_entry UMA */ - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); if ((pve = pmap_get_pv_entry()) == NULL) panic("pmap_kenter_internal: no pv entries"); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap_kernel()); pmap_enter_pv(m, pve, pmap_kernel(), va, PVF_WRITE | PVF_UNMAN); @@ -2841,7 +2848,7 @@ pmap_kenter_internal(vm_offset_t va, vm_ } else { m->md.pv_kva = va; } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } } @@ -2902,13 +2909,13 @@ pmap_kremove(vm_offset_t va) /* note: should never have to remove an allocation * before the pvzone is initialized. */ - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap_kernel()); if (pvzone != NULL && (m = vm_phys_paddr_to_vm_page(pa)) && (pve = pmap_remove_pv(m, pmap_kernel(), va))) pmap_free_pv_entry(pve); PMAP_UNLOCK(pmap_kernel()); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); va = va & ~PAGE_MASK; cpu_dcache_wbinv_range(va, PAGE_SIZE); cpu_l2cache_wbinv_range(va, PAGE_SIZE); @@ -3126,7 +3133,7 @@ pmap_remove_all(vm_page_t m) ("pmap_remove_all: page %p is not managed", m)); if (TAILQ_EMPTY(&m->md.pv_list)) return; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); pmap_remove_write(m); curpm = vmspace_pmap(curproc->p_vmspace); while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { @@ -3175,7 +3182,7 @@ pmap_remove_all(vm_page_t m) pmap_tlb_flushD(curpm); } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } @@ -3208,7 +3215,7 @@ pmap_protect(pmap_t pm, vm_offset_t sva, return; } - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); /* @@ -3275,7 +3282,7 @@ pmap_protect(pmap_t pm, vm_offset_t sva, if (PV_BEEN_REFD(flags)) pmap_tlb_flushD(pm); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pm); } @@ -3299,10 +3306,10 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t prot, boolean_t wired) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); pmap_enter_locked(pmap, va, m, prot, wired, M_WAITOK); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3322,7 +3329,7 @@ pmap_enter_locked(pmap_t pmap, vm_offset vm_paddr_t pa; PMAP_ASSERT_LOCKED(pmap); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); if (va == vector_page) { pa = systempage.pv_pa; m = NULL; @@ -3352,9 +3359,9 @@ do_l2b_alloc: if (l2b == NULL) { if (flags & M_WAITOK) { PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); VM_WAIT; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); goto do_l2b_alloc; } @@ -3594,14 +3601,14 @@ pmap_enter_object(pmap_t pmap, vm_offset psize = atop(end - start); m = m_start; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { pmap_enter_locked(pmap, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE, M_NOWAIT); m = TAILQ_NEXT(m, listq); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3618,11 +3625,11 @@ void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); pmap_enter_locked(pmap, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE, M_NOWAIT); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3640,7 +3647,7 @@ pmap_change_wiring(pmap_t pmap, vm_offse pt_entry_t *ptep, pte; vm_page_t pg; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); l2b = pmap_get_l2_bucket(pmap, va); KASSERT(l2b, ("No l2b bucket in pmap_change_wiring")); @@ -3649,7 +3656,7 @@ pmap_change_wiring(pmap_t pmap, vm_offse pg = PHYS_TO_VM_PAGE(l2pte_pa(pte)); if (pg) pmap_modify_pv(pg, pmap, va, PVF_WIRED, wired ? PVF_WIRED : 0); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -3895,7 +3902,7 @@ pmap_remove(pmap_t pm, vm_offset_t sva, * we lock in the pmap => pv_head direction */ - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); total = 0; while (sva < eva) { @@ -3989,7 +3996,7 @@ pmap_remove(pmap_t pm, vm_offset_t sva, pmap_free_l2_bucket(pm, l2b, mappings); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); if (flushall) cpu_tlb_flushID(); PMAP_UNLOCK(pm); @@ -4405,7 +4412,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (pv->pv_pmap == pmap) { rv = TRUE; @@ -4415,7 +4422,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p if (loops >= 16) break; } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -4434,11 +4441,11 @@ pmap_page_wired_mappings(vm_page_t m) count = 0; if ((m->oflags & VPO_UNMANAGED) != 0) return (count); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) if ((pv->pv_flags & PVF_WIRED) != 0) count++; - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (count); } From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 08:48:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7FE87106566B; Fri, 31 Aug 2012 08:48:54 +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 6B77B8FC29; Fri, 31 Aug 2012 08:48: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 q7V8msTa099633; Fri, 31 Aug 2012 08:48:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7V8msTV099631; Fri, 31 Aug 2012 08:48:54 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208310848.q7V8msTV099631@svn.freebsd.org> From: Ed Schouten Date: Fri, 31 Aug 2012 08:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239938 - head/usr.sbin/ac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 08:48:54 -0000 Author: ed Date: Fri Aug 31 08:48:53 2012 New Revision: 239938 URL: http://svn.freebsd.org/changeset/base/239938 Log: Use better variable naming. MFC after: 1 month Modified: head/usr.sbin/ac/ac.c Modified: head/usr.sbin/ac/ac.c ============================================================================== --- head/usr.sbin/ac/ac.c Fri Aug 31 06:42:51 2012 (r239937) +++ head/usr.sbin/ac/ac.c Fri Aug 31 08:48:53 2012 (r239938) @@ -269,8 +269,7 @@ show_today(struct timeval today) struct user_entry *up; struct utmpx_entry *lp; char date[64]; - struct timeval usec = { 0, 1 }; - struct timeval yesterday; + struct timeval diff, total = { 0, 0 }, usec = { 0, 1 }, yesterday; static int d_first = -1; if (d_first < 0) @@ -280,23 +279,19 @@ show_today(struct timeval today) d_first ? "%e %b total" : "%b %e total", localtime(&yesterday.tv_sec)); - /* restore the missing second */ - timeradd(&today, &usec, &yesterday); - SLIST_FOREACH(lp, &CurUtmpx, next) { - timersub(&yesterday, &lp->time, &today); - update_user(lp->user, today); + timersub(&today, &lp->time, &diff); + update_user(lp->user, diff); /* As if they just logged in. */ - lp->time = yesterday; + lp->time = today; } - timerclear(&today); SLIST_FOREACH(up, &Users, next) { - timeradd(&today, &up->time, &today); + timeradd(&total, &up->time, &total); /* For next day. */ timerclear(&up->time); } - if (timerisset(&today)) - (void)printf("%s %11.2f\n", date, (double)today.tv_sec / 3600); + if (timerisset(&total)) + (void)printf("%s %11.2f\n", date, (double)total.tv_sec / 3600); } /* From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 09:42:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 982511065673; Fri, 31 Aug 2012 09:42:47 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 832238FC18; Fri, 31 Aug 2012 09:42: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 q7V9glkv007018; Fri, 31 Aug 2012 09:42:47 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7V9glpp007014; Fri, 31 Aug 2012 09:42:47 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201208310942.q7V9glpp007014@svn.freebsd.org> From: Scott Long Date: Fri, 31 Aug 2012 09:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239939 - head/sys/dev/amr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 09:42:47 -0000 Author: scottl Date: Fri Aug 31 09:42:46 2012 New Revision: 239939 URL: http://svn.freebsd.org/changeset/base/239939 Log: Essentially revert r239912. The amr_periodic function hadn't been armed in over 10 years and was dead code; the previous revision exposed it as such to CLANG. The solution is to cull the whole thing. Modified: head/sys/dev/amr/amr.c head/sys/dev/amr/amr_pci.c head/sys/dev/amr/amrvar.h Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Fri Aug 31 08:48:53 2012 (r239938) +++ head/sys/dev/amr/amr.c Fri Aug 31 09:42:46 2012 (r239939) @@ -139,11 +139,6 @@ static void amr_setup_ccb(void *arg, bus static void amr_abort_load(struct amr_command *ac); /* - * Status monitoring - */ -static void amr_periodic(void *data); - -/* * Interface-specific shims */ static int amr_quartz_submit_command(struct amr_command *ac); @@ -348,11 +343,6 @@ amr_startup(void *arg) /* interrupts will be enabled before we do anything more */ sc->amr_state |= AMR_STATE_INTEN; - /* - * Start the timeout routine. - */ -/* callout_reset(&sc->amr_timeout, hz, amr_periodic, sc);*/ - return; } @@ -391,9 +381,6 @@ amr_free(struct amr_softc *sc) if (sc->amr_pass != NULL) device_delete_child(sc->amr_dev, sc->amr_pass); - /* cancel status timeout */ - callout_drain(&sc->amr_timeout); - /* throw away any command buffers */ while ((acc = TAILQ_FIRST(&sc->amr_cmd_clusters)) != NULL) { TAILQ_REMOVE(&sc->amr_cmd_clusters, acc, acc_link); @@ -959,31 +946,6 @@ out: /******************************************************************************** ******************************************************************************** - Status Monitoring - ******************************************************************************** - ********************************************************************************/ - -/******************************************************************************** - * Perform a periodic check of the controller status - */ -static void -amr_periodic(void *data) -{ - struct amr_softc *sc = (struct amr_softc *)data; - - debug_called(2); - - /* XXX perform periodic status checks here */ - - /* compensate for missed interrupts */ - amr_done(sc); - - /* reschedule */ - callout_reset(&sc->amr_timeout, hz, amr_periodic, sc); -} - -/******************************************************************************** - ******************************************************************************** Command Wrappers ******************************************************************************** ********************************************************************************/ Modified: head/sys/dev/amr/amr_pci.c ============================================================================== --- head/sys/dev/amr/amr_pci.c Fri Aug 31 08:48:53 2012 (r239938) +++ head/sys/dev/amr/amr_pci.c Fri Aug 31 09:42:46 2012 (r239939) @@ -331,7 +331,6 @@ amr_pci_attach(device_t dev) */ mtx_init(&sc->amr_list_lock, "AMR List Lock", NULL, MTX_DEF); mtx_init(&sc->amr_hw_lock, "AMR HW Lock", NULL, MTX_DEF); - callout_init(&sc->amr_timeout, CALLOUT_MPSAFE); if ((error = amr_setup_mbox(sc)) != 0) goto out; Modified: head/sys/dev/amr/amrvar.h ============================================================================== --- head/sys/dev/amr/amrvar.h Fri Aug 31 08:48:53 2012 (r239938) +++ head/sys/dev/amr/amrvar.h Fri Aug 31 09:42:46 2012 (r239939) @@ -256,7 +256,6 @@ struct amr_softc device_t amr_pass; int (*amr_cam_command)(struct amr_softc *sc, struct amr_command **acp); struct intr_config_hook amr_ich; /* wait-for-interrupts probe hook */ - struct callout amr_timeout; /* periodic status check */ int amr_allow_vol_config; int amr_linux_no_adapters; int amr_ld_del_supported; From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 10:07:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE978106566B; Fri, 31 Aug 2012 10:07:38 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A89628FC0C; Fri, 31 Aug 2012 10:07: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 q7VA7cel011003; Fri, 31 Aug 2012 10:07:38 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VA7cwT010999; Fri, 31 Aug 2012 10:07:38 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201208311007.q7VA7cwT010999@svn.freebsd.org> From: Scott Long Date: Fri, 31 Aug 2012 10:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239940 - head/sys/dev/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 10:07:38 -0000 Author: scottl Date: Fri Aug 31 10:07:38 2012 New Revision: 239940 URL: http://svn.freebsd.org/changeset/base/239940 Log: Heavily optimize the case of small RX packets of 160 bytes or less. For this case, allocate a plain mbuf and copy the frame into it, then send the copy up the stack, leaving the original mbuf+cluster in place in the receive ring for immediate re-use. This saves a trip through 2 of the 3 zones of the compound mbuf allocator, a trip through busdma, and a trip through the 1 of the 3 mbuf destructors. For our load at Netflix, this can lower CPU consumption by as much as 20%. The copy algorithm is based on investigative work from Luigi Rizzo earlier in the year. Reviewed by: jfv Obtained from: Netflix Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixgbe_osdep.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Aug 31 09:42:46 2012 (r239939) +++ head/sys/dev/ixgbe/ixgbe.c Fri Aug 31 10:07:38 2012 (r239940) @@ -3734,21 +3734,30 @@ no_split: mp = rxbuf->m_pack; mp->m_pkthdr.len = mp->m_len = adapter->rx_mbuf_sz; - /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr->ptag, - rxbuf->pmap, mp, pseg, &nsegs, BUS_DMA_NOWAIT); - if (error != 0) { - printf("Refresh mbufs: payload dmamap load" - " failure - %d\n", error); - m_free(mp); - rxbuf->m_pack = NULL; - goto update; + + /* If we're dealing with an mbuf that was copied rather + * than replaced, there's no need to go through busdma. + */ + if ((rxbuf->flags & IXGBE_RX_COPY) == 0) { + /* Get the memory mapping */ + error = bus_dmamap_load_mbuf_sg(rxr->ptag, + rxbuf->pmap, mp, pseg, &nsegs, BUS_DMA_NOWAIT); + if (error != 0) { + printf("Refresh mbufs: payload dmamap load" + " failure - %d\n", error); + m_free(mp); + rxbuf->m_pack = NULL; + goto update; + } + rxbuf->m_pack = mp; + bus_dmamap_sync(rxr->ptag, rxbuf->pmap, + BUS_DMASYNC_PREREAD); + rxbuf->paddr = rxr->rx_base[i].read.pkt_addr = + htole64(pseg[0].ds_addr); + } else { + rxr->rx_base[i].read.pkt_addr = rxbuf->paddr; + rxbuf->flags &= ~IXGBE_RX_COPY; } - rxbuf->m_pack = mp; - bus_dmamap_sync(rxr->ptag, rxbuf->pmap, - BUS_DMASYNC_PREREAD); - rxr->rx_base[i].read.pkt_addr = - htole64(pseg[0].ds_addr); refreshed = TRUE; /* Next is precalculated */ @@ -4061,6 +4070,7 @@ skip_head: rxr->next_to_refresh = 0; rxr->lro_enabled = FALSE; rxr->rx_split_packets = 0; + rxr->rx_copies = 0; rxr->rx_bytes = 0; rxr->discard = FALSE; rxr->vtag_strip = FALSE; @@ -4618,14 +4628,37 @@ ixgbe_rxeof(struct ix_queue *que, int co ** that determines what we are */ sendmp = rbuf->fmp; - rbuf->m_pack = rbuf->fmp = NULL; if (sendmp != NULL) { /* secondary frag */ + rbuf->m_pack = rbuf->fmp = NULL; mp->m_flags &= ~M_PKTHDR; sendmp->m_pkthdr.len += mp->m_len; } else { + /* + * Optimize. This might be a small packet, + * maybe just a TCP ACK. Do a fast copy that + * is cache aligned into a new mbuf, and + * leave the old mbuf+cluster for re-use. + */ + if (eop && plen <= IXGBE_RX_COPY_LEN) { + prefetch(mp->m_data); + sendmp = m_gethdr(M_DONTWAIT, MT_DATA); + if (sendmp != NULL) { + sendmp->m_data += + IXGBE_RX_COPY_ALIGN; + ixgbe_bcopy(mp->m_data, + sendmp->m_data, plen); + sendmp->m_len = plen; + rxr->rx_copies++; + rbuf->flags |= IXGBE_RX_COPY; + } + } + if (sendmp == NULL) { + rbuf->m_pack = rbuf->fmp = NULL; + sendmp = mp; + } + /* first desc of a non-ps chain */ - sendmp = mp; sendmp->m_flags |= M_PKTHDR; sendmp->m_pkthdr.len = mp->m_len; if (staterr & IXGBE_RXD_STAT_VP) { @@ -5476,6 +5509,9 @@ ixgbe_add_hw_stats(struct adapter *adapt SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_bytes", CTLFLAG_RD, &rxr->rx_bytes, "Queue Bytes Received"); + SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_copies", + CTLFLAG_RD, &rxr->rx_copies, + "Copied RX Frames"); SYSCTL_ADD_INT(ctx, queue_list, OID_AUTO, "lro_queued", CTLFLAG_RD, &lro->lro_queued, 0, "LRO Queued"); Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Fri Aug 31 09:42:46 2012 (r239939) +++ head/sys/dev/ixgbe/ixgbe.h Fri Aug 31 10:07:38 2012 (r239940) @@ -154,6 +154,19 @@ #define IXGBE_FC_HI 0x20000 #define IXGBE_FC_LO 0x10000 +/* + * Used for optimizing small rx mbufs. Effort is made to keep the copy + * small and aligned for the CPU L1 cache. + * + * MHLEN is typically 168 bytes, giving us 8-byte alignment. Getting + * 32 byte alignment needed for the fast bcopy results in 8 bytes being + * wasted. Getting 64 byte alignment, which _should_ be ideal for + * modern Intel CPUs, results in 40 bytes wasted and a significant drop + * in observed efficiency of the optimization, 97.9% -> 81.8%. + */ +#define IXGBE_RX_COPY_LEN 160 +#define IXGBE_RX_COPY_ALIGN (MHLEN - IXGBE_RX_COPY_LEN) + /* Keep older OS drivers building... */ #if !defined(SYSCTL_ADD_UQUAD) #define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD @@ -245,6 +258,9 @@ struct ixgbe_rx_buf { struct mbuf *fmp; bus_dmamap_t hmap; bus_dmamap_t pmap; + u_int flags; +#define IXGBE_RX_COPY 0x01 + uint64_t paddr; }; /* @@ -339,6 +355,7 @@ struct rx_ring { /* Soft stats */ u64 rx_irq; u64 rx_split_packets; + u64 rx_copies; u64 rx_packets; u64 rx_bytes; u64 rx_discarded; Modified: head/sys/dev/ixgbe/ixgbe_osdep.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_osdep.h Fri Aug 31 09:42:46 2012 (r239939) +++ head/sys/dev/ixgbe/ixgbe_osdep.h Fri Aug 31 10:07:38 2012 (r239940) @@ -143,6 +143,25 @@ void prefetch(void *x) #define prefetch(x) #endif +/* + * Optimized bcopy thanks to Luigi Rizzo's investigative work. Assumes + * non-overlapping regions and 32-byte padding on both src and dst. + */ +static __inline int +ixgbe_bcopy(void *_src, void *_dst, int l) +{ + uint64_t *src = _src; + uint64_t *dst = _dst; + + for (; l > 0; l -= 32) { + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + } + return (0); +} + struct ixgbe_osdep { bus_space_tag_t mem_bus_space_tag; From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 10:11:08 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C6AA1065676; Fri, 31 Aug 2012 10:11:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 0086B8FC17; Fri, 31 Aug 2012 10:11:07 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q7VAB0nF098129; Fri, 31 Aug 2012 14:11:00 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q7VAB0Q2098128; Fri, 31 Aug 2012 14:11:00 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 31 Aug 2012 14:11:00 +0400 From: Gleb Smirnoff To: Scott Long Message-ID: <20120831101100.GL90597@FreeBSD.org> References: <201208311007.q7VA7cwT010999@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201208311007.q7VA7cwT010999@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r239940 - head/sys/dev/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 10:11:08 -0000 Scott, On Fri, Aug 31, 2012 at 10:07:38AM +0000, Scott Long wrote: S> +/* S> + * Optimized bcopy thanks to Luigi Rizzo's investigative work. Assumes S> + * non-overlapping regions and 32-byte padding on both src and dst. S> + */ S> +static __inline int S> +ixgbe_bcopy(void *_src, void *_dst, int l) S> +{ S> + uint64_t *src = _src; S> + uint64_t *dst = _dst; S> + S> + for (; l > 0; l -= 32) { S> + *dst++ = *src++; S> + *dst++ = *src++; S> + *dst++ = *src++; S> + *dst++ = *src++; S> + } S> + return (0); S> +} S> + Shouldn't this go to libkern? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 11:15:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECEFA106564A; Fri, 31 Aug 2012 11:15: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 D27A18FC14; Fri, 31 Aug 2012 11:15: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 q7VBF1id020913; Fri, 31 Aug 2012 11:15:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VBF1TK020909; Fri, 31 Aug 2012 11:15:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201208311115.q7VBF1TK020909@svn.freebsd.org> From: Marius Strobl Date: Fri, 31 Aug 2012 11:15: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: r239941 - in head/sys/sparc64: include pci sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 11:15:02 -0000 Author: marius Date: Fri Aug 31 11:15:01 2012 New Revision: 239941 URL: http://svn.freebsd.org/changeset/base/239941 Log: Add a global MD macro for the VIS block size instead of duplicating it and using magic values all over the place. MFC after: 1 week Modified: head/sys/sparc64/include/fsr.h head/sys/sparc64/pci/fire.c head/sys/sparc64/pci/schizo.c head/sys/sparc64/sparc64/support.S Modified: head/sys/sparc64/include/fsr.h ============================================================================== --- head/sys/sparc64/include/fsr.h Fri Aug 31 10:07:38 2012 (r239940) +++ head/sys/sparc64/include/fsr.h Fri Aug 31 11:15:01 2012 (r239941) @@ -31,6 +31,8 @@ #define FPRS_DU (1 << 1) #define FPRS_FEF (1 << 2) +#define VIS_BLOCKSIZE 64 + #ifndef LOCORE #define FSR_EXC_BITS 5 Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Fri Aug 31 10:07:38 2012 (r239940) +++ head/sys/sparc64/pci/fire.c Fri Aug 31 11:15:01 2012 (r239941) @@ -1503,8 +1503,6 @@ fire_read_ivar(device_t dev, device_t ch return (ENOENT); } -#define VIS_BLOCKSIZE 64 - static void fire_dmamap_sync(bus_dma_tag_t dt __unused, bus_dmamap_t map, bus_dmasync_op_t op) Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Fri Aug 31 10:07:38 2012 (r239940) +++ head/sys/sparc64/pci/schizo.c Fri Aug 31 11:15:01 2012 (r239941) @@ -1214,8 +1214,6 @@ schizo_dmamap_sync(bus_dma_tag_t dt, bus membar(Sync); } -#define VIS_BLOCKSIZE 64 - static void ichip_dmamap_sync(bus_dma_tag_t dt, bus_dmamap_t map, bus_dmasync_op_t op) { Modified: head/sys/sparc64/sparc64/support.S ============================================================================== --- head/sys/sparc64/sparc64/support.S Fri Aug 31 10:07:38 2012 (r239940) +++ head/sys/sparc64/sparc64/support.S Fri Aug 31 11:15:01 2012 (r239941) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -591,10 +590,10 @@ ENTRY(spitfire_block_copy) andcc %o5, FPRS_FEF, %g0 bz,a,pt %xcc, 1f nop - stda %f0, [PCB_REG + PCB_UFP + (0 * 64)] %asi - stda %f16, [PCB_REG + PCB_UFP + (1 * 64)] %asi - stda %f32, [PCB_REG + PCB_UFP + (2 * 64)] %asi - stda %f48, [PCB_REG + PCB_UFP + (3 * 64)] %asi + stda %f0, [PCB_REG + PCB_UFP + (0 * VIS_BLOCKSIZE)] %asi + stda %f16, [PCB_REG + PCB_UFP + (1 * VIS_BLOCKSIZE)] %asi + stda %f32, [PCB_REG + PCB_UFP + (2 * VIS_BLOCKSIZE)] %asi + stda %f48, [PCB_REG + PCB_UFP + (3 * VIS_BLOCKSIZE)] %asi membar #Sync andn %o5, FPRS_FEF, %o5 @@ -606,8 +605,8 @@ ENTRY(spitfire_block_copy) 1: wrpr %o3, 0, %pstate ldda [%o0] %asi, %f0 - add %o0, 64, %o0 - sub %o2, 64, %o2 + add %o0, VIS_BLOCKSIZE, %o0 + sub %o2, VIS_BLOCKSIZE, %o2 2: ldda [%o0] %asi, %f16 fsrc1 %f0, %f32 @@ -619,10 +618,10 @@ ENTRY(spitfire_block_copy) fsrc1 %f12, %f44 fsrc1 %f14, %f46 stda %f32, [%o1] %asi - add %o0, 64, %o0 - subcc %o2, 64, %o2 + add %o0, VIS_BLOCKSIZE, %o0 + subcc %o2, VIS_BLOCKSIZE, %o2 bz,pn %xcc, 3f - add %o1, 64, %o1 + add %o1, VIS_BLOCKSIZE, %o1 ldda [%o0] %asi, %f0 fsrc1 %f16, %f32 fsrc1 %f18, %f34 @@ -633,10 +632,10 @@ ENTRY(spitfire_block_copy) fsrc1 %f28, %f44 fsrc1 %f30, %f46 stda %f32, [%o1] %asi - add %o0, 64, %o0 - sub %o2, 64, %o2 + add %o0, VIS_BLOCKSIZE, %o0 + sub %o2, VIS_BLOCKSIZE, %o2 ba,pt %xcc, 2b - add %o1, 64, %o1 + add %o1, VIS_BLOCKSIZE, %o1 3: membar #Sync @@ -651,7 +650,7 @@ END(spitfire_block_copy) * void zeus_block_copy(void *src, void *dst, size_t len) */ ENTRY(zeus_block_copy) - prefetch [%o0 + (0 * 64)], 0 + prefetch [%o0 + (0 * VIS_BLOCKSIZE)], 0 rdpr %pstate, %o3 wrpr %g0, PSTATE_NORMAL, %pstate @@ -664,10 +663,10 @@ ENTRY(zeus_block_copy) andcc %o5, FPRS_FEF, %g0 bz,a,pt %xcc, 1f nop - stda %f0, [PCB_REG + PCB_UFP + (0 * 64)] %asi - stda %f16, [PCB_REG + PCB_UFP + (1 * 64)] %asi - stda %f32, [PCB_REG + PCB_UFP + (2 * 64)] %asi - stda %f48, [PCB_REG + PCB_UFP + (3 * 64)] %asi + stda %f0, [PCB_REG + PCB_UFP + (0 * VIS_BLOCKSIZE)] %asi + stda %f16, [PCB_REG + PCB_UFP + (1 * VIS_BLOCKSIZE)] %asi + stda %f32, [PCB_REG + PCB_UFP + (2 * VIS_BLOCKSIZE)] %asi + stda %f48, [PCB_REG + PCB_UFP + (3 * VIS_BLOCKSIZE)] %asi membar #Sync andn %o5, FPRS_FEF, %o5 @@ -679,32 +678,32 @@ ENTRY(zeus_block_copy) 1: wrpr %o3, 0, %pstate ldd [%o0 + (0 * 8)], %f0 - prefetch [%o0 + (1 * 64)], 0 + prefetch [%o0 + (1 * VIS_BLOCKSIZE)], 0 ldd [%o0 + (1 * 8)], %f2 - prefetch [%o0 + (2 * 64)], 0 + prefetch [%o0 + (2 * VIS_BLOCKSIZE)], 0 fmovd %f0, %f32 ldd [%o0 + (2 * 8)], %f4 - prefetch [%o0 + (3 * 64)], 0 + prefetch [%o0 + (3 * VIS_BLOCKSIZE)], 0 fmovd %f2, %f34 ldd [%o0 + (3 * 8)], %f6 - prefetch [%o0 + (4 * 64)], 1 + prefetch [%o0 + (4 * VIS_BLOCKSIZE)], 1 fmovd %f4, %f36 ldd [%o0 + (4 * 8)], %f8 - prefetch [%o0 + (8 * 64)], 1 + prefetch [%o0 + (8 * VIS_BLOCKSIZE)], 1 fmovd %f6, %f38 ldd [%o0 + (5 * 8)], %f10 - prefetch [%o0 + (12 * 64)], 1 + prefetch [%o0 + (12 * VIS_BLOCKSIZE)], 1 fmovd %f8, %f40 ldd [%o0 + (6 * 8)], %f12 - prefetch [%o0 + (16 * 64)], 1 + prefetch [%o0 + (16 * VIS_BLOCKSIZE)], 1 fmovd %f10, %f42 ldd [%o0 + (7 * 8)], %f14 ldd [%o0 + (8 * 8)], %f0 - sub %o2, 64, %o2 - add %o0, 64, %o0 - prefetch [%o0 + (19 * 64)], 1 + sub %o2, VIS_BLOCKSIZE, %o2 + add %o0, VIS_BLOCKSIZE, %o0 + prefetch [%o0 + (19 * VIS_BLOCKSIZE)], 1 ba,pt %xcc, 2f - prefetch [%o0 + (23 * 64)], 1 + prefetch [%o0 + (23 * VIS_BLOCKSIZE)], 1 .align 32 2: ldd [%o0 + (1 * 8)], %f2 @@ -724,14 +723,14 @@ ENTRY(zeus_block_copy) fmovd %f8, %f40 ldd [%o0 + (8 * 8)], %f0 fmovd %f10, %f42 - sub %o2, 64, %o2 - prefetch [%o0 + (3 * 64)], 0 - add %o1, 64, %o1 - prefetch [%o0 + (24 * 64)], 1 - add %o0, 64, %o0 - cmp %o2, 64 + 8 + sub %o2, VIS_BLOCKSIZE, %o2 + prefetch [%o0 + (3 * VIS_BLOCKSIZE)], 0 + add %o1, VIS_BLOCKSIZE, %o1 + prefetch [%o0 + (24 * VIS_BLOCKSIZE)], 1 + add %o0, VIS_BLOCKSIZE, %o0 + cmp %o2, VIS_BLOCKSIZE + 8 bgu,pt %xcc, 2b - prefetch [%o0 + (12 * 64)], 1 + prefetch [%o0 + (12 * VIS_BLOCKSIZE)], 1 ldd [%o0 + (1 * 8)], %f2 fsrc1 %f12, %f44 ldd [%o0 + (2 * 8)], %f4 @@ -747,7 +746,7 @@ ENTRY(zeus_block_copy) fsrc1 %f6, %f38 ldd [%o0 + (7 * 8)], %f14 fsrc1 %f8, %f40 - add %o1, 64, %o1 + add %o1, VIS_BLOCKSIZE, %o1 fsrc1 %f10, %f42 fsrc1 %f12, %f44 fsrc1 %f14, %f46 @@ -775,10 +774,10 @@ ENTRY(spitfire_block_zero) andcc %o5, FPRS_FEF, %g0 bz,a,pt %xcc, 1f nop - stda %f0, [PCB_REG + PCB_UFP + (0 * 64)] %asi - stda %f16, [PCB_REG + PCB_UFP + (1 * 64)] %asi - stda %f32, [PCB_REG + PCB_UFP + (2 * 64)] %asi - stda %f48, [PCB_REG + PCB_UFP + (3 * 64)] %asi + stda %f0, [PCB_REG + PCB_UFP + (0 * VIS_BLOCKSIZE)] %asi + stda %f16, [PCB_REG + PCB_UFP + (1 * VIS_BLOCKSIZE)] %asi + stda %f32, [PCB_REG + PCB_UFP + (2 * VIS_BLOCKSIZE)] %asi + stda %f48, [PCB_REG + PCB_UFP + (3 * VIS_BLOCKSIZE)] %asi membar #Sync andn %o5, FPRS_FEF, %o5 @@ -798,13 +797,13 @@ ENTRY(spitfire_block_zero) fzero %f12 fzero %f14 -1: stda %f0, [%o0] %asi - stda %f0, [%o0 + 64] %asi - stda %f0, [%o0 + 128] %asi - stda %f0, [%o0 + 192] %asi - sub %o1, 256, %o1 +1: stda %f0, [%o0 + (0 * VIS_BLOCKSIZE)] %asi + stda %f0, [%o0 + (1 * VIS_BLOCKSIZE)] %asi + stda %f0, [%o0 + (2 * VIS_BLOCKSIZE)] %asi + stda %f0, [%o0 + (3 * VIS_BLOCKSIZE)] %asi + sub %o1, (4 * VIS_BLOCKSIZE), %o1 brnz,pt %o1, 1b - add %o0, 256, %o0 + add %o0, (4 * VIS_BLOCKSIZE), %o0 membar #Sync retl From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 14:35:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE516106564A; Fri, 31 Aug 2012 14:35:01 +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 9ABA78FC1C; Fri, 31 Aug 2012 14:35: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 q7VEZ1sQ046111; Fri, 31 Aug 2012 14:35:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VEZ1e5046109; Fri, 31 Aug 2012 14:35:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208311435.q7VEZ1e5046109@svn.freebsd.org> From: John Baldwin Date: Fri, 31 Aug 2012 14:35: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: r239951 - head/bin/mv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 14:35:02 -0000 Author: jhb Date: Fri Aug 31 14:35:01 2012 New Revision: 239951 URL: http://svn.freebsd.org/changeset/base/239951 Log: Add a -h flag similar to the -h flag for ln to force mv(1) to treat a symbolic link to a directory for the target as a symbolic link instead of a directory. This makes it possible to atomically update a symbolic link using rename(). Reviewed by: gj MFC after: 2 weeks Modified: head/bin/mv/mv.1 head/bin/mv/mv.c Modified: head/bin/mv/mv.1 ============================================================================== --- head/bin/mv/mv.1 Fri Aug 31 14:06:33 2012 (r239950) +++ head/bin/mv/mv.1 Fri Aug 31 14:35:01 2012 (r239951) @@ -32,7 +32,7 @@ .\" @(#)mv.1 8.1 (Berkeley) 5/31/93 .\" $FreeBSD$ .\" -.Dd May 12, 2007 +.Dd August 28, 2012 .Dt MV 1 .Os .Sh NAME @@ -41,7 +41,7 @@ .Sh SYNOPSIS .Nm .Op Fl f | i | n -.Op Fl v +.Op Fl hv .Ar source target .Nm .Op Fl f | i | n @@ -81,6 +81,21 @@ option overrides any previous or .Fl n options.) +.It Fl h +If the +.Ar target +operand is a symbolic link to a directory, +do not follow it. +This causes the +.Nm +utility to rename the file +.Ar source +to the destination path +.Ar target +rather than moving +.Ar source +into the directory referenced by +.Ar target . .It Fl i Cause .Nm @@ -142,7 +157,8 @@ rm -rf source_file .Ex -std .Sh COMPATIBILITY The -.Fl n +.Fl h , +.Fl n , and .Fl v options are non-standard and their use in scripts is not recommended. Modified: head/bin/mv/mv.c ============================================================================== --- head/bin/mv/mv.c Fri Aug 31 14:06:33 2012 (r239950) +++ head/bin/mv/mv.c Fri Aug 31 14:35:01 2012 (r239951) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); /* Exit code for a failed exec. */ #define EXEC_FAILED 127 -static int fflg, iflg, nflg, vflg; +static int fflg, hflg, iflg, nflg, vflg; static int copy(const char *, const char *); static int do_move(const char *, const char *); @@ -87,8 +87,11 @@ main(int argc, char *argv[]) int ch; char path[PATH_MAX]; - while ((ch = getopt(argc, argv, "finv")) != -1) + while ((ch = getopt(argc, argv, "fhinv")) != -1) switch (ch) { + case 'h': + hflg = 1; + break; case 'i': iflg = 1; fflg = nflg = 0; @@ -123,6 +126,17 @@ main(int argc, char *argv[]) exit(do_move(argv[0], argv[1])); } + /* + * If -h was specified, treat the target as a symlink instead of + * directory. + */ + if (hflg) { + if (argc > 2) + usage(); + if (lstat(argv[1], &sb) == 0 && S_ISLNK(sb.st_mode)) + exit(do_move(argv[0], argv[1])); + } + /* It's a directory, move each file into it. */ if (strlen(argv[argc - 1]) > sizeof(path) - 1) errx(1, "%s: destination pathname too long", *argv); @@ -483,7 +497,7 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: mv [-f | -i | -n] [-v] source target", + "usage: mv [-f | -i | -n] [-hv] source target", " mv [-f | -i | -n] [-v] source ... directory"); exit(EX_USAGE); } From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 15:02:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DEDA106566B; Fri, 31 Aug 2012 15:02:39 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from ref10-i386.freebsd.org (unknown [IPv6:2001:4f8:fff6::5e]) by mx1.freebsd.org (Postfix) with ESMTP id 48B508FC12; Fri, 31 Aug 2012 15:02:39 +0000 (UTC) Received: from ref10-i386.freebsd.org (localhost [127.0.0.1]) by ref10-i386.freebsd.org (8.14.5/8.14.5) with ESMTP id q7VF2dcQ098319; Fri, 31 Aug 2012 15:02:39 GMT (envelope-from bde@ref10-i386.freebsd.org) Received: (from bde@localhost) by ref10-i386.freebsd.org (8.14.5/8.14.5/Submit) id q7VF2dEv098318; Fri, 31 Aug 2012 15:02:39 GMT (envelope-from bde) Date: Fri, 31 Aug 2012 15:02:39 GMT From: Bruce Evans Message-Id: <201208311502.q7VF2dEv098318@ref10-i386.freebsd.org> To: glebius@freebsd.org, scottl@freebsd.org In-Reply-To: <20120831101100.GL90597@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239940 - head/sys/dev/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 15:02:39 -0000 glebius wrote: > On Fri, Aug 31, 2012 at 10:07:38AM +0000, Scott Long wrote: > S> +/* > S> + * Optimized bcopy thanks to Luigi Rizzo's investigative work. Assumes > S> + * non-overlapping regions and 32-byte padding on both src and dst. > S> + */ > S> +static __inline int > S> +ixgbe_bcopy(void *_src, void *_dst, int l) > S> +{ > S> + uint64_t *src = _src; > S> + uint64_t *dst = _dst; > S> + > S> + for (; l > 0; l -= 32) { > S> + *dst++ = *src++; > S> + *dst++ = *src++; > S> + *dst++ = *src++; > S> + *dst++ = *src++; > S> + } > S> + return (0); > S> +} > S> + > > Shouldn't this go to libkern? It's bogus, so it belongs in /dev/null. Bogusness starts with its name and its parameter names (its semantics are closer to memcpy() than bcopy(), but its arg order is that of bcopy()...). In a quick test, it is slightly slower than builtin memcpy when l = 64, and when l = 128 on amd64: % #include % % static __inline int % ixgbe_bcopy(void *_src, void *_dst, int l) % { % uint64_t *src = _src; % uint64_t *dst = _dst; % % for (; l > 0; l -= 32) { % *dst++ = *src++; % *dst++ = *src++; % *dst++ = *src++; % *dst++ = *src++; % } % return (0); % } % % int dst[512]; % int src[512]; % % main() % { % int i; % % for (i = 0; i < 100000000; i++) % #if 0 % __builtin_memcpy(dst, src, 64); % #else % ixgbe_bcopy(src, dst, 64); % #endif % } Builtin memcpy generates lots of unrolling, with up to 64 bytes copied in the builtin's inner loop on i386, and up to 128 on amd64. This is excessive, but is what makes the builtin slightly faster than the hand-rolled version in bogus micro-benchmarks like this. Times on FreeBSD cluster machines (core2): amd64 l = 128: builtin 1.00 seconds, hand-rolled 1.16 seconds i386 l = 64: builtin 0.99 seconds, hand-rolled 1.43 seconds Above 64 or 128 bytes, the builtin switches to calling memcpy(). Now the hand-rolled version is faster. This is essentially accidental. gcc knows that it doesn't understand copying memory and switches to the extern memcpy() above a certain threshold for the size, in the hope that the extern memcpy understands. The threshold is hard-coded but depends on -march. The hand-rolled version doesn't know that it doesn't understand copying memory, and uses a hard-coded magic number of 32 related to the threshold. The thresholds of 64/128 are possibly a little too small on the test hardware given the unsmartness of the extern memcpy(), but it is hard to do better without tuning for the CPU, its memory system, and other things. Perhaps ixgbe could know something about the context, but libkern can't. Times: amd64 l = 256: builtin 4.09 seconds, hand-rolled 2.28 seconds i386 l = 128: builtin 4.75 seconds, hand-rolled 2.67 seconds These times show some interesting unrelated pessimizations: - i386 is about twice as slow as amd64, on the same hardware. It is handicapped by only having 32-bit integer registers. With SSE, there would be little difference, but the setup overhead is probably too large to use SSE for such small copies, even in userland. - amd64 goes from being about twice as fast as i386 with builtin memcpy below the threshold to not much faster above the threshold. This is surprising, since the extern memcpy uses "rep movsq" on amd64, and in other benchmarks on other (amd64) machines, using "rep movsq" instead of "rep movsl"" retains the 2-flow speed advantage (because "rep movsq" goes at cache speed, but "rep movsl" can't keep up. String instructions tend to be slower` but are often fast enough. I recently read a claim that movs* is the fastest method on SandyBridge but not fastest on any older CPU. Anyway, the speed of copying from the L1 cache is unimportant. If anyone cared about it, then they would have noticed when automatic use of builtin memcpy was broken for kernels ~20 years ago by turning off all builtins. BTW, NOTES still hasn't caught up with this change. It still has -fno-builtin in makeoptions. I put this there to test the inversion of the default -fbuiltin. But the default was reversed without changing this (-fno-builtin is not explicit, but is implied by -ffreestanding). Bruce From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 16:57:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 413F81065675; Fri, 31 Aug 2012 16:57:18 +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 904998FC08; Fri, 31 Aug 2012 16:57: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 q7VGvHsv064568; Fri, 31 Aug 2012 16:57:17 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VGvHfB064566; Fri, 31 Aug 2012 16:57:17 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201208311657.q7VGvHfB064566@svn.freebsd.org> From: Joel Dahl Date: Fri, 31 Aug 2012 16:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239952 - head/usr.sbin/makefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 16:57:18 -0000 Author: joel (doc committer) Date: Fri Aug 31 16:57:16 2012 New Revision: 239952 URL: http://svn.freebsd.org/changeset/base/239952 Log: Remove trailing whitespace. Modified: head/usr.sbin/makefs/makefs.8 Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Fri Aug 31 14:35:01 2012 (r239951) +++ head/usr.sbin/makefs/makefs.8 Fri Aug 31 16:57:16 2012 (r239952) @@ -188,7 +188,7 @@ Set file system specific options. .Ar fs-options is a comma separated list of options. Valid file system specific options are detailed below. -.It Fl p +.It Fl p Create the image as a sparse file. .It Fl S Ar sector-size Set the file system sector size to From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 17:18:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F27AC106564A; Fri, 31 Aug 2012 17:18:41 +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 DD6588FC17; Fri, 31 Aug 2012 17: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 q7VHIfJM067071; Fri, 31 Aug 2012 17:18:41 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VHIfUc067067; Fri, 31 Aug 2012 17:18:41 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201208311718.q7VHIfUc067067@svn.freebsd.org> From: Joel Dahl Date: Fri, 31 Aug 2012 17: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: r239953 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 17:18:42 -0000 Author: joel (doc committer) Date: Fri Aug 31 17:18:41 2012 New Revision: 239953 URL: http://svn.freebsd.org/changeset/base/239953 Log: Mdoc fixes. Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Fri Aug 31 16:57:16 2012 (r239952) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.5 Fri Aug 31 17:18:41 2012 (r239953) @@ -67,7 +67,7 @@ however a feature's short name may diffe following the convention would result in name conflicts. .Ss Feature states Features can be in one of three states: -.Bl -tag +.Bl -tag -width "XXXXXXXX" .It Sy active This feature's on\-disk format changes are in effect on the pool. Support for this feature is required to import the pool in read\-write mode. @@ -93,6 +93,7 @@ unless an administrator moves the featur state. Features cannot be disabled once they have been enabled. .El +.Pp The state of supported features is exposed through pool properties of the form .Sy feature@short_name . .Ss Read\-only compatibility @@ -111,7 +112,7 @@ named .Sy unsupported@feature_guid will indicate why the import was allowed despite the unsupported feature. Possible values for this property are: -.Bl -tag +.Bl -tag -width "XXXXXXXX" .It Sy inactive The feature is in the .Sy enabled @@ -127,7 +128,7 @@ properly. Enabling a feature will automatically enable any features it depends on. .Sh FEATURES The following features are supported on this system: -.Bl -tag +.Bl -tag -width "XXXXXXXX" .It Sy async_destroy .Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:async_destroy" .It GUID Ta com.delphix:async_destroy Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Aug 31 16:57:16 2012 (r239952) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Aug 31 17:18:41 2012 (r239953) @@ -193,7 +193,7 @@ A describes a single device or a collection of devices organized according to certain performance and fault characteristics. The following virtual devices are supported: -.Bl -tag +.Bl -tag -width "XXXXXX" .It Sy disk A block device, typically located under .Pa /dev . @@ -532,7 +532,7 @@ can provide additional information about .It Sy dedupratio The deduplication ratio specified for a pool, expressed as a multiplier. For example, a -.S dedupratio +.Sy dedupratio value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See .Xr zfs 8 for a description of the deduplication feature. @@ -1678,6 +1678,16 @@ This option can only be used to increase supported legacy version number. .El .El +.Sh EXIT STATUS +The following exit values are returned: +.Bl -tag -offset 2n -width 2n +.It 0 +Successful completion. +.It 1 +An error occurred. +.It 2 +Invalid command line options were specified. +.El .Sh EXAMPLES .Bl -tag -width 0n .It Sy Example 1 No Creating a RAID-Z Storage Pool @@ -1915,16 +1925,6 @@ Pool data returned to its state as of Tu Discarded approximately 29 seconds of transactions. .Ed .El -.Sh EXIT STATUS -The following exit values are returned: -.Bl -tag -offset 2n -width 2n -.It 0 -Successful completion. -.It 1 -An error occurred. -.It 2 -Invalid command line options were specified. -.El .Sh SEE ALSO .Xr zfs 8 .Xr zpool-features 5 From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 18:26:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F0AA106568D; Fri, 31 Aug 2012 18:26: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 09C3F8FC18; Fri, 31 Aug 2012 18:26: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 q7VIQdqe075603; Fri, 31 Aug 2012 18:26:39 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VIQdhi075601; Fri, 31 Aug 2012 18:26:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208311826.q7VIQdhi075601@svn.freebsd.org> From: Ed Schouten Date: Fri, 31 Aug 2012 18:26: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: r239954 - head/usr.sbin/ac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 18:26:40 -0000 Author: ed Date: Fri Aug 31 18:26:39 2012 New Revision: 239954 URL: http://svn.freebsd.org/changeset/base/239954 Log: Relicense ac(8). Though the license of the original ac(8) source code provides many liberties, we are already somewhat violating it. The license requires us to clearly comment any modifications to the source code, as the original authors of course do not want to get bug reports for modified versions of ac(8). This is something we have not done consistently. The need for such a license clause has become less over time. It is very unlikely that end users will contact the original authors, as the copyright is from 1994. I contacted both the copyright holders. They responded in a timely fashion and were more than willing to relicense it to a 2-clause BSD license. To address any concerns about bug reports going to the original authors instead of me, add my own name and email address to the copyright statements as well. MFC after: 1 month Special thanks to: Christopher Demetriou and Simon Gerraty Modified: head/usr.sbin/ac/ac.c Modified: head/usr.sbin/ac/ac.c ============================================================================== --- head/usr.sbin/ac/ac.c Fri Aug 31 17:18:41 2012 (r239953) +++ head/usr.sbin/ac/ac.c Fri Aug 31 18:26:39 2012 (r239954) @@ -1,16 +1,29 @@ -/* - * Copyright (c) 1994 Christopher G. Demetriou. - * @(#)Copyright (c) 1994, Simon J. Gerraty. +/*- + * Copyright (c) 1994 Christopher G. Demetriou + * Copyright (c) 1994 Simon J. Gerraty + * Copyright (c) 2012 Ed Schouten + * 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 is free software. It comes with NO WARRANTY. - * Permission to use, modify and distribute this source code - * is granted subject to the following conditions. - * 1/ that the above copyright notice and this notice - * are preserved in all copies and that due credit be given - * to the author. - * 2/ that any changes to this code are clearly commented - * as such so that the author does not get blamed for bugs - * other than his own. + * 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 From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 20:54:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A43741065679; Fri, 31 Aug 2012 20:54:30 +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 83DDD8FC1C; Fri, 31 Aug 2012 20:54: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 q7VKsUBu093708; Fri, 31 Aug 2012 20:54:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VKsUMw093705; Fri, 31 Aug 2012 20:54:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208312054.q7VKsUMw093705@svn.freebsd.org> From: John Baldwin Date: Fri, 31 Aug 2012 20:54: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: r239955 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 20:54:30 -0000 Author: jhb Date: Fri Aug 31 20:54:30 2012 New Revision: 239955 URL: http://svn.freebsd.org/changeset/base/239955 Log: Add common rules for building firmware object files (NORMAL_FW to run uudecode, and NORMAL_FWO to use ld to build the .fwo file) and use those instead of explicit ld/uudecode invocations in sys/conf/files. Apart from increasing readability, this makes it possible to adjust the flags used for firmware objects in one place. MFC after: 2 weeks Modified: head/sys/conf/files head/sys/conf/kern.pre.mk Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 31 18:26:39 2012 (r239954) +++ head/sys/conf/files Fri Aug 31 20:54:30 2012 (r239955) @@ -1337,12 +1337,12 @@ ipwbssfw.c optional ipwbssfw | ipwfw clean "ipwbssfw.c" ipw_bss.fwo optional ipwbssfw | ipwfw \ dependency "ipw_bss.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_bss.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "ipw_bss.fwo" ipw_bss.fw optional ipwbssfw | ipwfw \ dependency "$S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "ipw_bss.fw" ipwibssfw.c optional ipwibssfw | ipwfw \ @@ -1351,12 +1351,12 @@ ipwibssfw.c optional ipwibssfw | ipwfw clean "ipwibssfw.c" ipw_ibss.fwo optional ipwibssfw | ipwfw \ dependency "ipw_ibss.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_ibss.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "ipw_ibss.fwo" ipw_ibss.fw optional ipwibssfw | ipwfw \ dependency "$S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "ipw_ibss.fw" ipwmonitorfw.c optional ipwmonitorfw | ipwfw \ @@ -1365,12 +1365,12 @@ ipwmonitorfw.c optional ipwmonitorfw | clean "ipwmonitorfw.c" ipw_monitor.fwo optional ipwmonitorfw | ipwfw \ dependency "ipw_monitor.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_monitor.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "ipw_monitor.fwo" ipw_monitor.fw optional ipwmonitorfw | ipwfw \ dependency "$S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "ipw_monitor.fw" dev/iscsi/initiator/iscsi.c optional iscsi_initiator scbus @@ -1395,12 +1395,12 @@ iwibssfw.c optional iwibssfw | iwifw clean "iwibssfw.c" iwi_bss.fwo optional iwibssfw | iwifw \ dependency "iwi_bss.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_bss.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwi_bss.fwo" iwi_bss.fw optional iwibssfw | iwifw \ dependency "$S/contrib/dev/iwi/ipw2200-bss.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-bss.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwi_bss.fw" iwiibssfw.c optional iwiibssfw | iwifw \ @@ -1409,12 +1409,12 @@ iwiibssfw.c optional iwiibssfw | iwifw clean "iwiibssfw.c" iwi_ibss.fwo optional iwiibssfw | iwifw \ dependency "iwi_ibss.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_ibss.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwi_ibss.fwo" iwi_ibss.fw optional iwiibssfw | iwifw \ dependency "$S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwi_ibss.fw" iwimonitorfw.c optional iwimonitorfw | iwifw \ @@ -1423,12 +1423,12 @@ iwimonitorfw.c optional iwimonitorfw | clean "iwimonitorfw.c" iwi_monitor.fwo optional iwimonitorfw | iwifw \ dependency "iwi_monitor.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_monitor.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwi_monitor.fwo" iwi_monitor.fw optional iwimonitorfw | iwifw \ dependency "$S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwi_monitor.fw" dev/iwn/if_iwn.c optional iwn @@ -1438,12 +1438,12 @@ iwn1000fw.c optional iwn1000fw | iwnfw clean "iwn1000fw.c" iwn1000fw.fwo optional iwn1000fw | iwnfw \ dependency "iwn1000.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn1000.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn1000fw.fwo" iwn1000.fw optional iwn1000fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-1000-39.31.5.1.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-1000-39.31.5.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn1000.fw" iwn4965fw.c optional iwn4965fw | iwnfw \ @@ -1452,12 +1452,12 @@ iwn4965fw.c optional iwn4965fw | iwnfw clean "iwn4965fw.c" iwn4965fw.fwo optional iwn4965fw | iwnfw \ dependency "iwn4965.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn4965.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn4965fw.fwo" iwn4965.fw optional iwn4965fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn4965.fw" iwn5000fw.c optional iwn5000fw | iwnfw \ @@ -1466,12 +1466,12 @@ iwn5000fw.c optional iwn5000fw | iwnfw clean "iwn5000fw.c" iwn5000fw.fwo optional iwn5000fw | iwnfw \ dependency "iwn5000.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5000.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn5000fw.fwo" iwn5000.fw optional iwn5000fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-5000-8.83.5.1.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5000-8.83.5.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn5000.fw" iwn5150fw.c optional iwn5150fw | iwnfw \ @@ -1480,12 +1480,12 @@ iwn5150fw.c optional iwn5150fw | iwnfw clean "iwn5150fw.c" iwn5150fw.fwo optional iwn5150fw | iwnfw \ dependency "iwn5150.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn5150.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn5150fw.fwo" iwn5150.fw optional iwn5150fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu"\ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn5150.fw" iwn6000fw.c optional iwn6000fw | iwnfw \ @@ -1494,12 +1494,12 @@ iwn6000fw.c optional iwn6000fw | iwnfw clean "iwn6000fw.c" iwn6000fw.fwo optional iwn6000fw | iwnfw \ dependency "iwn6000.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn6000fw.fwo" iwn6000.fw optional iwn6000fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000-9.221.4.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn6000.fw" iwn6000g2afw.c optional iwn6000g2afw | iwnfw \ @@ -1508,12 +1508,12 @@ iwn6000g2afw.c optional iwn6000g2afw | clean "iwn6000g2afw.c" iwn6000g2afw.fwo optional iwn6000g2afw | iwnfw \ dependency "iwn6000g2a.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000g2a.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn6000g2afw.fwo" iwn6000g2a.fw optional iwn6000g2afw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.2.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.2.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn6000g2a.fw" iwn6000g2bfw.c optional iwn6000g2bfw | iwnfw \ @@ -1522,12 +1522,12 @@ iwn6000g2bfw.c optional iwn6000g2bfw | clean "iwn6000g2bfw.c" iwn6000g2bfw.fwo optional iwn6000g2bfw | iwnfw \ dependency "iwn6000g2b.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6000g2b.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn6000g2bfw.fwo" iwn6000g2b.fw optional iwn6000g2bfw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-6000g2b-17.168.5.2.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000g2b-17.168.5.2.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn6000g2b.fw" iwn6050fw.c optional iwn6050fw | iwnfw \ @@ -1536,12 +1536,12 @@ iwn6050fw.c optional iwn6050fw | iwnfw clean "iwn6050fw.c" iwn6050fw.fwo optional iwn6050fw | iwnfw \ dependency "iwn6050.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn6050.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "iwn6050fw.fwo" iwn6050.fw optional iwn6050fw | iwnfw \ dependency "$S/contrib/dev/iwn/iwlwifi-6050-41.28.5.1.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6050-41.28.5.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn6050.fw" dev/ixgb/if_ixgb.c optional ixgb @@ -1673,22 +1673,22 @@ mwlfw.c optional mwlfw \ clean "mwlfw.c" mw88W8363.fwo optional mwlfw \ dependency "mw88W8363.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mw88W8363.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "mw88W8363.fwo" mw88W8363.fw optional mwlfw \ dependency "$S/contrib/dev/mwl/mw88W8363.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mw88W8363.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "mw88W8363.fw" mwlboot.fwo optional mwlfw \ dependency "mwlboot.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} mwlboot.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "mwlboot.fwo" mwlboot.fw optional mwlfw \ dependency "$S/contrib/dev/mwl/mwlboot.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/mwl/mwlboot.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "mwlboot.fw" dev/mxge/if_mxge.c optional mxge pci @@ -1820,12 +1820,12 @@ rt2561fw.c optional rt2561fw | ralfw clean "rt2561fw.c" rt2561fw.fwo optional rt2561fw | ralfw \ dependency "rt2561.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "rt2561fw.fwo" rt2561.fw optional rt2561fw | ralfw \ dependency "$S/contrib/dev/ral/rt2561.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2561.fw" rt2561sfw.c optional rt2561sfw | ralfw \ @@ -1834,12 +1834,12 @@ rt2561sfw.c optional rt2561sfw | ralfw clean "rt2561sfw.c" rt2561sfw.fwo optional rt2561sfw | ralfw \ dependency "rt2561s.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561s.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "rt2561sfw.fwo" rt2561s.fw optional rt2561sfw | ralfw \ dependency "$S/contrib/dev/ral/rt2561s.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561s.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2561s.fw" rt2661fw.c optional rt2661fw | ralfw \ @@ -1848,12 +1848,12 @@ rt2661fw.c optional rt2661fw | ralfw clean "rt2661fw.c" rt2661fw.fwo optional rt2661fw | ralfw \ dependency "rt2661.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2661.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "rt2661fw.fwo" rt2661.fw optional rt2661fw | ralfw \ dependency "$S/contrib/dev/ral/rt2661.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2661.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2661.fw" rt2860fw.c optional rt2860fw | ralfw \ @@ -1862,12 +1862,12 @@ rt2860fw.c optional rt2860fw | ralfw clean "rt2860fw.c" rt2860fw.fwo optional rt2860fw | ralfw \ dependency "rt2860.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2860.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "rt2860fw.fwo" rt2860.fw optional rt2860fw | ralfw \ dependency "$S/contrib/dev/ral/rt2860.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2860.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "rt2860.fw" dev/random/harvest.c standard @@ -2154,12 +2154,12 @@ runfw.c optional runfw \ clean "runfw.c" runfw.fwo optional runfw \ dependency "runfw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} runfw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "runfw.fwo" runfw optional runfw \ dependency "$S/contrib/dev/run/rt2870.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/run/rt2870.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "runfw" dev/usb/wlan/if_uath.c optional uath @@ -2277,12 +2277,12 @@ wpifw.c optional wpifw \ clean "wpifw.c" wpifw.fwo optional wpifw \ dependency "wpi.fw" \ - compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} wpi.fw" \ + compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "wpifw.fwo" wpi.fw optional wpifw \ dependency "$S/contrib/dev/wpi/iwlwifi-3945-15.32.2.9.fw.uu" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/wpi/iwlwifi-3945-15.32.2.9.fw.uu" \ + compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "wpi.fw" dev/xe/if_xe.c optional xe Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Aug 31 18:26:39 2012 (r239954) +++ head/sys/conf/kern.pre.mk Fri Aug 31 20:54:30 2012 (r239955) @@ -131,6 +131,9 @@ NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${ NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \ ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c +NORMAL_FW= uudecode -o ${.TARGET} ${.IMPSRC} +NORMAL_FWO= ${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ${.IMPSRC} + # Special flags for managing the compat compiles for ZFS ZFS_CFLAGS= -DFREEBSD_NAMECACHE -DBUILDING_ZFS -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common/fs/zfs -I$S/cddl/contrib/opensolaris/uts/common/zmod -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common/zfs -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas ZFS_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${ZFS_CFLAGS} From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 21:10:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E79B106564A; Fri, 31 Aug 2012 21:10:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2968C8FC14; Fri, 31 Aug 2012 21:10: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 q7VLAdap095683; Fri, 31 Aug 2012 21:10:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VLAcF9095681; Fri, 31 Aug 2012 21:10:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208312110.q7VLAcF9095681@svn.freebsd.org> From: John Baldwin Date: Fri, 31 Aug 2012 21:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239956 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 21:10:39 -0000 Author: jhb Date: Fri Aug 31 21:10:38 2012 New Revision: 239956 URL: http://svn.freebsd.org/changeset/base/239956 Log: The implied source variable (.IMPSRC) didn't actually work in my previous commit. Change this to use .ALLSRC instead, but be careful to only use the .fw file for NORMAL_FWO to ignore opt_global.h. Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Aug 31 20:54:30 2012 (r239955) +++ head/sys/conf/kern.pre.mk Fri Aug 31 21:10:38 2012 (r239956) @@ -131,8 +131,8 @@ NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${ NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \ ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c -NORMAL_FW= uudecode -o ${.TARGET} ${.IMPSRC} -NORMAL_FWO= ${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ${.IMPSRC} +NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC} +NORMAL_FWO= ${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ${.ALLSRC:M*.fw} # Special flags for managing the compat compiles for ZFS ZFS_CFLAGS= -DFREEBSD_NAMECACHE -DBUILDING_ZFS -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common/fs/zfs -I$S/cddl/contrib/opensolaris/uts/common/zmod -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common/zfs -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 21:25:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 845EA1065676; Fri, 31 Aug 2012 21:25:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 8BCCB8FC08; Fri, 31 Aug 2012 21:25:01 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CFBA6B977; Fri, 31 Aug 2012 17:25:00 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Fri, 31 Aug 2012 17:19:45 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201208312110.q7VLAcF9095681@svn.freebsd.org> In-Reply-To: <201208312110.q7VLAcF9095681@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201208311719.45910.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 31 Aug 2012 17:25:00 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r239956 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 21:25:08 -0000 On Friday, August 31, 2012 5:10:38 pm John Baldwin wrote: > Author: jhb > Date: Fri Aug 31 21:10:38 2012 > New Revision: 239956 > URL: http://svn.freebsd.org/changeset/base/239956 > > Log: > The implied source variable (.IMPSRC) didn't actually work in my previous > commit. Change this to use .ALLSRC instead, but be careful to only use > the .fw file for NORMAL_FWO to ignore opt_global.h. Should have a 'Pointy hat to: jhb'. :-/ -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 21:27:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE6CB106566B; Fri, 31 Aug 2012 21:27:24 +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 B00438FC16; Fri, 31 Aug 2012 21:27: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 q7VLRO4Q097664; Fri, 31 Aug 2012 21:27:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VLROpD097662; Fri, 31 Aug 2012 21:27:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208312127.q7VLROpD097662@svn.freebsd.org> From: John Baldwin Date: Fri, 31 Aug 2012 21:27: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: r239957 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 21:27:25 -0000 Author: jhb Date: Fri Aug 31 21:27:23 2012 New Revision: 239957 URL: http://svn.freebsd.org/changeset/base/239957 Log: Similar to how r171350 fixed linking of kernel modules containing firmware objects by adding --no-warn-mismatch to the linker flags, add --no-warn-mismatch when linking firmware objects (*.fwo) as well as to the link of the main kernel file. This permits firmware modules to be statically linked into an ia64 kernel. Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Aug 31 21:10:38 2012 (r239956) +++ head/sys/conf/kern.pre.mk Fri Aug 31 21:27:23 2012 (r239957) @@ -132,7 +132,8 @@ NORMAL_M= ${AWK} -f $S/tools/makeobjops. ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC} -NORMAL_FWO= ${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ${.ALLSRC:M*.fw} +NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \ + -o ${.TARGET} ${.ALLSRC:M*.fw} # Special flags for managing the compat compiles for ZFS ZFS_CFLAGS= -DFREEBSD_NAMECACHE -DBUILDING_ZFS -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common/fs/zfs -I$S/cddl/contrib/opensolaris/uts/common/zmod -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common/zfs -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas @@ -164,7 +165,7 @@ SYSTEM_DEP= Makefile ${SYSTEM_OBJS} SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS} SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o} SYSTEM_OBJS+= hack.So -SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} \ +SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} --no-warn-mismatch \ -warn-common -export-dynamic -dynamic-linker /red/herring \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 21:44:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E365106564A; Fri, 31 Aug 2012 21:44:13 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78FFE8FC08; Fri, 31 Aug 2012 21:44: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 q7VLiDAl099583; Fri, 31 Aug 2012 21:44:13 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VLiDlC099581; Fri, 31 Aug 2012 21:44:13 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201208312144.q7VLiDlC099581@svn.freebsd.org> From: Joel Dahl Date: Fri, 31 Aug 2012 21:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239958 - head/cddl/contrib/opensolaris/cmd/zdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 21:44:13 -0000 Author: joel (doc committer) Date: Fri Aug 31 21:44:12 2012 New Revision: 239958 URL: http://svn.freebsd.org/changeset/base/239958 Log: Minor mdoc fixes. Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Aug 31 21:27:23 2012 (r239957) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Aug 31 21:44:12 2012 (r239958) @@ -93,14 +93,14 @@ If specified multiple times, verify the .It Fl C Display information about the configuration. If specified with no other options, instead display information about the cache file -.Ns ( Pa /etc/zfs/zpool.cache Ns ). +.Po Pa /etc/zfs/zpool.cache Pc . To specify the cache file to display, see .Fl U .Pp If specified multiple times, and a pool name is also specified display both the cached configuration and the on-disk configuration. If specified multiple times with -.FL e +.Fl e also display the configuration that would be used were the pool to be imported. .It Fl d @@ -253,7 +253,7 @@ MOS Configuration: .Li # Ic zdb -d rpool Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects -... + ... .Ed .It Xo Sy Example 3 Display basic information about object 0 in .Sy 'rpool/export/home' From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 21:45:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28993106566B; Fri, 31 Aug 2012 21:45:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08BA78FC1E; Fri, 31 Aug 2012 21:45: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 q7VLjnGI099790; Fri, 31 Aug 2012 21:45:49 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VLjniF099787; Fri, 31 Aug 2012 21:45:49 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208312145.q7VLjniF099787@svn.freebsd.org> From: Dimitry Andric Date: Fri, 31 Aug 2012 21:45: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: r239959 - in head/sys: conf modules/xfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 21:45:50 -0000 Author: dim Date: Fri Aug 31 21:45:49 2012 New Revision: 239959 URL: http://svn.freebsd.org/changeset/base/239959 Log: Work around several warnings from clang in the xfs filesystem, when linking it statically into the kernel. With our gcc in base there are no warnings, so also remove the WERROR= from the module makefile. Noted by: Eir Nym MFC after: 1 week Modified: head/sys/conf/files head/sys/modules/xfs/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 31 21:44:12 2012 (r239958) +++ head/sys/conf/files Fri Aug 31 21:45:49 2012 (r239959) @@ -3608,7 +3608,7 @@ xdr/xdr_reference.c optional krpc | nfs xdr/xdr_sizeof.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd # gnu/fs/xfs/xfs_alloc.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" \ + compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" \ warning "kernel contains GPL contaminated xfs filesystem" gnu/fs/xfs/xfs_alloc_btree.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" @@ -3627,9 +3627,9 @@ gnu/fs/xfs/xfs_da_btree.c optional xfs \ gnu/fs/xfs/xfs_dir.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_block.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_data.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_leaf.c optional xfs \ @@ -3637,7 +3637,7 @@ gnu/fs/xfs/xfs_dir2_leaf.c optional xfs gnu/fs/xfs/xfs_dir2_node.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_sf.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_trace.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir_leaf.c optional xfs \ @@ -3685,7 +3685,7 @@ gnu/fs/xfs/xfs_trans_item.c optional xfs gnu/fs/xfs/xfs_utils.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_vfsops.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + compile-with "${NORMAL_C} ${NO_WFORMAT_SECURITY} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_vnodeops.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_rw.c optional xfs \ @@ -3715,9 +3715,9 @@ gnu/fs/xfs/FreeBSD/xfs_globals.c optiona gnu/fs/xfs/FreeBSD/xfs_dmistubs.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_super.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + compile-with "${NORMAL_C} ${NO_WFORMAT_SECURITY} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_stats.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + compile-with "${NORMAL_C} ${NO_WFORMAT_SECURITY} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_vfs.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_vnode.c optional xfs \ Modified: head/sys/modules/xfs/Makefile ============================================================================== --- head/sys/modules/xfs/Makefile Fri Aug 31 21:44:12 2012 (r239958) +++ head/sys/modules/xfs/Makefile Fri Aug 31 21:45:49 2012 (r239959) @@ -6,8 +6,6 @@ KMOD= xfs -WERROR= - SRCS = vnode_if.h \ xfs_alloc.c \ xfs_alloc_btree.c \ @@ -86,5 +84,12 @@ CFLAGS+= -I${.CURDIR}/../../gnu/fs/xfs/F -I${.CURDIR}/../../gnu/fs/xfs/FreeBSD/support \ -I${.CURDIR}/../../gnu/fs/xfs +CWARNFLAGS.xfs_alloc.c= ${NO_WSOMETIMES_UNINITIALIZED} +CWARNFLAGS.xfs_dir2.c= ${NO_WARRAY_BOUNDS} +CWARNFLAGS.xfs_dir2_block.c= ${NO_WARRAY_BOUNDS} +CWARNFLAGS.xfs_dir2_sf.c= ${NO_WARRAY_BOUNDS} CWARNFLAGS.xfs_ioctl.c= ${NO_WSELF_ASSIGN} +CWARNFLAGS.xfs_stats.c= ${NO_WFORMAT_SECURITY} +CWARNFLAGS.xfs_super.c= ${NO_WFORMAT_SECURITY} +CWARNFLAGS.xfs_vfsops.c= ${NO_WFORMAT_SECURITY} CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 22:00:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3D4691065673; Fri, 31 Aug 2012 22:00:00 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id ECCC68FC08; Fri, 31 Aug 2012 21:59:59 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 75F8E6140; Fri, 31 Aug 2012 23:59:53 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 110BC87CD; Fri, 31 Aug 2012 23:59:52 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Doug Barton References: <201208302256.q7UMuWE7027494@svn.freebsd.org> <504005E1.7040602@FreeBSD.org> Date: Fri, 31 Aug 2012 23:59:52 +0200 In-Reply-To: <504005E1.7040602@FreeBSD.org> (Doug Barton's message of "Thu, 30 Aug 2012 14:31:29 -1000") Message-ID: <868vcuzprb.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239927 - head/tools/tools/track X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 22:00:00 -0000 Doug Barton writes: > Dag-Erling Sm=C3=B8rgrav writes: > > - \*\*\*\ Error*) > > + \*\*\**) > Are you sure that the double ** is necessary here? Yes, error messages generally include text in addition to the initial three asterisks. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 22:22:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 71F7E106577D; Fri, 31 Aug 2012 22:22:15 +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 5C4E18FC18; Fri, 31 Aug 2012 22:22: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 q7VMMFAp004050; Fri, 31 Aug 2012 22:22:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VMMFfT004048; Fri, 31 Aug 2012 22:22:15 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208312222.q7VMMFfT004048@svn.freebsd.org> From: Ed Schouten Date: Fri, 31 Aug 2012 22:22: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: r239960 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 22:22:15 -0000 Author: ed Date: Fri Aug 31 22:22:14 2012 New Revision: 239960 URL: http://svn.freebsd.org/changeset/base/239960 Log: Properly enable Clang-style atomics when available. In addition to testing against cxx_atomic, we must check c_atomic. The former is only set when building C++ code. Also use __has_extension instead of __has_feature. This allows us to use the atomics outside of C11. Reported by: Ariane van der Steldt PR: threads/170073 Modified: head/include/stdatomic.h Modified: head/include/stdatomic.h ============================================================================== --- head/include/stdatomic.h Fri Aug 31 21:45:49 2012 (r239959) +++ head/include/stdatomic.h Fri Aug 31 22:22:14 2012 (r239960) @@ -33,7 +33,7 @@ #include #include -#if __has_feature(cxx_atomic) +#if __has_extension(c_atomic) || __has_extension(cxx_atomic) #define __CLANG_ATOMICS #elif __GNUC_PREREQ__(4, 7) #define __GNUC_ATOMICS From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 22:37:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 57C46106564A; Fri, 31 Aug 2012 22:37:09 +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 4275F8FC12; Fri, 31 Aug 2012 22:37: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 q7VMb9NM005915; Fri, 31 Aug 2012 22:37:09 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VMb9Yt005913; Fri, 31 Aug 2012 22:37:09 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201208312237.q7VMb9Yt005913@svn.freebsd.org> From: Ed Schouten Date: Fri, 31 Aug 2012 22:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239961 - head/usr.sbin/ac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 22:37:09 -0000 Author: ed Date: Fri Aug 31 22:37:08 2012 New Revision: 239961 URL: http://svn.freebsd.org/changeset/base/239961 Log: Also relicense the ac(8) man page. MFC after: 1 month Discussed with: Simon Gerraty and Chris Demetriou Modified: head/usr.sbin/ac/ac.8 Modified: head/usr.sbin/ac/ac.8 ============================================================================== --- head/usr.sbin/ac/ac.8 Fri Aug 31 22:22:14 2012 (r239960) +++ head/usr.sbin/ac/ac.8 Fri Aug 31 22:37:08 2012 (r239961) @@ -11,11 +11,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by Christopher G. Demetriou. -.\" 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 From owner-svn-src-head@FreeBSD.ORG Fri Aug 31 23:28:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9E5751065670; Fri, 31 Aug 2012 23:28:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89A6C8FC18; Fri, 31 Aug 2012 23:28: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 q7VNSfNX012049; Fri, 31 Aug 2012 23:28:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VNSfLK012047; Fri, 31 Aug 2012 23:28:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208312328.q7VNSfLK012047@svn.freebsd.org> From: Dimitry Andric Date: Fri, 31 Aug 2012 23:28: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: r239962 - head/contrib/binutils/binutils X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 23:28:41 -0000 Author: dim Date: Fri Aug 31 23:28:41 2012 New Revision: 239962 URL: http://svn.freebsd.org/changeset/base/239962 Log: Fix a twelve year old bug in readelf: when process_dynamic_segment() encounters a DT_RUNPATH entry, the global dynamic_info[] array is overrun, causing some other global variable to be overwritten. In my testcase, this was the section_headers variable, leading to segfaults or jemalloc assertions when it was freed later on. Thanks to Koop Mast for providing samples of a few "bad" .so files. MFC after: 1 week Modified: head/contrib/binutils/binutils/readelf.c Modified: head/contrib/binutils/binutils/readelf.c ============================================================================== --- head/contrib/binutils/binutils/readelf.c Fri Aug 31 22:37:08 2012 (r239961) +++ head/contrib/binutils/binutils/readelf.c Fri Aug 31 23:28:41 2012 (r239962) @@ -174,7 +174,7 @@ static Elf_Internal_Syminfo *dynamic_sym static unsigned long dynamic_syminfo_offset; static unsigned int dynamic_syminfo_nent; static char program_interpreter[PATH_MAX]; -static bfd_vma dynamic_info[DT_JMPREL + 1]; +static bfd_vma dynamic_info[DT_ENCODING]; static bfd_vma dynamic_info_DT_GNU_HASH; static bfd_vma version_info[16]; static Elf_Internal_Ehdr elf_header; From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 01:00:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBAAF106566B; Sat, 1 Sep 2012 01:00:54 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 691ED8FC18; Sat, 1 Sep 2012 01:00:53 +0000 (UTC) Received: by obbun3 with SMTP id un3so8623641obb.13 for ; Fri, 31 Aug 2012 18:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=noHQcmqTaGS/2tQnD72fEgaF+d0omBwzR1OovT62hz4=; b=CMuN01ZP0Q668kTAABjWG7cfnB7q8NqPPGeTi6zFDoqSxi9aCyUda1dT2a0A7RaPlU ODFBM2ugbxSdilyT1/zizr53hrh3cRT1UGrtAaWQeMAiDYenoqqPyUjf4eiN5vFyNglC E0Nul8IwSXlti1qC6qfZg3UpdHBBOrARGRsUBZIp7XrLiJ97eqdzWHLF+tdbMSl/SL/k gJ5ZA8MhP3gLIfNkbdONw9sAmSqYt/HZmNTEJ2EAYH/N1bEjRSfOlovrc97wfCAYquIm 5jhqTFbHuKDbp5XER7c7MLPRMf16xEVr0UAMmKk2WEZ0y76cFeCfNAkVWeH/h8hqb7YQ eZjw== MIME-Version: 1.0 Received: by 10.182.218.37 with SMTP id pd5mr9400681obc.24.1346461253446; Fri, 31 Aug 2012 18:00:53 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Fri, 31 Aug 2012 18:00:53 -0700 (PDT) In-Reply-To: <201208312328.q7VNSfLK012047@svn.freebsd.org> References: <201208312328.q7VNSfLK012047@svn.freebsd.org> Date: Fri, 31 Aug 2012 18:00:53 -0700 Message-ID: From: Garrett Cooper To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239962 - head/contrib/binutils/binutils X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 01:00:55 -0000 On Fri, Aug 31, 2012 at 4:28 PM, Dimitry Andric wrote: > Author: dim > Date: Fri Aug 31 23:28:41 2012 > New Revision: 239962 > URL: http://svn.freebsd.org/changeset/base/239962 > > Log: > Fix a twelve year old bug in readelf: when process_dynamic_segment() > encounters a DT_RUNPATH entry, the global dynamic_info[] array is > overrun, causing some other global variable to be overwritten. > > In my testcase, this was the section_headers variable, leading to > segfaults or jemalloc assertions when it was freed later on. > > Thanks to Koop Mast for providing samples of a few "bad" .so files. ... Nice! Hopefully this fixes the random tinderbox crashes I've seen! Has this been fixed upstream? Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 02:56:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A2FC106564A; Sat, 1 Sep 2012 02:56:18 +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 643D68FC08; Sat, 1 Sep 2012 02: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 q812uIw3037828; Sat, 1 Sep 2012 02:56:18 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q812uILS037812; Sat, 1 Sep 2012 02:56:18 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201209010256.q812uILS037812@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 1 Sep 2012 02:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239963 - in head: include/rpc lib/libc/rpc sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 02:56:18 -0000 Author: pfg Date: Sat Sep 1 02:56:17 2012 New Revision: 239963 URL: http://svn.freebsd.org/changeset/base/239963 Log: Bring some changes from Bull's NFSv4 libtirpc implementation. We especifically ignored the glibc compatibility changes but this should help interaction with Solaris and Linux. ____ Fixed infinite loop in svc_run() author Steve Dickson Tue, 10 Jun 2008 12:35:52 -0500 (13:35 -0400) Fixed infinite loop in svc_run() ____ __rpc_taddr2uaddr_af() assumes the netbuf to always have a non-zero data. This is a bad assumption and can lead to a seg-fault. This patch adds a check for zero length and returns NULL when found. author Steve Dickson Mon, 27 Oct 2008 11:46:54 -0500 (12:46 -0400) ____ Changed clnt_spcreateerror() to return clearer and more concise error messages. author Steve Dickson Thu, 20 Nov 2008 08:55:31 -0500 (08:55 -0500) ____ Converted all uid and gid variables of the type uid_t and gid_t. author Steve Dickson Wed, 28 Jan 2009 12:44:46 -0500 (12:44 -0500) ____ libtirpc: set r_netid and r_owner in __rpcb_findaddr_timed These fields in the rpcbind GETADDR call are being passed uninitialized to CLNT_CALL. In the case of x86_64 at least, this usually leads to a segfault. On x86, it sometimes causes segfaults and other times causes garbage to be sent on the wire. rpcbind generally ignores the r_owner field for calls that come in over the wire, so it really doesn't matter what we send in that slot. We just need to send something. The reference implementation from Sun seems to send a blank string. Have ours follow suit. author Jeff Layton Fri, 13 Mar 2009 11:44:16 -0500 (12:44 -0400) ____ libtirpc: be sure to free cl_netid and cl_tp When creating a client with clnt_tli_create, it uses strdup to copy strings for these fields if nconf is passed in. clnt_dg_destroy frees these strings already. Make sure clnt_vc_destroy frees them in the same way. author Jeff Layton Fri, 13 Mar 2009 11:47:36 -0500 (12:47 -0400) Obtained from: Bull GNU/Linux NFSv4 Project MFC after: 3 weeks Modified: head/include/rpc/auth.h head/include/rpc/auth_unix.h head/lib/libc/rpc/auth_unix.c head/lib/libc/rpc/authunix_prot.c head/lib/libc/rpc/clnt_perror.c head/lib/libc/rpc/clnt_vc.c head/lib/libc/rpc/rpc_generic.c head/lib/libc/rpc/rpc_soc.3 head/lib/libc/rpc/rpcb_clnt.c head/lib/libc/rpc/svc_auth_unix.c head/lib/libc/rpc/svc_run.c head/sys/rpc/auth.h head/sys/rpc/clnt_vc.c head/sys/rpc/rpcb_clnt.c Modified: head/include/rpc/auth.h ============================================================================== --- head/include/rpc/auth.h Fri Aug 31 23:28:41 2012 (r239962) +++ head/include/rpc/auth.h Sat Sep 1 02:56:17 2012 (r239963) @@ -243,14 +243,13 @@ __END_DECLS * System style authentication * AUTH *authunix_create(machname, uid, gid, len, aup_gids) * char *machname; - * int uid; - * int gid; + * uid_t uid; + * gid_t gid; * int len; - * int *aup_gids; + * gid_t *aup_gids; */ __BEGIN_DECLS -extern AUTH *authunix_create(char *, int, int, int, - int *); +extern AUTH *authunix_create(char *, uid_t, gid_t, int, gid_t *); extern AUTH *authunix_create_default(void); /* takes no parameters */ extern AUTH *authnone_create(void); /* takes no parameters */ __END_DECLS Modified: head/include/rpc/auth_unix.h ============================================================================== --- head/include/rpc/auth_unix.h Fri Aug 31 23:28:41 2012 (r239962) +++ head/include/rpc/auth_unix.h Sat Sep 1 02:56:17 2012 (r239963) @@ -60,10 +60,10 @@ struct authunix_parms { u_long aup_time; char *aup_machname; - int aup_uid; - int aup_gid; + uid_t aup_uid; + gid_t aup_gid; u_int aup_len; - int *aup_gids; + gid_t *aup_gids; }; #define authsys_parms authunix_parms Modified: head/lib/libc/rpc/auth_unix.c ============================================================================== --- head/lib/libc/rpc/auth_unix.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/auth_unix.c Sat Sep 1 02:56:17 2012 (r239963) @@ -94,10 +94,10 @@ struct audata { AUTH * authunix_create(machname, uid, gid, len, aup_gids) char *machname; - int uid; - int gid; + uid_t uid; + gid_t gid; int len; - int *aup_gids; + gid_t *aup_gids; { struct authunix_parms aup; char mymem[MAX_AUTH_BYTES]; @@ -207,9 +207,7 @@ authunix_create_default() abort(); if (ngids > NGRPS) ngids = NGRPS; - /* XXX: interface problem; those should all have been unsigned */ - auth = authunix_create(machname, (int)uid, (int)gid, ngids, - (int *)gids); + auth = authunix_create(machname, uid, gid, ngids, gids); free(gids); return (auth); } Modified: head/lib/libc/rpc/authunix_prot.c ============================================================================== --- head/lib/libc/rpc/authunix_prot.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/authunix_prot.c Sat Sep 1 02:56:17 2012 (r239963) @@ -60,7 +60,7 @@ xdr_authunix_parms(xdrs, p) XDR *xdrs; struct authunix_parms *p; { - int **paup_gids; + gid_t **paup_gids; assert(xdrs != NULL); assert(p != NULL); @@ -69,8 +69,8 @@ xdr_authunix_parms(xdrs, p) if (xdr_u_long(xdrs, &(p->aup_time)) && xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME) - && xdr_int(xdrs, &(p->aup_uid)) - && xdr_int(xdrs, &(p->aup_gid)) + && xdr_u_int(xdrs, &(p->aup_uid)) + && xdr_u_int(xdrs, &(p->aup_gid)) && xdr_array(xdrs, (char **) paup_gids, &(p->aup_len), NGRPS, sizeof(int), (xdrproc_t)xdr_int) ) { return (TRUE); Modified: head/lib/libc/rpc/clnt_perror.c ============================================================================== --- head/lib/libc/rpc/clnt_perror.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/clnt_perror.c Sat Sep 1 02:56:17 2012 (r239963) @@ -242,7 +242,7 @@ char * clnt_spcreateerror(s) const char *s; { - char *str; + char *str, *err; size_t len, i; assert(s != NULL); @@ -258,8 +258,21 @@ clnt_spcreateerror(s) switch (rpc_createerr.cf_stat) { case RPC_PMAPFAILURE: (void) strncat(str, " - ", len - 1); - (void) strncat(str, - clnt_sperrno(rpc_createerr.cf_error.re_status), len - 4); + err = clnt_sperrno(rpc_createerr.cf_error.re_status); + if (err) + (void) strncat(str, err+5, len-5); + switch(rpc_createerr.cf_error.re_status) { + case RPC_CANTSEND: + case RPC_CANTRECV: + i = strlen(str); + len -= i; + snprintf(str+i, len, ": errno %d (%s)", + rpc_createerr.cf_error.re_errno, + strerror(rpc_createerr.cf_error.re_errno)); + break; + default: + break; + } break; case RPC_SYSTEMERROR: Modified: head/lib/libc/rpc/clnt_vc.c ============================================================================== --- head/lib/libc/rpc/clnt_vc.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/clnt_vc.c Sat Sep 1 02:56:17 2012 (r239963) @@ -672,6 +672,10 @@ clnt_vc_destroy(cl) if (ct->ct_addr.buf) free(ct->ct_addr.buf); mem_free(ct, sizeof(struct ct_data)); + if (cl->cl_netid && cl->cl_netid[0]) + mem_free(cl->cl_netid, strlen(cl->cl_netid) +1); + if (cl->cl_tp && cl->cl_tp[0]) + mem_free(cl->cl_tp, strlen(cl->cl_tp) +1); mem_free(cl, sizeof(CLIENT)); mutex_unlock(&clnt_fd_lock); thr_sigsetmask(SIG_SETMASK, &(mask), NULL); Modified: head/lib/libc/rpc/rpc_generic.c ============================================================================== --- head/lib/libc/rpc/rpc_generic.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/rpc_generic.c Sat Sep 1 02:56:17 2012 (r239963) @@ -269,7 +269,8 @@ __rpc_getconfip(nettype) } while ((nconf = getnetconfig(confighandle)) != NULL) { if (strcmp(nconf->nc_protofmly, NC_INET) == 0) { - if (strcmp(nconf->nc_proto, NC_TCP) == 0) { + if (strcmp(nconf->nc_proto, NC_TCP) == 0 && + netid_tcp == NULL) { netid_tcp = strdup(nconf->nc_netid); if (main_thread) netid_tcp_main = netid_tcp; @@ -277,7 +278,8 @@ __rpc_getconfip(nettype) thr_setspecific(tcp_key, (void *) netid_tcp); } else - if (strcmp(nconf->nc_proto, NC_UDP) == 0) { + if (strcmp(nconf->nc_proto, NC_UDP) == 0 && + netid_udp == NULL) { netid_udp = strdup(nconf->nc_netid); if (main_thread) netid_udp_main = netid_udp; @@ -616,6 +618,9 @@ __rpc_taddr2uaddr_af(int af, const struc #endif u_int16_t port; + if (nbuf->len <= 0) + return NULL; + switch (af) { case AF_INET: sin = nbuf->buf; Modified: head/lib/libc/rpc/rpc_soc.3 ============================================================================== --- head/lib/libc/rpc/rpc_soc.3 Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/rpc_soc.3 Sat Sep 1 02:56:17 2012 (r239963) @@ -148,7 +148,7 @@ default authentication used by .Ft "AUTH *" .Xc .It Xo -.Fn authunix_create "char *host" "int uid" "int gid" "int len" "int *aup_gids" +.Fn authunix_create "char *host" "uid_t uid" "gid_t gid" "int len" "gid_t *aup_gids" .Xc .Pp Create and return an Modified: head/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- head/lib/libc/rpc/rpcb_clnt.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/rpcb_clnt.c Sat Sep 1 02:56:17 2012 (r239963) @@ -770,6 +770,13 @@ __rpcb_findaddr_timed(program, version, } parms.r_addr = NULL; + parms.r_netid = nconf->nc_netid; + + /* + * According to wire captures, the reference implementation + * (OpenSolaris) sends a blank string here too. + */ + parms.r_owner = ""; /* * Use default total timeout if no timeout is specified. Modified: head/lib/libc/rpc/svc_auth_unix.c ============================================================================== --- head/lib/libc/rpc/svc_auth_unix.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/svc_auth_unix.c Sat Sep 1 02:56:17 2012 (r239963) @@ -68,7 +68,7 @@ _svcauth_unix(rqst, msg) struct area { struct authunix_parms area_aup; char area_machname[MAX_MACHINE_NAME+1]; - int area_gids[NGRPS]; + gid_t area_gids[NGRPS]; } *area; u_int auth_len; size_t str_len, gid_len; Modified: head/lib/libc/rpc/svc_run.c ============================================================================== --- head/lib/libc/rpc/svc_run.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/lib/libc/rpc/svc_run.c Sat Sep 1 02:56:17 2012 (r239963) @@ -60,14 +60,13 @@ svc_run() fd_set readfds, cleanfds; struct timeval timeout; - timeout.tv_sec = 30; - timeout.tv_usec = 0; - for (;;) { rwlock_rdlock(&svc_fd_lock); readfds = svc_fdset; cleanfds = svc_fdset; rwlock_unlock(&svc_fd_lock); + timeout.tv_sec = 30; + timeout.tv_usec = 0; switch (_select(svc_maxfd+1, &readfds, NULL, NULL, &timeout)) { case -1: FD_ZERO(&readfds); Modified: head/sys/rpc/auth.h ============================================================================== --- head/sys/rpc/auth.h Fri Aug 31 23:28:41 2012 (r239962) +++ head/sys/rpc/auth.h Sat Sep 1 02:56:17 2012 (r239963) @@ -234,18 +234,17 @@ __END_DECLS * System style authentication * AUTH *authunix_create(machname, uid, gid, len, aup_gids) * char *machname; - * int uid; - * int gid; + * uid_t uid; + * gid_t gid; * int len; - * int *aup_gids; + * gid_t *aup_gids; */ __BEGIN_DECLS #ifdef _KERNEL struct ucred; extern AUTH *authunix_create(struct ucred *); #else -extern AUTH *authunix_create(char *, int, int, int, - int *); +extern AUTH *authunix_create(char *, uid_t, gid_t, int, gid_t *); extern AUTH *authunix_create_default(void); /* takes no parameters */ #endif extern AUTH *authnone_create(void); /* takes no parameters */ Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/sys/rpc/clnt_vc.c Sat Sep 1 02:56:17 2012 (r239963) @@ -836,6 +836,10 @@ clnt_vc_destroy(CLIENT *cl) soclose(so); } mem_free(ct, sizeof(struct ct_data)); + if (cl->cl_netid && cl->cl_netid[0]) + mem_free(cl->cl_netid, strlen(cl->cl_netid) +1); + if (cl->cl_tp && cl->cl_tp[0]) + mem_free(cl->cl_tp, strlen(cl->cl_tp) +1); mem_free(cl, sizeof(CLIENT)); } Modified: head/sys/rpc/rpcb_clnt.c ============================================================================== --- head/sys/rpc/rpcb_clnt.c Fri Aug 31 23:28:41 2012 (r239962) +++ head/sys/rpc/rpcb_clnt.c Sat Sep 1 02:56:17 2012 (r239963) @@ -780,6 +780,13 @@ __rpcb_findaddr_timed(program, version, } parms.r_addr = NULL; + parms.r_netid = nconf->nc_netid; + + /* + * According to wire captures, the reference implementation + * (OpenSolaris) sends a blank string here too. + */ + parms.r_owner = ""; /* * Use default total timeout if no timeout is specified. From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 03:46:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20D271065673; Sat, 1 Sep 2012 03:46:29 +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 0B3138FC0C; Sat, 1 Sep 2012 03:46: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 q813kSvo043880; Sat, 1 Sep 2012 03:46:28 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q813kSqJ043876; Sat, 1 Sep 2012 03:46:28 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209010346.q813kSqJ043876@svn.freebsd.org> From: Alan Cox Date: Sat, 1 Sep 2012 03: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: r239964 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 03:46:29 -0000 Author: alc Date: Sat Sep 1 03:46:28 2012 New Revision: 239964 URL: http://svn.freebsd.org/changeset/base/239964 Log: Introduce a new software PTE flag that indicates whether the mapping is for a managed page. Tested by: jchandra Modified: head/sys/mips/include/pmap.h head/sys/mips/include/pte.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Sat Sep 1 02:56:17 2012 (r239963) +++ head/sys/mips/include/pmap.h Sat Sep 1 03:46:28 2012 (r239964) @@ -171,7 +171,6 @@ void pmap_bootstrap(void); void *pmap_mapdev(vm_paddr_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); vm_offset_t pmap_steal_memory(vm_size_t size); -int page_is_managed(vm_paddr_t pa); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr); void pmap_kremove(vm_offset_t va); Modified: head/sys/mips/include/pte.h ============================================================================== --- head/sys/mips/include/pte.h Sat Sep 1 02:56:17 2012 (r239963) +++ head/sys/mips/include/pte.h Sat Sep 1 03:46:28 2012 (r239964) @@ -57,8 +57,8 @@ typedef pt_entry_t *pd_entry_t; /* * PFN for EntryLo register. Upper bits are 0, which is to say that - * bit 29 is the last hardware bit; Bits 30 and upwards (EntryLo is - * 64 bit though it can be referred to in 32-bits providing 2 software + * bit 28 is the last hardware bit; Bits 29 and upwards (EntryLo is + * 64 bit though it can be referred to in 32-bits providing 3 software * bits safely. We use it as 64 bits to get many software bits, and * god knows what else.) are unacknowledged by hardware. They may be * written as anything, but otherwise they have as much meaning as @@ -68,11 +68,11 @@ typedef pt_entry_t *pd_entry_t; #define TLBLO_SWBITS_SHIFT (34) #define TLBLO_PFN_MASK 0x3FFFFFFC0ULL #else -#define TLBLO_SWBITS_SHIFT (30) -#define TLBLO_PFN_MASK (0x3FFFFFC0) +#define TLBLO_SWBITS_SHIFT (29) +#define TLBLO_PFN_MASK (0x1FFFFFC0) #endif #define TLBLO_PFN_SHIFT (6) -#define TLBLO_SWBITS_MASK ((pt_entry_t)0x3 << TLBLO_SWBITS_SHIFT) +#define TLBLO_SWBITS_MASK ((pt_entry_t)0x7 << TLBLO_SWBITS_SHIFT) #define TLBLO_PA_TO_PFN(pa) ((((pa) >> TLB_PAGE_SHIFT) << TLBLO_PFN_SHIFT) & TLBLO_PFN_MASK) #define TLBLO_PFN_TO_PA(pfn) ((vm_paddr_t)((pfn) >> TLBLO_PFN_SHIFT) << TLB_PAGE_SHIFT) #define TLBLO_PTE_TO_PFN(pte) ((pte) & TLBLO_PFN_MASK) @@ -132,9 +132,11 @@ typedef pt_entry_t *pd_entry_t; * RO: Read only. Never set PTE_D on this page, and don't * listen to requests to write to it. * W: Wired. ??? + * MANAGED:Managed. This PTE maps a managed page. */ #define PTE_RO ((pt_entry_t)0x01 << TLBLO_SWBITS_SHIFT) #define PTE_W ((pt_entry_t)0x02 << TLBLO_SWBITS_SHIFT) +#define PTE_MANAGED ((pt_entry_t)0x04 << TLBLO_SWBITS_SHIFT) /* * PTE management functions for bits defined above. @@ -160,7 +162,7 @@ typedef pt_entry_t *pd_entry_t; #define PTESIZE 4 #define PTE_L lw #define PTE_MTC0 mtc0 -#define CLEAR_PTE_SWBITS(r) sll r, 2; srl r, 2 /* remove 2 high bits */ +#define CLEAR_PTE_SWBITS(r) sll r, 3; srl r, 3 /* remove 3 high bits */ #endif /* defined(__mips_n64) || defined(__mips_n32) */ #if defined(__mips_n64) Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Sep 1 02:56:17 2012 (r239963) +++ head/sys/mips/mips/pmap.c Sat Sep 1 03:46:28 2012 (r239964) @@ -1691,9 +1691,9 @@ pmap_remove_pte(struct pmap *pmap, pt_en pmap->pm_stats.wired_count -= 1; pmap->pm_stats.resident_count -= 1; - pa = TLBLO_PTE_TO_PA(oldpte); - if (page_is_managed(pa)) { + if (pte_test(&oldpte, PTE_MANAGED)) { + pa = TLBLO_PTE_TO_PA(oldpte); m = PHYS_TO_VM_PAGE(pa); if (pte_test(&oldpte, PTE_D)) { KASSERT(!pte_test(&oldpte, PTE_RO), @@ -1930,8 +1930,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv if (!pte_test(pte, PTE_V)) continue; pbits = *pte; - pa = TLBLO_PTE_TO_PA(pbits); - if (page_is_managed(pa) && pte_test(&pbits, PTE_D)) { + if (pte_test(&pbits, PTE_MANAGED | PTE_D)) { + pa = TLBLO_PTE_TO_PA(pbits); m = PHYS_TO_VM_PAGE(pa); vm_page_dirty(m); } @@ -1975,6 +1975,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, KASSERT(va <= VM_MAX_KERNEL_ADDRESS, ("pmap_enter: toobig")); KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0, ("pmap_enter: page %p is not busy", m)); + pa = VM_PAGE_TO_PHYS(m); + newpte = TLBLO_PA_TO_PFN(pa) | PTE_V; mpte = NULL; @@ -1997,7 +1999,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, panic("pmap_enter: invalid page directory, pdir=%p, va=%p", (void *)pmap->pm_segtab, (void *)va); } - pa = VM_PAGE_TO_PHYS(m); om = NULL; origpte = *pte; opa = TLBLO_PTE_TO_PA(origpte); @@ -2027,8 +2028,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (mpte) mpte->wire_count--; - if (page_is_managed(opa)) { + if (pte_test(&origpte, PTE_MANAGED)) { om = m; + newpte |= PTE_MANAGED; } goto validate; } @@ -2043,7 +2045,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (pte_test(&origpte, PTE_W)) pmap->pm_stats.wired_count--; - if (page_is_managed(opa)) { + if (pte_test(&origpte, PTE_MANAGED)) { om = PHYS_TO_VM_PAGE(opa); pv = pmap_pvh_remove(&om->md, pmap, va); } @@ -2068,6 +2070,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pv = get_pv_entry(pmap, FALSE); pv->pv_va = va; TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); + newpte |= PTE_MANAGED; } else if (pv != NULL) free_pv_entry(pmap, pv); @@ -2088,7 +2091,7 @@ validate: /* * Now validate mapping with desired protection/wiring. */ - newpte = TLBLO_PA_TO_PFN(pa) | rw | PTE_V; + newpte |= rw; if (is_cacheable_mem(pa)) newpte |= PTE_C_CACHE; @@ -2108,7 +2111,7 @@ validate: if (origpte != newpte) { if (pte_test(&origpte, PTE_V)) { *pte = newpte; - if (page_is_managed(opa) && (opa != pa)) { + if (pte_test(&origpte, PTE_MANAGED) && opa != pa) { if (om->md.pv_flags & PV_TABLE_REF) vm_page_aflag_set(om, PGA_REFERENCED); om->md.pv_flags &= ~PV_TABLE_REF; @@ -2117,10 +2120,10 @@ validate: KASSERT(!pte_test(&origpte, PTE_RO), ("pmap_enter: modified page not writable:" " va: %p, pte: %#jx", (void *)va, (uintmax_t)origpte)); - if (page_is_managed(opa)) + if (pte_test(&origpte, PTE_MANAGED)) vm_page_dirty(om); } - if (page_is_managed(opa) && + if (pte_test(&origpte, PTE_MANAGED) && TAILQ_EMPTY(&om->md.pv_list)) vm_page_aflag_clear(om, PGA_WRITEABLE); } else { @@ -2247,6 +2250,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ * Now validate mapping with RO protection */ *pte = TLBLO_PA_TO_PFN(pa) | PTE_V; + if ((m->oflags & VPO_UNMANAGED) == 0) + *pte |= PTE_MANAGED; if (is_cacheable_mem(pa)) *pte |= PTE_C_CACHE; @@ -2982,7 +2987,6 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad vm_paddr_t pa; vm_page_t m; int val; - boolean_t managed; PMAP_LOCK(pmap); retry: @@ -2996,8 +3000,7 @@ retry: if (pte_test(&pte, PTE_D)) val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; pa = TLBLO_PTE_TO_PA(pte); - managed = page_is_managed(pa); - if (managed) { + if (pte_test(&pte, PTE_MANAGED)) { /* * This may falsely report the given address as * MINCORE_REFERENCED. Unfortunately, due to the lack of @@ -3009,7 +3012,8 @@ retry: val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; } if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != - (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && managed) { + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && + pte_test(&pte, PTE_MANAGED)) { /* Ensure that "PHYS_TO_VM_PAGE(pa)->object" doesn't change. */ if (vm_page_pa_tryrelock(pmap, pa, locked_pa)) goto retry; @@ -3232,23 +3236,6 @@ pmap_asid_alloc(pmap) } } -int -page_is_managed(vm_paddr_t pa) -{ - vm_offset_t pgnum = atop(pa); - - if (pgnum >= first_page) { - vm_page_t m; - - m = PHYS_TO_VM_PAGE(pa); - if (m == NULL) - return (0); - if ((m->oflags & VPO_UNMANAGED) == 0) - return (1); - } - return (0); -} - static pt_entry_t init_pte_prot(vm_page_t m, vm_prot_t access, vm_prot_t prot) { @@ -3305,9 +3292,9 @@ pmap_emulate_modified(pmap_t pmap, vm_of } pte_set(pte, PTE_D); tlb_update(pmap, va, *pte); - pa = TLBLO_PTE_TO_PA(*pte); - if (!page_is_managed(pa)) + if (!pte_test(pte, PTE_MANAGED)) panic("pmap_emulate_modified: unmanaged page"); + pa = TLBLO_PTE_TO_PA(*pte); m = PHYS_TO_VM_PAGE(pa); m->md.pv_flags |= PV_TABLE_REF; PMAP_UNLOCK(pmap); From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 05:43:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1324A10656D4; Sat, 1 Sep 2012 05:43:31 +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 D916C8FC0C; Sat, 1 Sep 2012 05:43: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 q815hUAt056696; Sat, 1 Sep 2012 05:43:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q815hUB0056694; Sat, 1 Sep 2012 05:43:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209010543.q815hUB0056694@svn.freebsd.org> From: Adrian Chadd Date: Sat, 1 Sep 2012 05:43: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: r239966 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 05:43:31 -0000 Author: adrian Date: Sat Sep 1 05:43:30 2012 New Revision: 239966 URL: http://svn.freebsd.org/changeset/base/239966 Log: Fix the PHY / CRC error bug in the AR5212 HAL, which apparently also pops up on (at least) the AR5413. The 30 second summary - if a CRC error frame comes in during PHY error processing, that CRC bit will be set for all subsequent frames until a non-CRC error frame is processed. So to allow for accurate PHY error processing (Radar, and ANI on the AR5212 HAL chips) just tag the frame as being both CRC and PHY - let the driver decide what to do with it. PR: kern/169362 Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c Sat Sep 1 05:35:48 2012 (r239965) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c Sat Sep 1 05:43:30 2012 (r239966) @@ -276,6 +276,14 @@ ar5212ProcRxDesc(struct ath_hal *ah, str rs->rs_antenna = MS(ads->ds_rxstatus0, AR_RcvAntenna); rs->rs_more = (ads->ds_rxstatus0 & AR_More) ? 1 : 0; + /* + * The AR5413 (at least) sometimes sets both AR_CRCErr and + * AR_PHYErr when reporting radar pulses. In this instance + * set HAL_RXERR_PHY as well as HAL_RXERR_CRC and + * let the driver layer figure out what to do. + * + * See PR kern/169362. + */ if ((ads->ds_rxstatus1 & AR_FrmRcvOK) == 0) { /* * These four bits should not be set together. The @@ -286,9 +294,7 @@ ar5212ProcRxDesc(struct ath_hal *ah, str * Consequently we filter them out here so we don't * confuse and/or complicate drivers. */ - if (ads->ds_rxstatus1 & AR_CRCErr) - rs->rs_status |= HAL_RXERR_CRC; - else if (ads->ds_rxstatus1 & AR_PHYErr) { + if (ads->ds_rxstatus1 & AR_PHYErr) { u_int phyerr; rs->rs_status |= HAL_RXERR_PHY; @@ -297,7 +303,11 @@ ar5212ProcRxDesc(struct ath_hal *ah, str if (!AH5212(ah)->ah_hasHwPhyCounters && phyerr != HAL_PHYERR_RADAR) ar5212AniPhyErrReport(ah, rs); - } else if (ads->ds_rxstatus1 & AR_DecryptCRCErr) + } + + if (ads->ds_rxstatus1 & AR_CRCErr) + rs->rs_status |= HAL_RXERR_CRC; + else if (ads->ds_rxstatus1 & AR_DecryptCRCErr) rs->rs_status |= HAL_RXERR_DECRYPT; else if (ads->ds_rxstatus1 & AR_MichaelErr) rs->rs_status |= HAL_RXERR_MIC; From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 06:07:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5991510657CE; Sat, 1 Sep 2012 06:07:28 +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 44F7D8FC1A; Sat, 1 Sep 2012 06:07:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8167SJ3059432; Sat, 1 Sep 2012 06:07:28 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8167S8h059430; Sat, 1 Sep 2012 06:07:28 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209010607.q8167S8h059430@svn.freebsd.org> From: Joel Dahl Date: Sat, 1 Sep 2012 06:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239967 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 06:07:28 -0000 Author: joel (doc committer) Date: Sat Sep 1 06:07:27 2012 New Revision: 239967 URL: http://svn.freebsd.org/changeset/base/239967 Log: Mdoc fixes. Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Sep 1 05:43:30 2012 (r239966) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Sep 1 06:07:27 2012 (r239967) @@ -56,8 +56,8 @@ .Op Fl dnpRrv .Sm off .Ar snapshot -.Ns Op % Ns Ar snapname -.Ns Op , Ns Ar ... +.Op % Ns Ar snapname +.Op , Ns Ar ... .Sm on .Nm .Cm snapshot @@ -1496,8 +1496,8 @@ behavior for mounted file systems in use .Op Fl dnpRrv .Sm off .Ar snapshot -.Ns Op % Ns Ar snapname -.Ns Op , Ns Ar ... +.Op % Ns Ar snapname +.Op , Ns Ar ... .Sm on .Xc .Pp @@ -2472,10 +2472,10 @@ subcommand or change a property. The following permissions are available: .Bl -column -offset 4n "secondarycache" "subcommand" .It NAME Ta TYPE Ta NOTES -.It Xo allow Ta subcommand Ta Must +.It allow Ta subcommand Ta Must Xo also have the permission that is being allowed .Xc -.It Xo clone Ta subcommand Ta Must +.It clone Ta subcommand Ta Must Xo also have the 'create' ability and 'mount' ability in the origin file system .Xc .It create Ta subcommand Ta Must also have the 'mount' ability @@ -2484,14 +2484,14 @@ also have the 'create' ability and 'moun object number, and the ability to create snapshots necessary to 'zfs diff' .It hold Ta subcommand Ta Allows adding a user hold to a snapshot .It mount Ta subcommand Ta Allows mount/umount of Tn ZFS No datasets -.It Xo promote Ta subcommand Ta Must +.It promote Ta subcommand Ta Must Xo also have the 'mount' and 'promote' ability in the origin file system .Xc .It receive Ta subcommand Ta Must also have the 'mount' and 'create' ability -.It Xo release Ta subcommand Ta Allows +.It release Ta subcommand Ta Allows Xo releasing a user hold which might destroy the snapshot .Xc -.It Xo rename Ta subcommand Ta Must +.It rename Ta subcommand Ta Must Xo also have the 'mount' and 'create' ability in the new parent .Xc .It rollback Ta subcommand Ta Must also have the 'mount' ability @@ -2507,7 +2507,6 @@ protocol .It userprop Ta other Ta Allows changing any user property .It userquota Ta other Ta Allows accessing any userquota@... property .It userused Ta other Ta Allows reading any userused@... property -.It Ta .It aclinherit Ta property .It aclmode Ta property .It atime Ta property @@ -2705,7 +2704,6 @@ Display an indication of the type of fil .Fl F option of .Xr ls 1 . -.Pp .Bl -column -offset 2n indent .It \&B Ta block device .It \&C Ta character device @@ -2757,6 +2755,16 @@ Detaches the specified from the jail identified by JID .Ar jailid . .El +.Sh EXIT STATUS +The following exit values are returned: +.Bl -tag -offset 2n -width 2n +.It 0 +Successful completion. +.It 1 +An error occurred. +.It 2 +Invalid command line options were specified. +.El .Sh EXAMPLES .Bl -tag -width 0n .It Sy Example 1 No Creating a Tn ZFS No File System Hierarchy @@ -3179,7 +3187,6 @@ The following example shows how to see w snapshot of a ZFS Dataset and its current state. The .Fl F option is used to indicate type information for the files affected. -.Pp .Bd -literal -offset 2n .Li # Ic zfs diff tank/test@before tank/test M / /tank/test/ @@ -3190,16 +3197,6 @@ R F /tank/test/oldname -> /t M F /tank/test/modified .Ed .El -.Sh EXIT STATUS -The following exit values are returned: -.Bl -tag -offset 2n -width 2n -.It 0 -Successful completion. -.It 1 -An error occurred. -.It 2 -Invalid command line options were specified. -.El .Sh SEE ALSO .Xr chmod 2 , .Xr fsync 2 , From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 06:12:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D22E1065AFD; Sat, 1 Sep 2012 06:12:15 +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 718428FC19; Sat, 1 Sep 2012 06: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 q816CFss060041; Sat, 1 Sep 2012 06:12:15 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q816CFBC060037; Sat, 1 Sep 2012 06:12:15 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209010612.q816CFBC060037@svn.freebsd.org> From: Joel Dahl Date: Sat, 1 Sep 2012 06: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: r239968 - in head/cddl/contrib/opensolaris/cmd: zdb zfs zpool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 06:12:15 -0000 Author: joel (doc committer) Date: Sat Sep 1 06:12:14 2012 New Revision: 239968 URL: http://svn.freebsd.org/changeset/base/239968 Log: Remove trailing whitespace. Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sat Sep 1 06:07:27 2012 (r239967) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sat Sep 1 06:12:14 2012 (r239968) @@ -135,7 +135,7 @@ option is also specified, also display t .It Fl L Disable leak tracing and the loading of space maps. By default, -.Nm +.Nm verifies that all non-free blocks are referenced, which can be very expensive. .It Fl m Display the offset, spacemap, and free space of each metaslab. @@ -272,7 +272,7 @@ Dataset rpool/export/home [ZPL], ID 137, .Li # Ic zdb -S rpool Simulated DDT histogram: -bucket allocated referenced +bucket allocated referenced ______ ______________________________ ______________________________ refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE ------ ------ ----- ----- ----- ------ ----- ----- ----- Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Sep 1 06:07:27 2012 (r239967) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Sep 1 06:12:14 2012 (r239968) @@ -624,7 +624,7 @@ privilege with .Qq Nm Cm allow , can access everyone's usage. .Pp -The +The .Sy userused@ Ns ... properties are not displayed by .Qq Nm Cm get all . @@ -1134,7 +1134,7 @@ will not use configured pool log devices will instead optimize synchronous operations for global pool throughput and efficient use of resources. .It Sy snapdir Ns = Ns Cm hidden | visible -Controls whether the +Controls whether the .Pa \&.zfs directory is hidden or visible in the root of the file system as discussed in the @@ -1201,7 +1201,7 @@ are not reflected in the reservation. The .Sy vscan property is currently not supported on -.Fx . +.Fx . .It Sy xattr Ns = Ns Cm off | on The .Sy xattr @@ -1288,7 +1288,7 @@ properties. The correlation between prop In addition, these options can be set on a per-mount basis using the .Fl o option, without affecting the property that is stored on disk. The values -specified on the command line override the values stored in the dataset. These +specified on the command line override the values stored in the dataset. These properties are reported as "temporary" by the .Qq Nm Cm get command. If the properties are changed while the dataset is mounted, the new @@ -1327,7 +1327,7 @@ domain name for the .Ar module component of property names to reduce the chance that two independently-developed packages use the same property name for different -purposes. Property names beginning with +purposes. Property names beginning with .Em com.sun are reserved for use by Sun Microsystems. .Pp @@ -2216,7 +2216,7 @@ and it is assumed to be from the same fi .Ar snapshot . .Pp If the destination is a clone, the source may be the origin snapshot, which -must be fully specified (for example, +must be fully specified (for example, .Cm pool/fs@origin , not just .Cm @origin ) . @@ -2830,7 +2830,7 @@ Snapshots are displayed if the .Sy listsnaps property is .Cm on . -The default is +The default is .Cm off . See .Xr zpool 8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Sep 1 06:07:27 2012 (r239967) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Sep 1 06:12:14 2012 (r239968) @@ -731,7 +731,7 @@ The current on-disk version of the pool. decreased. The preferred method of updating pools is with the .Qq Nm Cm upgrade command, though this property can be used when a specific version is needed -for backwards compatibility. +for backwards compatibility. Once feature flags is enabled on a pool this property will no longer have a value. .El From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 06:23:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D904A106566B; Sat, 1 Sep 2012 06:23:13 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C38378FC1B; Sat, 1 Sep 2012 06:23:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q816NDS4061357; Sat, 1 Sep 2012 06:23:13 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q816NDn3061353; Sat, 1 Sep 2012 06:23:13 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209010623.q816NDn3061353@svn.freebsd.org> From: Joel Dahl Date: Sat, 1 Sep 2012 06:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239969 - in head/cddl: usr.bin/ctfconvert usr.bin/ctfmerge usr.sbin/dtruss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 06:23:14 -0000 Author: joel (doc committer) Date: Sat Sep 1 06:23:13 2012 New Revision: 239969 URL: http://svn.freebsd.org/changeset/base/239969 Log: Remove trailing whitespace. Modified: head/cddl/usr.bin/ctfconvert/ctfconvert.1 head/cddl/usr.bin/ctfmerge/ctfmerge.1 head/cddl/usr.sbin/dtruss/dtruss.1 Modified: head/cddl/usr.bin/ctfconvert/ctfconvert.1 ============================================================================== --- head/cddl/usr.bin/ctfconvert/ctfconvert.1 Sat Sep 1 06:12:14 2012 (r239968) +++ head/cddl/usr.bin/ctfconvert/ctfconvert.1 Sat Sep 1 06:23:13 2012 (r239969) @@ -74,7 +74,7 @@ Write the output to file in .Sh EXIT STATUS .Ex -std .Sh SEE ALSO -.Xr ctfmerge 1 , +.Xr ctfmerge 1 , .Xr ctfdump 1 .Sh HISTORY The Modified: head/cddl/usr.bin/ctfmerge/ctfmerge.1 ============================================================================== --- head/cddl/usr.bin/ctfmerge/ctfmerge.1 Sat Sep 1 06:12:14 2012 (r239968) +++ head/cddl/usr.bin/ctfmerge/ctfmerge.1 Sat Sep 1 06:23:13 2012 (r239969) @@ -32,7 +32,7 @@ .Dt CTFMERGE 1 .Os .Sh NAME -.Nm ctfmerge +.Nm ctfmerge .Nd merge several CTF data sections into one .Sh SYNOPSIS .Nm @@ -109,7 +109,7 @@ into .Sh EXIT STATUS .Ex -std .Sh SEE ALSO -.Xr ctfconvert 1 , +.Xr ctfconvert 1 , .Xr ctfdump 1 .Sh HISTORY The Modified: head/cddl/usr.sbin/dtruss/dtruss.1 ============================================================================== --- head/cddl/usr.sbin/dtruss/dtruss.1 Sat Sep 1 06:12:14 2012 (r239968) +++ head/cddl/usr.sbin/dtruss/dtruss.1 Sat Sep 1 06:23:13 2012 (r239969) @@ -32,7 +32,7 @@ .Dt DTRUSS 1 .Os .Sh NAME -.Nm dtruss +.Nm dtruss .Nd Trace system calls and userland stacks using DTrace .Sh SYNOPSIS .Nm @@ -79,7 +79,7 @@ Specify the DTrace buffer size. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO -.Xr dtrace 1 +.Xr dtrace 1 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 07:11:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6DA621065673; Sat, 1 Sep 2012 07:11:26 +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 593CA8FC0C; Sat, 1 Sep 2012 07:11: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 q817BQWC066940; Sat, 1 Sep 2012 07:11:26 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q817BQll066938; Sat, 1 Sep 2012 07:11:26 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209010711.q817BQll066938@svn.freebsd.org> From: Joel Dahl Date: Sat, 1 Sep 2012 07:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239970 - head/tools/tools/ath/athrd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 07:11:26 -0000 Author: joel (doc committer) Date: Sat Sep 1 07:11:25 2012 New Revision: 239970 URL: http://svn.freebsd.org/changeset/base/239970 Log: Minor mdoc fix. Modified: head/tools/tools/ath/athrd/athrd.1 Modified: head/tools/tools/ath/athrd/athrd.1 ============================================================================== --- head/tools/tools/ath/athrd/athrd.1 Sat Sep 1 06:23:13 2012 (r239969) +++ head/tools/tools/ath/athrd/athrd.1 Sat Sep 1 07:11:25 2012 (r239970) @@ -103,14 +103,12 @@ Display only Turbo channels. .Sh EXAMPLES The following demonstrates how to list the permissible frequencies and maximum transport power per channel for use in Spain: -.Pp -.nf -tubby% athrd es -\& +.Bd -literal -offset 2n +.Li # Ic athrd es SPAIN (ES, 0x2d4, 724) NULL1_WORLD (0x3, 3) 2412G 14.0 2417G 14.0 2422G 14.0 2427G 17.0 2432G 14.0 2437G 17.0 2442G 14.0 2447G 17.0 2452G 17.0 2457G 14.0 2462G 17.0 -.fi +.Ed .Pp Each frequency has a suffix that is one of: .Ql G , From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 07:35:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 68F7D106566B; Sat, 1 Sep 2012 07:35:17 +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 540E18FC0A; Sat, 1 Sep 2012 07:35: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 q817ZHpQ069651; Sat, 1 Sep 2012 07:35:17 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q817ZHmH069647; Sat, 1 Sep 2012 07:35:17 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209010735.q817ZHmH069647@svn.freebsd.org> From: Rui Paulo Date: Sat, 1 Sep 2012 07:35:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239971 - head/sys/modules/dtrace/dtraceall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 07:35:17 -0000 Author: rpaulo Date: Sat Sep 1 07:35:16 2012 New Revision: 239971 URL: http://svn.freebsd.org/changeset/base/239971 Log: The dtnfsclient module dependency should only be added if the old NFS client support was compiled in. Modified: head/sys/modules/dtrace/dtraceall/Makefile head/sys/modules/dtrace/dtraceall/dtraceall.c Modified: head/sys/modules/dtrace/dtraceall/Makefile ============================================================================== --- head/sys/modules/dtrace/dtraceall/Makefile Sat Sep 1 07:11:25 2012 (r239970) +++ head/sys/modules/dtrace/dtraceall/Makefile Sat Sep 1 07:35:16 2012 (r239971) @@ -1,7 +1,7 @@ # $FreeBSD$ KMOD= dtraceall -SRCS= dtraceall.c opt_compat.h +SRCS= dtraceall.c opt_compat.h opt_nfs.h CFLAGS+= -I${.CURDIR}/../../.. Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c ============================================================================== --- head/sys/modules/dtrace/dtraceall/dtraceall.c Sat Sep 1 07:11:25 2012 (r239970) +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Sat Sep 1 07:35:16 2012 (r239971) @@ -33,6 +33,7 @@ #include #include #include "opt_compat.h" +#include "opt_nfs.h" static int dtraceall_modevent(module_t mod __unused, int type, void *data __unused) @@ -68,7 +69,9 @@ MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1 MODULE_DEPEND(dtraceall, dtio, 1, 1, 1); MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1); MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); +#if defined(NFSCLIENT) MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1); +#endif #if defined(__amd64__) || defined(__i386__) MODULE_DEPEND(dtraceall, fbt, 1, 1, 1); MODULE_DEPEND(dtraceall, fasttrap, 1, 1, 1); From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 08:14:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA18B106564A; Sat, 1 Sep 2012 08:14:21 +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 A9DAE8FC0C; Sat, 1 Sep 2012 08:14: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 q818EL5L074162; Sat, 1 Sep 2012 08:14:21 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q818ELEH074159; Sat, 1 Sep 2012 08:14:21 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209010814.q818ELEH074159@svn.freebsd.org> From: Rui Paulo Date: Sat, 1 Sep 2012 08:14: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: r239972 - in head/cddl: contrib/dtracetoolkit lib/libdtrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 08:14:21 -0000 Author: rpaulo Date: Sat Sep 1 08:14:21 2012 New Revision: 239972 URL: http://svn.freebsd.org/changeset/base/239972 Log: Finish porting execsnoop to FreeBSD. This includes replacing the zonename with a jail ID and removing the project ID from the list of options. Modified: head/cddl/contrib/dtracetoolkit/execsnoop head/cddl/lib/libdtrace/psinfo.d Modified: head/cddl/contrib/dtracetoolkit/execsnoop ============================================================================== --- head/cddl/contrib/dtracetoolkit/execsnoop Sat Sep 1 07:35:16 2012 (r239971) +++ head/cddl/contrib/dtracetoolkit/execsnoop Sat Sep 1 08:14:21 2012 (r239972) @@ -5,21 +5,20 @@ # # $Id: execsnoop 3 2007-08-01 10:50:08Z brendan $ # -# USAGE: execsnoop [-a|-A|-ehjsvZ] [-c command] +# USAGE: execsnoop [-a|-A|-ehsvJ] [-c command] # # execsnoop # default output # # -a # print all data # -A # dump all data, space delimited # -e # safe output - parseable -# -j # print project ID # -s # print start time, us # -v # print start time, string -# -Z # print zonename +# -J # print jail ID # -c command # command name to snoop # eg, # execsnoop -v # human readable timestamps -# execsnoop -Z # print zonename +# execsnoop -J # print jail ID # execsnoop -c ls # snoop ls commands only # # The parseable output ensures that the ARGS field doesn't contain @@ -31,8 +30,7 @@ # PPID Parent Process ID # COMM command name for the process # ARGS argument listing for the process -# ZONE zonename -# PROJ project ID +# JAIL ID Jail ID # TIME timestamp for the command, us # STRTIME timestamp for the command, string # @@ -72,34 +70,32 @@ ### default variables opt_dump=0; opt_cmd=0; opt_time=0; opt_timestr=0; filter=0; command=. -opt_zone=0; opt_safe=0; opt_proj=0 +opt_jailid=0; opt_safe=0 ### process options -while getopts aAc:ehjsvZ name +while getopts aAc:ehsvJ name do case $name in - a) opt_time=1; opt_timestr=1; opt_zone=1; opt_proj=1 ;; + a) opt_time=1; opt_timestr=1; opt_jailid=1 ;; A) opt_dump=1 ;; c) opt_cmd=1; command=$OPTARG ;; e) opt_safe=1 ;; - j) opt_proj=1 ;; s) opt_time=1 ;; v) opt_timestr=1 ;; - Z) opt_zone=1 ;; + J) opt_jailid=1 ;; h|?) cat <<-END >&2 - USAGE: execsnoop [-a|-A|-ehjsvZ] [-c command] + USAGE: execsnoop [-a|-A|-ehjsvJ] [-c command] execsnoop # default output -a # print all data -A # dump all data, space delimited -e # safe output, parseable - -j # print project ID -s # print start time, us -v # print start time, string - -Z # print zonename + -J # print jail ID -c command # command name to snoop eg, execsnoop -v # human readable timestamps - execsnoop -Z # print zonename + execsnoop -J # print jail ID execsnoop -c ls # snoop ls commands only END exit 1 @@ -108,7 +104,7 @@ done ### option logic if [ $opt_dump -eq 1 ]; then - opt_time=0; opt_timestr=0; opt_zone=0; opt_proj=0 + opt_time=0; opt_timestr=0; opt_jailid=0 fi if [ $opt_cmd -eq 1 ]; then filter=1 @@ -126,9 +122,8 @@ fi inline int OPT_cmd = '$opt_cmd'; inline int OPT_time = '$opt_time'; inline int OPT_timestr = '$opt_timestr'; - inline int OPT_zone = '$opt_zone'; + inline int OPT_jailid = '$opt_jailid'; inline int OPT_safe = '$opt_safe'; - inline int OPT_proj = '$opt_proj'; inline int FILTER = '$filter'; inline string COMMAND = "'$command'"; @@ -143,12 +138,11 @@ fi /* print optional headers */ OPT_time ? printf("%-14s ", "TIME") : 1; OPT_timestr ? printf("%-20s ", "STRTIME") : 1; - OPT_zone ? printf("%-10s ", "ZONE") : 1; - OPT_proj ? printf("%5s ", "PROJ") : 1; + OPT_jailid ? printf("%-10s ", "JAIL ID") : 1; /* print main headers */ - OPT_dump ? printf("%s %s %s %s %s %s %s %s\n", - "TIME", "ZONE", "PROJ", "UID", "PID", "PPID", "COMM", "ARGS") : + OPT_dump ? printf("%s %s %s %s %s %s %s\n", + "TIME", "JAIL ID", "UID", "PID", "PPID", "COMM", "ARGS") : printf("%5s %6s %6s %s\n", "UID", "PID", "PPID", "ARGS"); } @@ -161,12 +155,11 @@ fi /* print optional fields */ OPT_time ? printf("%-14d ", timestamp/1000) : 1; OPT_timestr ? printf("%-20Y ", walltimestamp) : 1; - OPT_zone ? printf("%-10s ", zonename) : 1; - OPT_proj ? printf("%5d ", curpsinfo->pr_projid) : 1; + OPT_jailid ? printf("%-10d ", curpsinfo->pr_jailid) : 1; /* print main data */ - OPT_dump ? printf("%d %s %d %d %d %d %s ", timestamp/1000, - zonename, curpsinfo->pr_projid, uid, pid, ppid, execname) : + OPT_dump ? printf("%d %d %d %d %d %s ", timestamp/1000, + curpsinfo->pr_jailid, uid, pid, ppid, execname) : printf("%5d %6d %6d ", uid, pid, ppid); OPT_safe ? printf("%S\n", curpsinfo->pr_psargs) : printf("%s\n", curpsinfo->pr_psargs); Modified: head/cddl/lib/libdtrace/psinfo.d ============================================================================== --- head/cddl/lib/libdtrace/psinfo.d Sat Sep 1 07:35:16 2012 (r239971) +++ head/cddl/lib/libdtrace/psinfo.d Sat Sep 1 08:14:21 2012 (r239972) @@ -42,6 +42,7 @@ typedef struct psinfo { pr_addr; /* address of process */ string pr_psargs; /* process arguments */ u_int pr_arglen; /* process argument length */ + u_int pr_jailid; /* jail id */ } psinfo_t; #pragma D binding "1.0" translator @@ -58,6 +59,7 @@ translator psinfo_t < struct proc *T > { pr_addr = 0; pr_psargs = stringof(T->p_args->ar_args); pr_arglen = T->p_args->ar_length; + pr_jailid = T->p_ucred->cr_prison->pr_id; }; typedef struct lwpsinfo { From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 08:45:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D394106566B; Sat, 1 Sep 2012 08:45:20 +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 098308FC18; Sat, 1 Sep 2012 08: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 q818jJIR077830; Sat, 1 Sep 2012 08:45:19 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q818jJAc077828; Sat, 1 Sep 2012 08:45:19 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201209010845.q818jJAc077828@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Sep 2012 08:45: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: r239973 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 08:45:20 -0000 Author: ed Date: Sat Sep 1 08:45:19 2012 New Revision: 239973 URL: http://svn.freebsd.org/changeset/base/239973 Log: Fix whitespace. MFC after: 1 month Modified: head/sys/sys/time.h Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Sat Sep 1 08:14:21 2012 (r239972) +++ head/sys/sys/time.h Sat Sep 1 08:45:19 2012 (r239973) @@ -31,7 +31,7 @@ */ #ifndef _SYS_TIME_H_ -#define _SYS_TIME_H_ +#define _SYS_TIME_H_ #include #include @@ -137,7 +137,7 @@ timespec2bintime(const struct timespec * bt->sec = ts->tv_sec; /* 18446744073 = int(2^64 / 1000000000) */ - bt->frac = ts->tv_nsec * (uint64_t)18446744073LL; + bt->frac = ts->tv_nsec * (uint64_t)18446744073LL; } static __inline void @@ -167,7 +167,7 @@ timeval2bintime(const struct timeval *tv (((tvp)->tv_sec == (uvp)->tv_sec) ? \ ((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \ ((tvp)->tv_sec cmp (uvp)->tv_sec)) -#define timespecadd(vvp, uvp) \ +#define timespecadd(vvp, uvp) \ do { \ (vvp)->tv_sec += (uvp)->tv_sec; \ (vvp)->tv_nsec += (uvp)->tv_nsec; \ @@ -176,7 +176,7 @@ timeval2bintime(const struct timeval *tv (vvp)->tv_nsec -= 1000000000; \ } \ } while (0) -#define timespecsub(vvp, uvp) \ +#define timespecsub(vvp, uvp) \ do { \ (vvp)->tv_sec -= (uvp)->tv_sec; \ (vvp)->tv_nsec -= (uvp)->tv_nsec; \ @@ -207,7 +207,7 @@ timeval2bintime(const struct timeval *tv (((tvp)->tv_sec == (uvp)->tv_sec) ? \ ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ ((tvp)->tv_sec cmp (uvp)->tv_sec)) -#define timeradd(tvp, uvp, vvp) \ +#define timeradd(tvp, uvp, vvp) \ do { \ (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ @@ -216,7 +216,7 @@ timeval2bintime(const struct timeval *tv (vvp)->tv_usec -= 1000000; \ } \ } while (0) -#define timersub(tvp, uvp, vvp) \ +#define timersub(tvp, uvp, vvp) \ do { \ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ @@ -253,25 +253,25 @@ struct clockinfo { /* These macros are also in time.h. */ #ifndef CLOCK_REALTIME -#define CLOCK_REALTIME 0 -#define CLOCK_VIRTUAL 1 -#define CLOCK_PROF 2 -#define CLOCK_MONOTONIC 4 -#define CLOCK_UPTIME 5 /* FreeBSD-specific. */ -#define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */ -#define CLOCK_UPTIME_FAST 8 /* FreeBSD-specific. */ -#define CLOCK_REALTIME_PRECISE 9 /* FreeBSD-specific. */ -#define CLOCK_REALTIME_FAST 10 /* FreeBSD-specific. */ -#define CLOCK_MONOTONIC_PRECISE 11 /* FreeBSD-specific. */ -#define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */ -#define CLOCK_SECOND 13 /* FreeBSD-specific. */ -#define CLOCK_THREAD_CPUTIME_ID 14 -#define CLOCK_PROCESS_CPUTIME_ID 15 +#define CLOCK_REALTIME 0 +#define CLOCK_VIRTUAL 1 +#define CLOCK_PROF 2 +#define CLOCK_MONOTONIC 4 +#define CLOCK_UPTIME 5 /* FreeBSD-specific. */ +#define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */ +#define CLOCK_UPTIME_FAST 8 /* FreeBSD-specific. */ +#define CLOCK_REALTIME_PRECISE 9 /* FreeBSD-specific. */ +#define CLOCK_REALTIME_FAST 10 /* FreeBSD-specific. */ +#define CLOCK_MONOTONIC_PRECISE 11 /* FreeBSD-specific. */ +#define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */ +#define CLOCK_SECOND 13 /* FreeBSD-specific. */ +#define CLOCK_THREAD_CPUTIME_ID 14 +#define CLOCK_PROCESS_CPUTIME_ID 15 #endif #ifndef TIMER_ABSTIME -#define TIMER_RELTIME 0x0 /* relative timer */ -#define TIMER_ABSTIME 0x1 /* absolute timer */ +#define TIMER_RELTIME 0x0 /* relative timer */ +#define TIMER_ABSTIME 0x1 /* absolute timer */ #endif #if __BSD_VISIBLE @@ -301,7 +301,7 @@ extern struct timeval boottime; * "bin" == struct bintime == seconds + 64 bit fraction of seconds. * "nano" == struct timespec == seconds + nanoseconds. * "micro" == struct timeval == seconds + microseconds. - * + * * Functions containing "up" returns time relative to boot and * should be used for calculating time intervals. * @@ -310,8 +310,8 @@ extern struct timeval boottime; * Functions with the "get" prefix returns a less precise result * much faster than the functions without "get" prefix and should * be used where a precision of 1/hz seconds is acceptable or where - * performance is priority. (NB: "precision", _not_ "resolution" !) - * + * performance is priority. (NB: "precision", _not_ "resolution" !) + * */ void binuptime(struct bintime *bt); From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 08:45:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 622AF106566B; Sat, 1 Sep 2012 08:45:59 +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 4E0368FC08; Sat, 1 Sep 2012 08:45: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 q818jxv5077940; Sat, 1 Sep 2012 08:45:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q818jxxc077938; Sat, 1 Sep 2012 08:45:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201209010845.q818jxxc077938@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Sep 2012 08:45: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: r239974 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 08:45:59 -0000 Author: ed Date: Sat Sep 1 08:45:58 2012 New Revision: 239974 URL: http://svn.freebsd.org/changeset/base/239974 Log: While there, remove an unneeded blank line. MFC after: 1 month Modified: head/sys/sys/time.h Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Sat Sep 1 08:45:19 2012 (r239973) +++ head/sys/sys/time.h Sat Sep 1 08:45:58 2012 (r239974) @@ -311,7 +311,6 @@ extern struct timeval boottime; * much faster than the functions without "get" prefix and should * be used where a precision of 1/hz seconds is acceptable or where * performance is priority. (NB: "precision", _not_ "resolution" !) - * */ void binuptime(struct bintime *bt); From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 10:48:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5C2F106564A; Sat, 1 Sep 2012 10:48:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90A5D8FC0C; Sat, 1 Sep 2012 10:48: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 q81AmcmC096178; Sat, 1 Sep 2012 10:48:38 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81AmcQ0096175; Sat, 1 Sep 2012 10:48:38 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201209011048.q81AmcQ0096175@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Sep 2012 10:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239986 - head/usr.sbin/lmcconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:48:38 -0000 Author: ed Date: Sat Sep 1 10:48:38 2012 New Revision: 239986 URL: http://svn.freebsd.org/changeset/base/239986 Log: Remove unneeded struct timezone. We're only interested in a timestamp -- not the timezone. Modified: head/usr.sbin/lmcconfig/lmcconfig.c Modified: head/usr.sbin/lmcconfig/lmcconfig.c ============================================================================== --- head/usr.sbin/lmcconfig/lmcconfig.c Sat Sep 1 10:39:01 2012 (r239985) +++ head/usr.sbin/lmcconfig/lmcconfig.c Sat Sep 1 10:48:38 2012 (r239986) @@ -1076,9 +1076,8 @@ print_events(void) { char *time; struct timeval tv; - struct timezone tz; - gettimeofday(&tv, &tz); + gettimeofday(&tv, NULL); time = (char *)ctime((time_t *)&tv); printf("Current time:\t\t%s", time); if (status.cntrs.reset_time.tv_sec < 1000) From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 10:52:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCE8E1065676; Sat, 1 Sep 2012 10:52:19 +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 A89C58FC17; Sat, 1 Sep 2012 10:52: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 q81AqJxn096629; Sat, 1 Sep 2012 10:52:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81AqJqG096627; Sat, 1 Sep 2012 10:52:19 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209011052.q81AqJqG096627@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 1 Sep 2012 10:52: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: r239987 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:52:19 -0000 Author: pjd Date: Sat Sep 1 10:52:19 2012 New Revision: 239987 URL: http://svn.freebsd.org/changeset/base/239987 Log: Allow to pass providers with /dev/ prefix to g_provider_by_name(). MFC after: 3 days Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Sat Sep 1 10:48:38 2012 (r239986) +++ head/sys/geom/geom_subr.c Sat Sep 1 10:52:19 2012 (r239987) @@ -686,6 +686,10 @@ g_resize_provider(struct g_provider *pp, g_post_event(g_resize_provider_event, hh, M_WAITOK, NULL); } +#ifndef _PATH_DEV +#define _PATH_DEV "/dev/" +#endif + struct g_provider * g_provider_by_name(char const *arg) { @@ -693,6 +697,9 @@ g_provider_by_name(char const *arg) struct g_geom *gp; struct g_provider *pp; + if (strncmp(arg, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + arg += sizeof(_PATH_DEV) - 1; + LIST_FOREACH(cp, &g_classes, class) { LIST_FOREACH(gp, &cp->geom, geom) { LIST_FOREACH(pp, &gp->provider, provider) { @@ -701,6 +708,7 @@ g_provider_by_name(char const *arg) } } } + return (NULL); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 10:56:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E78AD106566B; Sat, 1 Sep 2012 10:56:15 +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 D28C78FC0C; Sat, 1 Sep 2012 10:56: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 q81AuFUA097114; Sat, 1 Sep 2012 10:56:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81AuFIs097112; Sat, 1 Sep 2012 10:56:15 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201209011056.q81AuFIs097112@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Sep 2012 10:56: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: r239988 - head/usr.sbin/lmcconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 10:56:16 -0000 Author: ed Date: Sat Sep 1 10:56:15 2012 New Revision: 239988 URL: http://svn.freebsd.org/changeset/base/239988 Log: Rework time handling. After I made the previous commit, I noticed the code does some things it shouldn't. It casts a struct timeval to a time_t, assuming tv_sec is the first member. Also, we are not interested in microseconds, so it is better to just call time(NULL). MFC after: 1 month Modified: head/usr.sbin/lmcconfig/lmcconfig.c Modified: head/usr.sbin/lmcconfig/lmcconfig.c ============================================================================== --- head/usr.sbin/lmcconfig/lmcconfig.c Sat Sep 1 10:52:19 2012 (r239987) +++ head/usr.sbin/lmcconfig/lmcconfig.c Sat Sep 1 10:56:15 2012 (r239988) @@ -1074,17 +1074,16 @@ print_hssi_sigs(void) static void print_events(void) { - char *time; - struct timeval tv; + const char *reset_time; + time_t now; - gettimeofday(&tv, NULL); - time = (char *)ctime((time_t *)&tv); - printf("Current time:\t\t%s", time); + now = time(NULL); + printf("Current time:\t\t%s", ctime(&now)); if (status.cntrs.reset_time.tv_sec < 1000) - time = "Never\n"; + reset_time = "Never\n"; else - time = (char *)ctime((time_t *)&status.cntrs.reset_time.tv_sec); - printf("Cntrs reset:\t\t%s", time); + reset_time = ctime(&status.cntrs.reset_time.tv_sec); + printf("Cntrs reset:\t\t%s", reset_time); if (status.cntrs.ibytes) printf("Rx bytes:\t\t%ju\n", (uintmax_t)status.cntrs.ibytes); if (status.cntrs.obytes) printf("Tx bytes:\t\t%ju\n", (uintmax_t)status.cntrs.obytes); From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 11:06:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEF19106566C; Sat, 1 Sep 2012 11:06:47 +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 6994D8FC0C; Sat, 1 Sep 2012 11:06:47 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:2c45:8400:d715:4c2a] (unknown [IPv6:2001:7b8:3a7:0:2c45:8400:d715:4c2a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E3B405C37; Sat, 1 Sep 2012 13:06:45 +0200 (CEST) Message-ID: <5041EC4B.5000501@FreeBSD.org> Date: Sat, 01 Sep 2012 13:06:51 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20120828 Thunderbird/16.0 MIME-Version: 1.0 To: Garrett Cooper References: <201208312328.q7VNSfLK012047@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: r239962 - head/contrib/binutils/binutils X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 11:06:47 -0000 On 2012-09-01 03:00, Garrett Cooper wrote: > On Fri, Aug 31, 2012 at 4:28 PM, Dimitry Andric wrote: >> Author: dim >> Date: Fri Aug 31 23:28:41 2012 >> New Revision: 239962 >> URL: http://svn.freebsd.org/changeset/base/239962 >> >> Log: >> Fix a twelve year old bug in readelf: when process_dynamic_segment() >> encounters a DT_RUNPATH entry, the global dynamic_info[] array is >> overrun, causing some other global variable to be overwritten. ... > Nice! Hopefully this fixes the random tinderbox crashes I've seen! Koop said it occurred semi-randomly during the openjdk7 port build. It apparently runs "readelf -d" on a whole bunch of produced libraries. So I hope those are now gone. :) > Has this been fixed upstream? Yes, in 2009: http://sourceware.org/git/?p=binutils.git;a=commitdiff;h=839d59b5c25836c05cc5abb401e0b5fe17a98981 From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 11:21:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A874106566B; Sat, 1 Sep 2012 11:21:57 +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 6C9A88FC1C; Sat, 1 Sep 2012 11:21: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 q81BLvj0000221; Sat, 1 Sep 2012 11:21:57 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81BLvxV000218; Sat, 1 Sep 2012 11:21:57 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209011121.q81BLvxV000218@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 1 Sep 2012 11:21: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: r239989 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 11:21:57 -0000 Author: pjd Date: Sat Sep 1 11:21:56 2012 New Revision: 239989 URL: http://svn.freebsd.org/changeset/base/239989 Log: Fix panic in procdesc that can be triggered in the following scenario: 1. Process A pdfork(2)s process B. 2. Process A passes process descriptor of B to unrelated process C. 3. Hit CTRL+C to terminate process A. Process B is also terminated with SIGINT. 4. init(8) collects status of process B. 5. Process C closes process descriptor associated with process B. When we have such order of events, init(8), by collecting status of process B, will call procdesc_reap(). This function sets pd_proc to NULL. Now when process C calls close on this process descriptor, procdesc_close() is called. Unfortunately procdesc_close() assumes that pd_proc points at a valid proc structure, but it was set to NULL earlier, so the kernel panics. The patch also adds setting 'p->p_procdesc' to NULL in procdesc_reap(), which I think should be done. MFC after: 1 week Modified: head/sys/kern/sys_procdesc.c Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Sat Sep 1 10:56:15 2012 (r239988) +++ head/sys/kern/sys_procdesc.c Sat Sep 1 11:21:56 2012 (r239989) @@ -333,6 +333,7 @@ procdesc_reap(struct proc *p) pd = p->p_procdesc; pd->pd_proc = NULL; + p->p_procdesc = NULL; procdesc_free(pd); } @@ -358,14 +359,20 @@ procdesc_close(struct file *fp, struct t pd->pd_flags |= PDF_CLOSED; PROCDESC_UNLOCK(pd); p = pd->pd_proc; - PROC_LOCK(p); - if (p->p_state == PRS_ZOMBIE) { + if (p == NULL) { + /* + * This is the case where process' exit status was already + * collected and procdesc_reap() was already called. + */ + sx_xunlock(&proctree_lock); + } else if (p->p_state == PRS_ZOMBIE) { /* * If the process is already dead and just awaiting reaping, * do that now. This will release the process's reference to * the process descriptor when it calls back into * procdesc_reap(). */ + PROC_LOCK(p); PROC_SLOCK(p); proc_reap(curthread, p, NULL, 0, NULL); } else { @@ -376,6 +383,7 @@ procdesc_close(struct file *fp, struct t * process from its descriptor so that its exit status will * be reported normally. */ + PROC_LOCK(p); pd->pd_proc = NULL; p->p_procdesc = NULL; procdesc_free(pd); From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 11:24:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D0951065670; Sat, 1 Sep 2012 11:24:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 570998FC14; Sat, 1 Sep 2012 11:24: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 q81BO3H2000505; Sat, 1 Sep 2012 11:24:03 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81BO36q000503; Sat, 1 Sep 2012 11:24:03 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209011124.q81BO36q000503@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 1 Sep 2012 11:24: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: r239990 - head/usr.bin/rctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 11:24:03 -0000 Author: trasz Date: Sat Sep 1 11:24:02 2012 New Revision: 239990 URL: http://svn.freebsd.org/changeset/base/239990 Log: Improve description for "rctl -l". MFC after: 2 weeks Modified: head/usr.bin/rctl/rctl.8 Modified: head/usr.bin/rctl/rctl.8 ============================================================================== --- head/usr.bin/rctl/rctl.8 Sat Sep 1 11:21:56 2012 (r239989) +++ head/usr.bin/rctl/rctl.8 Sat Sep 1 11:24:02 2012 (r239990) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2012 +.Dd September 1, 2012 .Dt RCTL 8 .Os .Sh NAME @@ -68,6 +68,10 @@ to the RCTL database. .It Fl l Ar filter Display rules applicable to the process defined by .Ar filter . +Note that this is different from showing the rules when called without +any options, as it shows not just the rules with subject equal to that +of process, but also rules for the user, jail, and login class applicable +to the process. .It Fl r Ar filter Remove rules matching .Ar filter @@ -90,7 +94,8 @@ Subject defines the kind of entity the r It can be either process, user, login class, or jail. .Pp Subject ID identifies the subject. -It can be user name, numerical user ID, login class name, or jail name. +It can be a process ID, user name, numerical user ID, login class name, +or jail name. .Pp Resource identifies the resource the rule controls. .Pp From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 14:45:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12A1D106566C; Sat, 1 Sep 2012 14:45:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E36FA8FC15; Sat, 1 Sep 2012 14:45: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 q81EjFDC025332; Sat, 1 Sep 2012 14:45:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81EjF2j025306; Sat, 1 Sep 2012 14:45:15 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201209011445.q81EjF2j025306@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Sep 2012 14:45: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: r239991 - in head: bin/date bin/dd lib/libc/rpc libexec/rbootd libexec/rpc.rstatd release/picobsd/tinyware/login sbin/adjkerntz usr.bin/lock usr.bin/mail usr.bin/systat usr.bin/time usr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 14:45:16 -0000 Author: ed Date: Sat Sep 1 14:45:15 2012 New Revision: 239991 URL: http://svn.freebsd.org/changeset/base/239991 Log: Rework all non-contributed files that use `struct timezone'. This structure is not part of POSIX. According to POSIX, gettimeofday() has the following prototype: int gettimeofday(struct timeval *restrict tp, void *restrict tzp); Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is not used). Remove dead error handling code. Also use NULL for a nul-pointer instead of integer 0. While there, change all pieces of code that only use tv_sec to use time(3), as this provides less overhead. Modified: head/bin/date/date.c head/bin/dd/dd.c head/bin/dd/misc.c head/lib/libc/rpc/auth_des.c head/lib/libc/rpc/svc_auth_des.c head/libexec/rbootd/rbootd.c head/libexec/rbootd/rmpproto.c head/libexec/rpc.rstatd/rstat_proc.c head/release/picobsd/tinyware/login/pico-login.c head/sbin/adjkerntz/adjkerntz.c head/usr.bin/lock/lock.c head/usr.bin/mail/util.c head/usr.bin/systat/ifstat.c head/usr.bin/time/time.c head/usr.sbin/cron/crontab/crontab.c head/usr.sbin/inetd/builtins.c head/usr.sbin/keyserv/keyserv.c head/usr.sbin/timed/timed/master.c head/usr.sbin/timed/timed/measure.c head/usr.sbin/timed/timed/readmsg.c head/usr.sbin/timed/timed/slave.c head/usr.sbin/timed/timed/timed.c head/usr.sbin/timed/timedc/cmds.c Modified: head/bin/date/date.c ============================================================================== --- head/bin/date/date.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/bin/date/date.c Sat Sep 1 14:45:15 2012 (r239991) @@ -137,7 +137,7 @@ main(int argc, char *argv[]) * If -d or -t, set the timezone or daylight savings time; this * doesn't belong here; the kernel should not know about either. */ - if (set_timezone && settimeofday((struct timeval *)NULL, &tz)) + if (set_timezone && settimeofday(NULL, &tz) != 0) err(1, "settimeofday (timezone)"); if (!rflag && time(&tval) == -1) @@ -273,14 +273,14 @@ setthetime(const char *fmt, const char * /* set the time */ if (nflag || netsettime(tval)) { utx.ut_type = OLD_TIME; - gettimeofday(&utx.ut_tv, NULL); + (void)gettimeofday(&utx.ut_tv, NULL); pututxline(&utx); tv.tv_sec = tval; tv.tv_usec = 0; - if (settimeofday(&tv, (struct timezone *)NULL)) + if (settimeofday(&tv, NULL) != 0) err(1, "settimeofday (timeval)"); utx.ut_type = NEW_TIME; - gettimeofday(&utx.ut_tv, NULL); + (void)gettimeofday(&utx.ut_tv, NULL); pututxline(&utx); } Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/bin/dd/dd.c Sat Sep 1 14:45:15 2012 (r239991) @@ -232,8 +232,8 @@ setup(void) ctab = casetab; } - (void)gettimeofday(&tv, (struct timezone *)NULL); - st.start = tv.tv_sec + tv.tv_usec * 1e-6; + (void)gettimeofday(&tv, NULL); + st.start = tv.tv_sec + tv.tv_usec * 1e-6; } static void Modified: head/bin/dd/misc.c ============================================================================== --- head/bin/dd/misc.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/bin/dd/misc.c Sat Sep 1 14:45:15 2012 (r239991) @@ -59,7 +59,7 @@ summary(void) double secs; char buf[100]; - (void)gettimeofday(&tv, (struct timezone *)NULL); + (void)gettimeofday(&tv, NULL); secs = tv.tv_sec + tv.tv_usec * 1e-6 - st.start; if (secs < 1e-6) secs = 1e-6; Modified: head/lib/libc/rpc/auth_des.c ============================================================================== --- head/lib/libc/rpc/auth_des.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/lib/libc/rpc/auth_des.c Sat Sep 1 14:45:15 2012 (r239991) @@ -286,7 +286,7 @@ authdes_marshal(AUTH *auth, XDR *xdrs) * Figure out the "time", accounting for any time difference * with the server if necessary. */ - (void) gettimeofday(&ad->ad_timestamp, (struct timezone *)NULL); + (void)gettimeofday(&ad->ad_timestamp, NULL); ad->ad_timestamp.tv_sec += ad->ad_timediff.tv_sec; ad->ad_timestamp.tv_usec += ad->ad_timediff.tv_usec; while (ad->ad_timestamp.tv_usec >= USEC_PER_SEC) { Modified: head/lib/libc/rpc/svc_auth_des.c ============================================================================== --- head/lib/libc/rpc/svc_auth_des.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/lib/libc/rpc/svc_auth_des.c Sat Sep 1 14:45:15 2012 (r239991) @@ -271,7 +271,7 @@ _svcauth_des(rqst, msg) debug("timestamp before last seen"); return (AUTH_REJECTEDVERF); /* replay */ } - (void) gettimeofday(¤t, (struct timezone *)NULL); + (void)gettimeofday(¤t, NULL); current.tv_sec -= window; /* allow for expiration */ if (!BEFORE(¤t, ×tamp)) { debug("timestamp expired"); Modified: head/libexec/rbootd/rbootd.c ============================================================================== --- head/libexec/rbootd/rbootd.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/libexec/rbootd/rbootd.c Sat Sep 1 14:45:15 2012 (r239991) @@ -310,16 +310,15 @@ void DoTimeout(void) { RMPCONN *rtmp; - struct timeval now; - - (void) gettimeofday(&now, (struct timezone *)0); + time_t now; /* * For each active connection, if RMP_TIMEOUT seconds have passed * since the last packet was sent, delete the connection. */ + now = time(NULL); for (rtmp = RmpConns; rtmp != NULL; rtmp = rtmp->next) - if ((rtmp->tstamp.tv_sec + RMP_TIMEOUT) < now.tv_sec) { + if ((rtmp->tstamp.tv_sec + RMP_TIMEOUT) < now) { syslog(LOG_WARNING, "%s: connection timed out (%u)", EnetStr(rtmp), rtmp->rmp.r_type); RemoveConn(rtmp); Modified: head/libexec/rbootd/rmpproto.c ============================================================================== --- head/libexec/rbootd/rmpproto.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/libexec/rbootd/rmpproto.c Sat Sep 1 14:45:15 2012 (r239991) @@ -575,7 +575,7 @@ SendPacket(RMPCONN *rconn) /* * Last time this connection was active. */ - (void) gettimeofday(&rconn->tstamp, (struct timezone *)0); + (void)gettimeofday(&rconn->tstamp, NULL); if (DbgFp != NULL) /* display packet */ DispPkt(rconn,DIR_SENT); Modified: head/libexec/rpc.rstatd/rstat_proc.c ============================================================================== --- head/libexec/rpc.rstatd/rstat_proc.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/libexec/rpc.rstatd/rstat_proc.c Sat Sep 1 14:45:15 2012 (r239991) @@ -244,7 +244,7 @@ updatestat(void) FETCH_CNT(stats_all.s1.v_pswpout, vm.v_swappgsout); FETCH_CNT(stats_all.s1.v_intr, sys.v_intr); FETCH_CNT(stats_all.s2.v_swtch, sys.v_swtch); - gettimeofday(&tm, (struct timezone *) 0); + (void)gettimeofday(&tm, NULL); stats_all.s1.v_intr -= hz*(tm.tv_sec - btm.tv_sec) + hz*(tm.tv_usec - btm.tv_usec)/1000000; @@ -287,8 +287,9 @@ updatestat(void) stats_all.s1.if_oerrors += ifmd.ifmd_data.ifi_oerrors; stats_all.s1.if_collisions += ifmd.ifmd_data.ifi_collisions; } - gettimeofday((struct timeval *)&stats_all.s3.curtime, - (struct timezone *) 0); + (void)gettimeofday(&tm, NULL); + stats_all.s3.curtime.tv_sec = tm.tv_sec; + stats_all.s3.curtime.tv_usec = tm.tv_usec; alarm(1); } Modified: head/release/picobsd/tinyware/login/pico-login.c ============================================================================== --- head/release/picobsd/tinyware/login/pico-login.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/release/picobsd/tinyware/login/pico-login.c Sat Sep 1 14:45:15 2012 (r239991) @@ -150,12 +150,11 @@ main(argc, argv) extern char **environ; struct group *gr; struct stat st; - struct timeval tp; struct utmpx utmp; int rootok, retries, backoff; int ask, ch, cnt, fflag, hflag, pflag, quietlog, rootlogin, rval; int changepass; - time_t warntime; + time_t now, warntime; uid_t uid, euid; gid_t egid; char *p, *ttyn; @@ -430,8 +429,7 @@ main(argc, argv) if (!quietlog) quietlog = access(_PATH_HUSHLOGIN, F_OK) == 0; - if (pwd->pw_change || pwd->pw_expire) - (void)gettimeofday(&tp, (struct timezone *)NULL); + now = time(NULL); #define DEFAULT_WARN (2L * 7L * 86400L) /* Two weeks */ @@ -439,10 +437,10 @@ main(argc, argv) DEFAULT_WARN); if (pwd->pw_expire) { - if (tp.tv_sec >= pwd->pw_expire) { + if (now >= pwd->pw_expire) { refused("Sorry -- your account has expired", "EXPIRED", 1); - } else if (pwd->pw_expire - tp.tv_sec < warntime && !quietlog) + } else if (pwd->pw_expire - now < warntime && !quietlog) (void)printf("Warning: your account expires on %s", ctime(&pwd->pw_expire)); } @@ -452,12 +450,12 @@ main(argc, argv) changepass = 0; if (pwd->pw_change) { - if (tp.tv_sec >= pwd->pw_change) { + if (now >= pwd->pw_change) { (void)printf("Sorry -- your password has expired.\n"); changepass = 1; syslog(LOG_INFO, "%s Password expired - forcing change", pwd->pw_name); - } else if (pwd->pw_change - tp.tv_sec < warntime && !quietlog) + } else if (pwd->pw_change - now < warntime && !quietlog) (void)printf("Warning: your password expires on %s", ctime(&pwd->pw_change)); } Modified: head/sbin/adjkerntz/adjkerntz.c ============================================================================== --- head/sbin/adjkerntz/adjkerntz.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/sbin/adjkerntz/adjkerntz.c Sat Sep 1 14:45:15 2012 (r239991) @@ -315,10 +315,7 @@ recalculate: * restoring disrtcset, since we don't clean up * anything. */ - if (gettimeofday(&tv, (struct timezone *)NULL)) { - syslog(LOG_ERR, "gettimeofday: %m"); - return 1; - } + (void)gettimeofday(&tv, NULL); tv.tv_sec += diff; stv = &tv; } Modified: head/usr.bin/lock/lock.c ============================================================================== --- head/usr.bin/lock/lock.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.bin/lock/lock.c Sat Sep 1 14:45:15 2012 (r239991) @@ -54,9 +54,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include + #include #include #include @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define TIMEOUT 15 @@ -89,10 +90,9 @@ int main(int argc, char **argv) { struct passwd *pw; - struct timeval timval; - time_t timval_sec; struct itimerval ntimer, otimer; struct tm *timp; + time_t timval; int ch, failures, sectimeout, usemine, vtylock; char *ap, *cryptpw, *mypw, *ttynam, *tzn; char hostname[MAXHOSTNAMELEN], s[BUFSIZ], s1[BUFSIZ]; @@ -138,11 +138,9 @@ main(int argc, char **argv) errx(1, "not a terminal?"); if (strncmp(ttynam, _PATH_DEV, strlen(_PATH_DEV)) == 0) ttynam += strlen(_PATH_DEV); - if (gettimeofday(&timval, (struct timezone *)NULL)) - err(1, "gettimeofday"); - nexttime = timval.tv_sec + (sectimeout * 60); - timval_sec = timval.tv_sec; - timp = localtime(&timval_sec); + timval = time(NULL); + nexttime = timval + (sectimeout * 60); + timp = localtime(&timval); ap = asctime(timp); tzn = timp->tm_zone; @@ -256,17 +254,16 @@ usage(void) static void hi(int signo __unused) { - struct timeval timval; + time_t timval; - if (!gettimeofday(&timval, (struct timezone *)NULL)) { - (void)printf("lock: type in the unlock key. "); - if (no_timeout) { - (void)putchar('\n'); - } else { - (void)printf("timeout in %jd:%jd minutes\n", - (intmax_t)(nexttime - timval.tv_sec) / 60, - (intmax_t)(nexttime - timval.tv_sec) % 60); - } + timval = time(NULL); + (void)printf("lock: type in the unlock key. "); + if (no_timeout) { + (void)putchar('\n'); + } else { + (void)printf("timeout in %jd:%jd minutes\n", + (intmax_t)(nexttime - timval) / 60, + (intmax_t)(nexttime - timval) % 60); } } Modified: head/usr.bin/mail/util.c ============================================================================== --- head/usr.bin/mail/util.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.bin/mail/util.c Sat Sep 1 14:45:15 2012 (r239991) @@ -324,7 +324,7 @@ alter(char *name) if (stat(name, &sb)) return; - (void)gettimeofday(&tv[0], (struct timezone *)NULL); + (void)gettimeofday(&tv[0], NULL); tv[0].tv_sec++; TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtim); (void)utimes(name, tv); Modified: head/usr.bin/systat/ifstat.c ============================================================================== --- head/usr.bin/systat/ifstat.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.bin/systat/ifstat.c Sat Sep 1 14:45:15 2012 (r239991) @@ -247,8 +247,7 @@ fetchifstat(void) old_outb = ifp->if_mib.ifmd_data.ifi_obytes; ifp->tv_lastchanged = ifp->if_mib.ifmd_data.ifi_lastchange; - if (gettimeofday(&new_tv, (struct timezone *)0) != 0) - IFSTAT_ERR(2, "error getting time of day"); + (void)gettimeofday(&new_tv, NULL); (void)getifmibdata(ifp->if_row, &ifp->if_mib); new_inb = ifp->if_mib.ifmd_data.ifi_ibytes; Modified: head/usr.bin/time/time.c ============================================================================== --- head/usr.bin/time/time.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.bin/time/time.c Sat Sep 1 14:45:15 2012 (r239991) @@ -117,7 +117,7 @@ main(int argc, char **argv) setvbuf(out, (char *)NULL, _IONBF, (size_t)0); } - gettimeofday(&before_tv, (struct timezone *)NULL); + (void)gettimeofday(&before_tv, NULL); switch(pid = fork()) { case -1: /* error */ err(1, "time"); @@ -134,7 +134,7 @@ main(int argc, char **argv) (void)signal(SIGQUIT, SIG_IGN); (void)signal(SIGINFO, siginfo); while (wait4(pid, &status, 0, &ru) != pid); - gettimeofday(&after, (struct timezone *)NULL); + (void)gettimeofday(&after, NULL); if ( ! WIFEXITED(status)) warnx("command terminated abnormally"); exitonsig = WIFSIGNALED(status) ? WTERMSIG(status) : 0; @@ -297,7 +297,7 @@ siginfo(int sig __unused) struct timeval after; struct rusage ru; - gettimeofday(&after, (struct timezone *)NULL); + (void)gettimeofday(&after, NULL); getrusage(RUSAGE_CHILDREN, &ru); showtime(stdout, &before_tv, &after, &ru); } Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/cron/crontab/crontab.c Sat Sep 1 14:45:15 2012 (r239991) @@ -627,9 +627,8 @@ static void poke_daemon() { #ifdef USE_UTIMES struct timeval tvs[2]; - struct timezone tz; - (void) gettimeofday(&tvs[0], &tz); + (void)gettimeofday(&tvs[0], NULL); tvs[1] = tvs[0]; if (utimes(SPOOL_DIR, tvs) < OK) { warn("can't update mtime on spooldir %s", SPOOL_DIR); Modified: head/usr.sbin/inetd/builtins.c ============================================================================== --- head/usr.sbin/inetd/builtins.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/inetd/builtins.c Sat Sep 1 14:45:15 2012 (r239991) @@ -691,15 +691,9 @@ printit: uint32_t machtime(void) { - struct timeval tv; - if (gettimeofday(&tv, (struct timezone *)NULL) < 0) { - if (debug) - warnx("unable to get time of day"); - return (0L); - } #define OFFSET ((uint32_t)25567 * 24*60*60) - return (htonl((uint32_t)(tv.tv_sec + OFFSET))); + return (htonl((uint32_t)(time(NULL) + OFFSET))); #undef OFFSET } Modified: head/usr.sbin/keyserv/keyserv.c ============================================================================== --- head/usr.sbin/keyserv/keyserv.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/keyserv/keyserv.c Sat Sep 1 14:45:15 2012 (r239991) @@ -232,7 +232,7 @@ randomize(master) seed = 0; for (i = 0; i < 1024; i++) { - (void) gettimeofday(&tv, (struct timezone *) NULL); + (void)gettimeofday(&tv, NULL); shift = i % 8 * sizeof (int); seed ^= (tv.tv_usec << shift) | (tv.tv_usec >> (32 - shift)); } @@ -575,7 +575,7 @@ key_gen_1_svc_prog(v, s) static des_block keygen; static des_block key; - (void) gettimeofday(&time, (struct timezone *) NULL); + (void)gettimeofday(&time, NULL); keygen.key.high += (time.tv_sec ^ time.tv_usec); keygen.key.low += (time.tv_sec ^ time.tv_usec); ecb_crypt((char *)&masterkey, (char *)&keygen, sizeof (keygen), Modified: head/usr.sbin/timed/timed/master.c ============================================================================== --- head/usr.sbin/timed/timed/master.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/timed/timed/master.c Sat Sep 1 14:45:15 2012 (r239991) @@ -85,7 +85,7 @@ master() if (ntp->status == MASTER) masterup(ntp); } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); pollingtime = ntime.tv_sec+3; if (justquit) polls = 0; @@ -96,14 +96,14 @@ master() * to update all timers. */ loop: - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); wait.tv_sec = pollingtime - ntime.tv_sec; if (wait.tv_sec < 0) wait.tv_sec = 0; wait.tv_usec = 0; msg = readmsg(TSP_ANY, ANYADDR, &wait, 0); if (!msg) { - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); if (ntime.tv_sec >= pollingtime) { pollingtime = ntime.tv_sec + SAMPLEINTVL; get_goodgroup(0); @@ -175,7 +175,7 @@ loop: } mchgdate(msg); - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); pollingtime = ntime.tv_sec + SAMPLEINTVL; break; @@ -203,7 +203,7 @@ loop: } mchgdate(msg); - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); pollingtime = ntime.tv_sec + SAMPLEINTVL; break; @@ -284,7 +284,7 @@ loop: * do not want to call synch() while waiting * to be killed! */ - (void)gettimeofday(&ntime, (struct timezone *)0); + (void)gettimeofday(&ntime, NULL); pollingtime = ntime.tv_sec + SAMPLEINTVL; break; @@ -354,7 +354,7 @@ mchgdate(msg) (void)strcpy(olddate, date()); /* adjust time for residence on the queue */ - (void)gettimeofday(&otime, 0); + (void)gettimeofday(&otime, NULL); adj_msg_time(msg,&otime); tmptv.tv_sec = msg->tsp_time.tv_sec; @@ -368,11 +368,11 @@ mchgdate(msg) synch(tvtomsround(ntime)); } else { utx.ut_type = OLD_TIME; - gettimeofday(&utx.ut_tv, NULL); + (void)gettimeofday(&utx.ut_tv, NULL); pututxline(&utx); (void)settimeofday(&tmptv, 0); utx.ut_type = NEW_TIME; - gettimeofday(&utx.ut_tv, NULL); + (void)gettimeofday(&utx.ut_tv, NULL); pututxline(&utx); spreadtime(); } @@ -396,7 +396,7 @@ synch(mydelta) if (slvcount > 0) { if (trace) fprintf(fd, "measurements starting at %s\n", date()); - (void)gettimeofday(&check, 0); + (void)gettimeofday(&check, NULL); for (htp = self.l_fwd; htp != &self; htp = htp->l_fwd) { if (htp->noanswer != 0) { measure_status = measure(500, 100, @@ -424,7 +424,7 @@ synch(mydelta) } else { htp->delta = measure_delta; } - (void)gettimeofday(&stop, 0); + (void)gettimeofday(&stop, NULL); timevalsub(&stop, &stop, &check); if (stop.tv_sec >= 1) { if (trace) @@ -437,7 +437,7 @@ synch(mydelta) if (0 != readmsg(TSP_TRACEON,ANYADDR, &wait,0)) traceon(); - (void)gettimeofday(&check, 0); + (void)gettimeofday(&check, NULL); } } if (trace) @@ -474,7 +474,7 @@ spreadtime() for (htp = self.l_fwd; htp != &self; htp = htp->l_fwd) { to.tsp_type = TSP_SETTIME; (void)strcpy(to.tsp_name, hostname); - (void)gettimeofday(&tmptv, 0); + (void)gettimeofday(&tmptv, NULL); to.tsp_time.tv_sec = tmptv.tv_sec; to.tsp_time.tv_usec = tmptv.tv_usec; answer = acksend(&to, &htp->addr, htp->name, @@ -732,7 +732,7 @@ masterup(net) * we do not tell them to start using our time, before we have * found a good master. */ - (void)gettimeofday(&net->slvwait, 0); + (void)gettimeofday(&net->slvwait, NULL); } void @@ -755,12 +755,12 @@ newslave(msg) * If we are stable, send our time to the slave. * Do not go crazy if the date has been changed. */ - (void)gettimeofday(&now, 0); + (void)gettimeofday(&now, NULL); if (now.tv_sec >= fromnet->slvwait.tv_sec+3 || now.tv_sec < fromnet->slvwait.tv_sec) { to.tsp_type = TSP_SETTIME; (void)strcpy(to.tsp_name, hostname); - (void)gettimeofday(&tmptv, 0); + (void)gettimeofday(&tmptv, NULL); to.tsp_time.tv_sec = tmptv.tv_sec; to.tsp_time.tv_usec = tmptv.tv_usec; answer = acksend(&to, &htp->addr, Modified: head/usr.sbin/timed/timed/measure.c ============================================================================== --- head/usr.sbin/timed/timed/measure.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/timed/timed/measure.c Sat Sep 1 14:45:15 2012 (r239991) @@ -128,7 +128,7 @@ measure(maxmsec, wmsec, hname, addr, pri FD_ZERO(&ready); - (void)gettimeofday(&tdone, 0); + (void)gettimeofday(&tdone, NULL); mstotvround(&tout, maxmsec); timevaladd(&tdone, &tout); /* when we give up */ @@ -136,7 +136,7 @@ measure(maxmsec, wmsec, hname, addr, pri rcvcount = 0; while (rcvcount < MSGS) { - (void)gettimeofday(&tcur, 0); + (void)gettimeofday(&tcur, NULL); /* * keep sending until we have sent the max @@ -173,7 +173,7 @@ measure(maxmsec, wmsec, hname, addr, pri FD_SET(sock_raw, &ready); count = select(sock_raw+1, &ready, (fd_set *)0, (fd_set *)0, &tout); - (void)gettimeofday(&tcur, (struct timezone *)0); + (void)gettimeofday(&tcur, NULL); if (count <= 0) break; Modified: head/usr.sbin/timed/timed/readmsg.c ============================================================================== --- head/usr.sbin/timed/timed/readmsg.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/timed/timed/readmsg.c Sat Sep 1 14:45:15 2012 (r239991) @@ -168,11 +168,11 @@ again: * right one, return it, otherwise insert it in the linked list. */ - (void)gettimeofday(&rtout, 0); + (void)gettimeofday(&rtout, NULL); timevaladd(&rtout, intvl); FD_ZERO(&ready); for (;;) { - (void)gettimeofday(&rtime, 0); + (void)gettimeofday(&rtime, NULL); timevalsub(&rwait, &rtout, &rtime); if (rwait.tv_sec < 0) rwait.tv_sec = rwait.tv_usec = 0; @@ -219,7 +219,7 @@ again: inet_ntoa(from.sin_addr)); continue; } - (void)gettimeofday(&from_when, (struct timezone *)0); + (void)gettimeofday(&from_when, NULL); bytehostorder(&msgin); if (msgin.tsp_vers > TSPVERSION) { Modified: head/usr.sbin/timed/timed/slave.c ============================================================================== --- head/usr.sbin/timed/timed/slave.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/timed/timed/slave.c Sat Sep 1 14:45:15 2012 (r239991) @@ -83,7 +83,7 @@ slave() refusetime = 0; adjtime = 0; - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); electiontime = ntime.tv_sec + delay2; fastelection = ntime.tv_sec + FASTTOUT; if (justquit) @@ -103,7 +103,7 @@ slave() loop: get_goodgroup(0); - (void)gettimeofday(&ntime, (struct timezone *)0); + (void)gettimeofday(&ntime, NULL); if (ntime.tv_sec > electiontime) { if (trace) fprintf(fd, "election timer expired\n"); @@ -132,7 +132,7 @@ loop: makeslave(slavenet); /* prune extras */ setstatus(); } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); looktime = ntime.tv_sec + delay2; } if (ntime.tv_sec >= looptime) { @@ -153,7 +153,7 @@ loop: } } } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); looptime = ntime.tv_sec + delay2; } @@ -225,7 +225,7 @@ loop: * Otherwise the clocks can race until the loop * is found. */ - (void)gettimeofday(&otime, 0); + (void)gettimeofday(&otime, NULL); if (adjtime < otime.tv_sec) looptime -= (looptime-otime.tv_sec)/2 + 1; @@ -234,7 +234,7 @@ loop: seq = msg->tsp_seq; synch(tvtomsround(msg->tsp_time)); } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); electiontime = ntime.tv_sec + delay2; fastelection = ntime.tv_sec + FASTTOUT; adjtime = ntime.tv_sec + SAMPLEINTVL*2; @@ -248,7 +248,7 @@ loop: seq = msg->tsp_seq; /* adjust time for residence on the queue */ - (void)gettimeofday(&otime, 0); + (void)gettimeofday(&otime, NULL); adj_msg_time(msg,&otime); /* * the following line is necessary due to syslog @@ -289,7 +289,7 @@ loop: if (status & MASTER) spreadtime(); } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); electiontime = ntime.tv_sec + delay2; fastelection = ntime.tv_sec + FASTTOUT; @@ -327,7 +327,7 @@ loop: setstatus(); answerdelay(); xmit(TSP_SLAVEUP, 0, &from); - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); electiontime = ntime.tv_sec + delay2; fastelection = ntime.tv_sec + FASTTOUT; refusetime = 0; @@ -336,7 +336,7 @@ loop: case TSP_MASTERREQ: if (fromnet->status != SLAVE) break; - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); electiontime = ntime.tv_sec + delay2; break; @@ -381,7 +381,7 @@ loop: case TSP_ELECTION: if (fromnet->status == SLAVE) { - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); electiontime = ntime.tv_sec + delay2; fastelection = ntime.tv_sec + FASTTOUT; seq = 0; @@ -538,7 +538,7 @@ loop: electiontime = 0; } } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); looptime = ntime.tv_sec + FASTTOUT; } else { if (msg->tsp_hopcnt-- < 1) @@ -590,7 +590,7 @@ loop: (void)remmach(htp); } } - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); looptime = ntime.tv_sec + FASTTOUT; } break; @@ -660,7 +660,7 @@ schgdate(msg, newdate) msg->tsp_name, newdate); /* adjust time for residence on the queue */ - (void)gettimeofday(&otime, 0); + (void)gettimeofday(&otime, NULL); adj_msg_time(msg, &otime); to.tsp_type = TSP_SETDATEREQ; Modified: head/usr.sbin/timed/timed/timed.c ============================================================================== --- head/usr.sbin/timed/timed/timed.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/timed/timed/timed.c Sat Sep 1 14:45:15 2012 (r239991) @@ -232,7 +232,7 @@ main(argc, argv) } /* choose a unique seed for random number generation */ - (void)gettimeofday(&ntime, 0); + (void)gettimeofday(&ntime, NULL); srandom(ntime.tv_sec + ntime.tv_usec); sequence = random(); /* initial seq number */ @@ -701,11 +701,9 @@ casual(inf, sup) char * date() { - struct timeval tv; time_t tv_sec; - (void)gettimeofday(&tv, (struct timezone *)0); - tv_sec = tv.tv_sec; + tv_sec = time(NULL); return (ctime(&tv_sec)); } Modified: head/usr.sbin/timed/timedc/cmds.c ============================================================================== --- head/usr.sbin/timed/timedc/cmds.c Sat Sep 1 11:24:02 2012 (r239990) +++ head/usr.sbin/timed/timedc/cmds.c Sat Sep 1 14:45:15 2012 (r239991) @@ -131,7 +131,7 @@ daydiff(hostname) } sec -= BU; - (void)gettimeofday(&now, (struct timezone*)0); + (void)gettimeofday(&now, NULL); return (sec - now.tv_sec); } } From owner-svn-src-head@FreeBSD.ORG Sat Sep 1 23:33:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04828106566B; Sat, 1 Sep 2012 23:33:50 +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 E2D168FC0A; Sat, 1 Sep 2012 23:33: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 q81NXnTH099698; Sat, 1 Sep 2012 23:33:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q81NXnas099696; Sat, 1 Sep 2012 23:33:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209012333.q81NXnas099696@svn.freebsd.org> From: Eitan Adler Date: Sat, 1 Sep 2012 23:33: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: r239997 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2012 23:33:50 -0000 Author: eadler Date: Sat Sep 1 23:33:49 2012 New Revision: 239997 URL: http://svn.freebsd.org/changeset/base/239997 Log: Mark the ipfw interface type as not being ether. This fixes an issue where uuidgen tried to obtain a ipfw device's mac address which was always zero. PR: 170460 Submitted by: wxs Reviewed by: bdrewery Reviewed by: delphij Approved by: cperciva MFC after: 1 week Modified: head/sys/netinet/ipfw/ip_fw_log.c Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Sat Sep 1 15:59:09 2012 (r239996) +++ head/sys/netinet/ipfw/ip_fw_log.c Sat Sep 1 23:33:49 2012 (r239997) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* for IFT_ETHER */ +#include /* for IFT_PFLOG */ #include /* for BPF */ #include @@ -151,7 +151,7 @@ ipfw_log_clone_create(struct if_clone *i if (error) return (error); - ifp = if_alloc(IFT_ETHER); + ifp = if_alloc(IFT_PFLOG); if (ifp == NULL) { ifc_free_unit(ifc, unit); return (ENOSPC);